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

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