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

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