@faststore/core 3.69.0 → 3.69.1
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +25 -25
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +7 -7
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/2778.js +2 -2
- package/.next/server/chunks/3963.js +1 -1
- package/.next/server/chunks/9563.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/{3166-6af5e854c2f2913a.js → 3166-a8f5e248b43b7766.js} +1 -1
- package/.next/static/chunks/{7191-9bdd5f0c18fbd942.js → 7191-4faf346dc8112e08.js} +1 -1
- package/.next/static/chunks/ProductShelf.3ddb66d12af618d2.js +1 -0
- package/.next/static/chunks/ProductTiles.81efd0bf3542f004.js +1 -0
- package/.next/static/chunks/pages/[slug]/{p-d782ecb21200f200.js → p-9e6d7d3fd6978f5a.js} +1 -1
- package/.next/static/chunks/{webpack-8b6c086380cf1398.js → webpack-42d75fbe3cafd732.js} +1 -1
- package/.next/static/{8LqJdo90qttH83UstKDej → tVd-SsiuJlud_z2vlEscj}/_buildManifest.js +1 -1
- package/.next/trace +135 -135
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/src/components/ui/ProductShelf/ProductShelf.tsx +15 -1
- package/src/sdk/deliveryPromise/useDeliveryPromiseFacets.ts +20 -0
- package/src/sdk/product/useLocalizedVariables.ts +2 -14
- package/.next/static/chunks/ProductShelf.299d0989eea49a79.js +0 -1
- package/.next/static/chunks/ProductTiles.ab99b919f3c0215f.js +0 -1
- /package/.next/static/{8LqJdo90qttH83UstKDej → tVd-SsiuJlud_z2vlEscj}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.69.0 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.69.0 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.69.0 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.69.0 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.69.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.69.0 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.69.0 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -58,7 +58,7 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
58
58
|
Creating an optimized production build ...
|
|
59
59
|
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
|
|
60
60
|
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
61
|
-
Browserslist: browsers data (caniuse-lite) is
|
|
61
|
+
Browserslist: browsers data (caniuse-lite) is 7 months old. Please run:
|
|
62
62
|
npx update-browserslist-db@latest
|
|
63
63
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
64
64
|
✓ Compiled successfully
|
|
@@ -77,7 +77,7 @@ Route (pages) Size First Load JS
|
|
|
77
77
|
├ └ css/b1806cbafd0c1f81.css 3.06 kB
|
|
78
78
|
├ /_app 0 B 105 kB
|
|
79
79
|
├ ● /[...slug] 2.4 kB 147 kB
|
|
80
|
-
├ ● /[slug]/p 32.
|
|
80
|
+
├ ● /[slug]/p 32.3 kB 168 kB
|
|
81
81
|
├ ├ css/a3ca6a9b63f657be.css 5.75 kB
|
|
82
82
|
├ ├ css/62a5153ac7061286.css 6.11 kB
|
|
83
83
|
├ └ css/6831395ff5fd317a.css 16.1 kB
|
|
@@ -110,7 +110,7 @@ Route (pages) Size First Load JS
|
|
|
110
110
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
111
111
|
├ chunks/main-f658704b53a96ab1.js 33.1 kB
|
|
112
112
|
├ chunks/pages/_app-728289774860e9d9.js 22.8 kB
|
|
113
|
-
├ chunks/webpack-
|
|
113
|
+
├ chunks/webpack-42d75fbe3cafd732.js 3.8 kB
|
|
114
114
|
└ css/0a57ee6c7a57788c.css 3.49 kB
|
|
115
115
|
|
|
116
116
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.69.0 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/utils/multipleTemplates.test.ts (27.
|
|
6
|
-
PASS test/server/cms/global.test.ts (27.
|
|
5
|
+
PASS test/utils/multipleTemplates.test.ts (27.108 s)
|
|
6
|
+
PASS test/server/cms/global.test.ts (27.451 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (30.
|
|
8
|
+
PASS test/server/index.test.ts (30.583 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time: 31.
|
|
13
|
+
Time: 31.868 s
|
|
14
14
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.69.1](https://github.com/vtex/faststore/compare/v3.69.0...v3.69.1) (2025-08-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- removing unwanted facets on product shelf to prevent duplication… ([#2970](https://github.com/vtex/faststore/issues/2970)) ([6ba3ca0](https://github.com/vtex/faststore/commit/6ba3ca06ecee058bc93ef9fa784a585f0a8c6563))
|
|
11
|
+
|
|
6
12
|
# [3.69.0](https://github.com/vtex/faststore/compare/v3.68.2...v3.69.0) (2025-07-31)
|
|
7
13
|
|
|
8
14
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.69.
|
|
3
|
+
"version": "3.69.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ts-jest": "29.1.1",
|
|
108
108
|
"typescript": "5.3.2"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "a9e52da1845bb5f3aff66fcef75efdb2970f6ed6"
|
|
111
111
|
}
|
|
@@ -5,6 +5,8 @@ import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEve
|
|
|
5
5
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
6
6
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
7
7
|
import { textToKebabCase } from 'src/utils/utilities'
|
|
8
|
+
import { useDeliveryPromiseFacets } from 'src/sdk/deliveryPromise/useDeliveryPromiseFacets'
|
|
9
|
+
import deepmerge from 'deepmerge'
|
|
8
10
|
|
|
9
11
|
const ProductShelfSkeleton = dynamic(
|
|
10
12
|
() =>
|
|
@@ -61,7 +63,16 @@ function ProductShelf({
|
|
|
61
63
|
const titleId = textToKebabCase(title)
|
|
62
64
|
const id = useId()
|
|
63
65
|
const viewedOnce = useRef(false)
|
|
64
|
-
const
|
|
66
|
+
const { deliveryFacets } = useDeliveryPromiseFacets()
|
|
67
|
+
|
|
68
|
+
const data = useProductsQuery({
|
|
69
|
+
first: numberOfItems,
|
|
70
|
+
selectedFacets: deepmerge(otherProps.selectedFacets, deliveryFacets, {
|
|
71
|
+
arrayMerge: overwriteMerge,
|
|
72
|
+
}),
|
|
73
|
+
...otherProps,
|
|
74
|
+
})
|
|
75
|
+
|
|
65
76
|
const products = data?.search?.products
|
|
66
77
|
const productEdges = products?.edges ?? []
|
|
67
78
|
const aspectRatio = 1
|
|
@@ -128,3 +139,6 @@ function ProductShelf({
|
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
export default ProductShelf
|
|
142
|
+
|
|
143
|
+
// Array merging strategy from deepmerge that makes client arrays overwrite server array
|
|
144
|
+
const overwriteMerge = (_: any[], clientArray: any[]) => clientArray
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useSearch } from '@faststore/sdk'
|
|
2
|
+
|
|
3
|
+
export function useDeliveryPromiseFacets() {
|
|
4
|
+
const { state: searchState } = useSearch()
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
deliveryFacets: searchState.selectedFacets.filter(
|
|
8
|
+
pickByKey(['shipping', 'pickupPoint'])
|
|
9
|
+
),
|
|
10
|
+
shipping: searchState.selectedFacets.filter(pickByKey(['shipping']))?.[0],
|
|
11
|
+
pickupPoint: searchState.selectedFacets.filter(
|
|
12
|
+
pickByKey(['pickupPoint'])
|
|
13
|
+
)?.[0],
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const pickByKey =
|
|
18
|
+
(keys: Array<string>) =>
|
|
19
|
+
({ key }: { key: string }) =>
|
|
20
|
+
keys.includes(key)
|
|
@@ -10,9 +10,6 @@ import { ITEMS_PER_SECTION } from 'src/constants'
|
|
|
10
10
|
const toArray = <T>(x: T[] | T | undefined) =>
|
|
11
11
|
Array.isArray(x) ? x : x ? [x] : []
|
|
12
12
|
|
|
13
|
-
// Array merging strategy from deepmerge that makes client arrays overwrite server array
|
|
14
|
-
const overwriteMerge = (_: any[], clientArray: any[]) => clientArray
|
|
15
|
-
|
|
16
13
|
export const useLocalizedVariables = ({
|
|
17
14
|
first,
|
|
18
15
|
after,
|
|
@@ -22,15 +19,6 @@ export const useLocalizedVariables = ({
|
|
|
22
19
|
sponsoredCount,
|
|
23
20
|
}: Partial<ClientManyProductsQueryQueryVariables>) => {
|
|
24
21
|
const { channel, locale } = useSession()
|
|
25
|
-
const { state: searchState } = useSearch()
|
|
26
|
-
|
|
27
|
-
const mergedSelectedFacets = deepmerge(
|
|
28
|
-
selectedFacets as SearchState['selectedFacets'],
|
|
29
|
-
searchState.selectedFacets,
|
|
30
|
-
{
|
|
31
|
-
arrayMerge: overwriteMerge,
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
22
|
|
|
35
23
|
return useMemo(() => {
|
|
36
24
|
return {
|
|
@@ -39,14 +27,14 @@ export const useLocalizedVariables = ({
|
|
|
39
27
|
sort: sort ?? ('score_desc' as const),
|
|
40
28
|
term: term ?? '',
|
|
41
29
|
selectedFacets: [
|
|
42
|
-
...
|
|
30
|
+
...toArray(selectedFacets),
|
|
43
31
|
{ key: 'channel', value: channel ?? '' },
|
|
44
32
|
{ key: 'locale', value: locale },
|
|
45
33
|
],
|
|
46
34
|
sponsoredCount: sponsoredCount ?? 3,
|
|
47
35
|
}
|
|
48
36
|
}, [
|
|
49
|
-
|
|
37
|
+
selectedFacets,
|
|
50
38
|
first,
|
|
51
39
|
after,
|
|
52
40
|
sort,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3506],{552:function(e,t,r){"use strict";r.r(t),r.d(t,{OverriddenDefaultProductShelf:function(){return O}});var n=r(3067),i={section:"ProductShelf"},o=r(1716),s=r(6410),c=r(1325),a=r(9428),u=r(2418),l=r.n(u),d=r(3888),p=r.n(d),f=p()(()=>Promise.all([r.e(7498),r.e(5781),r.e(6857)]).then(r.bind(r,5781)).then(e=>e.ProductShelf),{loadableGenerated:{webpack:()=>[null]}}),b=p()(()=>r.e(294).then(r.bind(r,294)),{loadableGenerated:{webpack:()=>[294]}}),h=p()(()=>r.e(3836).then(r.bind(r,3836)),{loadableGenerated:{webpack:()=>[3836]}}),v=r(1549);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var y=(0,o.B)("ProductShelf",function(e){var t=Object.assign({},e),{ref:r,inView:i}=(0,s.YD)();return(0,v.jsx)(c.Z,{className:"".concat(l().section," section-product-shelf layout__section"),ref:r,children:(0,v.jsx)(a.Z,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({inView:i},t))})},{ProductShelf:f,__experimentalCarousel:b,__experimentalProductCard:h});function OverriddenDefaultProductShelf_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function OverriddenDefaultProductShelf_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OverriddenDefaultProductShelf_ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OverriddenDefaultProductShelf_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var O=(0,o.v)(OverriddenDefaultProductShelf_objectSpread(OverriddenDefaultProductShelf_objectSpread(OverriddenDefaultProductShelf_objectSpread({},i),i),{},{Section:y}))},9428:function(e,t,r){"use strict";var n=r(3067),i=r(4235),o=r(3888),s=r.n(o),c=r(4194),a=r(1917),u=r(9746),l=r(6377),d=r(4018),p=r(1549),f=["title","inView","productCardConfiguration","numberOfItems","itemsPerPage","taxesConfiguration"];function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b=s()(()=>r.e(4799).then(r.bind(r,4799)),{loadableGenerated:{webpack:()=>[4799]}});t.Z=function(e){var t,r,{title:n,inView:o,productCardConfiguration:{bordered:s,showDiscountBadge:h}={},numberOfItems:v,itemsPerPage:y=5,taxesConfiguration:O={}}=e,g=(0,i.Z)(e,f),{ProductShelf:w,__experimentalCarousel:j,__experimentalProductCard:_}=(0,u.r3)(),m=(0,d.B5)(n),P=(0,c.useId)(),V=(0,c.useRef)(!1),k=(0,l.k)(_objectSpread({first:v},g)),S=null==k?void 0:null===(t=k.search)||void 0===t?void 0:t.products,C=null!==(r=null==S?void 0:S.edges)&&void 0!==r?r:[],{sendViewItemListEvent:D}=(0,a.m)({products:C,title:n,page:0,pageSize:0});return((0,c.useEffect)(()=>{o&&!V.current&&C.length&&(D(),V.current=!0)},[o,C.length,D]),(null==S?void 0:S.edges.length)===0)?null:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("h2",{className:"text__title-section layout__content",children:n}),(0,p.jsx)(b,{aspectRatio:1,loading:void 0===S,itemsPerPage:y,children:(0,p.jsx)(w.Component,_objectSpread(_objectSpread({},w.props),{},{children:(0,p.jsx)(j.Component,_objectSpread(_objectSpread({id:m||P,itemsPerPage:y},j.props),{},{children:C.map((e,t)=>(0,c.createElement)(_.Component,_objectSpread(_objectSpread({aspectRatio:1,imgProps:{width:216,height:216,sizes:"(max-width: 768px) 42vw, 30vw"}},_.props),{},{bordered:null!=s?s:_.props.bordered,showDiscountBadge:null!=h?h:_.props.showDiscountBadge,taxesConfiguration:O,key:"".concat(e.node.id),product:e.node,index:t+1})))}))}))})]})}},1917:function(e,t,r){"use strict";r.d(t,{m:function(){return useViewItemListEvent}});var n=r(4194),i=r(31),useViewItemListEvent=e=>{var{products:t,title:o,page:s,pageSize:c}=e,{currency:{code:a}}=(0,i.kP)();return{sendViewItemListEvent:(0,n.useCallback)(e=>{var n=null!=t&&t.length?t:null==e?void 0:e.products;n&&0!==n.length&&r.e(6393).then(r.bind(r,6393)).then(e=>{var{sendAnalyticsEvent:t}=e;t({name:"view_item_list",params:{item_list_name:o,item_list_id:o,items:n.map((e,t)=>{var{node:r}=e;return{item_id:r.isVariantOf.productGroupID,item_name:r.isVariantOf.name,item_brand:r.brand.name,item_variant:r.sku,price:r.offers.offers[0].price,index:s*c+t+1,discount:r.offers.offers[0].listPrice-r.offers.offers[0].price,currency:a,item_variant_name:r.name,product_reference_id:r.gtin}})}})})},[a,t,o,s,c])}}},7772:function(e,t,r){"use strict";r.d(t,{y:function(){return useLocalizedVariables}});var n=r(4194),i=r(4876),o=r.n(i),s=r(9029),c=r(31),a=r(8132),overwriteMerge=(e,t)=>t,useLocalizedVariables=e=>{var{first:t,after:r,sort:i,term:u,selectedFacets:l,sponsoredCount:d}=e,{channel:p,locale:f}=(0,c.kP)(),{state:b}=(0,s.R)(),h=o()(l,b.selectedFacets,{arrayMerge:overwriteMerge});return(0,n.useMemo)(()=>({first:null!=t?t:a.KS,after:null!=r?r:"0",sort:null!=i?i:"score_desc",term:null!=u?u:"",selectedFacets:[...h,{key:"channel",value:null!=p?p:""},{key:"locale",value:f}],sponsoredCount:null!=d?d:3}),[h,t,r,i,u,p,f,d])}},6377:function(e,t,r){"use strict";r.d(t,{k:function(){return useProductsQuery}});var n=r(3067),i=r(5487),o=r(2693),s=r(7772);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var c=i.gU,useProductsQuery=(e,t)=>{var r=(0,s.y)(e),{data:i}=(0,o.aM)(c,r,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({fallbackData:null,suspense:!0},t));return i}},2418:function(e){e.exports={section:"section_section__TjtMz",loading:"section_loading__ffSvt"}},6410:function(e,t,r){"use strict";r.d(t,{YD:function(){return useInView},df:function(){return u}});var n=r(4194);function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var i=new Map,o=new WeakMap,s=0,c=void 0;function observe(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n=c),void 0===window.IntersectionObserver&&void 0!==n){var a=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),function(){}}var u=function(e){var t=Object.keys(e).sort().filter(function(t){return void 0!==e[t]}).map(function(t){var r;return t+"_"+("root"===t?(r=e.root)?(o.has(r)||(s+=1,o.set(r,s.toString())),o.get(r)):"0":e[t])}).toString(),r=i.get(t);if(!r){var n,c=new Map,a=new IntersectionObserver(function(t){t.forEach(function(t){var r,i=t.isIntersecting&&n.some(function(e){return t.intersectionRatio>=e});e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(r=c.get(t.target))||r.forEach(function(e){e(i,t)})})},e);n=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:c},i.set(t,r)}return r}(r),l=u.id,d=u.observer,p=u.elements,f=p.get(e)||[];return p.has(e)||p.set(e,f),f.push(t),d.observe(e),function(){f.splice(f.indexOf(t),1),0===f.length&&(p.delete(e),d.unobserve(e)),0===p.size&&(d.disconnect(),i.delete(l))}}var a=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function isPlainChildren(e){return"function"!=typeof e.children}var u=function(e){function InView(t){var r;return(r=e.call(this,t)||this).node=null,r._unobserveCb=null,r.handleNode=function(e){!r.node||(r.unobserve(),e||r.props.triggerOnce||r.props.skip||r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=e||null,r.observeNode()},r.handleChange=function(e,t){e&&r.props.triggerOnce&&r.unobserve(),isPlainChildren(r.props)||r.setState({inView:e,entry:t}),r.props.onChange&&r.props.onChange(e,t)},r.state={inView:!!t.initialInView,entry:void 0},r}InView.prototype=Object.create(e.prototype),InView.prototype.constructor=InView,_setPrototypeOf(InView,e);var t=InView.prototype;return t.componentDidUpdate=function(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,r=e.root,n=e.rootMargin,i=e.trackVisibility,o=e.delay,s=e.fallbackInView;this._unobserveCb=observe(this.node,this.handleChange,{threshold:t,root:r,rootMargin:n,trackVisibility:i,delay:o},s)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!isPlainChildren(this.props)){var e=this.state,t=e.inView,r=e.entry;return this.props.children({inView:t,entry:r,ref:this.handleNode})}var i=this.props,o=i.children,s=i.as,c=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(i,a);return n.createElement(s||"div",_extends({ref:this.handleNode},c),o)},InView}(n.Component);function useInView(e){var t=void 0===e?{}:e,r=t.threshold,i=t.delay,o=t.trackVisibility,s=t.rootMargin,c=t.root,a=t.triggerOnce,u=t.skip,l=t.initialInView,d=t.fallbackInView,p=n.useRef(),f=n.useState({inView:!!l}),b=f[0],h=f[1],v=n.useCallback(function(e){void 0!==p.current&&(p.current(),p.current=void 0),!u&&e&&(p.current=observe(e,function(e,t){h({inView:e,entry:t}),t.isIntersecting&&a&&p.current&&(p.current(),p.current=void 0)},{root:c,rootMargin:s,threshold:r,trackVisibility:o,delay:i},d))},[Array.isArray(r)?r.toString():r,c,s,a,u,o,d,i]);(0,n.useEffect)(function(){p.current||!b.entry||a||u||h({inView:!!l})});var y=[v,b.inView,b.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}u.displayName="InView",u.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7181],{839:function(e,t,r){"use strict";var n=r(3067),i=r(4235),a=r(8394),o=r(5167),s=r(547),c=r(4194),l=r(2331),d=r.n(l),u=r(2056),f=r(643),p=r(8563),h=r(1549),v=["product","index","bordered","variant","aspectRatio","imgProps","ratingValue","buttonLabel","onButtonClick","showDiscountBadge","taxesConfiguration","sponsoredLabel"];function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}t.Z=(0,c.memo)(function(e){var t,r,{product:n,index:l,bordered:m=!0,variant:g="default",aspectRatio:b=1,imgProps:y,ratingValue:w,buttonLabel:_="Add",onButtonClick:k,showDiscountBadge:O=!0,taxesConfiguration:P,sponsoredLabel:j}=e,x=(0,i.Z)(e,v),{sku:E,isVariantOf:{name:V},image:[Z],advertisement:S,offers:{lowPrice:I,lowPriceWithTaxes:C,offers:[{listPrice:R,availability:D,listPriceWithTaxes:T}]}}=n,M=_objectSpread(_objectSpread({},(0,p.w)({product:n,selectedOffer:0,index:l})),{},{as:d(),passHref:!0,legacyBehavior:!1,prefetch:!1}),z=(0,c.useMemo)(()=>"https://schema.org/InStock"!==D,[D]),N=null!=P&&P.usePriceWithTaxes?C:I,F=null!=P&&P.usePriceWithTaxes?T:R,L=S?{"data-van-res-id":S.adResponseId,"data-van-aid":S.adId,"data-van-prod-name":V}:{};return(0,h.jsxs)(a.Z,_objectSpread(_objectSpread(_objectSpread({outOfStock:z,bordered:m,variant:g,"data-fs-product-card-sku":E},L),x),{},{children:[(0,h.jsx)(o.Z,{aspectRatio:b,children:(0,h.jsx)(u.Z,{src:Z.url,alt:Z.alternateName,sizes:"".concat(null!==(t=null==y?void 0:y.sizes)&&void 0!==t?t:"(max-width: 768px) 40vw, 30vw"),width:null!==(r=null==y?void 0:y.width)&&void 0!==r?r:360,height:Math.round((Number(null==y?void 0:y.height)||360)/b),loading:null==y?void 0:y.loading})}),(0,h.jsx)(s.Z,{title:V,price:{value:N,listPrice:F,formatter:f.P},ratingValue:w,outOfStock:z,onButtonClick:k,linkProps:M,showDiscountBadge:N<=F&&O,includeTaxes:null==P?void 0:P.usePriceWithTaxes,includeTaxesLabel:null==P?void 0:P.taxesLabel,sponsored:!!S,sponsoredLabel:j})]}))})},5859:function(e,t,r){"use strict";r.d(t,{Z:function(){return ProductTiles_ProductTiles}});var n=r(4235),i=r(4194),a=r(6410),o=r(839),s=r(3067),c=r(3877),l=r(1549),d=["children"];function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,s.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ui_Tiles_Tiles=e=>{var{children:t}=e,r=(0,n.Z)(e,d);return(0,l.jsx)(c.Z,_objectSpread(_objectSpread({},r),{},{children:t}))},u=r(7901),f=r(792),ProductTileSkeleton_ProductTileSkeleton=function(e){var{index:t,aspectRatio:r=1}=e;return(0,l.jsxs)("div",{"data-fs-product-tile-skeleton":!0,"data-fs-product-tile-skeleton-index":t,children:[(0,l.jsx)("div",{"data-fs-product-tile-skeleton-image":!0,"data-fs-product-tile-skeleton-index":t,style:{"--fs-product-tile-skeleton-image-aspect-ratio":r},children:(0,l.jsx)(f.Z,{size:{width:"auto",height:"100%"},loading:!0})}),(0,l.jsxs)("div",{"data-fs-product-tile-skeleton-content":!0,"data-fs-product-tile-skeleton-index":t,children:[(0,l.jsxs)("div",{"data-fs-product-tile-skeleton-heading":!0,children:[(0,l.jsx)("div",{"data-fs-product-tile-skeleton-text":!0,"data-fs-product-tile-skeleton-index":t,children:(0,l.jsx)(f.Z,{size:{width:"70%",height:"1.5rem"}})}),(0,l.jsx)("div",{"data-fs-product-tile-skeleton-price":!0,children:(0,l.jsx)(f.Z,{size:{width:"60%",height:"1.5rem"}})})]}),(0,l.jsx)("div",{"data-fs-product-tile-skeleton-badge":!0,"data-fs-product-tile-skeleton-index":t,children:(0,l.jsx)(f.Z,{size:{width:"6rem",height:"2rem"},border:"pill"})})]})]})},getRatio=(e,t)=>3===e&&0===t||2===e&&(0===t||1===t)?5/3:3/4,ProductTilesSkeleton_ProductTilesSkeleton=function(e){var{children:t,loading:r=!0}=e;return r?(0,l.jsx)(ui_Tiles_Tiles,{children:Array.from({length:3},(e,t)=>(0,l.jsx)(u.Z,{children:(0,l.jsx)(ProductTileSkeleton_ProductTileSkeleton,{index:t+1,aspectRatio:getRatio(3,t)})},String(t)))}):(0,l.jsx)(l.Fragment,{children:t})},p=r(1917),h=r(6377),v=r(1325),m=r(4578),g=r.n(m),b=["title","taxesConfiguration"],ProductTiles_getRatio=(e,t)=>3===e&&0===t||2===e&&(0===t||1===t)?5/3:3/4,getSizes=(e,t)=>3===e&&0===t||2===e&&(0===t||1===t)?{width:594,height:364}:{width:284,height:364},ProductTiles_ProductTiles=e=>{var t,r,{title:s,taxesConfiguration:c}=e,d=(0,n.Z)(e,b),f=(0,i.useRef)(!1),{ref:m,inView:y}=(0,a.YD)(),w=(0,h.k)(d),_=null==w?void 0:null===(t=w.search)||void 0===t?void 0:t.products,k=null!==(r=null==_?void 0:_.edges)&&void 0!==r?r:[],{sendViewItemListEvent:O}=(0,p.m)({products:k,title:s,page:0,pageSize:0});return((0,i.useEffect)(()=>{y&&!f.current&&k.length&&(O(),f.current=!0)},[y,k.length,O]),(null==_?void 0:_.edges.length)===0)?null:(0,l.jsxs)(v.Z,{className:"".concat(g().section," section-product-tiles layout__section"),ref:m,children:[(0,l.jsx)("h2",{className:"text__title-section layout__content",children:s}),(0,l.jsx)(ProductTilesSkeleton_ProductTilesSkeleton,{loading:!_,children:(0,l.jsx)(ui_Tiles_Tiles,{children:k.map((e,t)=>(0,l.jsx)(u.Z,{children:(0,l.jsx)(o.Z,{"data-testid":"tile-card",product:e.node,index:t+1,variant:"wide",aspectRatio:ProductTiles_getRatio(k.length,t),imgProps:getSizes(k.length,t),taxesConfiguration:c})},e.node.id))})})]})}},7226:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return n.Z}});var n=r(5859)},1917:function(e,t,r){"use strict";r.d(t,{m:function(){return useViewItemListEvent}});var n=r(4194),i=r(31),useViewItemListEvent=e=>{var{products:t,title:a,page:o,pageSize:s}=e,{currency:{code:c}}=(0,i.kP)();return{sendViewItemListEvent:(0,n.useCallback)(e=>{var n=null!=t&&t.length?t:null==e?void 0:e.products;n&&0!==n.length&&r.e(6393).then(r.bind(r,6393)).then(e=>{var{sendAnalyticsEvent:t}=e;t({name:"view_item_list",params:{item_list_name:a,item_list_id:a,items:n.map((e,t)=>{var{node:r}=e;return{item_id:r.isVariantOf.productGroupID,item_name:r.isVariantOf.name,item_brand:r.brand.name,item_variant:r.sku,price:r.offers.offers[0].price,index:o*s+t+1,discount:r.offers.offers[0].listPrice-r.offers.offers[0].price,currency:c,item_variant_name:r.name,product_reference_id:r.gtin}})}})})},[c,t,a,o,s])}}},643:function(e,t,r){"use strict";r.d(t,{P:function(){return useFormattedPrice}});var n=r(4194),i=r(31),usePriceFormatter=function(){var{decimals:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{currency:t,locale:r}=(0,i.kP)();return(0,n.useCallback)(n=>Intl.NumberFormat(r,{style:"currency",currency:t.code,minimumFractionDigits:e?2:0}).format(n),[t.code,r,e])},useFormattedPrice=e=>{var t=usePriceFormatter();return(0,n.useMemo)(()=>t(e),[t,e])}},7772:function(e,t,r){"use strict";r.d(t,{y:function(){return useLocalizedVariables}});var n=r(4194),i=r(4876),a=r.n(i),o=r(9029),s=r(31),c=r(8132),overwriteMerge=(e,t)=>t,useLocalizedVariables=e=>{var{first:t,after:r,sort:i,term:l,selectedFacets:d,sponsoredCount:u}=e,{channel:f,locale:p}=(0,s.kP)(),{state:h}=(0,o.R)(),v=a()(d,h.selectedFacets,{arrayMerge:overwriteMerge});return(0,n.useMemo)(()=>({first:null!=t?t:c.KS,after:null!=r?r:"0",sort:null!=i?i:"score_desc",term:null!=l?l:"",selectedFacets:[...v,{key:"channel",value:null!=f?f:""},{key:"locale",value:p}],sponsoredCount:null!=u?u:3}),[v,t,r,i,l,f,p,u])}},8563:function(e,t,r){"use strict";r.d(t,{w:function(){return useProductLink}});var n=r(4194),i=r(31),useProductLink=e=>{var{index:t,product:a,selectedOffer:o}=e,{slug:s}=a,{currency:{code:c}}=(0,i.kP)(),l=(0,n.useCallback)(()=>{r.e(6393).then(r.bind(r,6393)).then(e=>{var{sendAnalyticsEvent:r}=e;r({name:"select_item",params:{items:[{item_id:a.isVariantOf.productGroupID,item_name:a.isVariantOf.name,item_brand:a.brand.name,item_variant:a.sku,index:t,price:a.offers.offers[o].price,discount:a.offers.offers[o].listPrice-a.offers.offers[o].price,currency:c,item_variant_name:a.name,product_reference_id:a.gtin}]}}),r({name:"search_select_item",params:{url:window.location.href,items:[{item_id:a.isVariantOf.productGroupID,item_variant:a.sku,index:t}]}})})},[c,a,t,o]);return{href:"/".concat(s,"/p"),onClick:l,"data-testid":"product-link"}}},6377:function(e,t,r){"use strict";r.d(t,{k:function(){return useProductsQuery}});var n=r(3067),i=r(5487),a=r(2693),o=r(7772);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var s=i.gU,useProductsQuery=(e,t)=>{var r=(0,o.y)(e),{data:i}=(0,a.aM)(s,r,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({fallbackData:null,suspense:!0},t));return i}},4578:function(e){e.exports={section:"section_section__Wwc_y",loading:"section_loading__7M1Dl"}},6410:function(e,t,r){"use strict";r.d(t,{YD:function(){return useInView},df:function(){return l}});var n=r(4194);function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var i=new Map,a=new WeakMap,o=0,s=void 0;function observe(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n=s),void 0===window.IntersectionObserver&&void 0!==n){var c=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:c,intersectionRect:c,rootBounds:c}),function(){}}var l=function(e){var t=Object.keys(e).sort().filter(function(t){return void 0!==e[t]}).map(function(t){var r;return t+"_"+("root"===t?(r=e.root)?(a.has(r)||(o+=1,a.set(r,o.toString())),a.get(r)):"0":e[t])}).toString(),r=i.get(t);if(!r){var n,s=new Map,c=new IntersectionObserver(function(t){t.forEach(function(t){var r,i=t.isIntersecting&&n.some(function(e){return t.intersectionRatio>=e});e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(r=s.get(t.target))||r.forEach(function(e){e(i,t)})})},e);n=c.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:c,elements:s},i.set(t,r)}return r}(r),d=l.id,u=l.observer,f=l.elements,p=f.get(e)||[];return f.has(e)||f.set(e,p),p.push(t),u.observe(e),function(){p.splice(p.indexOf(t),1),0===p.length&&(f.delete(e),u.unobserve(e)),0===f.size&&(u.disconnect(),i.delete(d))}}var c=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function isPlainChildren(e){return"function"!=typeof e.children}var l=function(e){function InView(t){var r;return(r=e.call(this,t)||this).node=null,r._unobserveCb=null,r.handleNode=function(e){!r.node||(r.unobserve(),e||r.props.triggerOnce||r.props.skip||r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=e||null,r.observeNode()},r.handleChange=function(e,t){e&&r.props.triggerOnce&&r.unobserve(),isPlainChildren(r.props)||r.setState({inView:e,entry:t}),r.props.onChange&&r.props.onChange(e,t)},r.state={inView:!!t.initialInView,entry:void 0},r}InView.prototype=Object.create(e.prototype),InView.prototype.constructor=InView,_setPrototypeOf(InView,e);var t=InView.prototype;return t.componentDidUpdate=function(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,r=e.root,n=e.rootMargin,i=e.trackVisibility,a=e.delay,o=e.fallbackInView;this._unobserveCb=observe(this.node,this.handleChange,{threshold:t,root:r,rootMargin:n,trackVisibility:i,delay:a},o)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!isPlainChildren(this.props)){var e=this.state,t=e.inView,r=e.entry;return this.props.children({inView:t,entry:r,ref:this.handleNode})}var i=this.props,a=i.children,o=i.as,s=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(i,c);return n.createElement(o||"div",_extends({ref:this.handleNode},s),a)},InView}(n.Component);function useInView(e){var t=void 0===e?{}:e,r=t.threshold,i=t.delay,a=t.trackVisibility,o=t.rootMargin,s=t.root,c=t.triggerOnce,l=t.skip,d=t.initialInView,u=t.fallbackInView,f=n.useRef(),p=n.useState({inView:!!d}),h=p[0],v=p[1],m=n.useCallback(function(e){void 0!==f.current&&(f.current(),f.current=void 0),!l&&e&&(f.current=observe(e,function(e,t){v({inView:e,entry:t}),t.isIntersecting&&c&&f.current&&(f.current(),f.current=void 0)},{root:s,rootMargin:o,threshold:r,trackVisibility:a,delay:i},u))},[Array.isArray(r)?r.toString():r,s,o,c,l,a,u,i]);(0,n.useEffect)(function(){f.current||!h.entry||c||l||v({inView:!!d})});var g=[m,h.inView,h.entry];return g.ref=g[0],g.inView=g[1],g.entry=g[2],g}l.displayName="InView",l.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}},9767:function(e,t,r){"use strict";var n=r(4194),i=r(5450);let a=(0,n.forwardRef)(function({value:e,as:t="span",variant:r="selling",testId:a="fs-price",formatter:o=e=>e,SRText:s,...c},l){let d=o(e,r);return n.createElement(t,{ref:l,"data-fs-price":!0,"data-fs-price-variant":r,"data-testid":a,...c},s&&n.createElement(i.Z,{text:s}),d)});t.Z=a},5450:function(e,t,r){"use strict";var n=r(4194);t.Z=function({text:e,as:t}){let r=t??"span";return n.createElement(r,{"data-fs-sr-only":!0},e)}},792:function(e,t,r){"use strict";var n=r(4194);let i=(0,n.forwardRef)(function({testId:e="fs-skeleton",loading:t=!0,shimmer:r=!0,children:i,size:a,border:o,borderRadius:s,...c},l){let d={width:a.width,height:a.height};return t?n.createElement("div",{ref:l,"data-fs-skeleton":!0,"data-testid":e,"data-fs-skeleton-border":o||null,style:s?{...d,borderRadius:s}:d,...c},r&&n.createElement("div",{"data-fs-skeleton-shimmer":!0})):n.createElement(n.Fragment,null,i)});t.Z=i},2946:function(e,t,r){"use strict";r.d(t,{Z:function(){return DiscountBadge_DiscountBadge}});var n=r(4194),i=r(276);let useDiscountPercent=(e,t)=>(0,n.useMemo)(()=>{let r=e-t,n=100*r/e;return Math.round(n)},[t,e]);var DiscountBadge_DiscountBadge=({listPrice:e,spotPrice:t,thresholdLow:r=15,thresholdHigh:a=40,size:o,testId:s="fs-discount-badge"})=>{let c=useDiscountPercent(e,t);if(0===c)return n.createElement(n.Fragment,null);let l=c<=r?"low":c<=a?"medium":"high";return n.createElement(i.Z,{"data-fs-discount-badge":!0,"data-fs-discount-badge-variant":l,size:o,"data-testid":s},c,"% off")}},8394:function(e,t,r){"use strict";var n=r(4194);let i=(0,n.forwardRef)(function({testId:e="fs-product-card",variant:t="default",bordered:r=!1,outOfStock:i,children:a,...o},s){return n.createElement("article",{ref:s,"data-fs-product-card":i?"out-of-stock":"","data-fs-product-card-variant":t,"data-fs-product-card-bordered":r,"data-testid":e,...o},a)});t.Z=i},547:function(e,t,r){"use strict";var n=r(4194),i=r(727),a=r(9088),o=r(1953),s=r(3024),c=r(2614),l=r(2946),d=r(276),u=r(9009);let f=(0,n.forwardRef)(function({testId:e="fs-product-card-content",title:t,linkProps:r,price:f,outOfStock:p,outOfStockLabel:h="Out of stock",ratingValue:v,showDiscountBadge:m,buttonLabel:g="Add",onButtonClick:b,children:y,includeTaxes:w=!1,includeTaxesLabel:_="Tax included",sponsored:k=!1,sponsoredLabel:O="Sponsored",...P},j){let x=f?.listPrice?f.listPrice:0,E=f?.value?f.value:0;return n.createElement("section",{ref:j,"data-fs-product-card-content":!0,"data-fs-product-card-badge":m,"data-testid":e,...P},k&&n.createElement("span",{"data-fs-product-card-sponsored-label":!0},O),n.createElement("div",{"data-fs-product-card-heading":!0},n.createElement("h3",{"data-fs-product-card-title":!0},n.createElement(i.Z,{...r,title:t},n.createElement("span",null,t))),!p&&n.createElement(a.Z,{"data-fs-product-card-prices":!0,value:E,listPrice:x,formatter:f?.formatter}),w&&n.createElement(o.Z,{"data-fs-product-card-taxes-label":!0},_),v&&n.createElement(s.Z,{value:v,icon:n.createElement(c.Z,{name:"Star"})})),m&&!p&&n.createElement(l.Z,{listPrice:x,spotPrice:E}),p&&n.createElement(d.Z,null,h),b&&!p&&n.createElement("div",{"data-fs-product-card-actions":!0},n.createElement(u.Z,{variant:"primary",icon:n.createElement(c.Z,{name:"ShoppingCart"}),iconPosition:"left",size:"small",onClick:b},g)))});t.Z=f},5167:function(e,t,r){"use strict";var n=r(4194);let i=(0,n.forwardRef)(function({testId:e="fs-product-card-image",aspectRatio:t=1,children:r,...i},a){return n.createElement("div",{ref:a,"data-fs-product-card-image":!0,"data-testid":e,style:{"--fs-product-card-image-aspect-ratio":t},...i},r)});t.Z=i},9088:function(e,t,r){"use strict";var n=r(4194),i=r(9767);let a=(0,n.forwardRef)(function({testId:e="fs-product-price",value:t,listPrice:r,formatter:a,...o},s){let c=r??0,l=t??0;return n.createElement("div",{ref:s,"data-fs-product-price":!0,"data-testid":e,...o},l!==c&&0!==c?n.createElement(n.Fragment,null,n.createElement(i.Z,{value:c,formatter:a,testId:"list-price","data-value":c,variant:"listing",SRText:"Original price:"}),n.createElement(i.Z,{value:l,formatter:a,testId:"price","data-value":l,variant:"spot",SRText:"Price:"})):n.createElement(i.Z,{value:l,formatter:a,testId:"price","data-value":l,variant:"spot",SRText:"Price:"}))});t.Z=a},3024:function(e,t,r){"use strict";var n=r(4194),i=r(2614),a=r(7041),o=r(4564);let s=(0,n.forwardRef)(function({children:e,testId:t="fs-rating",length:r=5,value:s=0,icon:c,onChange:l,disabled:d,...u},f){let[p,h]=(0,n.useState)(0),v={"data-fs-rating-icon-outline":!0},m=n.isValidElement(c)?c:n.createElement(i.Z,{name:"Star"});return n.createElement(o.Z,{ref:f,"data-fs-rating":!0,"data-fs-rating-actionable":"function"==typeof l,"data-testid":t,...u},Array.from({length:r}).map((e,r)=>{let o=r+1;return n.createElement("li",{key:`rating-${r}`,"data-fs-rating-item":o<=(p||s)?"full":o-s>0&&o-s<1?"partial":"empty","data-testid":`${t}-item`},l?n.createElement(a.Z,{"data-fs-rating-button":!0,icon:m,size:"small","aria-label":"rate",onClick:()=>{l(o)},onMouseEnter:()=>h(o),onMouseLeave:()=>h(s),disabled:d}):n.createElement(n.Fragment,null,n.createElement("div",{"data-fs-rating-icon-wrapper":!0},m),n.isValidElement(c)?n.cloneElement(c,v):n.createElement(i.Z,{name:"Star","data-fs-rating-icon-outline":!0})))}))});t.Z=s},7901:function(e,t,r){"use strict";var n=r(4194);let i=(0,n.forwardRef)(function({testId:e="store-tile",children:t,...r},i){return n.createElement("li",{ref:i,role:"listitem","data-fs-tile":!0,"data-testid":e,...r},t)});t.Z=i},3877:function(e,t,r){"use strict";var n=r(4194);let i=(0,n.forwardRef)(function({testId:e="store-tiles",children:t,...r},i){let a=n.Children.count(t);return n.createElement("ul",{ref:i,role:"list","data-fs-tiles":!0,"data-fs-tiles-variant":3===a?"expanded-first":2===a?"expanded-first-two":"","data-fs-content":"tiles","data-testid":e,...r},t)});t.Z=i}}]);
|
|
File without changes
|