@soma-vertical-web/multi-lib 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/contexts/contexts/header/HeaderCategoryContext.d.ts +7 -0
  2. package/contexts/contexts/header/MenuMobileContext.d.ts +5 -4
  3. package/contexts/index.d.ts +2 -2
  4. package/index.js +17 -17
  5. package/index.mjs +4837 -4881
  6. package/layout/index.d.ts +2 -2
  7. package/layout/team-component/Header/Composite/HeaderDesktopWrapper.d.ts +5 -1
  8. package/layout/team-component/Header/Composite/HeaderMobileWrapper.d.ts +6 -1
  9. package/layout/team-component/Header/index.d.ts +1 -1
  10. package/layout/team-component/Menu/Composite/Mobile/Body/Body.d.ts +7 -0
  11. package/layout/team-component/Menu/Composite/Mobile/Body/Category/Banner.d.ts +7 -0
  12. package/layout/team-component/Menu/Composite/Mobile/Body/Category/Category.d.ts +7 -0
  13. package/layout/team-component/Menu/Composite/Mobile/Body/Category/List.d.ts +7 -0
  14. package/layout/team-component/Menu/Composite/Mobile/Body/Category/SubCategory.d.ts +7 -0
  15. package/layout/team-component/Menu/Composite/Mobile/Body/Category/Title.d.ts +7 -0
  16. package/layout/team-component/Menu/Composite/Mobile/Body/Category/index.d.ts +22 -0
  17. package/layout/team-component/Menu/Composite/Mobile/{Body/SubMenu/SubMenu.d.ts → Header/Header.d.ts} +2 -2
  18. package/layout/team-component/Menu/Composite/Mobile/MenuRoot.d.ts +4 -7
  19. package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBarItem.d.ts → BarItem.d.ts} +1 -1
  20. package/layout/team-component/Menu/MenuMobile.d.ts +7 -8
  21. package/layout/team-component/UserMenu/Composite/Menu.d.ts +1 -1
  22. package/layout/team-component/UserMenu/UserMenu.d.ts +1 -1
  23. package/layout/team-component/UserMenu/index.d.ts +3 -1
  24. package/package.json +1 -1
  25. package/style.css +1 -1
  26. package/types/cms/ContentTypes/Header/index.d.ts +9 -1
  27. package/types/constants.d.ts +12 -14
  28. package/types/layout/team-components/Header/index.d.ts +9 -1
  29. package/types/layout/team-components/Menu/Mobile/Body/Category/index.d.ts +23 -0
  30. package/types/layout/team-components/Menu/Mobile/Body/index.d.ts +3 -0
  31. package/types/layout/team-components/Menu/Mobile/index.d.ts +10 -1
  32. package/types/layout/team-components/UserMenu/index.d.ts +10 -7
  33. package/Footer-93X9fl_J.mjs +0 -7055
  34. package/Footer-BjB3blIh.mjs +0 -6956
  35. package/Footer-By1Gk2Ku.mjs +0 -7050
  36. package/Footer-COiI-tye.mjs +0 -7049
  37. package/Footer-CZqTxkCn.js +0 -41
  38. package/Footer-D3zDoa2N.mjs +0 -6961
  39. package/Footer-DfAuGt3s.js +0 -41
  40. package/Footer-TLfR7lta.js +0 -41
  41. package/Footer-okPVOqRy.js +0 -41
  42. package/Footer-rMb9FYog.js +0 -41
  43. package/SearchPageScreening-BIyp1dAW.mjs +0 -112
  44. package/SearchPageScreening-gO7dG13l.js +0 -1
  45. package/__vite-browser-external-B8mGO3z6.js +0 -1
  46. package/__vite-browser-external-BYRIRx8p.mjs +0 -8
  47. package/__vite-browser-external-C4n7rb1H.mjs +0 -85
  48. package/__vite-browser-external-Cjz79hOw.js +0 -1
  49. package/__vite-browser-external-CpdIDx9o.mjs +0 -79
  50. package/__vite-browser-external-DDWPeg5L.js +0 -1
  51. package/cms/ContentTypes/CommonPage/index.d.ts +0 -2
  52. package/cms/ContentTypes/FlagsAndTags/index.d.ts +0 -1
  53. package/cms/ContentTypes/PLP/PLPContentContext.d.ts +0 -4
  54. package/cms/ContentTypes/Search/SearchContentScreening.d.ts +0 -3
  55. package/cms/ContentTypes/index.d.ts +0 -6
  56. package/data/actions/masterDataServices.d.ts +0 -5
  57. package/data/api/user/index.d.ts +0 -3
  58. package/data/helpers/search/policy.d.ts +0 -3
  59. package/data/helpers/search/product/utils/index.d.ts +0 -8
  60. package/data/helpers/search/region.d.ts +0 -3
  61. package/index-ASRiF3PD.js +0 -1
  62. package/index-BJzBUeMp.js +0 -1
  63. package/index-BR5lPUsH.js +0 -1
  64. package/index-BRfMTuMz.mjs +0 -405
  65. package/index-BYY2x6mQ.js +0 -1
  66. package/index-Ba7fQCkk.js +0 -1
  67. package/index-BzNV29ol.mjs +0 -402
  68. package/index-C3QT-3iu.mjs +0 -355
  69. package/index-C5zOWvXN.js +0 -1
  70. package/index-CbOiLJQX.mjs +0 -403
  71. package/index-CiBRnp7U.js +0 -1
  72. package/index-CiMxj6Pg.mjs +0 -412
  73. package/index-CkcBCfzG.js +0 -1
  74. package/index-CuKKHhKx.mjs +0 -355
  75. package/index-D3ONVIla.mjs +0 -412
  76. package/index-DD12Nl4r.mjs +0 -412
  77. package/index-DJR4CcKO.mjs +0 -398
  78. package/index-DJeLEsRl.js +0 -1
  79. package/index-DKnolQoT.mjs +0 -412
  80. package/index-DYpuW0tu.mjs +0 -354
  81. package/index-D__YfUie.js +0 -1
  82. package/index-DfnS9D5I.mjs +0 -354
  83. package/index-Do5eAlCL.mjs +0 -219
  84. package/index-VkanwPXK.mjs +0 -221
  85. package/index-WV5Gjz3i.js +0 -1
  86. package/index-catAI5a3.mjs +0 -258
  87. package/index-drKDwA8_.js +0 -1
  88. package/layout/team-component/Menu/Composite/Mobile/Body/MenuBody.d.ts +0 -7
  89. package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategories.d.ts +0 -7
  90. package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategoriesWrapper.d.ts +0 -7
  91. package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuItem.d.ts +0 -7
  92. package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuSubCategory.d.ts +0 -7
  93. package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderContainer.d.ts +0 -5
  94. package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderNavLinks.d.ts +0 -7
  95. package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderWrapper.d.ts +0 -7
  96. package/types/data/actions/index.d.ts +0 -27
  97. package/types/layout/team-components/PDCNavigation/intex.d.ts +0 -9
  98. package/types/layout/team-components/ProductList/Composite/Card/index.d.ts +0 -9
  99. package/types/utils.d.ts +0 -3
  100. /package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBar.d.ts → Bar.d.ts} +0 -0
@@ -1,355 +0,0 @@
1
- import { jsxs as y, Fragment as w, jsx as f } from "react/jsx-runtime";
2
- import { Utils as N } from "@soma-vertical-web/core-components";
3
- const h = (e, t = !0) => Intl.NumberFormat("pt-BR", {
4
- style: "currency",
5
- currency: "BRL",
6
- minimumFractionDigits: t ? 2 : 0
7
- }).format(e), O = ({ valueInCents: e, hasFree: t, freeTaxMessage: n }) => e === 0 ? t ? n : h(0) : h(e / 100), I = (e, t) => {
8
- const [n, s] = e.split(t);
9
- return { name: n.trim(), size: s ? s.trim() : "" };
10
- }, P = (e, t) => {
11
- if (!e)
12
- return {};
13
- const [n, s] = e.split(t);
14
- return { color: n == null ? void 0 : n.trim(), size: s == null ? void 0 : s.trim() };
15
- }, R = (e, t = "tamanho") => {
16
- if (e.additionalProperty) {
17
- const [n] = e.additionalProperty;
18
- return n != null && n.name ? n.name.toLocaleLowerCase() === t ? n.value : e.name : "";
19
- }
20
- return e.name;
21
- }, F = (e, t) => e.replace(t, "").trim(), z = (e) => e.replace(/\//g, ""), C = ({ items: e, NAME_SPLIT_SYMBOL: t }) => {
22
- const n = {
23
- price: 0,
24
- listPrice: 0,
25
- installments: {
26
- count: 0,
27
- value: 0
28
- }
29
- }, s = (r, i) => {
30
- var m;
31
- i && (i.sellerId = r.sellerId, i.sellerName = r.sellerName, i.available = !0, i.isSellerDefault = r.sellerDefault);
32
- const {
33
- Price: c,
34
- ListPrice: p,
35
- PaymentOptions: { installmentOptions: d }
36
- } = r.commertialOffer;
37
- n.price = c, n.listPrice = p;
38
- const l = (m = d == null ? void 0 : d[0]) == null ? void 0 : m.installments;
39
- if (l) {
40
- const { count: u, value: g } = l[l.length - 1];
41
- n.installments = {
42
- count: u,
43
- value: g / 100
44
- };
45
- }
46
- };
47
- let a = !0;
48
- const o = e.reduce((r, i) => {
49
- var d;
50
- const c = {
51
- name: i.name,
52
- sku: i.itemId,
53
- value: ((d = i.Tamanho) == null ? void 0 : d[0]) ?? I(i.nameComplete ?? i.name, t).size,
54
- available: !1,
55
- sellerId: "",
56
- sellerName: "",
57
- isSellerDefault: !1
58
- }, p = i.sellers.filter((l) => (l.sellerDefault && l.commertialOffer.IsAvailable && (c.available = !0, s(l, c)), l.commertialOffer.IsAvailable));
59
- return !c.isSellerDefault && p.length > 0 && (c.available = !0, s(p[0], {
60
- ...c,
61
- sellerId: p[0].sellerId,
62
- sellerName: p[0].sellerName
63
- })), c.available === !1 && (a = !1), r.push(c), r;
64
- }, []);
65
- return {
66
- ...n,
67
- sizes: o,
68
- allSizesAvailable: a
69
- };
70
- }, j = (e) => e ? !e.offers.offers.find(({ quantity: t = 0 }) => t > 0) : !1, T = (e, t) => {
71
- const n = e.find(
72
- (s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0 && s.seller.identifier === t
73
- );
74
- return n || e.find(
75
- (s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0
76
- );
77
- }, A = ({ images: e, TEXTURE_IMAGE: t }) => e.find((n) => t.includes(n.imageLabel)) ?? e[0], D = (e, t) => {
78
- const n = /\/ids\/(\d+)\//, s = e.match(n);
79
- return s ? e.replace(
80
- `/${s[1]}/`,
81
- `/${s[1]}-${t.width}-${t.height}/`
82
- ) : e;
83
- }, x = (e, t) => {
84
- const n = /\/ids\/(\d+)-(\d+)-(\d+)\//, s = e.match(n);
85
- return s ? e.replace(
86
- `/${s[1]}-${s[2]}-${s[3]}/`,
87
- `/${s[1]}-${t.width}-${t.height}/`
88
- ) : e;
89
- }, B = ({
90
- images: e,
91
- label: t
92
- }) => {
93
- const n = e.filter(
94
- (s) => s.keywords === t.first || s.keywords === t.second || s.alternateName === t.first || s.alternateName === t.second
95
- );
96
- return n.length === 0 ? e.slice(0, 2) : n;
97
- }, E = (e) => {
98
- const [t, n] = e.split("/").map(Number);
99
- if (Number.isNaN(t) || Number.isNaN(n))
100
- throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
101
- return n / t;
102
- }, L = (e, t, n) => {
103
- t && (e ? (t.getAttribute("src") || (t.src = n ?? ""), t.play()) : t.pause());
104
- }, ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
105
- __proto__: null,
106
- disableSKU: j,
107
- formatPriceToCurrency: h,
108
- freightParsePrice: O,
109
- getAspectRatio: E,
110
- getColorAndSizeFromSkuName: P,
111
- getFirstImages: B,
112
- getProductNameWithoutSku: F,
113
- getSKUName: R,
114
- getSkuInfos: C,
115
- getThumbImage: A,
116
- getValidOffer: T,
117
- removeSlashes: z,
118
- resizingImg: D,
119
- setVideoPlay: L,
120
- splitNameAndSizeFromFullName: I,
121
- updatedResizedImg: x
122
- }, Symbol.toStringTag, { value: "Module" })), b = "fuzzy", _ = "operator", U = (e) => ({
123
- isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
124
- }), te = (e, t) => {
125
- const n = decodeURIComponent(t ?? "").slice(1).split("/");
126
- return e.map((s) => {
127
- if (s.key === "category-2" && s.__typename === "FacetBoolean") {
128
- const a = s.values;
129
- return {
130
- ...s,
131
- values: a.filter(
132
- (o) => !n.find(
133
- (r) => r.toLowerCase() === o.value || r.toLowerCase() === o.name.toLowerCase()
134
- )
135
- )
136
- };
137
- }
138
- return s;
139
- });
140
- }, S = (e, t) => t ? e === "category-1" : !1, M = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), q = (e) => e.type === "TEXT", K = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), V = (e) => {
141
- const { key: t, name: n, values: s } = e;
142
- return {
143
- __typename: "FacetBoolean",
144
- key: t,
145
- label: n,
146
- values: s.slice().sort((a, o) => a.name.localeCompare(o.name))
147
- };
148
- }, Y = ({ key: e, values: t }) => ({
149
- __typename: "FacetRange",
150
- key: e,
151
- values: t
152
- }), ne = (e, t, n) => {
153
- if (!(e instanceof Object) || !("facets" in e))
154
- return [];
155
- const { facets: s = [] } = e, a = t != null && t.length ? t[0].key === "category-1" : !1;
156
- return s.filter(
157
- (r) => !n || !S(r.key, a)
158
- ).map(
159
- (r) => q(r) ? V(r) : Y(r)
160
- );
161
- }, se = (e, t) => {
162
- const n = e.find(({ key: a }) => a === b) ?? null, s = e.find(({ key: a }) => a === _) ?? null;
163
- n && K(n) && t.append(b, n.value), s && M(s) && t.append(_, s.value);
164
- }, J = (e) => e.map((t) => {
165
- const [n, s] = t.split("/");
166
- return { key: n, value: s };
167
- }), re = (e, t) => {
168
- const n = decodeURIComponent(t ?? "").slice(1).split("/"), s = e.filter(({ value: o }) => !n.includes(decodeURIComponent(o))).map((o) => ({
169
- ...o,
170
- value: decodeURIComponent(o.value)
171
- })), { isDepartment: a } = U(s);
172
- return s == null ? void 0 : s.filter((o) => !S(o.key, a));
173
- }, ae = ({ pathname: e, searchParams: t }, n) => {
174
- const s = t.get("sort") ?? "", a = t.get("query") ?? null, o = parseInt(t.get("page") ?? "1", 10);
175
- return {
176
- sort: s,
177
- facets: J(n),
178
- term: a,
179
- base: a ? "" : e,
180
- page: o
181
- };
182
- }, oe = (e) => {
183
- const t = new URLSearchParams();
184
- return Object.entries(e).forEach(([n, s]) => {
185
- Array.isArray(s) ? s.forEach((a) => t.append(n, a)) : s !== void 0 && t.append(n, s);
186
- }), t;
187
- }, v = {
188
- "responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
189
- "responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
190
- "responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
191
- "responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
192
- }, $ = {}, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
193
- __proto__: null,
194
- default: $
195
- }, Symbol.toStringTag, { value: "Module" })), le = ({
196
- children: e,
197
- data: t,
198
- SectionZone: n,
199
- className: s
200
- }) => {
201
- var d, l;
202
- const a = ((d = t == null ? void 0 : t.filter((m) => {
203
- var u, g;
204
- return ((g = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : g.deviceType) === "mobile";
205
- })[0]) == null ? void 0 : d.sections) || [], o = ((l = t == null ? void 0 : t.filter((m) => {
206
- var u, g;
207
- return ((g = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : g.deviceType) === "desktop";
208
- })[0]) == null ? void 0 : l.sections) || [], r = a.slice(0, 1), i = a.slice(1, a.length), c = o.slice(0, 1), p = o.slice(1, o.length);
209
- return /* @__PURE__ */ y(w, { children: [
210
- /* @__PURE__ */ y("div", { className: s, children: [
211
- /* @__PURE__ */ f("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: r ?? [] }) }),
212
- /* @__PURE__ */ f("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: c ?? [] }) })
213
- ] }),
214
- e,
215
- /* @__PURE__ */ f("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: i ?? [] }) }),
216
- /* @__PURE__ */ f("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: p ?? [] }) }),
217
- /* @__PURE__ */ f(N.Divider, {})
218
- ] });
219
- };
220
- async function W({ contentType: e, storeId: t, CMS_PROJECT_NAME: n, NextCookies: s }) {
221
- const a = await k({
222
- contentType: e,
223
- storeId: t,
224
- CMS_PROJECT_NAME: n,
225
- NextCookies: s
226
- });
227
- if (a.status === 200) {
228
- const o = {
229
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
230
- contentType: e,
231
- data: a.data
232
- };
233
- console.log("Resultado da chamada:", a);
234
- const r = `backup-${e}-${Date.now()}.json`;
235
- return await $.writeFile(
236
- `./backups/${r}`,
237
- JSON.stringify(o, null, 2),
238
- "utf-8"
239
- ), { success: !0, fileName: r };
240
- }
241
- return { success: !1, error: a.error || "No data to backup" };
242
- }
243
- async function G(e) {
244
- return W(e);
245
- }
246
- async function H({
247
- contentType: e,
248
- documentId: t,
249
- versionId: n,
250
- storeId: s,
251
- CMS_PROJECT_NAME: a
252
- }) {
253
- const o = t && t.length ? `/${t}` : "", r = n && n.length ? `?versionId=${n}` : "";
254
- return fetch(
255
- `https://${s}.myvtex.com/_v/cms/api/${a}/${e}${o}${r}`,
256
- { cache: "no-cache" }
257
- );
258
- }
259
- async function X({
260
- contentType: e,
261
- documents: t,
262
- NextCookies: n,
263
- previewId: s,
264
- CMS_PROJECT_NAME: a,
265
- storeId: o
266
- }) {
267
- var i;
268
- const r = JSON.parse(
269
- s ?? ((i = n == null ? void 0 : n().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
270
- );
271
- if (r && (r == null ? void 0 : r.contentType) === e) {
272
- const c = r.documentId && r.documentId.length ? `/${r.documentId}` : "", p = r != null && r.versionId && (r != null && r.versionId.length) ? `?versionId=${r == null ? void 0 : r.versionId}` : "", l = await (await fetch(
273
- `https://${o}.myvtex.com/_v/cms/api/${a}/${e}${c}${p}`,
274
- { cache: "no-store" }
275
- )).json(), m = t.filter(
276
- (u) => l.id !== u.documentId
277
- );
278
- return m.unshift(l), m;
279
- }
280
- return t;
281
- }
282
- async function k({
283
- contentType: e,
284
- NextCookies: t,
285
- CMS_PROJECT_NAME: n,
286
- storeId: s,
287
- previewId: a
288
- }) {
289
- var d, l;
290
- const o = JSON.parse(
291
- a ?? ((d = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : d.value) ?? "{}"
292
- ), r = [];
293
- let i = 1, c = 0, p = !0;
294
- try {
295
- do {
296
- const u = await (await fetch(
297
- `https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`
298
- )).json();
299
- i === 1 && (c = u.totalItems), (l = u == null ? void 0 : u.data) != null && l.length && r.push(...u.data), p = u.hasNextPage, i++;
300
- } while (p && r.length < c);
301
- if (o.previewMode && r.length) {
302
- const m = await X({
303
- contentType: e,
304
- documents: r,
305
- NextCookies: t,
306
- CMS_PROJECT_NAME: n,
307
- storeId: s
308
- });
309
- return {
310
- status: m.length > 0 ? 200 : 404,
311
- data: m ?? []
312
- };
313
- }
314
- return {
315
- status: r.length ? 200 : 404,
316
- data: r
317
- };
318
- } catch (m) {
319
- return { status: "error", data: [], error: m };
320
- }
321
- }
322
- const ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
323
- __proto__: null,
324
- cmsBackup: G,
325
- getCMSContentType: H,
326
- getContentType: k
327
- }, Symbol.toStringTag, { value: "Module" }));
328
- export {
329
- le as S,
330
- ie as _,
331
- C as a,
332
- A as b,
333
- oe as c,
334
- R as d,
335
- j as e,
336
- ee as f,
337
- P as g,
338
- h,
339
- O as i,
340
- T as j,
341
- B as k,
342
- L as l,
343
- F as m,
344
- D as n,
345
- k as o,
346
- ae as p,
347
- se as q,
348
- v as r,
349
- I as s,
350
- ne as t,
351
- x as u,
352
- te as v,
353
- re as w,
354
- ce as x
355
- };
package/index-C5zOWvXN.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const f=require("react/jsx-runtime"),A=require("@soma-vertical-web/core-components"),g=(e,t=!0)=>Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:t?2:0}).format(e),I=({valueInCents:e,hasFree:t,freeTaxMessage:n})=>e===0?t?n:g(0):g(e/100),b=(e,t)=>{const[n,s]=e.split(t);return{name:n.trim(),size:s?s.trim():""}},S=(e,t)=>{if(!e)return{};const[n,s]=e.split(t);return{color:n==null?void 0:n.trim(),size:s==null?void 0:s.trim()}},w=(e,t="tamanho")=>{if(e.additionalProperty){const[n]=e.additionalProperty;return n!=null&&n.name?n.name.toLocaleLowerCase()===t?n.value:e.name:""}return e.name},k=(e,t)=>e.replace(t,"").trim(),B=e=>e.replace(/\//g,""),$=({items:e,NAME_SPLIT_SYMBOL:t})=>{const n={price:0,listPrice:0,installments:{count:0,value:0}},s=(r,i)=>{var d;i&&(i.sellerId=r.sellerId,i.sellerName=r.sellerName,i.available=!0,i.isSellerDefault=r.sellerDefault);const{Price:l,ListPrice:u,PaymentOptions:{installmentOptions:_}}=r.commertialOffer;n.price=l,n.listPrice=u;const c=(d=_==null?void 0:_[0])==null?void 0:d.installments;if(c){const{count:m,value:p}=c[c.length-1];n.installments={count:m,value:p/100}}};let a=!0;const o=e.reduce((r,i)=>{var _;const l={name:i.name,sku:i.itemId,value:((_=i.Tamanho)==null?void 0:_[0])??b(i.nameComplete??i.name,t).size,available:!1,sellerId:"",sellerName:"",isSellerDefault:!1},u=i.sellers.filter(c=>(c.sellerDefault&&c.commertialOffer.IsAvailable&&(l.available=!0,s(c,l)),c.commertialOffer.IsAvailable));return!l.isSellerDefault&&u.length>0&&(l.available=!0,s(u[0],{...l,sellerId:u[0].sellerId,sellerName:u[0].sellerName})),l.available===!1&&(a=!1),r.push(l),r},[]);return{...n,sizes:o,allSizesAvailable:a}},C=e=>e?!e.offers.offers.find(({quantity:t=0})=>t>0):!1,N=(e,t)=>{const n=e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0&&s.seller.identifier===t);return n||e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0)},R=({images:e,TEXTURE_IMAGE:t})=>e.find(n=>t.includes(n.imageLabel))??e[0],T=(e,t)=>{const n=/\/ids\/(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},P=(e,t)=>{const n=/\/ids\/(\d+)-(\d+)-(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}-${s[2]}-${s[3]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},z=({images:e,label:t})=>{const n=e.filter(s=>s.keywords===t.first||s.keywords===t.second||s.alternateName===t.first||s.alternateName===t.second);return n.length===0?e.slice(0,2):n},D=e=>{const[t,n]=e.split("/").map(Number);if(Number.isNaN(t)||Number.isNaN(n))throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");return n/t},F=(e,t,n)=>{t&&(e?(t.getAttribute("src")||(t.src=n??""),t.play()):t.pause())},U=Object.freeze(Object.defineProperty({__proto__:null,disableSKU:C,formatPriceToCurrency:g,freightParsePrice:I,getAspectRatio:D,getColorAndSizeFromSkuName:S,getFirstImages:z,getProductNameWithoutSku:k,getSKUName:w,getSkuInfos:$,getThumbImage:R,getValidOffer:N,removeSlashes:B,resizingImg:T,setVideoPlay:F,splitNameAndSizeFromFullName:b,updatedResizedImg:P},Symbol.toStringTag,{value:"Module"})),v="fuzzy",x="operator",E=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),L=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/");return e.map(s=>{if(s.key==="category-2"&&s.__typename==="FacetBoolean"){const a=s.values;return{...s,values:a.filter(o=>!n.find(r=>r.toLowerCase()===o.value||r.toLowerCase()===o.name.toLowerCase()))}}return s})},j=(e,t)=>t?e==="category-1":!1,M=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),K=e=>e.type==="TEXT",V=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),q=e=>{const{key:t,name:n,values:s}=e;return{__typename:"FacetBoolean",key:t,label:n,values:s.slice().sort((a,o)=>a.name.localeCompare(o.name))}},H=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),W=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:s=[]}=e,a=t!=null&&t.length?t[0].key==="category-1":!1;return s.filter(r=>!n||!j(r.key,a)).map(r=>K(r)?q(r):H(r))},Y=(e,t)=>{const n=e.find(({key:a})=>a===v)??null,s=e.find(({key:a})=>a===x)??null;n&&V(n)&&t.append(v,n.value),s&&M(s)&&t.append(x,s.value)},J=e=>e.map(t=>{const[n,s]=t.split("/");return{key:n,value:s}}),G=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),s=e.filter(({value:o})=>!n.includes(decodeURIComponent(o))).map(o=>({...o,value:decodeURIComponent(o.value)})),{isDepartment:a}=E(s);return s==null?void 0:s.filter(o=>!j(o.key,a))},X=({pathname:e,searchParams:t},n)=>{const s=t.get("sort")??"",a=t.get("query")??null,o=parseInt(t.get("page")??"1",10);return{sort:s,facets:J(n),term:a,base:a?"":e,page:o}},Q=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{Array.isArray(s)?s.forEach(a=>t.append(n,a)):s!==void 0&&t.append(n,s)}),t},y={"responsive-mobile-flex":"_responsive-mobile-flex_t5bry_2","responsive-desktop-flex":"_responsive-desktop-flex_t5bry_13","responsive-mobile-block":"_responsive-mobile-block_t5bry_24","responsive-desktop-block":"_responsive-desktop-block_t5bry_35"},O={},Z=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),ee="_header_1dxfy_40",te="_actions_1dxfy_61",ne="_breadcrumb_1dxfy_72",se="_credits_1dxfy_87",re="_similars_1dxfy_139",ae="_sizes_1dxfy_178",oe="_measurementTable_1dxfy_194",ie="_measurementHead_1dxfy_207",ce="_measurementRows_1dxfy_212",le="_measurementRowsTitle_1dxfy_229",me="_measurementRowsText_1dxfy_241",de="_measurementImage_1dxfy_252",ue="_measurementImageContainer_1dxfy_255",_e="_measurementContent_1dxfy_264",fe="_measurementTitle_1dxfy_268",pe="_measurementClose_1dxfy_279",ye="_productref_1dxfy_344",ge="_content_1dxfy_324",be="_pdp_1dxfy_112",he={"bottom-navigation":"_bottom-navigation_1dxfy_1","bottom-navigation__header":"_bottom-navigation__header_1dxfy_21",header:ee,actions:te,"add-to-cart":"_add-to-cart_1dxfy_68",breadcrumb:ne,"breadcrumb--active":"_breadcrumb--active_1dxfy_77",credits:se,"gallery-carousel-modifier":"_gallery-carousel-modifier_1dxfy_92","links-wrapper":"_links-wrapper_1dxfy_122",similars:re,"similars-info":"_similars-info_1dxfy_151","accessibility-info":"_accessibility-info_1dxfy_164",sizes:ae,"price-wrapper":"_price-wrapper_1dxfy_190",measurementTable:oe,measurementHead:ie,measurementRows:ce,measurementRowsTitle:le,measurementRowsText:me,measurementImage:de,measurementImageContainer:ue,measurementContent:_e,measurementTitle:fe,measurementClose:pe,"tabs-root-modifier":"_tabs-root-modifier_1dxfy_285","tabs-list-modifier":"_tabs-list-modifier_1dxfy_303","tabs-item-modifier":"_tabs-item-modifier_1dxfy_320","content-wrapper":"_content-wrapper_1dxfy_324",productref:ye,"tabs-panel":"_tabs-panel_1dxfy_355","tabs-panel-exit":"_tabs-panel-exit_1dxfy_361","tabs-panel-enter":"_tabs-panel-enter_1dxfy_365",content:ge,pdp:be,"pdp-main":"_pdp-main_1dxfy_423","pdp-main__gallery-wrapper":"_pdp-main__gallery-wrapper_1dxfy_428","pdp-main__info":"_pdp-main__info_1dxfy_445","pdp-main__info-main-content":"_pdp-main__info-main-content_1dxfy_465","pdp-main__info-subsection":"_pdp-main__info-subsection_1dxfy_465","subsection-product-info":"_subsection-product-info_1dxfy_476","subsection-similars":"_subsection-similars_1dxfy_479","subsection-sizes":"_subsection-sizes_1dxfy_482","subsection-actions":"_subsection-actions_1dxfy_485","pdp-main__info-secondary-content":"_pdp-main__info-secondary-content_1dxfy_489","sections-title":"_sections-title_1dxfy_495"},ve=({children:e,data:t,SectionZone:n,className:s})=>{var _,c;const a=((_=t==null?void 0:t.filter(d=>{var m,p;return((p=(m=d.config)==null?void 0:m.responsive)==null?void 0:p.deviceType)==="mobile"})[0])==null?void 0:_.sections)||[],o=((c=t==null?void 0:t.filter(d=>{var m,p;return((p=(m=d.config)==null?void 0:m.responsive)==null?void 0:p.deviceType)==="desktop"})[0])==null?void 0:c.sections)||[],r=a.slice(0,1),i=a.slice(1,a.length),l=o.slice(0,1),u=o.slice(1,o.length);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:s,children:[f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:r??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:l??[]})})]}),e,f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:i??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:u??[]})}),f.jsx(A.Utils.Divider,{})]})};async function xe({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s}){const a=await h({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s});if(a.status===200){const o={timestamp:new Date().toISOString(),contentType:e,data:a.data};console.log("Resultado da chamada:",a);const r=`backup-${e}-${Date.now()}.json`;return await O.writeFile(`./backups/${r}`,JSON.stringify(o,null,2),"utf-8"),{success:!0,fileName:r}}return{success:!1,error:a.error||"No data to backup"}}async function Ie(e){return xe(e)}async function Se({contentType:e,documentId:t,versionId:n,storeId:s,CMS_PROJECT_NAME:a}){const o=t&&t.length?`/${t}`:"",r=n&&n.length?`?versionId=${n}`:"";return fetch(`https://${s}.myvtex.com/_v/cms/api/${a}/${e}${o}${r}`,{cache:"no-cache"})}async function we({contentType:e,documents:t,NextCookies:n,previewId:s,CMS_PROJECT_NAME:a,storeId:o}){var i;const r=JSON.parse(s??((i=n==null?void 0:n().get("cms_preview_data"))==null?void 0:i.value)??"{}");if(r&&(r==null?void 0:r.contentType)===e){const l=r.documentId&&r.documentId.length?`/${r.documentId}`:"",u=r!=null&&r.versionId&&(r!=null&&r.versionId.length)?`?versionId=${r==null?void 0:r.versionId}`:"",c=await(await fetch(`https://${o}.myvtex.com/_v/cms/api/${a}/${e}${l}${u}`,{cache:"no-store"})).json(),d=t.filter(m=>c.id!==m.documentId);return d.unshift(c),d}return t}async function h({contentType:e,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s,previewId:a}){var _,c;const o=JSON.parse(a??((_=t==null?void 0:t().get("cms_preview_data"))==null?void 0:_.value)??"{}"),r=[];let i=1,l=0,u=!0;try{do{const m=await(await fetch(`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`)).json();i===1&&(l=m.totalItems),(c=m==null?void 0:m.data)!=null&&c.length&&r.push(...m.data),u=m.hasNextPage,i++}while(u&&r.length<l);if(o.previewMode&&r.length){const d=await we({contentType:e,documents:r,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s});return{status:d.length>0?200:404,data:d??[]}}return{status:r.length?200:404,data:r}}catch(d){return{status:"error",data:[],error:d}}}const ke=Object.freeze(Object.defineProperty({__proto__:null,cmsBackup:Ie,getCMSContentType:Se,getContentType:h},Symbol.toStringTag,{value:"Module"}));exports.SearchPageScreening=ve;exports.__viteBrowserExternal=Z;exports.addSearchParamsFacets=Y;exports.cms=ke;exports.convertSearchParams=Q;exports.disableSKU=C;exports.filterNonCategorySelected=L;exports.filterNonRootFacets=G;exports.formatPriceToCurrency=g;exports.formattedFacets=W;exports.freightParsePrice=I;exports.getColorAndSizeFromSkuName=S;exports.getContentType=h;exports.getFirstImages=z;exports.getProductNameWithoutSku=k;exports.getSKUName=w;exports.getSkuInfos=$;exports.getThumbImage=R;exports.getValidOffer=N;exports.parseSearchState=X;exports.productHelpers=U;exports.resizingImg=T;exports.responsive=y;exports.setVideoPlay=F;exports.splitNameAndSizeFromFullName=b;exports.styles=he;exports.updatedResizedImg=P;