@faststore/api 4.7.0-dev.8 → 4.7.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +17 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.mjs +271 -251
- package/dist/es/index.mjs.map +1 -1
- package/dist/src/__generated__/schema.d.ts +8 -0
- package/dist/src/__generated__/schema.d.ts.map +1 -1
- package/dist/src/platforms/vtex/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/product.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/query.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/__generated__/schema.ts +8 -0
- package/src/platforms/vtex/resolvers/product.ts +51 -17
- package/src/platforms/vtex/resolvers/query.ts +5 -4
- package/src/platforms/vtex/typeDefs/product.graphql +8 -0
package/dist/es/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { logger as Vn, OTELAPI as M } from "@faststore/diagnostics";
|
|
|
6
6
|
import xn from "isomorphic-unfetch";
|
|
7
7
|
import { parse as Q } from "cookie";
|
|
8
8
|
import we from "p-limit";
|
|
9
|
-
import
|
|
9
|
+
import ue from "dataloader";
|
|
10
10
|
import qn from "sanitize-html";
|
|
11
11
|
import De from "fast-deep-equal";
|
|
12
12
|
import jn from "node:crypto";
|
|
@@ -14,7 +14,7 @@ var Wn = /* @__PURE__ */ ((e) => (e.Personal = "personal", e.Shared = "shared",
|
|
|
14
14
|
const Qn = () => function(n = {}) {
|
|
15
15
|
const t = process.env.FS_DISCOVERY_APP_KEY ?? "", r = process.env.FS_DISCOVERY_APP_TOKEN ?? "";
|
|
16
16
|
if (!t || !r)
|
|
17
|
-
throw new
|
|
17
|
+
throw new J("No authentication AppKey and AppToken passed.");
|
|
18
18
|
return {
|
|
19
19
|
...n,
|
|
20
20
|
"X-VTEX-API-AppKey": t,
|
|
@@ -29,7 +29,7 @@ const Qn = () => function(n = {}) {
|
|
|
29
29
|
throw new re("Authentication required");
|
|
30
30
|
} catch (t) {
|
|
31
31
|
const r = t.extensions?.status ?? t.status;
|
|
32
|
-
throw r === 401 ? new re("Authentication required") : r === 403 ? new
|
|
32
|
+
throw r === 401 ? new re("Authentication required") : r === 403 ? new J("You are not allowed to access this resource") : new re("Authentication required");
|
|
33
33
|
}
|
|
34
34
|
}, et = "auth", nt = {
|
|
35
35
|
typeDefs: "directive @auth on FIELD_DEFINITION",
|
|
@@ -80,7 +80,7 @@ const Qn = () => function(n = {}) {
|
|
|
80
80
|
resolvers: n
|
|
81
81
|
})
|
|
82
82
|
);
|
|
83
|
-
}, sn = "@faststore/api", cn = "4.7.0-dev.
|
|
83
|
+
}, sn = "@faststore/api", cn = "4.7.0-dev.8", ke = {
|
|
84
84
|
name: sn,
|
|
85
85
|
version: cn
|
|
86
86
|
}, ot = Vn("@faststore/api"), st = (e, n = "Unknown Graphql Resolver") => (t, r, i, a) => {
|
|
@@ -105,13 +105,13 @@ const Qn = () => function(n = {}) {
|
|
|
105
105
|
);
|
|
106
106
|
return c instanceof Promise ? c.then(
|
|
107
107
|
(d) => (o.end(), d),
|
|
108
|
-
(d) =>
|
|
108
|
+
(d) => Te(d, o, n)
|
|
109
109
|
) : (o.end(), c);
|
|
110
110
|
} catch (c) {
|
|
111
|
-
return
|
|
111
|
+
return Te(c, o, n);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
function
|
|
114
|
+
function Te(e, n, t) {
|
|
115
115
|
throw n.setStatus({ code: M.SpanStatusCode.ERROR }), n.recordException(e), n.end(), console.error(`Error at resolver: ${t}:
|
|
116
116
|
%o`, e), ot("error", `Error at resolver: %s
|
|
117
117
|
%o`, t, e), e;
|
|
@@ -121,7 +121,7 @@ class Z extends Error {
|
|
|
121
121
|
super(t), this.extensions = n, this.name = "FastStoreError";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class T extends Z {
|
|
125
125
|
constructor(n) {
|
|
126
126
|
super({ status: 400, type: "BadRequestError" }, n);
|
|
127
127
|
}
|
|
@@ -131,7 +131,7 @@ class re extends Z {
|
|
|
131
131
|
super({ status: 401, type: "UnauthorizedError" }, n);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
class
|
|
134
|
+
class J extends Z {
|
|
135
135
|
constructor(n) {
|
|
136
136
|
super({ status: 403, type: "ForbiddenError" }, n);
|
|
137
137
|
}
|
|
@@ -141,7 +141,7 @@ class $ extends Z {
|
|
|
141
141
|
super({ status: 404, type: "NotFoundError" }, n);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const no = (e) => e?.name === "FastStoreError", to = (e) => e?.extensions?.type === "BadRequestError", ro = (e) => e?.extensions?.type === "UnauthorizedError", ct = (e) => e?.extensions?.type === "ForbiddenError",
|
|
144
|
+
const no = (e) => e?.name === "FastStoreError", to = (e) => e?.extensions?.type === "BadRequestError", ro = (e) => e?.extensions?.type === "UnauthorizedError", ct = (e) => e?.extensions?.type === "ForbiddenError", Y = (e) => e?.extensions?.type === "NotFoundError", lt = `${ke.name}@${ke.version}`, y = async (e, n, t) => {
|
|
145
145
|
const r = await xn(e, {
|
|
146
146
|
...n,
|
|
147
147
|
headers: {
|
|
@@ -156,11 +156,11 @@ const no = (e) => e?.name === "FastStoreError", to = (e) => e?.extensions?.type
|
|
|
156
156
|
if (typeof r?.status == "number")
|
|
157
157
|
switch (r.status) {
|
|
158
158
|
case 400:
|
|
159
|
-
throw new
|
|
159
|
+
throw new T(i);
|
|
160
160
|
case 401:
|
|
161
161
|
throw new re(i);
|
|
162
162
|
case 403:
|
|
163
|
-
throw new
|
|
163
|
+
throw new J(i);
|
|
164
164
|
case 404:
|
|
165
165
|
throw new $(i);
|
|
166
166
|
default:
|
|
@@ -208,7 +208,7 @@ const no = (e) => e?.name === "FastStoreError", to = (e) => e?.extensions?.type
|
|
|
208
208
|
n.getSetCookie().forEach(
|
|
209
209
|
(t) => pt(e, t)
|
|
210
210
|
);
|
|
211
|
-
}, mt = (e) => (n) => gt(e, n),
|
|
211
|
+
}, mt = (e) => (n) => gt(e, n), ge = (e) => {
|
|
212
212
|
if (!e.headers?.cookie)
|
|
213
213
|
return null;
|
|
214
214
|
const n = ln(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
|
|
@@ -221,7 +221,7 @@ const no = (e) => e?.name === "FastStoreError", to = (e) => e?.extensions?.type
|
|
|
221
221
|
n
|
|
222
222
|
);
|
|
223
223
|
}, dn = (e) => function(t) {
|
|
224
|
-
const r =
|
|
224
|
+
const r = ge(e);
|
|
225
225
|
return r ? {
|
|
226
226
|
...t,
|
|
227
227
|
cookie: r
|
|
@@ -245,12 +245,12 @@ function z(e) {
|
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const ft = "storefront/faststore.recommendation-shelf@v4",
|
|
248
|
+
const ft = "storefront/faststore.recommendation-shelf@v4", W = {
|
|
249
249
|
method: "POST",
|
|
250
250
|
headers: {
|
|
251
251
|
"content-type": "application/json"
|
|
252
252
|
}
|
|
253
|
-
}, St = (e) => e.split("/").map(encodeURIComponent).join("/"),
|
|
253
|
+
}, St = (e) => e.split("/").map(encodeURIComponent).join("/"), pe = (e) => e ? { headers: { "Accept-Language": e } } : void 0, yt = /^\d{4}-\d{2}-\d{2}$/, It = /* @__PURE__ */ new Set([
|
|
254
254
|
"Draft",
|
|
255
255
|
"Requested",
|
|
256
256
|
"InReview",
|
|
@@ -309,13 +309,13 @@ function Ot({
|
|
|
309
309
|
const c = new URLSearchParams();
|
|
310
310
|
return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((d) => c.append("status", d)), r && c.append("createdAtFrom", r), i && c.append("createdAtTo", i), a && c.append("expiresAtFrom", a), o && c.append("expiresAtTo", o), s?.trim() && c.append("label", s.trim()), c;
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
|
|
313
313
|
const a = `https://${e}.${n}.com.br`, o = mt(i), s = dn(i), c = Qn(), d = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", u = r && r.map((l) => l + ".").find((l) => d.includes(l)) || "", p = d.replace(u, ""), f = `${a}/api/recommend-bff/v2`, h = s({
|
|
314
314
|
accept: "application/json",
|
|
315
315
|
"content-type": "application/json",
|
|
316
316
|
"x-vtex-rec-origin": `${e}/${ft}`
|
|
317
317
|
}), v = (l = {}) => {
|
|
318
|
-
const g = L(
|
|
318
|
+
const g = L(ge(i) ?? "", e);
|
|
319
319
|
return s({
|
|
320
320
|
...l,
|
|
321
321
|
"X-FORWARDED-HOST": p,
|
|
@@ -356,10 +356,10 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
356
356
|
try {
|
|
357
357
|
return await y(
|
|
358
358
|
`${a}/api/catalog_system/pub/category/by-linkid/${St(l)}`,
|
|
359
|
-
|
|
359
|
+
pe(g)
|
|
360
360
|
);
|
|
361
361
|
} catch (m) {
|
|
362
|
-
if (
|
|
362
|
+
if (Y(m)) return null;
|
|
363
363
|
throw m;
|
|
364
364
|
}
|
|
365
365
|
},
|
|
@@ -367,10 +367,10 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
367
367
|
try {
|
|
368
368
|
return await y(
|
|
369
369
|
`${a}/api/catalog_system/pub/brand/by-linkid/${encodeURIComponent(l)}`,
|
|
370
|
-
|
|
370
|
+
pe(g)
|
|
371
371
|
);
|
|
372
372
|
} catch (m) {
|
|
373
|
-
if (
|
|
373
|
+
if (Y(m)) return null;
|
|
374
374
|
throw m;
|
|
375
375
|
}
|
|
376
376
|
},
|
|
@@ -378,10 +378,10 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
378
378
|
try {
|
|
379
379
|
return await y(
|
|
380
380
|
`${a}/api/catalog_system/pub/collection/by-linkid/${encodeURIComponent(l)}`,
|
|
381
|
-
|
|
381
|
+
pe(g)
|
|
382
382
|
);
|
|
383
383
|
} catch (m) {
|
|
384
|
-
if (
|
|
384
|
+
if (Y(m)) return null;
|
|
385
385
|
throw m;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
@@ -415,7 +415,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
415
415
|
return y(
|
|
416
416
|
`${a}/api/checkout/pub/orderForms/simulation?${m.toString()}`,
|
|
417
417
|
{
|
|
418
|
-
...
|
|
418
|
+
...W,
|
|
419
419
|
headers: S,
|
|
420
420
|
body: JSON.stringify(l)
|
|
421
421
|
},
|
|
@@ -431,7 +431,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
431
431
|
const w = O ? {
|
|
432
432
|
startDateUtc: m?.deliveryWindow?.startDate,
|
|
433
433
|
endDateUtc: m?.deliveryWindow?.endDate
|
|
434
|
-
} : null,
|
|
434
|
+
} : null, C = {
|
|
435
435
|
logisticsInfo: Array.from({ length: g }, (I, D) => ({
|
|
436
436
|
itemIndex: D,
|
|
437
437
|
selectedDeliveryChannel: m?.deliveryChannel || null,
|
|
@@ -440,16 +440,16 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
440
440
|
})),
|
|
441
441
|
selectedAddresses: S,
|
|
442
442
|
clearAddressIfPostalCodeNotFound: t
|
|
443
|
-
},
|
|
443
|
+
}, k = s({
|
|
444
444
|
"content-type": "application/json",
|
|
445
445
|
"X-FORWARDED-HOST": p
|
|
446
446
|
});
|
|
447
447
|
return y(
|
|
448
448
|
`${a}/api/checkout/pub/orderForm/${l}/attachments/shippingData`,
|
|
449
449
|
{
|
|
450
|
-
...
|
|
451
|
-
headers:
|
|
452
|
-
body: JSON.stringify(
|
|
450
|
+
...W,
|
|
451
|
+
headers: k,
|
|
452
|
+
body: JSON.stringify(C)
|
|
453
453
|
},
|
|
454
454
|
{ storeCookies: o }
|
|
455
455
|
);
|
|
@@ -499,13 +499,13 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
499
499
|
const { salesChannel: O } = m, w = s({
|
|
500
500
|
"content-type": "application/json",
|
|
501
501
|
"X-FORWARDED-HOST": p
|
|
502
|
-
}),
|
|
503
|
-
(!S || !l) &&
|
|
504
|
-
const
|
|
502
|
+
}), C = new URLSearchParams();
|
|
503
|
+
(!S || !l) && C.set("sc", O), l && C.set("refreshOutdatedData", g.toString());
|
|
504
|
+
const k = l ? `/${l}` : "", I = `${a}/api/checkout/pub/orderForm${k}?${C}`;
|
|
505
505
|
return y(
|
|
506
506
|
I,
|
|
507
507
|
{
|
|
508
|
-
...
|
|
508
|
+
...W,
|
|
509
509
|
headers: w,
|
|
510
510
|
...l ? {} : { body: "{}" }
|
|
511
511
|
},
|
|
@@ -520,7 +520,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
520
520
|
return y(
|
|
521
521
|
`${a}/api/checkout/pub/orderForm/${l}/messages/clear`,
|
|
522
522
|
{
|
|
523
|
-
...
|
|
523
|
+
...W,
|
|
524
524
|
headers: g,
|
|
525
525
|
body: "{}"
|
|
526
526
|
}
|
|
@@ -536,14 +536,14 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
536
536
|
const w = new URLSearchParams({
|
|
537
537
|
allowOutdatedData: m,
|
|
538
538
|
sc: S
|
|
539
|
-
}),
|
|
539
|
+
}), C = s({
|
|
540
540
|
"content-type": "application/json",
|
|
541
541
|
"X-FORWARDED-HOST": p
|
|
542
542
|
});
|
|
543
543
|
return y(
|
|
544
544
|
`${a}/api/checkout/pub/orderForm/${l}/items?${w}`,
|
|
545
545
|
{
|
|
546
|
-
headers:
|
|
546
|
+
headers: C,
|
|
547
547
|
body: JSON.stringify({
|
|
548
548
|
orderItems: g,
|
|
549
549
|
noSplitItem: !O
|
|
@@ -586,14 +586,14 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
586
586
|
"geoCoordinates",
|
|
587
587
|
`${g?.longitude};${g?.latitude}`
|
|
588
588
|
);
|
|
589
|
-
const w = `${a}/api/checkout/pub/regions/?${O.toString()}`,
|
|
589
|
+
const w = `${a}/api/checkout/pub/regions/?${O.toString()}`, C = s({
|
|
590
590
|
"content-type": "application/json",
|
|
591
591
|
"X-FORWARDED-HOST": p
|
|
592
592
|
});
|
|
593
593
|
return y(
|
|
594
594
|
w,
|
|
595
595
|
{
|
|
596
|
-
headers:
|
|
596
|
+
headers: C
|
|
597
597
|
},
|
|
598
598
|
{ storeCookies: o }
|
|
599
599
|
);
|
|
@@ -680,7 +680,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
680
680
|
subscribeToNewsletter: (l) => y(
|
|
681
681
|
`${a}/api/dataentities/NL/documents/`,
|
|
682
682
|
{
|
|
683
|
-
...
|
|
683
|
+
...W,
|
|
684
684
|
body: JSON.stringify({ ...l, isNewsletterOptIn: !0 }),
|
|
685
685
|
method: "PATCH"
|
|
686
686
|
},
|
|
@@ -721,8 +721,8 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
721
721
|
dateFinal: S,
|
|
722
722
|
text: O,
|
|
723
723
|
clientEmail: w,
|
|
724
|
-
perPage:
|
|
725
|
-
pendingMyApproval:
|
|
724
|
+
perPage: C,
|
|
725
|
+
pendingMyApproval: k
|
|
726
726
|
}) => {
|
|
727
727
|
const I = new URLSearchParams();
|
|
728
728
|
if (m) {
|
|
@@ -746,7 +746,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
746
746
|
O && I.append("text", O), g && g.length > 0 && I.append("status", g.filter(Boolean).join(",")), m && S ? I.append(
|
|
747
747
|
"creation_date",
|
|
748
748
|
`creationDate:[${m} TO ${S}]`
|
|
749
|
-
) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), w && I.append("clientEmail", w), l && I.append("page", l.toString()),
|
|
749
|
+
) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), w && I.append("clientEmail", w), l && I.append("page", l.toString()), C && I.append("per_page", C.toString()), k && I.append("my_pending_approvals", String(!0));
|
|
750
750
|
const D = s({
|
|
751
751
|
"content-type": "application/json",
|
|
752
752
|
"X-FORWARDED-HOST": p
|
|
@@ -785,7 +785,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
785
785
|
const O = s({
|
|
786
786
|
"content-type": "application/json",
|
|
787
787
|
"X-FORWARDED-HOST": p
|
|
788
|
-
}),
|
|
788
|
+
}), k = {
|
|
789
789
|
params: {
|
|
790
790
|
ruleId: m,
|
|
791
791
|
dimensionId: g,
|
|
@@ -797,7 +797,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
797
797
|
{
|
|
798
798
|
method: "POST",
|
|
799
799
|
headers: O,
|
|
800
|
-
body: JSON.stringify(
|
|
800
|
+
body: JSON.stringify(k)
|
|
801
801
|
},
|
|
802
802
|
{ storeCookies: o }
|
|
803
803
|
);
|
|
@@ -947,7 +947,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
947
947
|
contractId: l
|
|
948
948
|
}) => {
|
|
949
949
|
if (!l)
|
|
950
|
-
throw new
|
|
950
|
+
throw new T("Missing contractId to fetch CL fields.");
|
|
951
951
|
const g = v({
|
|
952
952
|
Accept: "application/json",
|
|
953
953
|
"content-type": "application/json"
|
|
@@ -965,7 +965,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
965
965
|
userId: l
|
|
966
966
|
}) => {
|
|
967
967
|
if (!l)
|
|
968
|
-
throw new
|
|
968
|
+
throw new T("Missing userId to fetch shopper name.");
|
|
969
969
|
const g = c({
|
|
970
970
|
Accept: "application/json",
|
|
971
971
|
"content-type": "application/json",
|
|
@@ -1003,7 +1003,7 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1003
1003
|
const l = s({
|
|
1004
1004
|
"content-type": "application/json",
|
|
1005
1005
|
"X-FORWARDED-HOST": p
|
|
1006
|
-
}), g = L(
|
|
1006
|
+
}), g = L(ge(i) ?? "", e);
|
|
1007
1007
|
return y(
|
|
1008
1008
|
`${a}/api/vtexid/credential/validate`,
|
|
1009
1009
|
{
|
|
@@ -1025,17 +1025,17 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1025
1025
|
"content-type": "application/json",
|
|
1026
1026
|
"X-FORWARDED-HOST": p
|
|
1027
1027
|
}), O = `----FastStoreUploadBoundary${Date.now()}`, w = `\r
|
|
1028
|
-
`,
|
|
1028
|
+
`, k = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", I = g.replaceAll(/[\r\n"]/g, "_"), D = [
|
|
1029
1029
|
`--${O}`,
|
|
1030
1030
|
`Content-Disposition: form-data; name="file"; filename="${I}"`,
|
|
1031
|
-
`Content-Type: ${
|
|
1031
|
+
`Content-Type: ${k}`,
|
|
1032
1032
|
"",
|
|
1033
1033
|
""
|
|
1034
1034
|
].join(w), A = `${w}--${O}--${w}`, _ = Buffer.from(D), P = Buffer.from(A), R = new Uint8Array(
|
|
1035
1035
|
_.byteLength + l.byteLength + P.byteLength
|
|
1036
1036
|
);
|
|
1037
|
-
let
|
|
1038
|
-
return R.set(_,
|
|
1037
|
+
let b = 0;
|
|
1038
|
+
return R.set(_, b), b += _.byteLength, R.set(l, b), b += l.byteLength, R.set(P, b), y(
|
|
1039
1039
|
`${a}/api/order-entry/upload?an=${e}`,
|
|
1040
1040
|
{
|
|
1041
1041
|
method: "POST",
|
|
@@ -1149,22 +1149,22 @@ const Ct = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
|
-
},
|
|
1152
|
+
}, K = (e) => e.discoveryConfig?.localization ?? {}, x = (e) => K(e).enabled === !0, Ct = (e) => Object.keys(K(e).locales ?? {}), wt = (e) => K(e).defaultLocale, ie = (e) => x(e) && e.storage.locale || void 0, me = "fuzzy", he = "operator", fe = "pickupPoint", Ee = "shipping", Ue = "delivery-options", Dt = "in-stock", At = "trade-policy", Pt = "region-id", _t = /* @__PURE__ */ new Set([
|
|
1153
1153
|
At,
|
|
1154
1154
|
Pt,
|
|
1155
|
-
ge,
|
|
1156
1155
|
me,
|
|
1157
|
-
he
|
|
1158
|
-
|
|
1156
|
+
he,
|
|
1157
|
+
fe
|
|
1158
|
+
]), kt = /* @__PURE__ */ new Set([
|
|
1159
1159
|
"zip-code",
|
|
1160
1160
|
"pickupPoint",
|
|
1161
1161
|
"country",
|
|
1162
1162
|
"coordinates",
|
|
1163
1163
|
"deliveryZonesHash",
|
|
1164
1164
|
"pickupPointsHash"
|
|
1165
|
-
]), Re = (e) => encodeURI(decodeURI(e)),
|
|
1165
|
+
]), Re = (e) => encodeURI(decodeURI(e)), Tt = (e) => encodeURIComponent(
|
|
1166
1166
|
decodeURIComponent(e).normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "")
|
|
1167
|
-
),
|
|
1167
|
+
), Et = /^pickup-in-point-(.+)$/;
|
|
1168
1168
|
function un(e) {
|
|
1169
1169
|
if (!e)
|
|
1170
1170
|
return {};
|
|
@@ -1184,7 +1184,7 @@ function Ut(e) {
|
|
|
1184
1184
|
const i = r.indexOf("=");
|
|
1185
1185
|
if (i < 0) continue;
|
|
1186
1186
|
const a = r.slice(0, i), o = r.slice(i + 1);
|
|
1187
|
-
!a || !o || (
|
|
1187
|
+
!a || !o || (kt.has(a) ? n[a] = o : t.push({ key: a, value: o }));
|
|
1188
1188
|
}
|
|
1189
1189
|
return { shipping: n, extraFacets: t };
|
|
1190
1190
|
}
|
|
@@ -1231,7 +1231,7 @@ function pn(e, n) {
|
|
|
1231
1231
|
i != null && i !== "" && e.append(r, String(i));
|
|
1232
1232
|
}
|
|
1233
1233
|
function gn(e) {
|
|
1234
|
-
return
|
|
1234
|
+
return Et.exec(e)?.[1];
|
|
1235
1235
|
}
|
|
1236
1236
|
function Ft(e) {
|
|
1237
1237
|
const n = e.find((r) => r.key === "shipping"), t = n ? gn(n.value) : void 0;
|
|
@@ -1264,7 +1264,7 @@ function Bt(e, n) {
|
|
|
1264
1264
|
function $t(e) {
|
|
1265
1265
|
return e.reduce((n, t) => {
|
|
1266
1266
|
let { key: r, value: i } = t;
|
|
1267
|
-
return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Re(r)}/${
|
|
1267
|
+
return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Re(r)}/${Tt(Re(i)).replaceAll(/ |%20/g, "-")}/`;
|
|
1268
1268
|
}, "");
|
|
1269
1269
|
}
|
|
1270
1270
|
const Mt = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), zt = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
|
|
@@ -1282,19 +1282,19 @@ function Vt(e, n) {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
function xt(e, n) {
|
|
1284
1284
|
const t = e.filter(({ key: c }) => !_t.has(c)), r = e.find(
|
|
1285
|
-
({ key: c, value: d }) => c ===
|
|
1285
|
+
({ key: c, value: d }) => c === Ee && d !== "all-delivery-methods"
|
|
1286
1286
|
) ?? null, i = e.find(
|
|
1287
1287
|
({ key: c, value: d }) => c === Ue && d !== "all-delivery-options"
|
|
1288
1288
|
) ?? null, a = [...t], o = a.some(
|
|
1289
|
-
({ key: c }) => c ===
|
|
1289
|
+
({ key: c }) => c === Ee
|
|
1290
1290
|
), s = a.some(
|
|
1291
1291
|
({ key: c }) => c === Ue
|
|
1292
1292
|
);
|
|
1293
1293
|
return r !== null && !o && a.push(r), i !== null && !s && a.push(i), Bt(a, n);
|
|
1294
1294
|
}
|
|
1295
1295
|
function qt(e, n) {
|
|
1296
|
-
const t = e.find(({ key: a }) => a ===
|
|
1297
|
-
t && Mt(t) && n.append(
|
|
1296
|
+
const t = e.find(({ key: a }) => a === me) ?? null, r = e.find(({ key: a }) => a === he) ?? null, i = e.find(({ key: a }) => a === fe) ?? null;
|
|
1297
|
+
t && Mt(t) && n.append(me, t.value), r && zt(r) && n.append(he, r.value), i && n.append(fe, i.value);
|
|
1298
1298
|
}
|
|
1299
1299
|
function Fe(e, n, t, r) {
|
|
1300
1300
|
const {
|
|
@@ -1334,7 +1334,7 @@ function jt(e, n) {
|
|
|
1334
1334
|
});
|
|
1335
1335
|
return pn(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function H(e, n) {
|
|
1338
1338
|
return {
|
|
1339
1339
|
path: e,
|
|
1340
1340
|
params: n,
|
|
@@ -1344,7 +1344,7 @@ function W(e, n) {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
};
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function G(e) {
|
|
1348
1348
|
const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = Vt(t, r);
|
|
1349
1349
|
switch (n) {
|
|
1350
1350
|
case "product-search":
|
|
@@ -1355,7 +1355,7 @@ function H(e) {
|
|
|
1355
1355
|
a,
|
|
1356
1356
|
{ includePagination: !0, includeSort: !0 }
|
|
1357
1357
|
);
|
|
1358
|
-
return
|
|
1358
|
+
return H(s, o);
|
|
1359
1359
|
}
|
|
1360
1360
|
case "catalog-count": {
|
|
1361
1361
|
const { params: o, path: s } = Fe(
|
|
@@ -1364,24 +1364,24 @@ function H(e) {
|
|
|
1364
1364
|
a,
|
|
1365
1365
|
{ includePagination: !1, includeSort: !1 }
|
|
1366
1366
|
);
|
|
1367
|
-
return
|
|
1367
|
+
return H(s, o);
|
|
1368
1368
|
}
|
|
1369
1369
|
case "products": {
|
|
1370
1370
|
const o = jt(i, a.segmentParams);
|
|
1371
|
-
return
|
|
1371
|
+
return H("", o);
|
|
1372
1372
|
}
|
|
1373
1373
|
case "search-suggestions": {
|
|
1374
1374
|
const o = new URLSearchParams({
|
|
1375
1375
|
query: i.query?.toString() ?? "",
|
|
1376
1376
|
locale: r?.locale ?? a.segmentParams.locale ?? ""
|
|
1377
1377
|
});
|
|
1378
|
-
return
|
|
1378
|
+
return H("", o);
|
|
1379
1379
|
}
|
|
1380
1380
|
case "top-searches": {
|
|
1381
1381
|
const o = new URLSearchParams({
|
|
1382
1382
|
locale: r?.locale ?? a.segmentParams.locale ?? ""
|
|
1383
1383
|
});
|
|
1384
|
-
return
|
|
1384
|
+
return H("", o);
|
|
1385
1385
|
}
|
|
1386
1386
|
default: {
|
|
1387
1387
|
const o = n;
|
|
@@ -1396,7 +1396,7 @@ function Ht(e) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
function Gt(e) {
|
|
1398
1398
|
const t = un(e.headers?.cookie).cultureInfo || "";
|
|
1399
|
-
return
|
|
1399
|
+
return x(e) ? e.storage.locale || t : t || e.storage.locale || "";
|
|
1400
1400
|
}
|
|
1401
1401
|
const Xt = ({
|
|
1402
1402
|
account: e,
|
|
@@ -1417,7 +1417,7 @@ const Xt = ({
|
|
|
1417
1417
|
"content-type": "application/json",
|
|
1418
1418
|
"X-FORWARDED-HOST": h
|
|
1419
1419
|
}), l = ({ type: I, ...D }) => {
|
|
1420
|
-
const A = I === "facets" ? "facets" : "product-search", _ =
|
|
1420
|
+
const A = I === "facets" ? "facets" : "product-search", _ = G({
|
|
1421
1421
|
endpoint: A,
|
|
1422
1422
|
segment: d,
|
|
1423
1423
|
defaults: u(),
|
|
@@ -1433,7 +1433,7 @@ const Xt = ({
|
|
|
1433
1433
|
hideUnavailableItems: A,
|
|
1434
1434
|
showInvisibleItems: _
|
|
1435
1435
|
}) => {
|
|
1436
|
-
const P =
|
|
1436
|
+
const P = G({
|
|
1437
1437
|
endpoint: "products",
|
|
1438
1438
|
segment: d,
|
|
1439
1439
|
defaults: u(),
|
|
@@ -1462,11 +1462,11 @@ const Xt = ({
|
|
|
1462
1462
|
const P = we(Wt);
|
|
1463
1463
|
return (await Promise.all(
|
|
1464
1464
|
D.map(
|
|
1465
|
-
(
|
|
1465
|
+
(b) => P(async () => {
|
|
1466
1466
|
try {
|
|
1467
1467
|
return await m({
|
|
1468
1468
|
field: I,
|
|
1469
|
-
value:
|
|
1469
|
+
value: b,
|
|
1470
1470
|
hideUnavailableItems: _,
|
|
1471
1471
|
showInvisibleItems: A
|
|
1472
1472
|
});
|
|
@@ -1476,11 +1476,11 @@ const Xt = ({
|
|
|
1476
1476
|
})
|
|
1477
1477
|
)
|
|
1478
1478
|
)).filter(
|
|
1479
|
-
(
|
|
1479
|
+
(b) => b !== null
|
|
1480
1480
|
);
|
|
1481
1481
|
},
|
|
1482
1482
|
suggestedTerms: (I) => {
|
|
1483
|
-
const D =
|
|
1483
|
+
const D = G({
|
|
1484
1484
|
endpoint: "search-suggestions",
|
|
1485
1485
|
segment: d,
|
|
1486
1486
|
defaults: u(),
|
|
@@ -1492,7 +1492,7 @@ const Xt = ({
|
|
|
1492
1492
|
);
|
|
1493
1493
|
},
|
|
1494
1494
|
topSearches: () => {
|
|
1495
|
-
const I =
|
|
1495
|
+
const I = G({
|
|
1496
1496
|
endpoint: "top-searches",
|
|
1497
1497
|
segment: d,
|
|
1498
1498
|
defaults: u()
|
|
@@ -1503,7 +1503,7 @@ const Xt = ({
|
|
|
1503
1503
|
);
|
|
1504
1504
|
},
|
|
1505
1505
|
productCount: (I) => {
|
|
1506
|
-
const D =
|
|
1506
|
+
const D = G({
|
|
1507
1507
|
endpoint: "catalog-count",
|
|
1508
1508
|
segment: d,
|
|
1509
1509
|
defaults: u(),
|
|
@@ -1516,13 +1516,13 @@ const Xt = ({
|
|
|
1516
1516
|
}
|
|
1517
1517
|
};
|
|
1518
1518
|
}, Yt = (e, n) => {
|
|
1519
|
-
const t = Xt(e, n), r =
|
|
1519
|
+
const t = Xt(e, n), r = bt(e, n), i = dt(e);
|
|
1520
1520
|
return {
|
|
1521
1521
|
search: t,
|
|
1522
1522
|
commerce: r,
|
|
1523
1523
|
catalog: i
|
|
1524
1524
|
};
|
|
1525
|
-
}, Jt = 20, Kt = (e) => e.entityType === "category",
|
|
1525
|
+
}, Jt = 20, Kt = (e) => e.entityType === "category", Se = (e) => e.entityType === "brand", Ne = (e) => e.entityType === "collection", Qt = (e, n) => {
|
|
1526
1526
|
const t = we(Jt), r = async (i) => Promise.all(
|
|
1527
1527
|
i.map(
|
|
1528
1528
|
(a) => t(async () => {
|
|
@@ -1554,7 +1554,7 @@ const Xt = ({
|
|
|
1554
1554
|
})
|
|
1555
1555
|
)
|
|
1556
1556
|
);
|
|
1557
|
-
return new
|
|
1557
|
+
return new ue(r, {
|
|
1558
1558
|
// DataLoader is used for caching, not batching
|
|
1559
1559
|
batch: !1,
|
|
1560
1560
|
// Dedup by lowercased slug + captured locale so casing variants share an
|
|
@@ -1563,7 +1563,7 @@ const Xt = ({
|
|
|
1563
1563
|
});
|
|
1564
1564
|
}, Zt = (e, n) => {
|
|
1565
1565
|
const t = async (r) => Promise.all(r.map((i) => n.commerce.catalog.salesChannel(i)));
|
|
1566
|
-
return new
|
|
1566
|
+
return new ue(t);
|
|
1567
1567
|
}, er = 1, nr = (e, n) => {
|
|
1568
1568
|
const t = we(er), r = async (a) => {
|
|
1569
1569
|
const o = a.reduce((p, { items: f }) => [...p, f], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
|
|
@@ -1585,7 +1585,7 @@ const Xt = ({
|
|
|
1585
1585
|
items: d.slice(u[f], u[f + 1]).filter((h) => !!h)
|
|
1586
1586
|
}));
|
|
1587
1587
|
}, i = async (a) => t(r, a);
|
|
1588
|
-
return new
|
|
1588
|
+
return new ue(i, {
|
|
1589
1589
|
maxBatchSize: 50
|
|
1590
1590
|
});
|
|
1591
1591
|
}, tr = (e, n) => qn(e, n);
|
|
@@ -1623,7 +1623,7 @@ const F = (e, n) => ({
|
|
|
1623
1623
|
);
|
|
1624
1624
|
return c;
|
|
1625
1625
|
};
|
|
1626
|
-
return new
|
|
1626
|
+
return new ue(t, {
|
|
1627
1627
|
maxBatchSize: 99
|
|
1628
1628
|
// Max allowed batch size of Search API
|
|
1629
1629
|
});
|
|
@@ -1635,14 +1635,14 @@ const F = (e, n) => ({
|
|
|
1635
1635
|
collectionLoader: a,
|
|
1636
1636
|
salesChannelLoader: o
|
|
1637
1637
|
};
|
|
1638
|
-
}, B = (e) => e.AvailableQuantity > 0,
|
|
1638
|
+
}, B = (e) => e.AvailableQuantity > 0, q = (e) => e.spotPrice ?? 0, or = (e) => e.Price ?? 0, Le = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", mn = (e, n) => B(e) && !B(n) ? -1 : !B(e) && B(n) ? 1 : q(e) - q(n), sr = (e) => e === "available", V = (e, n = 0, t = 1) => {
|
|
1639
1639
|
const r = n / t;
|
|
1640
1640
|
return Math.round((e + r) * 100) / 100;
|
|
1641
1641
|
}, cr = (e, n = { includeTaxes: !1 }) => {
|
|
1642
|
-
const t = e.filter(B), r = t[t.length - 1], i = r ?
|
|
1642
|
+
const t = e.filter(B), r = t[t.length - 1], i = r ? q(r) : 0;
|
|
1643
1643
|
return n.includeTaxes ? V(i, r?.Tax, r?.product?.unitMultiplier) : i;
|
|
1644
1644
|
}, Be = (e, n = { includeTaxes: !1 }) => {
|
|
1645
|
-
const [t] = e.filter(B), r = t ?
|
|
1645
|
+
const [t] = e.filter(B), r = t ? q(t) : 0;
|
|
1646
1646
|
return n.includeTaxes ? V(r, t?.Tax, t?.product?.unitMultiplier) : r;
|
|
1647
1647
|
}, lr = {
|
|
1648
1648
|
highPrice: (e) => cr(e),
|
|
@@ -1666,13 +1666,13 @@ const F = (e, n) => ({
|
|
|
1666
1666
|
n = n.replace(new RegExp($e.charAt(t), "g"), ur.charAt(t));
|
|
1667
1667
|
return n;
|
|
1668
1668
|
}, gr = (e) => e.replace(/[·/_,:]/, "-");
|
|
1669
|
-
function
|
|
1669
|
+
function se(e) {
|
|
1670
1670
|
const t = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}><=_^]/g, "-");
|
|
1671
1671
|
return gr(pr(t)).toLowerCase();
|
|
1672
1672
|
}
|
|
1673
|
-
const
|
|
1673
|
+
const X = (e) => Kt(e) ? e.slug : Se(e) ? e.linkId : e.linkId ?? se(e.name), hn = {
|
|
1674
1674
|
id: ({ id: e }) => e.toString(),
|
|
1675
|
-
slug: (e) =>
|
|
1675
|
+
slug: (e) => X(e),
|
|
1676
1676
|
seo: (e) => ({
|
|
1677
1677
|
title: e.title ?? e.name,
|
|
1678
1678
|
// pagetype.metaTagDescription and catalog `description` share the same
|
|
@@ -1680,14 +1680,14 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1680
1680
|
// for forward-compat; fall back to description for by-linkid parity.
|
|
1681
1681
|
description: e.metaTagDescription ?? e.description
|
|
1682
1682
|
}),
|
|
1683
|
-
type: (e) =>
|
|
1683
|
+
type: (e) => Se(e) ? "Brand" : Ne(e) ? "Collection" : e.fatherCategoryId === null ? "Department" : "Category",
|
|
1684
1684
|
meta: async (e, n, t) => {
|
|
1685
|
-
const r =
|
|
1686
|
-
if (
|
|
1685
|
+
const r = X(e);
|
|
1686
|
+
if (Se(e))
|
|
1687
1687
|
return { selectedFacets: [{ key: "brand", value: r }] };
|
|
1688
1688
|
if (Ne(e))
|
|
1689
1689
|
return { selectedFacets: [{ key: "productclusterids", value: e.id }] };
|
|
1690
|
-
const { defaultLocale: i } =
|
|
1690
|
+
const { defaultLocale: i } = K(t), a = r.split("/").filter(Boolean), o = a.map(
|
|
1691
1691
|
(d, u) => a.slice(0, u + 1).join("/")
|
|
1692
1692
|
), {
|
|
1693
1693
|
loaders: { collectionLoader: s }
|
|
@@ -1706,7 +1706,7 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1706
1706
|
breadcrumbList: async (e, n, t) => {
|
|
1707
1707
|
const {
|
|
1708
1708
|
loaders: { collectionLoader: r }
|
|
1709
|
-
} = t, a =
|
|
1709
|
+
} = t, a = X(e).split("/").filter(Boolean), o = a.map(
|
|
1710
1710
|
(c, d) => a.slice(0, d + 1).join("/")
|
|
1711
1711
|
), s = await Promise.all(
|
|
1712
1712
|
o.map(
|
|
@@ -1715,7 +1715,7 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1715
1715
|
);
|
|
1716
1716
|
return {
|
|
1717
1717
|
itemListElement: s.map((c, d) => ({
|
|
1718
|
-
item: `/${
|
|
1718
|
+
item: `/${X(c)}`,
|
|
1719
1719
|
name: c.name,
|
|
1720
1720
|
position: d + 1
|
|
1721
1721
|
})),
|
|
@@ -1723,11 +1723,11 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1723
1723
|
};
|
|
1724
1724
|
},
|
|
1725
1725
|
otherLocales: async (e, n, t) => {
|
|
1726
|
-
const r =
|
|
1726
|
+
const r = K(t);
|
|
1727
1727
|
if (!r.enabled) return null;
|
|
1728
1728
|
const i = Object.keys(r.locales ?? {});
|
|
1729
1729
|
if (i.length === 0) return null;
|
|
1730
|
-
const a = t.storage.locale, o =
|
|
1730
|
+
const a = t.storage.locale, o = X(e), s = o.split("/").filter(Boolean);
|
|
1731
1731
|
if (s.length === 0) return null;
|
|
1732
1732
|
const {
|
|
1733
1733
|
loaders: { collectionLoader: c }
|
|
@@ -1787,11 +1787,11 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1787
1787
|
(t) => mr(t.key)
|
|
1788
1788
|
);
|
|
1789
1789
|
if (Array.isArray(n) && n.length > 1)
|
|
1790
|
-
throw new
|
|
1790
|
+
throw new T(
|
|
1791
1791
|
`You passed ${n.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${n.map((t) => t.key).join(",")}`
|
|
1792
1792
|
);
|
|
1793
1793
|
return n?.[0] ?? null;
|
|
1794
|
-
}, fr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, Sr = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ve = (e) => e?.find((n) => n.key === "locale")?.value ?? null, xe = (e) => e?.find((n) => n.key === "channel")?.value ?? null,
|
|
1794
|
+
}, fr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, Sr = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ve = (e) => e?.find((n) => n.key === "locale")?.value ?? null, xe = (e) => e?.find((n) => n.key === "channel")?.value ?? null, ye = (e, n) => {
|
|
1795
1795
|
let t = 0;
|
|
1796
1796
|
for (let r = 1; r < e.length; r++)
|
|
1797
1797
|
n(e[t], e[r]) > 0 && (t = r);
|
|
@@ -1808,7 +1808,7 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1808
1808
|
min: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
|
|
1809
1809
|
const i = ze(
|
|
1810
1810
|
r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
|
|
1811
|
-
), o =
|
|
1811
|
+
), o = ye(e, (s, c) => s.range.from - c.range.from)?.range?.from ?? 0;
|
|
1812
1812
|
return {
|
|
1813
1813
|
selected: i?.[0] ?? o,
|
|
1814
1814
|
absolute: o
|
|
@@ -1817,7 +1817,7 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1817
1817
|
max: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
|
|
1818
1818
|
const i = ze(
|
|
1819
1819
|
r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
|
|
1820
|
-
), o =
|
|
1820
|
+
), o = ye(e, (s, c) => c.range.to - s.range.to)?.range?.to ?? 0;
|
|
1821
1821
|
return {
|
|
1822
1822
|
selected: i?.[1] ?? o,
|
|
1823
1823
|
absolute: o
|
|
@@ -1828,9 +1828,9 @@ const G = (e) => Kt(e) ? e.slug : fe(e) ? e.linkId : e.linkId ?? oe(e.name), hn
|
|
|
1828
1828
|
label: ({ name: e }) => e || "unknown",
|
|
1829
1829
|
selected: ({ selected: e }) => e,
|
|
1830
1830
|
quantity: ({ quantity: e }) => e
|
|
1831
|
-
},
|
|
1831
|
+
}, br = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1832
1832
|
if (!n?.orderId)
|
|
1833
|
-
throw new
|
|
1833
|
+
throw new T("Missing orderId");
|
|
1834
1834
|
return { data: (await t.checkout.cancelOrder(n))?.data };
|
|
1835
1835
|
};
|
|
1836
1836
|
function Sn(e) {
|
|
@@ -1851,7 +1851,7 @@ function Sn(e) {
|
|
|
1851
1851
|
}
|
|
1852
1852
|
return null;
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1854
|
+
function Cr(e) {
|
|
1855
1855
|
if (!e || e.status !== "pending") return !1;
|
|
1856
1856
|
const n = e.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
|
|
1857
1857
|
return n.length === 0 ? !1 : n.every((t) => !t.isUserNextAuthorizer);
|
|
@@ -1859,12 +1859,12 @@ function br(e) {
|
|
|
1859
1859
|
const wr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1860
1860
|
const r = await t.oms.processOrderAuthorization(n), i = Sn(r);
|
|
1861
1861
|
return {
|
|
1862
|
-
isPendingForOtherAuthorizer: !i &&
|
|
1862
|
+
isPendingForOtherAuthorizer: !i && Cr(r),
|
|
1863
1863
|
ruleForAuthorization: i
|
|
1864
1864
|
};
|
|
1865
1865
|
}, Dr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1866
1866
|
if (!n?.objectKey)
|
|
1867
|
-
throw new
|
|
1867
|
+
throw new T("Missing objectKey");
|
|
1868
1868
|
const r = n.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
|
|
1869
1869
|
return t.orderEntry.startOperation({
|
|
1870
1870
|
objectKey: n.objectKey,
|
|
@@ -1880,16 +1880,16 @@ const wr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
|
1880
1880
|
}, Pr = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), _r = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1881
1881
|
const { fileContent: r, fileName: i, mimeType: a } = n;
|
|
1882
1882
|
if (!r || !i || !a)
|
|
1883
|
-
throw new
|
|
1883
|
+
throw new T(
|
|
1884
1884
|
"Missing required fields: fileContent, fileName, mimeType"
|
|
1885
1885
|
);
|
|
1886
1886
|
const o = r.replaceAll(/\s/g, ""), s = 5 * 1024 * 1024;
|
|
1887
1887
|
if (Math.floor(o.length * 3 / 4) > s)
|
|
1888
|
-
throw new
|
|
1888
|
+
throw new T("File exceeds maximum allowed size of 5MB");
|
|
1889
1889
|
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
|
|
1890
1890
|
o
|
|
1891
1891
|
))
|
|
1892
|
-
throw new
|
|
1892
|
+
throw new T("Invalid Base64 fileContent");
|
|
1893
1893
|
const u = Buffer.from(o, "base64");
|
|
1894
1894
|
return await t.orderEntry.uploadFile({
|
|
1895
1895
|
fileBuffer: u,
|
|
@@ -1915,16 +1915,16 @@ class ee {
|
|
|
1915
1915
|
return JSON.stringify(n);
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
1918
|
-
function
|
|
1918
|
+
function kr(e, n) {
|
|
1919
1919
|
return n == null || n === "" || String(n) === String(e.salesChannel ?? "") ? null : ee.stringify({
|
|
1920
1920
|
...e,
|
|
1921
1921
|
salesChannel: String(n),
|
|
1922
1922
|
hasOnlyDefaultSalesChannel: !1
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
|
-
const
|
|
1925
|
+
const ce = (e, n) => {
|
|
1926
1926
|
e.storage.channel = ee.parse(n);
|
|
1927
|
-
},
|
|
1927
|
+
}, Ie = (e, n) => {
|
|
1928
1928
|
e.storage.locale = n;
|
|
1929
1929
|
}, yn = (e) => jn.createHash("md5").update(e).digest("hex"), ne = {
|
|
1930
1930
|
attachment: "ATTACHMENT",
|
|
@@ -1938,7 +1938,7 @@ function In(e) {
|
|
|
1938
1938
|
valueReference: ne.attachment
|
|
1939
1939
|
};
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1941
|
+
function Tr(e) {
|
|
1942
1942
|
return {
|
|
1943
1943
|
propertyID: e.id,
|
|
1944
1944
|
name: e.name,
|
|
@@ -1954,7 +1954,7 @@ function vn(e) {
|
|
|
1954
1954
|
`${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`
|
|
1955
1955
|
);
|
|
1956
1956
|
}
|
|
1957
|
-
const
|
|
1957
|
+
const Er = (e) => {
|
|
1958
1958
|
const n = e.postalCode, t = e.geoCoordinates, r = {
|
|
1959
1959
|
addressType: e.addressType || null,
|
|
1960
1960
|
postalCode: n || null,
|
|
@@ -2007,12 +2007,12 @@ const kr = (e) => {
|
|
|
2007
2007
|
));
|
|
2008
2008
|
}
|
|
2009
2009
|
);
|
|
2010
|
-
},
|
|
2010
|
+
}, bn = (e) => e.valueReference === ne.attachment, ve = (e) => [
|
|
2011
2011
|
e.itemOffered.sku,
|
|
2012
2012
|
e.seller.identifier,
|
|
2013
2013
|
e.price < 0.01 ? "Gift" : void 0,
|
|
2014
|
-
e.itemOffered.additionalProperty?.filter(
|
|
2015
|
-
].filter(Boolean).join("::"),
|
|
2014
|
+
e.itemOffered.additionalProperty?.filter(bn).map(vn).join("-")
|
|
2015
|
+
].filter(Boolean).join("::"), le = (e, n) => ({
|
|
2016
2016
|
listPrice: e.listPrice / 100,
|
|
2017
2017
|
price: e.sellingPrice / 100,
|
|
2018
2018
|
quantity: e.quantity,
|
|
@@ -2029,13 +2029,13 @@ const kr = (e) => {
|
|
|
2029
2029
|
seller: e.seller.identifier,
|
|
2030
2030
|
id: e.itemOffered.sku,
|
|
2031
2031
|
index: e.index,
|
|
2032
|
-
attachments: (e.itemOffered.additionalProperty?.filter(
|
|
2032
|
+
attachments: (e.itemOffered.additionalProperty?.filter(bn) ?? []).map((n) => ({
|
|
2033
2033
|
name: n.name,
|
|
2034
2034
|
content: n.value
|
|
2035
2035
|
})),
|
|
2036
2036
|
...e.priceToken ? { priceToken: e.priceToken } : {}
|
|
2037
2037
|
}), qe = (e) => e.reduce((n, t) => {
|
|
2038
|
-
const r =
|
|
2038
|
+
const r = ve(t);
|
|
2039
2039
|
return n.has(r) || n.set(r, []), n.get(r)?.push(t), n;
|
|
2040
2040
|
}, /* @__PURE__ */ new Map()), zr = (e, n) => {
|
|
2041
2041
|
const t = ({ priceToken: s, ...c }, d) => ({
|
|
@@ -2044,10 +2044,10 @@ const kr = (e) => {
|
|
|
2044
2044
|
sku: c.itemOffered.sku
|
|
2045
2045
|
},
|
|
2046
2046
|
index: d
|
|
2047
|
-
}), r = n.items.map(
|
|
2047
|
+
}), r = n.items.map(le).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = De(r, i);
|
|
2048
2048
|
return a && o;
|
|
2049
2049
|
};
|
|
2050
|
-
function
|
|
2050
|
+
function Cn(e, n) {
|
|
2051
2051
|
return e?.some(
|
|
2052
2052
|
(t) => t.parentItemIndex !== null && t.parentItemIndex !== void 0 && e[t.parentItemIndex]?.id === n
|
|
2053
2053
|
);
|
|
@@ -2060,7 +2060,7 @@ function wn(e, n) {
|
|
|
2060
2060
|
const je = (e) => {
|
|
2061
2061
|
const n = e.items.reduce(
|
|
2062
2062
|
(t, r, i) => {
|
|
2063
|
-
const a = wn(e.items, r.id) ||
|
|
2063
|
+
const a = wn(e.items, r.id) || Cn(e.items, r.id) ? `${ve(le(r))}::${i}` : ve(le(r));
|
|
2064
2064
|
return t[a] || (t[a] = []), t[a].push(r), t;
|
|
2065
2065
|
},
|
|
2066
2066
|
{}
|
|
@@ -2079,7 +2079,7 @@ const je = (e) => {
|
|
|
2079
2079
|
};
|
|
2080
2080
|
})
|
|
2081
2081
|
};
|
|
2082
|
-
},
|
|
2082
|
+
}, Oe = async (e, n, t, r) => ({
|
|
2083
2083
|
order: {
|
|
2084
2084
|
orderNumber: e.orderFormId,
|
|
2085
2085
|
acceptedOffer: e.items.map(async (i) => ({
|
|
@@ -2135,7 +2135,7 @@ const je = (e) => {
|
|
|
2135
2135
|
n
|
|
2136
2136
|
);
|
|
2137
2137
|
if (r) {
|
|
2138
|
-
const a = Ur(e, n, i), s = a ||
|
|
2138
|
+
const a = Ur(e, n, i), s = a || Er(n);
|
|
2139
2139
|
return !!n.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
|
|
2140
2140
|
{
|
|
2141
2141
|
id: e.orderFormId,
|
|
@@ -2161,12 +2161,12 @@ const je = (e) => {
|
|
|
2161
2161
|
const r = Q(e)[n];
|
|
2162
2162
|
return r ? r.split("=")[1] : "";
|
|
2163
2163
|
}, Ge = (e, n) => {
|
|
2164
|
-
const t =
|
|
2164
|
+
const t = kr(
|
|
2165
2165
|
e.storage.channel,
|
|
2166
2166
|
n.salesChannel
|
|
2167
2167
|
);
|
|
2168
|
-
return t ? (
|
|
2169
|
-
}, Xe = (e, n, t, r) => r ?
|
|
2168
|
+
return t ? (ce(e, t), n.salesChannel ? String(n.salesChannel) : null) : null;
|
|
2169
|
+
}, Xe = (e, n, t, r) => r ? Oe(e, n, t, r) : null, jr = async (e, { cart: { order: n }, session: t }, r) => {
|
|
2170
2170
|
const i = qr(
|
|
2171
2171
|
r.headers.cookie,
|
|
2172
2172
|
"checkout.vtex.com"
|
|
@@ -2174,7 +2174,7 @@ const je = (e) => {
|
|
|
2174
2174
|
clients: { commerce: a },
|
|
2175
2175
|
loaders: { skuLoader: o }
|
|
2176
2176
|
} = r, s = t?.channel, c = t?.locale;
|
|
2177
|
-
s &&
|
|
2177
|
+
s && ce(r, s), c && Ie(r, c);
|
|
2178
2178
|
const d = i || void 0, u = await a.checkout.orderForm({
|
|
2179
2179
|
id: d,
|
|
2180
2180
|
channel: r.storage.channel,
|
|
@@ -2183,7 +2183,7 @@ const je = (e) => {
|
|
|
2183
2183
|
u.messages.length !== 0 && await xr(p, r);
|
|
2184
2184
|
const f = Q(r?.headers?.cookie ?? "")?.vtex_session, h = z(f), { acceptedOffer: v, shouldSplitItem: l } = n;
|
|
2185
2185
|
if (Vr(u, h)) {
|
|
2186
|
-
const
|
|
2186
|
+
const b = Ge(
|
|
2187
2187
|
r,
|
|
2188
2188
|
u
|
|
2189
2189
|
), N = await We(
|
|
@@ -2192,35 +2192,35 @@ const je = (e) => {
|
|
|
2192
2192
|
h
|
|
2193
2193
|
).then(je);
|
|
2194
2194
|
if (p)
|
|
2195
|
-
return
|
|
2195
|
+
return Oe(
|
|
2196
2196
|
N,
|
|
2197
2197
|
o,
|
|
2198
2198
|
l,
|
|
2199
|
-
|
|
2199
|
+
b
|
|
2200
2200
|
);
|
|
2201
2201
|
}
|
|
2202
2202
|
const m = Ge(
|
|
2203
2203
|
r,
|
|
2204
2204
|
u
|
|
2205
|
-
), S = qe(v), O = qe(u.items.map(
|
|
2206
|
-
(
|
|
2205
|
+
), S = qe(v), O = qe(u.items.map(le)), w = Array.from(O.entries()), C = Array.from(S.entries()), { itemsToAdd: k, itemsToUpdate: I } = C.reduce(
|
|
2206
|
+
(b, [N, Ae]) => {
|
|
2207
2207
|
const Pe = O.get(N);
|
|
2208
2208
|
if (!Pe)
|
|
2209
|
-
return Ae.forEach((
|
|
2209
|
+
return Ae.forEach((j) => b.itemsToAdd.push(j)), b;
|
|
2210
2210
|
const [te, ...Un] = Pe;
|
|
2211
|
-
if (wn(u.items, te.itemOffered.sku) ||
|
|
2212
|
-
return
|
|
2213
|
-
const Rn = Ae.reduce((
|
|
2214
|
-
return
|
|
2211
|
+
if (wn(u.items, te.itemOffered.sku) || Cn(u.items, te.itemOffered.sku))
|
|
2212
|
+
return b.itemsToUpdate.push(te), b;
|
|
2213
|
+
const Rn = Ae.reduce((j, Fn) => j + Fn.quantity, 0);
|
|
2214
|
+
return b.itemsToUpdate.push({
|
|
2215
2215
|
...te,
|
|
2216
2216
|
quantity: Rn
|
|
2217
|
-
}), Un.forEach((
|
|
2217
|
+
}), Un.forEach((j) => b.itemsToUpdate.push({ ...j, quantity: 0 })), b;
|
|
2218
2218
|
},
|
|
2219
2219
|
{
|
|
2220
2220
|
itemsToAdd: [],
|
|
2221
2221
|
itemsToUpdate: []
|
|
2222
2222
|
}
|
|
2223
|
-
), D = w.filter(([
|
|
2223
|
+
), D = w.filter(([b]) => !S.has(b)).flatMap(([, b]) => b.map((N) => ({ ...N, quantity: 0 }))), A = [...k, ...I, ...D].map(
|
|
2224
2224
|
Mr
|
|
2225
2225
|
), { updateShipping: _ } = t ? On(u, t) : { updateShipping: !1 };
|
|
2226
2226
|
if (A.length === 0 && !_)
|
|
@@ -2236,15 +2236,15 @@ const je = (e) => {
|
|
|
2236
2236
|
orderItems: A,
|
|
2237
2237
|
shouldSplitItem: l
|
|
2238
2238
|
}).then(
|
|
2239
|
-
(
|
|
2239
|
+
(b) => He(b, t, r)
|
|
2240
2240
|
) : P = await He(
|
|
2241
2241
|
u,
|
|
2242
2242
|
t,
|
|
2243
2243
|
r
|
|
2244
|
-
), P = await Promise.resolve(P).then((
|
|
2244
|
+
), P = await Promise.resolve(P).then((b) => {
|
|
2245
2245
|
if (t?.marketingData) {
|
|
2246
2246
|
const N = {
|
|
2247
|
-
...
|
|
2247
|
+
...b.marketingData,
|
|
2248
2248
|
...t.marketingData
|
|
2249
2249
|
};
|
|
2250
2250
|
return a.checkout.marketingData({
|
|
@@ -2252,14 +2252,14 @@ const je = (e) => {
|
|
|
2252
2252
|
marketingData: N
|
|
2253
2253
|
});
|
|
2254
2254
|
}
|
|
2255
|
-
return
|
|
2256
|
-
}).then((
|
|
2257
|
-
id:
|
|
2255
|
+
return b;
|
|
2256
|
+
}).then((b) => c && b.clientPreferencesData?.locale !== c ? a.checkout.clientPreferencesData({
|
|
2257
|
+
id: b.orderFormId,
|
|
2258
2258
|
clientPreferencesData: {
|
|
2259
|
-
...
|
|
2259
|
+
...b.clientPreferencesData,
|
|
2260
2260
|
locale: c
|
|
2261
2261
|
}
|
|
2262
|
-
}) :
|
|
2262
|
+
}) : b).then((b) => We(b, a, h)).then(je);
|
|
2263
2263
|
const R = De(
|
|
2264
2264
|
u.messages,
|
|
2265
2265
|
P.messages
|
|
@@ -2269,7 +2269,7 @@ const je = (e) => {
|
|
|
2269
2269
|
o,
|
|
2270
2270
|
l,
|
|
2271
2271
|
m
|
|
2272
|
-
) :
|
|
2272
|
+
) : Oe(
|
|
2273
2273
|
P,
|
|
2274
2274
|
o,
|
|
2275
2275
|
l,
|
|
@@ -2416,7 +2416,7 @@ const ii = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2416
2416
|
r,
|
|
2417
2417
|
i?.cookie,
|
|
2418
2418
|
a
|
|
2419
|
-
), m = await r.commerce.session(f.toString()).catch(() => null), S = m?.namespaces.profile ?? null, O = m?.namespaces.shopper ?? null, w = m?.namespaces.store ?? null,
|
|
2419
|
+
), m = await r.commerce.session(f.toString()).catch(() => null), S = m?.namespaces.profile ?? null, O = m?.namespaces.shopper ?? null, w = m?.namespaces.store ?? null, C = m?.namespaces.authentication ?? null, k = m?.namespaces.checkout ?? null, I = m?.namespaces.public ?? null;
|
|
2420
2420
|
let D = null;
|
|
2421
2421
|
if (v && S?.id?.value)
|
|
2422
2422
|
try {
|
|
@@ -2446,7 +2446,7 @@ const ii = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2446
2446
|
channel: Wr(
|
|
2447
2447
|
o,
|
|
2448
2448
|
w?.channel?.value,
|
|
2449
|
-
|
|
2449
|
+
k?.regionId?.value,
|
|
2450
2450
|
A
|
|
2451
2451
|
),
|
|
2452
2452
|
/**
|
|
@@ -2457,7 +2457,7 @@ const ii = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2457
2457
|
*/
|
|
2458
2458
|
b2b: ti({
|
|
2459
2459
|
isRepresentative: v,
|
|
2460
|
-
authentication:
|
|
2460
|
+
authentication: C,
|
|
2461
2461
|
shopper: O,
|
|
2462
2462
|
publicData: I,
|
|
2463
2463
|
profile: S,
|
|
@@ -2475,16 +2475,16 @@ const ii = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
|
|
|
2475
2475
|
validateCart: jr,
|
|
2476
2476
|
validateSession: ii,
|
|
2477
2477
|
subscribeToNewsletter: Pr,
|
|
2478
|
-
cancelOrder:
|
|
2478
|
+
cancelOrder: br,
|
|
2479
2479
|
processOrderAuthorization: wr,
|
|
2480
2480
|
uploadFileToOrderEntry: _r,
|
|
2481
2481
|
startOrderEntryOperation: Dr,
|
|
2482
2482
|
startRecommendationSession: Ar
|
|
2483
2483
|
};
|
|
2484
|
-
var
|
|
2484
|
+
var be;
|
|
2485
2485
|
(function(e) {
|
|
2486
2486
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
2487
|
-
})(
|
|
2487
|
+
})(be || (be = {}));
|
|
2488
2488
|
const oi = (e) => typeof e == "string" ? Pn(e) : null;
|
|
2489
2489
|
function Pn(e) {
|
|
2490
2490
|
try {
|
|
@@ -2499,9 +2499,9 @@ const si = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2499
2499
|
parseValue: oi,
|
|
2500
2500
|
serialize: si,
|
|
2501
2501
|
parseLiteral(e) {
|
|
2502
|
-
return e.kind ===
|
|
2502
|
+
return e.kind === be.STRING ? Pn(e.value) : null;
|
|
2503
2503
|
}
|
|
2504
|
-
}),
|
|
2504
|
+
}), E = (e) => "Price" in e && "seller" in e && "product" in e, U = (e) => "skuName" in e, li = {
|
|
2505
2505
|
priceCurrency: async (e, n, t) => {
|
|
2506
2506
|
const {
|
|
2507
2507
|
loaders: { salesChannelLoader: r },
|
|
@@ -2509,34 +2509,34 @@ const si = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2509
2509
|
} = t;
|
|
2510
2510
|
return (await r.load(i.salesChannel)).CurrencyCode ?? "";
|
|
2511
2511
|
},
|
|
2512
|
-
priceValidUntil: (e) =>
|
|
2512
|
+
priceValidUntil: (e) => E(e) ? e.PriceValidUntil ?? "" : U(e) ? e.priceValidUntil ?? "" : null,
|
|
2513
2513
|
itemCondition: () => "https://schema.org/NewCondition",
|
|
2514
|
-
availability: async (e) =>
|
|
2515
|
-
seller: (e, n, t) =>
|
|
2514
|
+
availability: async (e) => E(e) ? Le(B(e)) : U(e) ? Le(sr(e.availability)) : null,
|
|
2515
|
+
seller: (e, n, t) => E(e) ? {
|
|
2516
2516
|
identifier: t.storage.channel?.seller || e.seller.sellerId || ""
|
|
2517
2517
|
} : U(e) ? {
|
|
2518
2518
|
identifier: e.seller
|
|
2519
2519
|
} : null,
|
|
2520
|
-
price: (e) =>
|
|
2521
|
-
priceWithTaxes: (e) =>
|
|
2520
|
+
price: (e) => E(e) ? q(e) : U(e) ? e.sellingPrice / 100 : null,
|
|
2521
|
+
priceWithTaxes: (e) => E(e) ? V(q(e), e?.Tax, e.product.unitMultiplier) : U(e) ? V(
|
|
2522
2522
|
e.sellingPrice / 100,
|
|
2523
2523
|
e.tax / 100,
|
|
2524
2524
|
e.unitMultiplier
|
|
2525
2525
|
) : null,
|
|
2526
|
-
sellingPrice: (e) =>
|
|
2527
|
-
listPrice: (e) =>
|
|
2528
|
-
listPriceWithTaxes: (e) =>
|
|
2526
|
+
sellingPrice: (e) => E(e) ? or(e) : U(e) ? e.sellingPrice / 100 : null,
|
|
2527
|
+
listPrice: (e) => E(e) ? e.ListPrice ?? 0 : U(e) ? e.listPrice / 100 : null,
|
|
2528
|
+
listPriceWithTaxes: (e) => E(e) ? V(
|
|
2529
2529
|
e.ListPrice ?? 0,
|
|
2530
2530
|
e?.Tax,
|
|
2531
2531
|
e.product.unitMultiplier
|
|
2532
2532
|
) : U(e) ? V(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
|
|
2533
|
-
itemOffered: (e) =>
|
|
2533
|
+
itemOffered: (e) => E(e) ? e.product : U(e) ? {
|
|
2534
2534
|
...e.product,
|
|
2535
2535
|
attachmentsValues: e.attachments
|
|
2536
2536
|
} : null,
|
|
2537
|
-
quantity: (e) =>
|
|
2537
|
+
quantity: (e) => E(e) ? e.AvailableQuantity ?? 0 : U(e) ? e.quantity : null,
|
|
2538
2538
|
isGift: (e) => U(e) ? e.isGift ?? !1 : null,
|
|
2539
|
-
priceToken: (e) =>
|
|
2539
|
+
priceToken: (e) => E(e) ? e.PriceToken ?? null : null
|
|
2540
2540
|
}, di = ({ linkText: e }) => `/${e}/p`, ui = ({
|
|
2541
2541
|
offer: e,
|
|
2542
2542
|
seller: n,
|
|
@@ -2568,7 +2568,7 @@ const si = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2568
2568
|
function Ce(e) {
|
|
2569
2569
|
return e.replace(/^\/+|\/+$/g, "");
|
|
2570
2570
|
}
|
|
2571
|
-
async function
|
|
2571
|
+
async function oe(e, n, t) {
|
|
2572
2572
|
const r = `${n}:${t}`;
|
|
2573
2573
|
e.storage.productTranslationsCache ??= /* @__PURE__ */ new Map();
|
|
2574
2574
|
const i = e.storage.productTranslationsCache, a = i.get(r);
|
|
@@ -2584,8 +2584,11 @@ async function be(e, n, t) {
|
|
|
2584
2584
|
categories: s.categories ?? [],
|
|
2585
2585
|
availableLinkIds: s.availableLinkIds ?? {}
|
|
2586
2586
|
};
|
|
2587
|
-
} catch {
|
|
2588
|
-
return
|
|
2587
|
+
} catch (s) {
|
|
2588
|
+
return console.warn(
|
|
2589
|
+
`[getLocalizedProductEntry] failed to load product ${n} for locale ${t}:`,
|
|
2590
|
+
s
|
|
2591
|
+
), null;
|
|
2589
2592
|
}
|
|
2590
2593
|
})();
|
|
2591
2594
|
return i.set(r, o), o;
|
|
@@ -2617,8 +2620,8 @@ const Ii = (e, n) => {
|
|
|
2617
2620
|
},
|
|
2618
2621
|
itemId: d
|
|
2619
2622
|
} = e, u = Ii(s, o), p = r[u], f = Ce(p).split("/"), h = t.storage.locale;
|
|
2620
|
-
if (
|
|
2621
|
-
const v = await
|
|
2623
|
+
if (x(t) && h) {
|
|
2624
|
+
const v = await oe(t, c, h);
|
|
2622
2625
|
if (v) {
|
|
2623
2626
|
const l = new Set(
|
|
2624
2627
|
Ce(s[u]).split("/").filter(Boolean)
|
|
@@ -2648,7 +2651,7 @@ const Ii = (e, n) => {
|
|
|
2648
2651
|
return {
|
|
2649
2652
|
itemListElement: [
|
|
2650
2653
|
...f.map((v, l) => {
|
|
2651
|
-
const g = `/${f.slice(0, l + 1).map(
|
|
2654
|
+
const g = `/${f.slice(0, l + 1).map(se).join("/")}/`;
|
|
2652
2655
|
return {
|
|
2653
2656
|
name: v,
|
|
2654
2657
|
item: g,
|
|
@@ -2709,7 +2712,7 @@ const Ii = (e, n) => {
|
|
|
2709
2712
|
}))
|
|
2710
2713
|
), i = n.map(
|
|
2711
2714
|
In
|
|
2712
|
-
), a = t.map(
|
|
2715
|
+
), a = t.map(Tr);
|
|
2713
2716
|
return [
|
|
2714
2717
|
...r,
|
|
2715
2718
|
...i,
|
|
@@ -2723,20 +2726,29 @@ const Ii = (e, n) => {
|
|
|
2723
2726
|
advertisement: ({ isVariantOf: { advertisement: e } }) => e,
|
|
2724
2727
|
deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: e } }) => e,
|
|
2725
2728
|
otherLocales: async (e, n, t) => {
|
|
2726
|
-
if (!
|
|
2727
|
-
const r =
|
|
2729
|
+
if (!x(t)) return null;
|
|
2730
|
+
const r = Ct(t);
|
|
2728
2731
|
if (r.length === 0) return null;
|
|
2729
|
-
const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s =
|
|
2730
|
-
if (!
|
|
2731
|
-
const { availableLinkIds:
|
|
2732
|
-
return r.map((
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2732
|
+
const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await oe(t, i, o);
|
|
2733
|
+
if (!s?.availableLinkIds) return null;
|
|
2734
|
+
const { availableLinkIds: c } = s;
|
|
2735
|
+
return r.map((d) => {
|
|
2736
|
+
const u = c[d];
|
|
2737
|
+
return u ? { locale: d, slug: ae(u, a) } : null;
|
|
2738
|
+
}).filter((d) => d !== null);
|
|
2739
|
+
},
|
|
2740
|
+
defaultLocaleSlug: async (e, n, t) => {
|
|
2741
|
+
if (!x(t)) return null;
|
|
2742
|
+
const r = wt(t);
|
|
2743
|
+
if (!r) return null;
|
|
2744
|
+
const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await oe(
|
|
2745
|
+
t,
|
|
2746
|
+
i,
|
|
2747
|
+
t.storage.locale
|
|
2748
|
+
))?.availableLinkIds?.[r] ?? a;
|
|
2749
|
+
return ae(c, o);
|
|
2738
2750
|
}
|
|
2739
|
-
}, Oi = /* @__PURE__ */ new Set(["allSpecifications"]),
|
|
2751
|
+
}, Oi = /* @__PURE__ */ new Set(["allSpecifications"]), bi = {
|
|
2740
2752
|
hasVariant: (e) => e.isVariantOf.items.map((n) => F(n, e.isVariantOf)),
|
|
2741
2753
|
productGroupID: ({ isVariantOf: e }) => e.productId,
|
|
2742
2754
|
name: (e) => e.isVariantOf.productName,
|
|
@@ -2752,18 +2764,18 @@ const Ii = (e, n) => {
|
|
|
2752
2764
|
}))
|
|
2753
2765
|
)
|
|
2754
2766
|
)
|
|
2755
|
-
},
|
|
2767
|
+
}, Ci = {
|
|
2756
2768
|
propertyID: (e) => e.propertyID || vn(e),
|
|
2757
2769
|
name: ({ name: e }) => e,
|
|
2758
2770
|
value: ({ value: e }) => e,
|
|
2759
2771
|
valueReference: ({ valueReference: e }) => e
|
|
2760
|
-
},
|
|
2772
|
+
}, de = (e) => {
|
|
2761
2773
|
const n = e.flatMap(
|
|
2762
2774
|
(r) => r.sellers.map((i) => ({
|
|
2763
2775
|
offer: i.commertialOffer,
|
|
2764
2776
|
sku: r
|
|
2765
2777
|
}))
|
|
2766
|
-
), t =
|
|
2778
|
+
), t = ye(
|
|
2767
2779
|
n,
|
|
2768
2780
|
({ offer: r }, { offer: i }) => mn(r, i)
|
|
2769
2781
|
);
|
|
@@ -2773,12 +2785,12 @@ const Ii = (e, n) => {
|
|
|
2773
2785
|
clients: { commerce: a }
|
|
2774
2786
|
} = i, { salesChannel: o } = i.storage.channel, s = n?.trim();
|
|
2775
2787
|
if (!s || !wi.test(s))
|
|
2776
|
-
throw new
|
|
2788
|
+
throw new T(`Invalid campaignVrn: "${n}"`);
|
|
2777
2789
|
const c = t?.trim();
|
|
2778
2790
|
if (t != null && !c)
|
|
2779
|
-
throw new
|
|
2791
|
+
throw new T("Invalid userId: must be a non-empty string");
|
|
2780
2792
|
if (r != null && (!Array.isArray(r) || r.some((h) => !h?.trim())))
|
|
2781
|
-
throw new
|
|
2793
|
+
throw new T(
|
|
2782
2794
|
"Invalid products: must be an array of non-empty strings"
|
|
2783
2795
|
);
|
|
2784
2796
|
const d = await a.recommendation.recommendations({
|
|
@@ -2790,7 +2802,7 @@ const Ii = (e, n) => {
|
|
|
2790
2802
|
}), { campaign: u, correlationId: p } = d;
|
|
2791
2803
|
return {
|
|
2792
2804
|
products: (d.products ?? []).map((h) => {
|
|
2793
|
-
const v =
|
|
2805
|
+
const v = de(h.items);
|
|
2794
2806
|
return v ? F(v, h) : null;
|
|
2795
2807
|
}).filter((h) => !!h),
|
|
2796
2808
|
correlationId: p,
|
|
@@ -2807,11 +2819,11 @@ const Ii = (e, n) => {
|
|
|
2807
2819
|
score_desc: ""
|
|
2808
2820
|
}, Ai = async (e, { operationId: n }, { clients: { commerce: t } }) => {
|
|
2809
2821
|
if (!n)
|
|
2810
|
-
throw new
|
|
2822
|
+
throw new T("Missing operationId");
|
|
2811
2823
|
return t.orderEntry.getOperation({ operationId: n });
|
|
2812
2824
|
}, Pi = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
|
|
2813
2825
|
if (!n)
|
|
2814
|
-
throw new
|
|
2826
|
+
throw new T("Missing orderFormId");
|
|
2815
2827
|
const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: n });
|
|
2816
2828
|
return (r ?? []).map((i) => ({
|
|
2817
2829
|
id: i.id,
|
|
@@ -2827,17 +2839,17 @@ const Ii = (e, n) => {
|
|
|
2827
2839
|
};
|
|
2828
2840
|
async function _i(e, n, t, r) {
|
|
2829
2841
|
const i = n.slice(0, n.lastIndexOf("-"));
|
|
2830
|
-
return (await
|
|
2842
|
+
return (await oe(e, t, r))?.linkId === i;
|
|
2831
2843
|
}
|
|
2832
|
-
const
|
|
2833
|
-
async function
|
|
2844
|
+
const kn = "Invalid SkuId", Tn = "Slug was set but the fetched sku does not satisfy the slug condition.", ki = "UseAdHocCard", Ti = (e) => Y(e) || e instanceof Error && (e.message === kn || e.message.startsWith(Tn));
|
|
2845
|
+
async function Ei(e, n, t, r) {
|
|
2834
2846
|
const { linkText: i, productId: a } = n.isVariantOf;
|
|
2835
|
-
if (!(!t || !i || t.startsWith(i) ||
|
|
2836
|
-
throw new Error(`${
|
|
2847
|
+
if (!(!t || !i || t.startsWith(i) || x(e) && r && _n(t.split("-").pop() ?? "") && await _i(e, t, a, r)))
|
|
2848
|
+
throw new Error(`${Tn} slug: ${t}, linkText: ${i}`);
|
|
2837
2849
|
}
|
|
2838
2850
|
async function Ui(e, n) {
|
|
2839
2851
|
if (n == null)
|
|
2840
|
-
throw new
|
|
2852
|
+
throw new T("Missing slug or id");
|
|
2841
2853
|
const {
|
|
2842
2854
|
clients: { commerce: t, search: r }
|
|
2843
2855
|
} = e, i = await t.catalog.portal.pagetype(`${n}/p`);
|
|
@@ -2849,23 +2861,23 @@ async function Ui(e, n) {
|
|
|
2849
2861
|
}).catch(() => null);
|
|
2850
2862
|
if (!a)
|
|
2851
2863
|
throw new $(`No product found for id ${i.id}`);
|
|
2852
|
-
return F(
|
|
2864
|
+
return F(de(a.items), a);
|
|
2853
2865
|
}
|
|
2854
2866
|
const Ri = {
|
|
2855
2867
|
product: async (e, { locator: n }, t) => {
|
|
2856
2868
|
const r = xe(n), i = Ve(n), a = Sr(n), o = fr(n);
|
|
2857
|
-
r &&
|
|
2869
|
+
r && ce(t, r), i && Ie(t, i);
|
|
2858
2870
|
const {
|
|
2859
2871
|
loaders: { skuLoader: s }
|
|
2860
2872
|
} = t;
|
|
2861
2873
|
try {
|
|
2862
2874
|
const c = a ?? o?.split("-").pop() ?? "";
|
|
2863
2875
|
if (!_n(c))
|
|
2864
|
-
throw new Error(
|
|
2876
|
+
throw new Error(kn);
|
|
2865
2877
|
const d = await s.load(c);
|
|
2866
|
-
return await
|
|
2878
|
+
return await Ei(t, d, o, i), d;
|
|
2867
2879
|
} catch (c) {
|
|
2868
|
-
if (!
|
|
2880
|
+
if (!Ti(c))
|
|
2869
2881
|
throw c;
|
|
2870
2882
|
return Ui(t, o);
|
|
2871
2883
|
}
|
|
@@ -2888,7 +2900,7 @@ const Ri = {
|
|
|
2888
2900
|
sponsoredCount: o
|
|
2889
2901
|
}, s) => {
|
|
2890
2902
|
const c = xe(a), d = Ve(a), u = hr(a);
|
|
2891
|
-
c &&
|
|
2903
|
+
c && ce(s, c), d && Ie(s, d);
|
|
2892
2904
|
const p = t ? Number(t) : 0, f = {
|
|
2893
2905
|
page: Math.ceil(p / n) || 0,
|
|
2894
2906
|
count: n,
|
|
@@ -2977,7 +2989,7 @@ const Ri = {
|
|
|
2977
2989
|
id: h.id,
|
|
2978
2990
|
name: h.name,
|
|
2979
2991
|
fatherCategoryId: v,
|
|
2980
|
-
linkId:
|
|
2992
|
+
linkId: se(h.name),
|
|
2981
2993
|
title: h.Title,
|
|
2982
2994
|
description: null,
|
|
2983
2995
|
metaTagDescription: h.MetaTagDescription,
|
|
@@ -2993,7 +3005,7 @@ const Ri = {
|
|
|
2993
3005
|
const f = [...o.filter((h) => h.isActive).map((h) => ({
|
|
2994
3006
|
id: h.id,
|
|
2995
3007
|
name: h.name,
|
|
2996
|
-
linkId:
|
|
3008
|
+
linkId: se(h.name),
|
|
2997
3009
|
title: h.title,
|
|
2998
3010
|
description: null,
|
|
2999
3011
|
metaTagDescription: h.metaTagDescription,
|
|
@@ -3077,7 +3089,7 @@ const Ri = {
|
|
|
3077
3089
|
userOrder: async (e, { orderId: n }, t) => {
|
|
3078
3090
|
try {
|
|
3079
3091
|
if (!n)
|
|
3080
|
-
throw new
|
|
3092
|
+
throw new T("Missing orderId");
|
|
3081
3093
|
const {
|
|
3082
3094
|
clients: { commerce: r }
|
|
3083
3095
|
} = t, i = await r.oms.userOrder({ orderId: n });
|
|
@@ -3125,7 +3137,7 @@ const Ri = {
|
|
|
3125
3137
|
a = { message: i };
|
|
3126
3138
|
}
|
|
3127
3139
|
const o = a?.message || i;
|
|
3128
|
-
throw
|
|
3140
|
+
throw Y(r) ? new $(`No order found for id ${n}. ${o}.`) : ct(r) ? new J(
|
|
3129
3141
|
`You are forbidden to interact with order with id ${n}. ${o}.`
|
|
3130
3142
|
) : r;
|
|
3131
3143
|
}
|
|
@@ -3176,7 +3188,7 @@ const Ri = {
|
|
|
3176
3188
|
} = t, s = z(L(i?.cookie ?? "", r))?.userId ?? "";
|
|
3177
3189
|
if (!s)
|
|
3178
3190
|
return !0;
|
|
3179
|
-
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey:
|
|
3191
|
+
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey: ki }).catch(() => null);
|
|
3180
3192
|
return typeof c == "boolean" ? c : !0;
|
|
3181
3193
|
},
|
|
3182
3194
|
listUserQuotes: async (e, n, t) => {
|
|
@@ -3291,7 +3303,7 @@ const Ri = {
|
|
|
3291
3303
|
// Contract list from VTEX session `shopper.availableContracts`.
|
|
3292
3304
|
availableContracts: async (e, { orgUnitId: n }, t) => {
|
|
3293
3305
|
if (!n)
|
|
3294
|
-
throw new
|
|
3306
|
+
throw new T("Missing orgUnitId");
|
|
3295
3307
|
const {
|
|
3296
3308
|
account: r,
|
|
3297
3309
|
headers: i,
|
|
@@ -3305,7 +3317,7 @@ const Ri = {
|
|
|
3305
3317
|
}
|
|
3306
3318
|
const d = o?.namespaces.authentication?.unitId?.value?.trim() ?? c?.unitId?.trim() ?? "";
|
|
3307
3319
|
if (!d || d !== n)
|
|
3308
|
-
throw new
|
|
3320
|
+
throw new J(
|
|
3309
3321
|
"You are not allowed to list contracts for this organization unit"
|
|
3310
3322
|
);
|
|
3311
3323
|
const u = Xr(
|
|
@@ -3349,7 +3361,7 @@ const Ri = {
|
|
|
3349
3361
|
r.suggestedTerms(i),
|
|
3350
3362
|
a
|
|
3351
3363
|
]), c = s.products.map((u) => {
|
|
3352
|
-
const p =
|
|
3364
|
+
const p = de(u.items);
|
|
3353
3365
|
return p && F(p, u);
|
|
3354
3366
|
}).filter((u) => !!u), { searches: d } = o;
|
|
3355
3367
|
return {
|
|
@@ -3359,7 +3371,7 @@ const Ri = {
|
|
|
3359
3371
|
},
|
|
3360
3372
|
products: async ({ productSearchPromise: e }) => {
|
|
3361
3373
|
const n = await e, t = n.products.map((r) => {
|
|
3362
|
-
const i =
|
|
3374
|
+
const i = de(r.items);
|
|
3363
3375
|
return i && F(i, r);
|
|
3364
3376
|
}).filter((r) => !!r);
|
|
3365
3377
|
return {
|
|
@@ -3421,7 +3433,7 @@ const Ri = {
|
|
|
3421
3433
|
1: "In 1 minute",
|
|
3422
3434
|
other: "Up to # minutes"
|
|
3423
3435
|
}
|
|
3424
|
-
},
|
|
3436
|
+
}, En = (e) => {
|
|
3425
3437
|
const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i = Mi(t);
|
|
3426
3438
|
if (!r || !i)
|
|
3427
3439
|
return "";
|
|
@@ -3430,7 +3442,7 @@ const Ri = {
|
|
|
3430
3442
|
}, Vi = {
|
|
3431
3443
|
carrier: (e) => e?.friendlyName ?? e?.name ?? "",
|
|
3432
3444
|
price: (e) => e?.price ? e.price / 100 : e?.price,
|
|
3433
|
-
localizedEstimates: (e) => e?.shippingEstimate ?
|
|
3445
|
+
localizedEstimates: (e) => e?.shippingEstimate ? En(e.shippingEstimate) : ""
|
|
3434
3446
|
}, Ze = "skuvariation";
|
|
3435
3447
|
function en(e, n) {
|
|
3436
3448
|
const t = `${Ze}${n}`.toLowerCase(), r = e.find(
|
|
@@ -3548,11 +3560,11 @@ const Gi = {
|
|
|
3548
3560
|
deliveryOptionsData: (e) => {
|
|
3549
3561
|
const { shippingData: n, items: t } = e, r = n?.logisticsInfo || [], i = n?.selectedAddresses || n?.availableAddresses || [n?.address], a = r.reduce(
|
|
3550
3562
|
(d, u) => {
|
|
3551
|
-
const p = u?.selectedSla || "", f = u?.selectedDeliveryChannel || u?.deliveryChannel || "", h = u?.deliveryCompany || "", v = u?.deliveryWindow, l = u?.pickupStoreInfo, g = u?.shippingEstimate || "", m = u?.shippingEstimate ?
|
|
3552
|
-
(
|
|
3563
|
+
const p = u?.selectedSla || "", f = u?.selectedDeliveryChannel || u?.deliveryChannel || "", h = u?.deliveryCompany || "", v = u?.deliveryWindow, l = u?.pickupStoreInfo, g = u?.shippingEstimate || "", m = u?.shippingEstimate ? En(u?.shippingEstimate) : "", S = u?.shippingEstimateDate || "", O = u?.addressId || "", w = u?.itemIndex ?? 0, C = t?.[w], k = C?.seller || "", I = `${p}|${f}|${h}|${k}|${g}|${S}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, D = i?.find(
|
|
3564
|
+
(b) => b?.addressId === O
|
|
3553
3565
|
), A = `${Xi[f] || ""} ${m} ${D?.neighborhood ? `to ${D?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: _, taxPriceTags: P } = Ji(
|
|
3554
|
-
|
|
3555
|
-
), R = (
|
|
3566
|
+
C?.priceTags ?? []
|
|
3567
|
+
), R = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (_ ?? 0);
|
|
3556
3568
|
return d[I] || (d[I] = {
|
|
3557
3569
|
// static fields
|
|
3558
3570
|
selectedSla: p,
|
|
@@ -3561,7 +3573,7 @@ const Gi = {
|
|
|
3561
3573
|
deliveryWindow: v,
|
|
3562
3574
|
shippingEstimate: g,
|
|
3563
3575
|
shippingEstimateDate: S,
|
|
3564
|
-
seller:
|
|
3576
|
+
seller: k,
|
|
3565
3577
|
friendlyShippingEstimate: m,
|
|
3566
3578
|
friendlyDeliveryOptionName: A,
|
|
3567
3579
|
address: D,
|
|
@@ -3571,16 +3583,16 @@ const Gi = {
|
|
|
3571
3583
|
total: 0,
|
|
3572
3584
|
items: []
|
|
3573
3585
|
}), d[I] && (d[I].items?.push({
|
|
3574
|
-
id:
|
|
3575
|
-
uniqueId:
|
|
3576
|
-
name:
|
|
3577
|
-
quantity:
|
|
3578
|
-
price:
|
|
3579
|
-
sellingPrice:
|
|
3580
|
-
imageUrl:
|
|
3586
|
+
id: C?.id || "",
|
|
3587
|
+
uniqueId: C?.uniqueId || "",
|
|
3588
|
+
name: C?.name || "",
|
|
3589
|
+
quantity: C?.quantity || 0,
|
|
3590
|
+
price: C?.price || 0,
|
|
3591
|
+
sellingPrice: C?.sellingPrice || 0,
|
|
3592
|
+
imageUrl: C?.imageUrl || "",
|
|
3581
3593
|
taxPriceTags: P ?? [],
|
|
3582
3594
|
taxPriceTagsTotal: _ ?? 0,
|
|
3583
|
-
tax:
|
|
3595
|
+
tax: C?.tax || 0,
|
|
3584
3596
|
total: R
|
|
3585
3597
|
}), d[I].quantityOfDifferentItems = (d[I].quantityOfDifferentItems ?? 0) + 1, d[I].total = (d[I].total ?? 0) + R), d;
|
|
3586
3598
|
},
|
|
@@ -3632,9 +3644,9 @@ const Ki = {
|
|
|
3632
3644
|
StoreOffer: li,
|
|
3633
3645
|
StoreAggregateRating: dr,
|
|
3634
3646
|
StoreReview: Fi,
|
|
3635
|
-
StoreProductGroup:
|
|
3647
|
+
StoreProductGroup: bi,
|
|
3636
3648
|
StoreSearchResult: Li,
|
|
3637
|
-
StorePropertyValue:
|
|
3649
|
+
StorePropertyValue: Ci,
|
|
3638
3650
|
SkuVariants: Gi,
|
|
3639
3651
|
ShippingSLA: Vi,
|
|
3640
3652
|
UserOrderResult: Yi,
|
|
@@ -4875,7 +4887,7 @@ input IStorePerson {
|
|
|
4875
4887
|
"""
|
|
4876
4888
|
familyName: String!
|
|
4877
4889
|
}
|
|
4878
|
-
`,
|
|
4890
|
+
`, ba = `type PickupPointAddress {
|
|
4879
4891
|
"""
|
|
4880
4892
|
Address city.
|
|
4881
4893
|
"""
|
|
@@ -4954,7 +4966,7 @@ type PickupPoints {
|
|
|
4954
4966
|
"""
|
|
4955
4967
|
pickupPointsHash: String
|
|
4956
4968
|
}
|
|
4957
|
-
`,
|
|
4969
|
+
`, Ca = `"""
|
|
4958
4970
|
Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
4959
4971
|
"""
|
|
4960
4972
|
type StoreProduct {
|
|
@@ -5055,6 +5067,14 @@ type StoreProduct {
|
|
|
5055
5067
|
Only populated when localization is enabled.
|
|
5056
5068
|
"""
|
|
5057
5069
|
otherLocales: [StoreProductLocale!]
|
|
5070
|
+
"""
|
|
5071
|
+
Slug for the store's default locale, including the SKU ID suffix.
|
|
5072
|
+
Navigation fallback for the locale selector when the target locale is absent
|
|
5073
|
+
from \`otherLocales\`. Best-effort: it may point at a slug the catalog has not
|
|
5074
|
+
registered for the default locale, so it must never be used to build hreflang
|
|
5075
|
+
annotations. Only populated when localization is enabled.
|
|
5076
|
+
"""
|
|
5077
|
+
defaultLocaleSlug: String
|
|
5058
5078
|
}
|
|
5059
5079
|
|
|
5060
5080
|
"""
|
|
@@ -5964,7 +5984,7 @@ type UserQuoteListPaging {
|
|
|
5964
5984
|
"""
|
|
5965
5985
|
perPage: Int!
|
|
5966
5986
|
}
|
|
5967
|
-
`,
|
|
5987
|
+
`, ka = `type RecommendationResponse {
|
|
5968
5988
|
products: [StoreProduct!]!
|
|
5969
5989
|
correlationId: String!
|
|
5970
5990
|
campaign: RecommendationCampaign!
|
|
@@ -5975,7 +5995,7 @@ type RecommendationCampaign {
|
|
|
5975
5995
|
title: String
|
|
5976
5996
|
type: String!
|
|
5977
5997
|
}
|
|
5978
|
-
`,
|
|
5998
|
+
`, Ta = `"""
|
|
5979
5999
|
Information of a given review rating.
|
|
5980
6000
|
"""
|
|
5981
6001
|
type StoreReviewRating {
|
|
@@ -6002,7 +6022,7 @@ type StoreReview {
|
|
|
6002
6022
|
"""
|
|
6003
6023
|
author: StoreAuthor!
|
|
6004
6024
|
}
|
|
6005
|
-
`,
|
|
6025
|
+
`, Ea = `"""
|
|
6006
6026
|
Whether a saved card is personally owned by the buyer or shared by their
|
|
6007
6027
|
Organization/Contract. Resolved server-side by the Saved-cards service from
|
|
6008
6028
|
the buyer's \`useAdHocCard\` role — never inferred client-side.
|
|
@@ -7644,16 +7664,16 @@ type UserOrderBudgetAllocationLinkedEntity {
|
|
|
7644
7664
|
"./pageInfo.graphql": Ia,
|
|
7645
7665
|
"./password.graphql": va,
|
|
7646
7666
|
"./person.graphql": Oa,
|
|
7647
|
-
"./pickupPoints.graphql":
|
|
7648
|
-
"./product.graphql":
|
|
7667
|
+
"./pickupPoints.graphql": ba,
|
|
7668
|
+
"./product.graphql": Ca,
|
|
7649
7669
|
"./productGroup.graphql": wa,
|
|
7650
7670
|
"./profile.graphql": Da,
|
|
7651
7671
|
"./propertyValue.graphql": Aa,
|
|
7652
7672
|
"./query.graphql": Pa,
|
|
7653
7673
|
"./quote.graphql": _a,
|
|
7654
|
-
"./recommendation.graphql":
|
|
7655
|
-
"./review.graphql":
|
|
7656
|
-
"./savedCard.graphql":
|
|
7674
|
+
"./recommendation.graphql": ka,
|
|
7675
|
+
"./review.graphql": Ta,
|
|
7676
|
+
"./savedCard.graphql": Ea,
|
|
7657
7677
|
"./seo.graphql": Ua,
|
|
7658
7678
|
"./session.graphql": Ra,
|
|
7659
7679
|
"./shipping.graphql": Fa,
|
|
@@ -7689,12 +7709,12 @@ function ao(e) {
|
|
|
7689
7709
|
}
|
|
7690
7710
|
export {
|
|
7691
7711
|
nt as AuthDirective,
|
|
7692
|
-
|
|
7712
|
+
T as BadRequestError,
|
|
7693
7713
|
it as CacheControlDirective,
|
|
7694
7714
|
Wn as CardOrigin,
|
|
7695
7715
|
Hn as CommercialAuthorizationStatus,
|
|
7696
7716
|
Z as FastStoreError,
|
|
7697
|
-
|
|
7717
|
+
J as ForbiddenError,
|
|
7698
7718
|
io as GraphqlVtexContextFactory,
|
|
7699
7719
|
ao as GraphqlVtexSchema,
|
|
7700
7720
|
$ as NotFoundError,
|
|
@@ -7707,7 +7727,7 @@ export {
|
|
|
7707
7727
|
to as isBadRequestError,
|
|
7708
7728
|
no as isFastStoreError,
|
|
7709
7729
|
ct as isForbiddenError,
|
|
7710
|
-
|
|
7730
|
+
Y as isNotFoundError,
|
|
7711
7731
|
ro as isUnauthorizedError,
|
|
7712
7732
|
eo as stringifyCacheControl,
|
|
7713
7733
|
za as typeDefs,
|