@soma-vertical-web/multi-lib 1.0.2 → 1.0.4
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/cms/ContentTypes/Footer/Footer.d.ts +1 -1
- package/cms/Sections/Banner/Composite/Content.d.ts +1 -1
- package/cms/Sections/ProductCarousel/ProductCarousel.d.ts +2 -2
- package/cms/index.d.ts +2 -2
- package/cms/server.d.ts +1 -1
- package/contexts/contexts/Session.d.ts +1 -1
- package/contexts/hooks/useOperations.d.ts +1 -1
- package/contexts/index.d.ts +1 -1
- package/index-4tOP7lCS.js +4 -0
- package/index-ByhWQJ9Z.mjs +1844 -0
- package/index-Dj1bg0lu.mjs +1826 -0
- package/index-DvhdPe3b.js +4 -0
- package/index.js +16 -16
- package/index.mjs +7940 -7046
- package/index2.js +1 -1
- package/index2.mjs +189 -190
- package/layout/index.d.ts +2 -2
- package/layout/team-component/BackToTop/BackToTop.d.ts +1 -1
- package/layout/team-component/Footer/Footer.d.ts +1 -1
- package/layout/team-component/ProductList/Composite/Card/Actions.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Sku.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Style.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/index.d.ts +2 -2
- package/layout/template/PDC/Composite/Grid/Banners.d.ts +1 -1
- package/layout/template/PDC/Composite/InfiniteScroller/Banners/Banners.d.ts +1 -1
- package/layout/utils/SessionEvent/index.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/Footer/index.d.ts +1 -0
- package/types/cms/Sections/BannerCarousel/index.d.ts +2 -1
- package/types/cms/Sections/SectionZone/index.d.ts +1 -0
- package/types/contexts/contexts/session.d.ts +2 -1
- package/types/data/events/index.d.ts +3 -0
- package/types/layout/team-components/BackToTop/index.d.ts +1 -0
- package/types/layout/templates/PLP/index.d.ts +2 -2
package/index2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as b, jsxs as N, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import { x as E, r as j, S as ce, y as le, z as ue, a as de, v as pe, t as me, A as fe, p as ge, o as M, B as he, C as ye, D as be, e as Ie } from "./index-
|
|
2
|
+
import { x as E, r as j, S as ce, y as le, z as ue, a as de, v as pe, t as me, A as fe, p as ge, o as M, B as he, C as ye, D as be, e as Ie } from "./index-Dj1bg0lu.mjs";
|
|
3
3
|
import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
|
|
4
4
|
import * as a from "yup";
|
|
5
5
|
import Ce from "sanitize-html";
|
|
@@ -22,20 +22,20 @@ const Re = async ({
|
|
|
22
22
|
}) => {
|
|
23
23
|
const o = e == null ? void 0 : e.find(
|
|
24
24
|
(d) => {
|
|
25
|
-
var C,
|
|
26
|
-
return ((
|
|
25
|
+
var C, m, p, y;
|
|
26
|
+
return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.deviceType) === "desktop" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
|
|
27
27
|
}
|
|
28
|
-
), i = o == null ? void 0 : o.config.responsive.gapCustom,
|
|
28
|
+
), i = o == null ? void 0 : o.config.responsive.gapCustom, c = o == null ? void 0 : o.config.responsive.gapSections, l = e == null ? void 0 : e.find(
|
|
29
29
|
(d) => {
|
|
30
|
-
var C,
|
|
31
|
-
return ((
|
|
30
|
+
var C, m, p, y;
|
|
31
|
+
return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.deviceType) === "mobile" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), f = l == null ? void 0 : l.config.responsive.gapCustom, u = l == null ? void 0 : l.config.responsive.gapSections;
|
|
34
34
|
return /* @__PURE__ */ N(L, { children: [
|
|
35
35
|
/* @__PURE__ */ b(
|
|
36
36
|
D.Column,
|
|
37
37
|
{
|
|
38
|
-
gap: i &&
|
|
38
|
+
gap: i && c ? c : r,
|
|
39
39
|
className: _.classNameConcat(
|
|
40
40
|
j["responsive-desktop-flex"],
|
|
41
41
|
"utils-column-modifier"
|
|
@@ -46,12 +46,12 @@ const Re = async ({
|
|
|
46
46
|
/* @__PURE__ */ b(
|
|
47
47
|
D.Column,
|
|
48
48
|
{
|
|
49
|
-
gap:
|
|
49
|
+
gap: f && u ? u : r,
|
|
50
50
|
className: _.classNameConcat(
|
|
51
51
|
j["responsive-mobile-flex"],
|
|
52
52
|
"utils-column-modifier"
|
|
53
53
|
),
|
|
54
|
-
children: /* @__PURE__ */ b(n, { data: (
|
|
54
|
+
children: /* @__PURE__ */ b(n, { data: (l == null ? void 0 : l.sections) ?? [], identifyWhoIsFirst: s })
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] });
|
|
@@ -94,35 +94,34 @@ const Re = async ({
|
|
|
94
94
|
ICONS: s,
|
|
95
95
|
SectionZone: o,
|
|
96
96
|
Footer: i,
|
|
97
|
-
FooterSupport:
|
|
98
|
-
|
|
97
|
+
FooterSupport: c,
|
|
98
|
+
hasFooterStamps: l,
|
|
99
|
+
...f
|
|
99
100
|
}) => {
|
|
100
|
-
var
|
|
101
|
-
const { data:
|
|
102
|
-
|
|
103
|
-
u
|
|
104
|
-
), c = Array.isArray(m) && ((C = m[0]) == null ? void 0 : C.type) === "footer" ? m[0] : null, d = {
|
|
105
|
-
...(f = c == null ? void 0 : c.paymentInfo) == null ? void 0 : f.paymentInfo,
|
|
101
|
+
var m, p, y, I, F, O, $, g, S, R, T;
|
|
102
|
+
const { data: u } = await E("footer", f), d = Array.isArray(u) && ((m = u[0]) == null ? void 0 : m.type) === "footer" ? u[0] : null, C = {
|
|
103
|
+
...(p = d == null ? void 0 : d.paymentInfo) == null ? void 0 : p.paymentInfo,
|
|
106
104
|
acceptedFlags: Array.isArray(
|
|
107
|
-
(
|
|
108
|
-
) ? (
|
|
109
|
-
(
|
|
105
|
+
(y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
|
|
106
|
+
) ? (I = d == null ? void 0 : d.paymentInfo) == null ? void 0 : I.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
|
|
107
|
+
(v) => e[v]
|
|
110
108
|
) : []
|
|
111
109
|
};
|
|
112
|
-
return
|
|
110
|
+
return d ? /* @__PURE__ */ b(
|
|
113
111
|
i,
|
|
114
112
|
{
|
|
115
113
|
className: t,
|
|
116
|
-
data: { ...
|
|
117
|
-
socialInfo: (
|
|
118
|
-
socialMedias: (
|
|
119
|
-
payments:
|
|
114
|
+
data: { ...d },
|
|
115
|
+
socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
|
|
116
|
+
socialMedias: ($ = (O = d.socialMedia) == null ? void 0 : O.socialMedia) == null ? void 0 : $.medias,
|
|
117
|
+
payments: C,
|
|
118
|
+
hasFooterStamps: l,
|
|
120
119
|
adornment: {
|
|
121
|
-
...(
|
|
120
|
+
...(S = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && S.content ? {
|
|
122
121
|
bottom: /* @__PURE__ */ b(
|
|
123
|
-
|
|
122
|
+
c,
|
|
124
123
|
{
|
|
125
|
-
content: (
|
|
124
|
+
content: (T = (R = d.supportInfo) == null ? void 0 : R.supportInfo) == null ? void 0 : T.content,
|
|
126
125
|
CONSTANTS: {
|
|
127
126
|
ICONS: s,
|
|
128
127
|
PAYMENT_FLAGS: n,
|
|
@@ -131,7 +130,7 @@ const Re = async ({
|
|
|
131
130
|
}
|
|
132
131
|
)
|
|
133
132
|
} : {},
|
|
134
|
-
...
|
|
133
|
+
...d.sections.length ? { top: /* @__PURE__ */ b(o, { data: d.sections }) } : {}
|
|
135
134
|
},
|
|
136
135
|
LEGAL_INFORMATION_TEXT: r,
|
|
137
136
|
ICONS: s
|
|
@@ -142,7 +141,7 @@ const Re = async ({
|
|
|
142
141
|
ClientHeaderProvider: e,
|
|
143
142
|
...n
|
|
144
143
|
}) => {
|
|
145
|
-
var o, i,
|
|
144
|
+
var o, i, c, l, f, u;
|
|
146
145
|
const { data: r } = await E(
|
|
147
146
|
"header",
|
|
148
147
|
n
|
|
@@ -153,15 +152,15 @@ const Re = async ({
|
|
|
153
152
|
headerData: {
|
|
154
153
|
...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
|
|
155
154
|
subMenus: ((i = s == null ? void 0 : s.sections) == null ? void 0 : i.map((d) => d.data)) ?? [],
|
|
156
|
-
categories: ((
|
|
157
|
-
navigationLinks: ((
|
|
155
|
+
categories: ((l = (c = s == null ? void 0 : s.categories) == null ? void 0 : c.categories) == null ? void 0 : l.items) ?? [],
|
|
156
|
+
navigationLinks: ((u = (f = s == null ? void 0 : s.navigationLinks) == null ? void 0 : f.navigationLinks) == null ? void 0 : u.items) ?? []
|
|
158
157
|
},
|
|
159
158
|
children: t
|
|
160
159
|
}
|
|
161
160
|
);
|
|
162
161
|
}, Oe = (t) => {
|
|
163
|
-
var i,
|
|
164
|
-
const e = (
|
|
162
|
+
var i, c;
|
|
163
|
+
const e = (c = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : c.items;
|
|
165
164
|
if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
|
|
166
165
|
return {
|
|
167
166
|
iconLabel: "",
|
|
@@ -169,17 +168,17 @@ const Re = async ({
|
|
|
169
168
|
content: []
|
|
170
169
|
};
|
|
171
170
|
const n = e == null ? void 0 : e.iconLabel, r = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
|
|
172
|
-
(
|
|
173
|
-
type:
|
|
174
|
-
id: `${
|
|
175
|
-
title:
|
|
176
|
-
subtitle:
|
|
177
|
-
description:
|
|
178
|
-
buttonLabel:
|
|
179
|
-
buttonHref:
|
|
180
|
-
buttonMode:
|
|
181
|
-
buttonSize:
|
|
182
|
-
buttonIcon:
|
|
171
|
+
(l, f) => ({
|
|
172
|
+
type: l.type,
|
|
173
|
+
id: `${f.toString()}-${l.title.toLowerCase()}`,
|
|
174
|
+
title: l.title,
|
|
175
|
+
subtitle: l.subtitle,
|
|
176
|
+
description: l.description,
|
|
177
|
+
buttonLabel: l.buttonLabel,
|
|
178
|
+
buttonHref: l.buttonHref,
|
|
179
|
+
buttonMode: l.buttonMode,
|
|
180
|
+
buttonSize: l.buttonSize,
|
|
181
|
+
buttonIcon: l.buttonIcon
|
|
183
182
|
})
|
|
184
183
|
);
|
|
185
184
|
return {
|
|
@@ -214,17 +213,17 @@ const Re = async ({
|
|
|
214
213
|
LPCadastro: e,
|
|
215
214
|
...n
|
|
216
215
|
}) => {
|
|
217
|
-
var
|
|
216
|
+
var l;
|
|
218
217
|
const { data: r } = await E(
|
|
219
218
|
"lp_cadastro",
|
|
220
219
|
n
|
|
221
220
|
);
|
|
222
221
|
if (!r || !Array.isArray(r) || r.length === 0)
|
|
223
222
|
return null;
|
|
224
|
-
const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((
|
|
223
|
+
const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((l = s == null ? void 0 : s.content) == null ? void 0 : l.conteúdo) || {}, c = s == null ? void 0 : s.sections;
|
|
225
224
|
return /* @__PURE__ */ N(L, { children: [
|
|
226
225
|
/* @__PURE__ */ b(e, { sections: o, content: i }),
|
|
227
|
-
/* @__PURE__ */ b(t, { data:
|
|
226
|
+
/* @__PURE__ */ b(t, { data: c })
|
|
228
227
|
] });
|
|
229
228
|
}, Ae = async ({
|
|
230
229
|
children: t,
|
|
@@ -259,31 +258,31 @@ const Re = async ({
|
|
|
259
258
|
PLPContentProvider: o,
|
|
260
259
|
...i
|
|
261
260
|
}) => {
|
|
262
|
-
const { data:
|
|
261
|
+
const { data: c } = await E(
|
|
263
262
|
"categories_page",
|
|
264
263
|
i
|
|
265
264
|
);
|
|
266
|
-
if (!
|
|
265
|
+
if (!c || !Array.isArray(c))
|
|
267
266
|
return null;
|
|
268
|
-
const
|
|
269
|
-
(
|
|
267
|
+
const l = c.find(
|
|
268
|
+
(m) => {
|
|
270
269
|
var p, y, I;
|
|
271
|
-
return ((p =
|
|
270
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
|
|
272
271
|
}
|
|
273
|
-
),
|
|
274
|
-
(
|
|
272
|
+
), f = c.find(
|
|
273
|
+
(m) => {
|
|
275
274
|
var p, y, I;
|
|
276
|
-
return ((p =
|
|
275
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
|
|
277
276
|
}
|
|
278
|
-
),
|
|
279
|
-
(
|
|
277
|
+
), u = c.find(
|
|
278
|
+
(m) => {
|
|
280
279
|
var p, y, I;
|
|
281
|
-
return ((p =
|
|
280
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
|
|
282
281
|
}
|
|
283
|
-
), d =
|
|
284
|
-
(
|
|
282
|
+
), d = c.find(
|
|
283
|
+
(m) => {
|
|
285
284
|
var p, y, I;
|
|
286
|
-
return ((p =
|
|
285
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
|
|
287
286
|
}
|
|
288
287
|
), C = Array.isArray(t) ? t : [t];
|
|
289
288
|
return /* @__PURE__ */ N(L, { children: [
|
|
@@ -300,7 +299,7 @@ const Re = async ({
|
|
|
300
299
|
children: /* @__PURE__ */ b(
|
|
301
300
|
o,
|
|
302
301
|
{
|
|
303
|
-
data:
|
|
302
|
+
data: l ?? u,
|
|
304
303
|
device: "desktop",
|
|
305
304
|
SectionZone: r,
|
|
306
305
|
COMMON_PAGE_COLUMN_GAP_PDC: s,
|
|
@@ -312,7 +311,7 @@ const Re = async ({
|
|
|
312
311
|
/* @__PURE__ */ b(D.Column, { className: _.classNameConcat(j["responsive-mobile-flex"], t), children: /* @__PURE__ */ b(
|
|
313
312
|
o,
|
|
314
313
|
{
|
|
315
|
-
data:
|
|
314
|
+
data: f ?? d,
|
|
316
315
|
device: "mobile",
|
|
317
316
|
SectionZone: r,
|
|
318
317
|
COMMON_PAGE_COLUMN_GAP_PDC: s,
|
|
@@ -321,7 +320,7 @@ const Re = async ({
|
|
|
321
320
|
) })
|
|
322
321
|
] });
|
|
323
322
|
}, Ne = async ({ slug: t, ...e }) => {
|
|
324
|
-
var i,
|
|
323
|
+
var i, c, l;
|
|
325
324
|
const { data: n } = await E(
|
|
326
325
|
"redirect_to_search",
|
|
327
326
|
e
|
|
@@ -332,7 +331,7 @@ const Re = async ({
|
|
|
332
331
|
query: null,
|
|
333
332
|
redirect: !1
|
|
334
333
|
};
|
|
335
|
-
const r = ((
|
|
334
|
+
const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
|
|
336
335
|
if (!!!r.length)
|
|
337
336
|
return {
|
|
338
337
|
slug: t,
|
|
@@ -340,9 +339,9 @@ const Re = async ({
|
|
|
340
339
|
redirect: !1
|
|
341
340
|
};
|
|
342
341
|
const o = r.find(
|
|
343
|
-
(
|
|
344
|
-
var
|
|
345
|
-
return ((
|
|
342
|
+
(f) => {
|
|
343
|
+
var u, d;
|
|
344
|
+
return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
346
345
|
}
|
|
347
346
|
);
|
|
348
347
|
return o ? {
|
|
@@ -361,20 +360,20 @@ const Re = async ({
|
|
|
361
360
|
sort: null
|
|
362
361
|
};
|
|
363
362
|
}, ke = async ({ slug: t, ...e }) => {
|
|
364
|
-
var i,
|
|
363
|
+
var i, c, l;
|
|
365
364
|
const { data: n } = await E(
|
|
366
365
|
"redirect_to_search",
|
|
367
366
|
e
|
|
368
367
|
);
|
|
369
368
|
if (!n || !Array.isArray(n))
|
|
370
369
|
return null;
|
|
371
|
-
const r = ((
|
|
370
|
+
const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
|
|
372
371
|
if (!!!r.length)
|
|
373
372
|
return null;
|
|
374
373
|
const o = r.find(
|
|
375
|
-
(
|
|
376
|
-
var
|
|
377
|
-
return ((
|
|
374
|
+
(f) => {
|
|
375
|
+
var u, d;
|
|
376
|
+
return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
378
377
|
}
|
|
379
378
|
);
|
|
380
379
|
return o ? {
|
|
@@ -437,8 +436,8 @@ const Re = async ({
|
|
|
437
436
|
cache: i,
|
|
438
437
|
...r ? { body: JSON.stringify(r) } : {}
|
|
439
438
|
// not body in get
|
|
440
|
-
}).then((
|
|
441
|
-
console.error("[ERROR FETCH VTEX]",
|
|
439
|
+
}).then((c) => c.json()).catch((c) => {
|
|
440
|
+
console.error("[ERROR FETCH VTEX]", c);
|
|
442
441
|
});
|
|
443
442
|
}, w = /* @__PURE__ */ new Map();
|
|
444
443
|
async function He(t, e = {}) {
|
|
@@ -522,7 +521,7 @@ async function J({
|
|
|
522
521
|
return;
|
|
523
522
|
}
|
|
524
523
|
await Me.validate(e);
|
|
525
|
-
const { orderFormId: s, sellerCode: o, marketingData: i } = e,
|
|
524
|
+
const { orderFormId: s, sellerCode: o, marketingData: i } = e, c = o ? {
|
|
526
525
|
utmCampaign: o ? o.toUpperCase() : "",
|
|
527
526
|
utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
|
|
528
527
|
} : {};
|
|
@@ -532,7 +531,7 @@ async function J({
|
|
|
532
531
|
method: "POST",
|
|
533
532
|
body: {
|
|
534
533
|
...i,
|
|
535
|
-
...
|
|
534
|
+
...c
|
|
536
535
|
},
|
|
537
536
|
...r
|
|
538
537
|
}
|
|
@@ -736,8 +735,8 @@ async function ct({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
736
735
|
return;
|
|
737
736
|
}
|
|
738
737
|
await it.validate(e);
|
|
739
|
-
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e,
|
|
740
|
-
return h(
|
|
738
|
+
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, c = i ? `/${o}/remove` : "", l = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${c}`;
|
|
739
|
+
return h(l, {
|
|
741
740
|
method: "POST",
|
|
742
741
|
body: { id: o },
|
|
743
742
|
...n
|
|
@@ -1100,9 +1099,9 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1100
1099
|
visible: t.visible
|
|
1101
1100
|
}
|
|
1102
1101
|
}), B = (t, e, n) => {
|
|
1103
|
-
const r = t.flatMap(({ name: i, values:
|
|
1102
|
+
const r = t.flatMap(({ name: i, values: c }) => c ? c.map((l) => ({
|
|
1104
1103
|
name: i,
|
|
1105
|
-
value:
|
|
1104
|
+
value: l,
|
|
1106
1105
|
valueReference: H.specification
|
|
1107
1106
|
})) : {
|
|
1108
1107
|
name: i,
|
|
@@ -1170,11 +1169,11 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1170
1169
|
additionalProperty: B(o, e, []),
|
|
1171
1170
|
name: r,
|
|
1172
1171
|
offers: {
|
|
1173
|
-
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer:
|
|
1174
|
-
availability: _t(
|
|
1175
|
-
listPrice:
|
|
1176
|
-
price:
|
|
1177
|
-
quantity:
|
|
1172
|
+
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: c }) => ({
|
|
1173
|
+
availability: _t(c.AvailableQuantity > 0),
|
|
1174
|
+
listPrice: c.ListPrice,
|
|
1175
|
+
price: c.Price,
|
|
1176
|
+
quantity: c.AvailableQuantity,
|
|
1178
1177
|
seller: {
|
|
1179
1178
|
identifier: i
|
|
1180
1179
|
}
|
|
@@ -1184,7 +1183,7 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1184
1183
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1185
1184
|
};
|
|
1186
1185
|
}, zt = (t) => {
|
|
1187
|
-
var
|
|
1186
|
+
var v;
|
|
1188
1187
|
const {
|
|
1189
1188
|
attributes: e,
|
|
1190
1189
|
referenceId: n,
|
|
@@ -1192,14 +1191,14 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1192
1191
|
images: s,
|
|
1193
1192
|
itemId: o,
|
|
1194
1193
|
name: i,
|
|
1195
|
-
sellers:
|
|
1196
|
-
videos:
|
|
1197
|
-
variations:
|
|
1194
|
+
sellers: c,
|
|
1195
|
+
videos: l,
|
|
1196
|
+
variations: f
|
|
1198
1197
|
} = t, {
|
|
1199
|
-
brand:
|
|
1198
|
+
brand: u,
|
|
1200
1199
|
categories: d,
|
|
1201
1200
|
categoriesIds: C,
|
|
1202
|
-
description:
|
|
1201
|
+
description: m,
|
|
1203
1202
|
linkText: p,
|
|
1204
1203
|
productClusters: y,
|
|
1205
1204
|
clusterHighlights: I,
|
|
@@ -1207,21 +1206,21 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1207
1206
|
properties: O,
|
|
1208
1207
|
productId: $,
|
|
1209
1208
|
productReference: g
|
|
1210
|
-
} = r,
|
|
1209
|
+
} = r, S = d.slice().reverse(), R = ne(c, t.isVariantOf), T = re(R.offers[0].installments);
|
|
1211
1210
|
return {
|
|
1212
1211
|
sku: o,
|
|
1213
|
-
gtin: ((
|
|
1212
|
+
gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
|
|
1214
1213
|
name: F ?? i,
|
|
1215
|
-
description:
|
|
1214
|
+
description: m,
|
|
1216
1215
|
releaseDate: r.releaseDate ?? "",
|
|
1217
1216
|
slug: p,
|
|
1218
|
-
video:
|
|
1217
|
+
video: l[0],
|
|
1219
1218
|
categories: d,
|
|
1220
1219
|
categoriesIds: C,
|
|
1221
1220
|
id: $,
|
|
1222
|
-
brand: { name:
|
|
1221
|
+
brand: { name: u, brandName: u },
|
|
1223
1222
|
seo: {
|
|
1224
|
-
description:
|
|
1223
|
+
description: m,
|
|
1225
1224
|
title: F,
|
|
1226
1225
|
canonical: te(p)
|
|
1227
1226
|
},
|
|
@@ -1233,7 +1232,7 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1233
1232
|
availability: { status: R.offers[0].availability },
|
|
1234
1233
|
breadcrumbList: {
|
|
1235
1234
|
itemListElement: [
|
|
1236
|
-
...
|
|
1235
|
+
...S.map((A, P) => {
|
|
1237
1236
|
const q = A.split("/"), G = q[q.length - 2], ie = q.map(ee).join("/");
|
|
1238
1237
|
return {
|
|
1239
1238
|
name: G,
|
|
@@ -1251,15 +1250,15 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1251
1250
|
},
|
|
1252
1251
|
image: Z(s),
|
|
1253
1252
|
offers: R,
|
|
1254
|
-
additionalProperty: B(
|
|
1253
|
+
additionalProperty: B(f, e, []),
|
|
1255
1254
|
isVariantOf: {
|
|
1256
1255
|
productGroupID: r.productId,
|
|
1257
1256
|
hasVariant: r.items.map((A) => ae(A))
|
|
1258
1257
|
},
|
|
1259
|
-
installments:
|
|
1258
|
+
installments: T
|
|
1260
1259
|
};
|
|
1261
1260
|
}, xt = (t) => {
|
|
1262
|
-
var
|
|
1261
|
+
var T;
|
|
1263
1262
|
const {
|
|
1264
1263
|
attributes: e,
|
|
1265
1264
|
referenceId: n,
|
|
@@ -1267,37 +1266,37 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1267
1266
|
images: s,
|
|
1268
1267
|
itemId: o,
|
|
1269
1268
|
name: i,
|
|
1270
|
-
sellers:
|
|
1271
|
-
Videos:
|
|
1272
|
-
variations:
|
|
1269
|
+
sellers: c,
|
|
1270
|
+
Videos: l,
|
|
1271
|
+
variations: f
|
|
1273
1272
|
} = t, {
|
|
1274
|
-
brand:
|
|
1273
|
+
brand: u,
|
|
1275
1274
|
categories: d,
|
|
1276
1275
|
categoriesIds: C,
|
|
1277
|
-
description:
|
|
1276
|
+
description: m,
|
|
1278
1277
|
linkText: p,
|
|
1279
1278
|
productClusters: y,
|
|
1280
1279
|
productName: I,
|
|
1281
1280
|
Coleção: F,
|
|
1282
1281
|
"ID Coleção": O,
|
|
1283
1282
|
productId: $
|
|
1284
|
-
} = r, g = d.slice().reverse(),
|
|
1283
|
+
} = r, g = d.slice().reverse(), S = ne(c, t.isVariantOf), R = re(S.offers[0].installments);
|
|
1285
1284
|
return {
|
|
1286
1285
|
sku: o,
|
|
1287
|
-
gtin: ((
|
|
1286
|
+
gtin: ((T = n[0]) == null ? void 0 : T.Value) ?? "",
|
|
1288
1287
|
name: I ?? i,
|
|
1289
|
-
description:
|
|
1288
|
+
description: m,
|
|
1290
1289
|
releaseDate: r.releaseDate ?? "",
|
|
1291
1290
|
slug: p,
|
|
1292
|
-
video:
|
|
1291
|
+
video: l[0],
|
|
1293
1292
|
categories: d,
|
|
1294
1293
|
categoriesIds: C,
|
|
1295
1294
|
collection: F,
|
|
1296
1295
|
collectionId: O,
|
|
1297
1296
|
id: $,
|
|
1298
|
-
brand: { name:
|
|
1297
|
+
brand: { name: u, brandName: u },
|
|
1299
1298
|
seo: {
|
|
1300
|
-
description:
|
|
1299
|
+
description: m,
|
|
1301
1300
|
title: I,
|
|
1302
1301
|
canonical: te(p)
|
|
1303
1302
|
},
|
|
@@ -1306,11 +1305,11 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1306
1305
|
highlights: []
|
|
1307
1306
|
// TODO: add highlights
|
|
1308
1307
|
},
|
|
1309
|
-
availability: { status:
|
|
1308
|
+
availability: { status: S.offers[0].availability },
|
|
1310
1309
|
breadcrumbList: {
|
|
1311
1310
|
itemListElement: [
|
|
1312
|
-
...g.map((
|
|
1313
|
-
const P =
|
|
1311
|
+
...g.map((v, A) => {
|
|
1312
|
+
const P = v.split("/"), q = P[P.length - 2], G = P.map(ee).join("/");
|
|
1314
1313
|
return {
|
|
1315
1314
|
name: q,
|
|
1316
1315
|
item: G,
|
|
@@ -1326,17 +1325,17 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
|
1326
1325
|
numberOfItems: d.length
|
|
1327
1326
|
},
|
|
1328
1327
|
image: Z(s),
|
|
1329
|
-
offers:
|
|
1330
|
-
additionalProperty: B(
|
|
1328
|
+
offers: S,
|
|
1329
|
+
additionalProperty: B(f, e, []),
|
|
1331
1330
|
isVariantOf: {
|
|
1332
1331
|
productGroupID: r.productId,
|
|
1333
|
-
hasVariant: r.items.map((
|
|
1334
|
-
const { variations: A } =
|
|
1332
|
+
hasVariant: r.items.map((v) => {
|
|
1333
|
+
const { variations: A } = v, P = A.map((q) => ({
|
|
1335
1334
|
name: q,
|
|
1336
|
-
values:
|
|
1335
|
+
values: v[q]
|
|
1337
1336
|
}));
|
|
1338
1337
|
return {
|
|
1339
|
-
...ae(
|
|
1338
|
+
...ae(v),
|
|
1340
1339
|
additionalProperty: B(
|
|
1341
1340
|
P,
|
|
1342
1341
|
e,
|
|
@@ -1357,17 +1356,17 @@ async function Kt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1357
1356
|
return;
|
|
1358
1357
|
}
|
|
1359
1358
|
await Qt.validate(e);
|
|
1360
|
-
const r = new URLSearchParams({}), s = e.map(({ key: i, value:
|
|
1359
|
+
const r = new URLSearchParams({}), s = e.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
|
|
1361
1360
|
le(e, r);
|
|
1362
1361
|
const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1363
1362
|
return h(o, {
|
|
1364
1363
|
cache: "no-store",
|
|
1365
1364
|
...n
|
|
1366
|
-
}).then((i) => i.map((
|
|
1367
|
-
const
|
|
1368
|
-
return
|
|
1369
|
-
}).filter((
|
|
1370
|
-
node: xt(
|
|
1365
|
+
}).then((i) => i.map((l) => {
|
|
1366
|
+
const f = X(l.items);
|
|
1367
|
+
return f && Y(f, l);
|
|
1368
|
+
}).filter((l) => !!l).map((l) => ({
|
|
1369
|
+
node: xt(l)
|
|
1371
1370
|
})));
|
|
1372
1371
|
}
|
|
1373
1372
|
const se = ({
|
|
@@ -1384,22 +1383,22 @@ const se = ({
|
|
|
1384
1383
|
query: s = "",
|
|
1385
1384
|
page: o = 1,
|
|
1386
1385
|
count: i,
|
|
1387
|
-
sort:
|
|
1388
|
-
facets:
|
|
1389
|
-
type:
|
|
1390
|
-
hideUnavailableItems:
|
|
1386
|
+
sort: c = "",
|
|
1387
|
+
facets: l = [],
|
|
1388
|
+
type: f,
|
|
1389
|
+
hideUnavailableItems: u = !0,
|
|
1391
1390
|
locale: d = ""
|
|
1392
1391
|
} = e, C = new URLSearchParams({
|
|
1393
1392
|
page: o.toString(),
|
|
1394
1393
|
count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
|
|
1395
1394
|
query: s,
|
|
1396
|
-
sort:
|
|
1395
|
+
sort: c,
|
|
1397
1396
|
locale: d
|
|
1398
1397
|
});
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1398
|
+
u !== void 0 && C.append("hideUnavailableItems", u.toString());
|
|
1399
|
+
const m = l.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
|
|
1401
1400
|
return He(
|
|
1402
|
-
`${t}/api/io/_v/api/intelligent-search/${
|
|
1401
|
+
`${t}/api/io/_v/api/intelligent-search/${f}/${m}?${C.toString()}`,
|
|
1403
1402
|
{
|
|
1404
1403
|
headers: {
|
|
1405
1404
|
Accept: "application/json",
|
|
@@ -1421,10 +1420,10 @@ async function Jt({ body: t, extraData: e, ...n }) {
|
|
|
1421
1420
|
},
|
|
1422
1421
|
extraData: e,
|
|
1423
1422
|
...n
|
|
1424
|
-
}), s = (r == null ? void 0 : r.products.map((
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1427
|
-
}).filter((
|
|
1423
|
+
}), s = (r == null ? void 0 : r.products.map((c) => {
|
|
1424
|
+
const l = X(c.items);
|
|
1425
|
+
return l && Y(l, c);
|
|
1426
|
+
}).filter((c) => !!c)) ?? [], {
|
|
1428
1427
|
pagination: o,
|
|
1429
1428
|
recordsFiltered: i
|
|
1430
1429
|
} = r;
|
|
@@ -1438,9 +1437,9 @@ async function Jt({ body: t, extraData: e, ...n }) {
|
|
|
1438
1437
|
count: i,
|
|
1439
1438
|
total: o.count
|
|
1440
1439
|
},
|
|
1441
|
-
products: s.map((
|
|
1442
|
-
node: zt(
|
|
1443
|
-
cursor:
|
|
1440
|
+
products: s.map((c, l) => ({
|
|
1441
|
+
node: zt(c),
|
|
1442
|
+
cursor: l.toString()
|
|
1444
1443
|
}))
|
|
1445
1444
|
}
|
|
1446
1445
|
};
|
|
@@ -1543,11 +1542,11 @@ async function sr({
|
|
|
1543
1542
|
const r = new URLSearchParams();
|
|
1544
1543
|
await ar.validate(e);
|
|
1545
1544
|
const { masterDataEntity: s, searchFields: o, headers: i } = e;
|
|
1546
|
-
o && Object.entries(o).forEach(([
|
|
1547
|
-
r.append(
|
|
1545
|
+
o && Object.entries(o).forEach(([l, f]) => {
|
|
1546
|
+
r.append(l, String(f));
|
|
1548
1547
|
}), "_fields" in o || r == null || r.append("_fields", "_all");
|
|
1549
|
-
const
|
|
1550
|
-
return h(
|
|
1548
|
+
const c = `${t}/api/dataentities/${s}/search?${r.toString()}`;
|
|
1549
|
+
return h(c, {
|
|
1551
1550
|
headers: {
|
|
1552
1551
|
"REST-Range": i["REST-Range"] ?? "resources=0-20"
|
|
1553
1552
|
},
|
|
@@ -1592,99 +1591,99 @@ async function lr({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1592
1591
|
const { NAME_SPLIT_SYMBOL: o } = n;
|
|
1593
1592
|
if (!o)
|
|
1594
1593
|
return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
|
|
1595
|
-
const i = s.map((
|
|
1594
|
+
const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), c = await h(
|
|
1596
1595
|
`${e}/api/catalog_system/pub/products/search?fq=${i}`,
|
|
1597
1596
|
{
|
|
1598
1597
|
...r
|
|
1599
1598
|
}
|
|
1600
|
-
),
|
|
1601
|
-
return
|
|
1599
|
+
), l = (u) => Object.keys(u).map((d) => ({ id: d, name: u[d] }));
|
|
1600
|
+
return c.map((u, d) => {
|
|
1602
1601
|
var $;
|
|
1603
|
-
const { installments: C, price:
|
|
1602
|
+
const { installments: C, price: m, listPrice: p, sizes: y, allSizesAvailable: I } = de({ items: u.items, NAME_SPLIT_SYMBOL: o }), F = I ? !0 : y.some((g) => g.available), O = u.items[0].sellers[0].commertialOffer;
|
|
1604
1603
|
return {
|
|
1605
1604
|
node: {
|
|
1606
|
-
sku:
|
|
1607
|
-
gtin:
|
|
1608
|
-
name:
|
|
1609
|
-
description:
|
|
1610
|
-
releaseDate:
|
|
1611
|
-
slug:
|
|
1612
|
-
categories:
|
|
1613
|
-
categoriesIds:
|
|
1614
|
-
id:
|
|
1605
|
+
sku: u.items[0].itemId,
|
|
1606
|
+
gtin: u.productReference,
|
|
1607
|
+
name: u.productName,
|
|
1608
|
+
description: u.description,
|
|
1609
|
+
releaseDate: u.releaseDate,
|
|
1610
|
+
slug: u.linkText,
|
|
1611
|
+
categories: u.categories,
|
|
1612
|
+
categoriesIds: u.categoriesIds,
|
|
1613
|
+
id: u.items[0].itemId,
|
|
1615
1614
|
brand: {
|
|
1616
|
-
name:
|
|
1617
|
-
brandName:
|
|
1615
|
+
name: u.brand,
|
|
1616
|
+
brandName: u.brand
|
|
1618
1617
|
},
|
|
1619
1618
|
seo: {
|
|
1620
|
-
description:
|
|
1621
|
-
title:
|
|
1622
|
-
canonical: `/${
|
|
1619
|
+
description: u.description,
|
|
1620
|
+
title: u.productName,
|
|
1621
|
+
canonical: `/${u.linkText}/p`
|
|
1623
1622
|
},
|
|
1624
1623
|
cluster: {
|
|
1625
|
-
generals: u
|
|
1626
|
-
highlights: u
|
|
1624
|
+
generals: l(u.productClusters),
|
|
1625
|
+
highlights: l(u.clusterHighlights)
|
|
1627
1626
|
},
|
|
1628
1627
|
availability: {
|
|
1629
1628
|
status: F
|
|
1630
1629
|
},
|
|
1631
|
-
image:
|
|
1630
|
+
image: u.items[0].images.map(
|
|
1632
1631
|
({
|
|
1633
1632
|
imageLabel: g,
|
|
1634
|
-
imageUrl:
|
|
1633
|
+
imageUrl: S
|
|
1635
1634
|
}) => ({
|
|
1636
1635
|
alternateName: g,
|
|
1637
|
-
url:
|
|
1636
|
+
url: S,
|
|
1638
1637
|
keywords: g
|
|
1639
1638
|
})
|
|
1640
1639
|
),
|
|
1641
1640
|
offers: {
|
|
1642
|
-
lowPrice:
|
|
1641
|
+
lowPrice: m,
|
|
1643
1642
|
highPrice: p,
|
|
1644
1643
|
offers: [
|
|
1645
1644
|
{
|
|
1646
1645
|
availability: F,
|
|
1647
1646
|
listPrice: p,
|
|
1648
|
-
price:
|
|
1647
|
+
price: m,
|
|
1649
1648
|
priceValidUntil: O.PriceValidUntil,
|
|
1650
1649
|
priceCurrency: "BRL",
|
|
1651
1650
|
installments: O.Installments,
|
|
1652
|
-
lowPrice:
|
|
1651
|
+
lowPrice: m,
|
|
1653
1652
|
quantity: O.AvailableQuantity,
|
|
1654
1653
|
seller: {
|
|
1655
|
-
identifier:
|
|
1654
|
+
identifier: u.items[0].sellers[0].sellerId
|
|
1656
1655
|
}
|
|
1657
1656
|
}
|
|
1658
1657
|
]
|
|
1659
1658
|
},
|
|
1660
|
-
additionalProperty: ($ =
|
|
1661
|
-
name:
|
|
1659
|
+
additionalProperty: ($ = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : $.map((g) => ({
|
|
1660
|
+
name: u == null ? void 0 : u.skuSpecifications[0].field.name,
|
|
1662
1661
|
value: g,
|
|
1663
1662
|
valueReference: "SPECIFICATION"
|
|
1664
1663
|
})),
|
|
1665
1664
|
isVariantOf: {
|
|
1666
|
-
productGroupID:
|
|
1667
|
-
hasVariant:
|
|
1668
|
-
var
|
|
1665
|
+
productGroupID: u.productId,
|
|
1666
|
+
hasVariant: u.items.map((g) => {
|
|
1667
|
+
var S;
|
|
1669
1668
|
return {
|
|
1670
1669
|
additionalProperty: g == null ? void 0 : g.variations.map(() => {
|
|
1671
|
-
var R,
|
|
1670
|
+
var R, T, v;
|
|
1672
1671
|
return {
|
|
1673
1672
|
name: (R = g == null ? void 0 : g.variations) == null ? void 0 : R[0],
|
|
1674
|
-
value: (
|
|
1673
|
+
value: (v = g == null ? void 0 : g[(T = g == null ? void 0 : g.variations) == null ? void 0 : T[0]]) == null ? void 0 : v[0],
|
|
1675
1674
|
valueReference: "SPECIFICATION"
|
|
1676
1675
|
};
|
|
1677
1676
|
}),
|
|
1678
1677
|
name: g.name,
|
|
1679
1678
|
offers: {
|
|
1680
|
-
offers: (
|
|
1681
|
-
({ commertialOffer: R, sellerId:
|
|
1679
|
+
offers: (S = g.sellers) == null ? void 0 : S.map(
|
|
1680
|
+
({ commertialOffer: R, sellerId: T }) => ({
|
|
1682
1681
|
availability: "https://schema.org/InStock",
|
|
1683
1682
|
listPrice: R.ListPrice,
|
|
1684
1683
|
price: R.Price,
|
|
1685
1684
|
quantity: R.AvailableQuantity,
|
|
1686
1685
|
seller: {
|
|
1687
|
-
identifier:
|
|
1686
|
+
identifier: T
|
|
1688
1687
|
}
|
|
1689
1688
|
})
|
|
1690
1689
|
)
|
|
@@ -1748,7 +1747,7 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1748
1747
|
items: t.items
|
|
1749
1748
|
}), oe = (t, e) => t.reduce((n, r) => {
|
|
1750
1749
|
if (r.items.filter(
|
|
1751
|
-
(i) => i.sellers.find((
|
|
1750
|
+
(i) => i.sellers.find((c) => c.commertialOffer.IsAvailable)
|
|
1752
1751
|
).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
|
|
1753
1752
|
return n;
|
|
1754
1753
|
const o = r.items[0].images.find(
|
|
@@ -1775,15 +1774,15 @@ const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1775
1774
|
filterNonRootFacets: me,
|
|
1776
1775
|
filterNonCategorySelected: pe
|
|
1777
1776
|
}, Rr = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1778
|
-
const
|
|
1777
|
+
const c = await fetch(
|
|
1779
1778
|
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
|
|
1780
|
-
).then((
|
|
1779
|
+
).then((f) => f.json()), l = oe(c, o);
|
|
1781
1780
|
return /* @__PURE__ */ N("div", { className: M.similars, children: [
|
|
1782
1781
|
/* @__PURE__ */ N("div", { className: M["similars-info"], children: [
|
|
1783
1782
|
/* @__PURE__ */ b("span", { className: M["sections-title"], children: s.product.color_title }),
|
|
1784
1783
|
t
|
|
1785
1784
|
] }),
|
|
1786
|
-
/* @__PURE__ */ b(r, { productId: n, similars:
|
|
1785
|
+
/* @__PURE__ */ b(r, { productId: n, similars: l, TOGGLE_STYLE_MODIFIER: i })
|
|
1787
1786
|
] });
|
|
1788
1787
|
}, Or = {
|
|
1789
1788
|
checkout: Et,
|