@soma-vertical-web/multi-lib 0.0.35 → 0.0.37

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