@soma-vertical-web/multi-lib 0.0.61 → 0.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index2.mjs CHANGED
@@ -1,106 +1,106 @@
1
- import { jsxs as z, Fragment as H, jsx as I } from "react/jsx-runtime";
2
- import { r as k, o as F, S as oe, q as ie, t as ce, a as le, v as ue, w as de, c as pe, p as me, x as fe, f as ge } from "./index-C3QT-3iu.mjs";
3
- import { Utils as j, helpers as G } from "@soma-vertical-web/core-components";
4
- import * as a from "yup";
5
- import he from "sanitize-html";
6
- const ye = ({
1
+ import { jsxs as k, Fragment as B, jsx as I } from "react/jsx-runtime";
2
+ import { r as j, q as F, S as ce, t as le, v as ue, a as de, w as pe, x as me, c as fe, p as ge, n as L, y as he, f as ye } from "./index-DD12Nl4r.mjs";
3
+ import { Utils as D, helpers as M } from "@soma-vertical-web/core-components";
4
+ import * as s from "yup";
5
+ import Ie from "sanitize-html";
6
+ const be = ({
7
7
  slug: e,
8
8
  data: t,
9
9
  SectionZone: n,
10
10
  COMMON_PAGE_COLUMN_GAP: r,
11
11
  identifyWhoIsFirst: o
12
12
  }) => {
13
- const s = t == null ? void 0 : t.find(
14
- (d) => {
13
+ const a = t == null ? void 0 : t.find(
14
+ (p) => {
15
15
  var h, f, m, R;
16
- return ((f = (h = d.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((R = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === e;
16
+ return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === e;
17
17
  }
18
- ), i = s == null ? void 0 : s.config.responsive.gapCustom, l = s == null ? void 0 : s.config.responsive.gapSections, u = t == null ? void 0 : t.find(
19
- (d) => {
18
+ ), i = a == null ? void 0 : a.config.responsive.gapCustom, l = a == null ? void 0 : a.config.responsive.gapSections, u = t == null ? void 0 : t.find(
19
+ (p) => {
20
20
  var h, f, m, R;
21
- return ((f = (h = d.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((R = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === e;
21
+ return ((f = (h = p.config) == null ? void 0 : h.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((R = (m = p.config) == null ? void 0 : m.seo) == null ? void 0 : R.slug) === e;
22
22
  }
23
- ), p = u == null ? void 0 : u.config.responsive.gapCustom, c = u == null ? void 0 : u.config.responsive.gapSections;
24
- return /* @__PURE__ */ z(H, { children: [
23
+ ), d = u == null ? void 0 : u.config.responsive.gapCustom, c = u == null ? void 0 : u.config.responsive.gapSections;
24
+ return /* @__PURE__ */ k(B, { children: [
25
25
  /* @__PURE__ */ I(
26
- j.Column,
26
+ D.Column,
27
27
  {
28
28
  gap: i && l ? l : r,
29
- className: G.classNameConcat(
30
- k["responsive-desktop-flex"],
29
+ className: M.classNameConcat(
30
+ j["responsive-desktop-flex"],
31
31
  "utils-column-modifier"
32
32
  ),
33
- children: /* @__PURE__ */ I(n, { data: (s == null ? void 0 : s.sections) ?? [], identifyWhoIsFirst: o })
33
+ children: /* @__PURE__ */ I(n, { data: (a == null ? void 0 : a.sections) ?? [], identifyWhoIsFirst: o })
34
34
  }
35
35
  ),
36
36
  /* @__PURE__ */ I(
37
- j.Column,
37
+ D.Column,
38
38
  {
39
- gap: p && c ? c : r,
40
- className: G.classNameConcat(
41
- k["responsive-mobile-flex"],
39
+ gap: d && c ? c : r,
40
+ className: M.classNameConcat(
41
+ j["responsive-mobile-flex"],
42
42
  "utils-column-modifier"
43
43
  ),
44
44
  children: /* @__PURE__ */ I(n, { data: (u == null ? void 0 : u.sections) ?? [], identifyWhoIsFirst: o })
45
45
  }
46
46
  )
47
47
  ] });
48
- }, Ie = async ({
48
+ }, Re = async ({
49
49
  slug: e,
50
50
  SectionZone: t,
51
51
  COMMON_PAGE_COLUMN_GAP: n,
52
52
  identifyWhoIsFirst: r = !1,
53
53
  ...o
54
54
  }) => {
55
- const { data: s } = await F({
55
+ const { data: a } = await F({
56
56
  contentType: "common_page",
57
57
  ...o
58
58
  });
59
59
  return /* @__PURE__ */ I(
60
- ye,
60
+ be,
61
61
  {
62
- data: s,
62
+ data: a,
63
63
  slug: e,
64
64
  SectionZone: t,
65
65
  COMMON_PAGE_COLUMN_GAP: n,
66
66
  identifyWhoIsFirst: r
67
67
  }
68
68
  );
69
- }, be = async ({
69
+ }, Ce = async ({
70
70
  PAYMENT_FLAGS_DICTIONARY: e,
71
71
  PAYMENT_FLAGS: t,
72
72
  LEGAL_INFORMATION_TEXT: n,
73
73
  SectionZone: r,
74
74
  ICONS: o,
75
- Footer: s,
75
+ Footer: a,
76
76
  FooterSupport: i,
77
77
  ...l
78
78
  }) => {
79
- var d, h, f, m, R, T, v, S, E, g, b;
79
+ var p, h, f, m, R, T, v, S, E, g, b;
80
80
  const { data: u } = await F({
81
81
  contentType: "footer",
82
82
  ...l
83
- }), p = Array.isArray(u) && ((d = u[0]) == null ? void 0 : d.type) === "footer" ? u[0] : null, c = {
84
- ...(h = p == null ? void 0 : p.paymentInfo) == null ? void 0 : h.paymentInfo,
83
+ }), d = Array.isArray(u) && ((p = u[0]) == null ? void 0 : p.type) === "footer" ? u[0] : null, c = {
84
+ ...(h = d == null ? void 0 : d.paymentInfo) == null ? void 0 : h.paymentInfo,
85
85
  acceptedFlags: Array.isArray(
86
- (f = p == null ? void 0 : p.paymentInfo) == null ? void 0 : f.paymentInfo.acceptedFlags
87
- ) ? (m = p == null ? void 0 : p.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((C) => !!e[C]).map(
86
+ (f = d == null ? void 0 : d.paymentInfo) == null ? void 0 : f.paymentInfo.acceptedFlags
87
+ ) ? (m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((C) => !!e[C]).map(
88
88
  (C) => e[C]
89
89
  ) : []
90
90
  };
91
- return p ? /* @__PURE__ */ I(
92
- s,
91
+ return d ? /* @__PURE__ */ I(
92
+ a,
93
93
  {
94
- data: { ...p },
95
- socialInfo: (R = p.socialMedia) == null ? void 0 : R.socialMedia,
96
- socialMedias: (v = (T = p.socialMedia) == null ? void 0 : T.socialMedia) == null ? void 0 : v.medias,
94
+ data: { ...d },
95
+ socialInfo: (R = d.socialMedia) == null ? void 0 : R.socialMedia,
96
+ socialMedias: (v = (T = d.socialMedia) == null ? void 0 : T.socialMedia) == null ? void 0 : v.medias,
97
97
  payments: c,
98
98
  adornment: {
99
- ...(E = (S = p.supportInfo) == null ? void 0 : S.supportInfo) != null && E.content ? {
99
+ ...(E = (S = d.supportInfo) == null ? void 0 : S.supportInfo) != null && E.content ? {
100
100
  bottom: /* @__PURE__ */ I(
101
101
  i,
102
102
  {
103
- content: (b = (g = p.supportInfo) == null ? void 0 : g.supportInfo) == null ? void 0 : b.content,
103
+ content: (b = (g = d.supportInfo) == null ? void 0 : g.supportInfo) == null ? void 0 : b.content,
104
104
  CONSTANTS: {
105
105
  ICONS: o,
106
106
  PAYMENT_FLAGS: t,
@@ -109,22 +109,22 @@ const ye = ({
109
109
  }
110
110
  )
111
111
  } : {},
112
- ...p.sections.length ? { top: /* @__PURE__ */ I(r, { data: p.sections }) } : {}
112
+ ...d.sections.length ? { top: /* @__PURE__ */ I(r, { data: d.sections }) } : {}
113
113
  },
114
114
  LEGAL_INFORMATION_TEXT: n,
115
115
  ICONS: o
116
116
  }
117
- ) : /* @__PURE__ */ I(H, {});
118
- }, Re = async ({
117
+ ) : /* @__PURE__ */ I(B, {});
118
+ }, ve = async ({
119
119
  children: e,
120
120
  ClientHeaderProvider: t,
121
121
  ...n
122
122
  }) => {
123
- var s, i, l, u;
123
+ var a, i, l, u;
124
124
  const { data: r } = await F({
125
125
  contentType: "header",
126
126
  ...n
127
- }), o = (s = r[0]) == null ? void 0 : s.sections.map((p) => p.data);
127
+ }), o = (a = r[0]) == null ? void 0 : a.sections.map((d) => d.data);
128
128
  return /* @__PURE__ */ I(
129
129
  t,
130
130
  {
@@ -137,17 +137,17 @@ const ye = ({
137
137
  children: e
138
138
  }
139
139
  );
140
- }, Ce = async ({
140
+ }, Se = async ({
141
141
  children: e,
142
142
  productId: t,
143
143
  COMMON_PAGE_COLUMN_GAP: n,
144
144
  SectionZone: r,
145
145
  PDPContentProvider: o,
146
- ...s
146
+ ...a
147
147
  }) => {
148
148
  const { data: i } = await F({
149
149
  contentType: "product_page",
150
- ...s
150
+ ...a
151
151
  });
152
152
  return /* @__PURE__ */ I(
153
153
  o,
@@ -159,47 +159,47 @@ const ye = ({
159
159
  children: e
160
160
  }
161
161
  );
162
- }, ve = {
162
+ }, Te = {
163
163
  "column-modifier": "_column-modifier_1tqap_1"
164
- }, Se = async ({
164
+ }, Ee = async ({
165
165
  children: e,
166
166
  slug: t,
167
167
  SectionZone: n,
168
168
  COMMON_PAGE_COLUMN_GAP_PDC: r,
169
169
  PLPContentProvider: o,
170
- ...s
170
+ ...a
171
171
  }) => {
172
172
  const { data: i } = await F({
173
173
  contentType: "categories_page",
174
- ...s
174
+ ...a
175
175
  }), l = i.find(
176
- (d) => {
176
+ (p) => {
177
177
  var h, f, m;
178
- return ((h = d.config) == null ? void 0 : h.seo.slug) === t && ((m = (f = d.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
178
+ return ((h = p.config) == null ? void 0 : h.seo.slug) === t && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
179
179
  }
180
180
  ), u = i.find(
181
- (d) => {
181
+ (p) => {
182
182
  var h, f, m;
183
- return ((h = d.config) == null ? void 0 : h.seo.slug) === t && ((m = (f = d.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
183
+ return ((h = p.config) == null ? void 0 : h.seo.slug) === t && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
184
184
  }
185
- ), p = i.find(
186
- (d) => {
185
+ ), d = i.find(
186
+ (p) => {
187
187
  var h, f, m;
188
- return ((h = d.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = d.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
188
+ return ((h = p.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "desktop";
189
189
  }
190
190
  ), c = i.find(
191
- (d) => {
191
+ (p) => {
192
192
  var h, f, m;
193
- return ((h = d.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = d.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
193
+ return ((h = p.config) == null ? void 0 : h.seo.slug) === "default" && ((m = (f = p.config) == null ? void 0 : f.responsive) == null ? void 0 : m.deviceType) === "mobile";
194
194
  }
195
195
  );
196
- return /* @__PURE__ */ z(H, { children: [
196
+ return /* @__PURE__ */ k(B, { children: [
197
197
  /* @__PURE__ */ I(
198
- j.Column,
198
+ D.Column,
199
199
  {
200
- className: G.classNameConcat(
201
- k["responsive-desktop-flex"],
202
- ve["column-modifier"]
200
+ className: M.classNameConcat(
201
+ j["responsive-desktop-flex"],
202
+ Te["column-modifier"]
203
203
  ),
204
204
  style: {
205
205
  minHeight: "100vh"
@@ -207,7 +207,7 @@ const ye = ({
207
207
  children: /* @__PURE__ */ I(
208
208
  o,
209
209
  {
210
- data: l ?? p,
210
+ data: l ?? d,
211
211
  device: "desktop",
212
212
  SectionZone: n,
213
213
  COMMON_PAGE_COLUMN_GAP_PDC: r,
@@ -216,7 +216,7 @@ const ye = ({
216
216
  )
217
217
  }
218
218
  ),
219
- /* @__PURE__ */ I(j.Column, { className: k["responsive-mobile-flex"], children: /* @__PURE__ */ I(
219
+ /* @__PURE__ */ I(D.Column, { className: j["responsive-mobile-flex"], children: /* @__PURE__ */ I(
220
220
  o,
221
221
  {
222
222
  data: u ?? c,
@@ -227,7 +227,7 @@ const ye = ({
227
227
  }
228
228
  ) })
229
229
  ] });
230
- }, Te = async ({ slug: e, ...t }) => {
230
+ }, Fe = async ({ slug: e, ...t }) => {
231
231
  var i, l, u;
232
232
  const { data: n } = await F({
233
233
  contentType: "redirect_to_search",
@@ -239,19 +239,19 @@ const ye = ({
239
239
  query: null,
240
240
  redirect: !1
241
241
  };
242
- const s = r.find(
243
- (p) => {
244
- var c, d;
245
- return ((c = p.path) == null ? void 0 : c.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
242
+ const a = r.find(
243
+ (d) => {
244
+ var c, p;
245
+ return ((c = d.path) == null ? void 0 : c.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((p = d.path) == null ? void 0 : p.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
246
246
  }
247
247
  );
248
- return s ? {
248
+ return a ? {
249
249
  slug: e,
250
- query: s == null ? void 0 : s.searchQuery,
250
+ query: a == null ? void 0 : a.searchQuery,
251
251
  redirect: !0,
252
- collectionId: s == null ? void 0 : s.collectionId,
253
- filters: s == null ? void 0 : s.filters,
254
- sort: s == null ? void 0 : s.sort
252
+ collectionId: a == null ? void 0 : a.collectionId,
253
+ filters: a == null ? void 0 : a.filters,
254
+ sort: a == null ? void 0 : a.sort
255
255
  } : {
256
256
  slug: e,
257
257
  query: null,
@@ -260,7 +260,7 @@ const ye = ({
260
260
  filters: null,
261
261
  sort: null
262
262
  };
263
- }, Ee = async ({ slug: e, ...t }) => {
263
+ }, Oe = async ({ slug: e, ...t }) => {
264
264
  var i, l, u;
265
265
  const { data: n } = await F({
266
266
  contentType: "redirect_to_search",
@@ -268,18 +268,18 @@ const ye = ({
268
268
  }), r = ((u = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : u.paths) ?? [];
269
269
  if (!!!r.length)
270
270
  return null;
271
- const s = r.find(
272
- (p) => {
273
- var c, d;
274
- return ((c = p.path) == null ? void 0 : c.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
271
+ const a = r.find(
272
+ (d) => {
273
+ var c, p;
274
+ return ((c = d.path) == null ? void 0 : c.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((p = d.path) == null ? void 0 : p.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
275
275
  }
276
276
  );
277
- return s ? {
277
+ return a ? {
278
278
  slug: e,
279
- title: s.pageTitle,
280
- description: s.pageDescription
279
+ title: a.pageTitle,
280
+ description: a.pageDescription
281
281
  } : null;
282
- }, Fe = async ({
282
+ }, $e = async ({
283
283
  children: e,
284
284
  SectionZone: t,
285
285
  className: n,
@@ -290,15 +290,15 @@ const ye = ({
290
290
  ...r
291
291
  });
292
292
  return Array.isArray(o) && o.length > 0 ? /* @__PURE__ */ I(
293
- oe,
293
+ ce,
294
294
  {
295
295
  data: o,
296
296
  SectionZone: t,
297
297
  className: n,
298
298
  children: e
299
299
  }
300
- ) : /* @__PURE__ */ I(H, { children: e });
301
- }, Oe = async ({
300
+ ) : /* @__PURE__ */ I(B, { children: e });
301
+ }, qe = async ({
302
302
  ClientTipbarContent: e,
303
303
  ...t
304
304
  }) => {
@@ -307,18 +307,18 @@ const ye = ({
307
307
  ...t
308
308
  });
309
309
  return /* @__PURE__ */ I(e, { data: n });
310
- }, qe = {
311
- CommonPageContent: Ie,
312
- HeaderContent: Re,
313
- TipbarContent: Oe,
314
- FooterContent: be,
315
- PLPContent: Se,
316
- PDPContent: Ce,
317
- getRedirectData: Te,
318
- getPLPSynteticMetaData: Ee,
319
- SearchPageContent: Fe
320
- }, yr = { Components: qe }, y = async (e, t = {}) => {
321
- const { method: n = "GET", body: r, headers: o = {}, priority: s = "auto", cache: i = "default" } = t;
310
+ }, Pe = {
311
+ CommonPageContent: Re,
312
+ HeaderContent: ve,
313
+ TipbarContent: qe,
314
+ FooterContent: Ce,
315
+ PLPContent: Ee,
316
+ PDPContent: Se,
317
+ getRedirectData: Fe,
318
+ getPLPSynteticMetaData: Oe,
319
+ SearchPageContent: $e
320
+ }, br = { Components: Pe }, y = async (e, t = {}) => {
321
+ const { method: n = "GET", body: r, headers: o = {}, priority: a = "auto", cache: i = "default" } = t;
322
322
  return fetch(e, {
323
323
  method: n,
324
324
  headers: {
@@ -326,24 +326,24 @@ const ye = ({
326
326
  Accept: "application/json",
327
327
  "Content-Type": "application/json"
328
328
  },
329
- priority: s,
329
+ priority: a,
330
330
  cache: i,
331
331
  ...r ? { body: JSON.stringify(r) } : {}
332
332
  // not body in get
333
333
  }).then((l) => l.json()).catch((l) => {
334
334
  console.error("[ERROR FETCH VTEX]", l);
335
335
  });
336
- }, w = /* @__PURE__ */ new Map();
337
- async function $e(e, t = {}) {
336
+ }, A = /* @__PURE__ */ new Map();
337
+ async function Ne(e, t = {}) {
338
338
  var n;
339
339
  try {
340
340
  const { abort: r = !1 } = t, o = new AbortController();
341
- r && (w.has(e) && ((n = w.get(e)) == null || n.abort(), w.delete(e)), w.set(e, o));
342
- const s = y(e, {
341
+ r && (A.has(e) && ((n = A.get(e)) == null || n.abort(), A.delete(e)), A.set(e, o));
342
+ const a = y(e, {
343
343
  ...t,
344
344
  ...r ? { signal: o.signal } : {}
345
345
  });
346
- return r && w.delete(e), s;
346
+ return r && A.delete(e), a;
347
347
  } catch (r) {
348
348
  if (r.name === "AbortError") {
349
349
  console.log(`[REQUEST CANCELLED]: ${e}`);
@@ -352,16 +352,16 @@ async function $e(e, t = {}) {
352
352
  throw console.error(`[ERROR API]: ${r.message}`), r;
353
353
  }
354
354
  }
355
- const Pe = a.object({
356
- country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
357
- postalCode: a.string().nullable()
355
+ const Ae = s.object({
356
+ country: s.string().length(3, "Country code must be 3 characters long").required("Country is required"),
357
+ postalCode: s.string().nullable()
358
358
  });
359
- async function Ae({ apiUrl: e, body: t, fetchOptions: n }) {
359
+ async function we({ apiUrl: e, body: t, fetchOptions: n }) {
360
360
  if (!t) {
361
361
  console.error("[ERROR FETCHING] Body is required");
362
362
  return;
363
363
  }
364
- await Pe.validate(t);
364
+ await Ae.validate(t);
365
365
  const { country: r, postalCode: o } = t;
366
366
  return await y(
367
367
  `${e}/api/checkout/pub/postal-code/${r}/${o}`,
@@ -372,12 +372,12 @@ async function Ae({ apiUrl: e, body: t, fetchOptions: n }) {
372
372
  }
373
373
  );
374
374
  }
375
- const we = a.object({
376
- orderFormId: a.string().nullable(),
377
- sellerCode: a.string().nullable(),
378
- sellerName: a.string().nullable()
375
+ const ke = s.object({
376
+ orderFormId: s.string().nullable(),
377
+ sellerCode: s.string().nullable(),
378
+ sellerName: s.string().nullable()
379
379
  });
380
- async function Q({
380
+ async function K({
381
381
  apiUrl: e,
382
382
  body: t,
383
383
  fetchOptions: n
@@ -386,8 +386,8 @@ async function Q({
386
386
  console.error("[ERROR FETCHING] Body is required");
387
387
  return;
388
388
  }
389
- await we.validate(t);
390
- const { orderFormId: r, sellerCode: o, sellerName: s } = t, i = o ? `${o.trim()} - ${s}` : null;
389
+ await ke.validate(t);
390
+ const { orderFormId: r, sellerCode: o, sellerName: a } = t, i = o ? `${o.trim()} - ${a}` : null;
391
391
  return y(
392
392
  `${e}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
393
393
  {
@@ -399,12 +399,12 @@ async function Q({
399
399
  }
400
400
  );
401
401
  }
402
- const Ne = a.object({
403
- orderFormId: a.string().nullable(),
404
- sellerCode: a.string().nullable(),
405
- marketingData: a.object()
402
+ const je = s.object({
403
+ orderFormId: s.string().nullable(),
404
+ sellerCode: s.string().nullable(),
405
+ marketingData: s.object()
406
406
  });
407
- async function K({
407
+ async function J({
408
408
  apiUrl: e,
409
409
  body: t,
410
410
  extraData: n = {},
@@ -414,10 +414,10 @@ async function K({
414
414
  console.error("[ERROR FETCHING] Body is required");
415
415
  return;
416
416
  }
417
- await Ne.validate(t);
418
- const { orderFormId: o, sellerCode: s, marketingData: i } = t, l = s ? {
419
- utmCampaign: s ? s.toUpperCase() : "",
420
- utmiCampaign: s ? `${n.VENDOR_CODE}` : "semcodigo"
417
+ await je.validate(t);
418
+ const { orderFormId: o, sellerCode: a, marketingData: i } = t, l = a ? {
419
+ utmCampaign: a ? a.toUpperCase() : "",
420
+ utmiCampaign: a ? `${n.VENDOR_CODE}` : "semcodigo"
421
421
  } : {};
422
422
  return y(
423
423
  `${e}/api/checkout/pub/orderForm/${o}/attachments/marketingData`,
@@ -431,19 +431,19 @@ async function K({
431
431
  }
432
432
  );
433
433
  }
434
- const ke = a.object({
435
- orderFormId: a.string().nullable(),
436
- sellerCode: a.string().nullable(),
437
- sellerName: a.string().nullable()
434
+ const De = s.object({
435
+ orderFormId: s.string().nullable(),
436
+ sellerCode: s.string().nullable(),
437
+ sellerName: s.string().nullable()
438
438
  });
439
- async function je({ apiUrl: e, body: t, fetchOptions: n }) {
439
+ async function _e({ apiUrl: e, body: t, fetchOptions: n }) {
440
440
  if (!t) {
441
441
  console.error("[ERROR FETCHING] Body is required");
442
442
  return;
443
443
  }
444
- await ke.validate(t);
445
- const r = await Q({ apiUrl: e, body: t, fetchOptions: n });
446
- return K({
444
+ await De.validate(t);
445
+ const r = await K({ apiUrl: e, body: t, fetchOptions: n });
446
+ return J({
447
447
  apiUrl: e,
448
448
  body: {
449
449
  ...t,
@@ -452,11 +452,11 @@ async function je({ apiUrl: e, body: t, fetchOptions: n }) {
452
452
  fetchOptions: n
453
453
  });
454
454
  }
455
- const De = a.object({
456
- orderFormId: a.string().nullable(),
457
- coupon: a.string().nullable()
455
+ const He = s.object({
456
+ orderFormId: s.string().nullable(),
457
+ coupon: s.string().nullable()
458
458
  });
459
- async function _e({
459
+ async function Be({
460
460
  apiUrl: e,
461
461
  body: t,
462
462
  fetchOptions: n
@@ -465,7 +465,7 @@ async function _e({
465
465
  console.error("[ERROR FETCHING] Body is required");
466
466
  return;
467
467
  }
468
- await De.validate(t);
468
+ await He.validate(t);
469
469
  const { coupon: r = "", orderFormId: o } = t;
470
470
  return y(
471
471
  `${e}/api/checkout/pub/orderForm/${o}/coupons`,
@@ -476,12 +476,12 @@ async function _e({
476
476
  }
477
477
  );
478
478
  }
479
- const He = a.object({
480
- appId: a.string().required("App ID is required"),
481
- orderFormId: a.string().nullable(),
482
- key: a.array().of(a.string())
479
+ const Ge = s.object({
480
+ appId: s.string().required("App ID is required"),
481
+ orderFormId: s.string().nullable(),
482
+ key: s.array().of(s.string())
483
483
  });
484
- async function Be({
484
+ async function Le({
485
485
  apiUrl: e,
486
486
  body: t,
487
487
  fetchOptions: n
@@ -490,33 +490,33 @@ async function Be({
490
490
  console.error("[ERROR FETCHING] Body is required");
491
491
  return;
492
492
  }
493
- await He.validate(t);
494
- const { appId: r = "faststore", orderFormId: o, key: s } = t;
493
+ await Ge.validate(t);
494
+ const { appId: r = "faststore", orderFormId: o, key: a } = t;
495
495
  return y(
496
- `${e}/api/checkout/pub/orderForm/${o}/customData/${r}/${s}`,
496
+ `${e}/api/checkout/pub/orderForm/${o}/customData/${r}/${a}`,
497
497
  {
498
498
  method: "PUT",
499
499
  ...n
500
500
  }
501
501
  );
502
502
  }
503
- const Ge = a.object().shape({
504
- name: a.string().required("Attachment name is required"),
505
- content: a.object().nullable()
503
+ const Me = s.object().shape({
504
+ name: s.string().required("Attachment name is required"),
505
+ content: s.object().nullable()
506
506
  });
507
- var V;
508
- const Le = a.object().shape({
509
- attachments: (V = a.array().of(Ge)) == null ? void 0 : V.nullable(),
510
- id: a.string().required("ID of SKU is required"),
511
- index: a.number().integer().nullable(),
512
- quantity: a.number().integer().nullable(),
513
- seller: a.string().required("Seller is required"),
514
- price: a.number().integer()
515
- }), Me = a.object({
516
- orderFormId: a.string().required("OrderFormId is required"),
517
- orderItems: a.array().of(Le)
507
+ var z;
508
+ const Ue = s.object().shape({
509
+ attachments: (z = s.array().of(Me)) == null ? void 0 : z.nullable(),
510
+ id: s.string().required("ID of SKU is required"),
511
+ index: s.number().integer().nullable(),
512
+ quantity: s.number().integer().nullable(),
513
+ seller: s.string().required("Seller is required"),
514
+ price: s.number().integer()
515
+ }), Ve = s.object({
516
+ orderFormId: s.string().required("OrderFormId is required"),
517
+ orderItems: s.array().of(Ue)
518
518
  });
519
- async function Ue({
519
+ async function xe({
520
520
  apiUrl: e,
521
521
  body: t,
522
522
  fetchOptions: n
@@ -525,7 +525,7 @@ async function Ue({
525
525
  console.error("[ERROR FETCHING] Body is required");
526
526
  return;
527
527
  }
528
- await Me.validate(t);
528
+ await Ve.validate(t);
529
529
  const { orderFormId: r, orderItems: o } = t;
530
530
  return y(
531
531
  `${e}/api/checkout/pub/orderForm/${r}/items`,
@@ -536,10 +536,10 @@ async function Ue({
536
536
  }
537
537
  );
538
538
  }
539
- const Ve = a.object({
540
- orderFormId: a.string().nullable()
539
+ const ze = s.object({
540
+ orderFormId: s.string().nullable()
541
541
  });
542
- async function xe({
542
+ async function Qe({
543
543
  apiUrl: e,
544
544
  body: t,
545
545
  fetchOptions: n
@@ -548,7 +548,7 @@ async function xe({
548
548
  console.error("[ERROR FETCHING] Body is required");
549
549
  return;
550
550
  }
551
- await Ve.validate(t);
551
+ await ze.validate(t);
552
552
  const { orderFormId: r } = t;
553
553
  return y(
554
554
  `${e}/api/checkout/pub/orderForm/${r}/items/removeAll`,
@@ -558,23 +558,23 @@ async function xe({
558
558
  }
559
559
  );
560
560
  }
561
- const ze = a.object().shape({
562
- name: a.string().required("Attachment name is required"),
563
- content: a.object().nullable()
561
+ const Ke = s.object().shape({
562
+ name: s.string().required("Attachment name is required"),
563
+ content: s.object().nullable()
564
564
  });
565
- var x;
566
- const Qe = a.object().shape({
567
- attachments: (x = a.array().of(ze)) == null ? void 0 : x.nullable(),
568
- id: a.string().required("ID of SKU is required"),
569
- index: a.number().integer().nullable(),
570
- quantity: a.number().integer().nullable(),
571
- seller: a.string().required("Seller is required"),
572
- price: a.number().integer()
573
- }), Ke = a.object({
574
- orderFormId: a.string().nullable(),
575
- orderItems: a.array().of(Qe)
565
+ var Q;
566
+ const Je = s.object().shape({
567
+ attachments: (Q = s.array().of(Ke)) == null ? void 0 : Q.nullable(),
568
+ id: s.string().required("ID of SKU is required"),
569
+ index: s.number().integer().nullable(),
570
+ quantity: s.number().integer().nullable(),
571
+ seller: s.string().required("Seller is required"),
572
+ price: s.number().integer()
573
+ }), Ye = s.object({
574
+ orderFormId: s.string().nullable(),
575
+ orderItems: s.array().of(Je)
576
576
  });
577
- async function Je({
577
+ async function We({
578
578
  apiUrl: e,
579
579
  body: t,
580
580
  fetchOptions: n
@@ -583,7 +583,7 @@ async function Je({
583
583
  console.error("[ERROR FETCHING] Body is required");
584
584
  return;
585
585
  }
586
- await Ke.validate(t);
586
+ await Ye.validate(t);
587
587
  const { orderFormId: r, orderItems: o } = t;
588
588
  return y(
589
589
  `${e}/api/checkout/pub/orderForm/${r}/items/update`,
@@ -594,10 +594,10 @@ async function Je({
594
594
  }
595
595
  );
596
596
  }
597
- const Ye = a.object({
598
- orderFormId: a.string().nullable()
597
+ const Xe = s.object({
598
+ orderFormId: s.string().nullable()
599
599
  });
600
- async function We({
600
+ async function Ze({
601
601
  apiUrl: e,
602
602
  body: t,
603
603
  fetchOptions: n
@@ -606,7 +606,7 @@ async function We({
606
606
  console.error("[ERROR FETCHING] Body is required");
607
607
  return;
608
608
  }
609
- await Ye.validate(t);
609
+ await Xe.validate(t);
610
610
  const { orderFormId: r } = t;
611
611
  return y(
612
612
  `${e}/api/checkout/pub/orderForm/${r}/messages/clear`,
@@ -616,30 +616,30 @@ async function We({
616
616
  }
617
617
  );
618
618
  }
619
- const Xe = a.object({
620
- id: a.string().nullable(),
619
+ const et = s.object({
620
+ id: s.string().nullable(),
621
621
  // id offering
622
- itemIndex: a.number().nullable(),
623
- orderFormId: a.string().nullable(),
624
- remove: a.boolean().nullable()
622
+ itemIndex: s.number().nullable(),
623
+ orderFormId: s.string().nullable(),
624
+ remove: s.boolean().nullable()
625
625
  });
626
- async function Ze({ apiUrl: e, body: t, fetchOptions: n }) {
626
+ async function tt({ apiUrl: e, body: t, fetchOptions: n }) {
627
627
  if (!t) {
628
628
  console.error("[ERROR FETCHING] Body is required");
629
629
  return;
630
630
  }
631
- await Xe.validate(t);
632
- const { itemIndex: r, orderFormId: o, id: s, remove: i } = t, l = i ? `/${s}/remove` : "", u = `${e}/api/checkout/pub/orderForm/${o}/items/${r}/offerings${l}`;
631
+ await et.validate(t);
632
+ const { itemIndex: r, orderFormId: o, id: a, remove: i } = t, l = i ? `/${a}/remove` : "", u = `${e}/api/checkout/pub/orderForm/${o}/items/${r}/offerings${l}`;
633
633
  return y(u, {
634
634
  method: "POST",
635
- body: { id: s },
635
+ body: { id: a },
636
636
  ...n
637
637
  });
638
638
  }
639
- const et = a.object({
640
- orderFormId: a.string().nullable()
639
+ const rt = s.object({
640
+ orderFormId: s.string().nullable()
641
641
  });
642
- async function tt({
642
+ async function nt({
643
643
  apiUrl: e,
644
644
  body: t,
645
645
  fetchOptions: n,
@@ -650,22 +650,22 @@ async function tt({
650
650
  console.error("[ERROR FETCHING] Body is required");
651
651
  return;
652
652
  }
653
- await et.validate(t);
653
+ await rt.validate(t);
654
654
  const o = new URLSearchParams({
655
655
  refreshOutdatedData: "true"
656
- }), s = t.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(o)}` : `${e}/api/checkout/pub/orderForm`;
657
- return y(s, { method: "GET", ...n });
656
+ }), a = t.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(o)}` : `${e}/api/checkout/pub/orderForm`;
657
+ return y(a, { method: "GET", ...n });
658
658
  }
659
- const rt = a.object({
660
- orderFormId: a.string().nullable(),
661
- email: a.string().email().required(),
662
- firstName: a.string().required(),
663
- lastName: a.string().required(),
664
- documentType: a.string().required(),
665
- document: a.string().required(),
666
- phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
659
+ const st = s.object({
660
+ orderFormId: s.string().nullable(),
661
+ email: s.string().email().required(),
662
+ firstName: s.string().required(),
663
+ lastName: s.string().required(),
664
+ documentType: s.string().required(),
665
+ document: s.string().required(),
666
+ phone: s.string().matches(/^\+\d{1,3}\d{10,11}$/)
667
667
  });
668
- async function nt({
668
+ async function at({
669
669
  apiUrl: e,
670
670
  body: t,
671
671
  fetchOptions: n
@@ -674,7 +674,7 @@ async function nt({
674
674
  console.error("[ERROR FETCHING] Body is required");
675
675
  return;
676
676
  }
677
- await rt.validate(t);
677
+ await st.validate(t);
678
678
  const { orderFormId: r, ...o } = t;
679
679
  return y(
680
680
  `${e}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
@@ -685,10 +685,10 @@ async function nt({
685
685
  }
686
686
  );
687
687
  }
688
- const at = a.object({
689
- sellerCode: a.string().nullable()
688
+ const ot = s.object({
689
+ sellerCode: s.string().nullable()
690
690
  });
691
- async function st({
691
+ async function it({
692
692
  apiUrl: e,
693
693
  body: t,
694
694
  extraData: n,
@@ -698,7 +698,7 @@ async function st({
698
698
  console.error("[ERROR FETCHING] Body is required");
699
699
  return;
700
700
  }
701
- await at.validate(t);
701
+ await ot.validate(t);
702
702
  const { sellerCode: o = "" } = t;
703
703
  return y(
704
704
  `${e}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${o}`,
@@ -711,12 +711,12 @@ async function st({
711
711
  }
712
712
  );
713
713
  }
714
- const ot = a.object().shape({
715
- country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
716
- orderFormId: a.string().nullable(),
717
- postalCode: a.string().nullable()
714
+ const ct = s.object().shape({
715
+ country: s.string().length(3, "Country code must be 3 characters long").required("Country is required"),
716
+ orderFormId: s.string().nullable(),
717
+ postalCode: s.string().nullable()
718
718
  });
719
- async function it({
719
+ async function lt({
720
720
  apiUrl: e,
721
721
  body: t,
722
722
  fetchOptions: n
@@ -725,11 +725,11 @@ async function it({
725
725
  console.error("[ERROR FETCHING] Body is required");
726
726
  return;
727
727
  }
728
- await ot.validate(t);
729
- const { country: r, orderFormId: o, postalCode: s } = t, i = s ? {
728
+ await ct.validate(t);
729
+ const { country: r, orderFormId: o, postalCode: a } = t, i = a ? {
730
730
  address: {
731
731
  addressType: "residential",
732
- postalCode: s,
732
+ postalCode: a,
733
733
  country: r
734
734
  }
735
735
  } : {
@@ -745,47 +745,47 @@ async function it({
745
745
  }
746
746
  );
747
747
  }
748
- const ct = a.object().shape({
749
- orderFormId: a.string().nullable(),
750
- options: a.array().of(
751
- a.object().shape({
752
- itemIndex: a.number(),
753
- selectedDeliveryChannel: a.string(),
754
- selectedSla: a.string()
748
+ const ut = s.object().shape({
749
+ orderFormId: s.string().nullable(),
750
+ options: s.array().of(
751
+ s.object().shape({
752
+ itemIndex: s.number(),
753
+ selectedDeliveryChannel: s.string(),
754
+ selectedSla: s.string()
755
755
  })
756
756
  ),
757
- selectedAddresses: a.array().of(
758
- a.object().shape({
759
- addressId: a.string().required(),
760
- addressType: a.string().required(),
761
- city: a.string().nullable(),
762
- complement: a.string().nullable(),
763
- country: a.string().required().length(3),
764
- geoCoordinates: a.array().of(a.number()).required().min(0),
765
- isDisposable: a.boolean().required(),
766
- neighborhood: a.string().nullable(),
767
- number: a.string().nullable(),
768
- postalCode: a.string().required(),
769
- receiverName: a.string().nullable(),
770
- reference: a.string().nullable(),
771
- state: a.string().nullable(),
772
- street: a.string().nullable()
757
+ selectedAddresses: s.array().of(
758
+ s.object().shape({
759
+ addressId: s.string().required(),
760
+ addressType: s.string().required(),
761
+ city: s.string().nullable(),
762
+ complement: s.string().nullable(),
763
+ country: s.string().required().length(3),
764
+ geoCoordinates: s.array().of(s.number()).required().min(0),
765
+ isDisposable: s.boolean().required(),
766
+ neighborhood: s.string().nullable(),
767
+ number: s.string().nullable(),
768
+ postalCode: s.string().required(),
769
+ receiverName: s.string().nullable(),
770
+ reference: s.string().nullable(),
771
+ state: s.string().nullable(),
772
+ street: s.string().nullable()
773
773
  })
774
774
  )
775
775
  });
776
- async function lt({ apiUrl: e, body: t, fetchOptions: n }) {
776
+ async function dt({ apiUrl: e, body: t, fetchOptions: n }) {
777
777
  if (!t) {
778
778
  console.error("[ERROR FETCHING] Body is required");
779
779
  return;
780
780
  }
781
- await ct.validate(t);
782
- const { orderFormId: r, options: o, selectedAddresses: s } = t;
781
+ await ut.validate(t);
782
+ const { orderFormId: r, options: o, selectedAddresses: a } = t;
783
783
  return y(
784
784
  `${e}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
785
785
  {
786
786
  method: "POST",
787
787
  body: {
788
- selectedAddresses: s,
788
+ selectedAddresses: a,
789
789
  clearAddressIfPostalCodeNotFound: !1,
790
790
  logisticsInfo: o
791
791
  },
@@ -793,22 +793,22 @@ async function lt({ apiUrl: e, body: t, fetchOptions: n }) {
793
793
  }
794
794
  );
795
795
  }
796
- const ut = a.object({
797
- country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
798
- postalCode: a.string().nullable(),
799
- geoCoordinates: a.object().shape({
800
- longitude: a.number().required(),
801
- latitude: a.number().required()
796
+ const pt = s.object({
797
+ country: s.string().length(3, "Country code must be 3 characters long").required("Country is required"),
798
+ postalCode: s.string().nullable(),
799
+ geoCoordinates: s.object().shape({
800
+ longitude: s.number().required(),
801
+ latitude: s.number().required()
802
802
  })
803
803
  });
804
- async function dt({ apiUrl: e, body: t, fetchOptions: n }) {
804
+ async function mt({ apiUrl: e, body: t, fetchOptions: n }) {
805
805
  if (!t) {
806
806
  console.error("[ERROR FETCHING] Body is required");
807
807
  return;
808
808
  }
809
- await ut.validate(t);
810
- const { country: r = "", geoCoordinates: o, postalCode: s = "" } = t, i = new URLSearchParams({ country: String(r) });
811
- return s ? i.append("postalCode", s) : i.append(
809
+ await pt.validate(t);
810
+ const { country: r = "", geoCoordinates: o, postalCode: a = "" } = t, i = new URLSearchParams({ country: String(r) });
811
+ return a ? i.append("postalCode", a) : i.append(
812
812
  "geoCoordinates",
813
813
  `${o == null ? void 0 : o.longitude};${o == null ? void 0 : o.latitude}`
814
814
  ), await y(
@@ -819,22 +819,22 @@ async function dt({ apiUrl: e, body: t, fetchOptions: n }) {
819
819
  }
820
820
  );
821
821
  }
822
- const pt = a.object({
823
- id: a.string().required("ID of SKU is required"),
824
- quantity: a.number().integer().required("Quantity of item is required"),
825
- seller: a.string()
826
- }), mt = a.object({
827
- items: a.array().of(pt),
828
- country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
829
- postalCode: a.string().nullable(),
830
- geoCoordinates: a.array().nullable().of(a.number()).length(2)
822
+ const ft = s.object({
823
+ id: s.string().required("ID of SKU is required"),
824
+ quantity: s.number().integer().required("Quantity of item is required"),
825
+ seller: s.string()
826
+ }), gt = s.object({
827
+ items: s.array().of(ft),
828
+ country: s.string().length(3, "Country code must be 3 characters long").required("Country is required"),
829
+ postalCode: s.string().nullable(),
830
+ geoCoordinates: s.array().nullable().of(s.number()).length(2)
831
831
  });
832
- async function ft({ apiUrl: e, body: t, fetchOptions: n }) {
832
+ async function ht({ apiUrl: e, body: t, fetchOptions: n }) {
833
833
  if (!t) {
834
834
  console.error("[ERROR FETCHING] Body is required");
835
835
  return;
836
836
  }
837
- return await mt.validate(t), y(
837
+ return await gt.validate(t), y(
838
838
  `${e}/api/checkout/pub/orderForms/simulation`,
839
839
  {
840
840
  method: "POST",
@@ -843,35 +843,35 @@ async function ft({ apiUrl: e, body: t, fetchOptions: n }) {
843
843
  }
844
844
  );
845
845
  }
846
- const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
846
+ const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
847
847
  __proto__: null,
848
- getMasterDataSellerCode: st,
849
- getOrderForm: tt,
850
- postOrderFormAddCoupon: _e,
851
- postOrderFormAttachClientProfileData: nt,
852
- postOrderFormAttachOrderFormData: je,
853
- postOrderFormAttachShippingData: it,
854
- postOrderFormAttachmentsMarketingData: K,
855
- postOrderFormAttachmentsOpenTextField: Q,
856
- postOrderFormClearMessages: We,
857
- postOrderFormFreightSimulation: ft,
858
- postOrderFormItems: Ue,
859
- postOrderFormRegion: dt,
860
- postOrderFormRemoveAllItems: xe,
861
- postOrderFormUpdateItems: Je,
862
- postOrderFormUpdateShippingData: lt,
863
- postOrderformAddress: Ae,
864
- putOrderFormCustomData: Be,
865
- updateOrderFormOffering: Ze
866
- }, Symbol.toStringTag, { value: "Module" })), ht = a.object({
867
- skuId: a.string()
848
+ getMasterDataSellerCode: it,
849
+ getOrderForm: nt,
850
+ postOrderFormAddCoupon: Be,
851
+ postOrderFormAttachClientProfileData: at,
852
+ postOrderFormAttachOrderFormData: _e,
853
+ postOrderFormAttachShippingData: lt,
854
+ postOrderFormAttachmentsMarketingData: J,
855
+ postOrderFormAttachmentsOpenTextField: K,
856
+ postOrderFormClearMessages: Ze,
857
+ postOrderFormFreightSimulation: ht,
858
+ postOrderFormItems: xe,
859
+ postOrderFormRegion: mt,
860
+ postOrderFormRemoveAllItems: Qe,
861
+ postOrderFormUpdateItems: We,
862
+ postOrderFormUpdateShippingData: dt,
863
+ postOrderformAddress: we,
864
+ putOrderFormCustomData: Le,
865
+ updateOrderFormOffering: tt
866
+ }, Symbol.toStringTag, { value: "Module" })), It = s.object({
867
+ skuId: s.string()
868
868
  });
869
- async function yt({ apiUrl: e, body: t, fetchOptions: n }) {
869
+ async function bt({ apiUrl: e, body: t, fetchOptions: n }) {
870
870
  if (!t) {
871
871
  console.error("[ERROR FETCHING] Body is required");
872
872
  return;
873
873
  }
874
- await ht.validate(t);
874
+ await It.validate(t);
875
875
  const { skuId: r } = t;
876
876
  return y(
877
877
  `${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
@@ -880,15 +880,15 @@ async function yt({ apiUrl: e, body: t, fetchOptions: n }) {
880
880
  }
881
881
  );
882
882
  }
883
- const It = a.object({
884
- ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
883
+ const Rt = s.object({
884
+ ids: s.array().of(s.string().required("ID are required")).required("IDs are required")
885
885
  });
886
- async function bt({ apiUrl: e, body: t, fetchOptions: n }) {
886
+ async function Ct({ apiUrl: e, body: t, fetchOptions: n }) {
887
887
  if (!t) {
888
888
  console.error("[ERROR FETCHING] Body is required");
889
889
  return;
890
890
  }
891
- await It.validate(t);
891
+ await Rt.validate(t);
892
892
  const { ids: r } = t;
893
893
  return y(
894
894
  `${e}/api/catalog_system/pub/products/search?fq=${r.map((o) => `productId:${o}`).join("&fq=")}`,
@@ -897,15 +897,15 @@ async function bt({ apiUrl: e, body: t, fetchOptions: n }) {
897
897
  }
898
898
  );
899
899
  }
900
- const Rt = a.object({
901
- productId: a.number().required("Product ID is required")
900
+ const vt = s.object({
901
+ productId: s.number().required("Product ID is required")
902
902
  });
903
- async function Ct({ apiUrl: e, body: t, fetchOptions: n }) {
903
+ async function St({ apiUrl: e, body: t, fetchOptions: n }) {
904
904
  if (!t) {
905
905
  console.error("[ERROR FETCHING] Body is required");
906
906
  return;
907
907
  }
908
- await Rt.validate(t);
908
+ await vt.validate(t);
909
909
  const { productId: r } = t;
910
910
  return y(
911
911
  `${e}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
@@ -914,20 +914,20 @@ async function Ct({ apiUrl: e, body: t, fetchOptions: n }) {
914
914
  }
915
915
  );
916
916
  }
917
- const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
917
+ const Tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
918
918
  __proto__: null,
919
- getCatalogKitProducts: yt,
920
- getCatalogProducts: bt,
921
- getCatalogSimilars: Ct
922
- }, Symbol.toStringTag, { value: "Module" })), St = a.object({
923
- query: a.string()
919
+ getCatalogKitProducts: bt,
920
+ getCatalogProducts: Ct,
921
+ getCatalogSimilars: St
922
+ }, Symbol.toStringTag, { value: "Module" })), Et = s.object({
923
+ query: s.string()
924
924
  });
925
- async function Tt({ apiUrl: e, body: t, fetchOptions: n }) {
925
+ async function Ft({ apiUrl: e, body: t, fetchOptions: n }) {
926
926
  if (!t) {
927
927
  console.error("[ERROR FETCHING] Body is required");
928
928
  return;
929
929
  }
930
- await St.validate(t);
930
+ await Et.validate(t);
931
931
  const { query: r = "" } = t, o = new URLSearchParams({ query: r });
932
932
  return y(
933
933
  `${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${o.toString()}`,
@@ -936,10 +936,10 @@ async function Tt({ apiUrl: e, body: t, fetchOptions: n }) {
936
936
  }
937
937
  );
938
938
  }
939
- const Et = (e, t) => he(e, t), Ft = (e) => ({
939
+ const Ot = (e, t) => Ie(e, t), $t = (e) => ({
940
940
  ...e,
941
- description: e.description ? Et(e.description) : e.description
942
- }), Ot = ({
941
+ description: e.description ? Ot(e.description) : e.description
942
+ }), qt = ({
943
943
  offer: e,
944
944
  seller: t,
945
945
  product: n
@@ -947,74 +947,74 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
947
947
  ...e,
948
948
  product: n,
949
949
  seller: t
950
- }), J = (e, t) => ({
950
+ }), Y = (e, t) => ({
951
951
  ...e,
952
- isVariantOf: Ft(t)
953
- }), qt = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", N = (e) => e.AvailableQuantity > 0, L = (e) => e.spotPrice ?? 0, $t = (e) => e.Price ?? 0, Y = (e, t) => N(e) && !N(t) ? -1 : !N(e) && N(t) ? 1 : L(e) - L(t), Pt = (e, t) => {
952
+ isVariantOf: $t(t)
953
+ }), Pt = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", w = (e) => e.AvailableQuantity > 0, U = (e) => e.spotPrice ?? 0, Nt = (e) => e.Price ?? 0, W = (e, t) => w(e) && !w(t) ? -1 : !w(e) && w(t) ? 1 : U(e) - U(t), At = (e, t) => {
954
954
  let n = 0;
955
955
  for (let r = 1; r < e.length; r++)
956
956
  t(e[n], e[r]) > 0 && (n = r);
957
957
  return e[n];
958
- }, W = (e) => {
958
+ }, X = (e) => {
959
959
  const t = e.flatMap(
960
960
  (r) => r.sellers.map((o) => ({
961
961
  offer: o.commertialOffer,
962
962
  sku: r
963
963
  }))
964
- ), n = Pt(
964
+ ), n = At(
965
965
  t,
966
- ({ offer: r }, { offer: o }) => Y(r, o)
966
+ ({ offer: r }, { offer: o }) => W(r, o)
967
967
  );
968
968
  return n ? n.sku : e[0];
969
- }, X = (e) => e.map(
969
+ }, Z = (e) => e.map(
970
970
  ({ imageUrl: t, imageText: n, imageLabel: r }) => ({
971
971
  alternateName: n ?? "",
972
972
  url: t.replace("vteximg.com.br", "vtexassets.com"),
973
973
  keywords: r
974
974
  })
975
- ), D = {
975
+ ), _ = {
976
976
  attachment: "ATTACHMENT",
977
977
  specification: "SPECIFICATION",
978
978
  attribute: "ATTRIBUTE"
979
- }, At = (e) => ({
979
+ }, wt = (e) => ({
980
980
  name: e.name,
981
981
  value: e.content,
982
- valueReference: D.attachment
983
- }), wt = (e) => ({
982
+ valueReference: _.attachment
983
+ }), kt = (e) => ({
984
984
  propertyID: e.id,
985
985
  name: e.name,
986
986
  value: e.value,
987
987
  valueReference: {
988
- valueReference: D.attribute,
988
+ valueReference: _.attribute,
989
989
  visible: e.visible
990
990
  }
991
- }), _ = (e, t, n) => {
991
+ }), H = (e, t, n) => {
992
992
  const r = e.flatMap(({ name: i, values: l }) => l ? l.map((u) => ({
993
993
  name: i,
994
994
  value: u,
995
- valueReference: D.specification
995
+ valueReference: _.specification
996
996
  })) : {
997
997
  name: i,
998
998
  value: "",
999
- valueReference: D.specification
1000
- }), o = Array.isArray(n) ? n.map(At) : [], s = t ? t.map(wt) : [];
999
+ valueReference: _.specification
1000
+ }), o = Array.isArray(n) ? n.map(wt) : [], a = t ? t.map(kt) : [];
1001
1001
  return [
1002
1002
  ...r,
1003
1003
  ...o,
1004
- ...s
1004
+ ...a
1005
1005
  ];
1006
- }, M = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Nt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", kt = (e) => {
1006
+ }, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", jt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Dt = (e) => {
1007
1007
  let t = e.slice(0);
1008
- for (let n = 0; n < M.length; n++)
1008
+ for (let n = 0; n < V.length; n++)
1009
1009
  t = t.replace(
1010
- new RegExp(M.charAt(n), "g"),
1011
- Nt.charAt(n)
1010
+ new RegExp(V.charAt(n), "g"),
1011
+ jt.charAt(n)
1012
1012
  );
1013
1013
  return t;
1014
- }, jt = (e) => e.replace(/[·/_,:]/, "-"), Z = (e) => {
1014
+ }, _t = (e) => e.replace(/[·/_,:]/, "-"), ee = (e) => {
1015
1015
  const n = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1016
- return jt(kt(n)).toLowerCase();
1017
- }, ee = (e) => `/${e}/p`, te = (e) => {
1016
+ return _t(Dt(n)).toLowerCase();
1017
+ }, te = (e) => `/${e}/p`, re = (e) => {
1018
1018
  const t = Math.max(
1019
1019
  ...e.map((r) => r.NumberOfInstallments)
1020
1020
  ), n = e.find(
@@ -1024,28 +1024,28 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1024
1024
  count: (n == null ? void 0 : n.NumberOfInstallments) ?? 0,
1025
1025
  value: (n == null ? void 0 : n.Value) ?? 0
1026
1026
  };
1027
- }, re = (e, t) => {
1027
+ }, ne = (e, t) => {
1028
1028
  const n = {
1029
1029
  price: 0,
1030
1030
  listPrice: 0,
1031
1031
  sellerDefault: !1
1032
1032
  }, o = e.map(
1033
- (s) => Ot({
1034
- offer: s.commertialOffer,
1035
- seller: s,
1033
+ (a) => qt({
1034
+ offer: a.commertialOffer,
1035
+ seller: a,
1036
1036
  product: t
1037
1037
  })
1038
- ).sort(Y).map((s) => (s.seller.sellerId === "1" && s.AvailableQuantity > 0 && (n.price = s.Price, n.listPrice = s.ListPrice, n.sellerDefault = !0), {
1039
- availability: s.AvailableQuantity > 0,
1040
- listPrice: s.ListPrice,
1041
- price: $t(s),
1042
- priceValidUntil: s.PriceValidUntil,
1038
+ ).sort(W).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (n.price = a.Price, n.listPrice = a.ListPrice, n.sellerDefault = !0), {
1039
+ availability: a.AvailableQuantity > 0,
1040
+ listPrice: a.ListPrice,
1041
+ price: Nt(a),
1042
+ priceValidUntil: a.PriceValidUntil,
1043
1043
  priceCurrency: "BRL",
1044
- installments: s.Installments,
1045
- lowPrice: s.spotPrice,
1046
- quantity: s.AvailableQuantity,
1044
+ installments: a.Installments,
1045
+ lowPrice: a.spotPrice,
1046
+ quantity: a.AvailableQuantity,
1047
1047
  seller: {
1048
- identifier: s.seller.sellerId
1048
+ identifier: a.seller.sellerId
1049
1049
  }
1050
1050
  }));
1051
1051
  return {
@@ -1053,14 +1053,14 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1053
1053
  highPrice: n.sellerDefault ? n.listPrice : o[0].listPrice,
1054
1054
  offers: o
1055
1055
  };
1056
- }, ne = (e) => {
1057
- const { attributes: t, itemId: n, name: r, sellers: o, variations: s } = e;
1056
+ }, se = (e) => {
1057
+ const { attributes: t, itemId: n, name: r, sellers: o, variations: a } = e;
1058
1058
  return {
1059
- additionalProperty: _(s, t, []),
1059
+ additionalProperty: H(a, t, []),
1060
1060
  name: r,
1061
1061
  offers: {
1062
1062
  offers: o.map(({ sellerId: i, commertialOffer: l }) => ({
1063
- availability: qt(l.AvailableQuantity > 0),
1063
+ availability: Pt(l.AvailableQuantity > 0),
1064
1064
  listPrice: l.ListPrice,
1065
1065
  price: l.Price,
1066
1066
  quantity: l.AvailableQuantity,
@@ -1072,21 +1072,21 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1072
1072
  sku: n
1073
1073
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1074
1074
  };
1075
- }, Dt = (e) => {
1075
+ }, Ht = (e) => {
1076
1076
  var O;
1077
1077
  const {
1078
1078
  attributes: t,
1079
1079
  referenceId: n,
1080
1080
  isVariantOf: r,
1081
1081
  images: o,
1082
- itemId: s,
1082
+ itemId: a,
1083
1083
  name: i,
1084
1084
  sellers: l,
1085
1085
  videos: u,
1086
- variations: p
1086
+ variations: d
1087
1087
  } = e, {
1088
1088
  brand: c,
1089
- categories: d,
1089
+ categories: p,
1090
1090
  categoriesIds: h,
1091
1091
  description: f,
1092
1092
  linkText: m,
@@ -1096,23 +1096,23 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1096
1096
  properties: S,
1097
1097
  productId: E,
1098
1098
  productReference: g
1099
- } = r, b = d.slice().reverse(), C = re(l, e.isVariantOf), $ = te(C.offers[0].installments);
1099
+ } = r, b = p.slice().reverse(), C = ne(l, e.isVariantOf), q = re(C.offers[0].installments);
1100
1100
  return {
1101
- sku: s,
1101
+ sku: a,
1102
1102
  gtin: ((O = n == null ? void 0 : n[0]) == null ? void 0 : O.Value) ?? g ?? "",
1103
1103
  name: v ?? i,
1104
1104
  description: f,
1105
1105
  releaseDate: r.releaseDate ?? "",
1106
1106
  slug: m,
1107
1107
  video: u[0],
1108
- categories: d,
1108
+ categories: p,
1109
1109
  categoriesIds: h,
1110
1110
  id: E,
1111
1111
  brand: { name: c, brandName: c },
1112
1112
  seo: {
1113
1113
  description: f,
1114
1114
  title: v,
1115
- canonical: ee(m)
1115
+ canonical: te(m)
1116
1116
  },
1117
1117
  cluster: {
1118
1118
  generals: R,
@@ -1122,46 +1122,46 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1122
1122
  availability: { status: C.offers[0].availability },
1123
1123
  breadcrumbList: {
1124
1124
  itemListElement: [
1125
- ...b.map((P, A) => {
1126
- const q = P.split("/"), B = q[q.length - 2], se = q.map(Z).join("/");
1125
+ ...b.map((P, N) => {
1126
+ const $ = P.split("/"), G = $[$.length - 2], ie = $.map(ee).join("/");
1127
1127
  return {
1128
- name: B,
1129
- item: se,
1130
- position: A + 1
1128
+ name: G,
1129
+ item: ie,
1130
+ position: N + 1
1131
1131
  };
1132
1132
  }),
1133
1133
  {
1134
1134
  name: r.productName,
1135
1135
  item: m,
1136
- position: d.length + 1
1136
+ position: p.length + 1
1137
1137
  }
1138
1138
  ],
1139
- numberOfItems: d.length
1139
+ numberOfItems: p.length
1140
1140
  },
1141
- image: X(o),
1141
+ image: Z(o),
1142
1142
  offers: C,
1143
- additionalProperty: _(p, t, []),
1143
+ additionalProperty: H(d, t, []),
1144
1144
  isVariantOf: {
1145
1145
  productGroupID: r.productId,
1146
- hasVariant: r.items.map((P) => ne(P))
1146
+ hasVariant: r.items.map((P) => se(P))
1147
1147
  },
1148
- installments: $
1148
+ installments: q
1149
1149
  };
1150
- }, _t = (e) => {
1151
- var $;
1150
+ }, Bt = (e) => {
1151
+ var q;
1152
1152
  const {
1153
1153
  attributes: t,
1154
1154
  referenceId: n,
1155
1155
  isVariantOf: r,
1156
1156
  images: o,
1157
- itemId: s,
1157
+ itemId: a,
1158
1158
  name: i,
1159
1159
  sellers: l,
1160
1160
  Videos: u,
1161
- variations: p
1161
+ variations: d
1162
1162
  } = e, {
1163
1163
  brand: c,
1164
- categories: d,
1164
+ categories: p,
1165
1165
  categoriesIds: h,
1166
1166
  description: f,
1167
1167
  linkText: m,
@@ -1170,16 +1170,16 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1170
1170
  Coleção: v,
1171
1171
  "ID Coleção": S,
1172
1172
  productId: E
1173
- } = r, g = d.slice().reverse(), b = re(l, e.isVariantOf), C = te(b.offers[0].installments);
1173
+ } = r, g = p.slice().reverse(), b = ne(l, e.isVariantOf), C = re(b.offers[0].installments);
1174
1174
  return {
1175
- sku: s,
1176
- gtin: (($ = n[0]) == null ? void 0 : $.Value) ?? "",
1175
+ sku: a,
1176
+ gtin: ((q = n[0]) == null ? void 0 : q.Value) ?? "",
1177
1177
  name: T ?? i,
1178
1178
  description: f,
1179
1179
  releaseDate: r.releaseDate ?? "",
1180
1180
  slug: m,
1181
1181
  video: u[0],
1182
- categories: d,
1182
+ categories: p,
1183
1183
  categoriesIds: h,
1184
1184
  collection: v,
1185
1185
  collectionId: S,
@@ -1188,7 +1188,7 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1188
1188
  seo: {
1189
1189
  description: f,
1190
1190
  title: T,
1191
- canonical: ee(m)
1191
+ canonical: te(m)
1192
1192
  },
1193
1193
  cluster: {
1194
1194
  generals: R,
@@ -1199,35 +1199,35 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1199
1199
  breadcrumbList: {
1200
1200
  itemListElement: [
1201
1201
  ...g.map((O, P) => {
1202
- const A = O.split("/"), q = A[A.length - 2], B = A.map(Z).join("/");
1202
+ const N = O.split("/"), $ = N[N.length - 2], G = N.map(ee).join("/");
1203
1203
  return {
1204
- name: q,
1205
- item: B,
1204
+ name: $,
1205
+ item: G,
1206
1206
  position: P + 1
1207
1207
  };
1208
1208
  }),
1209
1209
  {
1210
1210
  name: r.productName,
1211
1211
  item: m,
1212
- position: d.length + 1
1212
+ position: p.length + 1
1213
1213
  }
1214
1214
  ],
1215
- numberOfItems: d.length
1215
+ numberOfItems: p.length
1216
1216
  },
1217
- image: X(o),
1217
+ image: Z(o),
1218
1218
  offers: b,
1219
- additionalProperty: _(p, t, []),
1219
+ additionalProperty: H(d, t, []),
1220
1220
  isVariantOf: {
1221
1221
  productGroupID: r.productId,
1222
1222
  hasVariant: r.items.map((O) => {
1223
- const { variations: P } = O, A = P.map((q) => ({
1224
- name: q,
1225
- values: O[q]
1223
+ const { variations: P } = O, N = P.map(($) => ({
1224
+ name: $,
1225
+ values: O[$]
1226
1226
  }));
1227
1227
  return {
1228
- ...ne(O),
1229
- additionalProperty: _(
1230
- A,
1228
+ ...se(O),
1229
+ additionalProperty: H(
1230
+ N,
1231
1231
  t,
1232
1232
  []
1233
1233
  )
@@ -1236,27 +1236,27 @@ const Et = (e, t) => he(e, t), Ft = (e) => ({
1236
1236
  },
1237
1237
  installments: C
1238
1238
  };
1239
- }, Ht = a.array().of(a.object({
1240
- key: a.string().required(),
1241
- value: a.string().required()
1239
+ }, Gt = s.array().of(s.object({
1240
+ key: s.string().required(),
1241
+ value: s.string().required()
1242
1242
  })).required("Facets are required");
1243
- async function Bt({ apiUrl: e, body: t, fetchOptions: n }) {
1243
+ async function Lt({ apiUrl: e, body: t, fetchOptions: n }) {
1244
1244
  if (!t) {
1245
1245
  console.error("[ERROR FETCHING] Body is required");
1246
1246
  return;
1247
1247
  }
1248
- await Ht.validate(t);
1248
+ await Gt.validate(t);
1249
1249
  const r = new URLSearchParams({}), o = t.map(({ key: i, value: l }) => `${i}/${l}`).join("/");
1250
- ie(t, r);
1251
- const s = `${e}/api/catalog_system/pub/products/crossselling/${o}`;
1252
- return y(s, {
1250
+ le(t, r);
1251
+ const a = `${e}/api/catalog_system/pub/products/crossselling/${o}`;
1252
+ return y(a, {
1253
1253
  cache: "no-store",
1254
1254
  ...n
1255
1255
  }).then((i) => i.map((u) => {
1256
- const p = W(u.items);
1257
- return p && J(p, u);
1256
+ const d = X(u.items);
1257
+ return d && Y(d, u);
1258
1258
  }).filter((u) => !!u).map((u) => ({
1259
- node: _t(u)
1259
+ node: Bt(u)
1260
1260
  })));
1261
1261
  }
1262
1262
  const ae = ({
@@ -1271,24 +1271,24 @@ const ae = ({
1271
1271
  }
1272
1272
  const {
1273
1273
  query: o = "",
1274
- page: s = 1,
1274
+ page: a = 1,
1275
1275
  count: i,
1276
1276
  sort: l = "",
1277
1277
  facets: u = [],
1278
- type: p,
1278
+ type: d,
1279
1279
  hideUnavailableItems: c = !0,
1280
- locale: d = ""
1280
+ locale: p = ""
1281
1281
  } = t, h = new URLSearchParams({
1282
- page: s.toString(),
1282
+ page: a.toString(),
1283
1283
  count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1284
1284
  query: o,
1285
1285
  sort: l,
1286
- locale: d
1286
+ locale: p
1287
1287
  });
1288
1288
  c !== void 0 && h.append("hideUnavailableItems", c.toString());
1289
1289
  const f = u.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
1290
- return $e(
1291
- `${e}/api/io/_v/api/intelligent-search/${p}/${f}?${h.toString()}`,
1290
+ return Ne(
1291
+ `${e}/api/io/_v/api/intelligent-search/${d}/${f}?${h.toString()}`,
1292
1292
  {
1293
1293
  headers: {
1294
1294
  Accept: "application/json",
@@ -1298,7 +1298,7 @@ const ae = ({
1298
1298
  }
1299
1299
  );
1300
1300
  };
1301
- async function Gt({ body: e, extraData: t, ...n }) {
1301
+ async function Mt({ body: e, extraData: t, ...n }) {
1302
1302
  if (!e) {
1303
1303
  console.error("[ERROR FETCHING] Body is required");
1304
1304
  return;
@@ -1311,30 +1311,30 @@ async function Gt({ body: e, extraData: t, ...n }) {
1311
1311
  extraData: t,
1312
1312
  ...n
1313
1313
  }), o = (r == null ? void 0 : r.products.map((l) => {
1314
- const u = W(l.items);
1315
- return u && J(u, l);
1314
+ const u = X(l.items);
1315
+ return u && Y(u, l);
1316
1316
  }).filter((l) => !!l)) ?? [], {
1317
- pagination: s,
1317
+ pagination: a,
1318
1318
  recordsFiltered: i
1319
1319
  } = r;
1320
1320
  return {
1321
1321
  data: {
1322
1322
  pagination: {
1323
- nextPage: s.after.length > 0,
1324
- previousPage: s.before.length > 0,
1323
+ nextPage: a.after.length > 0,
1324
+ previousPage: a.before.length > 0,
1325
1325
  startCursor: "0",
1326
1326
  endCursor: i.toString(),
1327
1327
  count: i,
1328
- total: s.count
1328
+ total: a.count
1329
1329
  },
1330
1330
  products: o.map((l, u) => ({
1331
- node: Dt(l),
1331
+ node: Ht(l),
1332
1332
  cursor: u.toString()
1333
1333
  }))
1334
1334
  }
1335
1335
  };
1336
1336
  }
1337
- async function Lt({ body: e, extraData: t, ...n }) {
1337
+ async function Ut({ body: e, extraData: t, ...n }) {
1338
1338
  if (!e) {
1339
1339
  console.error("[ERROR FETCHING] Body is required");
1340
1340
  return;
@@ -1350,44 +1350,44 @@ async function Lt({ body: e, extraData: t, ...n }) {
1350
1350
  return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1351
1351
  data: {
1352
1352
  ...r,
1353
- facets: ce(r, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
1353
+ facets: ue(r, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
1354
1354
  }
1355
1355
  };
1356
1356
  }
1357
- const Mt = a.object({
1358
- query: a.string().optional(),
1359
- locale: a.string().optional()
1357
+ const Vt = s.object({
1358
+ query: s.string().optional(),
1359
+ locale: s.string().optional()
1360
1360
  });
1361
- async function Ut({ apiUrl: e, body: t, fetchOptions: n }) {
1361
+ async function xt({ apiUrl: e, body: t, fetchOptions: n }) {
1362
1362
  if (!t) {
1363
1363
  console.error("[ERROR FETCHING] Body is required");
1364
1364
  return;
1365
1365
  }
1366
- await Mt.validate(t);
1367
- const { query: r = "", locale: o = "default_locale" } = t, s = new URLSearchParams({ query: r, locale: o });
1366
+ await Vt.validate(t);
1367
+ const { query: r = "", locale: o = "default_locale" } = t, a = new URLSearchParams({ query: r, locale: o });
1368
1368
  return y(
1369
- `${e}/api/io/_v/api/intelligent-search/search_suggestions?${s.toString()}`,
1369
+ `${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
1370
1370
  {
1371
1371
  ...n
1372
1372
  }
1373
1373
  );
1374
1374
  }
1375
- async function Vt({ apiUrl: e }) {
1375
+ async function zt({ apiUrl: e }) {
1376
1376
  return y(`${e}/api/io/_v/api/intelligent-search/top_searches`);
1377
1377
  }
1378
- const xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1378
+ const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1379
1379
  __proto__: null,
1380
- getSearchAutoCompleteSuggestions: Tt,
1381
- getSearchCrossellingProducts: Bt,
1382
- getSearchFacets: Lt,
1383
- getSearchProducts: Gt,
1384
- getSearchSuggestedTerms: Ut,
1385
- getSearchTopSearchs: Vt
1386
- }, Symbol.toStringTag, { value: "Module" })), zt = a.object({
1387
- masterDataEntity: a.string().nonNullable(),
1388
- payload: a.object().shape({}).nullable()
1380
+ getSearchAutoCompleteSuggestions: Ft,
1381
+ getSearchCrossellingProducts: Lt,
1382
+ getSearchFacets: Ut,
1383
+ getSearchProducts: Mt,
1384
+ getSearchSuggestedTerms: xt,
1385
+ getSearchTopSearchs: zt
1386
+ }, Symbol.toStringTag, { value: "Module" })), Kt = s.object({
1387
+ masterDataEntity: s.string().nonNullable(),
1388
+ payload: s.object().shape({}).nullable()
1389
1389
  });
1390
- async function Qt({
1390
+ async function Jt({
1391
1391
  apiUrl: e,
1392
1392
  body: t,
1393
1393
  fetchOptions: n
@@ -1396,9 +1396,9 @@ async function Qt({
1396
1396
  console.error("[ERROR FETCHING] Body is required");
1397
1397
  return;
1398
1398
  }
1399
- await zt.validate(t);
1400
- const { masterDataEntity: r, payload: o } = t, s = `${e}/api/dataentities/${r}/documents`;
1401
- return y(s, {
1399
+ await Kt.validate(t);
1400
+ const { masterDataEntity: r, payload: o } = t, a = `${e}/api/dataentities/${r}/documents`;
1401
+ return y(a, {
1402
1402
  method: "POST",
1403
1403
  body: {
1404
1404
  payload: o
@@ -1406,21 +1406,21 @@ async function Qt({
1406
1406
  ...n
1407
1407
  });
1408
1408
  }
1409
- const Kt = a.object().shape({
1410
- _where: a.string().optional(),
1411
- _fields: a.string().optional(),
1412
- _sort: a.string().optional(),
1413
- _from: a.number().integer().min(0).optional(),
1414
- _to: a.number().integer().min(0).optional(),
1415
- _keyword: a.string().optional()
1416
- }), Jt = a.object({
1417
- masterDataEntity: a.string().required(),
1418
- searchFields: Kt,
1419
- headers: a.object().shape({
1420
- "REST-Range": a.string().notRequired()
1409
+ const Yt = s.object().shape({
1410
+ _where: s.string().optional(),
1411
+ _fields: s.string().optional(),
1412
+ _sort: s.string().optional(),
1413
+ _from: s.number().integer().min(0).optional(),
1414
+ _to: s.number().integer().min(0).optional(),
1415
+ _keyword: s.string().optional()
1416
+ }), Wt = s.object({
1417
+ masterDataEntity: s.string().required(),
1418
+ searchFields: Yt,
1419
+ headers: s.object().shape({
1420
+ "REST-Range": s.string().notRequired()
1421
1421
  })
1422
1422
  });
1423
- async function Yt({
1423
+ async function Xt({
1424
1424
  apiUrl: e,
1425
1425
  body: t,
1426
1426
  fetchOptions: n
@@ -1430,11 +1430,11 @@ async function Yt({
1430
1430
  return;
1431
1431
  }
1432
1432
  const r = new URLSearchParams();
1433
- await Jt.validate(t);
1434
- const { masterDataEntity: o, searchFields: s, headers: i } = t;
1435
- s && Object.entries(s).forEach(([u, p]) => {
1436
- r.append(u, String(p));
1437
- }), "_fields" in s || r == null || r.append("_fields", "_all");
1433
+ await Wt.validate(t);
1434
+ const { masterDataEntity: o, searchFields: a, headers: i } = t;
1435
+ a && Object.entries(a).forEach(([u, d]) => {
1436
+ r.append(u, String(d));
1437
+ }), "_fields" in a || r == null || r.append("_fields", "_all");
1438
1438
  const l = `${e}/api/dataentities/${o}/search?${r.toString()}`;
1439
1439
  return y(l, {
1440
1440
  headers: {
@@ -1444,12 +1444,12 @@ async function Yt({
1444
1444
  ...n
1445
1445
  });
1446
1446
  }
1447
- const Wt = a.object({
1448
- dataEntityName: a.string().required(),
1449
- id: a.string().required(),
1450
- fieldsToBeUpdated: a.object().shape({})
1447
+ const Zt = s.object({
1448
+ dataEntityName: s.string().required(),
1449
+ id: s.string().required(),
1450
+ fieldsToBeUpdated: s.object().shape({})
1451
1451
  });
1452
- async function Xt({
1452
+ async function er({
1453
1453
  apiUrl: e,
1454
1454
  body: t,
1455
1455
  fetchOptions: n
@@ -1458,38 +1458,38 @@ async function Xt({
1458
1458
  console.error("[ERROR FETCHING] Body is required");
1459
1459
  return;
1460
1460
  }
1461
- await Wt.validate(t);
1462
- const { dataEntityName: r, id: o, fieldsToBeUpdated: s } = t, i = `${e}/api/dataentities/${r}/documents/${o}`;
1461
+ await Zt.validate(t);
1462
+ const { dataEntityName: r, id: o, fieldsToBeUpdated: a } = t, i = `${e}/api/dataentities/${r}/documents/${o}`;
1463
1463
  return y(i, {
1464
1464
  body: {
1465
- fieldsToBeUpdated: s
1465
+ fieldsToBeUpdated: a
1466
1466
  },
1467
1467
  method: "PATCH",
1468
1468
  ...n
1469
1469
  });
1470
1470
  }
1471
- const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1471
+ const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1472
1472
  __proto__: null,
1473
- getSearchMasterdata: Yt,
1474
- patchUpdateMasterdata: Xt,
1475
- postMasterdata: Qt
1473
+ getSearchMasterdata: Xt,
1474
+ patchUpdateMasterdata: er,
1475
+ postMasterdata: Jt
1476
1476
  }, Symbol.toStringTag, { value: "Module" }));
1477
- async function er({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
1477
+ async function rr({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
1478
1478
  const { productIds: o } = e;
1479
1479
  if (!o)
1480
1480
  return console.error("[ERROR FETCHING] productIds is required"), [];
1481
- const { NAME_SPLIT_SYMBOL: s } = n;
1482
- if (!s)
1481
+ const { NAME_SPLIT_SYMBOL: a } = n;
1482
+ if (!a)
1483
1483
  return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
1484
1484
  const i = o.map((c) => typeof c == "string" || typeof c == "number" ? `productId:${c}` : "").join("&fq="), l = await y(
1485
1485
  `${t}/api/catalog_system/pub/products/search?fq=${i}`,
1486
1486
  {
1487
1487
  ...r
1488
1488
  }
1489
- ), u = (c) => Object.keys(c).map((d) => ({ id: d, name: c[d] }));
1490
- return l.map((c, d) => {
1489
+ ), u = (c) => Object.keys(c).map((p) => ({ id: p, name: c[p] }));
1490
+ return l.map((c, p) => {
1491
1491
  var E;
1492
- const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable: T } = le({ items: c.items, NAME_SPLIT_SYMBOL: s }), v = T ? !0 : R.some((g) => g.available), S = c.items[0].sellers[0].commertialOffer;
1492
+ const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable: T } = de({ items: c.items, NAME_SPLIT_SYMBOL: a }), v = T ? !0 : R.some((g) => g.available), S = c.items[0].sellers[0].commertialOffer;
1493
1493
  return {
1494
1494
  node: {
1495
1495
  sku: c.items[0].itemId,
@@ -1555,10 +1555,10 @@ async function er({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
1555
1555
  productGroupID: c.productId,
1556
1556
  hasVariant: c.items.map((g) => ({
1557
1557
  additionalProperty: g == null ? void 0 : g.variations.map(() => {
1558
- var b, C, $;
1558
+ var b, C, q;
1559
1559
  return {
1560
1560
  name: (b = g == null ? void 0 : g.variations) == null ? void 0 : b[0],
1561
- value: ($ = g == null ? void 0 : g[(C = g == null ? void 0 : g.variations) == null ? void 0 : C[0]]) == null ? void 0 : $[0],
1561
+ value: (q = g == null ? void 0 : g[(C = g == null ? void 0 : g.variations) == null ? void 0 : C[0]]) == null ? void 0 : q[0],
1562
1562
  valueReference: "SPECIFICATION"
1563
1563
  };
1564
1564
  }),
@@ -1582,25 +1582,25 @@ async function er({ body: e, apiUrl: t, extraData: n, fetchOptions: r }) {
1582
1582
  },
1583
1583
  installments: h
1584
1584
  },
1585
- cursor: d.toString()
1585
+ cursor: p.toString()
1586
1586
  };
1587
1587
  });
1588
1588
  }
1589
- const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1589
+ const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1590
1590
  __proto__: null,
1591
- getWishlistProducts: er
1592
- }, Symbol.toStringTag, { value: "Module" })), rr = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), U = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(rr).join(t), nr = ({ canonical: e, seo: t, slug: n }) => {
1591
+ getWishlistProducts: rr
1592
+ }, Symbol.toStringTag, { value: "Module" })), sr = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), x = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(sr).join(t), ar = ({ canonical: e, seo: t, slug: n }) => {
1593
1593
  const r = Array.isArray(n) ? n.join(", ") : n;
1594
1594
  return {
1595
1595
  id: 0,
1596
- Title: `${Array.isArray(n) ? n.map((s) => U(s)).join(",") : U(n)} - ${t.title}`,
1596
+ Title: `${Array.isArray(n) ? n.map((a) => x(a)).join(",") : x(n)} - ${t.title}`,
1597
1597
  MetaTagDescription: t.description,
1598
1598
  name: r,
1599
1599
  hasChildren: !1,
1600
1600
  url: e,
1601
1601
  children: []
1602
1602
  };
1603
- }, ar = ({ canonical: e, category: t, previousImages: n, seo: r }) => ({
1603
+ }, or = ({ canonical: e, category: t, previousImages: n, seo: r }) => ({
1604
1604
  category: String(t == null ? void 0 : t.id),
1605
1605
  title: (t == null ? void 0 : t.Title) ?? r.title,
1606
1606
  description: (t == null ? void 0 : t.MetaTagDescription) ?? r.description,
@@ -1611,71 +1611,87 @@ const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1611
1611
  description: (t == null ? void 0 : t.MetaTagDescription) ?? r.description,
1612
1612
  images: Array.isArray(n) ? [...n] : []
1613
1613
  }
1614
- }), sr = ({ items: e, parent: t, apiUrl: n, find: r }) => {
1614
+ }), ir = ({ items: e, parent: t, apiUrl: n, find: r }) => {
1615
1615
  const o = e.find(
1616
1616
  (i) => i.url.replace(n, "") === decodeURIComponent(t.toLowerCase())
1617
1617
  );
1618
1618
  return (o == null ? void 0 : o.children.find(
1619
1619
  (i) => i.name.toLowerCase() === decodeURIComponent(String(r))
1620
1620
  )) ?? o;
1621
- }, or = (e) => {
1621
+ }, cr = (e) => {
1622
1622
  e instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${e.message}`), console.error(e.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", e);
1623
- }, ir = /* @__PURE__ */ new Set([
1623
+ }, lr = /* @__PURE__ */ new Set([
1624
1624
  "brand",
1625
1625
  "category",
1626
1626
  "department",
1627
1627
  "subcategory",
1628
1628
  "collection",
1629
1629
  "cluster"
1630
- ]), cr = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && ir.has(e == null ? void 0 : e.pageType.toLowerCase()), lr = (e) => ({
1630
+ ]), ur = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && lr.has(e == null ? void 0 : e.pageType.toLowerCase()), dr = (e) => ({
1631
1631
  collection: e.Coleção,
1632
1632
  categoryId: e.categoryId,
1633
1633
  current_collection: e["Coleção Atual"],
1634
1634
  items: e.items
1635
- }), ur = (e, t) => e.reduce((n, r) => {
1635
+ }), oe = (e, t) => e.reduce((n, r) => {
1636
1636
  if (r.items.filter(
1637
1637
  (i) => i.sellers.find((l) => l.commertialOffer.IsAvailable)
1638
1638
  ).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
1639
1639
  return n;
1640
- const s = r.items[0].images.find(
1640
+ const a = r.items[0].images.find(
1641
1641
  (i) => t.includes(i.imageLabel)
1642
1642
  );
1643
1643
  return n.push({
1644
1644
  slug: `/${r.linkText}/p`,
1645
1645
  productId: r == null ? void 0 : r.productId,
1646
- textureImage: (s == null ? void 0 : s.imageUrl) ?? "",
1647
- textureAlt: (s == null ? void 0 : s.imageText) ?? ""
1646
+ textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
1647
+ textureAlt: (a == null ? void 0 : a.imageText) ?? ""
1648
1648
  }), n;
1649
- }, []), dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1649
+ }, []), pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1650
1650
  __proto__: null,
1651
- createEmptySeoCategory: nr,
1652
- createSeoCategory: ar,
1653
- findCategory: sr,
1654
- formattedSimilars: ur,
1655
- isCollectionPageType: cr,
1656
- notFindCategoryError: or,
1657
- responseAdapter: lr
1658
- }, Symbol.toStringTag, { value: "Module" })), pr = {
1659
- parseSearchState: me,
1660
- convertSearchParams: pe,
1661
- filterNonRootFacets: de,
1662
- filterNonCategorySelected: ue
1663
- }, Ir = {
1664
- checkout: gt,
1665
- catalog: vt,
1666
- cms: fe,
1667
- search: xt,
1668
- masterdata: Zt,
1651
+ createEmptySeoCategory: ar,
1652
+ createSeoCategory: or,
1653
+ findCategory: ir,
1654
+ formattedSimilars: oe,
1655
+ isCollectionPageType: ur,
1656
+ notFindCategoryError: cr,
1657
+ responseAdapter: dr
1658
+ }, Symbol.toStringTag, { value: "Module" })), mr = {
1659
+ parseSearchState: ge,
1660
+ convertSearchParams: fe,
1661
+ filterNonRootFacets: me,
1662
+ filterNonCategorySelected: pe
1663
+ }, fr = async ({ children: e, apiUrl: t, productId: n, ClientItems: r, PDP_INFO: o, TEXTURE_IMAGE: a, TOGGLE_STYLE_MODIFIER: i }) => {
1664
+ const l = await fetch(
1665
+ `${t}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
1666
+ ).then((d) => d.json()), u = oe(l, a);
1667
+ return /* @__PURE__ */ k("div", { className: L.similars, children: [
1668
+ /* @__PURE__ */ k("div", { className: L["similars-info"], children: [
1669
+ /* @__PURE__ */ I("span", { className: L["sections-title"], children: o.product.color_title }),
1670
+ e
1671
+ ] }),
1672
+ /* @__PURE__ */ I(r, { productId: n, similars: u, TOGGLE_STYLE_MODIFIER: i })
1673
+ ] });
1674
+ }, Rr = {
1675
+ checkout: yt,
1676
+ catalog: Tt,
1677
+ cms: he,
1678
+ search: Qt,
1679
+ masterdata: tr,
1669
1680
  wishlist: {
1670
- ...tr
1681
+ ...nr
1682
+ }
1683
+ }, Cr = {
1684
+ catalog: pr,
1685
+ search: mr,
1686
+ product: ye
1687
+ }, vr = {
1688
+ template: {
1689
+ pdp: { PDPSimilars: fr }
1671
1690
  }
1672
- }, br = {
1673
- catalog: dr,
1674
- search: pr,
1675
- product: ge
1676
1691
  };
1677
1692
  export {
1678
- Ir as serverAPIs,
1679
- yr as serverCMS,
1680
- br as serverHelpers
1693
+ Rr as serverAPIs,
1694
+ br as serverCMS,
1695
+ vr as serverComponents,
1696
+ Cr as serverHelpers
1681
1697
  };