@faststore/api 4.3.0-dev.1 → 4.3.0-dev.3

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.
Files changed (38) hide show
  1. package/dist/cjs/index.js +124 -39
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/es/index.mjs +832 -595
  4. package/dist/es/index.mjs.map +1 -1
  5. package/dist/src/__generated__/schema.d.ts +79 -0
  6. package/dist/src/__generated__/schema.d.ts.map +1 -1
  7. package/dist/src/platforms/vtex/clients/commerce/index.d.ts +36 -0
  8. package/dist/src/platforms/vtex/clients/commerce/index.d.ts.map +1 -1
  9. package/dist/src/platforms/vtex/clients/index.d.ts +36 -0
  10. package/dist/src/platforms/vtex/clients/index.d.ts.map +1 -1
  11. package/dist/src/platforms/vtex/index.d.ts +27 -0
  12. package/dist/src/platforms/vtex/index.d.ts.map +1 -1
  13. package/dist/src/platforms/vtex/resolvers/getOrderEntryOperation.d.ts +13 -0
  14. package/dist/src/platforms/vtex/resolvers/getOrderEntryOperation.d.ts.map +1 -0
  15. package/dist/src/platforms/vtex/resolvers/getOrderFormItems.d.ts +14 -0
  16. package/dist/src/platforms/vtex/resolvers/getOrderFormItems.d.ts.map +1 -0
  17. package/dist/src/platforms/vtex/resolvers/index.d.ts +27 -0
  18. package/dist/src/platforms/vtex/resolvers/index.d.ts.map +1 -1
  19. package/dist/src/platforms/vtex/resolvers/mutation.d.ts +6 -0
  20. package/dist/src/platforms/vtex/resolvers/mutation.d.ts.map +1 -1
  21. package/dist/src/platforms/vtex/resolvers/query.d.ts +21 -0
  22. package/dist/src/platforms/vtex/resolvers/query.d.ts.map +1 -1
  23. package/dist/src/platforms/vtex/resolvers/startOrderEntryOperation.d.ts +6 -0
  24. package/dist/src/platforms/vtex/resolvers/startOrderEntryOperation.d.ts.map +1 -0
  25. package/dist/src/platforms/vtex/resolvers/uploadFileToOrderEntry.d.ts +6 -0
  26. package/dist/src/platforms/vtex/resolvers/uploadFileToOrderEntry.d.ts.map +1 -0
  27. package/package.json +3 -3
  28. package/src/__generated__/schema.ts +94 -0
  29. package/src/platforms/vtex/clients/commerce/index.ts +153 -0
  30. package/src/platforms/vtex/resolvers/getOrderEntryOperation.ts +15 -0
  31. package/src/platforms/vtex/resolvers/getOrderFormItems.ts +26 -0
  32. package/src/platforms/vtex/resolvers/mutation.ts +4 -0
  33. package/src/platforms/vtex/resolvers/query.ts +4 -0
  34. package/src/platforms/vtex/resolvers/startOrderEntryOperation.ts +23 -0
  35. package/src/platforms/vtex/resolvers/uploadFileToOrderEntry.ts +45 -0
  36. package/src/platforms/vtex/typeDefs/mutation.graphql +14 -0
  37. package/src/platforms/vtex/typeDefs/orderEntry.graphql +61 -0
  38. package/src/platforms/vtex/typeDefs/query.graphql +9 -0
package/dist/es/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { mergeTypeDefs as Vn } from "@graphql-tools/merge";
2
2
  import { makeExecutableSchema as me, mergeSchemas as he } from "@graphql-tools/schema";
3
3
  import { mapSchema as xn, MapperKind as qn, getDirective as jn } from "@graphql-tools/utils";
4
- import { OTELAPI as L } from "@faststore/diagnostics";
4
+ import { OTELAPI as M } from "@faststore/diagnostics";
5
5
  import { GraphQLScalarType as fe, print as Se, parse as ye, isSchema as Ie } from "graphql";
6
6
  import { parse as tn } from "cookie";
7
7
  import ve from "isomorphic-unfetch";
@@ -10,8 +10,8 @@ import Wn from "p-limit";
10
10
  import Oe from "sanitize-html";
11
11
  import Cn from "fast-deep-equal";
12
12
  import Ce from "node:crypto";
13
- var be = /* @__PURE__ */ ((n) => (n.Accepted = "accepted", n.Denied = "denied", n.Pending = "pending", n))(be || {}), De = /* @__PURE__ */ ((n) => (n.Brand = "Brand", n.Category = "Category", n.Cluster = "Cluster", n.Collection = "Collection", n.Department = "Department", n.SubCategory = "SubCategory", n))(De || {}), we = /* @__PURE__ */ ((n) => (n.Boolean = "BOOLEAN", n.Range = "RANGE", n))(we || {}), Ae = /* @__PURE__ */ ((n) => (n.DiscountDesc = "discount_desc", n.NameAsc = "name_asc", n.NameDesc = "name_desc", n.OrdersDesc = "orders_desc", n.PriceAsc = "price_asc", n.PriceDesc = "price_desc", n.ReleaseDesc = "release_desc", n.ScoreDesc = "score_desc", n))(Ae || {}), Pe = /* @__PURE__ */ ((n) => (n.Error = "ERROR", n.Info = "INFO", n.Warning = "WARNING", n))(Pe || {}), Ue = /* @__PURE__ */ ((n) => (n.Input = "Input", n.Output = "Output", n))(Ue || {});
14
- const ke = () => function(e = {}) {
13
+ var be = /* @__PURE__ */ ((n) => (n.Accepted = "accepted", n.Denied = "denied", n.Pending = "pending", n))(be || {}), we = /* @__PURE__ */ ((n) => (n.Brand = "Brand", n.Category = "Category", n.Cluster = "Cluster", n.Collection = "Collection", n.Department = "Department", n.SubCategory = "SubCategory", n))(we || {}), De = /* @__PURE__ */ ((n) => (n.Boolean = "BOOLEAN", n.Range = "RANGE", n))(De || {}), Ae = /* @__PURE__ */ ((n) => (n.DiscountDesc = "discount_desc", n.NameAsc = "name_asc", n.NameDesc = "name_desc", n.OrdersDesc = "orders_desc", n.PriceAsc = "price_asc", n.PriceDesc = "price_desc", n.ReleaseDesc = "release_desc", n.ScoreDesc = "score_desc", n))(Ae || {}), Pe = /* @__PURE__ */ ((n) => (n.Error = "ERROR", n.Info = "INFO", n.Warning = "WARNING", n))(Pe || {}), Ee = /* @__PURE__ */ ((n) => (n.Input = "Input", n.Output = "Output", n))(Ee || {});
14
+ const _e = () => function(e = {}) {
15
15
  const t = process.env.FS_DISCOVERY_APP_KEY ?? "", r = process.env.FS_DISCOVERY_APP_TOKEN ?? "";
16
16
  if (!t || !r)
17
17
  throw new an("No authentication AppKey and AppToken passed.");
@@ -20,7 +20,7 @@ const ke = () => function(e = {}) {
20
20
  "X-VTEX-API-AppKey": t,
21
21
  "X-VTEX-API-AppToken": r
22
22
  };
23
- }, _e = async (n) => {
23
+ }, Te = async (n) => {
24
24
  const {
25
25
  clients: { commerce: e }
26
26
  } = n;
@@ -31,39 +31,39 @@ const ke = () => function(e = {}) {
31
31
  const r = t.extensions?.status ?? t.status;
32
32
  throw r === 401 ? new J("Authentication required") : r === 403 ? new an("You are not allowed to access this resource") : new J("Authentication required");
33
33
  }
34
- }, Te = "auth", Ee = {
34
+ }, Ue = "auth", ke = {
35
35
  typeDefs: "directive @auth on FIELD_DEFINITION",
36
36
  transformer: (n) => xn(n, {
37
37
  [qn.OBJECT_FIELD]: (e) => {
38
- if (jn(n, e, Te)?.[0]) {
38
+ if (jn(n, e, Ue)?.[0]) {
39
39
  const r = e.resolve;
40
- e.resolve = async (i, a, o, s) => (await _e(o), r?.(i, a, o, s));
40
+ e.resolve = async (i, a, o, s) => (await Te(o), r?.(i, a, o, s));
41
41
  }
42
42
  return e;
43
43
  }
44
44
  })
45
- }, Ne = "cacheControl", Pi = (n, e) => {
45
+ }, Ne = "cacheControl", ki = (n, e) => {
46
46
  const {
47
47
  scope: t = "private",
48
48
  sMaxAge: r = 0,
49
49
  staleWhileRevalidate: i = 0
50
50
  } = n;
51
51
  return `${e ? "private" : t}, s-maxage=${r}, stale-while-revalidate=${i}`;
52
- }, Dn = (n, e) => typeof n == "number" && typeof e == "number" ? n > e ? e : n : typeof n == "number" ? n : e, Fe = (n, e) => typeof n == "string" && typeof e == "string" ? n === "public" && e === "public" ? "public" : "private" : n || e, Re = {
52
+ }, wn = (n, e) => typeof n == "number" && typeof e == "number" ? n > e ? e : n : typeof n == "number" ? n : e, Fe = (n, e) => typeof n == "string" && typeof e == "string" ? n === "public" && e === "public" ? "public" : "private" : n || e, Re = {
53
53
  typeDefs: "directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",
54
54
  transformer: (n) => xn(n, {
55
55
  [qn.OBJECT_FIELD]: (e) => {
56
56
  const t = jn(n, e, Ne)?.[0];
57
57
  if (t) {
58
58
  const { sMaxAge: r, staleWhileRevalidate: i, scope: a } = t, o = e.resolve;
59
- e.resolve = (s, c, d, p) => (d.cacheControl = {
60
- sMaxAge: Dn(d.cacheControl?.sMaxAge, r),
61
- staleWhileRevalidate: Dn(
62
- d.cacheControl?.staleWhileRevalidate,
59
+ e.resolve = (s, c, u, g) => (u.cacheControl = {
60
+ sMaxAge: wn(u.cacheControl?.sMaxAge, r),
61
+ staleWhileRevalidate: wn(
62
+ u.cacheControl?.staleWhileRevalidate,
63
63
  i
64
64
  ),
65
- scope: Fe(d.cacheControl?.scope, a)
66
- }, o?.(s, c, d, p));
65
+ scope: Fe(u.cacheControl?.scope, a)
66
+ }, o?.(s, c, u, g));
67
67
  }
68
68
  return e;
69
69
  }
@@ -80,20 +80,20 @@ const ke = () => function(e = {}) {
80
80
  resolvers: e
81
81
  })
82
82
  );
83
- }, cn = "@faststore/api", ln = "4.3.0-dev.0", wn = {
83
+ }, cn = "@faststore/api", ln = "4.3.0-dev.2", Dn = {
84
84
  name: cn,
85
85
  version: ln
86
- }, Be = (n, e) => (t, r, i, a) => {
86
+ }, Me = (n, e) => (t, r, i, a) => {
87
87
  if ((i?.OTEL?.enabled ?? !1) === !1)
88
88
  return n(t, r, i, a);
89
- const o = L.trace.getTracer(cn, ln), s = L.propagation.extract(
90
- L.context.active(),
89
+ const o = M.trace.getTracer(cn, ln), s = M.propagation.extract(
90
+ M.context.active(),
91
91
  i.OTEL
92
92
  );
93
- return L.context.with(s, () => {
93
+ return M.context.with(s, () => {
94
94
  const c = o.startSpan(e ?? "Unknown Graphql Resolver", {
95
95
  startTime: Date.now(),
96
- kind: L.SpanKind.INTERNAL,
96
+ kind: M.SpanKind.INTERNAL,
97
97
  attributes: {
98
98
  timestamp: Date.now(),
99
99
  "@faststore_version": ln,
@@ -104,10 +104,10 @@ const ke = () => function(e = {}) {
104
104
  });
105
105
  if (!c) return n(t, r, i, a);
106
106
  try {
107
- const d = n(t, r, i, a);
108
- return d instanceof Promise ? d.then((p) => (c.end(), p)) : (c.end(), d);
109
- } catch (d) {
110
- throw c.end(), console.error(`Error when executing resolver: ${e}`, d), d;
107
+ const u = n(t, r, i, a);
108
+ return u instanceof Promise ? u.then((g) => (c.end(), g)) : (c.end(), u);
109
+ } catch (u) {
110
+ throw c.end(), console.error(`Error when executing resolver: ${e}`, u), u;
111
111
  }
112
112
  });
113
113
  };
@@ -116,7 +116,7 @@ class X extends Error {
116
116
  super(t), this.extensions = e, this.name = "FastStoreError";
117
117
  }
118
118
  }
119
- class V extends X {
119
+ class k extends X {
120
120
  constructor(e) {
121
121
  super({ status: 400, type: "BadRequestError" }, e);
122
122
  }
@@ -131,12 +131,12 @@ class an extends X {
131
131
  super({ status: 403, type: "ForbiddenError" }, e);
132
132
  }
133
133
  }
134
- class $ extends X {
134
+ class z extends X {
135
135
  constructor(e) {
136
136
  super({ status: 404, type: "NotFoundError" }, e);
137
137
  }
138
138
  }
139
- const Ui = (n) => n?.name === "FastStoreError", ki = (n) => n?.extensions?.type === "BadRequestError", _i = (n) => n?.extensions?.type === "UnauthorizedError", Me = (n) => n?.extensions?.type === "ForbiddenError", $e = (n) => n?.extensions?.type === "NotFoundError", ze = `${wn.name}@${wn.version}`, I = async (n, e, t) => {
139
+ const Ni = (n) => n?.name === "FastStoreError", Fi = (n) => n?.extensions?.type === "BadRequestError", Ri = (n) => n?.extensions?.type === "UnauthorizedError", Be = (n) => n?.extensions?.type === "ForbiddenError", $e = (n) => n?.extensions?.type === "NotFoundError", ze = `${Dn.name}@${Dn.version}`, I = async (n, e, t) => {
140
140
  const r = await ve(n, {
141
141
  ...e,
142
142
  headers: {
@@ -151,13 +151,13 @@ const Ui = (n) => n?.name === "FastStoreError", ki = (n) => n?.extensions?.type
151
151
  if (typeof r?.status == "number")
152
152
  switch (r.status) {
153
153
  case 400:
154
- throw new V(i);
154
+ throw new k(i);
155
155
  case 401:
156
156
  throw new J(i);
157
157
  case 403:
158
158
  throw new an(i);
159
159
  case 404:
160
- throw new $(i);
160
+ throw new z(i);
161
161
  default:
162
162
  throw new X(
163
163
  { status: r.status, type: "UnknownError" },
@@ -241,7 +241,7 @@ const H = {
241
241
  "content-type": "application/json"
242
242
  }
243
243
  }, Xe = ({ account: n, environment: e, incrementAddress: t, subDomainPrefix: r }, i) => {
244
- const a = `https://${n}.${e}.com.br`, o = je(i), s = bn(i), c = Ge(i), d = ke(), p = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", m = r && r.map((l) => l + ".").find((l) => p.includes(l)) || "", u = p.replace(m, "");
244
+ const a = `https://${n}.${e}.com.br`, o = je(i), s = bn(i), c = Ge(i), u = _e(), g = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", m = r && r.map((l) => l + ".").find((l) => g.includes(l)) || "", d = g.replace(m, "");
245
245
  return {
246
246
  catalog: {
247
247
  salesChannel: (l) => I(
@@ -271,7 +271,7 @@ const H = {
271
271
  products: {
272
272
  crossselling: ({
273
273
  type: l,
274
- productId: g,
274
+ productId: p,
275
275
  groupByProduct: f = !0
276
276
  }) => {
277
277
  const S = new URLSearchParams({
@@ -279,7 +279,7 @@ const H = {
279
279
  groupByProduct: f.toString()
280
280
  });
281
281
  return I(
282
- `${a}/api/catalog_system/pub/products/crossselling/${l}/${g}?${S}`,
282
+ `${a}/api/catalog_system/pub/products/crossselling/${l}/${p}?${S}`,
283
283
  void 0,
284
284
  { storeCookies: o }
285
285
  );
@@ -287,12 +287,12 @@ const H = {
287
287
  }
288
288
  },
289
289
  checkout: {
290
- simulation: (l, { salesChannel: g } = i.storage.channel) => {
290
+ simulation: (l, { salesChannel: p } = i.storage.channel) => {
291
291
  const f = new URLSearchParams({
292
- sc: g
292
+ sc: p
293
293
  }), S = s({
294
294
  "content-type": "application/json",
295
- "X-FORWARDED-HOST": u
295
+ "X-FORWARDED-HOST": d
296
296
  });
297
297
  return I(
298
298
  `${a}/api/checkout/pub/orderForms/simulation?${f.toString()}`,
@@ -306,49 +306,49 @@ const H = {
306
306
  },
307
307
  shippingData: ({
308
308
  id: l,
309
- index: g,
309
+ index: p,
310
310
  deliveryMode: f,
311
311
  selectedAddresses: S
312
- }, O) => {
313
- const D = O ? {
312
+ }, v) => {
313
+ const w = v ? {
314
314
  startDateUtc: f?.deliveryWindow?.startDate,
315
315
  endDateUtc: f?.deliveryWindow?.endDate
316
- } : null, A = {
317
- logisticsInfo: Array.from({ length: g }, (v, U) => ({
318
- itemIndex: U,
316
+ } : null, P = {
317
+ logisticsInfo: Array.from({ length: p }, (O, E) => ({
318
+ itemIndex: E,
319
319
  selectedDeliveryChannel: f?.deliveryChannel || null,
320
320
  selectedSla: f?.deliveryMethod || null,
321
- deliveryWindow: D
321
+ deliveryWindow: w
322
322
  })),
323
323
  selectedAddresses: S,
324
324
  clearAddressIfPostalCodeNotFound: t
325
325
  }, T = s({
326
326
  "content-type": "application/json",
327
- "X-FORWARDED-HOST": u
327
+ "X-FORWARDED-HOST": d
328
328
  });
329
329
  return I(
330
330
  `${a}/api/checkout/pub/orderForm/${l}/attachments/shippingData`,
331
331
  {
332
332
  ...H,
333
333
  headers: T,
334
- body: JSON.stringify(A)
334
+ body: JSON.stringify(P)
335
335
  },
336
336
  { storeCookies: o }
337
337
  );
338
338
  },
339
339
  marketingData: ({
340
340
  id: l,
341
- marketingData: g
341
+ marketingData: p
342
342
  }) => {
343
343
  const f = s({
344
344
  "content-type": "application/json",
345
- "X-FORWARDED-HOST": u
345
+ "X-FORWARDED-HOST": d
346
346
  });
347
347
  return I(
348
348
  `${a}/api/checkout/pub/orderForm/${l}/attachments/marketingData`,
349
349
  {
350
350
  headers: f,
351
- body: JSON.stringify(g),
351
+ body: JSON.stringify(p),
352
352
  method: "POST"
353
353
  },
354
354
  { storeCookies: o }
@@ -356,17 +356,17 @@ const H = {
356
356
  },
357
357
  clientPreferencesData: ({
358
358
  id: l,
359
- clientPreferencesData: g
359
+ clientPreferencesData: p
360
360
  }) => {
361
361
  const f = s({
362
362
  "content-type": "application/json",
363
- "X-FORWARDED-HOST": u
363
+ "X-FORWARDED-HOST": d
364
364
  });
365
365
  return I(
366
366
  `${a}/api/checkout/pub/orderForm/${l}/attachments/clientPreferencesData`,
367
367
  {
368
368
  headers: f,
369
- body: JSON.stringify(g),
369
+ body: JSON.stringify(p),
370
370
  method: "POST"
371
371
  },
372
372
  { storeCookies: o }
@@ -374,60 +374,60 @@ const H = {
374
374
  },
375
375
  orderForm: ({
376
376
  id: l,
377
- refreshOutdatedData: g = !0,
377
+ refreshOutdatedData: p = !0,
378
378
  channel: f = i.storage.channel
379
379
  }) => {
380
- const { salesChannel: S } = f, O = s({
380
+ const { salesChannel: S } = f, v = s({
381
381
  "content-type": "application/json",
382
- "X-FORWARDED-HOST": u
383
- }), D = new URLSearchParams({ sc: S });
384
- l && D.set("refreshOutdatedData", g.toString());
385
- const A = `${a}/api/checkout/pub/orderForm${l ? `/${l}` : ""}?${D.toString()}`;
382
+ "X-FORWARDED-HOST": d
383
+ }), w = new URLSearchParams({ sc: S });
384
+ l && w.set("refreshOutdatedData", p.toString());
385
+ const P = `${a}/api/checkout/pub/orderForm${l ? `/${l}` : ""}?${w.toString()}`;
386
386
  return I(
387
- A,
387
+ P,
388
388
  {
389
389
  ...H,
390
- headers: O,
390
+ headers: v,
391
391
  ...l ? {} : { body: "{}" }
392
392
  },
393
393
  { storeCookies: o }
394
394
  );
395
395
  },
396
396
  clearOrderFormMessages: ({ id: l }) => {
397
- const g = s({
397
+ const p = s({
398
398
  "content-type": "application/json",
399
- "X-FORWARDED-HOST": u
399
+ "X-FORWARDED-HOST": d
400
400
  });
401
401
  return I(
402
402
  `${a}/api/checkout/pub/orderForm/${l}/messages/clear`,
403
403
  {
404
404
  ...H,
405
- headers: g,
405
+ headers: p,
406
406
  body: "{}"
407
407
  }
408
408
  );
409
409
  },
410
410
  updateOrderFormItems: ({
411
411
  id: l,
412
- orderItems: g,
412
+ orderItems: p,
413
413
  allowOutdatedData: f = "paymentData",
414
414
  salesChannel: S = i.storage.channel.salesChannel,
415
- shouldSplitItem: O = !0
415
+ shouldSplitItem: v = !0
416
416
  }) => {
417
- const D = new URLSearchParams({
417
+ const w = new URLSearchParams({
418
418
  allowOutdatedData: f,
419
419
  sc: S
420
- }), A = s({
420
+ }), P = s({
421
421
  "content-type": "application/json",
422
- "X-FORWARDED-HOST": u
422
+ "X-FORWARDED-HOST": d
423
423
  });
424
424
  return I(
425
- `${a}/api/checkout/pub/orderForm/${l}/items?${D}`,
425
+ `${a}/api/checkout/pub/orderForm/${l}/items?${w}`,
426
426
  {
427
- headers: A,
427
+ headers: P,
428
428
  body: JSON.stringify({
429
- orderItems: g,
430
- noSplitItem: !O
429
+ orderItems: p,
430
+ noSplitItem: !v
431
431
  }),
432
432
  method: "PATCH"
433
433
  },
@@ -436,18 +436,18 @@ const H = {
436
436
  },
437
437
  setCustomData: ({
438
438
  id: l,
439
- appId: g,
439
+ appId: p,
440
440
  key: f,
441
441
  value: S
442
442
  }) => {
443
- const O = s({
443
+ const v = s({
444
444
  "content-type": "application/json",
445
- "X-FORWARDED-HOST": u
445
+ "X-FORWARDED-HOST": d
446
446
  });
447
447
  return I(
448
- `${a}/api/checkout/pub/orderForm/${l}/customData/${g}/${f}`,
448
+ `${a}/api/checkout/pub/orderForm/${l}/customData/${p}/${f}`,
449
449
  {
450
- headers: O,
450
+ headers: v,
451
451
  body: JSON.stringify({ value: S }),
452
452
  method: "PUT"
453
453
  }
@@ -455,40 +455,40 @@ const H = {
455
455
  },
456
456
  region: async ({
457
457
  postalCode: l,
458
- geoCoordinates: g,
458
+ geoCoordinates: p,
459
459
  country: f,
460
460
  salesChannel: S
461
461
  }) => {
462
- const O = new URLSearchParams({
462
+ const v = new URLSearchParams({
463
463
  country: f,
464
464
  sc: S ?? ""
465
465
  });
466
- l ? O.append("postalCode", l) : O.append(
466
+ l ? v.append("postalCode", l) : v.append(
467
467
  "geoCoordinates",
468
- `${g?.longitude};${g?.latitude}`
468
+ `${p?.longitude};${p?.latitude}`
469
469
  );
470
- const D = `${a}/api/checkout/pub/regions/?${O.toString()}`, A = s({
470
+ const w = `${a}/api/checkout/pub/regions/?${v.toString()}`, P = s({
471
471
  "content-type": "application/json",
472
- "X-FORWARDED-HOST": u
472
+ "X-FORWARDED-HOST": d
473
473
  });
474
474
  return I(
475
- D,
475
+ w,
476
476
  {
477
- headers: A
477
+ headers: P
478
478
  },
479
479
  { storeCookies: o }
480
480
  );
481
481
  },
482
482
  address: async ({
483
483
  postalCode: l,
484
- country: g
484
+ country: p
485
485
  }) => {
486
486
  const f = s({
487
487
  "content-type": "application/json",
488
- "X-FORWARDED-HOST": u
488
+ "X-FORWARDED-HOST": d
489
489
  });
490
490
  return I(
491
- `${a}/api/checkout/pub/postal-code/${g}/${l}`,
491
+ `${a}/api/checkout/pub/postal-code/${p}/${l}`,
492
492
  {
493
493
  headers: f
494
494
  },
@@ -497,12 +497,12 @@ const H = {
497
497
  },
498
498
  cancelOrder: ({
499
499
  orderId: l,
500
- customerEmail: g,
500
+ customerEmail: p,
501
501
  reason: f
502
502
  }) => {
503
503
  const S = s({
504
504
  "content-type": "application/json",
505
- "X-FORWARDED-HOST": u
505
+ "X-FORWARDED-HOST": d
506
506
  });
507
507
  return I(
508
508
  `${a}/api/checkout/pub/orders/${l}/user-cancel-request`,
@@ -510,7 +510,7 @@ const H = {
510
510
  method: "POST",
511
511
  headers: S,
512
512
  body: JSON.stringify({
513
- customerEmail: g,
513
+ customerEmail: p,
514
514
  reason: f
515
515
  })
516
516
  },
@@ -524,15 +524,15 @@ const H = {
524
524
  throw new Error(
525
525
  "Missing required parameter for listing pickup points."
526
526
  );
527
- const g = s({
527
+ const p = s({
528
528
  "content-type": "application/json",
529
- "X-FORWARDED-HOST": u
529
+ "X-FORWARDED-HOST": d
530
530
  });
531
531
  return I(
532
532
  `${a}/api/logistics-shipping/pickuppoints/_search`,
533
533
  {
534
534
  method: "POST",
535
- headers: g,
535
+ headers: p,
536
536
  body: JSON.stringify({ coordinate: l })
537
537
  },
538
538
  { storeCookies: o }
@@ -540,8 +540,8 @@ const H = {
540
540
  }
541
541
  },
542
542
  session: (l) => {
543
- const g = new URLSearchParams(l);
544
- g.set(
543
+ const p = new URLSearchParams(l);
544
+ p.set(
545
545
  "items",
546
546
  "profile.id,profile.email,profile.firstName,profile.lastName,profile.phone,shopper.firstName,shopper.lastName,shopper.organizationManager,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol,authentication.customerId,authentication.storeUserId,authentication.storeUserEmail,authentication.unitId,authentication.unitName,checkout.regionId,public.postalCode"
547
547
  );
@@ -549,7 +549,7 @@ const H = {
549
549
  "content-type": "application/json"
550
550
  }), S = tn(i?.headers?.cookie ?? "")?.vtex_session;
551
551
  return I(
552
- `${a}/api/sessions?${g.toString()}`,
552
+ `${a}/api/sessions?${p.toString()}`,
553
553
  {
554
554
  method: S ? "PATCH" : "POST",
555
555
  headers: f,
@@ -569,37 +569,37 @@ const H = {
569
569
  ),
570
570
  profile: {
571
571
  addresses: async (l) => {
572
- const g = c(u, n);
572
+ const p = c(d, n);
573
573
  return I(
574
574
  `${a}/api/profile-system/pvt/profiles/${l}/addresses`,
575
- { headers: g },
575
+ { headers: p },
576
576
  { storeCookies: o }
577
577
  );
578
578
  }
579
579
  },
580
580
  oms: {
581
581
  userOrder: ({ orderId: l }) => {
582
- const g = c(u, n);
582
+ const p = c(d, n);
583
583
  return I(
584
584
  `${a}/api/oms/user/orders/${l}`,
585
585
  {
586
586
  method: "GET",
587
- headers: g
587
+ headers: p
588
588
  },
589
589
  { storeCookies: o }
590
590
  );
591
591
  },
592
592
  listUserOrders: ({
593
593
  page: l,
594
- status: g,
594
+ status: p,
595
595
  dateInitial: f,
596
596
  dateFinal: S,
597
- text: O,
598
- clientEmail: D,
599
- perPage: A,
597
+ text: v,
598
+ clientEmail: w,
599
+ perPage: P,
600
600
  pendingMyApproval: T
601
601
  }) => {
602
- const v = new URLSearchParams();
602
+ const O = new URLSearchParams();
603
603
  if (f) {
604
604
  const h = new Date(f).setHours(
605
605
  0,
@@ -618,19 +618,19 @@ const H = {
618
618
  );
619
619
  S = new Date(h).toISOString();
620
620
  }
621
- O && v.append("text", O), g && g.length > 0 && v.append("status", g.filter(Boolean).join(",")), f && S ? v.append(
621
+ v && O.append("text", v), p && p.length > 0 && O.append("status", p.filter(Boolean).join(",")), f && S ? O.append(
622
622
  "creation_date",
623
623
  `creationDate:[${f} TO ${S}]`
624
- ) : f ? v.append("creation_date", `creationDate:[${f} TO *]`) : S && v.append("creation_date", `creationDate:[* TO ${S}]`), D && v.append("clientEmail", D), l && v.append("page", l.toString()), A && v.append("per_page", A.toString()), T && v.append("my_pending_approvals", String(!0));
625
- const U = s({
624
+ ) : f ? O.append("creation_date", `creationDate:[${f} TO *]`) : S && O.append("creation_date", `creationDate:[* TO ${S}]`), w && O.append("clientEmail", w), l && O.append("page", l.toString()), P && O.append("per_page", P.toString()), T && O.append("my_pending_approvals", String(!0));
625
+ const E = s({
626
626
  "content-type": "application/json",
627
- "X-FORWARDED-HOST": u
627
+ "X-FORWARDED-HOST": d
628
628
  });
629
629
  return I(
630
- `${a}/api/oms/user/orders?${v.toString()}`,
630
+ `${a}/api/oms/user/orders?${O.toString()}`,
631
631
  {
632
632
  method: "GET",
633
- headers: U
633
+ headers: E
634
634
  },
635
635
  { storeCookies: o }
636
636
  );
@@ -638,26 +638,26 @@ const H = {
638
638
  getCommercialAuthorizationsByOrderId: ({
639
639
  orderId: l
640
640
  }) => {
641
- const g = c(u, n);
641
+ const p = c(d, n);
642
642
  return I(
643
643
  `${a}/${n}/commercial-authorizations/order/${l}`,
644
644
  {
645
645
  method: "GET",
646
- headers: g
646
+ headers: p
647
647
  },
648
648
  { storeCookies: o }
649
649
  );
650
650
  },
651
651
  processOrderAuthorization: async ({
652
652
  orderAuthorizationId: l,
653
- dimensionId: g,
653
+ dimensionId: p,
654
654
  ruleId: f,
655
655
  approved: S
656
656
  }) => {
657
- const O = c(u, n), T = {
657
+ const v = c(d, n), T = {
658
658
  params: {
659
659
  ruleId: f,
660
- dimensionId: g,
660
+ dimensionId: p,
661
661
  score: S ? 100 : 0
662
662
  }
663
663
  };
@@ -665,7 +665,7 @@ const H = {
665
665
  `${a}/${n}/commercial-authorizations/${l}/callback`,
666
666
  {
667
667
  method: "POST",
668
- headers: O,
668
+ headers: v,
669
669
  body: JSON.stringify(T)
670
670
  },
671
671
  { storeCookies: o }
@@ -676,12 +676,12 @@ const H = {
676
676
  getUnitByUserId: ({
677
677
  userId: l
678
678
  }) => {
679
- const g = c(u, n);
679
+ const p = c(d, n);
680
680
  return I(
681
681
  `${a}/api/units/v1/${l}/unit`,
682
682
  {
683
683
  method: "GET",
684
- headers: g
684
+ headers: p
685
685
  },
686
686
  {}
687
687
  );
@@ -689,12 +689,12 @@ const H = {
689
689
  getOrgUnitById: ({
690
690
  orgUnitId: l
691
691
  }) => {
692
- const g = c(u, n);
692
+ const p = c(d, n);
693
693
  return I(
694
694
  `${a}/api/units/v1/${l}`,
695
695
  {
696
696
  method: "GET",
697
- headers: g
697
+ headers: p
698
698
  },
699
699
  {}
700
700
  );
@@ -702,12 +702,12 @@ const H = {
702
702
  getScopesByOrgUnit: ({
703
703
  orgUnitId: l
704
704
  }) => {
705
- const g = c(u, n);
705
+ const p = c(d, n);
706
706
  return I(
707
707
  `${a}/api/units/v1/${l}/scopes`,
708
708
  {
709
709
  method: "GET",
710
- headers: g
710
+ headers: p
711
711
  },
712
712
  {}
713
713
  );
@@ -717,12 +717,12 @@ const H = {
717
717
  getUserById: ({
718
718
  userId: l
719
719
  }) => {
720
- const g = c(u, n);
720
+ const p = c(d, n);
721
721
  return I(
722
722
  `${a}/api/license-manager/users/${l}`,
723
723
  {
724
724
  method: "GET",
725
- headers: g
725
+ headers: p
726
726
  },
727
727
  {}
728
728
  );
@@ -730,12 +730,12 @@ const H = {
730
730
  getUserByEmail: ({
731
731
  email: l
732
732
  }) => {
733
- const g = c(u, n);
733
+ const p = c(d, n);
734
734
  return I(
735
735
  `${a}/api/license-manager/pvt/users/${l}`,
736
736
  {
737
737
  method: "GET",
738
- headers: g
738
+ headers: p
739
739
  },
740
740
  {}
741
741
  );
@@ -743,12 +743,12 @@ const H = {
743
743
  getUserRoles: ({
744
744
  userId: l
745
745
  }) => {
746
- const g = c(u, n);
746
+ const p = c(d, n);
747
747
  return I(
748
748
  `${a}/api/license-manager/storefront/users/${l}/roles`,
749
749
  {
750
750
  method: "GET",
751
- headers: g
751
+ headers: p
752
752
  },
753
753
  {}
754
754
  );
@@ -759,17 +759,17 @@ const H = {
759
759
  contractId: l
760
760
  }) => {
761
761
  if (!l)
762
- throw new V("Missing contractId to fetch CL fields.");
763
- const g = d({
762
+ throw new k("Missing contractId to fetch CL fields.");
763
+ const p = u({
764
764
  Accept: "application/json",
765
765
  "content-type": "application/json",
766
- "X-FORWARDED-HOST": u
766
+ "X-FORWARDED-HOST": d
767
767
  });
768
768
  return I(
769
769
  `${a}/api/dataentities/CL/documents/${l}?_fields=_all`,
770
770
  {
771
771
  method: "GET",
772
- headers: g
772
+ headers: p
773
773
  },
774
774
  {}
775
775
  );
@@ -778,17 +778,17 @@ const H = {
778
778
  userId: l
779
779
  }) => {
780
780
  if (!l)
781
- throw new V("Missing userId to fetch shopper name.");
782
- const g = d({
781
+ throw new k("Missing userId to fetch shopper name.");
782
+ const p = u({
783
783
  Accept: "application/json",
784
784
  "content-type": "application/json",
785
- "X-FORWARDED-HOST": u
785
+ "X-FORWARDED-HOST": d
786
786
  }), f = l.replace(/-/g, "");
787
787
  return I(
788
788
  `${a}/api/dataentities/shopper/search?_where=(userId=${f} OR userId=${l})&_fields=_all&_schema=v1`,
789
789
  {
790
790
  method: "GET",
791
- headers: g
791
+ headers: p
792
792
  },
793
793
  {}
794
794
  );
@@ -796,7 +796,7 @@ const H = {
796
796
  },
797
797
  vtexid: {
798
798
  validate: () => {
799
- const l = c(u, n);
799
+ const l = c(d, n);
800
800
  return I(
801
801
  `${a}/api/vtexid/credential/validate`,
802
802
  {
@@ -809,6 +809,107 @@ const H = {
809
809
  { storeCookies: o }
810
810
  );
811
811
  }
812
+ },
813
+ orderEntry: {
814
+ uploadFile: ({
815
+ fileBuffer: l,
816
+ fileName: p,
817
+ mimeType: f
818
+ }) => {
819
+ const S = c(d, n), v = `----FastStoreUploadBoundary${Date.now()}`, w = `\r
820
+ `, T = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(f) ? f : "application/octet-stream", O = p.replaceAll(/[\r\n"]/g, "_"), E = [
821
+ `--${v}`,
822
+ `Content-Disposition: form-data; name="file"; filename="${O}"`,
823
+ `Content-Type: ${T}`,
824
+ "",
825
+ ""
826
+ ].join(w), h = `${w}--${v}--${w}`, C = Buffer.from(E), b = Buffer.from(h), D = new Uint8Array(
827
+ C.byteLength + l.byteLength + b.byteLength
828
+ );
829
+ let y = 0;
830
+ return D.set(C, y), y += C.byteLength, D.set(l, y), y += l.byteLength, D.set(b, y), I(
831
+ `${a}/api/order-entry/upload?an=${n}`,
832
+ {
833
+ method: "POST",
834
+ headers: {
835
+ ...S,
836
+ "content-type": `multipart/form-data; boundary=${v}`
837
+ },
838
+ body: D.buffer
839
+ },
840
+ {}
841
+ );
842
+ },
843
+ startOperation: ({
844
+ objectKey: l,
845
+ orderFormId: p,
846
+ sessionToken: f
847
+ }) => {
848
+ const S = c(d, n), v = JSON.stringify({
849
+ objectKey: l,
850
+ orderFormId: p,
851
+ operation: "CreateCart",
852
+ ...f ? { sessionToken: f } : {}
853
+ });
854
+ return I(
855
+ `${a}/api/order-entry/operation?an=${n}`,
856
+ {
857
+ method: "POST",
858
+ headers: {
859
+ ...S,
860
+ "Content-Type": "application/json"
861
+ },
862
+ body: v
863
+ },
864
+ {}
865
+ );
866
+ },
867
+ getOperation: ({
868
+ operationId: l
869
+ }) => {
870
+ const p = c(d, n);
871
+ return I(
872
+ `${a}/api/order-entry/operation/${l}?an=${n}`,
873
+ {
874
+ method: "GET",
875
+ headers: p
876
+ },
877
+ {}
878
+ );
879
+ },
880
+ createOrderForm: () => {
881
+ const l = c(d, n);
882
+ return I(
883
+ `${a}/api/checkout/pub/orderForm?sc=${i.storage.channel.salesChannel}`,
884
+ {
885
+ method: "POST",
886
+ headers: {
887
+ ...l,
888
+ "Content-Type": "application/json",
889
+ "X-FORWARDED-HOST": d
890
+ },
891
+ body: "{}"
892
+ },
893
+ {}
894
+ );
895
+ },
896
+ getOrderFormItems: ({
897
+ orderFormId: l
898
+ }) => {
899
+ const p = c(d, n);
900
+ return I(
901
+ `${a}/api/checkout/pub/orderForm/${l}`,
902
+ {
903
+ method: "GET",
904
+ headers: {
905
+ ...p,
906
+ "Content-Type": "application/json",
907
+ "X-FORWARDED-HOST": d
908
+ }
909
+ },
910
+ {}
911
+ );
912
+ }
812
913
  }
813
914
  };
814
915
  }, dn = "trade-policy", un = "region-id", pn = "fuzzy", gn = "operator", mn = "pickupPoint", Hn = "shipping", Xn = "delivery-options", Yn = "in-stock", Ye = /* @__PURE__ */ new Set([
@@ -828,7 +929,7 @@ const H = {
828
929
  showSponsored: i,
829
930
  subDomainPrefix: a
830
931
  }, o) => {
831
- const s = `https://${n}.${e}.com.br/api/io`, c = bn(o), d = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", p = a && a.map((h) => h + ".").find((h) => d.includes(h)) || "", m = d.replace(p, ""), u = c({
932
+ const s = `https://${n}.${e}.com.br/api/io`, c = bn(o), u = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", g = a && a.map((h) => h + ".").find((h) => u.includes(h)) || "", m = u.replace(g, ""), d = c({
832
933
  "content-type": "application/json",
833
934
  "X-FORWARDED-HOST": m
834
935
  }), l = () => {
@@ -837,59 +938,59 @@ const H = {
837
938
  key: dn,
838
939
  value: h
839
940
  } : null;
840
- }, g = () => {
841
- const { regionId: h, seller: C } = o.storage.channel, k = (C ? Buffer.from(`SW#${C}`).toString("base64") : null) ?? h;
842
- return k ? {
941
+ }, p = () => {
942
+ const { regionId: h, seller: C } = o.storage.channel, D = (C ? Buffer.from(`SW#${C}`).toString("base64") : null) ?? h;
943
+ return D ? {
843
944
  key: un,
844
- value: k
945
+ value: D
845
946
  } : null;
846
947
  }, f = (h) => {
847
948
  const C = h.filter(
848
- ({ key: P }) => !Ye.has(P)
949
+ ({ key: _ }) => !Ye.has(_)
849
950
  ), b = h.find(
850
- ({ key: P, value: E }) => P === Hn && E !== "all-delivery-methods"
851
- ) ?? null, k = h.find(
852
- ({ key: P, value: E }) => P === Xn && E !== "all-delivery-options"
853
- ) ?? null, y = h.find(({ key: P }) => P === dn) ?? l(), w = h.find(({ key: P }) => P === un) ?? g();
854
- return b !== null && C.push(b), k !== null && C.push(k), y !== null && C.push(y), w !== null && C.push(w), C;
951
+ ({ key: _, value: N }) => _ === Hn && N !== "all-delivery-methods"
952
+ ) ?? null, D = h.find(
953
+ ({ key: _, value: N }) => _ === Xn && N !== "all-delivery-options"
954
+ ) ?? null, y = h.find(({ key: _ }) => _ === dn) ?? l(), A = h.find(({ key: _ }) => _ === un) ?? p();
955
+ return b !== null && C.push(b), D !== null && C.push(D), y !== null && C.push(y), A !== null && C.push(A), C;
855
956
  }, S = (h, C) => {
856
- const b = h.find(({ key: w }) => w === pn) ?? null, k = h.find(({ key: w }) => w === gn) ?? null, y = h.find(({ key: w }) => w === mn) ?? null;
857
- b && Je(b) && C.append(pn, b.value), k && Ke(k) && C.append(gn, k.value), y && C.append(mn, y.value);
858
- }, O = ({
957
+ const b = h.find(({ key: A }) => A === pn) ?? null, D = h.find(({ key: A }) => A === gn) ?? null, y = h.find(({ key: A }) => A === mn) ?? null;
958
+ b && Je(b) && C.append(pn, b.value), D && Ke(D) && C.append(gn, D.value), y && C.append(mn, y.value);
959
+ }, v = ({
859
960
  query: h = "",
860
961
  page: C,
861
962
  count: b,
862
- sort: k = "",
963
+ sort: D = "",
863
964
  selectedFacets: y = [],
864
- type: w,
865
- showInvisibleItems: P,
866
- sponsoredCount: E,
867
- hideUnavailableItems: _,
965
+ type: A,
966
+ showInvisibleItems: _,
967
+ sponsoredCount: N,
968
+ hideUnavailableItems: U,
868
969
  allowRedirect: G = !1
869
970
  }) => {
870
- const N = new URLSearchParams({
971
+ const F = new URLSearchParams({
871
972
  page: (C + 1).toString(),
872
973
  count: b !== 0 ? b.toString() : "1",
873
974
  query: h,
874
- sort: k,
975
+ sort: D,
875
976
  locale: o.storage.locale
876
977
  });
877
- if (S(y, N), P && N.append("show-invisible-items", "true"), t !== void 0) {
978
+ if (S(y, F), _ && F.append("show-invisible-items", "true"), t !== void 0) {
878
979
  const x = y.find(
879
980
  ({ key: ge }) => ge === Yn
880
- ), on = x ? x.value : _?.toString() ?? t.toString();
881
- N.append("hideUnavailableItems", on);
981
+ ), on = x ? x.value : U?.toString() ?? t.toString();
982
+ F.append("hideUnavailableItems", on);
882
983
  }
883
- r !== void 0 && N.append("simulationBehavior", r.toString()), i !== void 0 && N.append("showSponsored", i.toString()), E !== void 0 && N.append("sponsoredCount", E.toString()), G !== void 0 && N.append("allowRedirect", G.toString());
884
- const M = f(y).map(({ key: x, value: on }) => `${x}/${on}`).join("/");
984
+ r !== void 0 && F.append("simulationBehavior", r.toString()), i !== void 0 && F.append("showSponsored", i.toString()), N !== void 0 && F.append("sponsoredCount", N.toString()), G !== void 0 && F.append("allowRedirect", G.toString());
985
+ const $ = f(y).map(({ key: x, value: on }) => `${x}/${on}`).join("/");
885
986
  return I(
886
- `${s}/_v/api/intelligent-search/${w}/${M}?${N.toString()}`,
887
- { headers: u }
987
+ `${s}/_v/api/intelligent-search/${A}/${$}?${F.toString()}`,
988
+ { headers: d }
888
989
  );
889
990
  };
890
991
  return {
891
- facets: (h) => O({ ...h, type: "facets" }),
892
- products: (h) => O({ ...h, type: "product_search" }),
992
+ facets: (h) => v({ ...h, type: "facets" }),
993
+ products: (h) => v({ ...h, type: "product_search" }),
893
994
  suggestedTerms: (h) => {
894
995
  const C = new URLSearchParams({
895
996
  query: h.query?.toString() ?? "",
@@ -897,7 +998,7 @@ const H = {
897
998
  });
898
999
  return I(
899
1000
  `${s}/_v/api/intelligent-search/search_suggestions?${C.toString()}`,
900
- { headers: u }
1001
+ { headers: d }
901
1002
  );
902
1003
  },
903
1004
  topSearches: () => {
@@ -906,14 +1007,14 @@ const H = {
906
1007
  });
907
1008
  return I(
908
1009
  `${s}/_v/api/intelligent-search/top_searches?${h.toString()}`,
909
- { headers: u }
1010
+ { headers: d }
910
1011
  );
911
1012
  },
912
1013
  productCount: (h) => {
913
1014
  const C = new URLSearchParams();
914
1015
  return h?.query && C.append("query", h.query.toString()), I(
915
1016
  `${s}/_v/api/intelligent-search/catalog_count?${C.toString()}`,
916
- { headers: u }
1017
+ { headers: d }
917
1018
  );
918
1019
  }
919
1020
  };
@@ -937,7 +1038,7 @@ const H = {
937
1038
  const o = await e.commerce.catalog.portal.pagetype(a);
938
1039
  if (j(o))
939
1040
  return o;
940
- throw new $(
1041
+ throw new z(
941
1042
  `Catalog returned ${o.pageType} for slug: ${a}. This usually happens when there is more than one category with the same name in the same category tree level.`
942
1043
  );
943
1044
  })
@@ -952,23 +1053,23 @@ const H = {
952
1053
  return new rn(t);
953
1054
  }, it = 1, at = (n, e) => {
954
1055
  const t = Wn(it), r = async (a) => {
955
- const o = a.reduce((m, { items: u }) => [...m, u], []), s = [...o.flat()], c = await e.commerce.checkout.simulation({
1056
+ const o = a.reduce((m, { items: d }) => [...m, d], []), s = [...o.flat()], c = await e.commerce.checkout.simulation({
956
1057
  country: a[0].country,
957
1058
  postalCode: a[0].postalCode,
958
1059
  items: s
959
- }), d = c.items.reduce(
960
- (m, u) => {
961
- const l = u.requestIndex;
962
- return typeof l == "number" && l < m.length && (m[l] = u), m;
1060
+ }), u = c.items.reduce(
1061
+ (m, d) => {
1062
+ const l = d.requestIndex;
1063
+ return typeof l == "number" && l < m.length && (m[l] = d), m;
963
1064
  },
964
1065
  Array(s.length).fill(null)
965
- ), p = o.reduce(
966
- (m, u) => [...m, u.length + m[m.length - 1]],
1066
+ ), g = o.reduce(
1067
+ (m, d) => [...m, d.length + m[m.length - 1]],
967
1068
  [0]
968
1069
  );
969
- return o.map((m, u) => ({
1070
+ return o.map((m, d) => ({
970
1071
  ...c,
971
- items: d.slice(p[u], p[u + 1]).filter((l) => !!l)
1072
+ items: u.slice(g[d], g[d + 1]).filter((l) => !!l)
972
1073
  }));
973
1074
  }, i = async (a) => t(r, a);
974
1075
  return new rn(i, {
@@ -986,8 +1087,8 @@ const B = (n, e) => ({
986
1087
  isVariantOf: st(e)
987
1088
  }), ct = ({ flags: n }, e) => {
988
1089
  const t = async (r) => {
989
- const i = r.map((p) => p.split("-")[0]), a = r.some(
990
- (p) => p.split("-")[1] === "invisibleItems"
1090
+ const i = r.map((g) => g.split("-")[0]), a = r.some(
1091
+ (g) => g.split("-")[1] === "invisibleItems"
991
1092
  ), { products: o } = await e.search.products({
992
1093
  query: `sku:${i.join(";")}`,
993
1094
  page: 0,
@@ -997,16 +1098,16 @@ const B = (n, e) => ({
997
1098
  hideUnavailableItems: !1
998
1099
  }
999
1100
  }), s = o.reduce(
1000
- (p, m) => {
1001
- for (const u of m.items)
1002
- p[u.itemId] = B(u, m);
1003
- return p;
1101
+ (g, m) => {
1102
+ for (const d of m.items)
1103
+ g[d.itemId] = B(d, m);
1104
+ return g;
1004
1105
  },
1005
1106
  {}
1006
- ), c = i.map((p) => s[p]), d = i.filter((p) => !s[p]);
1007
- if (d.length > 0)
1008
- throw new $(
1009
- `Search API did not found the following skus: ${d.join(",")}`
1107
+ ), c = i.map((g) => s[g]), u = i.filter((g) => !s[g]);
1108
+ if (u.length > 0)
1109
+ throw new z(
1110
+ `Search API did not found the following skus: ${u.join(",")}`
1010
1111
  );
1011
1112
  return c;
1012
1113
  };
@@ -1022,14 +1123,14 @@ const B = (n, e) => ({
1022
1123
  collectionLoader: i,
1023
1124
  salesChannelLoader: a
1024
1125
  };
1025
- }, z = (n) => n.AvailableQuantity > 0, W = (n) => n.spotPrice ?? 0, dt = (n) => n.Price ?? 0, An = (n) => n ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", Jn = (n, e) => z(n) && !z(e) ? -1 : !z(n) && z(e) ? 1 : W(n) - W(e), ut = (n) => n === "available", q = (n, e = 0, t = 1) => {
1126
+ }, V = (n) => n.AvailableQuantity > 0, W = (n) => n.spotPrice ?? 0, dt = (n) => n.Price ?? 0, An = (n) => n ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", Jn = (n, e) => V(n) && !V(e) ? -1 : !V(n) && V(e) ? 1 : W(n) - W(e), ut = (n) => n === "available", q = (n, e = 0, t = 1) => {
1026
1127
  const r = e / t;
1027
1128
  return Math.round((n + r) * 100) / 100;
1028
1129
  }, pt = (n, e = { includeTaxes: !1 }) => {
1029
- const t = n.filter(z), r = t[t.length - 1], i = r ? W(r) : 0;
1130
+ const t = n.filter(V), r = t[t.length - 1], i = r ? W(r) : 0;
1030
1131
  return e.includeTaxes ? q(i, r?.Tax, r?.product?.unitMultiplier) : i;
1031
1132
  }, Pn = (n, e = { includeTaxes: !1 }) => {
1032
- const [t] = n.filter(z), r = t ? W(t) : 0;
1133
+ const [t] = n.filter(V), r = t ? W(t) : 0;
1033
1134
  return e.includeTaxes ? q(r, t?.Tax, t?.product?.unitMultiplier) : r;
1034
1135
  }, gt = {
1035
1136
  highPrice: (n) => pt(n),
@@ -1047,10 +1148,10 @@ const B = (n, e) => ({
1047
1148
  }, mt = {
1048
1149
  ratingValue: () => 5,
1049
1150
  reviewCount: () => 0
1050
- }, Un = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", ht = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", ft = (n) => {
1151
+ }, En = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", ht = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", ft = (n) => {
1051
1152
  let e = n.slice(0);
1052
- for (let t = 0; t < Un.length; t++)
1053
- e = e.replace(new RegExp(Un.charAt(t), "g"), ht.charAt(t));
1153
+ for (let t = 0; t < En.length; t++)
1154
+ e = e.replace(new RegExp(En.charAt(t), "g"), ht.charAt(t));
1054
1155
  return e;
1055
1156
  }, St = (n) => n.replace(/[·/_,:]/, "-");
1056
1157
  function Kn(n) {
@@ -1085,20 +1186,20 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1085
1186
  const {
1086
1187
  loaders: { collectionLoader: r }
1087
1188
  } = t, a = sn(n).split("/").filter((c) => !!c), o = a.map(
1088
- (c, d) => a.slice(0, d + 1).join("/")
1189
+ (c, u) => a.slice(0, u + 1).join("/")
1089
1190
  ), s = await Promise.all(
1090
1191
  o.map(async (c) => {
1091
- const d = await r.load(c);
1092
- return { slug: c, ...d };
1192
+ const u = await r.load(c);
1193
+ return { slug: c, ...u };
1093
1194
  })
1094
1195
  );
1095
1196
  return {
1096
- itemListElement: s.map((c, d) => ({
1197
+ itemListElement: s.map((c, u) => ({
1097
1198
  item: hn(c) ? `/${c.slug}` : new URL(
1098
1199
  `https://${c.url}`
1099
1200
  ).pathname.toLowerCase(),
1100
1201
  name: c.name,
1101
- position: d + 1
1202
+ position: u + 1
1102
1203
  })),
1103
1204
  numberOfItems: s.length
1104
1205
  };
@@ -1110,7 +1211,7 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1110
1211
  viewAndBought: "whosawalsobought",
1111
1212
  accessories: "accessories",
1112
1213
  suggestions: "suggestions"
1113
- }, kn = ({ key: n, value: e }) => {
1214
+ }, _n = ({ key: n, value: e }) => {
1114
1215
  switch (n) {
1115
1216
  case "price":
1116
1217
  return { key: n, value: e.replace("-to-", ":") };
@@ -1126,7 +1227,7 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1126
1227
  default:
1127
1228
  return { key: n, value: e };
1128
1229
  }
1129
- }, _n = (n) => {
1230
+ }, Tn = (n) => {
1130
1231
  const e = n.split(":").map(Number);
1131
1232
  return e.length !== 2 || Number.isNaN(e[0]) || Number.isNaN(e[1]) ? null : e;
1132
1233
  }, yt = (n) => typeof Zn[n] == "string", It = (n) => {
@@ -1134,11 +1235,11 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1134
1235
  (t) => yt(t.key)
1135
1236
  );
1136
1237
  if (Array.isArray(e) && e.length > 1)
1137
- throw new V(
1238
+ throw new k(
1138
1239
  `You passed ${e.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${e.map((t) => t.key).join(",")}`
1139
1240
  );
1140
1241
  return e?.[0] ?? null;
1141
- }, vt = (n) => n?.find((e) => e.key === "slug")?.value ?? null, Ot = (n) => n?.find((e) => e.key === "id")?.value ?? null, Tn = (n) => n?.find((e) => e.key === "locale")?.value ?? null, En = (n) => n?.find((e) => e.key === "channel")?.value ?? null, fn = (n, e) => {
1242
+ }, vt = (n) => n?.find((e) => e.key === "slug")?.value ?? null, Ot = (n) => n?.find((e) => e.key === "id")?.value ?? null, Un = (n) => n?.find((e) => e.key === "locale")?.value ?? null, kn = (n) => n?.find((e) => e.key === "channel")?.value ?? null, fn = (n, e) => {
1142
1243
  let t = 0;
1143
1244
  for (let r = 1; r < n.length; r++)
1144
1245
  e(n[t], n[r]) > 0 && (t = r);
@@ -1149,11 +1250,11 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1149
1250
  key: ({ key: n }) => n,
1150
1251
  label: ({ name: n }) => n,
1151
1252
  values: ({ values: n }) => n.sort((e, t) => e.name.localeCompare(t.name))
1152
- }, Dt = {
1253
+ }, wt = {
1153
1254
  key: ({ key: n }) => n,
1154
1255
  label: ({ name: n }) => n,
1155
1256
  min: ({ values: n, key: e }, t, { storage: { searchArgs: r } }) => {
1156
- const i = _n(
1257
+ const i = Tn(
1157
1258
  r?.selectedFacets?.find((s) => s.key === e)?.value ?? ""
1158
1259
  ), o = fn(n, (s, c) => s.range.from - c.range.from)?.range?.from ?? 0;
1159
1260
  return {
@@ -1162,7 +1263,7 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1162
1263
  };
1163
1264
  },
1164
1265
  max: ({ values: n, key: e }, t, { storage: { searchArgs: r } }) => {
1165
- const i = _n(
1266
+ const i = Tn(
1166
1267
  r?.selectedFacets?.find((s) => s.key === e)?.value ?? ""
1167
1268
  ), o = fn(n, (s, c) => c.range.to - s.range.to)?.range?.to ?? 0;
1168
1269
  return {
@@ -1170,14 +1271,14 @@ const K = (n) => n.type === "brand" || j(n) && n.pageType.toLowerCase() === "bra
1170
1271
  absolute: o
1171
1272
  };
1172
1273
  }
1173
- }, wt = {
1274
+ }, Dt = {
1174
1275
  value: ({ value: n }) => n,
1175
1276
  label: ({ name: n }) => n || "unknown",
1176
1277
  selected: ({ selected: n }) => n,
1177
1278
  quantity: ({ quantity: n }) => n
1178
1279
  }, At = async (n, { data: e }, { clients: { commerce: t } }) => {
1179
1280
  if (!e?.orderId)
1180
- throw new V("Missing orderId");
1281
+ throw new k("Missing orderId");
1181
1282
  return { data: (await t.checkout.cancelOrder(e))?.data };
1182
1283
  };
1183
1284
  function ne(n) {
@@ -1203,13 +1304,41 @@ function Pt(n) {
1203
1304
  const e = n.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
1204
1305
  return e.length === 0 ? !1 : e.every((t) => !t.isUserNextAuthorizer);
1205
1306
  }
1206
- const Ut = async (n, { data: e }, { clients: { commerce: t } }) => {
1307
+ const Et = async (n, { data: e }, { clients: { commerce: t } }) => {
1207
1308
  const r = await t.oms.processOrderAuthorization(e), i = ne(r);
1208
1309
  return {
1209
1310
  isPendingForOtherAuthorizer: !i && Pt(r),
1210
1311
  ruleForAuthorization: i
1211
1312
  };
1212
- }, kt = async (n, { data: e }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(e))?.Id });
1313
+ }, _t = async (n, { data: e }, { clients: { commerce: t } }) => {
1314
+ if (!e?.objectKey)
1315
+ throw new k("Missing objectKey");
1316
+ const r = e.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
1317
+ return t.orderEntry.startOperation({
1318
+ objectKey: e.objectKey,
1319
+ orderFormId: r,
1320
+ sessionToken: e.sessionToken ?? void 0
1321
+ });
1322
+ }, Tt = async (n, { data: e }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(e))?.Id }), Ut = async (n, { data: e }, { clients: { commerce: t } }) => {
1323
+ const { fileContent: r, fileName: i, mimeType: a } = e;
1324
+ if (!r || !i || !a)
1325
+ throw new k(
1326
+ "Missing required fields: fileContent, fileName, mimeType"
1327
+ );
1328
+ const o = r.replaceAll(/\s/g, ""), s = 5 * 1024 * 1024;
1329
+ if (Math.floor(o.length * 3 / 4) > s)
1330
+ throw new k("File exceeds maximum allowed size of 5MB");
1331
+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
1332
+ o
1333
+ ))
1334
+ throw new k("Invalid Base64 fileContent");
1335
+ const g = Buffer.from(o, "base64");
1336
+ return await t.orderEntry.uploadFile({
1337
+ fileBuffer: g,
1338
+ fileName: i,
1339
+ mimeType: a
1340
+ });
1341
+ };
1213
1342
  class nn {
1214
1343
  static parse(e) {
1215
1344
  try {
@@ -1244,7 +1373,7 @@ function te(n) {
1244
1373
  valueReference: Y.attachment
1245
1374
  };
1246
1375
  }
1247
- function _t(n) {
1376
+ function kt(n) {
1248
1377
  return {
1249
1378
  propertyID: n.id,
1250
1379
  name: n.name,
@@ -1260,7 +1389,7 @@ function re(n) {
1260
1389
  `${n.name}:${JSON.stringify(n.value)}:${n.valueReference}`
1261
1390
  );
1262
1391
  }
1263
- const Tt = (n) => {
1392
+ const Nt = (n) => {
1264
1393
  const e = n.postalCode, t = n.geoCoordinates, r = {
1265
1394
  addressType: n.addressType || null,
1266
1395
  postalCode: e || null,
@@ -1279,7 +1408,7 @@ const Tt = (n) => {
1279
1408
  r.geoCoordinates = i !== null && a !== null ? [a, i] : [];
1280
1409
  }
1281
1410
  return [r];
1282
- }, Et = (n, e, t) => {
1411
+ }, Ft = (n, e, t) => {
1283
1412
  const r = e.postalCode, i = e.geoCoordinates, a = n?.shippingData?.availableAddresses ?? [], o = n?.shippingData?.selectedAddresses ?? [];
1284
1413
  if (!t && o.length > 0)
1285
1414
  return [o[0]];
@@ -1294,22 +1423,22 @@ const Tt = (n) => {
1294
1423
  }
1295
1424
  return null;
1296
1425
  }, ie = (n, e) => {
1297
- if (!Nt(e))
1426
+ if (!Rt(e))
1298
1427
  return { updateShipping: !1, addressChanged: !1 };
1299
- if (!Bt(n))
1428
+ if (!$t(n))
1300
1429
  return { updateShipping: !1, addressChanged: !1 };
1301
1430
  const [t] = n?.shippingData?.selectedAddresses ?? [];
1302
- if (Ft(t, e.postalCode) || Rt(t, e.geoCoordinates) || Lt(t, e.addressType))
1431
+ if (Lt(t, e.postalCode) || Mt(t, e.geoCoordinates) || Bt(t, e.addressType))
1303
1432
  return { updateShipping: !0, addressChanged: !0 };
1304
1433
  const { logisticsInfo: r } = n.shippingData;
1305
- return Mt(r, e) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
1306
- }, Nt = (n) => !!n.postalCode || n.geoCoordinates?.latitude && n.geoCoordinates?.longitude, Ft = (n, e) => typeof e == "string" && n?.postalCode !== e, Rt = (n, e) => typeof e?.latitude == "number" && typeof e?.longitude == "number" && (n?.geoCoordinates[0] !== e?.longitude || n?.geoCoordinates[1] !== e?.latitude), Lt = (n, e) => typeof e == "string" && n?.addressType !== e, Bt = (n) => n.items.length !== 0, Mt = (n, e) => {
1434
+ return zt(r, e) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
1435
+ }, Rt = (n) => !!n.postalCode || n.geoCoordinates?.latitude && n.geoCoordinates?.longitude, Lt = (n, e) => typeof e == "string" && n?.postalCode !== e, Mt = (n, e) => typeof e?.latitude == "number" && typeof e?.longitude == "number" && (n?.geoCoordinates[0] !== e?.longitude || n?.geoCoordinates[1] !== e?.latitude), Bt = (n, e) => typeof e == "string" && n?.addressType !== e, $t = (n) => n.items.length !== 0, zt = (n, e) => {
1307
1436
  const t = e?.deliveryMode?.deliveryChannel, r = e?.deliveryMode?.deliveryMethod, { startDate: i, endDate: a } = e?.deliveryMode?.deliveryWindow || {};
1308
1437
  return n.some(
1309
1438
  ({ selectedDeliveryChannel: o, selectedSla: s, slas: c }) => {
1310
- const d = t && o !== t, p = r && s !== r;
1311
- return c?.some((m) => d && m.deliveryChannel === t || p && m.id === r ? !0 : i && a && m.deliveryChannel === t && m.id === r && (!m?.deliveryWindow || m?.deliveryWindow?.startDateUtc !== i || m?.deliveryWindow?.endDateUtc !== a) && m.availableDeliveryWindows?.some(
1312
- (u) => u?.startDateUtc === i && u?.endDateUtc === a
1439
+ const u = t && o !== t, g = r && s !== r;
1440
+ return c?.some((m) => u && m.deliveryChannel === t || g && m.id === r ? !0 : i && a && m.deliveryChannel === t && m.id === r && (!m?.deliveryWindow || m?.deliveryWindow?.startDateUtc !== i || m?.deliveryWindow?.endDateUtc !== a) && m.availableDeliveryWindows?.some(
1441
+ (d) => d?.startDateUtc === i && d?.endDateUtc === a
1313
1442
  ));
1314
1443
  }
1315
1444
  );
@@ -1330,7 +1459,7 @@ const Tt = (n) => {
1330
1459
  additionalProperty: n.attachments.map(te)
1331
1460
  },
1332
1461
  index: e
1333
- }), $t = (n) => ({
1462
+ }), Vt = (n) => ({
1334
1463
  quantity: n.quantity,
1335
1464
  seller: n.seller.identifier,
1336
1465
  id: n.itemOffered.sku,
@@ -1342,7 +1471,7 @@ const Tt = (n) => {
1342
1471
  }), Nn = (n) => n.reduce((e, t) => {
1343
1472
  const r = In(t);
1344
1473
  return e.has(r) || e.set(r, []), e.get(r)?.push(t), e;
1345
- }, /* @__PURE__ */ new Map()), zt = (n, e) => {
1474
+ }, /* @__PURE__ */ new Map()), xt = (n, e) => {
1346
1475
  const t = (s, c) => ({
1347
1476
  ...s,
1348
1477
  itemOffered: {
@@ -1424,14 +1553,14 @@ const Fn = (n) => {
1424
1553
  More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api`
1425
1554
  ), r;
1426
1555
  }
1427
- }, Vt = (n, e) => {
1556
+ }, qt = (n, e) => {
1428
1557
  const r = n.customData?.customApps.find(
1429
1558
  (a) => a.id === "faststore"
1430
1559
  )?.fields?.cartEtag;
1431
1560
  return r == null ? !0 : ce(n, e) !== r;
1432
- }, xt = async (n, { clients: { commerce: e } }) => e.checkout.clearOrderFormMessages({
1561
+ }, jt = async (n, { clients: { commerce: e } }) => e.checkout.clearOrderFormMessages({
1433
1562
  id: n
1434
- }), Bn = async (n, e, { clients: { commerce: t } }) => {
1563
+ }), Mn = async (n, e, { clients: { commerce: t } }) => {
1435
1564
  if (!e)
1436
1565
  return n;
1437
1566
  const { updateShipping: r, addressChanged: i } = ie(
@@ -1439,7 +1568,7 @@ const Fn = (n) => {
1439
1568
  e
1440
1569
  );
1441
1570
  if (r) {
1442
- const a = Et(n, e, i), s = a || Tt(e);
1571
+ const a = Ft(n, e, i), s = a || Nt(e);
1443
1572
  return !!e.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
1444
1573
  {
1445
1574
  id: n.orderFormId,
@@ -1459,13 +1588,13 @@ const Fn = (n) => {
1459
1588
  );
1460
1589
  }
1461
1590
  return n;
1462
- }, qt = (n, e) => {
1591
+ }, Wt = (n, e) => {
1463
1592
  if (!n)
1464
1593
  return "";
1465
1594
  const r = tn(n)[e];
1466
1595
  return r ? r.split("=")[1] : "";
1467
- }, jt = async (n, { cart: { order: e }, session: t }, r) => {
1468
- const i = qt(
1596
+ }, Gt = async (n, { cart: { order: e }, session: t }, r) => {
1597
+ const i = Wt(
1469
1598
  r.headers.cookie,
1470
1599
  "checkout.vtex.com"
1471
1600
  ), {
@@ -1473,64 +1602,64 @@ const Fn = (n) => {
1473
1602
  loaders: { skuLoader: o }
1474
1603
  } = r, s = t?.channel, c = t?.locale;
1475
1604
  s && Sn(r, s), c && yn(r, c);
1476
- const d = await a.checkout.orderForm({
1605
+ const u = await a.checkout.orderForm({
1477
1606
  id: i || void 0,
1478
1607
  channel: r.storage.channel
1479
- }), p = d.orderFormId;
1480
- d.messages.length !== 0 && await xt(p, r);
1481
- const m = tn(r?.headers?.cookie ?? "")?.vtex_session, u = Z(m), { acceptedOffer: l, shouldSplitItem: g } = e;
1482
- if (Vt(d, u)) {
1608
+ }), g = u.orderFormId;
1609
+ u.messages.length !== 0 && await jt(g, r);
1610
+ const m = tn(r?.headers?.cookie ?? "")?.vtex_session, d = Z(m), { acceptedOffer: l, shouldSplitItem: p } = e;
1611
+ if (qt(u, d)) {
1483
1612
  const y = await Ln(
1484
- d,
1613
+ u,
1485
1614
  a,
1486
- u
1615
+ d
1487
1616
  ).then(Fn);
1488
- if (p)
1489
- return Rn(y, o, g);
1617
+ if (g)
1618
+ return Rn(y, o, p);
1490
1619
  }
1491
- const S = Nn(l), O = Nn(d.items.map(en)), D = Array.from(O.entries()), A = Array.from(S.entries()), { itemsToAdd: T, itemsToUpdate: v } = A.reduce(
1492
- (y, [w, P]) => {
1493
- const E = O.get(w);
1494
- if (!E)
1495
- return P.forEach((M) => y.itemsToAdd.push(M)), y;
1496
- const [_, ...G] = E;
1497
- if (se(d.items, _.itemOffered.sku) || oe(d.items, _.itemOffered.sku))
1498
- return y.itemsToUpdate.push(_), y;
1499
- const N = P.reduce((M, x) => M + x.quantity, 0);
1620
+ const S = Nn(l), v = Nn(u.items.map(en)), w = Array.from(v.entries()), P = Array.from(S.entries()), { itemsToAdd: T, itemsToUpdate: O } = P.reduce(
1621
+ (y, [A, _]) => {
1622
+ const N = v.get(A);
1623
+ if (!N)
1624
+ return _.forEach(($) => y.itemsToAdd.push($)), y;
1625
+ const [U, ...G] = N;
1626
+ if (se(u.items, U.itemOffered.sku) || oe(u.items, U.itemOffered.sku))
1627
+ return y.itemsToUpdate.push(U), y;
1628
+ const F = _.reduce(($, x) => $ + x.quantity, 0);
1500
1629
  return y.itemsToUpdate.push({
1501
- ..._,
1502
- quantity: N
1503
- }), G.forEach((M) => y.itemsToUpdate.push({ ...M, quantity: 0 })), y;
1630
+ ...U,
1631
+ quantity: F
1632
+ }), G.forEach(($) => y.itemsToUpdate.push({ ...$, quantity: 0 })), y;
1504
1633
  },
1505
1634
  {
1506
1635
  itemsToAdd: [],
1507
1636
  itemsToUpdate: []
1508
1637
  }
1509
- ), U = D.filter(([y]) => !S.has(y)).flatMap(([, y]) => y.map((w) => ({ ...w, quantity: 0 }))), h = [...T, ...v, ...U].map(
1510
- $t
1511
- ), { updateShipping: C } = t ? ie(d, t) : { updateShipping: !1 };
1638
+ ), E = w.filter(([y]) => !S.has(y)).flatMap(([, y]) => y.map((A) => ({ ...A, quantity: 0 }))), h = [...T, ...O, ...E].map(
1639
+ Vt
1640
+ ), { updateShipping: C } = t ? ie(u, t) : { updateShipping: !1 };
1512
1641
  if (h.length === 0 && !C)
1513
1642
  return null;
1514
1643
  let b;
1515
1644
  h.length > 0 ? b = await a.checkout.updateOrderFormItems({
1516
- id: d.orderFormId,
1645
+ id: u.orderFormId,
1517
1646
  orderItems: h,
1518
- shouldSplitItem: g
1647
+ shouldSplitItem: p
1519
1648
  }).then(
1520
- (y) => Bn(y, t, r)
1521
- ) : b = await Bn(
1522
- d,
1649
+ (y) => Mn(y, t, r)
1650
+ ) : b = await Mn(
1651
+ u,
1523
1652
  t,
1524
1653
  r
1525
1654
  ), b = await Promise.resolve(b).then((y) => {
1526
1655
  if (t?.marketingData) {
1527
- const w = {
1656
+ const A = {
1528
1657
  ...y.marketingData,
1529
1658
  ...t.marketingData
1530
1659
  };
1531
1660
  return a.checkout.marketingData({
1532
- id: d.orderFormId,
1533
- marketingData: w
1661
+ id: u.orderFormId,
1662
+ marketingData: A
1534
1663
  });
1535
1664
  }
1536
1665
  return y;
@@ -1540,14 +1669,14 @@ const Fn = (n) => {
1540
1669
  ...y.clientPreferencesData,
1541
1670
  locale: c
1542
1671
  }
1543
- }) : y).then((y) => Ln(y, a, u)).then(Fn);
1544
- const k = Cn(
1545
- d.messages,
1672
+ }) : y).then((y) => Ln(y, a, d)).then(Fn);
1673
+ const D = Cn(
1674
+ u.messages,
1546
1675
  b.messages
1547
1676
  );
1548
- return zt(e, b) && k ? null : Rn(b, o, g);
1677
+ return xt(e, b) && D ? null : Rn(b, o, p);
1549
1678
  };
1550
- async function Wt(n, e, t) {
1679
+ async function Ht(n, e, t) {
1551
1680
  try {
1552
1681
  const r = await n.commerce.checkout.address({
1553
1682
  postalCode: t,
@@ -1564,61 +1693,61 @@ async function Wt(n, e, t) {
1564
1693
  ), r;
1565
1694
  }
1566
1695
  }
1567
- const Gt = async (n, { session: e, search: t }, { clients: r, headers: i, account: a }) => {
1696
+ const Xt = async (n, { session: e, search: t }, { clients: r, headers: i, account: a }) => {
1568
1697
  const o = nn.parse(e.channel ?? ""), s = String(e.postalCode ?? ""), c = e.country ?? "";
1569
- let d = e.city ?? null, p = e.geoCoordinates ?? null;
1570
- if ((!d || !p) && s !== "" && c !== "") {
1571
- const _ = await Wt(
1698
+ let u = e.city ?? null, g = e.geoCoordinates ?? null;
1699
+ if ((!u || !g) && s !== "" && c !== "") {
1700
+ const U = await Ht(
1572
1701
  r,
1573
1702
  c,
1574
1703
  s
1575
1704
  );
1576
- d = _.city, p = _.geoCoordinates;
1705
+ u = U.city, g = U.geoCoordinates;
1577
1706
  }
1578
- const u = new URLSearchParams(t);
1579
- u.has("facets") && u.delete("facets");
1580
- const l = u.get("sc") ?? o.salesChannel;
1581
- u.set("sc", l), s && u.set("postalCode", s), c && u.set("country", c), p && u.set(
1707
+ const d = new URLSearchParams(t);
1708
+ d.has("facets") && d.delete("facets");
1709
+ const l = d.get("sc") ?? o.salesChannel;
1710
+ d.set("sc", l), s && d.set("postalCode", s), c && d.set("country", c), g && d.set(
1582
1711
  "geoCoordinates",
1583
- `${p.longitude},${p.latitude}`
1712
+ `${g.longitude},${g.latitude}`
1584
1713
  // long,lat is the format expected
1585
- ), u.set("locale", e.locale);
1586
- const { marketingData: g } = e, f = {
1587
- utmCampaign: u.get("utm_campaign") ?? g?.utmCampaign ?? "",
1588
- utmMedium: u.get("utm_medium") ?? g?.utmMedium ?? "",
1589
- utmSource: u.get("utm_source") ?? g?.utmSource ?? "",
1590
- utmiCampaign: u.get("utmi_cp") ?? g?.utmiCampaign ?? "",
1591
- utmiPage: u.get("utmi_p") ?? g?.utmiPage ?? "",
1592
- utmiPart: u.get("utmi_pc") ?? g?.utmiPart ?? ""
1714
+ ), d.set("locale", e.locale);
1715
+ const { marketingData: p } = e, f = {
1716
+ utmCampaign: d.get("utm_campaign") ?? p?.utmCampaign ?? "",
1717
+ utmMedium: d.get("utm_medium") ?? p?.utmMedium ?? "",
1718
+ utmSource: d.get("utm_source") ?? p?.utmSource ?? "",
1719
+ utmiCampaign: d.get("utmi_cp") ?? p?.utmiCampaign ?? "",
1720
+ utmiPage: d.get("utmi_p") ?? p?.utmiPage ?? "",
1721
+ utmiPart: d.get("utmi_pc") ?? p?.utmiPart ?? ""
1593
1722
  }, S = Z(Q(i?.cookie ?? "", a));
1594
- let O = !1;
1723
+ let v = !1;
1595
1724
  if (S)
1596
1725
  try {
1597
- O = (await r.commerce.vtexid.validate())?.authStatus?.toLowerCase() === "success";
1598
- } catch (_) {
1599
- console.warn("JWT validation failed:", _), O = !1;
1726
+ v = (await r.commerce.vtexid.validate())?.authStatus?.toLowerCase() === "success";
1727
+ } catch (U) {
1728
+ console.warn("JWT validation failed:", U), v = !1;
1600
1729
  }
1601
- const D = O ? S?.isRepresentative : !1, A = O ? S?.customerId : void 0, T = O ? S?.unitId : void 0, v = await r.commerce.session(u.toString()).catch(() => null), U = v?.namespaces.profile ?? null, h = v?.namespaces.shopper ?? null, C = v?.namespaces.store ?? null, b = v?.namespaces.authentication ?? null, k = v?.namespaces.checkout ?? null, y = v?.namespaces.public ?? null;
1602
- let w = null;
1603
- if (D && U?.id?.value)
1730
+ const w = v ? S?.isRepresentative : !1, P = v ? S?.customerId : void 0, T = v ? S?.unitId : void 0, O = await r.commerce.session(d.toString()).catch(() => null), E = O?.namespaces.profile ?? null, h = O?.namespaces.shopper ?? null, C = O?.namespaces.store ?? null, b = O?.namespaces.authentication ?? null, D = O?.namespaces.checkout ?? null, y = O?.namespaces.public ?? null;
1731
+ let A = null;
1732
+ if (w && E?.id?.value)
1604
1733
  try {
1605
- w = await r.commerce.masterData.getContractById({
1606
- contractId: U.id.value
1734
+ A = await r.commerce.masterData.getContractById({
1735
+ contractId: E.id.value
1607
1736
  });
1608
1737
  } catch {
1609
1738
  console.error(
1610
- `Error while getting contract data for profile ID (${U.id.value}).
1739
+ `Error while getting contract data for profile ID (${E.id.value}).
1611
1740
  `
1612
1741
  );
1613
1742
  }
1614
- let P;
1615
- o.seller && (s || p) && (P = (await r.commerce.checkout.region({
1743
+ let _;
1744
+ o.seller && (s || g) && (_ = (await r.commerce.checkout.region({
1616
1745
  postalCode: s,
1617
- geoCoordinates: p,
1746
+ geoCoordinates: g,
1618
1747
  country: c,
1619
1748
  salesChannel: l
1620
- }))?.[0]?.sellers.find((N) => o.seller === N.id));
1621
- const E = {
1749
+ }))?.[0]?.sellers.find((F) => o.seller === F.id));
1750
+ const N = {
1622
1751
  ...e,
1623
1752
  currency: {
1624
1753
  code: C?.currencyCode?.value ?? e.currency.code,
@@ -1627,8 +1756,8 @@ const Gt = async (n, { session: e, search: t }, { clients: r, headers: i, accoun
1627
1756
  country: C?.countryCode?.value ?? c,
1628
1757
  channel: nn.stringify({
1629
1758
  salesChannel: C?.channel?.value ?? o.salesChannel,
1630
- regionId: k?.regionId?.value ?? o.regionId,
1631
- seller: P?.id,
1759
+ regionId: D?.regionId?.value ?? o.regionId,
1760
+ seller: _?.id,
1632
1761
  hasOnlyDefaultSalesChannel: !C?.channel?.value
1633
1762
  }),
1634
1763
  /**
@@ -1637,9 +1766,9 @@ const Gt = async (n, { session: e, search: t }, { clients: r, headers: i, accoun
1637
1766
  * - Unit data: `authentication` namespace
1638
1767
  * - Contract data: `profile` namespace (those info will be available inside Faststore's Session `person` object)
1639
1768
  */
1640
- b2b: D ? {
1641
- isRepresentative: D ?? !1,
1642
- customerId: b?.customerId?.value ?? A ?? "",
1769
+ b2b: w ? {
1770
+ isRepresentative: w ?? !1,
1771
+ customerId: b?.customerId?.value ?? P ?? "",
1643
1772
  unitName: b?.unitName?.value ?? "",
1644
1773
  unitId: b?.unitId?.value ?? T ?? "",
1645
1774
  firstName: typeof h?.firstName?.value == "string" ? h.firstName.value : "",
@@ -1647,32 +1776,34 @@ const Gt = async (n, { session: e, search: t }, { clients: r, headers: i, accoun
1647
1776
  userName: `${typeof h?.firstName?.value == "string" ? h.firstName.value : ""} ${typeof h?.lastName?.value == "string" ? h.lastName.value : ""}`.trim(),
1648
1777
  userEmail: b?.storeUserEmail.value ?? "",
1649
1778
  savedPostalCode: y?.postalCode?.value ?? "",
1650
- contractName: w?.corporateName ?? "",
1779
+ contractName: A?.corporateName ?? "",
1651
1780
  organizationManager: h?.organizationManager?.value ?? !1
1652
1781
  } : null,
1653
1782
  marketingData: f,
1654
- person: U?.id ? {
1655
- id: U.id?.value ?? "",
1656
- email: U.email?.value ?? "",
1657
- givenName: U.firstName?.value ?? "",
1658
- familyName: U.lastName?.value ?? ""
1783
+ person: E?.id ? {
1784
+ id: E.id?.value ?? "",
1785
+ email: E.email?.value ?? "",
1786
+ givenName: E.firstName?.value ?? "",
1787
+ familyName: E.lastName?.value ?? ""
1659
1788
  } : null,
1660
- geoCoordinates: p?.latitude && p?.longitude && p || null,
1661
- city: d
1789
+ geoCoordinates: g?.latitude && g?.longitude && g || null,
1790
+ city: u
1662
1791
  };
1663
- return Cn(e, E) ? null : E;
1664
- }, Ht = {
1665
- validateCart: jt,
1666
- validateSession: Gt,
1667
- subscribeToNewsletter: kt,
1792
+ return Cn(e, N) ? null : N;
1793
+ }, Yt = {
1794
+ validateCart: Gt,
1795
+ validateSession: Xt,
1796
+ subscribeToNewsletter: Tt,
1668
1797
  cancelOrder: At,
1669
- processOrderAuthorization: Ut
1798
+ processOrderAuthorization: Et,
1799
+ uploadFileToOrderEntry: Ut,
1800
+ startOrderEntryOperation: _t
1670
1801
  };
1671
1802
  var vn;
1672
1803
  (function(n) {
1673
1804
  n.NAME = "Name", n.DOCUMENT = "Document", n.OPERATION_DEFINITION = "OperationDefinition", n.VARIABLE_DEFINITION = "VariableDefinition", n.SELECTION_SET = "SelectionSet", n.FIELD = "Field", n.ARGUMENT = "Argument", n.FRAGMENT_SPREAD = "FragmentSpread", n.INLINE_FRAGMENT = "InlineFragment", n.FRAGMENT_DEFINITION = "FragmentDefinition", n.VARIABLE = "Variable", n.INT = "IntValue", n.FLOAT = "FloatValue", n.STRING = "StringValue", n.BOOLEAN = "BooleanValue", n.NULL = "NullValue", n.ENUM = "EnumValue", n.LIST = "ListValue", n.OBJECT = "ObjectValue", n.OBJECT_FIELD = "ObjectField", n.DIRECTIVE = "Directive", n.NAMED_TYPE = "NamedType", n.LIST_TYPE = "ListType", n.NON_NULL_TYPE = "NonNullType", n.SCHEMA_DEFINITION = "SchemaDefinition", n.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", n.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", n.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", n.FIELD_DEFINITION = "FieldDefinition", n.INPUT_VALUE_DEFINITION = "InputValueDefinition", n.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", n.UNION_TYPE_DEFINITION = "UnionTypeDefinition", n.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", n.ENUM_VALUE_DEFINITION = "EnumValueDefinition", n.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", n.DIRECTIVE_DEFINITION = "DirectiveDefinition", n.SCHEMA_EXTENSION = "SchemaExtension", n.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", n.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", n.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", n.UNION_TYPE_EXTENSION = "UnionTypeExtension", n.ENUM_TYPE_EXTENSION = "EnumTypeExtension", n.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
1674
1805
  })(vn || (vn = {}));
1675
- const Xt = (n) => typeof n == "string" ? le(n) : null;
1806
+ const Jt = (n) => typeof n == "string" ? le(n) : null;
1676
1807
  function le(n) {
1677
1808
  try {
1678
1809
  return JSON.parse(n);
@@ -1680,15 +1811,15 @@ function le(n) {
1680
1811
  return n;
1681
1812
  }
1682
1813
  }
1683
- const Yt = (n) => typeof n == "object" ? JSON.stringify(n) : typeof n == "string" ? n : null, Jt = new fe({
1814
+ const Kt = (n) => typeof n == "object" ? JSON.stringify(n) : typeof n == "string" ? n : null, Qt = new fe({
1684
1815
  name: "ObjectOrString",
1685
1816
  description: "A string or the string representation of an object (a stringified object).",
1686
- parseValue: Xt,
1687
- serialize: Yt,
1817
+ parseValue: Jt,
1818
+ serialize: Kt,
1688
1819
  parseLiteral(n) {
1689
1820
  return n.kind === vn.STRING ? le(n.value) : null;
1690
1821
  }
1691
- }), R = (n) => "Price" in n && "seller" in n && "product" in n, F = (n) => "skuName" in n, Kt = {
1822
+ }), L = (n) => "Price" in n && "seller" in n && "product" in n, R = (n) => "skuName" in n, Zt = {
1692
1823
  priceCurrency: async (n, e, t) => {
1693
1824
  const {
1694
1825
  loaders: { salesChannelLoader: r },
@@ -1696,34 +1827,34 @@ const Yt = (n) => typeof n == "object" ? JSON.stringify(n) : typeof n == "string
1696
1827
  } = t;
1697
1828
  return (await r.load(i.salesChannel)).CurrencyCode ?? "";
1698
1829
  },
1699
- priceValidUntil: (n) => R(n) ? n.PriceValidUntil ?? "" : F(n) ? n.priceValidUntil ?? "" : null,
1830
+ priceValidUntil: (n) => L(n) ? n.PriceValidUntil ?? "" : R(n) ? n.priceValidUntil ?? "" : null,
1700
1831
  itemCondition: () => "https://schema.org/NewCondition",
1701
- availability: async (n) => R(n) ? An(z(n)) : F(n) ? An(ut(n.availability)) : null,
1702
- seller: (n, e, t) => R(n) ? {
1832
+ availability: async (n) => L(n) ? An(V(n)) : R(n) ? An(ut(n.availability)) : null,
1833
+ seller: (n, e, t) => L(n) ? {
1703
1834
  identifier: t.storage.channel?.seller || n.seller.sellerId || ""
1704
- } : F(n) ? {
1835
+ } : R(n) ? {
1705
1836
  identifier: n.seller
1706
1837
  } : null,
1707
- price: (n) => R(n) ? W(n) : F(n) ? n.sellingPrice / 100 : null,
1708
- priceWithTaxes: (n) => R(n) ? q(W(n), n?.Tax, n.product.unitMultiplier) : F(n) ? q(
1838
+ price: (n) => L(n) ? W(n) : R(n) ? n.sellingPrice / 100 : null,
1839
+ priceWithTaxes: (n) => L(n) ? q(W(n), n?.Tax, n.product.unitMultiplier) : R(n) ? q(
1709
1840
  n.sellingPrice / 100,
1710
1841
  n.tax / 100,
1711
1842
  n.unitMultiplier
1712
1843
  ) : null,
1713
- sellingPrice: (n) => R(n) ? dt(n) : F(n) ? n.sellingPrice / 100 : null,
1714
- listPrice: (n) => R(n) ? n.ListPrice ?? 0 : F(n) ? n.listPrice / 100 : null,
1715
- listPriceWithTaxes: (n) => R(n) ? q(
1844
+ sellingPrice: (n) => L(n) ? dt(n) : R(n) ? n.sellingPrice / 100 : null,
1845
+ listPrice: (n) => L(n) ? n.ListPrice ?? 0 : R(n) ? n.listPrice / 100 : null,
1846
+ listPriceWithTaxes: (n) => L(n) ? q(
1716
1847
  n.ListPrice ?? 0,
1717
1848
  n?.Tax,
1718
1849
  n.product.unitMultiplier
1719
- ) : F(n) ? q(n.listPrice / 100, n.tax / 100, n.unitMultiplier) : null,
1720
- itemOffered: (n) => R(n) ? n.product : F(n) ? {
1850
+ ) : R(n) ? q(n.listPrice / 100, n.tax / 100, n.unitMultiplier) : null,
1851
+ itemOffered: (n) => L(n) ? n.product : R(n) ? {
1721
1852
  ...n.product,
1722
1853
  attachmentsValues: n.attachments
1723
1854
  } : null,
1724
- quantity: (n) => R(n) ? n.AvailableQuantity ?? 0 : F(n) ? n.quantity : null,
1725
- isGift: (n) => F(n) ? n.isGift ?? !1 : null
1726
- }, Qt = ({ linkText: n }) => `/${n}/p`, Zt = ({
1855
+ quantity: (n) => L(n) ? n.AvailableQuantity ?? 0 : R(n) ? n.quantity : null,
1856
+ isGift: (n) => R(n) ? n.isGift ?? !1 : null
1857
+ }, nr = ({ linkText: n }) => `/${n}/p`, er = ({
1727
1858
  offer: n,
1728
1859
  seller: e,
1729
1860
  product: t
@@ -1731,18 +1862,18 @@ const Yt = (n) => typeof n == "object" ? JSON.stringify(n) : typeof n == "string
1731
1862
  ...n,
1732
1863
  product: t,
1733
1864
  seller: e
1734
- }), nr = {
1865
+ }), tr = {
1735
1866
  imageText: "image",
1736
1867
  imageUrl: "https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg",
1737
1868
  imageLabel: "label"
1738
- }, de = (n, e) => `${n}-${e}`, er = (n, e) => `/${de(n, e)}/p`, tr = (n) => Array.isArray(n) && n.length > 0 ? n : null;
1869
+ }, de = (n, e) => `${n}-${e}`, rr = (n, e) => `/${de(n, e)}/p`, ir = (n) => Array.isArray(n) && n.length > 0 ? n : null;
1739
1870
  function ue(n) {
1740
1871
  return n.replace(/^\/+|\/+$/g, "");
1741
1872
  }
1742
- const rr = (n, e) => {
1873
+ const ar = (n, e) => {
1743
1874
  const t = n.findIndex((r) => ue(r).split("/").at(-1) === e);
1744
1875
  return t < 0 ? 0 : t;
1745
- }, ir = {
1876
+ }, or = {
1746
1877
  productID: ({ itemId: n }) => n,
1747
1878
  name: ({ isVariantOf: n, name: e }) => e ?? n.productName,
1748
1879
  slug: ({ isVariantOf: { linkText: n }, itemId: e }) => de(n, e),
@@ -1750,7 +1881,7 @@ const rr = (n, e) => {
1750
1881
  seo: ({ isVariantOf: n }) => ({
1751
1882
  title: n.productTitle || n.productName,
1752
1883
  description: n.metaTagDescription || n.description,
1753
- canonical: Qt(n)
1884
+ canonical: nr(n)
1754
1885
  }),
1755
1886
  brand: ({ isVariantOf: { brand: n } }) => ({ name: n }),
1756
1887
  unitMultiplier: ({ unitMultiplier: n }) => n,
@@ -1764,20 +1895,20 @@ const rr = (n, e) => {
1764
1895
  },
1765
1896
  itemId: a
1766
1897
  }) => {
1767
- const o = rr(i, r), s = n[o], c = ue(s).split("/");
1898
+ const o = ar(i, r), s = n[o], c = ue(s).split("/");
1768
1899
  return {
1769
1900
  itemListElement: [
1770
- ...c.map((d, p) => {
1771
- const m = `/${c.slice(0, p + 1).map(Kn).join("/")}/`;
1901
+ ...c.map((u, g) => {
1902
+ const m = `/${c.slice(0, g + 1).map(Kn).join("/")}/`;
1772
1903
  return {
1773
- name: d,
1904
+ name: u,
1774
1905
  item: m,
1775
- position: p + 1
1906
+ position: g + 1
1776
1907
  };
1777
1908
  }),
1778
1909
  {
1779
1910
  name: e,
1780
- item: er(t, a),
1911
+ item: rr(t, a),
1781
1912
  position: c.length + 1
1782
1913
  }
1783
1914
  ],
@@ -1785,11 +1916,11 @@ const rr = (n, e) => {
1785
1916
  };
1786
1917
  },
1787
1918
  image: ({ images: n }, e) => {
1788
- const t = (tr(n) ?? [nr]).map(
1789
- ({ imageUrl: s, imageText: c, imageLabel: d }) => ({
1919
+ const t = (ir(n) ?? [tr]).map(
1920
+ ({ imageUrl: s, imageText: c, imageLabel: u }) => ({
1790
1921
  alternateName: c ?? "",
1791
1922
  url: s.replace("vteximg.com.br", "vtexassets.com"),
1792
- keywords: d
1923
+ keywords: u
1793
1924
  })
1794
1925
  );
1795
1926
  if (typeof e != "object")
@@ -1808,7 +1939,7 @@ const rr = (n, e) => {
1808
1939
  review: () => [],
1809
1940
  aggregateRating: () => ({}),
1810
1941
  offers: (n) => n.sellers.map(
1811
- (e) => Zt({
1942
+ (e) => er({
1812
1943
  offer: e.commertialOffer,
1813
1944
  seller: e,
1814
1945
  product: n
@@ -1829,7 +1960,7 @@ const rr = (n, e) => {
1829
1960
  }))
1830
1961
  ), i = e.map(
1831
1962
  te
1832
- ), a = t.map(_t);
1963
+ ), a = t.map(kt);
1833
1964
  return [
1834
1965
  ...r,
1835
1966
  ...i,
@@ -1842,13 +1973,13 @@ const rr = (n, e) => {
1842
1973
  releaseDate: ({ isVariantOf: { releaseDate: n } }) => n ?? "",
1843
1974
  advertisement: ({ isVariantOf: { advertisement: n } }) => n,
1844
1975
  deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: n } }) => n
1845
- }, ar = /* @__PURE__ */ new Set(["allSpecifications"]), or = {
1976
+ }, sr = /* @__PURE__ */ new Set(["allSpecifications"]), cr = {
1846
1977
  hasVariant: (n) => n.isVariantOf.items.map((e) => B(e, n.isVariantOf)),
1847
1978
  productGroupID: ({ isVariantOf: n }) => n.productId,
1848
1979
  name: (n) => n.isVariantOf.productName,
1849
1980
  skuVariants: (n) => n,
1850
1981
  additionalProperty: ({ isVariantOf: { specificationGroups: n } }) => n.filter(
1851
- (e) => !ar.has(e.name)
1982
+ (e) => !sr.has(e.name)
1852
1983
  ).flatMap(
1853
1984
  ({ specifications: e }) => e.flatMap(
1854
1985
  ({ name: t, values: r }) => r.map((i) => ({
@@ -1858,11 +1989,30 @@ const rr = (n, e) => {
1858
1989
  }))
1859
1990
  )
1860
1991
  )
1861
- }, sr = {
1992
+ }, lr = {
1862
1993
  propertyID: (n) => n.propertyID || re(n),
1863
1994
  name: ({ name: n }) => n,
1864
1995
  value: ({ value: n }) => n,
1865
1996
  valueReference: ({ valueReference: n }) => n
1997
+ }, dr = async (n, { operationId: e }, { clients: { commerce: t } }) => {
1998
+ if (!e)
1999
+ throw new k("Missing operationId");
2000
+ return t.orderEntry.getOperation({ operationId: e });
2001
+ }, ur = async (n, { orderFormId: e }, { clients: { commerce: t } }) => {
2002
+ if (!e)
2003
+ throw new k("Missing orderFormId");
2004
+ const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: e });
2005
+ return (r ?? []).map((i) => ({
2006
+ id: i.id,
2007
+ name: i.name,
2008
+ price: i.price,
2009
+ listPrice: i.listPrice,
2010
+ quantity: i.quantity,
2011
+ imageUrl: i.imageUrl ?? null,
2012
+ availability: i.availability,
2013
+ seller: i.seller,
2014
+ unitMultiplier: i.unitMultiplier ?? 1
2015
+ }));
1866
2016
  }, On = (n) => {
1867
2017
  const e = n.flatMap(
1868
2018
  (r) => r.sellers.map((i) => ({
@@ -1874,7 +2024,7 @@ const rr = (n, e) => {
1874
2024
  ({ offer: r }, { offer: i }) => Jn(r, i)
1875
2025
  );
1876
2026
  return t ? t.sku : n[0];
1877
- }, cr = (n) => n !== "" && !Number.isNaN(Number(n)), lr = {
2027
+ }, pr = (n) => n !== "" && !Number.isNaN(Number(n)), gr = {
1878
2028
  price_desc: "price:desc",
1879
2029
  price_asc: "price:asc",
1880
2030
  orders_desc: "orders:desc",
@@ -1883,19 +2033,19 @@ const rr = (n, e) => {
1883
2033
  release_desc: "release:desc",
1884
2034
  discount_desc: "discount:desc",
1885
2035
  score_desc: ""
1886
- }, dr = {
2036
+ }, mr = {
1887
2037
  product: async (n, { locator: e }, t) => {
1888
- const r = En(e), i = Tn(e), a = Ot(e), o = vt(e);
2038
+ const r = kn(e), i = Un(e), a = Ot(e), o = vt(e);
1889
2039
  r && Sn(t, r), i && yn(t, i);
1890
2040
  const {
1891
2041
  loaders: { skuLoader: s },
1892
- clients: { commerce: c, search: d }
2042
+ clients: { commerce: c, search: u }
1893
2043
  } = t;
1894
2044
  try {
1895
- const p = a ?? o?.split("-").pop() ?? "";
1896
- if (!cr(p))
2045
+ const g = a ?? o?.split("-").pop() ?? "";
2046
+ if (!pr(g))
1897
2047
  throw new Error("Invalid SkuId");
1898
- const m = await s.load(p);
2048
+ const m = await s.load(g);
1899
2049
  if (o && m.isVariantOf.linkText && !o.startsWith(m.isVariantOf.linkText))
1900
2050
  throw new Error(
1901
2051
  `Slug was set but the fetched sku does not satisfy the slug condition. slug: ${o}, linkText: ${m.isVariantOf.linkText}`
@@ -1903,23 +2053,23 @@ const rr = (n, e) => {
1903
2053
  return m;
1904
2054
  } catch {
1905
2055
  if (o == null)
1906
- throw new V("Missing slug or id");
2056
+ throw new k("Missing slug or id");
1907
2057
  const m = await c.catalog.portal.pagetype(`${o}/p`);
1908
2058
  if (m.pageType !== "Product" || !m.id)
1909
- throw new $(`No product found for slug ${o}`);
2059
+ throw new z(`No product found for slug ${o}`);
1910
2060
  const {
1911
- products: [u]
1912
- } = await d.products({
2061
+ products: [d]
2062
+ } = await u.products({
1913
2063
  page: 0,
1914
2064
  count: 1,
1915
2065
  query: `product:${m.id}`,
1916
2066
  // Manually disabling this flag to prevent regionalization issues
1917
2067
  hideUnavailableItems: !1
1918
2068
  });
1919
- if (!u)
1920
- throw new $(`No product found for id ${m.id}`);
1921
- const l = On(u.items);
1922
- return B(l, u);
2069
+ if (!d)
2070
+ throw new z(`No product found for id ${m.id}`);
2071
+ const l = On(d.items);
2072
+ return B(l, d);
1923
2073
  }
1924
2074
  },
1925
2075
  collection: (n, { slug: e }, t) => {
@@ -1936,24 +2086,24 @@ const rr = (n, e) => {
1936
2086
  selectedFacets: a,
1937
2087
  sponsoredCount: o
1938
2088
  }, s) => {
1939
- const c = En(a), d = Tn(a), p = It(a);
1940
- c && Sn(s, c), d && yn(s, d);
2089
+ const c = kn(a), u = Un(a), g = It(a);
2090
+ c && Sn(s, c), u && yn(s, u);
1941
2091
  let m = i;
1942
- p && (m = `product:${(await s.clients.commerce.catalog.products.crossselling(
2092
+ g && (m = `product:${(await s.clients.commerce.catalog.products.crossselling(
1943
2093
  {
1944
- type: Zn[p.key],
1945
- productId: p.value
2094
+ type: Zn[g.key],
2095
+ productId: g.value
1946
2096
  }
1947
2097
  )).map((S) => S.productId).slice(0, e).join(";")}`);
1948
- const u = t ? Number(t) : 0, l = {
1949
- page: Math.ceil(u / e) || 0,
2098
+ const d = t ? Number(t) : 0, l = {
2099
+ page: Math.ceil(d / e) || 0,
1950
2100
  count: e,
1951
2101
  query: m ?? void 0,
1952
- sort: lr[r ?? "score_desc"],
1953
- selectedFacets: a?.flatMap(kn) ?? [],
2102
+ sort: gr[r ?? "score_desc"],
2103
+ selectedFacets: a?.flatMap(_n) ?? [],
1954
2104
  sponsoredCount: o ?? void 0
1955
- }, g = s.clients.search.products(l);
1956
- return { searchArgs: l, productSearchPromise: g };
2105
+ }, p = s.clients.search.products(l);
2106
+ return { searchArgs: l, productSearchPromise: p };
1957
2107
  },
1958
2108
  allProducts: async (n, { first: e, after: t }, r) => {
1959
2109
  const {
@@ -1962,7 +2112,7 @@ const rr = (n, e) => {
1962
2112
  page: Math.ceil(a / e),
1963
2113
  count: e
1964
2114
  }), s = o.products.flatMap(
1965
- (c) => c.items.map((d) => B(d, c))
2115
+ (c) => c.items.map((u) => B(u, c))
1966
2116
  ).filter((c) => c.sellers.length > 0);
1967
2117
  return {
1968
2118
  pageInfo: {
@@ -1973,9 +2123,9 @@ const rr = (n, e) => {
1973
2123
  totalCount: o.recordsFiltered
1974
2124
  },
1975
2125
  // after + index is bigger than after+first itself because of the array flat() above
1976
- edges: s.map((c, d) => ({
2126
+ edges: s.map((c, u) => ({
1977
2127
  node: c,
1978
- cursor: (a + d).toString()
2128
+ cursor: (a + u).toString()
1979
2129
  }))
1980
2130
  };
1981
2131
  },
@@ -2002,17 +2152,17 @@ const rr = (n, e) => {
2002
2152
  } = r, a = t ? Number(t) : 0, [o, s] = await Promise.all([
2003
2153
  i.catalog.brand.list(),
2004
2154
  i.catalog.category.tree()
2005
- ]), c = [], d = (u, l) => {
2006
- c.push({ ...u, level: l });
2007
- for (const g of u.children)
2008
- d(g, l + 1);
2155
+ ]), c = [], u = (d, l) => {
2156
+ c.push({ ...d, level: l });
2157
+ for (const p of d.children)
2158
+ u(p, l + 1);
2009
2159
  };
2010
- for (const u of s)
2011
- d(u, 0);
2160
+ for (const d of s)
2161
+ u(d, 0);
2012
2162
  const m = [
2013
- ...o.filter((u) => u.isActive).map((u) => ({ ...u, type: "brand" })),
2163
+ ...o.filter((d) => d.isActive).map((d) => ({ ...d, type: "brand" })),
2014
2164
  ...c
2015
- ].filter((u) => !!Qn.slug(u, null, r, null));
2165
+ ].filter((d) => !!Qn.slug(d, null, r, null));
2016
2166
  return {
2017
2167
  pageInfo: {
2018
2168
  hasNextPage: m.length - a > e,
@@ -2021,8 +2171,8 @@ const rr = (n, e) => {
2021
2171
  endCursor: (Math.min(e, m.length - a) - 1).toString(),
2022
2172
  totalCount: m.length
2023
2173
  },
2024
- edges: m.slice(a, a + e).map((u, l) => ({
2025
- node: u,
2174
+ edges: m.slice(a, a + e).map((d, l) => ({
2175
+ node: d,
2026
2176
  cursor: (a + l).toString()
2027
2177
  }))
2028
2178
  };
@@ -2047,7 +2197,7 @@ const rr = (n, e) => {
2047
2197
  page: 1,
2048
2198
  count: 1,
2049
2199
  query: e ?? void 0,
2050
- selectedFacets: t?.flatMap(kn) ?? [],
2200
+ selectedFacets: t?.flatMap(_n) ?? [],
2051
2201
  allowRedirect: !0
2052
2202
  });
2053
2203
  return {
@@ -2062,10 +2212,10 @@ const rr = (n, e) => {
2062
2212
  geoCoordinates: t,
2063
2213
  country: r,
2064
2214
  salesChannel: i
2065
- }))?.[0], { id: d, sellers: p } = c;
2215
+ }))?.[0], { id: u, sellers: g } = c;
2066
2216
  return {
2067
- id: d,
2068
- sellers: p
2217
+ id: u,
2218
+ sellers: g
2069
2219
  };
2070
2220
  },
2071
2221
  profile: async (n, { id: e }, t) => {
@@ -2090,12 +2240,12 @@ const rr = (n, e) => {
2090
2240
  userOrder: async (n, { orderId: e }, t) => {
2091
2241
  try {
2092
2242
  if (!e)
2093
- throw new V("Missing orderId");
2243
+ throw new k("Missing orderId");
2094
2244
  const {
2095
2245
  clients: { commerce: r }
2096
2246
  } = t, i = await r.oms.userOrder({ orderId: e });
2097
2247
  if (!i)
2098
- throw new $(`No order found for id ${e}`);
2248
+ throw new z(`No order found for id ${e}`);
2099
2249
  let a = null;
2100
2250
  try {
2101
2251
  const c = await r.oms.getCommercialAuthorizationsByOrderId({ orderId: e });
@@ -2138,7 +2288,7 @@ const rr = (n, e) => {
2138
2288
  a = { message: i };
2139
2289
  }
2140
2290
  const o = a?.message || i;
2141
- throw $e(r) ? new $(`No order found for id ${e}. ${o}.`) : Me(r) ? new an(
2291
+ throw $e(r) ? new z(`No order found for id ${e}. ${o}.`) : Be(r) ? new an(
2142
2292
  `You are forbidden to interact with order with id ${e}. ${o}.`
2143
2293
  ) : r;
2144
2294
  }
@@ -2172,18 +2322,18 @@ const rr = (n, e) => {
2172
2322
  account: r,
2173
2323
  headers: i,
2174
2324
  clients: { commerce: a }
2175
- } = t, s = Z(Q(i?.cookie ?? "", r))?.userId ?? "", [c, d, p] = await Promise.all([
2325
+ } = t, s = Z(Q(i?.cookie ?? "", r))?.userId ?? "", [c, u, g] = await Promise.all([
2176
2326
  a.session("").catch(() => null),
2177
2327
  s ? a.masterData.getShopperById({ userId: s }).catch(() => null) : Promise.resolve(null),
2178
2328
  s ? a.licenseManager.getUserRoles({ userId: s }).catch(() => null) : Promise.resolve(null)
2179
- ]), m = d?.[0], u = c?.namespaces.authentication ?? null, l = `${(m?.firstName ?? "").trim()} ${(m?.lastName ?? "").trim()}`.trim();
2329
+ ]), m = u?.[0], d = c?.namespaces.authentication ?? null, l = `${(m?.firstName ?? "").trim()} ${(m?.lastName ?? "").trim()}`.trim();
2180
2330
  return {
2181
- username: u?.storeUserEmail?.value ?? "",
2331
+ username: d?.storeUserEmail?.value ?? "",
2182
2332
  name: l,
2183
- email: u?.storeUserEmail?.value ?? "",
2333
+ email: d?.storeUserEmail?.value ?? "",
2184
2334
  phone: m?.phone ?? "",
2185
- role: p?.Roles?.map((g) => g.Name) ?? [],
2186
- orgUnit: u?.unitName?.value ?? ""
2335
+ role: g?.Roles?.map((p) => p.Name) ?? [],
2336
+ orgUnit: d?.unitName?.value ?? ""
2187
2337
  };
2188
2338
  },
2189
2339
  // If isRepresentative, return b2b information.
@@ -2200,13 +2350,13 @@ const rr = (n, e) => {
2200
2350
  const c = await a.session("").catch(() => null);
2201
2351
  if (!c)
2202
2352
  return null;
2203
- const d = c.namespaces.profile ?? null;
2353
+ const u = c.namespaces.profile ?? null;
2204
2354
  return {
2205
2355
  name: ((await a.masterData.getContractById({
2206
- contractId: d?.id?.value ?? ""
2207
- }))?.corporateName ?? `${(d?.firstName?.value ?? "").trim()} ${(d?.lastName?.value ?? "").trim()}`.trim()) || "",
2208
- email: d?.email?.value || "",
2209
- id: d?.id?.value || ""
2356
+ contractId: u?.id?.value ?? ""
2357
+ }))?.corporateName ?? `${(u?.firstName?.value ?? "").trim()} ${(u?.lastName?.value ?? "").trim()}`.trim()) || "",
2358
+ email: u?.email?.value || "",
2359
+ id: u?.id?.value || ""
2210
2360
  // createdAt: '',
2211
2361
  };
2212
2362
  }
@@ -2227,8 +2377,10 @@ const rr = (n, e) => {
2227
2377
  return await r.checkout.pickupPoints({
2228
2378
  geoCoordinates: e
2229
2379
  });
2230
- }
2231
- }, ur = {
2380
+ },
2381
+ orderEntryOperation: dr,
2382
+ orderFormItems: ur
2383
+ }, hr = {
2232
2384
  reviewRating: () => ({
2233
2385
  ratingValue: 5,
2234
2386
  bestRating: 5
@@ -2236,7 +2388,7 @@ const rr = (n, e) => {
2236
2388
  author: () => ({
2237
2389
  name: ""
2238
2390
  })
2239
- }, pr = (n, e, t) => e ? n.key === "category-1" : t ? n.key === "brand" : !1, gr = {
2391
+ }, fr = (n, e, t) => e ? n.key === "category-1" : t ? n.key === "brand" : !1, Sr = {
2240
2392
  suggestions: async (n, e, t) => {
2241
2393
  const {
2242
2394
  clients: { search: r }
@@ -2252,12 +2404,12 @@ const rr = (n, e) => {
2252
2404
  const { productSearchPromise: a } = n, [o, s] = await Promise.all([
2253
2405
  r.suggestedTerms(i),
2254
2406
  a
2255
- ]), c = s.products.map((p) => {
2256
- const m = On(p.items);
2257
- return m && B(m, p);
2258
- }).filter((p) => !!p), { searches: d } = o;
2407
+ ]), c = s.products.map((g) => {
2408
+ const m = On(g.items);
2409
+ return m && B(m, g);
2410
+ }).filter((g) => !!g), { searches: u } = o;
2259
2411
  return {
2260
- terms: d.map((p) => ({ value: p.term, count: p.count })),
2412
+ terms: u.map((g) => ({ value: g.term, count: g.count })),
2261
2413
  products: c
2262
2414
  };
2263
2415
  },
@@ -2287,7 +2439,7 @@ const rr = (n, e) => {
2287
2439
  t.storage.searchArgs = n;
2288
2440
  const { facets: i = [] } = await r.facets(n), a = !n.query, o = n.selectedFacets?.length ? n.selectedFacets[0].key === "category-1" : !1, s = n.selectedFacets?.length ? n.selectedFacets[0].key === "brand" : !1;
2289
2441
  return i.filter(
2290
- (d) => !a || !pr(d, o, s)
2442
+ (u) => !a || !fr(u, o, s)
2291
2443
  );
2292
2444
  },
2293
2445
  metadata: async ({ productSearchPromise: n }) => {
@@ -2299,12 +2451,12 @@ const rr = (n, e) => {
2299
2451
  };
2300
2452
  },
2301
2453
  searchId: async ({ productSearchPromise: n }) => (await n).searchId
2302
- }, mr = {
2454
+ }, yr = {
2303
2455
  title: ({ title: n }) => n ?? "",
2304
2456
  description: ({ description: n }) => n ?? "",
2305
2457
  canonical: ({ canonical: n }) => n ?? "",
2306
2458
  titleTemplate: () => ""
2307
- }, hr = ["bd", "d", "h", "m"], fr = (n) => hr.includes(n), Sr = {
2459
+ }, Ir = ["bd", "d", "h", "m"], vr = (n) => Ir.includes(n), Or = {
2308
2460
  bd: {
2309
2461
  0: "Today",
2310
2462
  1: "In 1 business day",
@@ -2326,28 +2478,28 @@ const rr = (n, e) => {
2326
2478
  other: "Up to # minutes"
2327
2479
  }
2328
2480
  }, pe = (n) => {
2329
- const [e, t] = [n.split(/\D+/)[0], n.split(/[0-9]+/)[1]], r = e !== "" && !Number.isNaN(Number(e)), i = fr(t);
2481
+ const [e, t] = [n.split(/\D+/)[0], n.split(/[0-9]+/)[1]], r = e !== "" && !Number.isNaN(Number(e)), i = vr(t);
2330
2482
  if (!r || !i)
2331
2483
  return "";
2332
2484
  const a = Number(e) < 2 ? Number(e) : "other";
2333
- return Sr[t][a].replace("#", e) ?? "";
2334
- }, yr = {
2485
+ return Or[t][a].replace("#", e) ?? "";
2486
+ }, Cr = {
2335
2487
  carrier: (n) => n?.friendlyName ?? n?.name ?? "",
2336
2488
  price: (n) => n?.price ? n.price / 100 : n?.price,
2337
2489
  localizedEstimates: (n) => n?.shippingEstimate ? pe(n.shippingEstimate) : ""
2338
- }, Mn = "skuvariation";
2490
+ }, Bn = "skuvariation";
2339
2491
  function $n(n, e) {
2340
- const t = `${Mn}${e}`.toLowerCase(), r = n.find(
2492
+ const t = `${Bn}${e}`.toLowerCase(), r = n.find(
2341
2493
  (a) => a.imageLabel === t
2342
2494
  );
2343
2495
  if (r)
2344
2496
  return r;
2345
2497
  const i = n.find(
2346
- (a) => a.imageLabel === Mn
2498
+ (a) => a.imageLabel === Bn
2347
2499
  );
2348
2500
  return i || n[0];
2349
2501
  }
2350
- function Ir(n, e, t) {
2502
+ function br(n, e, t) {
2351
2503
  const r = {};
2352
2504
  return n.forEach((i) => {
2353
2505
  const a = i.variations;
@@ -2355,7 +2507,7 @@ function Ir(n, e, t) {
2355
2507
  return;
2356
2508
  const o = `${e}-${a.find(
2357
2509
  (c) => c.name === e
2358
- )?.values[0] ?? ""}`, s = a.reduce((c, d) => d.name === e ? c : c + `-${d.name}-${d.values[0]}`, o);
2510
+ )?.values[0] ?? ""}`, s = a.reduce((c, u) => u.name === e ? c : c + `-${u.name}-${u.values[0]}`, o);
2359
2511
  r[s] = `${t}-${i.itemId}`;
2360
2512
  }), r;
2361
2513
  }
@@ -2365,24 +2517,24 @@ function zn(n) {
2365
2517
  e[t.name] = t.values[0];
2366
2518
  }), e;
2367
2519
  }
2368
- function vr(n) {
2520
+ function wr(n) {
2369
2521
  const e = {};
2370
2522
  return n?.forEach((t) => {
2371
2523
  e[t.field.originalName ?? t.field.name] = t.values.map((r) => r.originalName ?? r.name);
2372
2524
  }), e;
2373
2525
  }
2374
- function Or(n, e) {
2526
+ function Dr(n, e) {
2375
2527
  return Number.isNaN(Number(n) - Number(e)) ? n < e ? -1 : n > e ? 1 : 0 : Number(n) - Number(e);
2376
2528
  }
2377
- function Cr(n) {
2529
+ function Ar(n) {
2378
2530
  const e = n;
2379
2531
  for (const t in n)
2380
2532
  n[t].every(
2381
2533
  (i) => !Number.isNaN(Number(i.value))
2382
- ) && n[t].sort((i, a) => Or(i.value, a.value));
2534
+ ) && n[t].sort((i, a) => Dr(i.value, a.value));
2383
2535
  return e;
2384
2536
  }
2385
- function br(n, e, t) {
2537
+ function Pr(n, e, t) {
2386
2538
  const r = {}, i = /* @__PURE__ */ new Set();
2387
2539
  return n.forEach((a) => {
2388
2540
  if (a.variations.length === 0)
@@ -2395,78 +2547,78 @@ function br(n, e, t) {
2395
2547
  if (!o || i.has(c))
2396
2548
  return;
2397
2549
  i.add(c);
2398
- const d = $n(
2550
+ const u = $n(
2399
2551
  a.images,
2400
2552
  e
2401
- ), p = {
2402
- src: d.imageUrl,
2403
- alt: d.imageLabel ?? "",
2553
+ ), g = {
2554
+ src: u.imageUrl,
2555
+ alt: u.imageLabel ?? "",
2404
2556
  label: `${e}: ${o.values[0]}`,
2405
2557
  value: o.values[0]
2406
2558
  };
2407
- r[o.name] ? r[o.name].push(p) : r[o.name] = [p];
2559
+ r[o.name] ? r[o.name].push(g) : r[o.name] = [g];
2408
2560
  return;
2409
2561
  }
2410
2562
  a.variations.forEach((c) => {
2411
- const d = `${c.name}-${c.values[0]}`;
2412
- if (i.has(d))
2563
+ const u = `${c.name}-${c.values[0]}`;
2564
+ if (i.has(u))
2413
2565
  return;
2414
- i.add(d);
2415
- const p = $n(
2566
+ i.add(u);
2567
+ const g = $n(
2416
2568
  a.images,
2417
2569
  c.name
2418
2570
  ), m = {
2419
- src: p.imageUrl,
2420
- alt: p.imageText ?? "",
2571
+ src: g.imageUrl,
2572
+ alt: g.imageText ?? "",
2421
2573
  label: `${c.name}: ${c.values[0]}`,
2422
2574
  value: c.values[0]
2423
2575
  };
2424
2576
  r[c.name] ? r[c.name].push(m) : r[c.name] = [m];
2425
2577
  });
2426
- }), Cr(r);
2578
+ }), Ar(r);
2427
2579
  }
2428
- const Dr = {
2580
+ const Er = {
2429
2581
  activeVariations: (n) => zn(n.variations),
2430
- allVariantsByName: (n) => vr(n.isVariantOf.skuSpecifications),
2431
- slugsMap: (n, e) => Ir(
2582
+ allVariantsByName: (n) => wr(n.isVariantOf.skuSpecifications),
2583
+ slugsMap: (n, e) => br(
2432
2584
  n.isVariantOf.items,
2433
2585
  e.dominantVariantName ?? n.variations[0]?.name,
2434
2586
  n.isVariantOf.linkText
2435
2587
  ),
2436
2588
  availableVariations: (n, e) => {
2437
2589
  const t = e.dominantVariantName ?? n.variations[0]?.name, i = zn(n.variations)[t];
2438
- return br(
2590
+ return Pr(
2439
2591
  n.isVariantOf.items,
2440
2592
  t,
2441
2593
  i
2442
2594
  );
2443
2595
  },
2444
2596
  allVariantProducts: (n) => n.isVariantOf.items.map((e) => B(e, n.isVariantOf))
2445
- }, wr = {
2597
+ }, _r = {
2446
2598
  "pickup-in-point": "Pickup",
2447
2599
  delivery: "Delivery",
2448
2600
  pickup: "Pickup",
2449
2601
  "take-away": "Take away",
2450
2602
  "": ""
2451
- }, Ar = {
2603
+ }, Tr = {
2452
2604
  deliveryOptionsData: (n) => {
2453
2605
  const { shippingData: e, items: t } = n, r = e?.logisticsInfo || [], i = e?.selectedAddresses || e?.availableAddresses || [e?.address], a = r.reduce(
2454
- (d, p) => {
2455
- const m = p?.selectedSla || "", u = p?.selectedDeliveryChannel || p?.deliveryChannel || "", l = p?.deliveryCompany || "", g = p?.deliveryWindow, f = p?.pickupStoreInfo, S = p?.shippingEstimate || "", O = p?.shippingEstimate ? pe(p?.shippingEstimate) : "", D = p?.shippingEstimateDate || "", A = p?.addressId || "", T = p?.itemIndex ?? 0, v = t?.[T], U = v?.seller || "", h = `${m}|${u}|${l}|${U}|${S}|${D}|${A}|${g?.startDateUtc}|${g?.endDateUtc}`, C = i?.find(
2456
- (P) => P?.addressId === A
2457
- ), b = `${wr[u] || ""} ${O} ${C?.neighborhood ? `to ${C?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: k, taxPriceTags: y } = Pr(
2458
- v?.priceTags ?? []
2459
- ), w = (v?.sellingPrice ?? 0) * (v?.quantity ?? 0) + (v?.tax ?? 0) + (k ?? 0);
2460
- return d[h] || (d[h] = {
2606
+ (u, g) => {
2607
+ const m = g?.selectedSla || "", d = g?.selectedDeliveryChannel || g?.deliveryChannel || "", l = g?.deliveryCompany || "", p = g?.deliveryWindow, f = g?.pickupStoreInfo, S = g?.shippingEstimate || "", v = g?.shippingEstimate ? pe(g?.shippingEstimate) : "", w = g?.shippingEstimateDate || "", P = g?.addressId || "", T = g?.itemIndex ?? 0, O = t?.[T], E = O?.seller || "", h = `${m}|${d}|${l}|${E}|${S}|${w}|${P}|${p?.startDateUtc}|${p?.endDateUtc}`, C = i?.find(
2608
+ (_) => _?.addressId === P
2609
+ ), b = `${_r[d] || ""} ${v} ${C?.neighborhood ? `to ${C?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: D, taxPriceTags: y } = Ur(
2610
+ O?.priceTags ?? []
2611
+ ), A = (O?.sellingPrice ?? 0) * (O?.quantity ?? 0) + (O?.tax ?? 0) + (D ?? 0);
2612
+ return u[h] || (u[h] = {
2461
2613
  // static fields
2462
2614
  selectedSla: m,
2463
- deliveryChannel: u,
2615
+ deliveryChannel: d,
2464
2616
  deliveryCompany: l,
2465
- deliveryWindow: g,
2617
+ deliveryWindow: p,
2466
2618
  shippingEstimate: S,
2467
- shippingEstimateDate: D,
2468
- seller: U,
2469
- friendlyShippingEstimate: O,
2619
+ shippingEstimateDate: w,
2620
+ seller: E,
2621
+ friendlyShippingEstimate: v,
2470
2622
  friendlyDeliveryOptionName: b,
2471
2623
  address: C,
2472
2624
  pickupStoreInfo: f,
@@ -2474,19 +2626,19 @@ const Dr = {
2474
2626
  quantityOfDifferentItems: 0,
2475
2627
  total: 0,
2476
2628
  items: []
2477
- }), d[h] && (d[h].items?.push({
2478
- id: v?.id || "",
2479
- uniqueId: v?.uniqueId || "",
2480
- name: v?.name || "",
2481
- quantity: v?.quantity || 0,
2482
- price: v?.price || 0,
2483
- sellingPrice: v?.sellingPrice || 0,
2484
- imageUrl: v?.imageUrl || "",
2629
+ }), u[h] && (u[h].items?.push({
2630
+ id: O?.id || "",
2631
+ uniqueId: O?.uniqueId || "",
2632
+ name: O?.name || "",
2633
+ quantity: O?.quantity || 0,
2634
+ price: O?.price || 0,
2635
+ sellingPrice: O?.sellingPrice || 0,
2636
+ imageUrl: O?.imageUrl || "",
2485
2637
  taxPriceTags: y ?? [],
2486
- taxPriceTagsTotal: k ?? 0,
2487
- tax: v?.tax || 0,
2488
- total: w
2489
- }), d[h].quantityOfDifferentItems = (d[h].quantityOfDifferentItems ?? 0) + 1, d[h].total = (d[h].total ?? 0) + w), d;
2638
+ taxPriceTagsTotal: D ?? 0,
2639
+ tax: O?.tax || 0,
2640
+ total: A
2641
+ }), u[h].quantityOfDifferentItems = (u[h].quantityOfDifferentItems ?? 0) + 1, u[h].total = (u[h].total ?? 0) + A), u;
2490
2642
  },
2491
2643
  {}
2492
2644
  ), o = Object.values(a), s = e?.contactInformation?.[0], c = {
@@ -2512,7 +2664,7 @@ const Dr = {
2512
2664
  ) || [];
2513
2665
  }
2514
2666
  };
2515
- function Pr(n) {
2667
+ function Ur(n) {
2516
2668
  const t = n.filter(
2517
2669
  (i) => i?.name?.includes("TAX")
2518
2670
  ), r = t.reduce(
@@ -2524,28 +2676,28 @@ function Pr(n) {
2524
2676
  taxPriceTagsTotal: r
2525
2677
  };
2526
2678
  }
2527
- const Ur = {
2679
+ const kr = {
2528
2680
  StoreCollection: Qn,
2529
2681
  StoreAggregateOffer: gt,
2530
- StoreProduct: ir,
2531
- StoreSeo: mr,
2682
+ StoreProduct: or,
2683
+ StoreSeo: yr,
2532
2684
  StoreFacet: Ct,
2533
2685
  StoreFacetBoolean: bt,
2534
- StoreFacetRange: Dt,
2535
- StoreFacetValueBoolean: wt,
2536
- StoreOffer: Kt,
2686
+ StoreFacetRange: wt,
2687
+ StoreFacetValueBoolean: Dt,
2688
+ StoreOffer: Zt,
2537
2689
  StoreAggregateRating: mt,
2538
- StoreReview: ur,
2539
- StoreProductGroup: or,
2540
- StoreSearchResult: gr,
2541
- StorePropertyValue: sr,
2542
- SkuVariants: Dr,
2543
- ShippingSLA: yr,
2544
- UserOrderResult: Ar,
2545
- ObjectOrString: Jt,
2546
- Query: dr,
2547
- Mutation: Ht
2548
- }, kr = () => Ur, _r = `"""
2690
+ StoreReview: hr,
2691
+ StoreProductGroup: cr,
2692
+ StoreSearchResult: Sr,
2693
+ StorePropertyValue: lr,
2694
+ SkuVariants: Er,
2695
+ ShippingSLA: Cr,
2696
+ UserOrderResult: Tr,
2697
+ ObjectOrString: Qt,
2698
+ Query: mr,
2699
+ Mutation: Yt
2700
+ }, Nr = () => kr, Fr = `"""
2549
2701
  Address information.
2550
2702
  """
2551
2703
  type Address {
@@ -2590,7 +2742,7 @@ type Address {
2590
2742
  """
2591
2743
  geoCoordinates: [Float]
2592
2744
  }
2593
- `, Tr = `"""
2745
+ `, Rr = `"""
2594
2746
  Advertisement information about a specific product in a campaign
2595
2747
  """
2596
2748
  type Advertisement {
@@ -2615,7 +2767,7 @@ type Advertisement {
2615
2767
  """
2616
2768
  adResponseId: String!
2617
2769
  }
2618
- `, Er = `"""
2770
+ `, Lr = `"""
2619
2771
  Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.
2620
2772
  """
2621
2773
  type StoreAggregateOffer {
@@ -2644,7 +2796,7 @@ type StoreAggregateOffer {
2644
2796
  """
2645
2797
  offers: [StoreOffer!]!
2646
2798
  }
2647
- `, Nr = `"""
2799
+ `, Mr = `"""
2648
2800
  Average rating, based on multiple ratings or reviews.
2649
2801
  """
2650
2802
  type StoreAggregateRating {
@@ -2657,7 +2809,7 @@ type StoreAggregateRating {
2657
2809
  """
2658
2810
  reviewCount: Int!
2659
2811
  }
2660
- `, Fr = `"""
2812
+ `, Br = `"""
2661
2813
  information about the author of a product review or rating.
2662
2814
  """
2663
2815
  type StoreAuthor {
@@ -2666,7 +2818,7 @@ type StoreAuthor {
2666
2818
  """
2667
2819
  name: String!
2668
2820
  }
2669
- `, Rr = `"""
2821
+ `, $r = `"""
2670
2822
  Brand of a given product.
2671
2823
  """
2672
2824
  type StoreBrand {
@@ -2675,7 +2827,7 @@ type StoreBrand {
2675
2827
  """
2676
2828
  name: String!
2677
2829
  }
2678
- `, Lr = `"""
2830
+ `, zr = `"""
2679
2831
  Item of a list.
2680
2832
  """
2681
2833
  type StoreListItem {
@@ -2706,7 +2858,7 @@ type StoreBreadcrumbList {
2706
2858
  """
2707
2859
  numberOfItems: Int!
2708
2860
  }
2709
- `, Br = `"""
2861
+ `, Vr = `"""
2710
2862
  Shopping cart message.
2711
2863
  """
2712
2864
  type StoreCartMessage {
@@ -2743,7 +2895,7 @@ input IStoreCart {
2743
2895
  """
2744
2896
  order: IStoreOrder!
2745
2897
  }
2746
- `, Mr = `"""
2898
+ `, xr = `"""
2747
2899
  Product collection type. Possible values are \`Department\`, \`Category\`, \`Brand\`, \`Cluster\`, \`SubCategory\` or \`Collection\`.
2748
2900
  """
2749
2901
  enum StoreCollectionType {
@@ -2826,7 +2978,7 @@ type StoreCollection {
2826
2978
  """
2827
2979
  type: StoreCollectionType!
2828
2980
  }
2829
- `, $r = `"""
2981
+ `, qr = `"""
2830
2982
  Delivery Promise badge.
2831
2983
  """
2832
2984
  type DeliveryPromiseBadge {
@@ -2835,7 +2987,7 @@ type DeliveryPromiseBadge {
2835
2987
  """
2836
2988
  typeName: String
2837
2989
  }
2838
- `, zr = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
2990
+ `, jr = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
2839
2991
 
2840
2992
  """
2841
2993
  Search facet range information.
@@ -2912,7 +3064,7 @@ type StoreFacetValueBoolean {
2912
3064
  """
2913
3065
  quantity: Int
2914
3066
  }
2915
- `, Vr = `"""
3067
+ `, Wr = `"""
2916
3068
  Image.
2917
3069
  """
2918
3070
  type StoreImage {
@@ -2939,7 +3091,7 @@ input IStoreImage {
2939
3091
  """
2940
3092
  alternateName: String!
2941
3093
  }
2942
- `, xr = `type Mutation {
3094
+ `, Gr = `type Mutation {
2943
3095
  """
2944
3096
  Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns \`null\`.
2945
3097
  """
@@ -2962,8 +3114,22 @@ input IStoreImage {
2962
3114
  processOrderAuthorization(
2963
3115
  data: IProcessOrderAuthorization!
2964
3116
  ): ProcessOrderAuthorizationResponse
3117
+ """
3118
+ Uploads a file to the Order Entry Service and returns the S3 object key.
3119
+ The file must be Base64-encoded and passed via the \`data\` input.
3120
+ The returned \`objectKey\` is required to start an order entry operation.
3121
+ """
3122
+ uploadFileToOrderEntry(data: IOrderEntryUpload!): StoreOrderEntryUploadResult
3123
+ @auth
3124
+ """
3125
+ Submits an uploaded file for bulk import into a VTEX cart via the Order Entry Service.
3126
+ Returns an operationId to poll for the operation status.
3127
+ """
3128
+ startOrderEntryOperation(
3129
+ data: IOrderEntryOperation!
3130
+ ): StoreOrderEntryOperationResult @auth
2965
3131
  }
2966
- `, qr = `"""
3132
+ `, Hr = `"""
2967
3133
  Newsletter information.
2968
3134
  """
2969
3135
  type PersonNewsletter {
@@ -2986,8 +3152,8 @@ input IPersonNewsletter {
2986
3152
  """
2987
3153
  email: String!
2988
3154
  }
2989
- `, jr = `scalar ObjectOrString
2990
- `, Wr = `"""
3155
+ `, Xr = `scalar ObjectOrString
3156
+ `, Yr = `"""
2991
3157
  Offer information.
2992
3158
  """
2993
3159
  type StoreOffer {
@@ -3070,7 +3236,7 @@ input IStoreOffer {
3070
3236
  """
3071
3237
  quantity: Int!
3072
3238
  }
3073
- `, Gr = `"""
3239
+ `, Jr = `"""
3074
3240
  Information of a specific order.
3075
3241
  """
3076
3242
  type StoreOrder {
@@ -3105,7 +3271,7 @@ input IStoreOrder {
3105
3271
  """
3106
3272
  shouldSplitItem: Boolean
3107
3273
  }
3108
- `, Hr = `"""
3274
+ `, Kr = `"""
3109
3275
  Commercial Authorization response.
3110
3276
  """
3111
3277
  type CommercialAuthorizationResponse {
@@ -3504,7 +3670,68 @@ type ProcessOrderAuthorizationRule {
3504
3670
  """
3505
3671
  rule: CommercialAuthorizationRule!
3506
3672
  }
3507
- `, Xr = `"""
3673
+ `, Qr = `"""
3674
+ Input for uploading a file to the Order Entry Service.
3675
+ The file is transmitted as a Base64-encoded string so it can travel
3676
+ through the standard GraphQL JSON pipeline without multipart support.
3677
+ """
3678
+ input IOrderEntryUpload {
3679
+ """
3680
+ Base64-encoded file content.
3681
+ """
3682
+ fileContent: String!
3683
+ """
3684
+ Original file name (e.g. "order.csv").
3685
+ """
3686
+ fileName: String!
3687
+ """
3688
+ MIME type of the file (e.g. "text/csv", "image/png").
3689
+ """
3690
+ mimeType: String!
3691
+ }
3692
+
3693
+ """
3694
+ Result returned after uploading a file to the Order Entry Service.
3695
+ """
3696
+ type StoreOrderEntryUploadResult {
3697
+ objectKey: String!
3698
+ }
3699
+
3700
+ input IOrderEntryOperation {
3701
+ objectKey: String!
3702
+ orderFormId: String
3703
+ sessionToken: String
3704
+ }
3705
+
3706
+ type StoreOrderEntryOperationResult {
3707
+ operationId: String!
3708
+ }
3709
+
3710
+ type StoreOrderEntryMissingItem {
3711
+ itemId: String!
3712
+ itemName: String
3713
+ reason: String!
3714
+ }
3715
+
3716
+ type StoreOrderEntryOperationStatus {
3717
+ status: String!
3718
+ entityId: String
3719
+ message: String
3720
+ missingItems: [StoreOrderEntryMissingItem!]
3721
+ }
3722
+
3723
+ type StoreOrderFormCartItem {
3724
+ id: String!
3725
+ name: String!
3726
+ price: Int!
3727
+ listPrice: Int!
3728
+ quantity: Int!
3729
+ imageUrl: String
3730
+ availability: String!
3731
+ seller: String!
3732
+ unitMultiplier: Float
3733
+ }
3734
+ `, Zr = `"""
3508
3735
  Organization.
3509
3736
  """
3510
3737
  type StoreOrganization {
@@ -3523,7 +3750,7 @@ input IStoreOrganization {
3523
3750
  """
3524
3751
  identifier: String!
3525
3752
  }
3526
- `, Yr = `"""
3753
+ `, ni = `"""
3527
3754
  Whenever you make a query that allows for pagination, such as \`allProducts\` or \`allCollections\`, you can check \`StorePageInfo\` to learn more about the complete set of items and use it to paginate your queries.
3528
3755
  """
3529
3756
  type StorePageInfo {
@@ -3548,7 +3775,7 @@ type StorePageInfo {
3548
3775
  """
3549
3776
  totalCount: Int!
3550
3777
  }
3551
- `, Jr = `"""
3778
+ `, ei = `"""
3552
3779
  Input type for setting a new password.
3553
3780
  """
3554
3781
  input ISetPassword {
@@ -3591,7 +3818,7 @@ type SetPasswordResponse {
3591
3818
  """
3592
3819
  message: String
3593
3820
  }
3594
- `, Kr = `"""
3821
+ `, ti = `"""
3595
3822
  Client profile data.
3596
3823
  """
3597
3824
  type StorePerson {
@@ -3634,7 +3861,7 @@ input IStorePerson {
3634
3861
  """
3635
3862
  familyName: String!
3636
3863
  }
3637
- `, Qr = `type PickupPointAddress {
3864
+ `, ri = `type PickupPointAddress {
3638
3865
  """
3639
3866
  Address city.
3640
3867
  """
@@ -3713,7 +3940,7 @@ type PickupPoints {
3713
3940
  """
3714
3941
  pickupPointsHash: String
3715
3942
  }
3716
- `, Zr = `"""
3943
+ `, ii = `"""
3717
3944
  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.
3718
3945
  """
3719
3946
  type StoreProduct {
@@ -3862,7 +4089,7 @@ input IStoreProduct {
3862
4089
  """
3863
4090
  additionalProperty: [IStorePropertyValue!]
3864
4091
  }
3865
- `, ni = `"""
4092
+ `, ai = `"""
3866
4093
  Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](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.
3867
4094
  """
3868
4095
  type StoreProductGroup {
@@ -3889,7 +4116,7 @@ type StoreProductGroup {
3889
4116
  """
3890
4117
  skuVariants: SkuVariants
3891
4118
  }
3892
- `, ei = `type Profile {
4119
+ `, oi = `type Profile {
3893
4120
  """
3894
4121
  Collection of user's address
3895
4122
  """
@@ -3950,7 +4177,7 @@ type ProfileAddress {
3950
4177
  """
3951
4178
  geoCoordinate: [Float]
3952
4179
  }
3953
- `, ti = `"""
4180
+ `, si = `"""
3954
4181
  Properties that can be associated with products and products groups.
3955
4182
  """
3956
4183
  type StorePropertyValue {
@@ -3990,7 +4217,7 @@ input IStorePropertyValue {
3990
4217
  """
3991
4218
  valueReference: ObjectOrString!
3992
4219
  }
3993
- `, ri = `"""
4220
+ `, ci = `"""
3994
4221
  Each product edge contains a \`node\`, with product information, and a \`cursor\`, that can be used as a reference for pagination.
3995
4222
  """
3996
4223
  type StoreProductEdge {
@@ -4453,6 +4680,15 @@ type Query {
4453
4680
  geoCoordinates: IStoreGeoCoordinates
4454
4681
  ): PickupPoints
4455
4682
  @cacheControl(scope: "public", sMaxAge: 300, staleWhileRevalidate: 3600)
4683
+ """
4684
+ Returns the status of an Order Entry Service operation by its ID.
4685
+ """
4686
+ orderEntryOperation(operationId: String!): StoreOrderEntryOperationStatus
4687
+ @auth
4688
+ """
4689
+ Returns the items in an orderForm by its ID.
4690
+ """
4691
+ orderFormItems(orderFormId: String!): [StoreOrderFormCartItem!]! @auth
4456
4692
  }
4457
4693
 
4458
4694
  type ValidateUserData {
@@ -4543,7 +4779,7 @@ type StoreAccountProfile {
4543
4779
  email: String
4544
4780
  id: String
4545
4781
  }
4546
- `, ii = `"""
4782
+ `, li = `"""
4547
4783
  Information of a given review rating.
4548
4784
  """
4549
4785
  type StoreReviewRating {
@@ -4570,7 +4806,7 @@ type StoreReview {
4570
4806
  """
4571
4807
  author: StoreAuthor!
4572
4808
  }
4573
- `, ai = `"""
4809
+ `, di = `"""
4574
4810
  Search Engine Optimization (SEO) tags data.
4575
4811
  """
4576
4812
  type StoreSeo {
@@ -4591,7 +4827,7 @@ type StoreSeo {
4591
4827
  """
4592
4828
  canonical: String!
4593
4829
  }
4594
- `, oi = `"""
4830
+ `, ui = `"""
4595
4831
  Currency information.
4596
4832
  """
4597
4833
  type StoreCurrency {
@@ -4866,7 +5102,7 @@ input IStoreSession {
4866
5102
  """
4867
5103
  refreshAfter: String
4868
5104
  }
4869
- `, si = `"""
5105
+ `, pi = `"""
4870
5106
  Shipping Simulation item input.
4871
5107
  """
4872
5108
  input IShippingItem {
@@ -5197,7 +5433,7 @@ type MessageFields {
5197
5433
  """
5198
5434
  skuName: String
5199
5435
  }
5200
- `, ci = `type SkuVariants {
5436
+ `, gi = `type SkuVariants {
5201
5437
  """
5202
5438
  SKU property values for the current SKU.
5203
5439
  """
@@ -5292,7 +5528,7 @@ Example:
5292
5528
  \`\`\`
5293
5529
  """
5294
5530
  scalar FormattedVariants
5295
- `, li = `"""
5531
+ `, mi = `"""
5296
5532
  Status used to indicate a message type. For instance, a shopping cart informative or error message.
5297
5533
  """
5298
5534
  enum StoreStatus {
@@ -5300,7 +5536,7 @@ enum StoreStatus {
5300
5536
  WARNING
5301
5537
  ERROR
5302
5538
  }
5303
- `, di = `scalar JSONObject
5539
+ `, hi = `scalar JSONObject
5304
5540
 
5305
5541
  type UserOrder {
5306
5542
  orderId: String
@@ -6124,48 +6360,49 @@ type UserOrderBudgetAllocationLinkedEntity {
6124
6360
  type: String
6125
6361
  id: String
6126
6362
  }
6127
- `, ui = /* @__PURE__ */ Object.assign({
6128
- "./address.graphql": _r,
6129
- "./advertisement.graphql": Tr,
6130
- "./aggregateOffer.graphql": Er,
6131
- "./aggregateRating.graphql": Nr,
6132
- "./author.graphql": Fr,
6133
- "./brand.graphql": Rr,
6134
- "./breadcrumb.graphql": Lr,
6135
- "./cart.graphql": Br,
6136
- "./collection.graphql": Mr,
6137
- "./deliveryPromisesBadge.graphql": $r,
6138
- "./facet.graphql": zr,
6139
- "./image.graphql": Vr,
6140
- "./mutation.graphql": xr,
6141
- "./newsletter.graphql": qr,
6142
- "./objectOrString.graphql": jr,
6143
- "./offer.graphql": Wr,
6144
- "./order.graphql": Gr,
6145
- "./orderCommercialAuthorizaton.graphql": Hr,
6146
- "./organization.graphql": Xr,
6147
- "./pageInfo.graphql": Yr,
6148
- "./password.graphql": Jr,
6149
- "./person.graphql": Kr,
6150
- "./pickupPoints.graphql": Qr,
6151
- "./product.graphql": Zr,
6152
- "./productGroup.graphql": ni,
6153
- "./profile.graphql": ei,
6154
- "./propertyValue.graphql": ti,
6155
- "./query.graphql": ri,
6156
- "./review.graphql": ii,
6157
- "./seo.graphql": ai,
6158
- "./session.graphql": oi,
6159
- "./shipping.graphql": si,
6160
- "./skuVariants.graphql": ci,
6161
- "./status.graphql": li,
6162
- "./userOrder.graphql": di
6163
- }), pi = Se(
6164
- Object.values(ui).map((n) => ye(n)).reduce(
6363
+ `, fi = /* @__PURE__ */ Object.assign({
6364
+ "./address.graphql": Fr,
6365
+ "./advertisement.graphql": Rr,
6366
+ "./aggregateOffer.graphql": Lr,
6367
+ "./aggregateRating.graphql": Mr,
6368
+ "./author.graphql": Br,
6369
+ "./brand.graphql": $r,
6370
+ "./breadcrumb.graphql": zr,
6371
+ "./cart.graphql": Vr,
6372
+ "./collection.graphql": xr,
6373
+ "./deliveryPromisesBadge.graphql": qr,
6374
+ "./facet.graphql": jr,
6375
+ "./image.graphql": Wr,
6376
+ "./mutation.graphql": Gr,
6377
+ "./newsletter.graphql": Hr,
6378
+ "./objectOrString.graphql": Xr,
6379
+ "./offer.graphql": Yr,
6380
+ "./order.graphql": Jr,
6381
+ "./orderCommercialAuthorizaton.graphql": Kr,
6382
+ "./orderEntry.graphql": Qr,
6383
+ "./organization.graphql": Zr,
6384
+ "./pageInfo.graphql": ni,
6385
+ "./password.graphql": ei,
6386
+ "./person.graphql": ti,
6387
+ "./pickupPoints.graphql": ri,
6388
+ "./product.graphql": ii,
6389
+ "./productGroup.graphql": ai,
6390
+ "./profile.graphql": oi,
6391
+ "./propertyValue.graphql": si,
6392
+ "./query.graphql": ci,
6393
+ "./review.graphql": li,
6394
+ "./seo.graphql": di,
6395
+ "./session.graphql": ui,
6396
+ "./shipping.graphql": pi,
6397
+ "./skuVariants.graphql": gi,
6398
+ "./status.graphql": mi,
6399
+ "./userOrder.graphql": hi
6400
+ }), Si = Se(
6401
+ Object.values(fi).map((n) => ye(n)).reduce(
6165
6402
  (n, e) => Vn([n, e], { sort: !0 })
6166
6403
  )
6167
- ), gi = pi, Ti = async (n) => L.context.with(
6168
- L.propagation.extract(L.context.active(), n.OTEL),
6404
+ ), yi = Si, Li = async (n) => M.context.with(
6405
+ M.propagation.extract(M.context.active(), n.OTEL),
6169
6406
  () => (e) => (e.storage = {
6170
6407
  channel: nn.parse(n.channel),
6171
6408
  flags: n.flags ?? {},
@@ -6173,45 +6410,45 @@ type UserOrderBudgetAllocationLinkedEntity {
6173
6410
  cookies: /* @__PURE__ */ new Map()
6174
6411
  }, e.clients = Ze(n, e), e.loaders = lt(n, e), e.account = n.account, e.OTEL = n.OTEL, e.discoveryConfig = n.discoveryConfig, e)
6175
6412
  );
6176
- function mi() {
6177
- const n = kr(), e = {};
6413
+ function Ii() {
6414
+ const n = Nr(), e = {};
6178
6415
  for (const [t, r] of Object.entries(n))
6179
6416
  e[t] = Object.fromEntries(
6180
- Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, Be(a, `${t}(${i})`)])
6417
+ Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, Me(a, `${t}(${i})`)])
6181
6418
  );
6182
6419
  return e;
6183
6420
  }
6184
- function Ei(n) {
6421
+ function Mi(n) {
6185
6422
  const t = Le([
6186
6423
  Re,
6187
- Ee
6188
- ])(mi(), gi);
6424
+ ke
6425
+ ])(Ii(), yi);
6189
6426
  return n && Ie(n) ? he({
6190
6427
  schemas: [t, n]
6191
6428
  }) : t;
6192
6429
  }
6193
6430
  export {
6194
- Ee as AuthDirective,
6195
- V as BadRequestError,
6431
+ ke as AuthDirective,
6432
+ k as BadRequestError,
6196
6433
  Re as CacheControlDirective,
6197
6434
  be as CommercialAuthorizationStatus,
6198
6435
  X as FastStoreError,
6199
6436
  an as ForbiddenError,
6200
- Ti as GraphqlVtexContextFactory,
6201
- Ei as GraphqlVtexSchema,
6202
- $ as NotFoundError,
6203
- De as StoreCollectionType,
6204
- we as StoreFacetType,
6437
+ Li as GraphqlVtexContextFactory,
6438
+ Mi as GraphqlVtexSchema,
6439
+ z as NotFoundError,
6440
+ we as StoreCollectionType,
6441
+ De as StoreFacetType,
6205
6442
  Ae as StoreSort,
6206
6443
  Pe as StoreStatus,
6207
6444
  J as UnauthorizedError,
6208
- Ue as UserOrderInvoiceType,
6209
- ki as isBadRequestError,
6210
- Ui as isFastStoreError,
6211
- Me as isForbiddenError,
6445
+ Ee as UserOrderInvoiceType,
6446
+ Fi as isBadRequestError,
6447
+ Ni as isFastStoreError,
6448
+ Be as isForbiddenError,
6212
6449
  $e as isNotFoundError,
6213
- _i as isUnauthorizedError,
6214
- Pi as stringifyCacheControl,
6215
- gi as typeDefs,
6450
+ Ri as isUnauthorizedError,
6451
+ ki as stringifyCacheControl,
6452
+ yi as typeDefs,
6216
6453
  Le as withDirectives
6217
6454
  };