@spiffcommerce/core 33.13.0 → 33.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +75 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +476 -495
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as
|
|
2
|
-
import { setContext as
|
|
1
|
+
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as Di, gql as C } from "@apollo/client/core";
|
|
2
|
+
import { setContext as Fi } from "@apollo/client/link/context";
|
|
3
3
|
import { onError as xi } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as ki } from "preact-render-to-string";
|
|
5
5
|
import { removeTypenameFromVariables as Mi } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as Ti } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as yn } from "css";
|
|
8
8
|
import Ni from "fuse.js";
|
|
9
|
-
import { Pith as
|
|
9
|
+
import { Pith as va } from "pith";
|
|
10
10
|
import It from "lodash.clonedeep";
|
|
11
11
|
import Jt from "lodash.isequal";
|
|
12
12
|
import { jsx as P, jsxs as dt, Fragment as qt } from "preact/jsx-runtime";
|
|
13
|
-
import { parse as
|
|
13
|
+
import { parse as la } from "opentype.js";
|
|
14
14
|
import Qi from "handlebars";
|
|
15
15
|
import { dataUriToBuffer as Ri } from "data-uri-to-buffer";
|
|
16
16
|
import { toString as Sn } from "qrcode";
|
|
17
|
-
import { split as
|
|
17
|
+
import { split as ca } from "unicode-default-word-boundary";
|
|
18
18
|
import Oi from "svg-path-bbox";
|
|
19
|
-
import
|
|
20
|
-
import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as
|
|
19
|
+
import La from "lodash.chunk";
|
|
20
|
+
import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as Va, RespondToAuthChallengeCommand as Ui } from "@aws-sdk/client-cognito-identity-provider";
|
|
21
21
|
import Li from "dinero.js";
|
|
22
|
-
import * as
|
|
22
|
+
import * as za from "currency-codes";
|
|
23
23
|
import vn from "lodash.debounce";
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Vi from "lodash.omit";
|
|
27
|
-
var
|
|
27
|
+
var Ie = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ie || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), zi = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(zi || {}), Kt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Kt || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Gi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Gi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Wi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Wi || {}), qi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(qi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Hi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Hi || {}), Be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Be || {}), Tt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Tt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), ji = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(ji || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -35,7 +35,7 @@ class ae extends In {
|
|
|
35
35
|
super(`ConfigurationError - ${t}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class Pe extends ae {
|
|
39
39
|
constructor(t) {
|
|
40
40
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
|
41
41
|
}
|
|
@@ -55,32 +55,32 @@ class _t extends ae {
|
|
|
55
55
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
58
|
+
class De extends ae {
|
|
59
59
|
constructor(t, e) {
|
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class Qe extends In {
|
|
64
64
|
constructor(t) {
|
|
65
65
|
super(`ImplementationError - ${t}`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
class R extends
|
|
68
|
+
class R extends Qe {
|
|
69
69
|
constructor(t) {
|
|
70
70
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
class
|
|
73
|
+
class Ft extends Qe {
|
|
74
74
|
constructor(t) {
|
|
75
75
|
super(`Parsing Error: ${t}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
class gt extends
|
|
78
|
+
class gt extends Qe {
|
|
79
79
|
constructor(t) {
|
|
80
80
|
super(`Client Error: ${t}`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
class
|
|
83
|
+
class Re extends Qe {
|
|
84
84
|
constructor(t) {
|
|
85
85
|
super(`Resource Generation Failed: ${t}`);
|
|
86
86
|
}
|
|
@@ -105,7 +105,7 @@ class Yi {
|
|
|
105
105
|
this.set(t, a);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
class
|
|
108
|
+
class Ga {
|
|
109
109
|
constructor() {
|
|
110
110
|
this.storage = /* @__PURE__ */ new Map();
|
|
111
111
|
}
|
|
@@ -130,9 +130,9 @@ class Wa {
|
|
|
130
130
|
}
|
|
131
131
|
const Ji = () => {
|
|
132
132
|
try {
|
|
133
|
-
return localStorage ? new Yi() : new
|
|
133
|
+
return localStorage ? new Yi() : new Ga();
|
|
134
134
|
} catch {
|
|
135
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
|
135
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ga();
|
|
136
136
|
}
|
|
137
137
|
}, k = Ji();
|
|
138
138
|
class Ki {
|
|
@@ -162,42 +162,42 @@ class Ki {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
const ft = new Ki();
|
|
165
|
-
let
|
|
165
|
+
let da, Aa;
|
|
166
166
|
function id(n) {
|
|
167
|
-
|
|
167
|
+
da = n;
|
|
168
168
|
}
|
|
169
169
|
function rd(n) {
|
|
170
|
-
|
|
170
|
+
Aa = n;
|
|
171
171
|
}
|
|
172
172
|
function ne() {
|
|
173
|
-
return
|
|
173
|
+
return da ? new da().window : (console.log(
|
|
174
174
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
|
175
175
|
), window);
|
|
176
176
|
}
|
|
177
177
|
function it(n, t) {
|
|
178
|
-
if (!
|
|
178
|
+
if (!Aa) {
|
|
179
179
|
if (typeof window < "u" && window.fetch)
|
|
180
180
|
return window.fetch(n, t);
|
|
181
181
|
if (typeof global < "u" && global.fetch)
|
|
182
182
|
return global.fetch(n, t);
|
|
183
183
|
throw new Error("Fetch implementation is not registered. Please register it before calling this function.");
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return Aa(n, t);
|
|
186
186
|
}
|
|
187
|
-
const Bn = /* @__PURE__ */ new Map(),
|
|
188
|
-
const t =
|
|
187
|
+
const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Pn = async (n) => {
|
|
188
|
+
const t = Wa.get(n);
|
|
189
189
|
if (t) return t;
|
|
190
190
|
const a = (async () => {
|
|
191
191
|
const i = await it(n);
|
|
192
192
|
return Bn.set(n, i.headers?.get("content-type") || ""), await i.arrayBuffer();
|
|
193
193
|
})();
|
|
194
|
-
return
|
|
194
|
+
return Wa.set(n, a), a;
|
|
195
195
|
}, _i = async (n) => {
|
|
196
|
-
const t =
|
|
196
|
+
const t = qa.get(n);
|
|
197
197
|
if (t) return t;
|
|
198
198
|
const a = (async () => await (await it(n)).text())();
|
|
199
|
-
return
|
|
200
|
-
}, Nt = (n) => n.every((t) => t !== "undefined"),
|
|
199
|
+
return qa.set(n, a), a;
|
|
200
|
+
}, Nt = (n) => n.every((t) => t !== "undefined"), de = (n) => Nt([typeof document]) ? document.createElement(n) : ne().document.createElement(n), Xi = (n, t) => {
|
|
201
201
|
if (Nt([typeof document]))
|
|
202
202
|
return document.createElementNS(n, t);
|
|
203
203
|
const a = ne().document.createElement(t);
|
|
@@ -207,7 +207,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
207
207
|
return new DOMParser();
|
|
208
208
|
const n = ne();
|
|
209
209
|
return new n.DOMParser();
|
|
210
|
-
}, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser,
|
|
210
|
+
}, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser, Oe = (n, t) => new Promise((e, a) => {
|
|
211
211
|
t ? Pn(n).then(e).catch(a) : it(n).then((i) => {
|
|
212
212
|
i.arrayBuffer().then(e).catch(a);
|
|
213
213
|
}).catch((i) => {
|
|
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
217
217
|
t ? _i(n).then(e).catch(a) : it(n).then((i) => {
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
|
-
}),
|
|
220
|
+
}), Dn = (n) => ki(n), je = /* @__PURE__ */ new Map(), tr = async (n, t) => {
|
|
221
221
|
if (Nt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
@@ -231,7 +231,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
231
231
|
return new XMLSerializer();
|
|
232
232
|
const n = ne();
|
|
233
233
|
return new n.XMLSerializer();
|
|
234
|
-
},
|
|
234
|
+
}, Ha = (n) => btoa(n), $e = (n) => {
|
|
235
235
|
function t() {
|
|
236
236
|
const a = new Uint8Array(n), i = 4;
|
|
237
237
|
if (a.length >= i) {
|
|
@@ -258,7 +258,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
258
258
|
const e = t();
|
|
259
259
|
return e || "image/svg+xml";
|
|
260
260
|
}, od = async (n) => {
|
|
261
|
-
const t = await Pn(n), e = Bn.get(n) ||
|
|
261
|
+
const t = await Pn(n), e = Bn.get(n) || $e(t);
|
|
262
262
|
return await nr(new Blob([t], { type: e }));
|
|
263
263
|
}, er = (n) => {
|
|
264
264
|
let t = "";
|
|
@@ -267,9 +267,9 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
267
267
|
t += String.fromCharCode(n[a]);
|
|
268
268
|
return t;
|
|
269
269
|
}, ar = async (n) => {
|
|
270
|
-
const t =
|
|
270
|
+
const t = $e(n), e = new Uint8Array(n), a = er(e), i = btoa(a);
|
|
271
271
|
return `data:${t};base64,${i}`;
|
|
272
|
-
},
|
|
272
|
+
}, ba = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Fn = (n) => {
|
|
273
273
|
const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
|
274
274
|
if (e === -1 || e <= 4)
|
|
275
275
|
throw new TypeError("malformed data: URI");
|
|
@@ -288,10 +288,10 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
288
288
|
!r || !r.result ? e() : t(r.result.toString());
|
|
289
289
|
}, a.readAsDataURL(n);
|
|
290
290
|
});
|
|
291
|
-
let ir,
|
|
291
|
+
let ir, Ia;
|
|
292
292
|
const rr = (n) => {
|
|
293
|
-
|
|
294
|
-
}, or = () =>
|
|
293
|
+
Ia = n;
|
|
294
|
+
}, or = () => Ia;
|
|
295
295
|
let xn;
|
|
296
296
|
const sr = (n) => {
|
|
297
297
|
xn = n;
|
|
@@ -302,7 +302,7 @@ const sr = (n) => {
|
|
|
302
302
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
303
303
|
}), cr = async () => {
|
|
304
304
|
const n = {
|
|
305
|
-
applicationKey:
|
|
305
|
+
applicationKey: Ia,
|
|
306
306
|
customerToken: ir,
|
|
307
307
|
bearer: xn
|
|
308
308
|
};
|
|
@@ -329,7 +329,7 @@ class Ar {
|
|
|
329
329
|
const t = Ii({
|
|
330
330
|
uri: `${ft.getServerUrl()}/graphql`,
|
|
331
331
|
fetch: dr
|
|
332
|
-
}), e =
|
|
332
|
+
}), e = Fi(async (r, o) => {
|
|
333
333
|
const { headers: s } = o, l = s || {}, c = await cr();
|
|
334
334
|
let d = o.bearer ?? c.bearer;
|
|
335
335
|
if (this.spiffClient)
|
|
@@ -358,17 +358,17 @@ class Ar {
|
|
|
358
358
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
359
359
|
}), i = Mi();
|
|
360
360
|
return new Bi({
|
|
361
|
-
link:
|
|
361
|
+
link: Di([i, a, e, t]),
|
|
362
362
|
cache: new Pi(),
|
|
363
363
|
name: "Core"
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
const y = new Ar();
|
|
368
|
-
let
|
|
368
|
+
let ua, ha;
|
|
369
369
|
const Ct = (n, t, e) => {
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
370
|
+
if (ua !== void 0)
|
|
371
|
+
return ua(n, t, e);
|
|
372
372
|
try {
|
|
373
373
|
const a = Mn(!0);
|
|
374
374
|
return kn(a), a.createCanvas(n, t, e);
|
|
@@ -376,8 +376,8 @@ const Ct = (n, t, e) => {
|
|
|
376
376
|
throw new Error("Canvas module not set");
|
|
377
377
|
}
|
|
378
378
|
}, ie = (n, t) => {
|
|
379
|
-
if (
|
|
380
|
-
return
|
|
379
|
+
if (ha !== void 0)
|
|
380
|
+
return ha(n, t);
|
|
381
381
|
try {
|
|
382
382
|
const e = Mn(!0);
|
|
383
383
|
return kn(e), e.loadImage(n, t);
|
|
@@ -386,7 +386,7 @@ const Ct = (n, t, e) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
function kn(n) {
|
|
389
|
-
|
|
389
|
+
ua = n?.createCanvas, ha = n?.loadImage;
|
|
390
390
|
}
|
|
391
391
|
function Mn(n) {
|
|
392
392
|
try {
|
|
@@ -408,19 +408,19 @@ function Mn(n) {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
let Ye;
|
|
411
|
-
function
|
|
411
|
+
function Ba() {
|
|
412
412
|
return Ye === void 0 && (Ye = Zi()), Ye;
|
|
413
413
|
}
|
|
414
|
-
let
|
|
414
|
+
let Ae = null;
|
|
415
415
|
const ur = (n) => new Promise((t) => {
|
|
416
|
-
if (
|
|
416
|
+
if ($e(n) !== "image/jpeg")
|
|
417
417
|
return t(1);
|
|
418
418
|
Ti(n).then((a) => t(a || 1)).catch(() => t(1));
|
|
419
419
|
}), hr = async () => {
|
|
420
|
-
if (
|
|
421
|
-
return !
|
|
420
|
+
if (Ae !== null)
|
|
421
|
+
return !Ae;
|
|
422
422
|
const t = await ie("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
|
423
|
-
return
|
|
423
|
+
return Ae = t.width === 2 && t.height === 3, !Ae;
|
|
424
424
|
}, mr = (n) => {
|
|
425
425
|
const e = n.naturalWidth / n.naturalHeight;
|
|
426
426
|
return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
|
@@ -455,9 +455,9 @@ const ur = (n) => new Promise((t) => {
|
|
|
455
455
|
break;
|
|
456
456
|
}
|
|
457
457
|
return d.drawImage(e, 0, 0, s, l), c;
|
|
458
|
-
},
|
|
458
|
+
}, Ue = async (n) => {
|
|
459
459
|
const t = await gr(n);
|
|
460
|
-
return
|
|
460
|
+
return $e(n) === "image/jpeg" ? {
|
|
461
461
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
|
462
462
|
height: t.height,
|
|
463
463
|
width: t.width
|
|
@@ -3188,20 +3188,20 @@ function cd(n, t) {
|
|
|
3188
3188
|
let Ot = null;
|
|
3189
3189
|
function wr(n) {
|
|
3190
3190
|
if (n.startsWith("#"))
|
|
3191
|
-
return
|
|
3191
|
+
return ja(n);
|
|
3192
3192
|
if (!document)
|
|
3193
3193
|
throw new Error("browserColorToHex is only supported on browsers");
|
|
3194
3194
|
if (Ot || (Ot = document.createElement("canvas").getContext("2d")), !Ot)
|
|
3195
3195
|
throw new Error("Failed to create canvas context required to convert colors");
|
|
3196
3196
|
Ot.fillStyle = n;
|
|
3197
|
-
const t =
|
|
3197
|
+
const t = ja(Ot.fillStyle);
|
|
3198
3198
|
return t || console.error(`Unknown browser color ${n}`), t;
|
|
3199
3199
|
}
|
|
3200
|
-
function
|
|
3200
|
+
function ja(n) {
|
|
3201
3201
|
const t = n.substring(1).toUpperCase();
|
|
3202
3202
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
|
3203
3203
|
}
|
|
3204
|
-
const
|
|
3204
|
+
const ue = (n) => {
|
|
3205
3205
|
const t = Tn(n.spotColor);
|
|
3206
3206
|
return t ? `${n.browserValue} ${t}` : n.browserValue;
|
|
3207
3207
|
}, Tn = (n) => {
|
|
@@ -3212,7 +3212,7 @@ const me = (n) => {
|
|
|
3212
3212
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${n.namedColor})`;
|
|
3213
3213
|
}
|
|
3214
3214
|
return `icc-named-color(${n.profileName}, ${n.namedColor})`;
|
|
3215
|
-
},
|
|
3215
|
+
}, Ya = (n) => {
|
|
3216
3216
|
const t = n.split(/[ ](?=[^)]*?(?:\(|$))/);
|
|
3217
3217
|
if (t.length === 0)
|
|
3218
3218
|
return { browserValue: "#000000" };
|
|
@@ -3234,7 +3234,7 @@ const me = (n) => {
|
|
|
3234
3234
|
} catch {
|
|
3235
3235
|
return n.classList.contains(t.substring(1));
|
|
3236
3236
|
}
|
|
3237
|
-
},
|
|
3237
|
+
}, Pa = (n, t = !1) => {
|
|
3238
3238
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3239
3239
|
const e = [];
|
|
3240
3240
|
Mt(n, (a) => {
|
|
@@ -3287,13 +3287,13 @@ const me = (n) => {
|
|
|
3287
3287
|
if (s)
|
|
3288
3288
|
a.setAttribute(
|
|
3289
3289
|
"fill",
|
|
3290
|
-
e ?
|
|
3290
|
+
e ? ue(s) : s.browserValue
|
|
3291
3291
|
);
|
|
3292
3292
|
else {
|
|
3293
3293
|
const l = t[o];
|
|
3294
3294
|
l && a.setAttribute(
|
|
3295
3295
|
"fill",
|
|
3296
|
-
e ?
|
|
3296
|
+
e ? ue(l) : l.browserValue
|
|
3297
3297
|
);
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
@@ -3305,13 +3305,13 @@ const me = (n) => {
|
|
|
3305
3305
|
if (s)
|
|
3306
3306
|
a.setAttribute(
|
|
3307
3307
|
"stroke",
|
|
3308
|
-
e ?
|
|
3308
|
+
e ? ue(s) : s.browserValue
|
|
3309
3309
|
);
|
|
3310
3310
|
else {
|
|
3311
3311
|
const l = t[o];
|
|
3312
3312
|
l && a.setAttribute(
|
|
3313
3313
|
"fill",
|
|
3314
|
-
e ?
|
|
3314
|
+
e ? ue(l) : l.browserValue
|
|
3315
3315
|
);
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
@@ -3322,7 +3322,7 @@ const me = (n) => {
|
|
|
3322
3322
|
if (!r)
|
|
3323
3323
|
throw new Error("Failed to read SVG.");
|
|
3324
3324
|
return Er(r, t, e), Qn(r, a, i), Rn(r);
|
|
3325
|
-
},
|
|
3325
|
+
}, Fa = (n, t, e) => {
|
|
3326
3326
|
const a = Nn(n);
|
|
3327
3327
|
if (!a)
|
|
3328
3328
|
throw new Error("Failed to read SVG.");
|
|
@@ -3334,17 +3334,17 @@ const me = (n) => {
|
|
|
3334
3334
|
const e = br(n).firstElementChild;
|
|
3335
3335
|
if (!e)
|
|
3336
3336
|
throw new Error("Failed to read SVG.");
|
|
3337
|
-
|
|
3337
|
+
Pa(e);
|
|
3338
3338
|
const a = {};
|
|
3339
3339
|
Mt(e, (o) => {
|
|
3340
3340
|
const s = o.attributes.getNamedItem("fill");
|
|
3341
3341
|
if (s && s.value !== "none" && !s.value.startsWith("url(")) {
|
|
3342
|
-
const c =
|
|
3342
|
+
const c = Ya(s.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
|
3343
3343
|
o.setAttribute("fill", c.browserValue), o.classList.add(A), a[d] = c;
|
|
3344
3344
|
}
|
|
3345
3345
|
const l = o.attributes.getNamedItem("stroke");
|
|
3346
3346
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
|
3347
|
-
const c =
|
|
3347
|
+
const c = Ya(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
|
3348
3348
|
o.classList.add(A), o.setAttribute("stroke", c.browserValue), a[d] = c;
|
|
3349
3349
|
}
|
|
3350
3350
|
});
|
|
@@ -3410,7 +3410,7 @@ const me = (n) => {
|
|
|
3410
3410
|
...AssetFields
|
|
3411
3411
|
}
|
|
3412
3412
|
}
|
|
3413
|
-
`,
|
|
3413
|
+
`, xa = C`
|
|
3414
3414
|
fragment MaterialFields on Material {
|
|
3415
3415
|
id
|
|
3416
3416
|
name
|
|
@@ -3458,13 +3458,13 @@ const me = (n) => {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
3460
|
`, Pr = C`
|
|
3461
|
-
${
|
|
3461
|
+
${xa}
|
|
3462
3462
|
query GetMaterials($ids: [String]) {
|
|
3463
3463
|
materials(id: $ids) {
|
|
3464
3464
|
...MaterialFields
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
|
-
`,
|
|
3467
|
+
`, Dr = C`
|
|
3468
3468
|
mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
|
|
3469
3469
|
assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
|
|
3470
3470
|
uploadUrl
|
|
@@ -3478,14 +3478,14 @@ const me = (n) => {
|
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
|
-
`,
|
|
3481
|
+
`, Fr = C`
|
|
3482
3482
|
${re(!1)}
|
|
3483
3483
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
|
3484
3484
|
assetRemoveBackground(key: $key) {
|
|
3485
3485
|
...AssetFields
|
|
3486
3486
|
}
|
|
3487
3487
|
}
|
|
3488
|
-
`,
|
|
3488
|
+
`, Fe = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3489
3489
|
query: Br,
|
|
3490
3490
|
errorPolicy: "all",
|
|
3491
3491
|
fetchPolicy: "no-cache",
|
|
@@ -3499,7 +3499,7 @@ const me = (n) => {
|
|
|
3499
3499
|
ids: n
|
|
3500
3500
|
}
|
|
3501
3501
|
})).data.materials, kr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
|
|
3502
|
-
mutation:
|
|
3502
|
+
mutation: Dr,
|
|
3503
3503
|
errorPolicy: "all",
|
|
3504
3504
|
fetchPolicy: "no-cache",
|
|
3505
3505
|
variables: {
|
|
@@ -3513,7 +3513,7 @@ const me = (n) => {
|
|
|
3513
3513
|
class Mr {
|
|
3514
3514
|
constructor() {
|
|
3515
3515
|
this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (t) => {
|
|
3516
|
-
const e = await t.arrayBuffer(), a = await
|
|
3516
|
+
const e = await t.arrayBuffer(), a = await Ue(e), i = (r, o) => {
|
|
3517
3517
|
const s = atob(r.split(",")[1]), l = [];
|
|
3518
3518
|
for (let c = 0; c < s.length; c++)
|
|
3519
3519
|
l.push(s.charCodeAt(c));
|
|
@@ -3534,14 +3534,14 @@ class Mr {
|
|
|
3534
3534
|
if (!i) throw new R("Failed to get asset from cache!");
|
|
3535
3535
|
return i;
|
|
3536
3536
|
}
|
|
3537
|
-
const a = (async () => (await
|
|
3537
|
+
const a = (async () => (await Fe([t]))[0])();
|
|
3538
3538
|
return this.cache.set(t, a), a;
|
|
3539
3539
|
}
|
|
3540
3540
|
/**
|
|
3541
3541
|
* Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
|
|
3542
3542
|
*/
|
|
3543
3543
|
async getFromServer(t) {
|
|
3544
|
-
const a = (async () => (await
|
|
3544
|
+
const a = (async () => (await Fe([t]))[0])();
|
|
3545
3545
|
return this.cache.set(t, a), a;
|
|
3546
3546
|
}
|
|
3547
3547
|
keyFromURL(t) {
|
|
@@ -3600,7 +3600,7 @@ class Mr {
|
|
|
3600
3600
|
}, a, i);
|
|
3601
3601
|
}
|
|
3602
3602
|
async uploadFile(t, e) {
|
|
3603
|
-
const i = this.isRaster(t) ?
|
|
3603
|
+
const i = this.isRaster(t) ? Ie.Image : Ie.Illustration, r = await this.loadImageAsFileInfo(t);
|
|
3604
3604
|
return await this.uploadAssetWithProgress(r, i, e, !0);
|
|
3605
3605
|
}
|
|
3606
3606
|
async removeBackgroundFromAsset(t) {
|
|
@@ -3613,7 +3613,7 @@ class Mr {
|
|
|
3613
3613
|
}
|
|
3614
3614
|
const i = (async () => {
|
|
3615
3615
|
const r = await y.getShadowGraphqlClient().mutate({
|
|
3616
|
-
mutation:
|
|
3616
|
+
mutation: Fr,
|
|
3617
3617
|
fetchPolicy: "no-cache",
|
|
3618
3618
|
errorPolicy: "all",
|
|
3619
3619
|
variables: {
|
|
@@ -3647,7 +3647,7 @@ class Mr {
|
|
|
3647
3647
|
async postProcessFileUpload(t, e) {
|
|
3648
3648
|
if (e === "image/svg+xml") {
|
|
3649
3649
|
const a = await t.blob.text(), o = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
|
3650
|
-
if (!o) throw new
|
|
3650
|
+
if (!o) throw new Ft("Failed to read SVG.");
|
|
3651
3651
|
vr(o);
|
|
3652
3652
|
const l = Pt().serializeToString(o);
|
|
3653
3653
|
return {
|
|
@@ -3736,7 +3736,7 @@ const $t = "persistentAssets", ct = class ct {
|
|
|
3736
3736
|
};
|
|
3737
3737
|
ct.callbacks = [];
|
|
3738
3738
|
let ht = ct;
|
|
3739
|
-
const
|
|
3739
|
+
const Ja = "bgrmPersistentAssets";
|
|
3740
3740
|
class _ {
|
|
3741
3741
|
static has(t) {
|
|
3742
3742
|
return _.getMap().has(t);
|
|
@@ -3763,10 +3763,10 @@ class _ {
|
|
|
3763
3763
|
a && (e.delete(a), _.setMap(e));
|
|
3764
3764
|
}
|
|
3765
3765
|
static getMap() {
|
|
3766
|
-
return k.getMap(
|
|
3766
|
+
return k.getMap(Ja) || /* @__PURE__ */ new Map();
|
|
3767
3767
|
}
|
|
3768
3768
|
static setMap(t) {
|
|
3769
|
-
k.setMap(
|
|
3769
|
+
k.setMap(Ja, t);
|
|
3770
3770
|
}
|
|
3771
3771
|
}
|
|
3772
3772
|
const V = new Mr();
|
|
@@ -3842,7 +3842,7 @@ const Zt = new Tr(), On = C`
|
|
|
3842
3842
|
}
|
|
3843
3843
|
`, Nr = C`
|
|
3844
3844
|
${re(!1)}
|
|
3845
|
-
${
|
|
3845
|
+
${xa}
|
|
3846
3846
|
${On}
|
|
3847
3847
|
query GetOptions($ids: [String]!) {
|
|
3848
3848
|
options(ids: $ids) {
|
|
@@ -3931,7 +3931,7 @@ const J = new $r(), $n = C`
|
|
|
3931
3931
|
currencyCode
|
|
3932
3932
|
}
|
|
3933
3933
|
}
|
|
3934
|
-
`,
|
|
3934
|
+
`, Le = C`
|
|
3935
3935
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
|
3936
3936
|
id
|
|
3937
3937
|
product {
|
|
@@ -4046,7 +4046,7 @@ const J = new $r(), $n = C`
|
|
|
4046
4046
|
url
|
|
4047
4047
|
}
|
|
4048
4048
|
`, Lr = C`
|
|
4049
|
-
${
|
|
4049
|
+
${Le}
|
|
4050
4050
|
${oe}
|
|
4051
4051
|
${$n}
|
|
4052
4052
|
query ReadIntegrationProducts($ids: [String!]!) {
|
|
@@ -4292,7 +4292,7 @@ const J = new $r(), $n = C`
|
|
|
4292
4292
|
}
|
|
4293
4293
|
}
|
|
4294
4294
|
`, Gn = (n) => C`
|
|
4295
|
-
${
|
|
4295
|
+
${Le}
|
|
4296
4296
|
fragment IntegrationProductFields on IntegrationProduct {
|
|
4297
4297
|
id
|
|
4298
4298
|
externalProductId
|
|
@@ -4529,7 +4529,7 @@ const J = new $r(), $n = C`
|
|
|
4529
4529
|
}
|
|
4530
4530
|
`, ao = (n) => C`
|
|
4531
4531
|
${re(n)}
|
|
4532
|
-
${
|
|
4532
|
+
${xa}
|
|
4533
4533
|
${On}
|
|
4534
4534
|
${Xr}
|
|
4535
4535
|
${Zr}
|
|
@@ -4973,7 +4973,7 @@ const J = new $r(), $n = C`
|
|
|
4973
4973
|
}
|
|
4974
4974
|
}
|
|
4975
4975
|
}
|
|
4976
|
-
`,
|
|
4976
|
+
`, Ve = C`
|
|
4977
4977
|
${oe}
|
|
4978
4978
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
|
4979
4979
|
id
|
|
@@ -5042,7 +5042,7 @@ const J = new $r(), $n = C`
|
|
|
5042
5042
|
}
|
|
5043
5043
|
}
|
|
5044
5044
|
`, ro = C`
|
|
5045
|
-
${
|
|
5045
|
+
${Ve}
|
|
5046
5046
|
query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
|
|
5047
5047
|
marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
|
|
5048
5048
|
...MarketplaceThemeInstallConfigurationFields
|
|
@@ -5050,7 +5050,7 @@ const J = new $r(), $n = C`
|
|
|
5050
5050
|
}
|
|
5051
5051
|
`, oo = C`
|
|
5052
5052
|
${$n}
|
|
5053
|
-
${
|
|
5053
|
+
${Ve}
|
|
5054
5054
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
|
5055
5055
|
currentIntegration {
|
|
5056
5056
|
id
|
|
@@ -5062,7 +5062,7 @@ const J = new $r(), $n = C`
|
|
|
5062
5062
|
}
|
|
5063
5063
|
}
|
|
5064
5064
|
`, so = C`
|
|
5065
|
-
${
|
|
5065
|
+
${Ve}
|
|
5066
5066
|
query ReadTransactionForMarketplaceTheme($id: String!) {
|
|
5067
5067
|
transactions(ids: [$id]) {
|
|
5068
5068
|
marketplaceThemeInstallConfiguration(raw: false) {
|
|
@@ -5071,7 +5071,7 @@ const J = new $r(), $n = C`
|
|
|
5071
5071
|
}
|
|
5072
5072
|
}
|
|
5073
5073
|
`, lo = C`
|
|
5074
|
-
${
|
|
5074
|
+
${Ve}
|
|
5075
5075
|
query ReadBundleForMarketplaceTheme($id: String!) {
|
|
5076
5076
|
bundles(ids: [$id]) {
|
|
5077
5077
|
marketplaceThemeInstallConfiguration(raw: false) {
|
|
@@ -5275,14 +5275,14 @@ const M = () => {
|
|
|
5275
5275
|
viewBox: A,
|
|
5276
5276
|
width: u
|
|
5277
5277
|
}) => {
|
|
5278
|
-
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: p.width, height: p.height, rx: h }) }) }), w = a.colorProfiles?.map((E,
|
|
5278
|
+
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: p.width, height: p.height, rx: h }) }) }), w = a.colorProfiles?.map((E, D) => (
|
|
5279
5279
|
/* @ts-ignore */
|
|
5280
|
-
/* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " },
|
|
5280
|
+
/* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, D)
|
|
5281
5281
|
)), I = i.map((E) => ({
|
|
5282
5282
|
...E,
|
|
5283
5283
|
_renderingConfiguration: a,
|
|
5284
5284
|
mask: l ? `url(#viewmask-${f})` : void 0
|
|
5285
|
-
})), b =
|
|
5285
|
+
})), b = Ma(I);
|
|
5286
5286
|
return /* @__PURE__ */ dt(
|
|
5287
5287
|
"svg",
|
|
5288
5288
|
{
|
|
@@ -5389,7 +5389,7 @@ const M = () => {
|
|
|
5389
5389
|
}), fd = (n, t, e, a) => ({
|
|
5390
5390
|
x: n.x + (t?.x + t?.width) * e,
|
|
5391
5391
|
y: n.y + (t?.y + t?.height) * a
|
|
5392
|
-
}),
|
|
5392
|
+
}), Dt = (n) => {
|
|
5393
5393
|
switch (n) {
|
|
5394
5394
|
case Y.North:
|
|
5395
5395
|
return Y.East;
|
|
@@ -5408,7 +5408,7 @@ const M = () => {
|
|
|
5408
5408
|
case Y.Southwest:
|
|
5409
5409
|
return Y.Northwest;
|
|
5410
5410
|
}
|
|
5411
|
-
}, Cd = (n, t) => t > 45 && t <= 135 ?
|
|
5411
|
+
}, Cd = (n, t) => t > 45 && t <= 135 ? Dt(n) : t > 135 && t <= 225 ? Dt(Dt(n)) : t > 225 && t <= 315 ? Dt(Dt(Dt(n))) : n, wd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5412
5412
|
const a = wt(n.rotation), i = {
|
|
5413
5413
|
x: t.x + n.x * e.x,
|
|
5414
5414
|
y: t.x + n.y * e.y
|
|
@@ -5426,13 +5426,13 @@ const M = () => {
|
|
|
5426
5426
|
y: s.y - n.height * e.y / 2
|
|
5427
5427
|
};
|
|
5428
5428
|
return {
|
|
5429
|
-
a:
|
|
5430
|
-
b:
|
|
5431
|
-
c:
|
|
5432
|
-
d:
|
|
5429
|
+
a: he(i, l, a),
|
|
5430
|
+
b: he(r, l, a),
|
|
5431
|
+
c: he(o, l, a),
|
|
5432
|
+
d: he(s, l, a),
|
|
5433
5433
|
center: l
|
|
5434
5434
|
};
|
|
5435
|
-
},
|
|
5435
|
+
}, he = (n, t, e) => {
|
|
5436
5436
|
const a = Math.sin(e), i = Math.cos(e);
|
|
5437
5437
|
return {
|
|
5438
5438
|
x: (n.x - t.x) * i - (n.y - t.y) * a + t.x,
|
|
@@ -5461,7 +5461,7 @@ const M = () => {
|
|
|
5461
5461
|
}
|
|
5462
5462
|
) });
|
|
5463
5463
|
}, jn = (n) => {
|
|
5464
|
-
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o =
|
|
5464
|
+
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o = Ma(n.children);
|
|
5465
5465
|
return /* @__PURE__ */ dt(qt, { children: [
|
|
5466
5466
|
/* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ P("path", { d: n.clipPath }) : /* @__PURE__ */ P("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
|
|
5467
5467
|
/* @__PURE__ */ dt(
|
|
@@ -5496,8 +5496,8 @@ const M = () => {
|
|
|
5496
5496
|
if (!n.pattern)
|
|
5497
5497
|
return "";
|
|
5498
5498
|
if (n.pattern.svg) {
|
|
5499
|
-
const A =
|
|
5500
|
-
return
|
|
5499
|
+
const A = Fa(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5500
|
+
return ba(A);
|
|
5501
5501
|
}
|
|
5502
5502
|
return n.pattern.src;
|
|
5503
5503
|
};
|
|
@@ -5526,7 +5526,7 @@ const M = () => {
|
|
|
5526
5526
|
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, m = n.pattern?.height || 0, p = n.pattern?.scaleX || 1, g = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
|
5527
5527
|
return [n.pattern?.svg ? {
|
|
5528
5528
|
id: `${t}-contents`,
|
|
5529
|
-
type:
|
|
5529
|
+
type: F.Illustration,
|
|
5530
5530
|
x: A,
|
|
5531
5531
|
y: u,
|
|
5532
5532
|
rotation: f,
|
|
@@ -5537,7 +5537,7 @@ const M = () => {
|
|
|
5537
5537
|
colors: n.pattern?.colors
|
|
5538
5538
|
} : {
|
|
5539
5539
|
id: `${t}-contents`,
|
|
5540
|
-
type:
|
|
5540
|
+
type: F.Image,
|
|
5541
5541
|
x: A,
|
|
5542
5542
|
y: u,
|
|
5543
5543
|
rotation: f,
|
|
@@ -5640,24 +5640,24 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5640
5640
|
return yt(n).getFont();
|
|
5641
5641
|
} catch {
|
|
5642
5642
|
if (wo(n)) {
|
|
5643
|
-
const a =
|
|
5644
|
-
return
|
|
5643
|
+
const a = Fn(n), i = la(a);
|
|
5644
|
+
return ma(n, i), i;
|
|
5645
5645
|
} else {
|
|
5646
|
-
const a = await
|
|
5647
|
-
return
|
|
5646
|
+
const a = await Oe(n, !0), i = la(a);
|
|
5647
|
+
return ma(n, i), await tr(i, n), i;
|
|
5648
5648
|
}
|
|
5649
5649
|
}
|
|
5650
5650
|
})();
|
|
5651
5651
|
return Ke.set(n, e), e;
|
|
5652
5652
|
}, yo = (n) => {
|
|
5653
|
-
const t =
|
|
5654
|
-
return
|
|
5653
|
+
const t = Fn(n), e = la(t);
|
|
5654
|
+
return ma(n, e), e;
|
|
5655
5655
|
}, yt = (n) => {
|
|
5656
5656
|
const t = Yn.get(n);
|
|
5657
5657
|
if (t)
|
|
5658
5658
|
return t;
|
|
5659
5659
|
throw new Error("Font metrics unavailable for font");
|
|
5660
|
-
},
|
|
5660
|
+
}, ma = (n, t) => {
|
|
5661
5661
|
const e = new Co(t);
|
|
5662
5662
|
return Yn.set(n, e), e;
|
|
5663
5663
|
}, vd = async (n) => {
|
|
@@ -5683,28 +5683,28 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5683
5683
|
let b = 0;
|
|
5684
5684
|
const E = A.getAttribute("text-anchor");
|
|
5685
5685
|
E === "middle" ? b = I / 2 : E === "end" && (b = I);
|
|
5686
|
-
const
|
|
5686
|
+
const D = p.getPath(
|
|
5687
5687
|
A.innerHTML,
|
|
5688
5688
|
parseFloat(A.getAttribute("x") ?? "0") - b,
|
|
5689
5689
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
5690
5690
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5691
5691
|
);
|
|
5692
|
-
|
|
5693
|
-
const x =
|
|
5692
|
+
D.fill = g, D.stroke = f, D.strokeWidth = parseFloat(S ?? "0");
|
|
5693
|
+
const x = D.toSVG(2), $ = t.parseFromString(x, "image/svg+xml").firstElementChild;
|
|
5694
5694
|
h.appendChild($);
|
|
5695
5695
|
}
|
|
5696
5696
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Pt().serializeToString(a);
|
|
5697
|
-
},
|
|
5698
|
-
`), e, a), t),
|
|
5697
|
+
}, xe = (n, t, e, a) => Math.max(bo(n.join(`
|
|
5698
|
+
`), e, a), t), Ka = (n, t, e, a, i, r) => {
|
|
5699
5699
|
const o = (r || _n) * i.getApproximateHeight(), s = t.split(`
|
|
5700
5700
|
`);
|
|
5701
5701
|
try {
|
|
5702
|
-
const l = s.flatMap((d) =>
|
|
5702
|
+
const l = s.flatMap((d) => ye(d, n.width, a, i)), c = l.flatMap((d) => d.lines);
|
|
5703
5703
|
return {
|
|
5704
5704
|
lines: c,
|
|
5705
5705
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
|
|
5706
5706
|
fontSize: e,
|
|
5707
|
-
requiredWidth:
|
|
5707
|
+
requiredWidth: xe(c, n.width, a, i)
|
|
5708
5708
|
};
|
|
5709
5709
|
} catch {
|
|
5710
5710
|
const c = t.split("");
|
|
@@ -5712,17 +5712,17 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5712
5712
|
lines: c,
|
|
5713
5713
|
requiredHeight: c.length * (a * o),
|
|
5714
5714
|
fontSize: e,
|
|
5715
|
-
requiredWidth:
|
|
5715
|
+
requiredWidth: xe(c, n.width, a, i)
|
|
5716
5716
|
};
|
|
5717
5717
|
}
|
|
5718
|
-
},
|
|
5718
|
+
}, ye = (n, t, e, a) => {
|
|
5719
5719
|
const i = pt(n, e, a);
|
|
5720
5720
|
if (i <= t)
|
|
5721
5721
|
return { lines: [n], width: i };
|
|
5722
5722
|
if (!(n.indexOf(" ") > -1)) {
|
|
5723
5723
|
if (n.length <= 1)
|
|
5724
5724
|
throw new Error(`Character ${n} is wider than region`);
|
|
5725
|
-
const d = Math.floor(n.length / 2), A =
|
|
5725
|
+
const d = Math.floor(n.length / 2), A = ye(n.slice(0, d), t, e, a), u = ye(n.slice(d), t, e, a);
|
|
5726
5726
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
|
5727
5727
|
}
|
|
5728
5728
|
const o = n.split(" "), s = [];
|
|
@@ -5730,7 +5730,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5730
5730
|
for (; c < o.length; ) {
|
|
5731
5731
|
const d = o[c];
|
|
5732
5732
|
if (pt(d, e, a) > t) {
|
|
5733
|
-
const A =
|
|
5733
|
+
const A = ye(d, t, e, a);
|
|
5734
5734
|
s.push(...A.lines), l = Math.max(l, A.width), c++;
|
|
5735
5735
|
} else {
|
|
5736
5736
|
const A = [d];
|
|
@@ -5752,7 +5752,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5752
5752
|
}, vo = (n, t, e, a) => {
|
|
5753
5753
|
const i = yt(t.fontData.assetUrl), r = i.getFont(), o = t.fontSize / r.unitsPerEm;
|
|
5754
5754
|
if (!e)
|
|
5755
|
-
return
|
|
5755
|
+
return Ka(t, n, t.fontSize, o, i, a);
|
|
5756
5756
|
let s;
|
|
5757
5757
|
if (t.text ? s = t.text.split(`
|
|
5758
5758
|
`) : s = t.input?.split(`
|
|
@@ -5760,16 +5760,16 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5760
5760
|
return {
|
|
5761
5761
|
lines: s,
|
|
5762
5762
|
requiredHeight: t.height,
|
|
5763
|
-
requiredWidth:
|
|
5763
|
+
requiredWidth: xe(s, t.width, o, i),
|
|
5764
5764
|
fontSize: t.fontSize
|
|
5765
5765
|
};
|
|
5766
5766
|
const l = t.width !== e.width != (t.height !== e.height);
|
|
5767
5767
|
return t.lineHeight === e.lineHeight && !l && e.input === n ? {
|
|
5768
5768
|
lines: s,
|
|
5769
5769
|
requiredHeight: t.height,
|
|
5770
|
-
requiredWidth:
|
|
5770
|
+
requiredWidth: xe(s, t.width, o, i),
|
|
5771
5771
|
fontSize: So(s, i, r, t.width, t.height, a)
|
|
5772
|
-
} :
|
|
5772
|
+
} : Ka(t, n, t.fontSize, o, i, a);
|
|
5773
5773
|
}, Eo = (n, t, e, a, i) => {
|
|
5774
5774
|
const o = yt(t.assetUrl).getFont();
|
|
5775
5775
|
let s = { ...n };
|
|
@@ -5798,12 +5798,12 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5798
5798
|
return n.forEach((i) => {
|
|
5799
5799
|
a = Math.max(a, pt(i, t, e));
|
|
5800
5800
|
}), a;
|
|
5801
|
-
},
|
|
5801
|
+
}, _a = {
|
|
5802
5802
|
stripControlCharacters: !0,
|
|
5803
5803
|
vertical: !1,
|
|
5804
5804
|
uppercase: !1
|
|
5805
|
-
},
|
|
5806
|
-
const e = { ...
|
|
5805
|
+
}, ke = (n, t = _a) => {
|
|
5806
|
+
const e = { ..._a, ...t };
|
|
5807
5807
|
let a = n || "";
|
|
5808
5808
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
5809
5809
|
`)), a;
|
|
@@ -5897,8 +5897,8 @@ const Po = (n) => {
|
|
|
5897
5897
|
},
|
|
5898
5898
|
stroke: A,
|
|
5899
5899
|
strokeWidth: u,
|
|
5900
|
-
children: n.curved ? /* @__PURE__ */ P(
|
|
5901
|
-
|
|
5900
|
+
children: n.curved ? /* @__PURE__ */ P(Fo, { text: c, curvedPathId: r, align: n.align }) : d.map((m, p) => /* @__PURE__ */ P(
|
|
5901
|
+
Do,
|
|
5902
5902
|
{
|
|
5903
5903
|
align: n.vertical ? "center" : n.align,
|
|
5904
5904
|
fontSize: n.fontSize,
|
|
@@ -5917,7 +5917,7 @@ const Po = (n) => {
|
|
|
5917
5917
|
}
|
|
5918
5918
|
) }) })
|
|
5919
5919
|
] });
|
|
5920
|
-
},
|
|
5920
|
+
}, Do = (n) => {
|
|
5921
5921
|
const t = () => {
|
|
5922
5922
|
if (n.lineHeight !== void 0)
|
|
5923
5923
|
return n.lineHeight * n.fontSize;
|
|
@@ -5935,7 +5935,7 @@ const Po = (n) => {
|
|
|
5935
5935
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5936
5936
|
};
|
|
5937
5937
|
return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5938
|
-
},
|
|
5938
|
+
}, Fo = (n) => {
|
|
5939
5939
|
const t = `#${n.curvedPathId}`;
|
|
5940
5940
|
return /* @__PURE__ */ P(
|
|
5941
5941
|
"textPath",
|
|
@@ -6055,7 +6055,7 @@ class ko {
|
|
|
6055
6055
|
layout: t,
|
|
6056
6056
|
elements: e
|
|
6057
6057
|
},
|
|
6058
|
-
getComponentWithProps: (a) =>
|
|
6058
|
+
getComponentWithProps: (a) => ka(t, e, a)
|
|
6059
6059
|
};
|
|
6060
6060
|
}
|
|
6061
6061
|
initialize(t, e) {
|
|
@@ -6080,7 +6080,7 @@ class ko {
|
|
|
6080
6080
|
return { ...t, transaction: e.apply(a) };
|
|
6081
6081
|
}
|
|
6082
6082
|
}
|
|
6083
|
-
const Zn = (n) => n.type ===
|
|
6083
|
+
const Zn = (n) => n.type === F.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === F.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === F.Illustration ? /* @__PURE__ */ P(xo, { ...n }, n.id) : n.type === F.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === F.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, ka = (n, t, e) => {
|
|
6084
6084
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6085
6085
|
return /* @__PURE__ */ P(
|
|
6086
6086
|
po,
|
|
@@ -6111,7 +6111,7 @@ const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n
|
|
|
6111
6111
|
}
|
|
6112
6112
|
);
|
|
6113
6113
|
};
|
|
6114
|
-
function
|
|
6114
|
+
function Ma(n) {
|
|
6115
6115
|
return n.sort((t, e) => {
|
|
6116
6116
|
const a = t.layer || 0, i = e.layer || 0;
|
|
6117
6117
|
if (a < i) return -1;
|
|
@@ -6131,10 +6131,10 @@ const le = (n) => {
|
|
|
6131
6131
|
}, mt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), ti = async (n, t) => {
|
|
6132
6132
|
if (!t) {
|
|
6133
6133
|
if (!n) throw new Error("No region or src supplied. Cannot construct frame!");
|
|
6134
|
-
return
|
|
6134
|
+
return ga(n);
|
|
6135
6135
|
}
|
|
6136
6136
|
return nt(t);
|
|
6137
|
-
},
|
|
6137
|
+
}, ga = (n) => {
|
|
6138
6138
|
const t = n.width, e = n.height;
|
|
6139
6139
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
|
6140
6140
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
|
@@ -6149,7 +6149,7 @@ const le = (n) => {
|
|
|
6149
6149
|
if (!e.asset)
|
|
6150
6150
|
throw new Error(`No asset for variant with ID: ${n.frameVariantId}`);
|
|
6151
6151
|
return e;
|
|
6152
|
-
},
|
|
6152
|
+
}, ze = async (n) => {
|
|
6153
6153
|
if (Xe.has(n))
|
|
6154
6154
|
return Xe.get(n);
|
|
6155
6155
|
const e = (async () => {
|
|
@@ -6188,7 +6188,7 @@ const le = (n) => {
|
|
|
6188
6188
|
throw new Error("Malformed frame SVG");
|
|
6189
6189
|
})();
|
|
6190
6190
|
return Xe.set(n, e), e;
|
|
6191
|
-
},
|
|
6191
|
+
}, Ta = (n, t, e, a) => {
|
|
6192
6192
|
const i = t.width / t.height, r = n.width / n.height;
|
|
6193
6193
|
let o;
|
|
6194
6194
|
a ? r > i ? o = t.height / n.height : o = t.width / n.width : r > i ? o = t.width / n.width : o = t.height / n.height, e?.scale !== void 0 && (o *= e?.scale);
|
|
@@ -6198,7 +6198,7 @@ const le = (n) => {
|
|
|
6198
6198
|
y: u,
|
|
6199
6199
|
zoom: o
|
|
6200
6200
|
};
|
|
6201
|
-
},
|
|
6201
|
+
}, pa = async (n) => {
|
|
6202
6202
|
if (mt.has(n))
|
|
6203
6203
|
return mt.get(n);
|
|
6204
6204
|
if (n.startsWith("data:image/svg+xml")) {
|
|
@@ -6211,7 +6211,7 @@ const le = (n) => {
|
|
|
6211
6211
|
return mt.set(n, r), r;
|
|
6212
6212
|
}
|
|
6213
6213
|
if ((n.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
|
6214
|
-
const e = await
|
|
6214
|
+
const e = await Na(n), a = e.width, i = e.height, r = {
|
|
6215
6215
|
src: n,
|
|
6216
6216
|
width: a,
|
|
6217
6217
|
height: i,
|
|
@@ -6219,7 +6219,7 @@ const le = (n) => {
|
|
|
6219
6219
|
};
|
|
6220
6220
|
return mt.set(n, r), r;
|
|
6221
6221
|
} else {
|
|
6222
|
-
const e = await
|
|
6222
|
+
const e = await Oe(n, !0), a = await Ue(e), i = {
|
|
6223
6223
|
src: n,
|
|
6224
6224
|
width: a.width,
|
|
6225
6225
|
height: a.height,
|
|
@@ -6227,14 +6227,14 @@ const le = (n) => {
|
|
|
6227
6227
|
};
|
|
6228
6228
|
return mt.set(n, i), i;
|
|
6229
6229
|
}
|
|
6230
|
-
},
|
|
6230
|
+
}, Na = async (n) => {
|
|
6231
6231
|
const t = await nt(n);
|
|
6232
6232
|
return ei(t);
|
|
6233
|
-
},
|
|
6233
|
+
}, Xa = (n) => n.endsWith("mm") ? Number(n.replace("mm", "")) * 3.7795275591 : n.endsWith("px") ? Number(n.replace("px", "")) : Number(n), ei = (n) => {
|
|
6234
6234
|
const a = At().parseFromString(n, "image/svg+xml").querySelector("svg");
|
|
6235
6235
|
if (!a)
|
|
6236
6236
|
throw new Error("No svg tag found, this svg must be malformed!");
|
|
6237
|
-
const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0,
|
|
6237
|
+
const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0, Xa(r), Xa(o)] : i?.split(" ").map((l) => Number(l));
|
|
6238
6238
|
if (!s)
|
|
6239
6239
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
|
6240
6240
|
return {
|
|
@@ -6266,12 +6266,12 @@ const le = (n) => {
|
|
|
6266
6266
|
const o = At().parseFromString(n, "image/svg+xml").firstElementChild;
|
|
6267
6267
|
if (!o)
|
|
6268
6268
|
throw new Error("Failed to read SVG");
|
|
6269
|
-
const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await
|
|
6269
|
+
const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await va.from(d, l, {
|
|
6270
6270
|
anonymousCrossOrigin: !0,
|
|
6271
6271
|
ignoreDimensions: !1,
|
|
6272
6272
|
createCanvas: Ct,
|
|
6273
6273
|
createImage: ie,
|
|
6274
|
-
DOMParser:
|
|
6274
|
+
DOMParser: Ba(),
|
|
6275
6275
|
fetch: it
|
|
6276
6276
|
}), u = o.getAttribute("width"), h = o.getAttribute("height"), m = 2048;
|
|
6277
6277
|
if (h && u) {
|
|
@@ -6296,17 +6296,17 @@ const le = (n) => {
|
|
|
6296
6296
|
rotation: 0,
|
|
6297
6297
|
panelId: n.layoutState.layout.panelId
|
|
6298
6298
|
};
|
|
6299
|
-
if (e && t ===
|
|
6299
|
+
if (e && t === F.Illustration) {
|
|
6300
6300
|
const l = await lt(await ai(e)), u = At().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6301
6301
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6302
6302
|
const h = s.height, m = u.split(" "), p = parseFloat(m[2]) || 1, g = parseFloat(m[3]) || 1, f = p / g;
|
|
6303
6303
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6304
6304
|
}
|
|
6305
|
-
if (e && t ===
|
|
6306
|
-
const l = s.height, c = await
|
|
6305
|
+
if (e && t === F.Image) {
|
|
6306
|
+
const l = s.height, c = await Oe(e), d = await Ue(c), A = d.width / d.height;
|
|
6307
6307
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6308
6308
|
}
|
|
6309
|
-
if (e && t ===
|
|
6309
|
+
if (e && t === F.Textbox && a?.text && a?.fontScale) {
|
|
6310
6310
|
await Qt(e);
|
|
6311
6311
|
const l = yt(e), c = pt(a.text, a?.fontScale, l);
|
|
6312
6312
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6315,7 +6315,7 @@ const le = (n) => {
|
|
|
6315
6315
|
};
|
|
6316
6316
|
class Ed {
|
|
6317
6317
|
static async getFrame(t, e) {
|
|
6318
|
-
const a = await ti(e.region, e.src), i = await
|
|
6318
|
+
const a = await ti(e.region, e.src), i = await ze(a), r = e.region || await Vt(t, F.Frame);
|
|
6319
6319
|
return {
|
|
6320
6320
|
id: M(),
|
|
6321
6321
|
x: r.left,
|
|
@@ -6330,7 +6330,7 @@ class Ed {
|
|
|
6330
6330
|
path: i.path,
|
|
6331
6331
|
dataWidth: i.width,
|
|
6332
6332
|
dataHeight: i.height,
|
|
6333
|
-
type:
|
|
6333
|
+
type: F.Frame,
|
|
6334
6334
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6335
6335
|
focalBlur: e.configuration.focalBlur,
|
|
6336
6336
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6341,11 +6341,11 @@ class Ed {
|
|
|
6341
6341
|
};
|
|
6342
6342
|
}
|
|
6343
6343
|
static async getImage(t, e) {
|
|
6344
|
-
const a = e.region || await Vt(t,
|
|
6344
|
+
const a = e.region || await Vt(t, F.Image, e.src);
|
|
6345
6345
|
return {
|
|
6346
6346
|
id: M(),
|
|
6347
6347
|
src: e.src,
|
|
6348
|
-
type:
|
|
6348
|
+
type: F.Image,
|
|
6349
6349
|
y: a.top,
|
|
6350
6350
|
x: a.left,
|
|
6351
6351
|
rotation: a.rotation,
|
|
@@ -6361,16 +6361,16 @@ class Ed {
|
|
|
6361
6361
|
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Qt(i), s = {
|
|
6362
6362
|
assetUrl: i,
|
|
6363
6363
|
name: o.names.fullName.en
|
|
6364
|
-
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
|
6364
|
+
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = ke(c, {
|
|
6365
6365
|
vertical: a.vertical,
|
|
6366
6366
|
uppercase: a.uppercase
|
|
6367
|
-
}), A = e.region || await Vt(t,
|
|
6367
|
+
}), A = e.region || await Vt(t, F.Textbox, i, {
|
|
6368
6368
|
text: d,
|
|
6369
6369
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6370
6370
|
}), u = se(
|
|
6371
6371
|
{
|
|
6372
6372
|
id: M(),
|
|
6373
|
-
type:
|
|
6373
|
+
type: F.Textbox,
|
|
6374
6374
|
x: A.left,
|
|
6375
6375
|
y: A.top,
|
|
6376
6376
|
width: A.width,
|
|
@@ -6430,13 +6430,13 @@ class Ed {
|
|
|
6430
6430
|
</svg>
|
|
6431
6431
|
`, i = {};
|
|
6432
6432
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6433
|
-
const r = e.region || await Vt(t,
|
|
6433
|
+
const r = e.region || await Vt(t, F.Illustration), o = M();
|
|
6434
6434
|
return {
|
|
6435
6435
|
stepRegion: e.region,
|
|
6436
6436
|
colors: i,
|
|
6437
6437
|
id: o,
|
|
6438
6438
|
svg: a,
|
|
6439
|
-
type:
|
|
6439
|
+
type: F.Illustration,
|
|
6440
6440
|
y: r.top,
|
|
6441
6441
|
x: r.left,
|
|
6442
6442
|
rotation: r.rotation,
|
|
@@ -6448,7 +6448,7 @@ class Ed {
|
|
|
6448
6448
|
};
|
|
6449
6449
|
}
|
|
6450
6450
|
static async getIllustration(t, e) {
|
|
6451
|
-
const a = e.region || await Vt(t,
|
|
6451
|
+
const a = e.region || await Vt(t, F.Illustration, e.src), i = await lt(await ai(e.src)), r = await te(i.svg), o = M();
|
|
6452
6452
|
return {
|
|
6453
6453
|
cachedObjectURL: r,
|
|
6454
6454
|
stepRegion: e.region,
|
|
@@ -6456,7 +6456,7 @@ class Ed {
|
|
|
6456
6456
|
id: o,
|
|
6457
6457
|
src: e.src,
|
|
6458
6458
|
svg: i.svg,
|
|
6459
|
-
type:
|
|
6459
|
+
type: F.Illustration,
|
|
6460
6460
|
y: a.top,
|
|
6461
6461
|
x: a.left,
|
|
6462
6462
|
rotation: a.rotation,
|
|
@@ -6479,13 +6479,13 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6479
6479
|
throw new W();
|
|
6480
6480
|
return e;
|
|
6481
6481
|
}, tt = (n, t) => {
|
|
6482
|
-
const e = [...t.elements.filter((i) => i.id !== n.id), n], a =
|
|
6482
|
+
const e = [...t.elements.filter((i) => i.id !== n.id), n], a = Ma(e);
|
|
6483
6483
|
return {
|
|
6484
6484
|
layout: t.layout,
|
|
6485
6485
|
elements: a,
|
|
6486
6486
|
modificationID: M()
|
|
6487
6487
|
};
|
|
6488
|
-
},
|
|
6488
|
+
}, Za = async (n) => {
|
|
6489
6489
|
const t = [...Object.keys(n.layouts)], e = [...new Set(t)];
|
|
6490
6490
|
for (let a = 0; a < e.length; a++) {
|
|
6491
6491
|
const i = e[a], r = n.layouts[i];
|
|
@@ -6515,7 +6515,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6515
6515
|
}
|
|
6516
6516
|
for (const a in n.layouts) {
|
|
6517
6517
|
const i = n.layouts[a].elements.filter(
|
|
6518
|
-
(o) => o.type ===
|
|
6518
|
+
(o) => o.type === F.Illustration
|
|
6519
6519
|
);
|
|
6520
6520
|
for (let o = 0; o < i.length; ++o) {
|
|
6521
6521
|
const s = i[o];
|
|
@@ -6527,7 +6527,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6527
6527
|
}
|
|
6528
6528
|
}
|
|
6529
6529
|
const r = n.layouts[a].elements.filter(
|
|
6530
|
-
(o) => o.type ===
|
|
6530
|
+
(o) => o.type === F.Textbox
|
|
6531
6531
|
);
|
|
6532
6532
|
for (let o = 0; o < r.length; ++o) {
|
|
6533
6533
|
const s = r[o];
|
|
@@ -6545,7 +6545,7 @@ class O {
|
|
|
6545
6545
|
this.oldState = t;
|
|
6546
6546
|
}
|
|
6547
6547
|
}
|
|
6548
|
-
class
|
|
6548
|
+
class tn extends O {
|
|
6549
6549
|
constructor(t) {
|
|
6550
6550
|
super(), this.serializableWorkflow = t;
|
|
6551
6551
|
}
|
|
@@ -6807,7 +6807,7 @@ class No extends O {
|
|
|
6807
6807
|
};
|
|
6808
6808
|
}
|
|
6809
6809
|
}
|
|
6810
|
-
class
|
|
6810
|
+
class en extends O {
|
|
6811
6811
|
constructor(t, e) {
|
|
6812
6812
|
super(), this.id = t, this.fontData = e;
|
|
6813
6813
|
}
|
|
@@ -6976,7 +6976,7 @@ class ea extends O {
|
|
|
6976
6976
|
};
|
|
6977
6977
|
}
|
|
6978
6978
|
}
|
|
6979
|
-
class
|
|
6979
|
+
class fa extends O {
|
|
6980
6980
|
constructor(t, e, a) {
|
|
6981
6981
|
super(), this.id = t, this.className = e, this.fill = a;
|
|
6982
6982
|
}
|
|
@@ -7031,7 +7031,7 @@ class Uo extends O {
|
|
|
7031
7031
|
};
|
|
7032
7032
|
}
|
|
7033
7033
|
}
|
|
7034
|
-
class
|
|
7034
|
+
class Dd extends O {
|
|
7035
7035
|
/**
|
|
7036
7036
|
* @param id The targeted element to bring to the front.
|
|
7037
7037
|
*/
|
|
@@ -7060,7 +7060,7 @@ class Fd extends O {
|
|
|
7060
7060
|
};
|
|
7061
7061
|
}
|
|
7062
7062
|
}
|
|
7063
|
-
class
|
|
7063
|
+
class Fd extends O {
|
|
7064
7064
|
/**
|
|
7065
7065
|
* @param id The targeted element to bring to the back.
|
|
7066
7066
|
*/
|
|
@@ -7145,7 +7145,7 @@ class kd extends O {
|
|
|
7145
7145
|
};
|
|
7146
7146
|
}
|
|
7147
7147
|
}
|
|
7148
|
-
class
|
|
7148
|
+
class an {
|
|
7149
7149
|
constructor(t, e, a) {
|
|
7150
7150
|
this.processRegion = async (i) => {
|
|
7151
7151
|
const r = this.layouts.find((l) => l.panelId === i.panelId);
|
|
@@ -7155,10 +7155,10 @@ class nn {
|
|
|
7155
7155
|
if (this.configuration.type === v.ProductOverlay) {
|
|
7156
7156
|
let l = "";
|
|
7157
7157
|
if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), o = l, !l)
|
|
7158
|
-
throw new
|
|
7158
|
+
throw new De(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7159
7159
|
}
|
|
7160
7160
|
const s = this.evaluateAssetType();
|
|
7161
|
-
if (s ===
|
|
7161
|
+
if (s === F.Image) {
|
|
7162
7162
|
const l = this.configuration.type === v.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7163
7163
|
if (!l)
|
|
7164
7164
|
throw new Error("Undefined raster silent step source");
|
|
@@ -7226,7 +7226,7 @@ class nn {
|
|
|
7226
7226
|
}
|
|
7227
7227
|
async trigger() {
|
|
7228
7228
|
if (!this.configuration.data.regions)
|
|
7229
|
-
throw new
|
|
7229
|
+
throw new De(this.configuration, "Missing regions.");
|
|
7230
7230
|
if (this.configuration.type === v.SilentIllustration) {
|
|
7231
7231
|
const t = this.configuration.data.regions.map(this.processRegion);
|
|
7232
7232
|
return Promise.all(t);
|
|
@@ -7240,7 +7240,7 @@ class nn {
|
|
|
7240
7240
|
}
|
|
7241
7241
|
evaluateAssetType() {
|
|
7242
7242
|
const t = this.configuration.type === v.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7243
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7243
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? F.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), F.Illustration);
|
|
7244
7244
|
}
|
|
7245
7245
|
}
|
|
7246
7246
|
const Lo = async (n) => {
|
|
@@ -7254,7 +7254,7 @@ const Lo = async (n) => {
|
|
|
7254
7254
|
}
|
|
7255
7255
|
})).json()).shortUrl;
|
|
7256
7256
|
} catch (e) {
|
|
7257
|
-
throw console.error(e), new
|
|
7257
|
+
throw console.error(e), new Re("Failed to shorten URL, see console.");
|
|
7258
7258
|
}
|
|
7259
7259
|
};
|
|
7260
7260
|
class ii {
|
|
@@ -7299,7 +7299,7 @@ class Vo {
|
|
|
7299
7299
|
}
|
|
7300
7300
|
async regenerateQRCode(t, e, a, i) {
|
|
7301
7301
|
const r = async () => {
|
|
7302
|
-
const h = (await
|
|
7302
|
+
const h = (await Fe([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
|
|
7303
7303
|
return { asset: h, link: m };
|
|
7304
7304
|
}, o = await new Promise((h, m) => {
|
|
7305
7305
|
new ii(
|
|
@@ -7325,10 +7325,10 @@ class Vo {
|
|
|
7325
7325
|
l.searchParams.append("video", btoa(JSON.stringify([o]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
|
7326
7326
|
const c = l.toString();
|
|
7327
7327
|
if (c.length >= 2e3)
|
|
7328
|
-
throw new
|
|
7328
|
+
throw new Re("Cannot create QR code, URL too long.");
|
|
7329
7329
|
const d = await Lo(c);
|
|
7330
7330
|
if (!i.data || !i.data.regions)
|
|
7331
|
-
throw new
|
|
7331
|
+
throw new De(i, "Missing regions.");
|
|
7332
7332
|
const A = await this.regionElements(i), u = await this.command(d, A, a, i.stepName);
|
|
7333
7333
|
return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(i.stepName, [], A, async () => {
|
|
7334
7334
|
a.updateStorage(i.stepName, {
|
|
@@ -7356,7 +7356,7 @@ class Vo {
|
|
|
7356
7356
|
stepName: i,
|
|
7357
7357
|
id: c.id,
|
|
7358
7358
|
src: s,
|
|
7359
|
-
type:
|
|
7359
|
+
type: F.Image,
|
|
7360
7360
|
y: d.top,
|
|
7361
7361
|
x: d.left,
|
|
7362
7362
|
width: d.width,
|
|
@@ -7371,11 +7371,11 @@ class Vo {
|
|
|
7371
7371
|
}
|
|
7372
7372
|
}
|
|
7373
7373
|
const ri = new Vo();
|
|
7374
|
-
class
|
|
7374
|
+
class Me {
|
|
7375
7375
|
constructor() {
|
|
7376
7376
|
this.frameSourceSvg = async (t, e) => {
|
|
7377
7377
|
if (!t)
|
|
7378
|
-
return
|
|
7378
|
+
return ga(e);
|
|
7379
7379
|
const a = t.asset;
|
|
7380
7380
|
if (!a)
|
|
7381
7381
|
throw new Bt(t);
|
|
@@ -7424,7 +7424,7 @@ class Ne {
|
|
|
7424
7424
|
a.serializableWorkflow.steps
|
|
7425
7425
|
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
|
|
7426
7426
|
if (!t.option || (t.option.variants || []).length === 0) {
|
|
7427
|
-
const c = t.data.regions.map((d) =>
|
|
7427
|
+
const c = t.data.regions.map((d) => ga(d));
|
|
7428
7428
|
e.updateStorage(t.stepName, {
|
|
7429
7429
|
currentFrameSources: c
|
|
7430
7430
|
});
|
|
@@ -7478,7 +7478,7 @@ class Ne {
|
|
|
7478
7478
|
})) ?? [];
|
|
7479
7479
|
}
|
|
7480
7480
|
selectImage(t, e, a, i = !0) {
|
|
7481
|
-
const r =
|
|
7481
|
+
const r = Me.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
|
|
7482
7482
|
if (o && o === r)
|
|
7483
7483
|
return Promise.resolve();
|
|
7484
7484
|
a.setEditedStatus(t.stepName, !0);
|
|
@@ -7498,7 +7498,7 @@ class Ne {
|
|
|
7498
7498
|
});
|
|
7499
7499
|
},
|
|
7500
7500
|
() => {
|
|
7501
|
-
throw new
|
|
7501
|
+
throw new Re("Failed to resolve transcoded PDF");
|
|
7502
7502
|
}
|
|
7503
7503
|
)
|
|
7504
7504
|
);
|
|
@@ -7518,7 +7518,7 @@ class Ne {
|
|
|
7518
7518
|
return new H(
|
|
7519
7519
|
{
|
|
7520
7520
|
id: t,
|
|
7521
|
-
type:
|
|
7521
|
+
type: F.Frame,
|
|
7522
7522
|
x: e.left,
|
|
7523
7523
|
y: e.top,
|
|
7524
7524
|
width: e.width,
|
|
@@ -7542,7 +7542,7 @@ class Ne {
|
|
|
7542
7542
|
}
|
|
7543
7543
|
async loadPatternFromString(t, e, a = !0, i = void 0, r) {
|
|
7544
7544
|
if (t.endsWith("svg")) {
|
|
7545
|
-
const o = await
|
|
7545
|
+
const o = await Na(t), s = o.width, l = o.height, c = await nt(t);
|
|
7546
7546
|
if (r) {
|
|
7547
7547
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
|
7548
7548
|
if (u && u.length > 0)
|
|
@@ -7560,7 +7560,7 @@ class Ne {
|
|
|
7560
7560
|
};
|
|
7561
7561
|
mt.set(t, A), e.setPatternData(A, a);
|
|
7562
7562
|
} else {
|
|
7563
|
-
const o = await
|
|
7563
|
+
const o = await Oe(t, !0), s = await Ue(o), l = {
|
|
7564
7564
|
src: t,
|
|
7565
7565
|
width: s.width,
|
|
7566
7566
|
height: s.height,
|
|
@@ -7645,7 +7645,7 @@ class Ne {
|
|
|
7645
7645
|
r && r(!0);
|
|
7646
7646
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7647
7647
|
t.data.regions.map(async (h, m) => {
|
|
7648
|
-
const p = await
|
|
7648
|
+
const p = await ze(l[m]), g = s.getImageData(), f = a.map((D) => new Rt(D.id)), S = g ? Ta(
|
|
7649
7649
|
g,
|
|
7650
7650
|
p,
|
|
7651
7651
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7660,7 +7660,7 @@ class Ne {
|
|
|
7660
7660
|
scaleX: S?.zoom || 1,
|
|
7661
7661
|
scaleY: S?.zoom || 1,
|
|
7662
7662
|
rotation: 0
|
|
7663
|
-
} : void 0, I = M(), E = i.getLayouts().find((
|
|
7663
|
+
} : void 0, I = M(), E = i.getLayouts().find((D) => D.panelId === h.panelId);
|
|
7664
7664
|
if (!E)
|
|
7665
7665
|
throw new K(h);
|
|
7666
7666
|
return {
|
|
@@ -7709,7 +7709,7 @@ class Ne {
|
|
|
7709
7709
|
throw new _t(t);
|
|
7710
7710
|
}
|
|
7711
7711
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7712
|
-
const r =
|
|
7712
|
+
const r = Me.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
7713
7713
|
if (!s)
|
|
7714
7714
|
throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
|
|
7715
7715
|
try {
|
|
@@ -7736,7 +7736,7 @@ class Ne {
|
|
|
7736
7736
|
), this.validateColorCount(e, a);
|
|
7737
7737
|
}
|
|
7738
7738
|
}
|
|
7739
|
-
const Et = new
|
|
7739
|
+
const Et = new Me();
|
|
7740
7740
|
class zo {
|
|
7741
7741
|
async getIllustrationBody(t) {
|
|
7742
7742
|
return new Promise((e) => {
|
|
@@ -7755,7 +7755,7 @@ class zo {
|
|
|
7755
7755
|
src: i.src,
|
|
7756
7756
|
svg: i.svg.svg,
|
|
7757
7757
|
cachedObjectURL: i.objectURL,
|
|
7758
|
-
type:
|
|
7758
|
+
type: F.Illustration,
|
|
7759
7759
|
y: e.top,
|
|
7760
7760
|
x: e.left,
|
|
7761
7761
|
rotation: e.rotation,
|
|
@@ -7844,7 +7844,7 @@ class zo {
|
|
|
7844
7844
|
const s = Da(t, e, a, o), l = await te(s), c = [];
|
|
7845
7845
|
for (const d of i) {
|
|
7846
7846
|
for (const [A, u] of r.entries())
|
|
7847
|
-
c.push(new
|
|
7847
|
+
c.push(new fa(d, A, u));
|
|
7848
7848
|
c.push(new Uo(d, s, l));
|
|
7849
7849
|
}
|
|
7850
7850
|
return new L(c);
|
|
@@ -7891,7 +7891,7 @@ class zo {
|
|
|
7891
7891
|
}
|
|
7892
7892
|
async selectVariantCommand(t, e, a, i, r) {
|
|
7893
7893
|
if (!t.data || !t.data.regions)
|
|
7894
|
-
throw new
|
|
7894
|
+
throw new De(t, "Missing regions.");
|
|
7895
7895
|
i(!0);
|
|
7896
7896
|
const o = a.map((f) => new Rt(f.id));
|
|
7897
7897
|
t.mandatory && r.setMandatoryFulfilled(t.stepName, !1);
|
|
@@ -7951,7 +7951,7 @@ class zo {
|
|
|
7951
7951
|
const b = S[0], E = w[0];
|
|
7952
7952
|
await this.changeColors(
|
|
7953
7953
|
t,
|
|
7954
|
-
u.map((
|
|
7954
|
+
u.map((D) => D.regionElement),
|
|
7955
7955
|
r,
|
|
7956
7956
|
() => r.getCommandContext().getAllLayouts(),
|
|
7957
7957
|
/* @__PURE__ */ new Map([[E, b.variant.color]])
|
|
@@ -7969,12 +7969,12 @@ class zo {
|
|
|
7969
7969
|
};
|
|
7970
7970
|
}
|
|
7971
7971
|
}
|
|
7972
|
-
const
|
|
7972
|
+
const Se = new zo();
|
|
7973
7973
|
class Go {
|
|
7974
7974
|
async init(t, e, a) {
|
|
7975
7975
|
const i = t.option;
|
|
7976
7976
|
if (!i)
|
|
7977
|
-
throw new
|
|
7977
|
+
throw new Pe(t);
|
|
7978
7978
|
if (a)
|
|
7979
7979
|
await this.reload(t, e, a);
|
|
7980
7980
|
else {
|
|
@@ -7990,7 +7990,7 @@ class Go {
|
|
|
7990
7990
|
t.stepName,
|
|
7991
7991
|
a.serializableWorkflow.steps
|
|
7992
7992
|
), s = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName), l = t.option;
|
|
7993
|
-
if (!l) throw new
|
|
7993
|
+
if (!l) throw new Pe(t);
|
|
7994
7994
|
if (i?.selectedVariants) {
|
|
7995
7995
|
const c = i.selectedVariants[0].id;
|
|
7996
7996
|
if (c) {
|
|
@@ -8049,7 +8049,7 @@ const oi = new Go();
|
|
|
8049
8049
|
class Wo {
|
|
8050
8050
|
async init(t, e, a) {
|
|
8051
8051
|
const i = t.option;
|
|
8052
|
-
if (!i) throw new
|
|
8052
|
+
if (!i) throw new Pe(t);
|
|
8053
8053
|
if (a)
|
|
8054
8054
|
await this.reload(t, e, a);
|
|
8055
8055
|
else {
|
|
@@ -8172,7 +8172,7 @@ class qo {
|
|
|
8172
8172
|
colors: {},
|
|
8173
8173
|
id: h,
|
|
8174
8174
|
svg: d,
|
|
8175
|
-
type:
|
|
8175
|
+
type: F.Illustration,
|
|
8176
8176
|
y: A.top,
|
|
8177
8177
|
x: A.left,
|
|
8178
8178
|
rotation: A.rotation,
|
|
@@ -8227,7 +8227,7 @@ class qo {
|
|
|
8227
8227
|
}
|
|
8228
8228
|
if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
|
|
8229
8229
|
return i("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
|
|
8230
|
-
const r =
|
|
8230
|
+
const r = ca(e.toLowerCase());
|
|
8231
8231
|
for (const o of r)
|
|
8232
8232
|
for (const s in a) {
|
|
8233
8233
|
const l = a[s].toLowerCase().replace(/\s/g, "");
|
|
@@ -8298,7 +8298,7 @@ class Ho {
|
|
|
8298
8298
|
stepRegion: A,
|
|
8299
8299
|
id: m,
|
|
8300
8300
|
src: o,
|
|
8301
|
-
type:
|
|
8301
|
+
type: F.Image,
|
|
8302
8302
|
y: A.top,
|
|
8303
8303
|
x: A.left,
|
|
8304
8304
|
rotation: A.rotation,
|
|
@@ -8401,14 +8401,14 @@ class Yo {
|
|
|
8401
8401
|
const i = a.getLayouts(), o = (a.getRegionElements(e.stepName) || []).map((s) => {
|
|
8402
8402
|
const l = s.region;
|
|
8403
8403
|
if (!i.find((d) => d.panelId === l?.panelId)) throw new K(l);
|
|
8404
|
-
return new
|
|
8404
|
+
return new fa(s.id, this.shapeFillId, t);
|
|
8405
8405
|
}).filter((s) => !!s);
|
|
8406
8406
|
a.getCommandDispatcher()(new L(o)), a.updateStorage(e.stepName, { colour: t });
|
|
8407
8407
|
}
|
|
8408
8408
|
async init(t, e, a) {
|
|
8409
8409
|
const i = t.option;
|
|
8410
8410
|
if (!i)
|
|
8411
|
-
throw new
|
|
8411
|
+
throw new Pe(t);
|
|
8412
8412
|
if (a)
|
|
8413
8413
|
await this.reload(t, e, a);
|
|
8414
8414
|
else {
|
|
@@ -8467,7 +8467,7 @@ class Yo {
|
|
|
8467
8467
|
if (!r.find((m) => m.panelId === A?.panelId))
|
|
8468
8468
|
throw new K(A);
|
|
8469
8469
|
const h = s();
|
|
8470
|
-
return new
|
|
8470
|
+
return new fa(d.id, this.shapeFillId, h);
|
|
8471
8471
|
}, c = a.map(l).filter((d) => !!d);
|
|
8472
8472
|
return {
|
|
8473
8473
|
command: new L(c),
|
|
@@ -8517,7 +8517,7 @@ class Yo {
|
|
|
8517
8517
|
colors: g,
|
|
8518
8518
|
id: f,
|
|
8519
8519
|
svg: p,
|
|
8520
|
-
type:
|
|
8520
|
+
type: F.Illustration,
|
|
8521
8521
|
y: u.top,
|
|
8522
8522
|
x: u.left,
|
|
8523
8523
|
rotation: u.rotation,
|
|
@@ -8601,7 +8601,7 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8601
8601
|
m || (c = !1);
|
|
8602
8602
|
}
|
|
8603
8603
|
return [null, null];
|
|
8604
|
-
},
|
|
8604
|
+
}, ve = (n, t, e, a, i) => {
|
|
8605
8605
|
let r, o;
|
|
8606
8606
|
const s = yt(t.assetUrl), l = s.getFont();
|
|
8607
8607
|
if (i.size) {
|
|
@@ -8619,16 +8619,16 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8619
8619
|
const A = d / l.unitsPerEm;
|
|
8620
8620
|
return [r, o] = aa(e, a, d, A, s), [d, r, o];
|
|
8621
8621
|
}, na = 30;
|
|
8622
|
-
class
|
|
8622
|
+
class Te extends Error {
|
|
8623
8623
|
constructor(t) {
|
|
8624
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
8624
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Te.name;
|
|
8625
8625
|
}
|
|
8626
8626
|
}
|
|
8627
8627
|
const _o = ["‘", "’", "“", "”", `
|
|
8628
8628
|
`];
|
|
8629
|
-
class
|
|
8629
|
+
class Ne extends Error {
|
|
8630
8630
|
constructor(t) {
|
|
8631
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
8631
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ne.name;
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
class Xo {
|
|
@@ -8650,7 +8650,7 @@ class Xo {
|
|
|
8650
8650
|
}, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, i) => {
|
|
8651
8651
|
let r;
|
|
8652
8652
|
a.data && a.data.maxLength && e.length > a.data.maxLength && (r || (r = {}), r.hitCharacterLimit = !0);
|
|
8653
|
-
const o = i.getWorkflowExperience().getProfanityList(), s =
|
|
8653
|
+
const o = i.getWorkflowExperience().getProfanityList(), s = ca(t.toLowerCase());
|
|
8654
8654
|
for (const c of s)
|
|
8655
8655
|
for (const d in o) {
|
|
8656
8656
|
const A = o[d].toLowerCase().replace(/\s/g, "");
|
|
@@ -8670,7 +8670,7 @@ class Xo {
|
|
|
8670
8670
|
if (a)
|
|
8671
8671
|
await this.reload(t, e, a);
|
|
8672
8672
|
else {
|
|
8673
|
-
const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await
|
|
8673
|
+
const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await pa(o) : void 0, l = s ? {
|
|
8674
8674
|
src: s.src,
|
|
8675
8675
|
height: s.height,
|
|
8676
8676
|
width: s.width,
|
|
@@ -8777,7 +8777,7 @@ class Xo {
|
|
|
8777
8777
|
const a = e.variants?.map((i) => i.asset?.fileLink)?.filter((i) => !!i) || [];
|
|
8778
8778
|
return Promise.all(
|
|
8779
8779
|
a.map(async (i) => {
|
|
8780
|
-
const r = await
|
|
8780
|
+
const r = await pa(i);
|
|
8781
8781
|
return {
|
|
8782
8782
|
src: i,
|
|
8783
8783
|
width: r.width,
|
|
@@ -8840,7 +8840,7 @@ class Xo {
|
|
|
8840
8840
|
}
|
|
8841
8841
|
getProcessedInput(t, e, a) {
|
|
8842
8842
|
const i = a ? t : this.injectReplaceableText(t, e);
|
|
8843
|
-
return
|
|
8843
|
+
return ke(i, {
|
|
8844
8844
|
vertical: e.vertical,
|
|
8845
8845
|
uppercase: e.uppercase
|
|
8846
8846
|
});
|
|
@@ -8857,7 +8857,7 @@ class Xo {
|
|
|
8857
8857
|
const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
|
8858
8858
|
for (const u of e) {
|
|
8859
8859
|
if (!u.fontData) throw new R("Failed to resolve font data for text.");
|
|
8860
|
-
const [h, m] =
|
|
8860
|
+
const [h, m] = ve(
|
|
8861
8861
|
u.fontSize,
|
|
8862
8862
|
u.fontData,
|
|
8863
8863
|
{ left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
|
|
@@ -8924,7 +8924,7 @@ class Xo {
|
|
|
8924
8924
|
u,
|
|
8925
8925
|
async () => {
|
|
8926
8926
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
|
8927
|
-
const g = s.map((S) => new
|
|
8927
|
+
const g = s.map((S) => new en(S.id, A)), f = new L(g);
|
|
8928
8928
|
e.getCommandDispatcher()(f);
|
|
8929
8929
|
}
|
|
8930
8930
|
), s.length === 0 && l) {
|
|
@@ -9027,7 +9027,7 @@ class Xo {
|
|
|
9027
9027
|
async selectVariantCommand(t, e, a, i, r, o, s, l, c) {
|
|
9028
9028
|
const d = r.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
|
9029
9029
|
if (i.length > 0) {
|
|
9030
|
-
const u = i.map((p) => new
|
|
9030
|
+
const u = i.map((p) => new en(p.id, A));
|
|
9031
9031
|
if (l) {
|
|
9032
9032
|
const p = i.map((g) => new ta(g.id, l));
|
|
9033
9033
|
u.push(...p);
|
|
@@ -9109,7 +9109,7 @@ class Xo {
|
|
|
9109
9109
|
const m = o.getLayouts().find((g) => g.panelId === u.panelId), p = M();
|
|
9110
9110
|
try {
|
|
9111
9111
|
if (!m)
|
|
9112
|
-
throw new
|
|
9112
|
+
throw new Ne("Failed to find layout for region: " + u.panelId);
|
|
9113
9113
|
const g = a.colorOption;
|
|
9114
9114
|
let f;
|
|
9115
9115
|
if (g && g.variants) {
|
|
@@ -9131,7 +9131,7 @@ class Xo {
|
|
|
9131
9131
|
rotation: u.rotation,
|
|
9132
9132
|
text: c,
|
|
9133
9133
|
input: s,
|
|
9134
|
-
type:
|
|
9134
|
+
type: F.Textbox,
|
|
9135
9135
|
vertical: a.vertical,
|
|
9136
9136
|
x: u.left,
|
|
9137
9137
|
y: u.top,
|
|
@@ -9142,9 +9142,9 @@ class Xo {
|
|
|
9142
9142
|
curved: a.curved,
|
|
9143
9143
|
paths: a.paths,
|
|
9144
9144
|
fillSpotColorDefinition: f
|
|
9145
|
-
}, b = [], E = /* @__PURE__ */ new Map(),
|
|
9145
|
+
}, b = [], E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
|
|
9146
9146
|
if (!I.fontData) throw new R("Failed to resolve font data for text.");
|
|
9147
|
-
const [x, T] =
|
|
9147
|
+
const [x, T] = ve(
|
|
9148
9148
|
I.fontSize,
|
|
9149
9149
|
I.fontData,
|
|
9150
9150
|
{
|
|
@@ -9158,7 +9158,7 @@ class Xo {
|
|
|
9158
9158
|
[c],
|
|
9159
9159
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9160
9160
|
);
|
|
9161
|
-
E.set(I.id, x),
|
|
9161
|
+
E.set(I.id, x), D.set(I.id, T);
|
|
9162
9162
|
const $ = a.curved || a.vertical ? c : (T || []).join(`
|
|
9163
9163
|
`);
|
|
9164
9164
|
b.push(
|
|
@@ -9172,10 +9172,10 @@ class Xo {
|
|
|
9172
9172
|
fontData: i
|
|
9173
9173
|
};
|
|
9174
9174
|
} catch (g) {
|
|
9175
|
-
throw console.log(g), new
|
|
9175
|
+
throw console.log(g), new Te("Error adding font to region");
|
|
9176
9176
|
}
|
|
9177
9177
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
|
9178
|
-
throw u instanceof
|
|
9178
|
+
throw u instanceof Te ? (Ko.setLatestToast("Failed to load font.", qe.Error), u) : u instanceof Ne ? u : new Error(u);
|
|
9179
9179
|
});
|
|
9180
9180
|
return await o.setSelectionsAndElements(
|
|
9181
9181
|
t,
|
|
@@ -9205,23 +9205,23 @@ class Xo {
|
|
|
9205
9205
|
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = xt(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
9206
9206
|
for (const b of m)
|
|
9207
9207
|
if (b.region) {
|
|
9208
|
-
const [E,
|
|
9208
|
+
const [E, D] = ve(
|
|
9209
9209
|
e,
|
|
9210
9210
|
a,
|
|
9211
9211
|
b.region,
|
|
9212
9212
|
[h],
|
|
9213
9213
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9214
9214
|
);
|
|
9215
|
-
p.set(b.id, E), g.set(b.id,
|
|
9215
|
+
p.set(b.id, E), g.set(b.id, D);
|
|
9216
9216
|
}
|
|
9217
9217
|
const S = (() => {
|
|
9218
9218
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
|
9219
9219
|
return d && d(!0), { info: "0" };
|
|
9220
|
-
const b = o.getWorkflowExperience().getProfanityList(), E =
|
|
9221
|
-
for (const
|
|
9220
|
+
const b = o.getWorkflowExperience().getProfanityList(), E = ca(h.toLowerCase());
|
|
9221
|
+
for (const D of E)
|
|
9222
9222
|
for (const x in b) {
|
|
9223
9223
|
const T = b[x].toLowerCase().replace(/\s/g, "");
|
|
9224
|
-
if (
|
|
9224
|
+
if (D === T)
|
|
9225
9225
|
return l(!0), { error: "Blocked profanity." };
|
|
9226
9226
|
}
|
|
9227
9227
|
return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
|
|
@@ -9259,13 +9259,13 @@ const ts = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
|
|
|
9259
9259
|
const e = at("rect");
|
|
9260
9260
|
return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
|
|
9261
9261
|
}, as = (n, t, e, a) => {
|
|
9262
|
-
const i =
|
|
9262
|
+
const i = de("filter");
|
|
9263
9263
|
i.setAttribute("id", a), i.setAttribute("height", "200%"), i.setAttribute("width", "200%"), i.setAttribute("x", "-50%"), i.setAttribute("y", "-50%");
|
|
9264
|
-
const r =
|
|
9264
|
+
const r = de("feOffset");
|
|
9265
9265
|
i.appendChild(r), r.setAttribute("result", "offOut"), r.setAttribute("in", "SourceAlpha"), r.setAttribute("dx", `${n}`), r.setAttribute("dy", `${t}`);
|
|
9266
|
-
const o =
|
|
9266
|
+
const o = de("feGaussianBlur");
|
|
9267
9267
|
i.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
|
|
9268
|
-
const s =
|
|
9268
|
+
const s = de("feBlend");
|
|
9269
9269
|
return i.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), i;
|
|
9270
9270
|
}, ns = (n) => {
|
|
9271
9271
|
let t = n;
|
|
@@ -9287,7 +9287,7 @@ function rs(n, t, e, a) {
|
|
|
9287
9287
|
const i = e / n, r = a / t;
|
|
9288
9288
|
return i > 1 && r > 1 ? Math.min(i, r) : i > 1 && r < 1 ? r : i < 1 && r > 1 ? i : Math.min(i, r);
|
|
9289
9289
|
}
|
|
9290
|
-
const
|
|
9290
|
+
const nn = {
|
|
9291
9291
|
m: ["x", "y"],
|
|
9292
9292
|
z: [],
|
|
9293
9293
|
l: ["x", "y"],
|
|
@@ -9317,7 +9317,7 @@ class os {
|
|
|
9317
9317
|
const i = (r) => {
|
|
9318
9318
|
const o = [], s = r.relative ? r.type : r.type.toUpperCase();
|
|
9319
9319
|
let l = e !== s;
|
|
9320
|
-
const c =
|
|
9320
|
+
const c = nn[r.type];
|
|
9321
9321
|
l && (o.push(s), e = s);
|
|
9322
9322
|
for (const d of c) {
|
|
9323
9323
|
const A = r[d];
|
|
@@ -9330,7 +9330,7 @@ class os {
|
|
|
9330
9330
|
u = (A * 100 | 0) / 100;
|
|
9331
9331
|
break;
|
|
9332
9332
|
default:
|
|
9333
|
-
throw new
|
|
9333
|
+
throw new Ft("Failed to encode path.");
|
|
9334
9334
|
}
|
|
9335
9335
|
l || o.push(" "), o.push(u), l = !1;
|
|
9336
9336
|
}
|
|
@@ -9342,14 +9342,14 @@ class os {
|
|
|
9342
9342
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, i = [];
|
|
9343
9343
|
let r;
|
|
9344
9344
|
for (e.lastIndex = 0; r = e.exec(t); ) {
|
|
9345
|
-
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c =
|
|
9345
|
+
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = nn[o];
|
|
9346
9346
|
if (s.length < c.length)
|
|
9347
|
-
throw new
|
|
9347
|
+
throw new Ft(
|
|
9348
9348
|
`Path type "${o}" given ${s.length} arguments, expected ${c.length}.`
|
|
9349
9349
|
);
|
|
9350
9350
|
if (c.length > 0) {
|
|
9351
9351
|
if (s.length % c.length !== 0)
|
|
9352
|
-
throw new
|
|
9352
|
+
throw new Ft(
|
|
9353
9353
|
`Path type "${o}" given ${s.length} arguments, not divisible by ${c.length}`
|
|
9354
9354
|
);
|
|
9355
9355
|
for (let d = 0; d < s.length / c.length; d++) {
|
|
@@ -9374,7 +9374,7 @@ class os {
|
|
|
9374
9374
|
if (s in r && l in r) {
|
|
9375
9375
|
const c = [r[s], r[l]], d = e(c);
|
|
9376
9376
|
if (d.length < 2)
|
|
9377
|
-
throw new
|
|
9377
|
+
throw new Ft("Transformer must return at least 2 points.");
|
|
9378
9378
|
r[s] = d[0], r[l] = d[1];
|
|
9379
9379
|
}
|
|
9380
9380
|
}
|
|
@@ -9417,8 +9417,8 @@ class ss extends Zo {
|
|
|
9417
9417
|
b.setAttribute("d", d), b.setAttribute("stroke", "black"), b.setAttribute("stroke-width", "3"), I.appendChild(b);
|
|
9418
9418
|
const E = at("g");
|
|
9419
9419
|
E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = b.outerHTML;
|
|
9420
|
-
const
|
|
9421
|
-
|
|
9420
|
+
const D = at("g");
|
|
9421
|
+
D.classList.add("module-layer1"), w.appendChild(D), D.setAttribute("stroke-width", "3"), D.setAttribute("stroke", "rgb(45,41,38)"), D.setAttribute("fill", "rgb(45,41,38)"), D.setAttribute("transform", "translate(0.5,0)"), D.innerHTML = s;
|
|
9422
9422
|
const x = at("g");
|
|
9423
9423
|
x.classList.add("module-layer2"), w.appendChild(x), x.setAttribute("fill", "rgb(255,209,0)"), x.setAttribute("transform", "translate(1,-0.1)"), x.innerHTML = s;
|
|
9424
9424
|
const T = at("g");
|
|
@@ -9458,8 +9458,8 @@ const ls = [
|
|
|
9458
9458
|
"tspan"
|
|
9459
9459
|
], cs = async (n, t, e) => {
|
|
9460
9460
|
const a = t.data, i = e.data.baseUrl, r = a.assetUrl.replace("localhost", "localstack"), o = i.slice(0, 4) === "http" ? "" : "https://", s = new URL(o + i);
|
|
9461
|
-
s.searchParams.append("video",
|
|
9462
|
-
const l = s.toString(), d = `data:image/svg+xml;base64,${
|
|
9461
|
+
s.searchParams.append("video", Ha(JSON.stringify([{ href: r }]))), s.pathname = s.pathname + (s.pathname.slice(-1) === "/" ? "" : "/");
|
|
9462
|
+
const l = s.toString(), d = `data:image/svg+xml;base64,${Ha(await Sn(l, { type: "svg" }))}`, A = (h) => {
|
|
9463
9463
|
const m = n.find((g) => g.panelId === h.panelId);
|
|
9464
9464
|
if (!m)
|
|
9465
9465
|
throw new K(h);
|
|
@@ -9468,7 +9468,7 @@ const ls = [
|
|
|
9468
9468
|
{
|
|
9469
9469
|
id: p,
|
|
9470
9470
|
src: d,
|
|
9471
|
-
type:
|
|
9471
|
+
type: F.Image,
|
|
9472
9472
|
y: h.top,
|
|
9473
9473
|
x: h.left,
|
|
9474
9474
|
width: h.width,
|
|
@@ -9484,15 +9484,15 @@ const ls = [
|
|
|
9484
9484
|
return console.error(h), [];
|
|
9485
9485
|
}
|
|
9486
9486
|
}, ds = async (n, t, e, a) => {
|
|
9487
|
-
const i = e.data, r = i.assetUrl, o = await
|
|
9487
|
+
const i = e.data, r = i.assetUrl, o = await pa(r);
|
|
9488
9488
|
try {
|
|
9489
9489
|
const s = Mo(i, a.option);
|
|
9490
9490
|
s && (t[a.stepName] = { selectedVariants: [s] });
|
|
9491
9491
|
const l = async (c) => {
|
|
9492
|
-
const d = await ti(c, s?.asset?.fileLink), A = await
|
|
9492
|
+
const d = await ti(c, s?.asset?.fileLink), A = await ze(d), u = M(), h = n.find((p) => p.panelId === c.panelId);
|
|
9493
9493
|
if (!h)
|
|
9494
9494
|
throw new K(c);
|
|
9495
|
-
const m =
|
|
9495
|
+
const m = Ta(
|
|
9496
9496
|
o,
|
|
9497
9497
|
A,
|
|
9498
9498
|
{
|
|
@@ -9507,7 +9507,7 @@ const ls = [
|
|
|
9507
9507
|
{
|
|
9508
9508
|
id: u,
|
|
9509
9509
|
path: A.path,
|
|
9510
|
-
type:
|
|
9510
|
+
type: F.Frame,
|
|
9511
9511
|
forceImageCover: a.data.forceImageCover,
|
|
9512
9512
|
x: c.left,
|
|
9513
9513
|
y: c.top,
|
|
@@ -9556,7 +9556,7 @@ const ls = [
|
|
|
9556
9556
|
const l = await nt(s, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = At().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
9557
9557
|
if (!m)
|
|
9558
9558
|
return console.error("Failed to read SVG."), [];
|
|
9559
|
-
|
|
9559
|
+
Pa(m);
|
|
9560
9560
|
const p = {};
|
|
9561
9561
|
Mt(m, (b) => {
|
|
9562
9562
|
ls.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
|
|
@@ -9565,18 +9565,18 @@ const ls = [
|
|
|
9565
9565
|
const x = E.value, $ = `spiff-fill-${x.replace(/\W/g, "")}`;
|
|
9566
9566
|
b.classList.add($), p[$] = { browserValue: x };
|
|
9567
9567
|
}
|
|
9568
|
-
const
|
|
9569
|
-
if (
|
|
9570
|
-
const x =
|
|
9568
|
+
const D = b.attributes.getNamedItem("stroke");
|
|
9569
|
+
if (D && D.value !== "none") {
|
|
9570
|
+
const x = D.value, $ = `spiff-stroke-${x.replace(/\W/g, "")}`;
|
|
9571
9571
|
b.classList.add($), p[$] = { browserValue: x };
|
|
9572
9572
|
}
|
|
9573
9573
|
});
|
|
9574
9574
|
const f = Pt().serializeToString(m), S = i.colors;
|
|
9575
9575
|
if (S) {
|
|
9576
9576
|
for (const [b, E] of Object.entries(p))
|
|
9577
|
-
for (const
|
|
9578
|
-
if (E.browserValue ===
|
|
9579
|
-
p[b] = { browserValue: S[
|
|
9577
|
+
for (const D of Object.keys(S))
|
|
9578
|
+
if (E.browserValue === D) {
|
|
9579
|
+
p[b] = { browserValue: S[D] };
|
|
9580
9580
|
break;
|
|
9581
9581
|
}
|
|
9582
9582
|
}
|
|
@@ -9584,13 +9584,13 @@ const ls = [
|
|
|
9584
9584
|
const E = n.find((x) => x.panelId === b.panelId);
|
|
9585
9585
|
if (!E)
|
|
9586
9586
|
throw new K(b);
|
|
9587
|
-
const
|
|
9587
|
+
const D = M();
|
|
9588
9588
|
return new H(
|
|
9589
9589
|
{
|
|
9590
9590
|
colors: p,
|
|
9591
|
-
id:
|
|
9591
|
+
id: D,
|
|
9592
9592
|
svg: f,
|
|
9593
|
-
type:
|
|
9593
|
+
type: F.Illustration,
|
|
9594
9594
|
y: b.top,
|
|
9595
9595
|
x: b.left,
|
|
9596
9596
|
rotation: b.rotation,
|
|
@@ -9619,7 +9619,7 @@ const ls = [
|
|
|
9619
9619
|
colors: {},
|
|
9620
9620
|
id: d,
|
|
9621
9621
|
svg: s,
|
|
9622
|
-
type:
|
|
9622
|
+
type: F.Illustration,
|
|
9623
9623
|
y: l.top,
|
|
9624
9624
|
x: l.left,
|
|
9625
9625
|
rotation: l.rotation,
|
|
@@ -9660,7 +9660,7 @@ const ls = [
|
|
|
9660
9660
|
{
|
|
9661
9661
|
id: u,
|
|
9662
9662
|
src: s,
|
|
9663
|
-
type:
|
|
9663
|
+
type: F.Image,
|
|
9664
9664
|
y: d.top,
|
|
9665
9665
|
x: d.left,
|
|
9666
9666
|
rotation: d.rotation,
|
|
@@ -9717,7 +9717,7 @@ const ls = [
|
|
|
9717
9717
|
colors: h,
|
|
9718
9718
|
id: m,
|
|
9719
9719
|
svg: A,
|
|
9720
|
-
type:
|
|
9720
|
+
type: F.Illustration,
|
|
9721
9721
|
y: c.top,
|
|
9722
9722
|
x: c.left,
|
|
9723
9723
|
rotation: c.rotation,
|
|
@@ -9736,7 +9736,7 @@ const ls = [
|
|
|
9736
9736
|
return console.error(c), [];
|
|
9737
9737
|
}
|
|
9738
9738
|
}, gs = async (n, t, e) => {
|
|
9739
|
-
const a = [], r = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ?
|
|
9739
|
+
const a = [], r = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? F.Image : (r.endsWith(".svg"), F.Illustration), l = t.data.regions;
|
|
9740
9740
|
if (s === "image")
|
|
9741
9741
|
try {
|
|
9742
9742
|
l.forEach((c) => {
|
|
@@ -9769,8 +9769,8 @@ const ls = [
|
|
|
9769
9769
|
const c = await nt(r, !0), d = (A) => {
|
|
9770
9770
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = At().parseFromString(m, "image/svg+xml").firstElementChild;
|
|
9771
9771
|
if (!f)
|
|
9772
|
-
throw new
|
|
9773
|
-
return
|
|
9772
|
+
throw new Ft("Failed to read SVG.");
|
|
9773
|
+
return Pa(f), Pt().serializeToString(f);
|
|
9774
9774
|
};
|
|
9775
9775
|
l.forEach((A) => {
|
|
9776
9776
|
const u = n.find((m) => m.panelId === A.panelId);
|
|
@@ -9820,7 +9820,7 @@ const ls = [
|
|
|
9820
9820
|
assetUrl: g,
|
|
9821
9821
|
name: f.names.fullName.en
|
|
9822
9822
|
};
|
|
9823
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u =
|
|
9823
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = ke(A, {
|
|
9824
9824
|
vertical: a.data.vertical,
|
|
9825
9825
|
uppercase: a.data.uppercase
|
|
9826
9826
|
}), h = async (g) => {
|
|
@@ -9845,7 +9845,7 @@ const ls = [
|
|
|
9845
9845
|
paths: a.data.paths,
|
|
9846
9846
|
rotation: g.rotation,
|
|
9847
9847
|
text: u,
|
|
9848
|
-
type:
|
|
9848
|
+
type: F.Textbox,
|
|
9849
9849
|
vertical: a.data.vertical,
|
|
9850
9850
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9851
9851
|
width: g.width,
|
|
@@ -9853,12 +9853,12 @@ const ls = [
|
|
|
9853
9853
|
y: g.top
|
|
9854
9854
|
};
|
|
9855
9855
|
if (d) {
|
|
9856
|
-
const [w, I] =
|
|
9856
|
+
const [w, I] = ve(
|
|
9857
9857
|
a.data.size || o,
|
|
9858
9858
|
d,
|
|
9859
9859
|
g,
|
|
9860
9860
|
[
|
|
9861
|
-
|
|
9861
|
+
ke(u, {
|
|
9862
9862
|
vertical: a.data.vertical,
|
|
9863
9863
|
uppercase: a.data.uppercase
|
|
9864
9864
|
})
|
|
@@ -10106,12 +10106,12 @@ class Es extends Wn {
|
|
|
10106
10106
|
l = g.width, c = g.height;
|
|
10107
10107
|
} else
|
|
10108
10108
|
l = r.width, c = r.height;
|
|
10109
|
-
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A =
|
|
10109
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ka(t.layoutState.layout, e, {
|
|
10110
10110
|
renderingConfiguration: {
|
|
10111
10111
|
purpose: Kt.ThreeD,
|
|
10112
10112
|
templatingContext: d
|
|
10113
10113
|
}
|
|
10114
|
-
}), u =
|
|
10114
|
+
}), u = Dn(A), h = await va.from(this.ctx, u, {
|
|
10115
10115
|
anonymousCrossOrigin: !0,
|
|
10116
10116
|
ignoreDimensions: !this.nonPOTSupport,
|
|
10117
10117
|
ignoreAnimation: !0,
|
|
@@ -10120,7 +10120,7 @@ class Es extends Wn {
|
|
|
10120
10120
|
enableRedraw: !1,
|
|
10121
10121
|
createCanvas: Ct,
|
|
10122
10122
|
createImage: ie,
|
|
10123
|
-
DOMParser:
|
|
10123
|
+
DOMParser: Ba(),
|
|
10124
10124
|
fetch
|
|
10125
10125
|
});
|
|
10126
10126
|
h.resize(l, c), await h.render(), this.onRender();
|
|
@@ -10145,7 +10145,7 @@ const Md = (n, t) => {
|
|
|
10145
10145
|
i = new L(e.map((l) => new ni(l))).apply(i);
|
|
10146
10146
|
const o = await Cs(n, t, e, a);
|
|
10147
10147
|
return new L(o).apply(i);
|
|
10148
|
-
},
|
|
10148
|
+
}, Ge = C`
|
|
10149
10149
|
fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
|
|
10150
10150
|
name
|
|
10151
10151
|
value
|
|
@@ -10168,7 +10168,7 @@ const Md = (n, t) => {
|
|
|
10168
10168
|
}
|
|
10169
10169
|
}
|
|
10170
10170
|
`, bs = C`
|
|
10171
|
-
${
|
|
10171
|
+
${Ge}
|
|
10172
10172
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
|
10173
10173
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
|
10174
10174
|
id
|
|
@@ -10178,7 +10178,7 @@ const Md = (n, t) => {
|
|
|
10178
10178
|
}
|
|
10179
10179
|
}
|
|
10180
10180
|
`, Is = C`
|
|
10181
|
-
${
|
|
10181
|
+
${Ge}
|
|
10182
10182
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
|
10183
10183
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
|
10184
10184
|
id
|
|
@@ -10188,7 +10188,7 @@ const Md = (n, t) => {
|
|
|
10188
10188
|
}
|
|
10189
10189
|
}
|
|
10190
10190
|
`, Bs = C`
|
|
10191
|
-
${
|
|
10191
|
+
${Ge}
|
|
10192
10192
|
query GetGlobalPropertyState($bundleId: String!) {
|
|
10193
10193
|
globalPropertyState(bundleId: $bundleId) {
|
|
10194
10194
|
id
|
|
@@ -10205,7 +10205,7 @@ const Md = (n, t) => {
|
|
|
10205
10205
|
bundleId: n
|
|
10206
10206
|
}
|
|
10207
10207
|
})).data.globalPropertyState, Ps = (n) => C`
|
|
10208
|
-
${
|
|
10208
|
+
${Le}
|
|
10209
10209
|
fragment ProductFields on Product {
|
|
10210
10210
|
id
|
|
10211
10211
|
basePrice
|
|
@@ -10249,7 +10249,7 @@ const Md = (n, t) => {
|
|
|
10249
10249
|
name
|
|
10250
10250
|
}
|
|
10251
10251
|
}
|
|
10252
|
-
`,
|
|
10252
|
+
`, Qa = (n) => C`
|
|
10253
10253
|
${Ps(n)}
|
|
10254
10254
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
10255
10255
|
id
|
|
@@ -10259,8 +10259,8 @@ const Md = (n, t) => {
|
|
|
10259
10259
|
...ProductFields
|
|
10260
10260
|
}
|
|
10261
10261
|
}
|
|
10262
|
-
`,
|
|
10263
|
-
${n ?
|
|
10262
|
+
`, We = (n, t = !1) => C`
|
|
10263
|
+
${n ? Qa(t) : ""}
|
|
10264
10264
|
fragment ProductCollectionFields on ProductCollection {
|
|
10265
10265
|
id
|
|
10266
10266
|
name
|
|
@@ -10346,12 +10346,14 @@ const Md = (n, t) => {
|
|
|
10346
10346
|
totalPriceSubunits
|
|
10347
10347
|
quoteId
|
|
10348
10348
|
orderId
|
|
10349
|
+
externalOrderId
|
|
10350
|
+
internalOrderId
|
|
10349
10351
|
workflowViewerLink
|
|
10350
10352
|
workflowViewerAmendLink
|
|
10351
10353
|
}
|
|
10352
|
-
`,
|
|
10353
|
-
${
|
|
10354
|
-
${
|
|
10354
|
+
`, Ds = (n) => C`
|
|
10355
|
+
${Ge}
|
|
10356
|
+
${We(n)}
|
|
10355
10357
|
${ui}
|
|
10356
10358
|
query GetBundle($id: String!) {
|
|
10357
10359
|
globalPropertyState(bundleId: $id) {
|
|
@@ -10384,7 +10386,7 @@ const Md = (n, t) => {
|
|
|
10384
10386
|
}
|
|
10385
10387
|
}
|
|
10386
10388
|
}
|
|
10387
|
-
`,
|
|
10389
|
+
`, rn = C`
|
|
10388
10390
|
query GetBundleStakeholders($id: String!) {
|
|
10389
10391
|
bundles(ids: [$id]) {
|
|
10390
10392
|
id
|
|
@@ -10429,7 +10431,7 @@ const Md = (n, t) => {
|
|
|
10429
10431
|
}
|
|
10430
10432
|
}
|
|
10431
10433
|
}
|
|
10432
|
-
`,
|
|
10434
|
+
`, Fs = C`
|
|
10433
10435
|
query GetBundlesForCustomer($id: String!) {
|
|
10434
10436
|
customers(ids: [$id]) {
|
|
10435
10437
|
bundleStakeholders {
|
|
@@ -10459,7 +10461,7 @@ const Md = (n, t) => {
|
|
|
10459
10461
|
}
|
|
10460
10462
|
}
|
|
10461
10463
|
`, xs = C`
|
|
10462
|
-
${
|
|
10464
|
+
${Qa(!1)}
|
|
10463
10465
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10464
10466
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
10465
10467
|
id
|
|
@@ -10492,7 +10494,7 @@ const Md = (n, t) => {
|
|
|
10492
10494
|
}
|
|
10493
10495
|
}
|
|
10494
10496
|
`, Ms = C`
|
|
10495
|
-
${
|
|
10497
|
+
${Qa(!0)}
|
|
10496
10498
|
query GetProductCollectionForProductsFeed(
|
|
10497
10499
|
$id: String!
|
|
10498
10500
|
$limit: Int
|
|
@@ -10524,7 +10526,7 @@ const Md = (n, t) => {
|
|
|
10524
10526
|
}
|
|
10525
10527
|
}
|
|
10526
10528
|
`, Ts = (n) => C`
|
|
10527
|
-
${
|
|
10529
|
+
${We(n)}
|
|
10528
10530
|
mutation CreateBundle(
|
|
10529
10531
|
$collectionId: String
|
|
10530
10532
|
$initialMetadata: [MetadataInput!]
|
|
@@ -10552,9 +10554,7 @@ const Md = (n, t) => {
|
|
|
10552
10554
|
}
|
|
10553
10555
|
}
|
|
10554
10556
|
}
|
|
10555
|
-
`, Ns = (
|
|
10556
|
-
${ce}
|
|
10557
|
-
${de(n)}
|
|
10557
|
+
`, Ns = () => C`
|
|
10558
10558
|
mutation DuplicateBundle(
|
|
10559
10559
|
$id: String!
|
|
10560
10560
|
$template: Boolean
|
|
@@ -10571,28 +10571,9 @@ const Md = (n, t) => {
|
|
|
10571
10571
|
) {
|
|
10572
10572
|
id
|
|
10573
10573
|
bundleOwnerId
|
|
10574
|
-
template
|
|
10575
|
-
bundleStateData
|
|
10576
|
-
metadata {
|
|
10577
|
-
key
|
|
10578
|
-
value
|
|
10579
|
-
}
|
|
10580
|
-
name
|
|
10581
10574
|
partner {
|
|
10582
10575
|
id
|
|
10583
10576
|
}
|
|
10584
|
-
productCollection {
|
|
10585
|
-
...ProductCollectionFields
|
|
10586
|
-
}
|
|
10587
|
-
transactions {
|
|
10588
|
-
id
|
|
10589
|
-
}
|
|
10590
|
-
globalPropertyState {
|
|
10591
|
-
id
|
|
10592
|
-
aspects {
|
|
10593
|
-
...GlobalPropertyStateAspectFields
|
|
10594
|
-
}
|
|
10595
|
-
}
|
|
10596
10577
|
}
|
|
10597
10578
|
}
|
|
10598
10579
|
`, ia = C`
|
|
@@ -10710,7 +10691,7 @@ const Md = (n, t) => {
|
|
|
10710
10691
|
}
|
|
10711
10692
|
}
|
|
10712
10693
|
`, Gs = (n) => C`
|
|
10713
|
-
${
|
|
10694
|
+
${We(n)}
|
|
10714
10695
|
mutation BundleAssignProductCollection($id: String!, $productCollectionId: String!) {
|
|
10715
10696
|
bundleAssignProductCollection(id: $id, collectionId: $productCollectionId) {
|
|
10716
10697
|
id
|
|
@@ -10872,7 +10853,7 @@ const Md = (n, t) => {
|
|
|
10872
10853
|
`;
|
|
10873
10854
|
var qe = /* @__PURE__ */ ((n) => (n.Error = "Error", n.Warning = "Warning", n.Info = "Info", n))(qe || {});
|
|
10874
10855
|
const el = 1e3;
|
|
10875
|
-
class
|
|
10856
|
+
class on extends Wn {
|
|
10876
10857
|
constructor(t) {
|
|
10877
10858
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
|
10878
10859
|
}
|
|
@@ -10931,7 +10912,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10931
10912
|
const t = this.experience.getTransaction().recipient, e = { recipient: t };
|
|
10932
10913
|
return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
|
|
10933
10914
|
const i = a.uniqueIdentifier ?? a.title ?? "";
|
|
10934
|
-
a.type ===
|
|
10915
|
+
a.type === Ee.FirstName ? e[i] = t?.firstName : a.type === Ee.LastName ? e[i] = t?.lastName : a.type === Ee.Custom && (a.customFieldIndex === 1 ? e[i] = t?.customField1 : a.customFieldIndex === 2 ? e[i] = t?.customField2 : a.customFieldIndex === 3 ? e[i] = t?.customField3 : a.customFieldIndex === 4 ? e[i] = t?.customField4 : a.customFieldIndex === 5 && (e[i] = t?.customField5), a.option && (e[i] = a.option.variants?.find((r) => r.id === e[i])?.name));
|
|
10935
10916
|
}), e;
|
|
10936
10917
|
}
|
|
10937
10918
|
async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p, g, f, S) {
|
|
@@ -10956,7 +10937,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10956
10937
|
customField4: p ?? w.recipient.customField4,
|
|
10957
10938
|
customField5: g ?? w.recipient.customField5,
|
|
10958
10939
|
conversionConfigurationId: f || w.recipient.conversionConfigurationId
|
|
10959
|
-
}, this.experience.callEvent(
|
|
10940
|
+
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
10960
10941
|
mutation: Xs,
|
|
10961
10942
|
errorPolicy: "all",
|
|
10962
10943
|
fetchPolicy: "no-cache",
|
|
@@ -11026,7 +11007,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11026
11007
|
customField4: p,
|
|
11027
11008
|
customField5: g,
|
|
11028
11009
|
conversionConfigurationId: f
|
|
11029
|
-
}, this.experience.callEvent(
|
|
11010
|
+
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
11030
11011
|
mutation: Zs,
|
|
11031
11012
|
errorPolicy: "all",
|
|
11032
11013
|
fetchPolicy: "no-cache",
|
|
@@ -11320,7 +11301,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11320
11301
|
};
|
|
11321
11302
|
if (!Jt(a, this.storage)) {
|
|
11322
11303
|
this.storage = a;
|
|
11323
|
-
const i = new
|
|
11304
|
+
const i = new tn(this.constructSerializableWorkflow());
|
|
11324
11305
|
this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
|
11325
11306
|
}
|
|
11326
11307
|
}
|
|
@@ -11339,7 +11320,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11339
11320
|
if (this.readOnly) return;
|
|
11340
11321
|
const t = this.serialize();
|
|
11341
11322
|
this.workflowStatePromiseQueue.enqueue(
|
|
11342
|
-
new
|
|
11323
|
+
new on(async () => {
|
|
11343
11324
|
await new Promise((e) => {
|
|
11344
11325
|
setTimeout(() => {
|
|
11345
11326
|
e();
|
|
@@ -11356,7 +11337,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11356
11337
|
async updateStateWithServerImmediate() {
|
|
11357
11338
|
if (this.readOnly) return;
|
|
11358
11339
|
const t = this.serialize();
|
|
11359
|
-
return new
|
|
11340
|
+
return new on(async () => {
|
|
11360
11341
|
await this.updateTransaction({
|
|
11361
11342
|
variables: {
|
|
11362
11343
|
id: this.experience.getTransaction().id,
|
|
@@ -11418,10 +11399,10 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11418
11399
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
|
11419
11400
|
const i = async (c, d, A) => {
|
|
11420
11401
|
if (c.type === v.SilentIllustration) {
|
|
11421
|
-
const u = await new
|
|
11402
|
+
const u = await new an(c, d).trigger();
|
|
11422
11403
|
return { step: c, results: u };
|
|
11423
11404
|
} else if (c.type === v.ProductOverlay) {
|
|
11424
|
-
const u = await new
|
|
11405
|
+
const u = await new an(
|
|
11425
11406
|
c,
|
|
11426
11407
|
d,
|
|
11427
11408
|
A
|
|
@@ -11507,11 +11488,11 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11507
11488
|
this.stepSelections = {
|
|
11508
11489
|
...this.stepSelections,
|
|
11509
11490
|
[t]: { selectedVariants: e }
|
|
11510
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((E,
|
|
11491
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((E, D) => E + D.selectedVariants.map((x) => x.priceModifier || 0).reduce((x, T) => x + T, 0), 0), r.steps.forEach((E) => {
|
|
11511
11492
|
bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
|
|
11512
11493
|
});
|
|
11513
11494
|
const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((E) => E.silentSteps).flat(), u = c.map((E) => E.silentSteps).flat().filter(
|
|
11514
|
-
(E) => !d.some((
|
|
11495
|
+
(E) => !d.some((D) => D.stepName === E.stepName)
|
|
11515
11496
|
);
|
|
11516
11497
|
d.forEach((E) => {
|
|
11517
11498
|
bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
|
|
@@ -11523,14 +11504,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11523
11504
|
[t]: a
|
|
11524
11505
|
}, this.removeElements(h);
|
|
11525
11506
|
const g = r.steps.find((E) => E.stepName === t);
|
|
11526
|
-
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((
|
|
11527
|
-
const f = h.map((E) => new Rt(E.id)), S = new
|
|
11507
|
+
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((D) => D.id));
|
|
11508
|
+
const f = h.map((E) => new Rt(E.id)), S = new tn(this.constructSerializableWorkflow()), w = [...p, ...f, S];
|
|
11528
11509
|
w.length > 0 && this.commandContext.apply(new L(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11529
11510
|
const I = this.getInvalidModelVariants(), b = this.modelContainer;
|
|
11530
11511
|
if (b) {
|
|
11531
11512
|
const E = I.map(
|
|
11532
|
-
(
|
|
11533
|
-
|
|
11513
|
+
(D) => b.applyModelVariant(
|
|
11514
|
+
D,
|
|
11534
11515
|
{
|
|
11535
11516
|
contextService: this.getLayoutPreviewService()
|
|
11536
11517
|
},
|
|
@@ -11560,7 +11541,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11560
11541
|
break;
|
|
11561
11542
|
case v.Illustration:
|
|
11562
11543
|
a.push(
|
|
11563
|
-
|
|
11544
|
+
Se.init(l, this, this.reloadedState)
|
|
11564
11545
|
);
|
|
11565
11546
|
break;
|
|
11566
11547
|
case v.Material:
|
|
@@ -11655,7 +11636,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11655
11636
|
}
|
|
11656
11637
|
};
|
|
11657
11638
|
jt.configurationPromiseMap = /* @__PURE__ */ new Map();
|
|
11658
|
-
let
|
|
11639
|
+
let Ca = jt;
|
|
11659
11640
|
class ot {
|
|
11660
11641
|
constructor(t) {
|
|
11661
11642
|
this.variantData = t;
|
|
@@ -11880,7 +11861,7 @@ class il extends et {
|
|
|
11880
11861
|
*/
|
|
11881
11862
|
async selectVariant(t) {
|
|
11882
11863
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
|
11883
|
-
return
|
|
11864
|
+
return Se.selectVariant(
|
|
11884
11865
|
this.step,
|
|
11885
11866
|
t.getResource(),
|
|
11886
11867
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -11922,7 +11903,7 @@ class il extends et {
|
|
|
11922
11903
|
const c = l.id.replace(/\W/g, "");
|
|
11923
11904
|
a ? i.set(c, { browserValue: e, pmsValue: a }) : i.set(c, e);
|
|
11924
11905
|
}
|
|
11925
|
-
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e),
|
|
11906
|
+
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e), Se.changeColors(
|
|
11926
11907
|
this.step,
|
|
11927
11908
|
this.manager.getRegionElements(this.step.stepName),
|
|
11928
11909
|
this.manager,
|
|
@@ -11934,7 +11915,7 @@ class il extends et {
|
|
|
11934
11915
|
return this.step.data.colorOption;
|
|
11935
11916
|
}
|
|
11936
11917
|
getAvailableColors() {
|
|
11937
|
-
return this.step.data.colorPickerEnabled ?
|
|
11918
|
+
return this.step.data.colorPickerEnabled ? Se.availableColors(this.step, this.manager) : Promise.resolve([]);
|
|
11938
11919
|
}
|
|
11939
11920
|
isColorPickerEnabled() {
|
|
11940
11921
|
return this.step.data.colorPickerEnabled ?? !1;
|
|
@@ -12341,7 +12322,7 @@ class hl extends et {
|
|
|
12341
12322
|
});
|
|
12342
12323
|
}
|
|
12343
12324
|
}
|
|
12344
|
-
class
|
|
12325
|
+
class me {
|
|
12345
12326
|
static get(t, e) {
|
|
12346
12327
|
switch (e.type) {
|
|
12347
12328
|
case v.DigitalContent:
|
|
@@ -12501,7 +12482,7 @@ const pl = async (n, t) => {
|
|
|
12501
12482
|
headers: e
|
|
12502
12483
|
}
|
|
12503
12484
|
})).data?.designCreateMany;
|
|
12504
|
-
},
|
|
12485
|
+
}, sn = (n, t, e) => {
|
|
12505
12486
|
const a = (r) => {
|
|
12506
12487
|
const o = {};
|
|
12507
12488
|
if (r.type === "Frame") {
|
|
@@ -12597,7 +12578,7 @@ const pl = async (n, t) => {
|
|
|
12597
12578
|
B.errors && console.log("Server Error:", U.message);
|
|
12598
12579
|
}), null) : Q ?? null;
|
|
12599
12580
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await n.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
|
12600
|
-
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l &&
|
|
12581
|
+
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && sn(l, t, !0), g = l && sn(l, t, !1), f = async (x) => {
|
|
12601
12582
|
const T = {};
|
|
12602
12583
|
let $ = 0;
|
|
12603
12584
|
if (Object.keys(r).length > 0)
|
|
@@ -12636,7 +12617,7 @@ const pl = async (n, t) => {
|
|
|
12636
12617
|
const x = await (await it(E)).blob();
|
|
12637
12618
|
E = (await V.uploadAsset(
|
|
12638
12619
|
{ name: `${i.id}-preview-image.png`, blob: x },
|
|
12639
|
-
|
|
12620
|
+
Ie.Image,
|
|
12640
12621
|
!0,
|
|
12641
12622
|
!1
|
|
12642
12623
|
)).fileLink;
|
|
@@ -12857,8 +12838,8 @@ const ra = new Sl(), vl = C`
|
|
|
12857
12838
|
id
|
|
12858
12839
|
}
|
|
12859
12840
|
}
|
|
12860
|
-
`,
|
|
12861
|
-
${
|
|
12841
|
+
`, ln = C`
|
|
12842
|
+
${Le}
|
|
12862
12843
|
${oe}
|
|
12863
12844
|
mutation TransactionUpdateIntegrationProduct($id: String!, $integrationProductId: String) {
|
|
12864
12845
|
transactionUpdateIntegrationProduct(id: $id, integrationProductId: $integrationProductId) {
|
|
@@ -12946,7 +12927,7 @@ const ra = new Sl(), vl = C`
|
|
|
12946
12927
|
}
|
|
12947
12928
|
}
|
|
12948
12929
|
`;
|
|
12949
|
-
var
|
|
12930
|
+
var wa = /* @__PURE__ */ ((n) => (n.PriceBreakChanged = "PriceBreakChanged", n.ProductChanged = "ProductChanged", n.QuantityChanged = "QuantityChanged", n.RecipientChanged = "RecipientChanged", n.SelectionChanged = "SelectionChanged", n))(wa || {});
|
|
12950
12931
|
class Il {
|
|
12951
12932
|
constructor(t, e) {
|
|
12952
12933
|
this.cachedStepHandles = /* @__PURE__ */ new Map(), this.profanityList = [], this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = vn(async () => {
|
|
@@ -12962,7 +12943,7 @@ class Il {
|
|
|
12962
12943
|
} catch (o) {
|
|
12963
12944
|
r(o);
|
|
12964
12945
|
}
|
|
12965
|
-
}), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new
|
|
12946
|
+
}), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new Ca(
|
|
12966
12947
|
this,
|
|
12967
12948
|
t,
|
|
12968
12949
|
(a) => {
|
|
@@ -13008,7 +12989,7 @@ class Il {
|
|
|
13008
12989
|
async setProduct(t) {
|
|
13009
12990
|
this.workflow = void 0;
|
|
13010
12991
|
const e = await this.graphQlClient().mutate({
|
|
13011
|
-
mutation:
|
|
12992
|
+
mutation: ln,
|
|
13012
12993
|
variables: {
|
|
13013
12994
|
id: this.getTransaction().id,
|
|
13014
12995
|
integrationProductId: t
|
|
@@ -13048,7 +13029,7 @@ class Il {
|
|
|
13048
13029
|
"ProductChanged"
|
|
13049
13030
|
/* ProductChanged */
|
|
13050
13031
|
), await this.graphQlClient().mutate({
|
|
13051
|
-
mutation:
|
|
13032
|
+
mutation: ln,
|
|
13052
13033
|
variables: {
|
|
13053
13034
|
id: this.getTransaction().id
|
|
13054
13035
|
}
|
|
@@ -13130,20 +13111,20 @@ class Il {
|
|
|
13130
13111
|
height: d.layoutState.layout.height
|
|
13131
13112
|
}, u = this.workflowManager.getCommandContext().getLayoutById(d.layoutState.layout.id), h = o.getContext("2d");
|
|
13132
13113
|
if (!h)
|
|
13133
|
-
throw new
|
|
13134
|
-
const m = this.workflowManager.getTemplatingContext(), p =
|
|
13114
|
+
throw new Re("Failed to obtain 2D context for preview image creation");
|
|
13115
|
+
const m = this.workflowManager.getTemplatingContext(), p = ka(u.layoutState.layout, u.layoutState.elements, {
|
|
13135
13116
|
renderingConfiguration: {
|
|
13136
13117
|
purpose: Kt.Print,
|
|
13137
13118
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
13138
13119
|
templatingContext: m
|
|
13139
13120
|
}
|
|
13140
|
-
}), g =
|
|
13141
|
-
await (await
|
|
13121
|
+
}), g = Dn(p);
|
|
13122
|
+
await (await va.from(h, g, {
|
|
13142
13123
|
anonymousCrossOrigin: !0,
|
|
13143
13124
|
ignoreDimensions: !1,
|
|
13144
13125
|
createCanvas: Ct,
|
|
13145
13126
|
createImage: ie,
|
|
13146
|
-
DOMParser:
|
|
13127
|
+
DOMParser: Ba(),
|
|
13147
13128
|
fetch
|
|
13148
13129
|
})).render();
|
|
13149
13130
|
const S = await this.getCanvasObjectURLAsync(o);
|
|
@@ -13155,7 +13136,7 @@ class Il {
|
|
|
13155
13136
|
const a = this.cachedStepHandles.get(e.stepName);
|
|
13156
13137
|
if (a)
|
|
13157
13138
|
return a;
|
|
13158
|
-
const i =
|
|
13139
|
+
const i = me.get(this.getWorkflowManager(), e);
|
|
13159
13140
|
return this.cachedStepHandles.set(e.stepName, i), i;
|
|
13160
13141
|
}
|
|
13161
13142
|
getSteps() {
|
|
@@ -13252,17 +13233,17 @@ class Il {
|
|
|
13252
13233
|
getStepByName(t) {
|
|
13253
13234
|
const e = this.getWorkflow()?.steps.find((a) => a.stepTitle === t);
|
|
13254
13235
|
if (!(!e || !this.stepHasHandle(e)))
|
|
13255
|
-
return
|
|
13236
|
+
return me.get(this.getWorkflowManager(), e);
|
|
13256
13237
|
}
|
|
13257
13238
|
getStepsByType(t) {
|
|
13258
|
-
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) =>
|
|
13239
|
+
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) => me.get(this.getWorkflowManager(), e)) || [];
|
|
13259
13240
|
}
|
|
13260
13241
|
getStepsByScene(t) {
|
|
13261
13242
|
if (!this.getWorkflow()?.stepGroups.find((a) => a.name === t.name))
|
|
13262
13243
|
throw new Error(
|
|
13263
13244
|
"Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow."
|
|
13264
13245
|
);
|
|
13265
|
-
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) =>
|
|
13246
|
+
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) => me.get(this.getWorkflowManager(), a));
|
|
13266
13247
|
}
|
|
13267
13248
|
async attachCustomerDetails(t) {
|
|
13268
13249
|
return this.assignCustomerDetails({ emailAddress: t.email });
|
|
@@ -13492,7 +13473,7 @@ const Bl = (n) => {
|
|
|
13492
13473
|
}
|
|
13493
13474
|
return !1;
|
|
13494
13475
|
};
|
|
13495
|
-
class
|
|
13476
|
+
class Dl {
|
|
13496
13477
|
constructor(t) {
|
|
13497
13478
|
this.handleCache = {}, this.bundle = t;
|
|
13498
13479
|
}
|
|
@@ -13534,16 +13515,16 @@ class Fl {
|
|
|
13534
13515
|
async createHandle(t) {
|
|
13535
13516
|
switch (t.type) {
|
|
13536
13517
|
case G.FileUpload:
|
|
13537
|
-
return new
|
|
13518
|
+
return new Fl(this.bundle, t).initialize();
|
|
13538
13519
|
case G.ColorOption:
|
|
13539
|
-
return new
|
|
13520
|
+
return new cn(
|
|
13540
13521
|
this.bundle,
|
|
13541
13522
|
t,
|
|
13542
13523
|
t.entityId ? await J.getOption(t.entityId) : void 0
|
|
13543
13524
|
);
|
|
13544
13525
|
case G.Option: {
|
|
13545
13526
|
const e = t.entityId ? await J.getOption(t.entityId) : void 0;
|
|
13546
|
-
return e?.type === "Color" ? new
|
|
13527
|
+
return e?.type === "Color" ? new cn(this.bundle, t, e) : new pi(this.bundle, t, e);
|
|
13547
13528
|
}
|
|
13548
13529
|
case G.Text:
|
|
13549
13530
|
return new xl(this.bundle, t);
|
|
@@ -13552,7 +13533,7 @@ class Fl {
|
|
|
13552
13533
|
}
|
|
13553
13534
|
}
|
|
13554
13535
|
}
|
|
13555
|
-
class
|
|
13536
|
+
class Ra {
|
|
13556
13537
|
constructor(t, e) {
|
|
13557
13538
|
this.bundle = t, this.property = e;
|
|
13558
13539
|
}
|
|
@@ -13613,7 +13594,7 @@ class Oa {
|
|
|
13613
13594
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
13614
13595
|
}
|
|
13615
13596
|
}
|
|
13616
|
-
class
|
|
13597
|
+
class Fl extends Ra {
|
|
13617
13598
|
constructor(t, e) {
|
|
13618
13599
|
super(t, e);
|
|
13619
13600
|
}
|
|
@@ -13624,7 +13605,7 @@ class Dl extends Oa {
|
|
|
13624
13605
|
const t = await this.getImage();
|
|
13625
13606
|
if (t?.fileLink)
|
|
13626
13607
|
if (t?.fileLink.endsWith(".svg")) {
|
|
13627
|
-
const e = await nt(t?.fileLink), a = await
|
|
13608
|
+
const e = await nt(t?.fileLink), a = await Na(t?.fileLink), i = a.width, r = a.height, o = await lt(e);
|
|
13628
13609
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
|
13629
13610
|
o.colors[c.key] = {
|
|
13630
13611
|
browserValue: c.browserValue,
|
|
@@ -13667,7 +13648,7 @@ class Dl extends Oa {
|
|
|
13667
13648
|
]);
|
|
13668
13649
|
}
|
|
13669
13650
|
async canUseBackgroundRemover() {
|
|
13670
|
-
return this.bundle.getClient().canUseAddon(
|
|
13651
|
+
return this.bundle.getClient().canUseAddon(Ea.BackgroundRemover);
|
|
13671
13652
|
}
|
|
13672
13653
|
/**
|
|
13673
13654
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
|
@@ -13705,7 +13686,7 @@ class Dl extends Oa {
|
|
|
13705
13686
|
return V.getLocalOrFromServer(t);
|
|
13706
13687
|
}
|
|
13707
13688
|
async getImageWithColors() {
|
|
13708
|
-
return await this.loadImageData(), this.imageData?.svg ?
|
|
13689
|
+
return await this.loadImageData(), this.imageData?.svg ? ba(Fa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13709
13690
|
}
|
|
13710
13691
|
/**
|
|
13711
13692
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13839,7 +13820,7 @@ class Dl extends Oa {
|
|
|
13839
13820
|
);
|
|
13840
13821
|
}
|
|
13841
13822
|
}
|
|
13842
|
-
class xl extends
|
|
13823
|
+
class xl extends Ra {
|
|
13843
13824
|
constructor(t, e) {
|
|
13844
13825
|
super(t, e);
|
|
13845
13826
|
}
|
|
@@ -13878,7 +13859,7 @@ class xl extends Oa {
|
|
|
13878
13859
|
await Promise.all(i);
|
|
13879
13860
|
}
|
|
13880
13861
|
}
|
|
13881
|
-
class pi extends
|
|
13862
|
+
class pi extends Ra {
|
|
13882
13863
|
constructor(t, e, a) {
|
|
13883
13864
|
super(t, e), this.optionResource = a;
|
|
13884
13865
|
}
|
|
@@ -13940,7 +13921,7 @@ class pi extends Oa {
|
|
|
13940
13921
|
await Promise.all(i);
|
|
13941
13922
|
}
|
|
13942
13923
|
}
|
|
13943
|
-
class
|
|
13924
|
+
class cn extends pi {
|
|
13944
13925
|
constructor(t, e, a) {
|
|
13945
13926
|
super(t, e, a);
|
|
13946
13927
|
}
|
|
@@ -14002,15 +13983,15 @@ const kl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlo
|
|
|
14002
13983
|
});
|
|
14003
13984
|
return Math.max(...i);
|
|
14004
13985
|
};
|
|
14005
|
-
function
|
|
13986
|
+
function ya(n, t) {
|
|
14006
13987
|
function e(a) {
|
|
14007
13988
|
if (typeof a > "u" || !Array.isArray(a) && !Nl(a))
|
|
14008
13989
|
return a;
|
|
14009
13990
|
if (Array.isArray(a))
|
|
14010
|
-
return
|
|
13991
|
+
return ya(a, t);
|
|
14011
13992
|
let i = {};
|
|
14012
13993
|
for (const [r, o] of Object.entries(a))
|
|
14013
|
-
i[r] = Tl(o) ? o :
|
|
13994
|
+
i[r] = Tl(o) ? o : ya(o, t);
|
|
14014
13995
|
return Vi(i, t);
|
|
14015
13996
|
}
|
|
14016
13997
|
return Array.isArray(n) ? n.map(e) : e(n);
|
|
@@ -14027,17 +14008,17 @@ function fi(n) {
|
|
|
14027
14008
|
e.value !== "" && t.set(e.name, !0);
|
|
14028
14009
|
}), t;
|
|
14029
14010
|
}
|
|
14030
|
-
function
|
|
14031
|
-
return
|
|
14011
|
+
function ge(n) {
|
|
14012
|
+
return ya(n, ["__typename"]);
|
|
14032
14013
|
}
|
|
14033
14014
|
class Ql {
|
|
14034
14015
|
constructor(t, e, a, i, r) {
|
|
14035
14016
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = r;
|
|
14036
14017
|
const o = r?.existingGlobalPropertyState;
|
|
14037
14018
|
this.initPromise = o ? Promise.resolve(o).then(() => {
|
|
14038
|
-
console.log("Setting global property state to existing state."), this.globalPropertyState =
|
|
14019
|
+
console.log("Setting global property state to existing state."), this.globalPropertyState = ge(o), this.recalculateMandatoryStates();
|
|
14039
14020
|
}) : this.createGlobalPropertyState().then((s) => {
|
|
14040
|
-
console.log("Setting global property state to new state."), this.globalPropertyState =
|
|
14021
|
+
console.log("Setting global property state to new state."), this.globalPropertyState = ge(s), this.recalculateMandatoryStates();
|
|
14041
14022
|
}), this.onGlobalPropertyStateChange = i;
|
|
14042
14023
|
}
|
|
14043
14024
|
async clearAspects(t) {
|
|
@@ -14067,7 +14048,7 @@ class Ql {
|
|
|
14067
14048
|
async setGlobalPropertyState(t) {
|
|
14068
14049
|
this.globalPropertyState || await this.initPromise;
|
|
14069
14050
|
const e = It(this.globalPropertyState);
|
|
14070
|
-
this.globalPropertyState = { ...
|
|
14051
|
+
this.globalPropertyState = { ...ge(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
|
14071
14052
|
}
|
|
14072
14053
|
getAspectMandatoryFulfilled(t) {
|
|
14073
14054
|
return this.mandatoryFulfilledAspects.get(t);
|
|
@@ -14196,7 +14177,7 @@ class Ql {
|
|
|
14196
14177
|
}
|
|
14197
14178
|
});
|
|
14198
14179
|
if (t.data?.globalPropertyStateUpdate)
|
|
14199
|
-
this.globalPropertyState =
|
|
14180
|
+
this.globalPropertyState = ge(t.data.globalPropertyStateUpdate);
|
|
14200
14181
|
else
|
|
14201
14182
|
throw new Error("Unable to update global property state");
|
|
14202
14183
|
}
|
|
@@ -14435,14 +14416,14 @@ class Ci {
|
|
|
14435
14416
|
getProducts() {
|
|
14436
14417
|
if (!this.collection.productCollectionProducts)
|
|
14437
14418
|
throw new Error("Failed to find products on collection. Ensure you fetch them first!");
|
|
14438
|
-
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new
|
|
14419
|
+
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new pe(t));
|
|
14439
14420
|
}
|
|
14440
14421
|
/**
|
|
14441
14422
|
* A list of products in this collections with useful helpers for interacting with them.
|
|
14442
14423
|
*/
|
|
14443
14424
|
async fetchProducts(t) {
|
|
14444
14425
|
if (this.fullFetched)
|
|
14445
|
-
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
|
14426
|
+
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
|
|
14446
14427
|
const e = await y.getShadowGraphqlClient().query({
|
|
14447
14428
|
query: xs,
|
|
14448
14429
|
variables: {
|
|
@@ -14451,7 +14432,7 @@ class Ci {
|
|
|
14451
14432
|
},
|
|
14452
14433
|
errorPolicy: "all"
|
|
14453
14434
|
});
|
|
14454
|
-
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
|
14435
|
+
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
|
|
14455
14436
|
}
|
|
14456
14437
|
/**
|
|
14457
14438
|
* Returns a list of collections products matching the associated metafield/tag filters.
|
|
@@ -14541,7 +14522,7 @@ class Ci {
|
|
|
14541
14522
|
if (h || p.partial && (!p.data.productCollections || p.data.productCollections.length === 0 || !p.data.productCollections[0].productCollectionProductsFeed?.items || p.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
|
14542
14523
|
return;
|
|
14543
14524
|
c.abort(), h = !0, m.unsubscribe();
|
|
14544
|
-
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new
|
|
14525
|
+
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new pe(It(f))) || [];
|
|
14545
14526
|
u({
|
|
14546
14527
|
items: g,
|
|
14547
14528
|
// Clone items because it could be cached data (immutable)
|
|
@@ -14565,7 +14546,7 @@ class Ci {
|
|
|
14565
14546
|
return this.collection;
|
|
14566
14547
|
}
|
|
14567
14548
|
}
|
|
14568
|
-
class
|
|
14549
|
+
class pe {
|
|
14569
14550
|
constructor(t) {
|
|
14570
14551
|
this.product = t.product, this.productResource = t;
|
|
14571
14552
|
}
|
|
@@ -14758,7 +14739,7 @@ class zl {
|
|
|
14758
14739
|
}
|
|
14759
14740
|
}
|
|
14760
14741
|
const Gl = C`
|
|
14761
|
-
${
|
|
14742
|
+
${We(!1)}
|
|
14762
14743
|
query GetProductCollections($ids: [String!]!) {
|
|
14763
14744
|
productCollections(ids: $ids) {
|
|
14764
14745
|
...ProductCollectionFields
|
|
@@ -14834,7 +14815,7 @@ const ql = C`
|
|
|
14834
14815
|
}
|
|
14835
14816
|
}
|
|
14836
14817
|
`;
|
|
14837
|
-
class
|
|
14818
|
+
class dn {
|
|
14838
14819
|
constructor(t, e, a, i, r, o, s) {
|
|
14839
14820
|
this.workflowExperiences = [], this.eventEmitter = new Wl(), this.updatesLocked = !1, 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 = r, this.metadata = new Map(e.metadata?.map((d) => [d.key, d.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new Rl(e.bundleStateData);
|
|
14840
14821
|
const l = this.productCollection?.globalPropertyConfiguration;
|
|
@@ -14844,7 +14825,7 @@ class oa {
|
|
|
14844
14825
|
l,
|
|
14845
14826
|
this.onGlobalPropertiesChanged.bind(this),
|
|
14846
14827
|
o
|
|
14847
|
-
), this.globalPropertyHandleService = new
|
|
14828
|
+
), this.globalPropertyHandleService = new Dl(this), this.setPreviewService(a);
|
|
14848
14829
|
const c = new Promise((d, A) => {
|
|
14849
14830
|
if (o?.readonly) {
|
|
14850
14831
|
d([]);
|
|
@@ -15048,7 +15029,7 @@ class oa {
|
|
|
15048
15029
|
if (r)
|
|
15049
15030
|
switch (a.type) {
|
|
15050
15031
|
case G.FileUpload: {
|
|
15051
|
-
const o = r, s = await
|
|
15032
|
+
const o = r, s = await Fe([a.value]);
|
|
15052
15033
|
s.length > 0 && await o.selectImage(s[0]);
|
|
15053
15034
|
const l = a.storage?.colors;
|
|
15054
15035
|
if (l) {
|
|
@@ -15299,7 +15280,7 @@ class oa {
|
|
|
15299
15280
|
variables: {
|
|
15300
15281
|
id: this.id,
|
|
15301
15282
|
details: t,
|
|
15302
|
-
type: e ||
|
|
15283
|
+
type: e || Be.Owner
|
|
15303
15284
|
},
|
|
15304
15285
|
context: {
|
|
15305
15286
|
bundleOwnerId: this.ownerId
|
|
@@ -15338,7 +15319,7 @@ class oa {
|
|
|
15338
15319
|
}
|
|
15339
15320
|
async getAllStakeholders() {
|
|
15340
15321
|
const t = await y.getShadowGraphqlClient().query({
|
|
15341
|
-
query:
|
|
15322
|
+
query: rn,
|
|
15342
15323
|
errorPolicy: "all",
|
|
15343
15324
|
fetchPolicy: "no-cache",
|
|
15344
15325
|
variables: {
|
|
@@ -15354,7 +15335,7 @@ class oa {
|
|
|
15354
15335
|
}
|
|
15355
15336
|
async getCurrentStakeholder() {
|
|
15356
15337
|
const t = await y.getShadowGraphqlClient().query({
|
|
15357
|
-
query:
|
|
15338
|
+
query: rn,
|
|
15358
15339
|
errorPolicy: "all",
|
|
15359
15340
|
fetchPolicy: "no-cache",
|
|
15360
15341
|
variables: {
|
|
@@ -15710,14 +15691,14 @@ class Kl {
|
|
|
15710
15691
|
* @returns The nodes contained within the execution.
|
|
15711
15692
|
*/
|
|
15712
15693
|
getNodes() {
|
|
15713
|
-
return this.execution.nodes.map((t) => new
|
|
15694
|
+
return this.execution.nodes.map((t) => new fe(t));
|
|
15714
15695
|
}
|
|
15715
15696
|
/**
|
|
15716
15697
|
* @param type The type of node to return.
|
|
15717
15698
|
* @returns A list of nodes matching the requested type.
|
|
15718
15699
|
*/
|
|
15719
15700
|
getNodesByType(t) {
|
|
15720
|
-
return this.execution.nodes.filter((e) => e.type === t).map((e) => new
|
|
15701
|
+
return this.execution.nodes.filter((e) => e.type === t).map((e) => new fe(e));
|
|
15721
15702
|
}
|
|
15722
15703
|
/**
|
|
15723
15704
|
* @returns A list of input nodes that exist in this execution.
|
|
@@ -15726,7 +15707,7 @@ class Kl {
|
|
|
15726
15707
|
return this.execution.nodes.filter(
|
|
15727
15708
|
(t) => t.type === "StartTerminal"
|
|
15728
15709
|
/* StartTerminal */
|
|
15729
|
-
).map((t) => new
|
|
15710
|
+
).map((t) => new fe(t));
|
|
15730
15711
|
}
|
|
15731
15712
|
/**
|
|
15732
15713
|
* @returns A list of out put nodes that exist in this execution.
|
|
@@ -15735,7 +15716,7 @@ class Kl {
|
|
|
15735
15716
|
return this.execution.nodes.filter(
|
|
15736
15717
|
(t) => t.type === "EndTerminal"
|
|
15737
15718
|
/* EndTerminal */
|
|
15738
|
-
).map((t) => new
|
|
15719
|
+
).map((t) => new fe(t));
|
|
15739
15720
|
}
|
|
15740
15721
|
/**
|
|
15741
15722
|
* @returns A date object representing the point in time this execution completed.
|
|
@@ -15752,7 +15733,7 @@ class Kl {
|
|
|
15752
15733
|
return new Date(this.execution.failedAt);
|
|
15753
15734
|
}
|
|
15754
15735
|
}
|
|
15755
|
-
class
|
|
15736
|
+
class fe {
|
|
15756
15737
|
constructor(t) {
|
|
15757
15738
|
this.node = t;
|
|
15758
15739
|
}
|
|
@@ -15769,7 +15750,7 @@ class we {
|
|
|
15769
15750
|
return this.getArtifacts().get(t);
|
|
15770
15751
|
}
|
|
15771
15752
|
}
|
|
15772
|
-
class
|
|
15753
|
+
class Oa {
|
|
15773
15754
|
constructor(t) {
|
|
15774
15755
|
this.value = t;
|
|
15775
15756
|
}
|
|
@@ -15782,12 +15763,12 @@ class $a {
|
|
|
15782
15763
|
}
|
|
15783
15764
|
}
|
|
15784
15765
|
var _l = /* @__PURE__ */ ((n) => (n.Transaction = "Transaction", n.Bundle = "Bundle", n.Product = "Product", n.Variant = "Variant", n.Option = "Option", n.LineItem = "LineItem", n.Asset = "Asset", n))(_l || {});
|
|
15785
|
-
class Rd extends
|
|
15766
|
+
class Rd extends Oa {
|
|
15786
15767
|
constructor(t) {
|
|
15787
15768
|
super(`"${t}"`);
|
|
15788
15769
|
}
|
|
15789
15770
|
}
|
|
15790
|
-
class wi extends
|
|
15771
|
+
class wi extends Oa {
|
|
15791
15772
|
constructor(t, e) {
|
|
15792
15773
|
if (e !== "Asset" && !wi.validUUID(t))
|
|
15793
15774
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
|
@@ -15797,7 +15778,7 @@ class wi extends $a {
|
|
|
15797
15778
|
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);
|
|
15798
15779
|
}
|
|
15799
15780
|
}
|
|
15800
|
-
class Od extends
|
|
15781
|
+
class Od extends Oa {
|
|
15801
15782
|
constructor(t) {
|
|
15802
15783
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
|
15803
15784
|
}
|
|
@@ -15842,7 +15823,7 @@ class An {
|
|
|
15842
15823
|
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
|
|
15843
15824
|
}
|
|
15844
15825
|
}
|
|
15845
|
-
const
|
|
15826
|
+
const Ce = C`
|
|
15846
15827
|
query GetCustomer($emailAddress: String!) {
|
|
15847
15828
|
customer(emailAddress: $emailAddress) {
|
|
15848
15829
|
id
|
|
@@ -15990,7 +15971,7 @@ class ac {
|
|
|
15990
15971
|
}
|
|
15991
15972
|
async generateCode(t) {
|
|
15992
15973
|
const e = await this.cognitoClient?.send(
|
|
15993
|
-
new
|
|
15974
|
+
new Va({
|
|
15994
15975
|
AuthFlow: "CUSTOM_AUTH",
|
|
15995
15976
|
ClientId: this.userPoolClientId,
|
|
15996
15977
|
AuthParameters: {
|
|
@@ -16024,7 +16005,7 @@ class ac {
|
|
|
16024
16005
|
throw new Error("Failed to find existing tokens.");
|
|
16025
16006
|
const e = JSON.parse(t);
|
|
16026
16007
|
return await this.cognitoClient?.send(
|
|
16027
|
-
new
|
|
16008
|
+
new Va({
|
|
16028
16009
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
|
16029
16010
|
ClientId: this.userPoolClientId,
|
|
16030
16011
|
AuthParameters: {
|
|
@@ -16054,7 +16035,7 @@ class nc {
|
|
|
16054
16035
|
* @param currency The currency to determine precision for.
|
|
16055
16036
|
*/
|
|
16056
16037
|
getPrecisionForCurrency(t) {
|
|
16057
|
-
const e = t, a =
|
|
16038
|
+
const e = t, a = za.code(e);
|
|
16058
16039
|
return a ? a.digits : 2;
|
|
16059
16040
|
}
|
|
16060
16041
|
/**
|
|
@@ -16065,7 +16046,7 @@ class nc {
|
|
|
16065
16046
|
*/
|
|
16066
16047
|
getSpecialFormat(t) {
|
|
16067
16048
|
const e = t;
|
|
16068
|
-
if (
|
|
16049
|
+
if (za.code(e)?.code === "CLP")
|
|
16069
16050
|
return "USD0,0";
|
|
16070
16051
|
}
|
|
16071
16052
|
}
|
|
@@ -16167,7 +16148,7 @@ class $d {
|
|
|
16167
16148
|
} catch (a) {
|
|
16168
16149
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16169
16150
|
}
|
|
16170
|
-
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.
|
|
16151
|
+
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16171
16152
|
}
|
|
16172
16153
|
configure(t) {
|
|
16173
16154
|
ft.setHubUrl(t.hubUrl), ft.setServerUrl(t.serverUrl), ft.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 && sr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && zt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16217,7 +16198,7 @@ class $d {
|
|
|
16217
16198
|
*/
|
|
16218
16199
|
async authenticateBundleFromLocalStorage(t) {
|
|
16219
16200
|
if (k.getMap("bundleOwnerIds")?.has(t))
|
|
16220
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
|
16201
|
+
return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
|
|
16221
16202
|
const a = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16222
16203
|
if (a.has(t)) {
|
|
16223
16204
|
const i = a.get(t);
|
|
@@ -16261,7 +16242,7 @@ class $d {
|
|
|
16261
16242
|
if (i.isOrdered)
|
|
16262
16243
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
|
16263
16244
|
if (k.getMap("transactionOwnerIds")?.has(t))
|
|
16264
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
|
16245
|
+
return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
|
|
16265
16246
|
const s = k.getMap("transactionCustomerIds");
|
|
16266
16247
|
if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
|
|
16267
16248
|
const u = this.customer?.bundleStakeholders?.find(
|
|
@@ -16299,7 +16280,7 @@ class $d {
|
|
|
16299
16280
|
}
|
|
16300
16281
|
async customerHasBundleTemplates(t) {
|
|
16301
16282
|
const i = (await y.getShadowGraphqlClient().query({
|
|
16302
|
-
query:
|
|
16283
|
+
query: Ce,
|
|
16303
16284
|
errorPolicy: "all",
|
|
16304
16285
|
fetchPolicy: "no-cache",
|
|
16305
16286
|
variables: {
|
|
@@ -16318,7 +16299,7 @@ class $d {
|
|
|
16318
16299
|
async getOrCreateCustomer(t) {
|
|
16319
16300
|
this.customer = void 0;
|
|
16320
16301
|
const e = y.getShadowGraphqlClient(), i = (await e.query({
|
|
16321
|
-
query:
|
|
16302
|
+
query: Ce,
|
|
16322
16303
|
errorPolicy: "all",
|
|
16323
16304
|
fetchPolicy: "no-cache",
|
|
16324
16305
|
variables: {
|
|
@@ -16371,7 +16352,7 @@ class $d {
|
|
|
16371
16352
|
return this.logOut(), console.error("Failed to refresh tokens."), !1;
|
|
16372
16353
|
}
|
|
16373
16354
|
const s = (await y.getShadowGraphqlClient().query({
|
|
16374
|
-
query:
|
|
16355
|
+
query: Ce,
|
|
16375
16356
|
errorPolicy: "all",
|
|
16376
16357
|
fetchPolicy: "no-cache",
|
|
16377
16358
|
variables: {
|
|
@@ -16400,7 +16381,7 @@ class $d {
|
|
|
16400
16381
|
if (i?.AuthenticationResult) {
|
|
16401
16382
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(i.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16402
16383
|
const o = (await y.getShadowGraphqlClient().query({
|
|
16403
|
-
query:
|
|
16384
|
+
query: Ce,
|
|
16404
16385
|
errorPolicy: "all",
|
|
16405
16386
|
fetchPolicy: "no-cache",
|
|
16406
16387
|
variables: {
|
|
@@ -16467,7 +16448,7 @@ class $d {
|
|
|
16467
16448
|
o.set(r.id, r.partner.id), k.setMap("bundlePartnerIds", o);
|
|
16468
16449
|
const s = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16469
16450
|
s.set(r.id, r.bundleOwnerId), k.setMap("bundleOwnerIds", s);
|
|
16470
|
-
const l = new
|
|
16451
|
+
const l = new dn(this, r, void 0, void 0, r.bundleOwnerId, {
|
|
16471
16452
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
|
16472
16453
|
});
|
|
16473
16454
|
return await l.getInitializationPromise(), l;
|
|
@@ -16494,7 +16475,7 @@ class $d {
|
|
|
16494
16475
|
...l,
|
|
16495
16476
|
...i?.graphql?.additionalHeaders
|
|
16496
16477
|
}, d = await y.getShadowGraphqlClient().query({
|
|
16497
|
-
query:
|
|
16478
|
+
query: Ds(i?.graphql?.productCollection?.eagerFetchProducts || !1),
|
|
16498
16479
|
variables: {
|
|
16499
16480
|
id: t
|
|
16500
16481
|
},
|
|
@@ -16507,7 +16488,7 @@ class $d {
|
|
|
16507
16488
|
throw new Error(`Unable to find bundle: ${t}`);
|
|
16508
16489
|
const A = d.data?.bundles[0], u = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16509
16490
|
u.set(A.id, A.partner.id), k.setMap("bundlePartnerIds", u);
|
|
16510
|
-
const h = new
|
|
16491
|
+
const h = new dn(
|
|
16511
16492
|
this,
|
|
16512
16493
|
A,
|
|
16513
16494
|
e,
|
|
@@ -16534,7 +16515,7 @@ class $d {
|
|
|
16534
16515
|
...await Si(t),
|
|
16535
16516
|
...i?.graphql?.additionalHeaders
|
|
16536
16517
|
}, l = (await y.getShadowGraphqlClient().mutate({
|
|
16537
|
-
mutation: Ns(
|
|
16518
|
+
mutation: Ns(),
|
|
16538
16519
|
variables: {
|
|
16539
16520
|
id: t,
|
|
16540
16521
|
template: e,
|
|
@@ -16552,13 +16533,13 @@ class $d {
|
|
|
16552
16533
|
const c = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16553
16534
|
c.set(l.id, l.partner.id), k.setMap("bundlePartnerIds", c);
|
|
16554
16535
|
const d = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16555
|
-
return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => {
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
};
|
|
16536
|
+
return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => await this.getExistingBundle(l.id, void 0, void 0, {
|
|
16537
|
+
graphql: {
|
|
16538
|
+
productCollection: {
|
|
16539
|
+
eagerFetchProducts: i?.graphql?.productCollection?.eagerFetchProducts || !1
|
|
16540
|
+
}
|
|
16541
|
+
}
|
|
16542
|
+
});
|
|
16562
16543
|
}
|
|
16563
16544
|
/**
|
|
16564
16545
|
* Fetches information about the currently authenticated customer's bundles.
|
|
@@ -16590,7 +16571,7 @@ class $d {
|
|
|
16590
16571
|
if (!this.customer)
|
|
16591
16572
|
throw new Error("Customer not authenticated.");
|
|
16592
16573
|
const t = await y.getShadowGraphqlClient().query({
|
|
16593
|
-
query:
|
|
16574
|
+
query: Fs,
|
|
16594
16575
|
variables: {
|
|
16595
16576
|
id: this.customer.id
|
|
16596
16577
|
},
|
|
@@ -16627,7 +16608,7 @@ class $d {
|
|
|
16627
16608
|
throw new gt("No options provided!");
|
|
16628
16609
|
const r = t.map((B, Q) => ({ option: B, index: Q })), o = r.filter((B) => B.option.type === "transaction"), s = r.filter(
|
|
16629
16610
|
(B) => B.option.type === "integration" || B.option.type === "external" || B.option.type === "blank"
|
|
16630
|
-
), l = 50, c =
|
|
16611
|
+
), l = 50, c = La(o, l), d = La(s, l);
|
|
16631
16612
|
let A = 0;
|
|
16632
16613
|
const u = y.getShadowGraphqlClient(), h = async (B) => {
|
|
16633
16614
|
if (B.length === 0)
|
|
@@ -16692,7 +16673,7 @@ class $d {
|
|
|
16692
16673
|
), [S, w] = await Promise.all([
|
|
16693
16674
|
(async () => g.length > 0 ? await lc(g) : [])(),
|
|
16694
16675
|
(async () => f.length > 0 ? await yi(f, e) : [])()
|
|
16695
|
-
]), I = new Map(S.map((B) => [B.id, B])), b = new Map(w.map((B) => [B.id, B])), E = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(),
|
|
16676
|
+
]), I = new Map(S.map((B) => [B.id, B])), b = new Map(w.map((B) => [B.id, B])), E = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), D = p.map(async (B) => {
|
|
16696
16677
|
const { transaction: Q, workflowId: U, readOnly: N, index: q } = B, St = U ? b.get(U) : void 0, ut = t[q];
|
|
16697
16678
|
if (Q.integrationProductId) {
|
|
16698
16679
|
const rt = I.get(Q.integrationProductId);
|
|
@@ -16702,7 +16683,7 @@ class $d {
|
|
|
16702
16683
|
const He = E.get(Q.id) || void 0, bi = new ec({
|
|
16703
16684
|
onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16704
16685
|
onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
|
|
16705
|
-
}),
|
|
16686
|
+
}), ce = {
|
|
16706
16687
|
workflow: St,
|
|
16707
16688
|
transaction: Q,
|
|
16708
16689
|
singleVariantsRenderable: ut?.workflowConfiguration?.singleVariantsRenderable,
|
|
@@ -16718,13 +16699,13 @@ class $d {
|
|
|
16718
16699
|
};
|
|
16719
16700
|
if (ut.type === "transaction" && Q.workflowState) {
|
|
16720
16701
|
const rt = JSON.parse(Q.workflowState);
|
|
16721
|
-
await
|
|
16702
|
+
await Za(rt), ce.reloadedState = rt;
|
|
16722
16703
|
} else if (!N && ut.workflowState) {
|
|
16723
16704
|
const rt = JSON.parse(ut.workflowState);
|
|
16724
|
-
await
|
|
16705
|
+
await Za(rt), ce.reloadedState = rt;
|
|
16725
16706
|
}
|
|
16726
|
-
return
|
|
16727
|
-
}), x = await Promise.all(
|
|
16707
|
+
return ce.delayWorkflowStateSync = !0, { experienceOptions: ce, index: q, options: ut };
|
|
16708
|
+
}), x = await Promise.all(D);
|
|
16728
16709
|
k.setMap("transactionOwnerIds", E);
|
|
16729
16710
|
const T = x.sort((B, Q) => B.index - Q.index);
|
|
16730
16711
|
let $ = [];
|
|
@@ -16879,12 +16860,12 @@ function dc(n, t, e, a) {
|
|
|
16879
16860
|
const s = n, l = Math.max(t.width / e.width, t.height / e.height);
|
|
16880
16861
|
s.zoom = Math.max(l, n.zoom);
|
|
16881
16862
|
const c = e.width * s.zoom, d = e.height * s.zoom;
|
|
16882
|
-
return s.x =
|
|
16863
|
+
return s.x = we(n.x, t.width - c, 0), s.y = we(n.y, t.height - d, 0), s;
|
|
16883
16864
|
}
|
|
16884
16865
|
const o = n;
|
|
16885
|
-
return o.x =
|
|
16866
|
+
return o.x = we(o.x, -i, t.width), o.y = we(o.y, -r, t.height), o;
|
|
16886
16867
|
}
|
|
16887
|
-
function
|
|
16868
|
+
function we(n, t, e) {
|
|
16888
16869
|
return Math.min(Math.max(n, t), e);
|
|
16889
16870
|
}
|
|
16890
16871
|
class Ac {
|
|
@@ -16909,7 +16890,7 @@ class Ac {
|
|
|
16909
16890
|
if (i.currentFrameSources) {
|
|
16910
16891
|
let r = !1;
|
|
16911
16892
|
for (let o = 0; o < i.currentFrameSources.length; o++) {
|
|
16912
|
-
const s = i.currentFrameSources[o], l = await
|
|
16893
|
+
const s = i.currentFrameSources[o], l = await ze(s), c = this.frameData ? this.frameData[o] : void 0;
|
|
16913
16894
|
Jt(l, c) || (this.frameData || (this.frameData = new Array(i.currentFrameSources.length)), this.frameData[o] = l, r = !0);
|
|
16914
16895
|
}
|
|
16915
16896
|
r && (this.onFrameDataChangeListeners.forEach(
|
|
@@ -16962,8 +16943,8 @@ class Ac {
|
|
|
16962
16943
|
getImageSrc() {
|
|
16963
16944
|
if (this.imageData) {
|
|
16964
16945
|
if (this.imageData.svg) {
|
|
16965
|
-
const t =
|
|
16966
|
-
return
|
|
16946
|
+
const t = Fa(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
16947
|
+
return ba(t);
|
|
16967
16948
|
}
|
|
16968
16949
|
return this.imageData.src;
|
|
16969
16950
|
}
|
|
@@ -17099,7 +17080,7 @@ class Ac {
|
|
|
17099
17080
|
}
|
|
17100
17081
|
recalculateOffsets(t) {
|
|
17101
17082
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
|
17102
|
-
this.offsets[a] =
|
|
17083
|
+
this.offsets[a] = Ta(
|
|
17103
17084
|
t,
|
|
17104
17085
|
e,
|
|
17105
17086
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
|
@@ -17315,7 +17296,7 @@ class hc extends et {
|
|
|
17315
17296
|
* Returns `true` if the Background Remover is available for the current session.
|
|
17316
17297
|
*/
|
|
17317
17298
|
async canUseBackgroundRemover() {
|
|
17318
|
-
return this.manager.getClient().canUseAddon(
|
|
17299
|
+
return this.manager.getClient().canUseAddon(Ea.BackgroundRemover);
|
|
17319
17300
|
}
|
|
17320
17301
|
/**
|
|
17321
17302
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
|
@@ -17441,7 +17422,7 @@ const mc = C`
|
|
|
17441
17422
|
id
|
|
17442
17423
|
}
|
|
17443
17424
|
}
|
|
17444
|
-
`,
|
|
17425
|
+
`, $a = C`
|
|
17445
17426
|
query GetCustomerTransactions(
|
|
17446
17427
|
$id: String!
|
|
17447
17428
|
$limit: Int!
|
|
@@ -17608,7 +17589,7 @@ const mc = C`
|
|
|
17608
17589
|
},
|
|
17609
17590
|
context: t
|
|
17610
17591
|
}), Xd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17611
|
-
query:
|
|
17592
|
+
query: $a,
|
|
17612
17593
|
errorPolicy: "all",
|
|
17613
17594
|
fetchPolicy: "no-cache",
|
|
17614
17595
|
variables: {
|
|
@@ -17628,7 +17609,7 @@ const mc = C`
|
|
|
17628
17609
|
limit: t
|
|
17629
17610
|
}
|
|
17630
17611
|
}))?.data.customerTransactionsFeed?.items || [], Zd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17631
|
-
query:
|
|
17612
|
+
query: $a,
|
|
17632
17613
|
errorPolicy: "all",
|
|
17633
17614
|
fetchPolicy: "no-cache",
|
|
17634
17615
|
variables: {
|
|
@@ -17648,7 +17629,7 @@ const mc = C`
|
|
|
17648
17629
|
limit: t
|
|
17649
17630
|
}
|
|
17650
17631
|
}))?.data.customerTransactionsFeed?.items || [], tA = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17651
|
-
query:
|
|
17632
|
+
query: $a,
|
|
17652
17633
|
errorPolicy: "all",
|
|
17653
17634
|
fetchPolicy: "no-cache",
|
|
17654
17635
|
variables: {
|
|
@@ -17683,7 +17664,7 @@ const mc = C`
|
|
|
17683
17664
|
console.error("vite-plugin-css-injected-by-js", t);
|
|
17684
17665
|
}
|
|
17685
17666
|
})();
|
|
17686
|
-
var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}),
|
|
17667
|
+
var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}), Ee = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(Ee || {}), X;
|
|
17687
17668
|
X = { __e: function(n, t, e, a) {
|
|
17688
17669
|
for (var i, r, o; t = t.__; )
|
|
17689
17670
|
if ((i = t.__c) && !i.__)
|
|
@@ -17695,12 +17676,12 @@ X = { __e: function(n, t, e, a) {
|
|
|
17695
17676
|
}
|
|
17696
17677
|
throw n;
|
|
17697
17678
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
17698
|
-
var st,
|
|
17679
|
+
var st, oa, hn, vi = [], sa = [], mn = X.__b, gn = X.__r, pn = X.diffed, fn = X.__c, Cn = X.unmount;
|
|
17699
17680
|
function Ec() {
|
|
17700
17681
|
for (var n; n = vi.shift(); )
|
|
17701
17682
|
if (n.__P && n.__H)
|
|
17702
17683
|
try {
|
|
17703
|
-
n.__H.__h.forEach(
|
|
17684
|
+
n.__H.__h.forEach(be), n.__H.__h.forEach(Sa), n.__H.__h = [];
|
|
17704
17685
|
} catch (t) {
|
|
17705
17686
|
n.__H.__h = [], X.__e(t, n.__v);
|
|
17706
17687
|
}
|
|
@@ -17710,20 +17691,20 @@ X.__b = function(n) {
|
|
|
17710
17691
|
}, X.__r = function(n) {
|
|
17711
17692
|
gn && gn(n);
|
|
17712
17693
|
var t = (st = n.__c).__H;
|
|
17713
|
-
t && (
|
|
17714
|
-
e.__N && (e.__ = e.__N), e.__V =
|
|
17715
|
-
})) : (t.__h.forEach(
|
|
17694
|
+
t && (oa === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
|
17695
|
+
e.__N && (e.__ = e.__N), e.__V = sa, e.__N = e.i = void 0;
|
|
17696
|
+
})) : (t.__h.forEach(be), t.__h.forEach(Sa), t.__h = [])), oa = st;
|
|
17716
17697
|
}, X.diffed = function(n) {
|
|
17717
17698
|
pn && pn(n);
|
|
17718
17699
|
var t = n.__c;
|
|
17719
17700
|
t && t.__H && (t.__H.__h.length && (vi.push(t) !== 1 && hn === X.requestAnimationFrame || ((hn = X.requestAnimationFrame) || bc)(Ec)), t.__H.__.forEach(function(e) {
|
|
17720
|
-
e.i && (e.__H = e.i), e.__V !==
|
|
17721
|
-
})),
|
|
17701
|
+
e.i && (e.__H = e.i), e.__V !== sa && (e.__ = e.__V), e.i = void 0, e.__V = sa;
|
|
17702
|
+
})), oa = st = null;
|
|
17722
17703
|
}, X.__c = function(n, t) {
|
|
17723
17704
|
t.some(function(e) {
|
|
17724
17705
|
try {
|
|
17725
|
-
e.__h.forEach(
|
|
17726
|
-
return !a.__ ||
|
|
17706
|
+
e.__h.forEach(be), e.__h = e.__h.filter(function(a) {
|
|
17707
|
+
return !a.__ || Sa(a);
|
|
17727
17708
|
});
|
|
17728
17709
|
} catch (a) {
|
|
17729
17710
|
t.some(function(i) {
|
|
@@ -17736,7 +17717,7 @@ X.__b = function(n) {
|
|
|
17736
17717
|
var t, e = n.__c;
|
|
17737
17718
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
|
17738
17719
|
try {
|
|
17739
|
-
|
|
17720
|
+
be(a);
|
|
17740
17721
|
} catch (i) {
|
|
17741
17722
|
t = i;
|
|
17742
17723
|
}
|
|
@@ -17749,11 +17730,11 @@ function bc(n) {
|
|
|
17749
17730
|
}, a = setTimeout(e, 100);
|
|
17750
17731
|
wn && (t = requestAnimationFrame(e));
|
|
17751
17732
|
}
|
|
17752
|
-
function
|
|
17733
|
+
function be(n) {
|
|
17753
17734
|
var t = st, e = n.__c;
|
|
17754
17735
|
typeof e == "function" && (n.__c = void 0, e()), st = t;
|
|
17755
17736
|
}
|
|
17756
|
-
function
|
|
17737
|
+
function Sa(n) {
|
|
17757
17738
|
var t = st;
|
|
17758
17739
|
n.__c = n.__(), st = t;
|
|
17759
17740
|
}
|
|
@@ -17779,7 +17760,7 @@ const Ei = C`
|
|
|
17779
17760
|
}
|
|
17780
17761
|
missingComponentTypes
|
|
17781
17762
|
}
|
|
17782
|
-
`,
|
|
17763
|
+
`, Ua = C`
|
|
17783
17764
|
${Ei}
|
|
17784
17765
|
fragment AddressValidationJobFields on AddressValidationJob {
|
|
17785
17766
|
id
|
|
@@ -17792,14 +17773,14 @@ const Ei = C`
|
|
|
17792
17773
|
}
|
|
17793
17774
|
}
|
|
17794
17775
|
`, Ic = C`
|
|
17795
|
-
${
|
|
17776
|
+
${Ua}
|
|
17796
17777
|
query GetAddressValidationJobs($ids: [String!]!) {
|
|
17797
17778
|
addressValidationJobs(ids: $ids) {
|
|
17798
17779
|
...AddressValidationJobFields
|
|
17799
17780
|
}
|
|
17800
17781
|
}
|
|
17801
17782
|
`, Bc = C`
|
|
17802
|
-
${
|
|
17783
|
+
${Ua}
|
|
17803
17784
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
|
17804
17785
|
recipients(ids: $ids) {
|
|
17805
17786
|
id
|
|
@@ -17815,14 +17796,14 @@ const Ei = C`
|
|
|
17815
17796
|
...AddressValidationResultFields
|
|
17816
17797
|
}
|
|
17817
17798
|
}
|
|
17818
|
-
`,
|
|
17819
|
-
${
|
|
17799
|
+
`, Dc = C`
|
|
17800
|
+
${Ua}
|
|
17820
17801
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
|
17821
17802
|
recipientValidateBatch(ids: $ids) {
|
|
17822
17803
|
...AddressValidationJobFields
|
|
17823
17804
|
}
|
|
17824
17805
|
}
|
|
17825
|
-
`,
|
|
17806
|
+
`, Fc = C`
|
|
17826
17807
|
mutation OverrideRecipientAddress($id: String!) {
|
|
17827
17808
|
recipientOverrideAddress(id: $id) {
|
|
17828
17809
|
id
|
|
@@ -17860,7 +17841,7 @@ const aA = async (n) => {
|
|
|
17860
17841
|
}
|
|
17861
17842
|
})).data?.recipientValidate : void 0, rA = async (n) => {
|
|
17862
17843
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
|
|
17863
|
-
mutation:
|
|
17844
|
+
mutation: Dc,
|
|
17864
17845
|
errorPolicy: "all",
|
|
17865
17846
|
fetchPolicy: "network-only",
|
|
17866
17847
|
variables: {
|
|
@@ -17877,7 +17858,7 @@ const aA = async (n) => {
|
|
|
17877
17858
|
if (!t)
|
|
17878
17859
|
return;
|
|
17879
17860
|
(await y.getShadowGraphqlClient().mutate({
|
|
17880
|
-
mutation:
|
|
17861
|
+
mutation: Fc,
|
|
17881
17862
|
errorPolicy: "all",
|
|
17882
17863
|
fetchPolicy: "network-only",
|
|
17883
17864
|
variables: {
|
|
@@ -17901,23 +17882,23 @@ const aA = async (n) => {
|
|
|
17901
17882
|
}
|
|
17902
17883
|
})).data.integrationProducts;
|
|
17903
17884
|
export {
|
|
17904
|
-
|
|
17885
|
+
Ea as AddonHandle,
|
|
17905
17886
|
kc as AddressValidationJobStatus,
|
|
17906
17887
|
xc as AddressValidationResultConfirmationLevel,
|
|
17907
17888
|
bn as AddressValidationStatus,
|
|
17908
17889
|
Od as ArrayInput,
|
|
17909
17890
|
G as AspectType,
|
|
17910
17891
|
Bt as AssetNotFoundError,
|
|
17911
|
-
|
|
17892
|
+
Ie as AssetType,
|
|
17912
17893
|
xd as BringForwardCommand,
|
|
17913
|
-
|
|
17914
|
-
|
|
17894
|
+
Fd as BringToBackCommand,
|
|
17895
|
+
Dd as BringToFrontCommand,
|
|
17915
17896
|
Gi as BundleDesignCreationCartAddMode,
|
|
17916
17897
|
O as CanvasCommand,
|
|
17917
|
-
|
|
17918
|
-
|
|
17898
|
+
pe as CollectionProduct,
|
|
17899
|
+
cn as ColorOptionGlobalPropertyHandle,
|
|
17919
17900
|
ko as CommandContext,
|
|
17920
|
-
|
|
17901
|
+
Ee as ConversionDataType,
|
|
17921
17902
|
vc as ConversionLocation,
|
|
17922
17903
|
H as CreateElementCommand,
|
|
17923
17904
|
ni as CreateLayoutCommand,
|
|
@@ -17925,18 +17906,18 @@ export {
|
|
|
17925
17906
|
nc as CurrencyService,
|
|
17926
17907
|
Rt as DeleteElementCommand,
|
|
17927
17908
|
ul as DigitalContentStepHandle,
|
|
17928
|
-
|
|
17929
|
-
|
|
17909
|
+
Fl as FileUploadGlobalPropertyHandle,
|
|
17910
|
+
fe as FlowExecutionNodeResult,
|
|
17930
17911
|
Kl as FlowExecutionResult,
|
|
17931
17912
|
Jl as FlowService,
|
|
17932
17913
|
Qo as FontAlignmentCommand,
|
|
17933
17914
|
To as FontColorCommand,
|
|
17934
17915
|
No as FontSizeCommand,
|
|
17935
|
-
|
|
17916
|
+
en as FontSourceCommand,
|
|
17936
17917
|
Ac as FrameService,
|
|
17937
17918
|
uc as FrameStep,
|
|
17938
17919
|
hc as FrameStepHandle,
|
|
17939
|
-
|
|
17920
|
+
Ra as GlobalPropertyHandle,
|
|
17940
17921
|
L as GroupCommand,
|
|
17941
17922
|
il as IllustrationStepHandle,
|
|
17942
17923
|
qe as InformationMessageType,
|
|
@@ -17944,11 +17925,11 @@ export {
|
|
|
17944
17925
|
An as IntegrationProduct,
|
|
17945
17926
|
qi as IntegrationType,
|
|
17946
17927
|
Ed as LayoutElementFactory,
|
|
17947
|
-
|
|
17928
|
+
F as LayoutElementType,
|
|
17948
17929
|
K as LayoutNotFoundError,
|
|
17949
17930
|
Kt as LayoutRenderingPurpose,
|
|
17950
17931
|
rl as MaterialStepHandle,
|
|
17951
|
-
|
|
17932
|
+
De as MisconfigurationError,
|
|
17952
17933
|
Wd as MockWorkflowManager,
|
|
17953
17934
|
ol as ModelStepHandle,
|
|
17954
17935
|
hl as ModuleStepHandle,
|
|
@@ -17956,8 +17937,8 @@ export {
|
|
|
17956
17937
|
wi as ObjectInput,
|
|
17957
17938
|
_l as ObjectInputType,
|
|
17958
17939
|
pi as OptionGlobalPropertyHandle,
|
|
17959
|
-
|
|
17960
|
-
|
|
17940
|
+
Pe as OptionNotFoundError,
|
|
17941
|
+
Ft as ParseError,
|
|
17961
17942
|
sl as PictureStepHandle,
|
|
17962
17943
|
Hi as ProductCameraRig,
|
|
17963
17944
|
Ci as ProductCollection,
|
|
@@ -17975,7 +17956,7 @@ export {
|
|
|
17975
17956
|
cl as ShapeStepHandle,
|
|
17976
17957
|
Wi as ShareActionType,
|
|
17977
17958
|
$d as SpiffCommerceClient,
|
|
17978
|
-
|
|
17959
|
+
Be as StakeholderType,
|
|
17979
17960
|
zi as StepAspectType,
|
|
17980
17961
|
et as StepHandle,
|
|
17981
17962
|
v as StepType,
|
|
@@ -17990,7 +17971,7 @@ export {
|
|
|
17990
17971
|
ji as UnitOfMeasurement,
|
|
17991
17972
|
Pd as UpdateImageSourceCommand,
|
|
17992
17973
|
ot as Variant,
|
|
17993
|
-
|
|
17974
|
+
wa as WorkflowExperienceEventType,
|
|
17994
17975
|
Il as WorkflowExperienceImpl,
|
|
17995
17976
|
V as assetService,
|
|
17996
17977
|
wr as browserColorToHex,
|
|
@@ -18000,7 +17981,7 @@ export {
|
|
|
18000
17981
|
od as dataUrlFromExternalUrl,
|
|
18001
17982
|
Gd as deleteBundle,
|
|
18002
17983
|
ra as designService,
|
|
18003
|
-
|
|
17984
|
+
ve as determineCorrectFontSizeAndLines,
|
|
18004
17985
|
ri as digitalContentStepService,
|
|
18005
17986
|
At as domParser,
|
|
18006
17987
|
jd as duplicateBundle,
|
|
@@ -18016,14 +17997,14 @@ export {
|
|
|
18016
17997
|
lt as generateSVGWithUnknownColors,
|
|
18017
17998
|
Td as generateStateFromDesignInputSteps,
|
|
18018
17999
|
nA as getAddressValidationJobs,
|
|
18019
|
-
|
|
18000
|
+
Ue as getAttributesFromArrayBuffer,
|
|
18020
18001
|
dd as getAxisAlignedBoundingBox,
|
|
18021
18002
|
dc as getBoundedOffsets,
|
|
18022
18003
|
Vd as getBundleThemeConfiguration,
|
|
18023
18004
|
Jd as getCustomer,
|
|
18024
18005
|
Kd as getCustomerBundles,
|
|
18025
18006
|
wd as getElementVertices,
|
|
18026
|
-
|
|
18007
|
+
ze as getFrameData,
|
|
18027
18008
|
Nd as getGlobalPropertyStateForBundle,
|
|
18028
18009
|
cc as getIntegration,
|
|
18029
18010
|
sA as getIntegrationProducts,
|
|
@@ -18034,7 +18015,7 @@ export {
|
|
|
18034
18015
|
md as getPointOfRotation,
|
|
18035
18016
|
Qd as getProductCollections,
|
|
18036
18017
|
fd as getSEPoint,
|
|
18037
|
-
|
|
18018
|
+
ka as getSvgElement,
|
|
18038
18019
|
eA as getTemplateBundles,
|
|
18039
18020
|
tA as getTemplateTransactions,
|
|
18040
18021
|
Ud as getTransaction,
|
|
@@ -18046,7 +18027,7 @@ export {
|
|
|
18046
18027
|
sc as getWorkflow,
|
|
18047
18028
|
yi as getWorkflows,
|
|
18048
18029
|
y as graphQlManager,
|
|
18049
|
-
|
|
18030
|
+
Se as illustrationStepService,
|
|
18050
18031
|
ud as isCloseToValue,
|
|
18051
18032
|
Qt as loadFont,
|
|
18052
18033
|
ld as matchHexToPms,
|
|
@@ -18054,7 +18035,7 @@ export {
|
|
|
18054
18035
|
Ul as metafieldManager,
|
|
18055
18036
|
yd as mmPerPixel,
|
|
18056
18037
|
si as modelStepService,
|
|
18057
|
-
|
|
18038
|
+
Fa as modifySVGColors,
|
|
18058
18039
|
li as moduleStepService,
|
|
18059
18040
|
qd as nameBundle,
|
|
18060
18041
|
Hd as nameTransaction,
|
|
@@ -18068,19 +18049,19 @@ export {
|
|
|
18068
18049
|
di as questionStepService,
|
|
18069
18050
|
rd as registerFetchImplementation,
|
|
18070
18051
|
id as registerWindowImplementation,
|
|
18071
|
-
|
|
18052
|
+
Za as rehydrateSerializedLayout,
|
|
18072
18053
|
pr as rgbToPms,
|
|
18073
|
-
|
|
18074
|
-
|
|
18054
|
+
he as rotateAroundPoint,
|
|
18055
|
+
Pa as sanitizeSvgTree,
|
|
18075
18056
|
sr as setBearerAuthenticationToken,
|
|
18076
18057
|
kn as setCanvasModule,
|
|
18077
18058
|
Wt as shapeStepService,
|
|
18078
18059
|
Lo as shortenUrl,
|
|
18079
18060
|
ft as spiffCoreConfiguration,
|
|
18080
18061
|
Md as stepAspectValuesToDesignInputSteps,
|
|
18081
|
-
|
|
18062
|
+
Ya as svgColorValueToDefinition,
|
|
18082
18063
|
ei as svgStringDimensions,
|
|
18083
|
-
|
|
18064
|
+
ba as svgToDataUrl,
|
|
18084
18065
|
j as textStepService,
|
|
18085
18066
|
Ko as toast,
|
|
18086
18067
|
iA as validateWorkflowExperienceRecipient,
|