@faststore/core 2.2.69 → 2.2.71
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 +62 -52
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- 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/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +4 -4
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/117.js +427 -0
- package/.next/server/chunks/184.js +61 -0
- package/.next/server/chunks/350.js +2846 -35
- package/.next/server/chunks/585.js +22 -0
- package/.next/server/chunks/632.js +514 -0
- package/.next/server/chunks/661.js +1451 -0
- package/.next/server/chunks/693.js +58 -0
- package/.next/server/chunks/719.js +84 -0
- package/.next/server/chunks/74.js +987 -6854
- package/.next/server/chunks/779.js +58 -0
- package/.next/server/chunks/854.js +72 -0
- package/.next/server/chunks/863.js +22 -0
- package/.next/server/chunks/{520.js → 898.js} +250 -30
- package/.next/server/chunks/903.js +1926 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +0 -21
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +0 -21
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +9 -9
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1373 -33
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/account.js +0 -21
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +0 -21
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/index.js +5 -5
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +0 -21
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +4 -58
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/static/IDskqcKTB7kE5quFZAhgJ/_buildManifest.js +1 -0
- package/.next/static/chunks/223-cb77217cce52d45c.js +1 -0
- package/.next/static/chunks/251.11f5198fc8bef3a4.js +1 -0
- package/.next/static/chunks/397-0d3aada1012cd78b.js +1 -0
- package/.next/static/chunks/585.6561778b7763b79e.js +1 -0
- package/.next/static/chunks/675-479a97aecebead97.js +1 -0
- package/.next/static/chunks/800.5d92de2974baf641.js +1 -0
- package/.next/static/chunks/881-57643fb90f59e576.js +1 -0
- package/.next/static/chunks/988.afda042dd9ba11d1.js +1 -0
- package/.next/static/chunks/pages/404-e106cb9a78182f5f.js +1 -0
- package/.next/static/chunks/pages/500-d28aa4a8ce88bddd.js +1 -0
- package/.next/static/chunks/pages/[...slug]-cf872b9e9befd47c.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-4a75b11857b82b5c.js +1 -0
- package/.next/static/chunks/pages/{account-1963c084b0b6e597.js → account-bf9c88a9cac80d8a.js} +1 -1
- package/.next/static/chunks/pages/{checkout-d66a352e910607dd.js → checkout-6ca76c1e88a28ac4.js} +1 -1
- package/.next/static/chunks/pages/index-629ba146ae5f0ecf.js +1 -0
- package/.next/static/chunks/pages/login-d2af0de13ea75848.js +1 -0
- package/.next/static/chunks/pages/s-d729254b91430d1c.js +1 -0
- package/.next/static/chunks/webpack-54ce04ec11860b0b.js +1 -0
- package/.next/static/css/021de9c7b050d301.css +1 -0
- package/.next/static/css/510895065f32ed2f.css +1 -0
- package/.next/static/css/7e897ebb936fac09.css +1 -0
- package/.next/static/css/938781cdc945862e.css +1 -0
- package/.next/static/css/9558da13053ac066.css +1 -0
- package/.next/static/css/def381bf7c69fa2e.css +1 -0
- package/.next/trace +82 -82
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-test.log +10 -10
- package/index.ts +13 -0
- package/package.json +2 -2
- package/src/components/cms/GlobalSections.tsx +1 -1
- package/src/components/navigation/Navbar/Navbar.tsx +10 -10
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +3 -5
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +8 -7
- package/src/components/sections/Alert/Alert.tsx +11 -3
- package/src/components/sections/Alert/OverriddenDefaultAlert.ts +7 -4
- package/src/components/sections/BannerText/BannerText.tsx +10 -2
- package/src/components/sections/BannerText/OverriddenDefaultBannerText.ts +7 -4
- package/src/components/sections/Breadcrumb/Breadcrumb.tsx +9 -3
- package/src/components/sections/Breadcrumb/OverriddenDefaultBreadcrumb.ts +7 -4
- package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +8 -2
- package/src/components/sections/CrossSellingShelf/OverriddenDefaultCrossSellingShelf.ts +2 -1
- package/src/components/sections/EmptyState/Overrides.tsx +2 -2
- package/src/components/sections/Hero/Hero.tsx +11 -3
- package/src/components/sections/Hero/OverriddenDefaultHero.ts +7 -4
- package/src/components/sections/Navbar/DefaultComponents.ts +27 -0
- package/src/components/sections/Navbar/Navbar.tsx +10 -2
- package/src/components/sections/Navbar/OverriddenDefaultNavbar.ts +14 -0
- package/src/components/sections/Newsletter/Newsletter.tsx +10 -2
- package/src/components/sections/Newsletter/OverriddenDefaultNewsletter.ts +6 -4
- package/src/components/sections/ProductDetails/OverriddenDefaultProductDetails.ts +7 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +16 -8
- package/src/components/sections/ProductGallery/OverriddenDefaultProductGallery.ts +6 -4
- package/src/components/sections/ProductGallery/ProductGallery.tsx +13 -5
- package/src/components/sections/ProductShelf/OverriddenDefaultProductShelf.ts +7 -4
- package/src/components/sections/ProductShelf/ProductShelf.tsx +12 -2
- package/src/components/sections/RegionBar/OverriddenDefaultRegionBar.ts +6 -4
- package/src/components/sections/RegionBar/RegionBar.tsx +11 -5
- package/src/sdk/overrides/getOverriddenSection.tsx +45 -44
- package/src/sdk/overrides/overrides.ts +2 -2
- package/src/typings/overrides.ts +265 -186
- package/src/typings/overridesDefinition.ts +20 -6
- package/.next/server/chunks/445.js +0 -167
- package/.next/server/chunks/829.js +0 -2938
- package/.next/server/chunks/934.js +0 -125
- package/.next/static/JNkl1RxkhVPSzLAsRUxC6/_buildManifest.js +0 -1
- package/.next/static/chunks/251.65e0bb7a2f58b3db.js +0 -1
- package/.next/static/chunks/557-4f8a963d7e07e582.js +0 -1
- package/.next/static/chunks/585.ee7478bead8853ae.js +0 -1
- package/.next/static/chunks/800.8f4f91b39aa47346.js +0 -1
- package/.next/static/chunks/846-c59a0f158089800c.js +0 -1
- package/.next/static/chunks/988.a57dac6501fb5184.js +0 -1
- package/.next/static/chunks/pages/404-e44d7103a9c6781f.js +0 -1
- package/.next/static/chunks/pages/500-2ddd76fa11c851e4.js +0 -1
- package/.next/static/chunks/pages/[...slug]-f7f47afa6dce5abf.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-27a9a4ef5d07a4ce.js +0 -1
- package/.next/static/chunks/pages/index-9e98f2fc42dec7c1.js +0 -1
- package/.next/static/chunks/pages/login-349e1406a3a98968.js +0 -1
- package/.next/static/chunks/pages/s-9b771eb03d589ee6.js +0 -1
- package/.next/static/chunks/webpack-3beeb2f9a51fccf6.js +0 -1
- package/.next/static/css/0c844be3b8585e70.css +0 -1
- package/.next/static/css/280c254f1f559956.css +0 -1
- package/.next/static/css/a6bcc59f42b42f36.css +0 -1
- package/.next/static/css/ecdecb8d639a8311.css +0 -1
- package/src/components/sections/Navbar/Overrides.tsx +0 -60
- package/src/sdk/overrides/sections.tsx +0 -54
- /package/.next/static/{JNkl1RxkhVPSzLAsRUxC6 → IDskqcKTB7kE5quFZAhgJ}/_ssgManifest.js +0 -0
|
@@ -12,15 +12,15 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
12
12
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13
13
|
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
14
14
|
/* harmony export */ });
|
|
15
|
-
/* harmony import */ var src_components_sections_BannerText_OverriddenDefaultBannerText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
15
|
+
/* harmony import */ var src_components_sections_BannerText_OverriddenDefaultBannerText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7127);
|
|
16
16
|
/* harmony import */ var src_components_sections_Newsletter_OverriddenDefaultNewsletter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3122);
|
|
17
17
|
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3271);
|
|
18
18
|
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5411);
|
|
19
19
|
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_2__);
|
|
20
20
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
|
|
21
21
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
22
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([
|
|
23
|
-
|
|
22
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_Newsletter_OverriddenDefaultNewsletter__WEBPACK_IMPORTED_MODULE_4__]);
|
|
23
|
+
src_components_sections_Newsletter_OverriddenDefaultNewsletter__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -68,65 +68,1394 @@ __webpack_async_result__();
|
|
|
68
68
|
|
|
69
69
|
/***/ }),
|
|
70
70
|
|
|
71
|
-
/***/
|
|
71
|
+
/***/ 994:
|
|
72
72
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
73
73
|
|
|
74
74
|
"use strict";
|
|
75
75
|
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
76
76
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
77
|
-
/* harmony export */ "Z": () => (
|
|
77
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
78
78
|
/* harmony export */ });
|
|
79
|
-
/* harmony import */ var
|
|
80
|
-
var
|
|
81
|
-
|
|
79
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
|
|
80
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
81
|
+
/* harmony import */ var _components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7691);
|
|
82
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
|
|
83
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
|
|
84
|
+
/* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5953);
|
|
85
|
+
/* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
|
|
86
|
+
/* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
|
|
87
|
+
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3271);
|
|
88
|
+
/* harmony import */ var _DefaultComponents__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8435);
|
|
89
|
+
/* harmony import */ var _sdk_overrides_getOverriddenSection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8788);
|
|
90
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
|
|
91
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
92
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__]);
|
|
93
|
+
_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
82
94
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
const CrossSellingShelf = ({
|
|
105
|
+
numberOfItems,
|
|
106
|
+
itemsPerPage,
|
|
107
|
+
title,
|
|
108
|
+
kind
|
|
109
|
+
}) => {
|
|
110
|
+
const {
|
|
111
|
+
ref,
|
|
112
|
+
inView
|
|
113
|
+
} = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
|
|
114
|
+
const context = (0,src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__/* .usePDP */ .al)();
|
|
115
|
+
const productGroupID = context?.data?.product?.isVariantOf?.productGroupID;
|
|
116
|
+
const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
|
|
117
|
+
key: kind,
|
|
118
|
+
value: productGroupID
|
|
119
|
+
}], [kind, productGroupID]);
|
|
120
|
+
return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
|
121
|
+
className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
|
|
122
|
+
ref: ref,
|
|
123
|
+
children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
124
|
+
inView: inView,
|
|
125
|
+
numberOfItems: numberOfItems,
|
|
126
|
+
itemsPerPage: itemsPerPage,
|
|
127
|
+
title: title,
|
|
128
|
+
selectedFacets: selectedFacets
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const OverridableCrossSellingShelf = (0,_sdk_overrides_getOverriddenSection__WEBPACK_IMPORTED_MODULE_7__/* .getOverridableSection */ .B)('CrossSellingShelf', CrossSellingShelf, _DefaultComponents__WEBPACK_IMPORTED_MODULE_8__/* .CrossSellingShelfDefaultComponents */ .q);
|
|
134
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OverridableCrossSellingShelf);
|
|
86
135
|
__webpack_async_result__();
|
|
87
136
|
} catch(e) { __webpack_async_result__(e); } });
|
|
88
137
|
|
|
89
138
|
/***/ }),
|
|
90
139
|
|
|
91
|
-
/***/
|
|
140
|
+
/***/ 8435:
|
|
141
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
142
|
+
|
|
143
|
+
"use strict";
|
|
144
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
145
|
+
/* harmony export */ "q": () => (/* binding */ CrossSellingShelfDefaultComponents)
|
|
146
|
+
/* harmony export */ });
|
|
147
|
+
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6737);
|
|
148
|
+
/* harmony import */ var src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8553);
|
|
149
|
+
/* harmony import */ var src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8619);
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
const CrossSellingShelfDefaultComponents = {
|
|
154
|
+
ProductShelf: _faststore_ui__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
155
|
+
__experimentalCarousel: src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
|
156
|
+
__experimentalProductCard: src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/***/ }),
|
|
160
|
+
|
|
161
|
+
/***/ 4474:
|
|
92
162
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
93
163
|
|
|
94
164
|
"use strict";
|
|
95
165
|
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
96
166
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
97
|
-
/* harmony export */ "
|
|
167
|
+
/* harmony export */ "Z": () => (/* binding */ OverriddenDefaultCrossSellingShelf)
|
|
98
168
|
/* harmony export */ });
|
|
99
|
-
/* harmony import */ var src_customizations_src_components_overrides_ProductDetails__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2925);
|
|
100
169
|
/* harmony import */ var src_sdk_overrides_getOverriddenSection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8788);
|
|
101
|
-
var
|
|
102
|
-
|
|
170
|
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(994);
|
|
171
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([___WEBPACK_IMPORTED_MODULE_1__]);
|
|
172
|
+
___WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
103
173
|
|
|
104
174
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
* This allows users to override the default ProductDetails section present in the Headless CMS
|
|
110
|
-
*/
|
|
111
|
-
const OverriddenDefaultProductDetails = (0,src_sdk_overrides_getOverriddenSection__WEBPACK_IMPORTED_MODULE_0__/* .getOverriddenSection */ .v)(src_customizations_src_components_overrides_ProductDetails__WEBPACK_IMPORTED_MODULE_1__/* .override */ .K);
|
|
175
|
+
const OverriddenDefaultCrossSellingShelf = (0,src_sdk_overrides_getOverriddenSection__WEBPACK_IMPORTED_MODULE_0__/* .getOverriddenSection */ .v)({
|
|
176
|
+
Section: ___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z
|
|
177
|
+
});
|
|
112
178
|
__webpack_async_result__();
|
|
113
179
|
} catch(e) { __webpack_async_result__(e); } });
|
|
114
180
|
|
|
115
181
|
/***/ }),
|
|
116
182
|
|
|
117
|
-
/***/
|
|
183
|
+
/***/ 8655:
|
|
118
184
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
119
185
|
|
|
120
186
|
"use strict";
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
187
|
+
|
|
188
|
+
// EXPORTS
|
|
189
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
190
|
+
"L": () => (/* binding */ OverriddenDefaultProductDetails)
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
;// CONCATENATED MODULE: ./src/customizations/src/components/overrides/ProductDetails.tsx
|
|
124
194
|
// This is an example of how it can be used on the starter.
|
|
125
195
|
const SECTION = 'ProductDetails';
|
|
126
196
|
const override = {
|
|
127
197
|
section: SECTION
|
|
128
198
|
};
|
|
129
199
|
|
|
200
|
+
// EXTERNAL MODULE: ./src/sdk/overrides/getOverriddenSection.tsx
|
|
201
|
+
var getOverriddenSection = __webpack_require__(8788);
|
|
202
|
+
// EXTERNAL MODULE: external "react"
|
|
203
|
+
var external_react_ = __webpack_require__(6689);
|
|
204
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
205
|
+
// EXTERNAL MODULE: ../sdk/dist/analytics/sendAnalyticsEvent.js
|
|
206
|
+
var sendAnalyticsEvent = __webpack_require__(1072);
|
|
207
|
+
// EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
|
|
208
|
+
var useFormattedPrice = __webpack_require__(5346);
|
|
209
|
+
// EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
|
|
210
|
+
var session = __webpack_require__(7295);
|
|
211
|
+
// EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
|
|
212
|
+
var Section = __webpack_require__(3271);
|
|
213
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/Accordion.js
|
|
214
|
+
var Accordion = __webpack_require__(1516);
|
|
215
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionItem.js
|
|
216
|
+
var AccordionItem = __webpack_require__(783);
|
|
217
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionButton.js
|
|
218
|
+
var AccordionButton = __webpack_require__(7734);
|
|
219
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionPanel.js
|
|
220
|
+
var AccordionPanel = __webpack_require__(7583);
|
|
221
|
+
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
222
|
+
var jsx_runtime_ = __webpack_require__(997);
|
|
223
|
+
;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/ProductDescription.tsx
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
function ProductDescription({
|
|
230
|
+
descriptionData,
|
|
231
|
+
initiallyExpanded = 'first'
|
|
232
|
+
}) {
|
|
233
|
+
/**
|
|
234
|
+
* Maps 'initiallyExpanded' prop values to indices
|
|
235
|
+
*/
|
|
236
|
+
const INITIALLY_EXPANDED_MAP = (0,external_react_.useMemo)(() => ({
|
|
237
|
+
none: [],
|
|
238
|
+
first: [0],
|
|
239
|
+
all: [0, 1, 2, 3]
|
|
240
|
+
}), []);
|
|
241
|
+
const {
|
|
242
|
+
0: indices,
|
|
243
|
+
1: setIndices
|
|
244
|
+
} = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
|
|
245
|
+
|
|
246
|
+
const onChange = index => {
|
|
247
|
+
setIndices(currentIndices => {
|
|
248
|
+
const newIndices = new Set(currentIndices);
|
|
249
|
+
|
|
250
|
+
if (currentIndices.has(index)) {
|
|
251
|
+
newIndices.delete(index);
|
|
252
|
+
} else {
|
|
253
|
+
newIndices.add(index);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return newIndices;
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
return /*#__PURE__*/jsx_runtime_.jsx("section", {
|
|
261
|
+
"data-fs-product-description": true,
|
|
262
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(Accordion/* default */.Z, {
|
|
263
|
+
indices: indices,
|
|
264
|
+
onChange: onChange,
|
|
265
|
+
"aria-label": "Product Details Content",
|
|
266
|
+
children: descriptionData.map(({
|
|
267
|
+
title,
|
|
268
|
+
content
|
|
269
|
+
}, index) => /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
|
|
270
|
+
as: "article",
|
|
271
|
+
index: index,
|
|
272
|
+
prefixId: "product-description",
|
|
273
|
+
"data-fs-product-details-description": true,
|
|
274
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
|
|
275
|
+
children: title
|
|
276
|
+
}), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
|
|
277
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("div", {
|
|
278
|
+
// Applies display: contents through FastStore UI
|
|
279
|
+
"data-fs-product-details-description-content": true // The content is already sanitized by FastStore API
|
|
280
|
+
,
|
|
281
|
+
dangerouslySetInnerHTML: {
|
|
282
|
+
__html: content
|
|
283
|
+
}
|
|
284
|
+
})
|
|
285
|
+
})]
|
|
286
|
+
}, String(index)))
|
|
287
|
+
})
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* harmony default export */ const ProductDescription_ProductDescription = (ProductDescription);
|
|
292
|
+
// EXTERNAL MODULE: ../components/dist/esm/hooks/UIProvider.js
|
|
293
|
+
var UIProvider = __webpack_require__(6652);
|
|
294
|
+
// EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
|
|
295
|
+
var cart = __webpack_require__(6073);
|
|
296
|
+
;// CONCATENATED MODULE: ./src/sdk/cart/useBuyButton.ts
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
const useBuyButton = item => {
|
|
303
|
+
const {
|
|
304
|
+
openCart
|
|
305
|
+
} = (0,UIProvider/* useUI */.l)();
|
|
306
|
+
const {
|
|
307
|
+
currency: {
|
|
308
|
+
code
|
|
309
|
+
}
|
|
310
|
+
} = (0,session/* useSession */.kP)();
|
|
311
|
+
const onClick = (0,external_react_.useCallback)(e => {
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
|
|
314
|
+
if (!item) {
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
(0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
|
|
319
|
+
name: 'add_to_cart',
|
|
320
|
+
params: {
|
|
321
|
+
currency: code,
|
|
322
|
+
// TODO: In the future, we can explore more robust ways of
|
|
323
|
+
// calculating the value (gift items, discounts, etc.).
|
|
324
|
+
value: item.price * item.quantity,
|
|
325
|
+
items: [{
|
|
326
|
+
item_id: item.itemOffered.isVariantOf.productGroupID,
|
|
327
|
+
item_name: item.itemOffered.isVariantOf.name,
|
|
328
|
+
item_brand: item.itemOffered.brand.name,
|
|
329
|
+
item_variant: item.itemOffered.sku,
|
|
330
|
+
quantity: item.quantity,
|
|
331
|
+
price: item.price,
|
|
332
|
+
discount: item.listPrice - item.price,
|
|
333
|
+
currency: code,
|
|
334
|
+
item_variant_name: item.itemOffered.name,
|
|
335
|
+
product_reference_id: item.itemOffered.gtin
|
|
336
|
+
}]
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
cart/* cartStore.addItem */.i8.addItem(item);
|
|
340
|
+
openCart();
|
|
341
|
+
}, [code, item, openCart]);
|
|
342
|
+
return {
|
|
343
|
+
onClick,
|
|
344
|
+
'data-testid': 'buy-button',
|
|
345
|
+
'data-sku': item?.itemOffered.sku,
|
|
346
|
+
'data-seller': item?.seller.identifier
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
// EXTERNAL MODULE: ./node_modules/next/link.js
|
|
350
|
+
var next_link = __webpack_require__(1664);
|
|
351
|
+
var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
|
|
352
|
+
// EXTERNAL MODULE: ./src/components/ui/Image/Image.tsx + 1 modules
|
|
353
|
+
var Image = __webpack_require__(5731);
|
|
354
|
+
// EXTERNAL MODULE: ./src/sdk/overrides/OverrideContext.tsx
|
|
355
|
+
var OverrideContext = __webpack_require__(5522);
|
|
356
|
+
;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
|
|
357
|
+
const _excluded = ["src", "alt"],
|
|
358
|
+
_excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
|
|
359
|
+
|
|
360
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
361
|
+
|
|
362
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
363
|
+
|
|
364
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
365
|
+
|
|
366
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
367
|
+
|
|
368
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
const ImageComponent = _ref => {
|
|
377
|
+
let {
|
|
378
|
+
src,
|
|
379
|
+
alt
|
|
380
|
+
} = _ref,
|
|
381
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
382
|
+
|
|
383
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, _objectSpread({
|
|
384
|
+
src: src,
|
|
385
|
+
alt: alt,
|
|
386
|
+
width: 34,
|
|
387
|
+
height: 34
|
|
388
|
+
}, otherProps));
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
function Selectors(_ref2) {
|
|
392
|
+
let {
|
|
393
|
+
slugsMap,
|
|
394
|
+
activeVariations,
|
|
395
|
+
availableVariations
|
|
396
|
+
} = _ref2,
|
|
397
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
398
|
+
|
|
399
|
+
const {
|
|
400
|
+
SkuSelector
|
|
401
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
402
|
+
return /*#__PURE__*/jsx_runtime_.jsx("section", _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
403
|
+
children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/(0,external_react_.createElement)(SkuSelector.Component, _objectSpread(_objectSpread({
|
|
404
|
+
ImageComponent: ImageComponent
|
|
405
|
+
}, SkuSelector.props), {}, {
|
|
406
|
+
key: skuVariant,
|
|
407
|
+
skuPropertyName: skuVariant,
|
|
408
|
+
availableVariations: availableVariations,
|
|
409
|
+
activeVariations: activeVariations,
|
|
410
|
+
slugsMap: slugsMap,
|
|
411
|
+
linkProps: _objectSpread(_objectSpread({}, SkuSelector.props.linkProps ?? {}), {}, {
|
|
412
|
+
as: SkuSelector.props.linkProps?.as ?? (link_default()),
|
|
413
|
+
legacyBehavior: SkuSelector.props.linkProps?.legacyBehavior ?? false
|
|
414
|
+
})
|
|
415
|
+
})))
|
|
416
|
+
}));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/* harmony default export */ const SkuSelector_Selectors = (Selectors);
|
|
420
|
+
;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
function AddToCartLoadingSkeleton() {
|
|
424
|
+
return (
|
|
425
|
+
/*#__PURE__*/
|
|
426
|
+
// Generated via https://skeletonreact.com/.
|
|
427
|
+
(0,jsx_runtime_.jsxs)("svg", {
|
|
428
|
+
role: "img",
|
|
429
|
+
width: "100%",
|
|
430
|
+
height: "48",
|
|
431
|
+
"aria-labelledby": "loading-aria",
|
|
432
|
+
viewBox: "0 0 112 48",
|
|
433
|
+
preserveAspectRatio: "none",
|
|
434
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("title", {
|
|
435
|
+
id: "loading-aria",
|
|
436
|
+
children: "Loading..."
|
|
437
|
+
}), /*#__PURE__*/jsx_runtime_.jsx("rect", {
|
|
438
|
+
x: "0",
|
|
439
|
+
y: "0",
|
|
440
|
+
width: "100%",
|
|
441
|
+
height: "100%",
|
|
442
|
+
clipPath: "url(#clip-path)",
|
|
443
|
+
style: {
|
|
444
|
+
fill: 'url("#fill")'
|
|
445
|
+
}
|
|
446
|
+
}), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
|
|
447
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("clipPath", {
|
|
448
|
+
id: "clip-path",
|
|
449
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("rect", {
|
|
450
|
+
x: "0",
|
|
451
|
+
y: "0",
|
|
452
|
+
rx: "2",
|
|
453
|
+
ry: "2",
|
|
454
|
+
width: "112",
|
|
455
|
+
height: "48"
|
|
456
|
+
})
|
|
457
|
+
}), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
|
|
458
|
+
id: "fill",
|
|
459
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("stop", {
|
|
460
|
+
offset: "0.599964",
|
|
461
|
+
stopColor: "#f3f3f3",
|
|
462
|
+
stopOpacity: "1",
|
|
463
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
|
|
464
|
+
attributeName: "offset",
|
|
465
|
+
values: "-2; -2; 1",
|
|
466
|
+
keyTimes: "0; 0.25; 1",
|
|
467
|
+
dur: "2s",
|
|
468
|
+
repeatCount: "indefinite"
|
|
469
|
+
})
|
|
470
|
+
}), /*#__PURE__*/jsx_runtime_.jsx("stop", {
|
|
471
|
+
offset: "1.59996",
|
|
472
|
+
stopColor: "#ecebeb",
|
|
473
|
+
stopOpacity: "1",
|
|
474
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
|
|
475
|
+
attributeName: "offset",
|
|
476
|
+
values: "-1; -1; 2",
|
|
477
|
+
keyTimes: "0; 0.25; 1",
|
|
478
|
+
dur: "2s",
|
|
479
|
+
repeatCount: "indefinite"
|
|
480
|
+
})
|
|
481
|
+
}), /*#__PURE__*/jsx_runtime_.jsx("stop", {
|
|
482
|
+
offset: "2.59996",
|
|
483
|
+
stopColor: "#f3f3f3",
|
|
484
|
+
stopOpacity: "1",
|
|
485
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
|
|
486
|
+
attributeName: "offset",
|
|
487
|
+
values: "0; 0; 3",
|
|
488
|
+
keyTimes: "0; 0.25; 1",
|
|
489
|
+
dur: "2s",
|
|
490
|
+
repeatCount: "indefinite"
|
|
491
|
+
})
|
|
492
|
+
})]
|
|
493
|
+
})]
|
|
494
|
+
})]
|
|
495
|
+
})
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/ProductDetailsSettings.tsx
|
|
499
|
+
function ProductDetailsSettings_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
500
|
+
|
|
501
|
+
function ProductDetailsSettings_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetailsSettings_ownKeys(Object(source), !0).forEach(function (key) { ProductDetailsSettings_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetailsSettings_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
502
|
+
|
|
503
|
+
function ProductDetailsSettings_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
function ProductDetailsSettings({
|
|
516
|
+
product,
|
|
517
|
+
buyButtonTitle,
|
|
518
|
+
isValidating,
|
|
519
|
+
quantity,
|
|
520
|
+
setQuantity,
|
|
521
|
+
buyButtonIcon: {
|
|
522
|
+
icon: buyButtonIconName,
|
|
523
|
+
alt: buyButtonIconAlt
|
|
524
|
+
},
|
|
525
|
+
notAvailableButtonTitle
|
|
526
|
+
}) {
|
|
527
|
+
const {
|
|
528
|
+
BuyButton,
|
|
529
|
+
Icon,
|
|
530
|
+
ProductPrice,
|
|
531
|
+
QuantitySelector,
|
|
532
|
+
__experimentalNotAvailableButton: NotAvailableButton
|
|
533
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
534
|
+
const {
|
|
535
|
+
id,
|
|
536
|
+
sku,
|
|
537
|
+
gtin,
|
|
538
|
+
name: variantName,
|
|
539
|
+
brand,
|
|
540
|
+
isVariantOf,
|
|
541
|
+
isVariantOf: {
|
|
542
|
+
skuVariants
|
|
543
|
+
},
|
|
544
|
+
image: productImages,
|
|
545
|
+
additionalProperty,
|
|
546
|
+
offers: {
|
|
547
|
+
offers: [{
|
|
548
|
+
availability,
|
|
549
|
+
price,
|
|
550
|
+
listPrice,
|
|
551
|
+
seller
|
|
552
|
+
}]
|
|
553
|
+
}
|
|
554
|
+
} = product;
|
|
555
|
+
const buyProps = useBuyButton({
|
|
556
|
+
id,
|
|
557
|
+
price,
|
|
558
|
+
listPrice,
|
|
559
|
+
seller,
|
|
560
|
+
quantity,
|
|
561
|
+
itemOffered: {
|
|
562
|
+
sku,
|
|
563
|
+
name: variantName,
|
|
564
|
+
gtin,
|
|
565
|
+
image: productImages,
|
|
566
|
+
brand,
|
|
567
|
+
isVariantOf,
|
|
568
|
+
additionalProperty
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
|
|
572
|
+
|
|
573
|
+
const AddToCartButton = () => {
|
|
574
|
+
return outOfStock ?
|
|
575
|
+
/*#__PURE__*/
|
|
576
|
+
// TODO: Adds <OutOfStock /> when component is ready to use
|
|
577
|
+
jsx_runtime_.jsx(NotAvailableButton.Component, {
|
|
578
|
+
children: notAvailableButtonTitle
|
|
579
|
+
}) : /*#__PURE__*/jsx_runtime_.jsx(BuyButton.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, BuyButton.props), {}, {
|
|
580
|
+
icon: /*#__PURE__*/jsx_runtime_.jsx(Icon.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Icon.props), {}, {
|
|
581
|
+
name: buyButtonIconName ?? Icon.props.name,
|
|
582
|
+
"aria-label": buyButtonIconAlt ?? Icon.props['aria-label']
|
|
583
|
+
}))
|
|
584
|
+
}, buyProps), {}, {
|
|
585
|
+
children: buyButtonTitle || 'Add to Cart'
|
|
586
|
+
}));
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
|
|
590
|
+
children: [!outOfStock && /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
|
|
591
|
+
"data-fs-product-details-values": true,
|
|
592
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx(ProductPrice.Component, ProductDetailsSettings_objectSpread({
|
|
593
|
+
"data-fs-product-details-prices": true,
|
|
594
|
+
value: price,
|
|
595
|
+
listPrice: listPrice,
|
|
596
|
+
formatter: useFormattedPrice/* useFormattedPrice */.P
|
|
597
|
+
}, ProductPrice.props)), /*#__PURE__*/jsx_runtime_.jsx(QuantitySelector.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
|
|
598
|
+
min: 1,
|
|
599
|
+
max: 10
|
|
600
|
+
}, QuantitySelector.props), {}, {
|
|
601
|
+
// Dynamic props shouldn't be overridable
|
|
602
|
+
// This decision can be reviewed later if needed
|
|
603
|
+
onChange: setQuantity
|
|
604
|
+
}))]
|
|
605
|
+
}), skuVariants && /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_Selectors, {
|
|
606
|
+
slugsMap: skuVariants.slugsMap,
|
|
607
|
+
availableVariations: skuVariants.availableVariations,
|
|
608
|
+
activeVariations: skuVariants.activeVariations,
|
|
609
|
+
"data-fs-product-details-selectors": true
|
|
610
|
+
}), isValidating ?
|
|
611
|
+
/*#__PURE__*/
|
|
612
|
+
|
|
613
|
+
/* NOTE:
|
|
614
|
+
A loading skeleton had to be used to avoid a Lighthouse's
|
|
615
|
+
non-composited animation violation due to the button transitioning its
|
|
616
|
+
background color when changing from its initial disabled to active state.
|
|
617
|
+
See full explanation on commit https://git.io/JyXV5. */
|
|
618
|
+
jsx_runtime_.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/jsx_runtime_.jsx(AddToCartButton, {})]
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/* harmony default export */ const ProductDetails_ProductDetailsSettings = (ProductDetailsSettings);
|
|
623
|
+
// EXTERNAL MODULE: ./src/components/sections/ProductDetails/section.module.scss
|
|
624
|
+
var section_module = __webpack_require__(9034);
|
|
625
|
+
var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
|
|
626
|
+
// EXTERNAL MODULE: ./src/sdk/overrides/PageProvider.tsx
|
|
627
|
+
var PageProvider = __webpack_require__(5953);
|
|
628
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/Rating/Rating.js
|
|
629
|
+
var Rating = __webpack_require__(3024);
|
|
630
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/ProductTitle/ProductTitle.js
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
const ProductTitle = (0,external_react_.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
|
|
634
|
+
return (external_react_default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
|
|
635
|
+
external_react_default().createElement("div", { "data-fs-product-title-header": true },
|
|
636
|
+
title,
|
|
637
|
+
!!label && label),
|
|
638
|
+
(refNumber || ratingValue) && (external_react_default().createElement("div", { "data-fs-product-title-addendum": true },
|
|
639
|
+
ratingValue && external_react_default().createElement(Rating/* default */.Z, { value: ratingValue }),
|
|
640
|
+
refNumber && (external_react_default().createElement((external_react_default()).Fragment, null,
|
|
641
|
+
refTag,
|
|
642
|
+
" ",
|
|
643
|
+
refNumber))))));
|
|
644
|
+
});
|
|
645
|
+
/* harmony default export */ const ProductTitle_ProductTitle = (ProductTitle);
|
|
646
|
+
//# sourceMappingURL=ProductTitle.js.map
|
|
647
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/DiscountBadge/DiscountBadge.js + 1 modules
|
|
648
|
+
var DiscountBadge = __webpack_require__(2946);
|
|
649
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
|
|
650
|
+
var Button = __webpack_require__(3339);
|
|
651
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/BuyButton/BuyButton.js
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
|
|
655
|
+
return (external_react_default().createElement(Button/* default */.Z, { "data-fs-buy-button": true, icon: icon, iconPosition: "left", "data-testid": testId, ...otherProps }, children));
|
|
656
|
+
}
|
|
657
|
+
/* harmony default export */ const BuyButton_BuyButton = (BuyButton);
|
|
658
|
+
//# sourceMappingURL=BuyButton.js.map
|
|
659
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
|
|
660
|
+
var Icon = __webpack_require__(2614);
|
|
661
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/ProductPrice/ProductPrice.js
|
|
662
|
+
var ProductPrice = __webpack_require__(9088);
|
|
663
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/QuantitySelector/QuantitySelector.js
|
|
664
|
+
var QuantitySelector = __webpack_require__(6693);
|
|
665
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Label/Label.js
|
|
666
|
+
var Label = __webpack_require__(1953);
|
|
667
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Link/Link.js
|
|
668
|
+
var Link = __webpack_require__(727);
|
|
669
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/SROnly/SROnly.js
|
|
670
|
+
var SROnly = __webpack_require__(5450);
|
|
671
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useDefineVariant.js
|
|
672
|
+
|
|
673
|
+
const getImageName = (src) => {
|
|
674
|
+
const sourcePath = new URL(src).pathname;
|
|
675
|
+
const imageName = sourcePath.split('/').slice(-1)[0];
|
|
676
|
+
return imageName;
|
|
677
|
+
};
|
|
678
|
+
const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
|
|
679
|
+
if (variant)
|
|
680
|
+
return variant;
|
|
681
|
+
const allOptionsHaveHexColor = options.every((option) => option.hexColor);
|
|
682
|
+
if (allOptionsHaveHexColor) {
|
|
683
|
+
return 'color';
|
|
684
|
+
}
|
|
685
|
+
const firstImageName = options[0]?.src && getImageName(options[0].src);
|
|
686
|
+
const areSourcesEqualsOrNull = options.every((option) => {
|
|
687
|
+
if (!option.src) {
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
const optionImageName = getImageName(option.src);
|
|
691
|
+
return optionImageName === firstImageName;
|
|
692
|
+
});
|
|
693
|
+
if (!areSourcesEqualsOrNull) {
|
|
694
|
+
return 'image';
|
|
695
|
+
}
|
|
696
|
+
return 'label';
|
|
697
|
+
}, [options, variant]);
|
|
698
|
+
//# sourceMappingURL=useDefineVariant.js.map
|
|
699
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useSkuSlug.js
|
|
700
|
+
|
|
701
|
+
function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
|
|
702
|
+
const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
|
|
703
|
+
if (slugsMapKey in slugsMap) {
|
|
704
|
+
return slugsMap[slugsMapKey];
|
|
705
|
+
}
|
|
706
|
+
const possibleVariants = Object.keys(slugsMap);
|
|
707
|
+
const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
|
|
708
|
+
return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
|
|
709
|
+
}
|
|
710
|
+
const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
|
|
711
|
+
const getItemHref = (0,external_react_.useCallback)((option) => {
|
|
712
|
+
if (getItemHrefProp)
|
|
713
|
+
return { getItemHrefProp };
|
|
714
|
+
const currentItemHref = `/${getSkuSlug(slugsMap, {
|
|
715
|
+
...activeVariations,
|
|
716
|
+
[skuPropertyName]: option.value,
|
|
717
|
+
}, skuPropertyName)}/p`;
|
|
718
|
+
return currentItemHref;
|
|
719
|
+
}, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
|
|
720
|
+
return { getItemHref };
|
|
721
|
+
};
|
|
722
|
+
//# sourceMappingURL=useSkuSlug.js.map
|
|
723
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/SkuSelector.js
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
// TODO: Change by ImageComponent when it be right
|
|
729
|
+
const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
|
|
730
|
+
const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
|
|
731
|
+
const activeSelectorValue = activeVariations[skuPropertyName];
|
|
732
|
+
const options = availableVariations[skuPropertyName];
|
|
733
|
+
const variant = useDefineVariant(options, variantProp);
|
|
734
|
+
const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
|
|
735
|
+
return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
|
|
736
|
+
skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
|
|
737
|
+
skuPropertyName,
|
|
738
|
+
": ",
|
|
739
|
+
external_react_default().createElement("strong", null, activeSelectorValue))),
|
|
740
|
+
external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
|
|
741
|
+
return (external_react_default().createElement("li", { key: String(index), title: option.label, "data-fs-sku-selector-option": true, "data-fs-sku-selector-disabled": option.disabled, "data-fs-sku-selector-checked": option.value === activeVariations[skuPropertyName] },
|
|
742
|
+
external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
|
|
743
|
+
external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
|
|
744
|
+
variant === 'label' && external_react_default().createElement("span", null, option.value),
|
|
745
|
+
variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
|
|
746
|
+
external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
|
|
747
|
+
variant === 'color' && (external_react_default().createElement("span", null,
|
|
748
|
+
external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
|
|
749
|
+
'--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
|
|
750
|
+
} })))));
|
|
751
|
+
}))));
|
|
752
|
+
});
|
|
753
|
+
/* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
|
|
754
|
+
//# sourceMappingURL=SkuSelector.js.map
|
|
755
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/InputField/InputField.js
|
|
756
|
+
var InputField = __webpack_require__(3779);
|
|
757
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/Table.js
|
|
758
|
+
|
|
759
|
+
const Table = (0,external_react_.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
|
|
760
|
+
return (external_react_default().createElement("div", { "data-fs-table": true },
|
|
761
|
+
external_react_default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
|
|
762
|
+
});
|
|
763
|
+
/* harmony default export */ const Table_Table = (Table);
|
|
764
|
+
//# sourceMappingURL=Table.js.map
|
|
765
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableBody.js
|
|
766
|
+
|
|
767
|
+
const TableBody = (0,external_react_.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
|
|
768
|
+
return (external_react_default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
|
|
769
|
+
});
|
|
770
|
+
/* harmony default export */ const Table_TableBody = (TableBody);
|
|
771
|
+
//# sourceMappingURL=TableBody.js.map
|
|
772
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableRow.js
|
|
773
|
+
|
|
774
|
+
const TableRow = (0,external_react_.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
|
|
775
|
+
return (external_react_default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
|
|
776
|
+
});
|
|
777
|
+
/* harmony default export */ const Table_TableRow = (TableRow);
|
|
778
|
+
//# sourceMappingURL=TableRow.js.map
|
|
779
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableCell.js
|
|
780
|
+
|
|
781
|
+
const TableCell = (0,external_react_.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
|
|
782
|
+
const Cell = variant === 'header' ? 'th' : 'td';
|
|
783
|
+
return (external_react_default().createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
|
|
784
|
+
});
|
|
785
|
+
/* harmony default export */ const Table_TableCell = (TableCell);
|
|
786
|
+
//# sourceMappingURL=TableCell.js.map
|
|
787
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Price/Price.js
|
|
788
|
+
var Price = __webpack_require__(9767);
|
|
789
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ShippingSimulation/ShippingSimulation.js
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
function ShippingSimulation({ testId = 'fs-shipping-simulation', formatter, title = 'Shipping', inputLabel = 'Postal Code', optionsLabel = 'Shipping options', idkPostalCodeLinkProps, onInput, onSubmit, onClear, location, options = [], displayClearButton = false, errorMessage, postalCode, ...otherProps }) {
|
|
793
|
+
const hasShippingOptions = !!options && options.length > 0;
|
|
794
|
+
return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
|
|
795
|
+
external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
|
|
796
|
+
external_react_default().createElement(InputField/* default */.Z, { actionable: true, error: errorMessage, id: `${testId}-input-field`, label: inputLabel, value: postalCode, onInput: (event) => onInput?.(event), onSubmit: () => onSubmit?.(), onClear: () => onClear?.(), displayClearButton: displayClearButton }),
|
|
797
|
+
external_react_default().createElement(Link/* default */.Z, { href: "/", "data-fs-shipping-simulation-link": true, size: "small", ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ?? (external_react_default().createElement((external_react_default()).Fragment, null,
|
|
798
|
+
"I don't know my Postal Code",
|
|
799
|
+
external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
|
|
800
|
+
hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
|
|
801
|
+
external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
|
|
802
|
+
external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
|
|
803
|
+
external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
|
|
804
|
+
external_react_default().createElement(Table_Table, null,
|
|
805
|
+
external_react_default().createElement(Table_TableBody, null, options.map((option) => (external_react_default().createElement(Table_TableRow, { key: option.carrier },
|
|
806
|
+
external_react_default().createElement(Table_TableCell, { align: "left" }, option.carrier),
|
|
807
|
+
external_react_default().createElement(Table_TableCell, null, option.localizedEstimates),
|
|
808
|
+
external_react_default().createElement(Table_TableCell, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
|
|
809
|
+
}
|
|
810
|
+
/* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
|
|
811
|
+
//# sourceMappingURL=ShippingSimulation.js.map
|
|
812
|
+
// EXTERNAL MODULE: external "react-intersection-observer"
|
|
813
|
+
var external_react_intersection_observer_ = __webpack_require__(9785);
|
|
814
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
|
|
815
|
+
var IconButton = __webpack_require__(7041);
|
|
816
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallerySelector.js
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
const SCROLL_MARGIN_VALUE = 400;
|
|
821
|
+
const moveScroll = (container, value) => {
|
|
822
|
+
if (container) {
|
|
823
|
+
if (container.scrollHeight > container.clientHeight) {
|
|
824
|
+
// TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
|
|
825
|
+
container.style.overflow = 'auto';
|
|
826
|
+
window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
|
|
827
|
+
setTimeout(() => (container.style.overflow = 'hidden'), 2000);
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
container.scrollLeft += value;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
const hasScroll = (container) => {
|
|
835
|
+
if (container) {
|
|
836
|
+
return (container.scrollHeight > container.clientHeight ||
|
|
837
|
+
container.scrollWidth > container.clientWidth);
|
|
838
|
+
}
|
|
839
|
+
return false;
|
|
840
|
+
};
|
|
841
|
+
function ImageGallerySelector({ images, onSelect, ImageComponent, currentImageIdx, testId = 'fs-image-gallery-selector', 'aria-label': ariaLabel = 'Product Images', navigationButtonLeftAriaLabel = 'Backward slide image selector', navigationButtonRightAriaLabel = 'Forward slide image selector', }) {
|
|
842
|
+
const elementsRef = (0,external_react_.useRef)(null);
|
|
843
|
+
const elementHasScroll = hasScroll(elementsRef.current);
|
|
844
|
+
const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
|
|
845
|
+
const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
|
|
846
|
+
const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
|
|
847
|
+
idx === 0 && setFirstImageInView(inView);
|
|
848
|
+
idx === images.length - 1 && setLastImageInView(inView);
|
|
849
|
+
}, [images.length]);
|
|
850
|
+
return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel },
|
|
851
|
+
elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
|
|
852
|
+
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonLeftAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, -SCROLL_MARGIN_VALUE) }))),
|
|
853
|
+
external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
|
|
854
|
+
return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
|
|
855
|
+
external_react_default().createElement(Button/* default */.Z, { key: idx, "aria-label": `${image.alternateName} - Image ${idx + 1} of ${images.length}`, onClick: () => onSelect(idx), "data-fs-image-gallery-selector-thumbnail": idx === currentImageIdx ? 'selected' : 'true' },
|
|
856
|
+
external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
|
|
857
|
+
})),
|
|
858
|
+
elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
|
|
859
|
+
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonRightAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, +SCROLL_MARGIN_VALUE) })))));
|
|
860
|
+
}
|
|
861
|
+
/* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
|
|
862
|
+
//# sourceMappingURL=ImageGallerySelector.js.map
|
|
863
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallery.js
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
|
|
867
|
+
const hasSelector = images.length > 1;
|
|
868
|
+
return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-testid": testId, ...otherProps },
|
|
869
|
+
children,
|
|
870
|
+
hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
|
|
871
|
+
});
|
|
872
|
+
/* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
|
|
873
|
+
//# sourceMappingURL=ImageGallery.js.map
|
|
874
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGalleryViewer.js
|
|
875
|
+
|
|
876
|
+
const ImageGalleryViewer = ({ children, }) => {
|
|
877
|
+
return external_react_default().createElement((external_react_default()).Fragment, null, children);
|
|
878
|
+
};
|
|
879
|
+
/* harmony default export */ const ImageGallery_ImageGalleryViewer = (ImageGalleryViewer);
|
|
880
|
+
//# sourceMappingURL=ImageGalleryViewer.js.map
|
|
881
|
+
// EXTERNAL MODULE: external "next/router"
|
|
882
|
+
var router_ = __webpack_require__(1853);
|
|
883
|
+
;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
|
|
884
|
+
const ImageGallery_excluded = ["images"];
|
|
885
|
+
|
|
886
|
+
function ImageGallery_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
887
|
+
|
|
888
|
+
function ImageGallery_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ImageGallery_ownKeys(Object(source), !0).forEach(function (key) { ImageGallery_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ImageGallery_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
889
|
+
|
|
890
|
+
function ImageGallery_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
891
|
+
|
|
892
|
+
function ImageGallery_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ImageGallery_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
893
|
+
|
|
894
|
+
function ImageGallery_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
const ImageGallery_ImageComponent = ({
|
|
902
|
+
url,
|
|
903
|
+
alternateName
|
|
904
|
+
}) => {
|
|
905
|
+
const {
|
|
906
|
+
__experimentalImageGalleryImage: Image
|
|
907
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
908
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Image.Component, {
|
|
909
|
+
src: url,
|
|
910
|
+
alt: alternateName,
|
|
911
|
+
width: 68,
|
|
912
|
+
height: 68
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
const ImageGallery_ImageGallery_ImageGallery = _ref => {
|
|
917
|
+
let {
|
|
918
|
+
images
|
|
919
|
+
} = _ref,
|
|
920
|
+
otherProps = ImageGallery_objectWithoutProperties(_ref, ImageGallery_excluded);
|
|
921
|
+
|
|
922
|
+
const {
|
|
923
|
+
ImageGallery: ImageGalleryWrapper,
|
|
924
|
+
ImageGalleryViewer,
|
|
925
|
+
__experimentalImageGalleryImage: Image
|
|
926
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
927
|
+
const {
|
|
928
|
+
0: selectedImageIdx,
|
|
929
|
+
1: setSelectedImageIdx
|
|
930
|
+
} = (0,external_react_.useState)(0);
|
|
931
|
+
const currentImage = images[selectedImageIdx] ?? images[0];
|
|
932
|
+
const dynamicRoute = (0,router_.useRouter)().asPath;
|
|
933
|
+
(0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
|
|
934
|
+
return /*#__PURE__*/jsx_runtime_.jsx(ImageGalleryWrapper.Component, ImageGallery_objectSpread(ImageGallery_objectSpread(ImageGallery_objectSpread({}, ImageGalleryWrapper.props), {}, {
|
|
935
|
+
images: images,
|
|
936
|
+
ImageComponent: ImageGallery_ImageComponent,
|
|
937
|
+
selectedImageIdx: selectedImageIdx,
|
|
938
|
+
setSelectedImageIdx: setSelectedImageIdx
|
|
939
|
+
}, otherProps), {}, {
|
|
940
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ImageGalleryViewer.Component, ImageGallery_objectSpread(ImageGallery_objectSpread({}, ImageGalleryViewer.props), {}, {
|
|
941
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(Image.Component, ImageGallery_objectSpread(ImageGallery_objectSpread({
|
|
942
|
+
sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
|
|
943
|
+
width: 691,
|
|
944
|
+
height: 691 * (3 / 4),
|
|
945
|
+
loading: "eager"
|
|
946
|
+
}, Image.props), {}, {
|
|
947
|
+
src: currentImage.url,
|
|
948
|
+
alt: currentImage.alternateName
|
|
949
|
+
}))
|
|
950
|
+
}))
|
|
951
|
+
}));
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
/* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
|
|
955
|
+
// EXTERNAL MODULE: ./src/sdk/graphql/request.ts
|
|
956
|
+
var request = __webpack_require__(180);
|
|
957
|
+
;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
|
|
958
|
+
|
|
959
|
+
const query = "ClientShippingSimulationQuery";
|
|
960
|
+
const getShippingSimulation = async ({
|
|
961
|
+
items,
|
|
962
|
+
postalCode,
|
|
963
|
+
country
|
|
964
|
+
}) => {
|
|
965
|
+
const data = await (0,request/* request */.W)(query, {
|
|
966
|
+
items,
|
|
967
|
+
postalCode,
|
|
968
|
+
country
|
|
969
|
+
});
|
|
970
|
+
return data;
|
|
971
|
+
};
|
|
972
|
+
/* harmony default export */ const shipping = (getShippingSimulation);
|
|
973
|
+
;// CONCATENATED MODULE: ./src/sdk/shipping/useShippingSimulation.ts
|
|
974
|
+
function useShippingSimulation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
975
|
+
|
|
976
|
+
function useShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? useShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { useShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : useShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
977
|
+
|
|
978
|
+
function useShippingSimulation_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
const createEmptySimulation = () => ({
|
|
985
|
+
input: {
|
|
986
|
+
postalCode: '',
|
|
987
|
+
displayClearButton: false,
|
|
988
|
+
errorMessage: ''
|
|
989
|
+
},
|
|
990
|
+
shippingSimulation: undefined
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
const reducer = (state, action) => {
|
|
994
|
+
const {
|
|
995
|
+
type
|
|
996
|
+
} = action;
|
|
997
|
+
|
|
998
|
+
switch (type) {
|
|
999
|
+
case 'clear':
|
|
1000
|
+
{
|
|
1001
|
+
return createEmptySimulation();
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
case 'update':
|
|
1005
|
+
{
|
|
1006
|
+
const {
|
|
1007
|
+
payload
|
|
1008
|
+
} = action;
|
|
1009
|
+
return {
|
|
1010
|
+
input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload.input),
|
|
1011
|
+
shippingSimulation: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
case 'onInput':
|
|
1016
|
+
{
|
|
1017
|
+
const {
|
|
1018
|
+
payload
|
|
1019
|
+
} = action;
|
|
1020
|
+
return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
|
|
1021
|
+
input: useShippingSimulation_objectSpread({}, payload)
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
case 'onError':
|
|
1026
|
+
{
|
|
1027
|
+
const {
|
|
1028
|
+
payload
|
|
1029
|
+
} = action;
|
|
1030
|
+
return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
|
|
1031
|
+
input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload)
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
default:
|
|
1036
|
+
throw new Error(`Action ${type} not implemented`);
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
const useShippingSimulation = shippingItem => {
|
|
1041
|
+
const {
|
|
1042
|
+
0: {
|
|
1043
|
+
input,
|
|
1044
|
+
shippingSimulation
|
|
1045
|
+
},
|
|
1046
|
+
1: dispatch
|
|
1047
|
+
} = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
|
|
1048
|
+
const {
|
|
1049
|
+
country,
|
|
1050
|
+
postalCode: sessionPostalCode
|
|
1051
|
+
} = (0,session/* useSession */.kP)();
|
|
1052
|
+
const {
|
|
1053
|
+
postalCode: shippingPostalCode
|
|
1054
|
+
} = input;
|
|
1055
|
+
const shippingPostalCodeRef = (0,external_react_.useRef)(shippingPostalCode);
|
|
1056
|
+
(0,external_react_.useEffect)(() => {
|
|
1057
|
+
const shouldFetch = sessionPostalCode && !shippingPostalCodeRef.current;
|
|
1058
|
+
|
|
1059
|
+
if (!shouldFetch) {
|
|
1060
|
+
return;
|
|
1061
|
+
} // Use sessionPostalCode if there is no shippingPostalCode
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
async function fetchShipping() {
|
|
1065
|
+
const data = await shipping({
|
|
1066
|
+
country,
|
|
1067
|
+
postalCode: sessionPostalCode ?? '',
|
|
1068
|
+
items: [shippingItem]
|
|
1069
|
+
});
|
|
1070
|
+
const shippingSimulation = data.shipping;
|
|
1071
|
+
dispatch({
|
|
1072
|
+
type: 'update',
|
|
1073
|
+
payload: {
|
|
1074
|
+
input: {
|
|
1075
|
+
postalCode: sessionPostalCode ?? '',
|
|
1076
|
+
displayClearButton: true,
|
|
1077
|
+
errorMessage: ''
|
|
1078
|
+
},
|
|
1079
|
+
shippingSimulation
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
fetchShipping();
|
|
1085
|
+
}, [country, sessionPostalCode, shippingItem]);
|
|
1086
|
+
const handleSubmit = (0,external_react_.useCallback)(async () => {
|
|
1087
|
+
try {
|
|
1088
|
+
const data = await shipping({
|
|
1089
|
+
country,
|
|
1090
|
+
postalCode: shippingPostalCode ?? '',
|
|
1091
|
+
items: [shippingItem]
|
|
1092
|
+
});
|
|
1093
|
+
const shippingSimulation = data.shipping;
|
|
1094
|
+
dispatch({
|
|
1095
|
+
type: 'update',
|
|
1096
|
+
payload: {
|
|
1097
|
+
input: {
|
|
1098
|
+
displayClearButton: true,
|
|
1099
|
+
errorMessage: ''
|
|
1100
|
+
},
|
|
1101
|
+
shippingSimulation
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
} catch (error) {
|
|
1105
|
+
dispatch({
|
|
1106
|
+
type: 'onError',
|
|
1107
|
+
payload: {
|
|
1108
|
+
displayClearButton: true,
|
|
1109
|
+
errorMessage: 'You entered an invalid Postal Code'
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
}, [country, shippingItem, shippingPostalCode]);
|
|
1114
|
+
const handleOnInput = (0,external_react_.useCallback)(e => {
|
|
1115
|
+
const currentValue = e.currentTarget.value;
|
|
1116
|
+
|
|
1117
|
+
if (currentValue) {
|
|
1118
|
+
dispatch({
|
|
1119
|
+
type: 'onInput',
|
|
1120
|
+
payload: {
|
|
1121
|
+
postalCode: currentValue,
|
|
1122
|
+
displayClearButton: false,
|
|
1123
|
+
errorMessage: ''
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
} else {
|
|
1127
|
+
dispatch({
|
|
1128
|
+
type: 'clear'
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}, []);
|
|
1132
|
+
return {
|
|
1133
|
+
input,
|
|
1134
|
+
shippingSimulation,
|
|
1135
|
+
handleOnClear: () => {
|
|
1136
|
+
dispatch({
|
|
1137
|
+
type: 'clear'
|
|
1138
|
+
});
|
|
1139
|
+
},
|
|
1140
|
+
handleSubmit,
|
|
1141
|
+
handleOnInput
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
|
|
1145
|
+
const ShippingSimulation_excluded = ["productShippingInfo", "formatter", "inputLabel", "title", "idkPostalCodeLinkProps"];
|
|
1146
|
+
|
|
1147
|
+
function ShippingSimulation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1148
|
+
|
|
1149
|
+
function ShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { ShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1150
|
+
|
|
1151
|
+
function ShippingSimulation_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1152
|
+
|
|
1153
|
+
function ShippingSimulation_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ShippingSimulation_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1154
|
+
|
|
1155
|
+
function ShippingSimulation_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
|
|
1161
|
+
let {
|
|
1162
|
+
productShippingInfo,
|
|
1163
|
+
formatter,
|
|
1164
|
+
inputLabel,
|
|
1165
|
+
title,
|
|
1166
|
+
idkPostalCodeLinkProps
|
|
1167
|
+
} = _ref,
|
|
1168
|
+
otherProps = ShippingSimulation_objectWithoutProperties(_ref, ShippingSimulation_excluded);
|
|
1169
|
+
|
|
1170
|
+
const {
|
|
1171
|
+
ShippingSimulation: ShippingSimulationWrapper
|
|
1172
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
1173
|
+
const {
|
|
1174
|
+
input,
|
|
1175
|
+
shippingSimulation,
|
|
1176
|
+
handleSubmit,
|
|
1177
|
+
handleOnInput,
|
|
1178
|
+
handleOnClear
|
|
1179
|
+
} = useShippingSimulation(productShippingInfo);
|
|
1180
|
+
const {
|
|
1181
|
+
postalCode,
|
|
1182
|
+
displayClearButton,
|
|
1183
|
+
errorMessage
|
|
1184
|
+
} = input;
|
|
1185
|
+
const location = [shippingSimulation?.address?.neighborhood, shippingSimulation?.address?.city].filter(Boolean).join(' / ') ?? '';
|
|
1186
|
+
const options = shippingSimulation?.logisticsInfo?.[0]?.slas ?? [];
|
|
1187
|
+
return /*#__PURE__*/jsx_runtime_.jsx(ShippingSimulationWrapper.Component, ShippingSimulation_objectSpread({
|
|
1188
|
+
formatter: formatter,
|
|
1189
|
+
onInput: handleOnInput,
|
|
1190
|
+
onSubmit: handleSubmit,
|
|
1191
|
+
onClear: handleOnClear,
|
|
1192
|
+
location: location,
|
|
1193
|
+
options: options,
|
|
1194
|
+
address: shippingSimulation?.address,
|
|
1195
|
+
displayClearButton: displayClearButton,
|
|
1196
|
+
errorMessage: errorMessage,
|
|
1197
|
+
postalCode: postalCode,
|
|
1198
|
+
inputLabel: inputLabel,
|
|
1199
|
+
title: title,
|
|
1200
|
+
idkPostalCodeLinkProps: idkPostalCodeLinkProps
|
|
1201
|
+
}, otherProps));
|
|
1202
|
+
}
|
|
1203
|
+
;// CONCATENATED MODULE: ./src/components/product/NotAvailableButton/NotAvailableButton.tsx
|
|
1204
|
+
// TODO: Remove this component when <OutOfStock /> is ready to use
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
function NotAvailableButton({
|
|
1209
|
+
children
|
|
1210
|
+
}) {
|
|
1211
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Button/* default */.Z, {
|
|
1212
|
+
variant: "primary",
|
|
1213
|
+
disabled: true,
|
|
1214
|
+
"data-fs-buy-button": true,
|
|
1215
|
+
children: children
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/* harmony default export */ const NotAvailableButton_NotAvailableButton = (NotAvailableButton);
|
|
1220
|
+
;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/DefaultComponents.ts
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
const ProductDetailsDefaultComponents = {
|
|
1227
|
+
ProductTitle: ProductTitle_ProductTitle,
|
|
1228
|
+
DiscountBadge: DiscountBadge/* default */.Z,
|
|
1229
|
+
BuyButton: BuyButton_BuyButton,
|
|
1230
|
+
Icon: Icon/* default */.Z,
|
|
1231
|
+
ProductPrice: ProductPrice/* default */.Z,
|
|
1232
|
+
QuantitySelector: QuantitySelector/* default */.Z,
|
|
1233
|
+
SkuSelector: SkuSelector_SkuSelector,
|
|
1234
|
+
ShippingSimulation: ShippingSimulation_ShippingSimulation,
|
|
1235
|
+
ImageGallery: ImageGallery_ImageGallery,
|
|
1236
|
+
ImageGalleryViewer: ImageGallery_ImageGalleryViewer,
|
|
1237
|
+
__experimentalImageGalleryImage: Image/* default */.Z,
|
|
1238
|
+
__experimentalImageGallery: ui_ImageGallery_ImageGallery,
|
|
1239
|
+
__experimentalShippingSimulation: ShippingSimulation_ShippingSimulation_ShippingSimulation,
|
|
1240
|
+
__experimentalNotAvailableButton: NotAvailableButton_NotAvailableButton
|
|
1241
|
+
};
|
|
1242
|
+
;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/ProductDetails.tsx
|
|
1243
|
+
function ProductDetails_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1244
|
+
|
|
1245
|
+
function ProductDetails_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetails_ownKeys(Object(source), !0).forEach(function (key) { ProductDetails_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetails_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1246
|
+
|
|
1247
|
+
function ProductDetails_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
function ProductDetails({
|
|
1265
|
+
productTitle: {
|
|
1266
|
+
refNumber: showRefNumber,
|
|
1267
|
+
discountBadge: {
|
|
1268
|
+
showDiscountBadge,
|
|
1269
|
+
size: discountBadgeSize
|
|
1270
|
+
}
|
|
1271
|
+
},
|
|
1272
|
+
buyButton: {
|
|
1273
|
+
icon: buyButtonIcon,
|
|
1274
|
+
title: buyButtonTitle
|
|
1275
|
+
},
|
|
1276
|
+
shippingSimulator: {
|
|
1277
|
+
title: shippingSimulatorTitle,
|
|
1278
|
+
inputLabel: shippingSimulatorInputLabel,
|
|
1279
|
+
shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle,
|
|
1280
|
+
link: {
|
|
1281
|
+
to: shippingSimulatorLinkUrl,
|
|
1282
|
+
text: shippingSimulatorLinkText
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
productDescription: {
|
|
1286
|
+
title: productDescriptionDetailsTitle,
|
|
1287
|
+
initiallyExpanded: productDescriptionInitiallyExpanded,
|
|
1288
|
+
displayDescription: shouldDisplayProductDescription
|
|
1289
|
+
},
|
|
1290
|
+
notAvailableButton: {
|
|
1291
|
+
title: notAvailableButtonTitle
|
|
1292
|
+
}
|
|
1293
|
+
}) {
|
|
1294
|
+
const {
|
|
1295
|
+
DiscountBadge,
|
|
1296
|
+
ProductTitle,
|
|
1297
|
+
__experimentalImageGallery: ImageGallery,
|
|
1298
|
+
__experimentalShippingSimulation: ShippingSimulation,
|
|
1299
|
+
__experimentalNotAvailableButton: NotAvailableButton
|
|
1300
|
+
} = (0,OverrideContext/* useOverrideComponents */.r3)();
|
|
1301
|
+
const {
|
|
1302
|
+
currency
|
|
1303
|
+
} = (0,session/* useSession */.kP)();
|
|
1304
|
+
const {
|
|
1305
|
+
0: quantity,
|
|
1306
|
+
1: setQuantity
|
|
1307
|
+
} = (0,external_react_.useState)(1);
|
|
1308
|
+
const context = (0,PageProvider/* usePDP */.al)();
|
|
1309
|
+
const {
|
|
1310
|
+
product,
|
|
1311
|
+
isValidating
|
|
1312
|
+
} = context?.data;
|
|
1313
|
+
|
|
1314
|
+
if (!product) {
|
|
1315
|
+
throw new Error('NotFound');
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
const {
|
|
1319
|
+
id,
|
|
1320
|
+
sku,
|
|
1321
|
+
gtin,
|
|
1322
|
+
name: variantName,
|
|
1323
|
+
brand,
|
|
1324
|
+
isVariantOf,
|
|
1325
|
+
description,
|
|
1326
|
+
isVariantOf: {
|
|
1327
|
+
name,
|
|
1328
|
+
productGroupID: productId
|
|
1329
|
+
},
|
|
1330
|
+
image: productImages,
|
|
1331
|
+
offers: {
|
|
1332
|
+
offers: [{
|
|
1333
|
+
availability,
|
|
1334
|
+
price,
|
|
1335
|
+
listPrice,
|
|
1336
|
+
seller
|
|
1337
|
+
}],
|
|
1338
|
+
lowPrice
|
|
1339
|
+
}
|
|
1340
|
+
} = product;
|
|
1341
|
+
(0,external_react_.useEffect)(() => {
|
|
1342
|
+
(0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
|
|
1343
|
+
name: 'view_item',
|
|
1344
|
+
params: {
|
|
1345
|
+
currency: currency.code,
|
|
1346
|
+
value: price,
|
|
1347
|
+
items: [{
|
|
1348
|
+
item_id: isVariantOf.productGroupID,
|
|
1349
|
+
item_name: isVariantOf.name,
|
|
1350
|
+
item_brand: brand.name,
|
|
1351
|
+
item_variant: sku,
|
|
1352
|
+
price,
|
|
1353
|
+
discount: listPrice - price,
|
|
1354
|
+
currency: currency.code,
|
|
1355
|
+
item_variant_name: variantName,
|
|
1356
|
+
product_reference_id: gtin
|
|
1357
|
+
}]
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
}, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
|
|
1361
|
+
const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
|
|
1362
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Section/* default */.Z, {
|
|
1363
|
+
className: `${(section_module_default()).section} section-product-details`,
|
|
1364
|
+
children: /*#__PURE__*/jsx_runtime_.jsx("section", {
|
|
1365
|
+
"data-fs-product-details": true,
|
|
1366
|
+
children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
|
|
1367
|
+
"data-fs-product-details-body": true,
|
|
1368
|
+
"data-fs-content": "product-details",
|
|
1369
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("header", {
|
|
1370
|
+
"data-fs-product-details-title": true,
|
|
1371
|
+
"data-fs-product-details-section": true,
|
|
1372
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ProductTitle.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
|
|
1373
|
+
// TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
|
|
1374
|
+
// Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
|
|
1375
|
+
// Maybe now it's worth to make title always a h1 and receive only the name, as it would be easier for users to override.
|
|
1376
|
+
title: /*#__PURE__*/jsx_runtime_.jsx("h1", {
|
|
1377
|
+
children: name
|
|
1378
|
+
})
|
|
1379
|
+
}, ProductTitle.props), {}, {
|
|
1380
|
+
label: showDiscountBadge && /*#__PURE__*/jsx_runtime_.jsx(DiscountBadge.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({}, DiscountBadge.props), {}, {
|
|
1381
|
+
size: discountBadgeSize ?? DiscountBadge.props.size // Dynamic props shouldn't be overridable
|
|
1382
|
+
// This decision can be reviewed later if needed
|
|
1383
|
+
,
|
|
1384
|
+
listPrice: listPrice,
|
|
1385
|
+
spotPrice: lowPrice
|
|
1386
|
+
})),
|
|
1387
|
+
refNumber: showRefNumber && productId
|
|
1388
|
+
}))
|
|
1389
|
+
}), /*#__PURE__*/jsx_runtime_.jsx(ImageGallery.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
|
|
1390
|
+
"data-fs-product-details-gallery": true
|
|
1391
|
+
}, ImageGallery.props), {}, {
|
|
1392
|
+
images: productImages
|
|
1393
|
+
})), /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
|
|
1394
|
+
"data-fs-product-details-info": true,
|
|
1395
|
+
children: [/*#__PURE__*/jsx_runtime_.jsx("section", {
|
|
1396
|
+
"data-fs-product-details-settings": true,
|
|
1397
|
+
"data-fs-product-details-section": true,
|
|
1398
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ProductDetails_ProductDetailsSettings, {
|
|
1399
|
+
product: product,
|
|
1400
|
+
isValidating: isValidating,
|
|
1401
|
+
buyButtonTitle: buyButtonTitle,
|
|
1402
|
+
quantity: quantity,
|
|
1403
|
+
setQuantity: setQuantity,
|
|
1404
|
+
buyButtonIcon: buyButtonIcon,
|
|
1405
|
+
notAvailableButtonTitle: notAvailableButtonTitle ?? NotAvailableButton.props.title
|
|
1406
|
+
})
|
|
1407
|
+
}), !outOfStock && /*#__PURE__*/jsx_runtime_.jsx(ShippingSimulation.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
|
|
1408
|
+
"data-fs-product-details-section": true,
|
|
1409
|
+
"data-fs-product-details-shipping": true,
|
|
1410
|
+
formatter: useFormattedPrice/* useFormattedPrice */.P
|
|
1411
|
+
}, ShippingSimulation.props), {}, {
|
|
1412
|
+
idkPostalCodeLinkProps: ProductDetails_objectSpread(ProductDetails_objectSpread({}, ShippingSimulation.props.idkPostalCodeLinkProps), {}, {
|
|
1413
|
+
href: shippingSimulatorLinkUrl ?? ShippingSimulation.props.idkPostalCodeLinkProps?.href,
|
|
1414
|
+
children: shippingSimulatorLinkText ?? ShippingSimulation.props.idkPostalCodeLinkProps?.children
|
|
1415
|
+
}),
|
|
1416
|
+
productShippingInfo: {
|
|
1417
|
+
id,
|
|
1418
|
+
quantity,
|
|
1419
|
+
seller: seller.identifier
|
|
1420
|
+
},
|
|
1421
|
+
title: shippingSimulatorTitle ?? ShippingSimulation.props.title,
|
|
1422
|
+
inputLabel: shippingSimulatorInputLabel ?? ShippingSimulation.props.inputLabel,
|
|
1423
|
+
optionsLabel: shippingSimulatorOptionsTableTitle ?? ShippingSimulation.props.optionsLabel
|
|
1424
|
+
}))]
|
|
1425
|
+
}), shouldDisplayProductDescription && /*#__PURE__*/jsx_runtime_.jsx(ProductDescription_ProductDescription, {
|
|
1426
|
+
initiallyExpanded: productDescriptionInitiallyExpanded,
|
|
1427
|
+
descriptionData: [{
|
|
1428
|
+
title: productDescriptionDetailsTitle,
|
|
1429
|
+
content: description
|
|
1430
|
+
}]
|
|
1431
|
+
})]
|
|
1432
|
+
})
|
|
1433
|
+
})
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
const fragment = "unknown";
|
|
1438
|
+
const OverridableProductDetails = (0,getOverriddenSection/* getOverridableSection */.B)('ProductDetails', ProductDetails, ProductDetailsDefaultComponents);
|
|
1439
|
+
/* harmony default export */ const ProductDetails_ProductDetails = (OverridableProductDetails);
|
|
1440
|
+
;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/OverriddenDefaultProductDetails.ts
|
|
1441
|
+
function OverriddenDefaultProductDetails_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1442
|
+
|
|
1443
|
+
function OverriddenDefaultProductDetails_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? OverriddenDefaultProductDetails_ownKeys(Object(source), !0).forEach(function (key) { OverriddenDefaultProductDetails_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : OverriddenDefaultProductDetails_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1444
|
+
|
|
1445
|
+
function OverriddenDefaultProductDetails_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* This component exists to support overrides 1.0
|
|
1453
|
+
*
|
|
1454
|
+
* This allows users to override the default ProductDetails section present in the Headless CMS
|
|
1455
|
+
*/
|
|
1456
|
+
const OverriddenDefaultProductDetails = (0,getOverriddenSection/* getOverriddenSection */.v)(OverriddenDefaultProductDetails_objectSpread(OverriddenDefaultProductDetails_objectSpread({}, override), {}, {
|
|
1457
|
+
Section: ProductDetails_ProductDetails
|
|
1458
|
+
}));
|
|
130
1459
|
|
|
131
1460
|
/***/ }),
|
|
132
1461
|
|
|
@@ -148,10 +1477,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
148
1477
|
/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);
|
|
149
1478
|
/* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2224);
|
|
150
1479
|
/* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2951);
|
|
151
|
-
/* harmony import */ var src_components_sections_BannerText_OverriddenDefaultBannerText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
152
|
-
/* harmony import */ var src_components_sections_Breadcrumb_OverriddenDefaultBreadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
1480
|
+
/* harmony import */ var src_components_sections_BannerText_OverriddenDefaultBannerText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7127);
|
|
1481
|
+
/* harmony import */ var src_components_sections_Breadcrumb_OverriddenDefaultBreadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5632);
|
|
153
1482
|
/* harmony import */ var src_components_sections_CrossSellingShelf_OverriddenDefaultCrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4474);
|
|
154
|
-
/* harmony import */ var src_components_sections_ProductDetails_OverriddenDefaultProductDetails__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
1483
|
+
/* harmony import */ var src_components_sections_ProductDetails_OverriddenDefaultProductDetails__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8655);
|
|
155
1484
|
/* harmony import */ var src_customizations_src_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3276);
|
|
156
1485
|
/* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7295);
|
|
157
1486
|
/* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(2541);
|
|
@@ -164,8 +1493,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
164
1493
|
/* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5953);
|
|
165
1494
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
|
|
166
1495
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
167
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_faststore_api__WEBPACK_IMPORTED_MODULE_0__,
|
|
168
|
-
([_faststore_api__WEBPACK_IMPORTED_MODULE_0__,
|
|
1496
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_faststore_api__WEBPACK_IMPORTED_MODULE_0__, src_components_sections_CrossSellingShelf_OverriddenDefaultCrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__, src_server__WEBPACK_IMPORTED_MODULE_15__]);
|
|
1497
|
+
([_faststore_api__WEBPACK_IMPORTED_MODULE_0__, src_components_sections_CrossSellingShelf_OverriddenDefaultCrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__, src_server__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
169
1498
|
const _excluded = ["listPrice"];
|
|
170
1499
|
|
|
171
1500
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -432,6 +1761,17 @@ module.exports = {
|
|
|
432
1761
|
};
|
|
433
1762
|
|
|
434
1763
|
|
|
1764
|
+
/***/ }),
|
|
1765
|
+
|
|
1766
|
+
/***/ 9034:
|
|
1767
|
+
/***/ ((module) => {
|
|
1768
|
+
|
|
1769
|
+
// Exports
|
|
1770
|
+
module.exports = {
|
|
1771
|
+
"section": "section_section__XsOoR"
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
|
|
435
1775
|
/***/ }),
|
|
436
1776
|
|
|
437
1777
|
/***/ 4691:
|
|
@@ -969,7 +2309,7 @@ module.exports = require("crypto");
|
|
|
969
2309
|
var __webpack_require__ = require("../../webpack-runtime.js");
|
|
970
2310
|
__webpack_require__.C(exports);
|
|
971
2311
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
972
|
-
var __webpack_exports__ = __webpack_require__.X(0, [676,825,404,183,177,74,350,
|
|
2312
|
+
var __webpack_exports__ = __webpack_require__.X(0, [676,825,404,183,177,74,719,779,854,117,184,661,632,350,693], () => (__webpack_exec__(5779)));
|
|
973
2313
|
module.exports = __webpack_exports__;
|
|
974
2314
|
|
|
975
2315
|
})();
|