@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/SearchPageScreening-BIyp1dAW.mjs +112 -0
- package/SearchPageScreening-gO7dG13l.js +1 -0
- package/cms/ContentTypes/Search/SearchContentScreening.d.ts +3 -0
- package/cms/index.d.ts +2 -0
- package/cms/server.d.ts +1 -0
- package/data/api/cms/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.mjs +2328 -2320
- package/index2.js +1 -1
- package/index2.mjs +371 -457
- package/layout/index.d.ts +1 -1
- package/layout/team-component/Header/Composite/HeaderDesktopWrapper.d.ts +1 -3
- package/layout/team-component/Header/Composite/HeaderMobileWrapper.d.ts +1 -3
- package/layout/team-component/Header/Composite/SearchButton.d.ts +1 -5
- package/layout/team-component/Header/index.d.ts +1 -1
- package/package.json +1 -1
- package/types/cms/ContentTypes/Search/index.d.ts +31 -0
- package/types/data/api/cms/index.d.ts +2 -1
- package/types/layout/team-components/Header/index.d.ts +1 -5
package/index2.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as n from "yup";
|
|
2
|
-
import {
|
|
3
|
-
import { jsxs as z, Fragment as
|
|
4
|
-
import { Utils as j, helpers as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
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
|
-
},
|
|
23
|
-
async function
|
|
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 && (
|
|
28
|
-
const a =
|
|
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 &&
|
|
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
|
|
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
|
|
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
|
|
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
|
|
75
|
+
await Ie.validate(t);
|
|
76
76
|
const { orderFormId: r, sellerCode: s, sellerName: a } = t, i = s ? `${s.trim()} - ${a}` : null;
|
|
77
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
125
|
+
await be.validate(t);
|
|
126
126
|
const r = await Q({ apiUrl: e, body: t, fetchOptions: o });
|
|
127
|
-
return
|
|
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
|
|
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
|
|
149
|
+
await Re.validate(t);
|
|
150
150
|
const { coupon: r = "", orderFormId: s } = t;
|
|
151
|
-
return
|
|
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
|
|
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
|
|
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
|
|
174
|
+
await Fe.validate(t);
|
|
175
175
|
const { appId: r = "faststore", orderFormId: s, key: a } = t;
|
|
176
|
-
return
|
|
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
|
|
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
|
-
}),
|
|
196
|
+
}), Ee = n.object({
|
|
197
197
|
orderFormId: n.string().required("OrderFormId is required"),
|
|
198
|
-
orderItems: n.array().of(
|
|
198
|
+
orderItems: n.array().of(Oe)
|
|
199
199
|
});
|
|
200
|
-
async function
|
|
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
|
|
209
|
+
await Ee.validate(t);
|
|
210
210
|
const { orderFormId: r, orderItems: s } = t;
|
|
211
|
-
return
|
|
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
|
|
220
|
+
const $e = n.object({
|
|
221
221
|
orderFormId: n.string().nullable()
|
|
222
222
|
});
|
|
223
|
-
async function
|
|
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
|
|
232
|
+
await $e.validate(t);
|
|
233
233
|
const { orderFormId: r } = t;
|
|
234
|
-
return
|
|
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
|
|
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
|
|
248
|
-
attachments: (x = n.array().of(
|
|
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
|
-
}),
|
|
254
|
+
}), ke = n.object({
|
|
255
255
|
orderFormId: n.string().nullable(),
|
|
256
|
-
orderItems: n.array().of(
|
|
256
|
+
orderItems: n.array().of(we)
|
|
257
257
|
});
|
|
258
|
-
async function
|
|
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
|
|
267
|
+
await ke.validate(t);
|
|
268
268
|
const { orderFormId: r, orderItems: s } = t;
|
|
269
|
-
return
|
|
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
|
|
278
|
+
const je = n.object({
|
|
279
279
|
orderFormId: n.string().nullable()
|
|
280
280
|
});
|
|
281
|
-
async function
|
|
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
|
|
290
|
+
await je.validate(t);
|
|
291
291
|
const { orderFormId: r } = t;
|
|
292
|
-
return
|
|
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
|
|
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
|
|
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
|
|
314
|
+
return f(u, {
|
|
315
315
|
method: "POST",
|
|
316
316
|
body: { id: a },
|
|
317
317
|
...o
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const Be = n.object({
|
|
321
321
|
orderFormId: n.string().nullable()
|
|
322
322
|
});
|
|
323
|
-
async function
|
|
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
|
|
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
|
|
338
|
+
return f(a, { method: "GET", ...o });
|
|
339
339
|
}
|
|
340
|
-
const
|
|
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
|
|
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
|
|
358
|
+
await Le.validate(t);
|
|
359
359
|
const { orderFormId: r, ...s } = t;
|
|
360
|
-
return
|
|
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
|
|
369
|
+
const Ve = n.object({
|
|
370
370
|
sellerCode: n.string().nullable()
|
|
371
371
|
});
|
|
372
|
-
async function
|
|
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
|
|
381
|
+
await Ve.validate(t);
|
|
382
382
|
const { sellerCode: r = "" } = t;
|
|
383
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
461
|
+
await Qe.validate(t);
|
|
462
462
|
const { orderFormId: r, options: s, selectedAddresses: a } = t;
|
|
463
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
-
}),
|
|
507
|
-
items: n.array().of(
|
|
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
|
|
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
|
|
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
|
|
526
|
+
const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
527
527
|
__proto__: null,
|
|
528
|
-
getMasterDataSellerCode:
|
|
529
|
-
getOrderForm:
|
|
528
|
+
getMasterDataSellerCode: Me,
|
|
529
|
+
getOrderForm: Ge,
|
|
530
530
|
postOrderFormAddCoupon: ve,
|
|
531
|
-
postOrderFormAttachClientProfileData:
|
|
532
|
-
postOrderFormAttachOrderFormData:
|
|
533
|
-
postOrderFormAttachShippingData:
|
|
534
|
-
postOrderFormAttachmentsMarketingData:
|
|
531
|
+
postOrderFormAttachClientProfileData: Ue,
|
|
532
|
+
postOrderFormAttachOrderFormData: Ce,
|
|
533
|
+
postOrderFormAttachShippingData: ze,
|
|
534
|
+
postOrderFormAttachmentsMarketingData: K,
|
|
535
535
|
postOrderFormAttachmentsOpenTextField: Q,
|
|
536
|
-
postOrderFormClearMessages:
|
|
537
|
-
postOrderFormFreightSimulation:
|
|
538
|
-
postOrderFormItems:
|
|
539
|
-
postOrderFormRegion:
|
|
540
|
-
postOrderFormRemoveAllItems:
|
|
541
|
-
postOrderFormUpdateItems:
|
|
542
|
-
postOrderFormUpdateShippingData:
|
|
543
|
-
postOrderformAddress:
|
|
544
|
-
putOrderFormCustomData:
|
|
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" })),
|
|
546
|
+
}, Symbol.toStringTag, { value: "Module" })), tt = n.object({
|
|
547
547
|
skuId: n.string()
|
|
548
548
|
});
|
|
549
|
-
async function
|
|
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
|
|
554
|
+
await tt.validate(t);
|
|
555
555
|
const { skuId: r } = t;
|
|
556
|
-
return
|
|
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
|
|
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
|
|
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
|
|
571
|
+
await ot.validate(t);
|
|
572
572
|
const { ids: r } = t;
|
|
573
|
-
return
|
|
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
|
|
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
|
|
588
|
+
await st.validate(t);
|
|
589
589
|
const { productId: r } = t;
|
|
590
|
-
return
|
|
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
|
|
597
|
+
const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
598
598
|
__proto__: null,
|
|
599
|
-
getCatalogKitProducts:
|
|
600
|
-
getCatalogProducts:
|
|
599
|
+
getCatalogKitProducts: rt,
|
|
600
|
+
getCatalogProducts: nt,
|
|
601
601
|
getCatalogSimilars: at
|
|
602
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
633
|
+
}, mt = /* @__PURE__ */ new Set([
|
|
634
634
|
"brand",
|
|
635
635
|
"category",
|
|
636
636
|
"department",
|
|
637
637
|
"subcategory",
|
|
638
638
|
"collection",
|
|
639
639
|
"cluster"
|
|
640
|
-
]),
|
|
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
|
-
}),
|
|
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
|
-
}, []),
|
|
659
|
+
}, []), It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
660
660
|
__proto__: null,
|
|
661
|
-
createEmptySeoCategory:
|
|
662
|
-
createSeoCategory:
|
|
663
|
-
findCategory:
|
|
664
|
-
formattedSimilars:
|
|
665
|
-
isCollectionPageType:
|
|
666
|
-
notFindCategoryError:
|
|
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
|
-
(
|
|
782
|
-
var
|
|
783
|
-
return ((
|
|
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
|
-
(
|
|
787
|
-
var
|
|
788
|
-
return ((
|
|
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,
|
|
791
|
-
return /* @__PURE__ */ z(
|
|
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:
|
|
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 &&
|
|
807
|
-
className:
|
|
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
|
-
},
|
|
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
|
|
715
|
+
const { data: s } = await v({
|
|
822
716
|
contentType: "common_page",
|
|
823
717
|
...r
|
|
824
718
|
});
|
|
825
719
|
return /* @__PURE__ */ I(
|
|
826
|
-
|
|
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
|
-
},
|
|
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
|
|
845
|
-
const { data: u } = await
|
|
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
|
-
}),
|
|
849
|
-
...(
|
|
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
|
-
(
|
|
852
|
-
) ? (
|
|
853
|
-
(
|
|
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
|
|
750
|
+
return l ? /* @__PURE__ */ I(
|
|
857
751
|
a,
|
|
858
752
|
{
|
|
859
|
-
data: { ...
|
|
860
|
-
socialInfo: (F =
|
|
861
|
-
socialMedias: (
|
|
862
|
-
payments:
|
|
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 = (
|
|
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: (
|
|
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
|
-
...
|
|
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(
|
|
883
|
-
},
|
|
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
|
|
783
|
+
const { data: r } = await v({
|
|
890
784
|
contentType: "header",
|
|
891
785
|
...o
|
|
892
|
-
}), s = (a = r[0]) == null ? void 0 : a.sections.map((
|
|
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
|
-
},
|
|
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
|
|
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
|
-
},
|
|
821
|
+
}, Ft = {
|
|
928
822
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
929
|
-
},
|
|
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
|
|
831
|
+
const { data: i } = await v({
|
|
938
832
|
contentType: "categories_page",
|
|
939
833
|
...a
|
|
940
834
|
}), c = i.find(
|
|
941
|
-
(
|
|
942
|
-
var
|
|
943
|
-
return ((
|
|
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
|
-
(
|
|
947
|
-
var
|
|
948
|
-
return ((
|
|
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
|
-
),
|
|
951
|
-
(
|
|
952
|
-
var
|
|
953
|
-
return ((
|
|
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
|
-
),
|
|
956
|
-
(
|
|
957
|
-
var
|
|
958
|
-
return ((
|
|
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(
|
|
855
|
+
return /* @__PURE__ */ z(_, { children: [
|
|
962
856
|
/* @__PURE__ */ I(
|
|
963
857
|
j.Column,
|
|
964
858
|
{
|
|
965
|
-
className:
|
|
859
|
+
className: G.classNameConcat(
|
|
966
860
|
N["responsive-desktop-flex"],
|
|
967
|
-
|
|
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 ??
|
|
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 ??
|
|
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
|
-
},
|
|
889
|
+
}, St = async ({ slug: e, ...t }) => {
|
|
996
890
|
var i, c, u;
|
|
997
|
-
const { data: o } = await
|
|
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
|
-
(
|
|
1009
|
-
var
|
|
1010
|
-
return ((
|
|
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
|
-
},
|
|
922
|
+
}, Ot = async ({ slug: e, ...t }) => {
|
|
1029
923
|
var i, c, u;
|
|
1030
|
-
const { data: o } = await
|
|
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
|
-
(
|
|
1038
|
-
var
|
|
1039
|
-
return ((
|
|
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
|
-
},
|
|
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
|
|
964
|
+
const { data: o } = await v({
|
|
1052
965
|
contentType: "tipbar",
|
|
1053
966
|
...t
|
|
1054
967
|
});
|
|
1055
968
|
return /* @__PURE__ */ I(e, { data: o });
|
|
1056
|
-
},
|
|
1057
|
-
CommonPageContent:
|
|
1058
|
-
HeaderContent:
|
|
1059
|
-
TipbarContent:
|
|
1060
|
-
FooterContent:
|
|
1061
|
-
PLPContent:
|
|
1062
|
-
PDPContent:
|
|
1063
|
-
getRedirectData:
|
|
1064
|
-
getPLPSynteticMetaData:
|
|
1065
|
-
|
|
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
|
|
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
|
|
987
|
+
await Pt.validate(t);
|
|
1074
988
|
const { query: r = "" } = t, s = new URLSearchParams({ query: r });
|
|
1075
|
-
return
|
|
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
|
|
996
|
+
const wt = (e, t) => me(e, t), kt = (e) => ({
|
|
1083
997
|
...e,
|
|
1084
|
-
description: e.description ?
|
|
1085
|
-
}),
|
|
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
|
-
}),
|
|
1007
|
+
}), J = (e, t) => ({
|
|
1094
1008
|
...e,
|
|
1095
|
-
isVariantOf:
|
|
1096
|
-
}),
|
|
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 =
|
|
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
|
-
},
|
|
1036
|
+
}, _t = (e) => ({
|
|
1123
1037
|
name: e.name,
|
|
1124
1038
|
value: e.content,
|
|
1125
1039
|
valueReference: D.attachment
|
|
1126
|
-
}),
|
|
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
|
-
}),
|
|
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(
|
|
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",
|
|
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
|
-
|
|
1068
|
+
Gt.charAt(o)
|
|
1155
1069
|
);
|
|
1156
1070
|
return t;
|
|
1157
|
-
},
|
|
1071
|
+
}, Ut = (e) => e.replace(/[·/_,:]/, "-"), Z = (e) => {
|
|
1158
1072
|
const o = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1159
|
-
return
|
|
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) =>
|
|
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:
|
|
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:
|
|
1116
|
+
additionalProperty: H(a, t, []),
|
|
1203
1117
|
name: r,
|
|
1204
1118
|
offers: {
|
|
1205
1119
|
offers: s.map(({ sellerId: i, commertialOffer: c }) => ({
|
|
1206
|
-
availability:
|
|
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
|
-
},
|
|
1219
|
-
var
|
|
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:
|
|
1143
|
+
variations: l
|
|
1230
1144
|
} = e, {
|
|
1231
|
-
brand:
|
|
1232
|
-
categories:
|
|
1233
|
-
categoriesIds:
|
|
1234
|
-
description:
|
|
1235
|
-
linkText:
|
|
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:
|
|
1239
|
-
properties:
|
|
1240
|
-
productId:
|
|
1241
|
-
} = r, q =
|
|
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: ((
|
|
1245
|
-
name:
|
|
1246
|
-
description:
|
|
1158
|
+
gtin: ((b = o[0]) == null ? void 0 : b.Value) ?? "",
|
|
1159
|
+
name: T ?? i,
|
|
1160
|
+
description: m,
|
|
1247
1161
|
releaseDate: r.releaseDate ?? "",
|
|
1248
|
-
slug:
|
|
1162
|
+
slug: p,
|
|
1249
1163
|
video: u[0],
|
|
1250
|
-
categories:
|
|
1251
|
-
categoriesIds:
|
|
1252
|
-
id:
|
|
1253
|
-
brand: { name:
|
|
1164
|
+
categories: d,
|
|
1165
|
+
categoriesIds: g,
|
|
1166
|
+
id: E,
|
|
1167
|
+
brand: { name: h, brandName: h },
|
|
1254
1168
|
seo: {
|
|
1255
|
-
description:
|
|
1256
|
-
title:
|
|
1257
|
-
canonical: ee(
|
|
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:
|
|
1177
|
+
properties: O,
|
|
1264
1178
|
availability: { status: y.offers[0].availability },
|
|
1265
1179
|
breadcrumbList: {
|
|
1266
1180
|
itemListElement: [
|
|
1267
|
-
...q.map((
|
|
1268
|
-
const R =
|
|
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:
|
|
1271
|
-
item:
|
|
1184
|
+
name: P,
|
|
1185
|
+
item: B,
|
|
1272
1186
|
position: A + 1
|
|
1273
1187
|
};
|
|
1274
1188
|
}),
|
|
1275
1189
|
{
|
|
1276
1190
|
name: r.productName,
|
|
1277
|
-
item:
|
|
1278
|
-
position:
|
|
1191
|
+
item: p,
|
|
1192
|
+
position: d.length + 1
|
|
1279
1193
|
}
|
|
1280
1194
|
],
|
|
1281
|
-
numberOfItems:
|
|
1195
|
+
numberOfItems: d.length
|
|
1282
1196
|
},
|
|
1283
1197
|
image: Y(s),
|
|
1284
1198
|
offers: y,
|
|
1285
|
-
additionalProperty:
|
|
1199
|
+
additionalProperty: H(l, t, []),
|
|
1286
1200
|
isVariantOf: {
|
|
1287
1201
|
productGroupID: r.productId,
|
|
1288
|
-
hasVariant: r.items.map((
|
|
1202
|
+
hasVariant: r.items.map((C) => oe(C))
|
|
1289
1203
|
},
|
|
1290
|
-
installments:
|
|
1204
|
+
installments: $
|
|
1291
1205
|
};
|
|
1292
|
-
},
|
|
1293
|
-
var
|
|
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:
|
|
1217
|
+
variations: l
|
|
1304
1218
|
} = e, {
|
|
1305
|
-
brand:
|
|
1306
|
-
categories:
|
|
1307
|
-
categoriesIds:
|
|
1308
|
-
description:
|
|
1309
|
-
linkText:
|
|
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:
|
|
1313
|
-
"ID Coleção":
|
|
1314
|
-
productId:
|
|
1315
|
-
} = r, q =
|
|
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: ((
|
|
1232
|
+
gtin: ((b = o[0]) == null ? void 0 : b.Value) ?? "",
|
|
1319
1233
|
name: F ?? i,
|
|
1320
|
-
description:
|
|
1234
|
+
description: m,
|
|
1321
1235
|
releaseDate: r.releaseDate ?? "",
|
|
1322
|
-
slug:
|
|
1236
|
+
slug: p,
|
|
1323
1237
|
video: u[0],
|
|
1324
|
-
categories:
|
|
1325
|
-
categoriesIds:
|
|
1326
|
-
collection:
|
|
1327
|
-
collectionId:
|
|
1328
|
-
id:
|
|
1329
|
-
brand: { name:
|
|
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:
|
|
1245
|
+
description: m,
|
|
1332
1246
|
title: F,
|
|
1333
|
-
canonical: ee(
|
|
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((
|
|
1344
|
-
const R =
|
|
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:
|
|
1347
|
-
item:
|
|
1260
|
+
name: P,
|
|
1261
|
+
item: B,
|
|
1348
1262
|
position: A + 1
|
|
1349
1263
|
};
|
|
1350
1264
|
}),
|
|
1351
1265
|
{
|
|
1352
1266
|
name: r.productName,
|
|
1353
|
-
item:
|
|
1354
|
-
position:
|
|
1267
|
+
item: p,
|
|
1268
|
+
position: d.length + 1
|
|
1355
1269
|
}
|
|
1356
1270
|
],
|
|
1357
|
-
numberOfItems:
|
|
1271
|
+
numberOfItems: d.length
|
|
1358
1272
|
},
|
|
1359
1273
|
image: Y(s),
|
|
1360
1274
|
offers: y,
|
|
1361
|
-
additionalProperty:
|
|
1275
|
+
additionalProperty: H(l, t, []),
|
|
1362
1276
|
isVariantOf: {
|
|
1363
1277
|
productGroupID: r.productId,
|
|
1364
|
-
hasVariant: r.items.map((
|
|
1365
|
-
const { variations: A } =
|
|
1366
|
-
name:
|
|
1367
|
-
values:
|
|
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(
|
|
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:
|
|
1293
|
+
installments: $
|
|
1380
1294
|
};
|
|
1381
|
-
},
|
|
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
|
|
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
|
|
1304
|
+
await xt.validate(t);
|
|
1391
1305
|
const r = new URLSearchParams({}), s = t.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
|
|
1392
|
-
|
|
1306
|
+
ae(t, r);
|
|
1393
1307
|
const a = `${e}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1394
|
-
return
|
|
1308
|
+
return f(a, {
|
|
1395
1309
|
cache: "no-store",
|
|
1396
1310
|
...o
|
|
1397
1311
|
}).then((i) => i.map((u) => {
|
|
1398
|
-
const
|
|
1399
|
-
return
|
|
1312
|
+
const l = X(u.items);
|
|
1313
|
+
return l && J(l, u);
|
|
1400
1314
|
}).filter((u) => !!u).map((u) => ({
|
|
1401
|
-
node:
|
|
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:
|
|
1421
|
-
hideUnavailableItems:
|
|
1422
|
-
locale:
|
|
1423
|
-
} = t,
|
|
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:
|
|
1342
|
+
locale: d
|
|
1429
1343
|
});
|
|
1430
|
-
|
|
1431
|
-
const
|
|
1432
|
-
return
|
|
1433
|
-
`${e}/api/io/_v/api/intelligent-search/${
|
|
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
|
|
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 &&
|
|
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:
|
|
1387
|
+
node: Vt(c),
|
|
1474
1388
|
cursor: u.toString()
|
|
1475
1389
|
}))
|
|
1476
1390
|
}
|
|
1477
1391
|
};
|
|
1478
1392
|
}
|
|
1479
|
-
async function
|
|
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
|
|
1413
|
+
const Jt = n.object({
|
|
1500
1414
|
query: n.string().optional(),
|
|
1501
1415
|
locale: n.string().optional()
|
|
1502
1416
|
});
|
|
1503
|
-
async function
|
|
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
|
|
1422
|
+
await Jt.validate(t);
|
|
1509
1423
|
const { query: r = "", locale: s = "default_locale" } = t, a = new URLSearchParams({ query: r, locale: s });
|
|
1510
|
-
return
|
|
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
|
|
1518
|
-
return
|
|
1431
|
+
async function Xt({ apiUrl: e }) {
|
|
1432
|
+
return f(`${e}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1519
1433
|
}
|
|
1520
|
-
const
|
|
1434
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1521
1435
|
__proto__: null,
|
|
1522
|
-
getSearchAutoCompleteSuggestions:
|
|
1523
|
-
getSearchCrossellingProducts:
|
|
1524
|
-
getSearchFacets:
|
|
1525
|
-
getSearchProducts:
|
|
1526
|
-
getSearchSuggestedTerms:
|
|
1527
|
-
getSearchTopSearchs:
|
|
1528
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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
|
-
},
|
|
1534
|
-
checkout:
|
|
1535
|
-
catalog:
|
|
1536
|
-
cms:
|
|
1537
|
-
search:
|
|
1538
|
-
},
|
|
1539
|
-
catalog:
|
|
1540
|
-
search:
|
|
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
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1457
|
+
sr as serverAPIs,
|
|
1458
|
+
nr as serverCMS,
|
|
1459
|
+
ar as serverHelpers
|
|
1546
1460
|
};
|