@soma-vertical-web/multi-lib 0.0.49 → 0.0.51

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