@faststore/core 2.2.0-alpha.6 → 2.2.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +9 -9
  3. package/package.json +2 -2
  4. package/.next/BUILD_ID +0 -1
  5. package/.next/build-manifest.json +0 -128
  6. package/.next/cache/.tsbuildinfo +0 -1
  7. package/.next/cache/config.json +0 -7
  8. package/.next/cache/eslint/.cache_1gneedd +0 -1
  9. package/.next/cache/next-server.js.nft.json +0 -1
  10. package/.next/cache/webpack/client-production/0.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/server-production/0.pack +0 -0
  13. package/.next/cache/webpack/server-production/index.pack +0 -0
  14. package/.next/export-marker.json +0 -1
  15. package/.next/images-manifest.json +0 -1
  16. package/.next/next-server.js.nft.json +0 -1
  17. package/.next/package.json +0 -1
  18. package/.next/prerender-manifest.json +0 -1
  19. package/.next/react-loadable-manifest.json +0 -47
  20. package/.next/required-server-files.json +0 -1
  21. package/.next/routes-manifest.json +0 -1
  22. package/.next/server/chunks/117.js +0 -430
  23. package/.next/server/chunks/177.js +0 -120
  24. package/.next/server/chunks/183.js +0 -95
  25. package/.next/server/chunks/184.js +0 -61
  26. package/.next/server/chunks/289.js +0 -240
  27. package/.next/server/chunks/312.js +0 -677
  28. package/.next/server/chunks/350.js +0 -200
  29. package/.next/server/chunks/37.js +0 -610
  30. package/.next/server/chunks/386.js +0 -200
  31. package/.next/server/chunks/387.js +0 -550
  32. package/.next/server/chunks/52.js +0 -4007
  33. package/.next/server/chunks/53.js +0 -61
  34. package/.next/server/chunks/574.js +0 -145
  35. package/.next/server/chunks/576.js +0 -95
  36. package/.next/server/chunks/585.js +0 -640
  37. package/.next/server/chunks/676.js +0 -32
  38. package/.next/server/chunks/692.js +0 -111
  39. package/.next/server/chunks/693.js +0 -58
  40. package/.next/server/chunks/732.js +0 -1845
  41. package/.next/server/chunks/74.js +0 -3963
  42. package/.next/server/chunks/779.js +0 -58
  43. package/.next/server/chunks/817.js +0 -4007
  44. package/.next/server/chunks/825.js +0 -4039
  45. package/.next/server/chunks/854.js +0 -72
  46. package/.next/server/chunks/859.js +0 -959
  47. package/.next/server/chunks/897.js +0 -1289
  48. package/.next/server/chunks/98.js +0 -163
  49. package/.next/server/chunks/988.js +0 -211
  50. package/.next/server/chunks/font-manifest.json +0 -1
  51. package/.next/server/font-manifest.json +0 -1
  52. package/.next/server/middleware-build-manifest.js +0 -1
  53. package/.next/server/middleware-manifest.json +0 -6
  54. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  55. package/.next/server/pages/404.js +0 -386
  56. package/.next/server/pages/404.js.nft.json +0 -1
  57. package/.next/server/pages/500.js +0 -388
  58. package/.next/server/pages/500.js.nft.json +0 -1
  59. package/.next/server/pages/[...slug].js +0 -1076
  60. package/.next/server/pages/[...slug].js.nft.json +0 -1
  61. package/.next/server/pages/[slug]/p.js +0 -2271
  62. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  63. package/.next/server/pages/_app.js +0 -279
  64. package/.next/server/pages/_app.js.nft.json +0 -1
  65. package/.next/server/pages/_document.js +0 -358
  66. package/.next/server/pages/_document.js.nft.json +0 -1
  67. package/.next/server/pages/_error.js +0 -164
  68. package/.next/server/pages/_error.js.nft.json +0 -1
  69. package/.next/server/pages/account.js +0 -363
  70. package/.next/server/pages/account.js.nft.json +0 -1
  71. package/.next/server/pages/api/graphql.js +0 -450
  72. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  73. package/.next/server/pages/api/health/live.js +0 -31
  74. package/.next/server/pages/api/health/live.js.nft.json +0 -1
  75. package/.next/server/pages/api/health/ready.js +0 -31
  76. package/.next/server/pages/api/health/ready.js.nft.json +0 -1
  77. package/.next/server/pages/api/preview.js +0 -130
  78. package/.next/server/pages/api/preview.js.nft.json +0 -1
  79. package/.next/server/pages/checkout.js +0 -363
  80. package/.next/server/pages/checkout.js.nft.json +0 -1
  81. package/.next/server/pages/en-US/404.html +0 -81
  82. package/.next/server/pages/en-US/404.json +0 -1
  83. package/.next/server/pages/en-US/500.html +0 -81
  84. package/.next/server/pages/en-US/500.json +0 -1
  85. package/.next/server/pages/en-US/account.html +0 -81
  86. package/.next/server/pages/en-US/account.json +0 -1
  87. package/.next/server/pages/en-US/checkout.html +0 -81
  88. package/.next/server/pages/en-US/checkout.json +0 -1
  89. package/.next/server/pages/en-US/login.html +0 -81
  90. package/.next/server/pages/en-US/login.json +0 -1
  91. package/.next/server/pages/en-US/s.html +0 -81
  92. package/.next/server/pages/en-US/s.json +0 -1
  93. package/.next/server/pages/en-US.html +0 -90
  94. package/.next/server/pages/en-US.json +0 -1
  95. package/.next/server/pages/index.js +0 -432
  96. package/.next/server/pages/index.js.nft.json +0 -1
  97. package/.next/server/pages/login.js +0 -368
  98. package/.next/server/pages/login.js.nft.json +0 -1
  99. package/.next/server/pages/s.js +0 -548
  100. package/.next/server/pages/s.js.nft.json +0 -1
  101. package/.next/server/pages-manifest.json +0 -18
  102. package/.next/server/webpack-api-runtime.js +0 -229
  103. package/.next/server/webpack-runtime.js +0 -229
  104. package/.next/static/chunks/251.47f06fb688ea42d1.js +0 -1
  105. package/.next/static/chunks/383-f5039943ae2a4372.js +0 -1
  106. package/.next/static/chunks/386.d01e0db26c523f0f.js +0 -1
  107. package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
  108. package/.next/static/chunks/585.3350efefe61c9461.js +0 -1
  109. package/.next/static/chunks/635-666ee2cad2925bb7.js +0 -1
  110. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  111. package/.next/static/chunks/721-717d8a2486b7d30e.js +0 -1
  112. package/.next/static/chunks/722-686f01490d4d2176.js +0 -1
  113. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  114. package/.next/static/chunks/783-ded9d8cda0d5c8d9.js +0 -1
  115. package/.next/static/chunks/800.851af48fe2ab4a4c.js +0 -1
  116. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
  117. package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
  118. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  119. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  120. package/.next/static/chunks/pages/404-6c674028b2f80cbb.js +0 -1
  121. package/.next/static/chunks/pages/500-ff55de77265a7e43.js +0 -1
  122. package/.next/static/chunks/pages/[...slug]-7f8dc13cc9542463.js +0 -1
  123. package/.next/static/chunks/pages/[slug]/p-1cec94f3f7583058.js +0 -1
  124. package/.next/static/chunks/pages/_app-7db7de3d205714be.js +0 -1
  125. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  126. package/.next/static/chunks/pages/account-b06035cba2c99604.js +0 -1
  127. package/.next/static/chunks/pages/checkout-f0c3e8d691cb8a54.js +0 -1
  128. package/.next/static/chunks/pages/index-a141c747fcc197a1.js +0 -1
  129. package/.next/static/chunks/pages/login-4e0e6cab7a07f1f3.js +0 -1
  130. package/.next/static/chunks/pages/s-823f8e1cabbf63b3.js +0 -1
  131. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  132. package/.next/static/chunks/webpack-bed5a9784a3af4e8.js +0 -1
  133. package/.next/static/css/1b48021b9c503e72.css +0 -1
  134. package/.next/static/css/527e334fa69cf40a.css +0 -1
  135. package/.next/static/css/6a7fdc5a21fbead5.css +0 -1
  136. package/.next/static/css/6e1a7434f061d0ef.css +0 -1
  137. package/.next/static/css/723835bce380750d.css +0 -1
  138. package/.next/static/css/8f93a4630936c20b.css +0 -1
  139. package/.next/static/css/9e76fef1c9ca89af.css +0 -1
  140. package/.next/static/css/a2eefb25a4608343.css +0 -1
  141. package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
  142. package/.next/static/css/df588bb98c0b0ca6.css +0 -1
  143. package/.next/static/css/fd27ecc37832aa54.css +0 -1
  144. package/.next/static/h5IF1CNB8dJwLG9OAuMOX/_buildManifest.js +0 -1
  145. package/.next/static/h5IF1CNB8dJwLG9OAuMOX/_ssgManifest.js +0 -1
  146. package/.next/trace +0 -77
  147. package/public/~partytown/debug/partytown-atomics.js +0 -556
  148. package/public/~partytown/debug/partytown-media.js +0 -374
  149. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  150. package/public/~partytown/debug/partytown-sw.js +0 -59
  151. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  152. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  153. package/public/~partytown/debug/partytown.js +0 -72
  154. package/public/~partytown/partytown-atomics.js +0 -2
  155. package/public/~partytown/partytown-media.js +0 -2
  156. package/public/~partytown/partytown-sw.js +0 -2
  157. package/public/~partytown/partytown.js +0 -2
@@ -1,2271 +0,0 @@
1
- (() => {
2
- var exports = {};
3
- exports.id = 103;
4
- exports.ids = [103];
5
- exports.modules = {
6
-
7
- /***/ 2951:
8
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
9
-
10
- "use strict";
11
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
14
- /* harmony export */ });
15
- /* harmony import */ var src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8824);
16
- /* harmony import */ var src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8170);
17
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3271);
18
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5411);
19
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_2__);
20
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
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__([src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__]);
23
- src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
- function BannerNewsletter({
32
- banner,
33
- newsletter
34
- }) {
35
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Section__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
36
- className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_2___default().section)} section-banner-newsletter`,
37
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
38
- "data-fs-banner-text-newsletter": true,
39
- "data-fs-content": "banner-newsletter",
40
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
41
- title: banner.title,
42
- caption: banner.caption,
43
- link: banner?.link,
44
- variant: banner.variant,
45
- colorVariant: banner.colorVariant
46
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
47
- title: newsletter.title,
48
- description: newsletter.description,
49
- icon: newsletter.icon,
50
- privacyPolicy: newsletter.privacyPolicy,
51
- emailInputLabel: newsletter.emailInputLabel,
52
- displayNameInput: newsletter.displayNameInput,
53
- nameInputLabel: newsletter.nameInputLabel,
54
- subscribeButtonLabel: newsletter.subscribeButtonLabel,
55
- toastSubscribe: newsletter.toastSubscribe,
56
- toastSubscribeError: newsletter.toastSubscribeError,
57
- card: newsletter.card
58
- })]
59
- })
60
- });
61
- }
62
-
63
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerNewsletter);
64
- __webpack_async_result__();
65
- } catch(e) { __webpack_async_result__(e); } });
66
-
67
- /***/ }),
68
-
69
- /***/ 994:
70
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
71
-
72
- "use strict";
73
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
74
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
75
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
76
- /* harmony export */ });
77
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
78
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
79
- /* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7691);
80
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
81
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
82
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5953);
83
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
84
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
85
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3271);
86
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
87
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
88
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__]);
89
- src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- const CrossSellingShelf = ({
99
- items: first,
100
- title,
101
- kind
102
- }) => {
103
- const {
104
- ref,
105
- inView
106
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
107
- const context = (0,src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__/* .usePDP */ .al)();
108
- const productGroupID = context?.data?.product?.isVariantOf?.productGroupID;
109
- const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
110
- key: kind,
111
- value: productGroupID
112
- }], [kind, productGroupID]);
113
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
114
- className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
115
- ref: ref,
116
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
117
- inView: inView,
118
- first: first,
119
- title: title,
120
- selectedFacets: selectedFacets
121
- })
122
- });
123
- };
124
-
125
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
126
- __webpack_async_result__();
127
- } catch(e) { __webpack_async_result__(e); } });
128
-
129
- /***/ }),
130
-
131
- /***/ 3437:
132
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
133
-
134
- "use strict";
135
-
136
- // EXPORTS
137
- __webpack_require__.d(__webpack_exports__, {
138
- "Z": () => (/* binding */ ProductDetails_ProductDetails)
139
- });
140
-
141
- // UNUSED EXPORTS: fragment
142
-
143
- // EXTERNAL MODULE: external "react"
144
- var external_react_ = __webpack_require__(6689);
145
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
146
- // EXTERNAL MODULE: ../sdk/dist/analytics/sendAnalyticsEvent.js
147
- var sendAnalyticsEvent = __webpack_require__(1072);
148
- // EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
149
- var useFormattedPrice = __webpack_require__(5346);
150
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
151
- var session = __webpack_require__(7295);
152
- // EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
153
- var Section = __webpack_require__(3271);
154
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/Accordion.js
155
- var Accordion = __webpack_require__(1516);
156
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionItem.js
157
- var AccordionItem = __webpack_require__(783);
158
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionButton.js
159
- var AccordionButton = __webpack_require__(7734);
160
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionPanel.js
161
- var AccordionPanel = __webpack_require__(5208);
162
- // EXTERNAL MODULE: external "react/jsx-runtime"
163
- var jsx_runtime_ = __webpack_require__(997);
164
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/ProductDescription.tsx
165
-
166
-
167
-
168
-
169
-
170
- function ProductDescription({
171
- descriptionData,
172
- initiallyExpanded = 'first'
173
- }) {
174
- /**
175
- * Maps 'initiallyExpanded' prop values to indices
176
- */
177
- const INITIALLY_EXPANDED_MAP = (0,external_react_.useMemo)(() => ({
178
- none: [],
179
- first: [0],
180
- all: [0, 1, 2, 3]
181
- }), []);
182
- const {
183
- 0: indices,
184
- 1: setIndices
185
- } = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
186
-
187
- const onChange = index => {
188
- setIndices(currentIndices => {
189
- const newIndices = new Set(currentIndices);
190
-
191
- if (currentIndices.has(index)) {
192
- newIndices.delete(index);
193
- } else {
194
- newIndices.add(index);
195
- }
196
-
197
- return newIndices;
198
- });
199
- };
200
-
201
- return /*#__PURE__*/jsx_runtime_.jsx("section", {
202
- "data-fs-product-description": true,
203
- children: /*#__PURE__*/jsx_runtime_.jsx(Accordion/* default */.Z, {
204
- indices: indices,
205
- onChange: onChange,
206
- "aria-label": "Product Details Content",
207
- children: descriptionData.map(({
208
- title,
209
- content
210
- }, index) => /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
211
- as: "article",
212
- index: index,
213
- prefixId: "product-description",
214
- "data-fs-product-details-description": true,
215
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
216
- children: title
217
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
218
- children: /*#__PURE__*/jsx_runtime_.jsx("p", {
219
- className: "text__body",
220
- children: content
221
- })
222
- })]
223
- }, String(index)))
224
- })
225
- });
226
- }
227
-
228
- /* harmony default export */ const ProductDescription_ProductDescription = (ProductDescription);
229
- // EXTERNAL MODULE: ../components/dist/esm/hooks/UIProvider.js
230
- var UIProvider = __webpack_require__(6652);
231
- // EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
232
- var cart = __webpack_require__(6073);
233
- ;// CONCATENATED MODULE: ./src/sdk/cart/useBuyButton.ts
234
-
235
-
236
-
237
-
238
-
239
- const useBuyButton = item => {
240
- const {
241
- openCart
242
- } = (0,UIProvider/* useUI */.l)();
243
- const {
244
- currency: {
245
- code
246
- }
247
- } = (0,session/* useSession */.kP)();
248
- const onClick = (0,external_react_.useCallback)(e => {
249
- e.preventDefault();
250
-
251
- if (!item) {
252
- return;
253
- }
254
-
255
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
256
- name: 'add_to_cart',
257
- params: {
258
- currency: code,
259
- // TODO: In the future, we can explore more robust ways of
260
- // calculating the value (gift items, discounts, etc.).
261
- value: item.price * item.quantity,
262
- items: [{
263
- item_id: item.itemOffered.isVariantOf.productGroupID,
264
- item_name: item.itemOffered.isVariantOf.name,
265
- item_brand: item.itemOffered.brand.name,
266
- item_variant: item.itemOffered.sku,
267
- quantity: item.quantity,
268
- price: item.price,
269
- discount: item.listPrice - item.price,
270
- currency: code,
271
- item_variant_name: item.itemOffered.name,
272
- product_reference_id: item.itemOffered.gtin
273
- }]
274
- }
275
- });
276
- cart/* cartStore.addItem */.i8.addItem(item);
277
- openCart();
278
- }, [code, item, openCart]);
279
- return {
280
- onClick,
281
- 'data-testid': 'buy-button',
282
- 'data-sku': item?.itemOffered.sku,
283
- 'data-seller': item?.seller.identifier
284
- };
285
- };
286
- // EXTERNAL MODULE: ./node_modules/next/link.js
287
- var next_link = __webpack_require__(1664);
288
- var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
289
- // EXTERNAL MODULE: ./src/components/ui/Image/Image.tsx + 1 modules
290
- var Image = __webpack_require__(5731);
291
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Rating/Rating.js
292
- var Rating = __webpack_require__(3024);
293
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/ProductTitle/ProductTitle.js
294
-
295
-
296
- const ProductTitle = (0,external_react_.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
297
- return (external_react_default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
298
- external_react_default().createElement("div", { "data-fs-product-title-header": true },
299
- title,
300
- !!label && label),
301
- (refNumber || ratingValue) && (external_react_default().createElement("div", { "data-fs-product-title-addendum": true },
302
- ratingValue && external_react_default().createElement(Rating/* default */.Z, { value: ratingValue }),
303
- refNumber && (external_react_default().createElement((external_react_default()).Fragment, null,
304
- refTag,
305
- " ",
306
- refNumber))))));
307
- });
308
- /* harmony default export */ const ProductTitle_ProductTitle = (ProductTitle);
309
- //# sourceMappingURL=ProductTitle.js.map
310
- // EXTERNAL MODULE: ../components/dist/esm/molecules/DiscountBadge/DiscountBadge.js + 1 modules
311
- var DiscountBadge = __webpack_require__(2946);
312
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
313
- var Button = __webpack_require__(3339);
314
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/BuyButton/BuyButton.js
315
-
316
-
317
- function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
318
- return (external_react_default().createElement(Button/* default */.Z, { "data-fs-buy-button": true, icon: icon, iconPosition: "left", "data-testid": testId, ...otherProps }, children));
319
- }
320
- /* harmony default export */ const BuyButton_BuyButton = (BuyButton);
321
- //# sourceMappingURL=BuyButton.js.map
322
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
323
- var Icon = __webpack_require__(2614);
324
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Price/Price.js
325
- var Price = __webpack_require__(9767);
326
- // EXTERNAL MODULE: ../components/dist/esm/molecules/QuantitySelector/QuantitySelector.js
327
- var QuantitySelector = __webpack_require__(6693);
328
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Label/Label.js
329
- var Label = __webpack_require__(1953);
330
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Link/Link.js
331
- var Link = __webpack_require__(4272);
332
- // EXTERNAL MODULE: ../components/dist/esm/atoms/SROnly/SROnly.js
333
- var SROnly = __webpack_require__(5450);
334
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useDefineVariant.js
335
-
336
- const getImageName = (src) => {
337
- const sourcePath = new URL(src).pathname;
338
- const imageName = sourcePath.split('/').slice(-1)[0];
339
- return imageName;
340
- };
341
- const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
342
- if (variant)
343
- return variant;
344
- const allOptionsHaveHexColor = options.every((option) => option.hexColor);
345
- if (allOptionsHaveHexColor) {
346
- return 'color';
347
- }
348
- const firstImageName = options[0]?.src && getImageName(options[0].src);
349
- const areSourcesEqualsOrNull = options.every((option) => {
350
- if (!option.src) {
351
- return true;
352
- }
353
- const optionImageName = getImageName(option.src);
354
- return optionImageName === firstImageName;
355
- });
356
- if (!areSourcesEqualsOrNull) {
357
- return 'image';
358
- }
359
- return 'label';
360
- }, [options, variant]);
361
- //# sourceMappingURL=useDefineVariant.js.map
362
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useSkuSlug.js
363
-
364
- function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
365
- const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
366
- if (slugsMapKey in slugsMap) {
367
- return slugsMap[slugsMapKey];
368
- }
369
- const possibleVariants = Object.keys(slugsMap);
370
- const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
371
- return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
372
- }
373
- const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
374
- const getItemHref = (0,external_react_.useCallback)((option) => {
375
- if (getItemHrefProp)
376
- return { getItemHrefProp };
377
- const currentItemHref = `/${getSkuSlug(slugsMap, {
378
- ...activeVariations,
379
- [skuPropertyName]: option.value,
380
- }, skuPropertyName)}/p`;
381
- return currentItemHref;
382
- }, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
383
- return { getItemHref };
384
- };
385
- //# sourceMappingURL=useSkuSlug.js.map
386
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/SkuSelector.js
387
-
388
-
389
-
390
-
391
- // TODO: Change by ImageComponent when it be right
392
- const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
393
- const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
394
- const activeSelectorValue = activeVariations[skuPropertyName];
395
- const options = availableVariations[skuPropertyName];
396
- const variant = useDefineVariant(options, variantProp);
397
- const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
398
- return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
399
- skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
400
- skuPropertyName,
401
- ": ",
402
- external_react_default().createElement("strong", null, activeSelectorValue))),
403
- external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
404
- 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] },
405
- external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
406
- external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
407
- variant === 'label' && external_react_default().createElement("span", null, option.value),
408
- variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
409
- external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
410
- variant === 'color' && (external_react_default().createElement("span", null,
411
- external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
412
- '--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
413
- } })))));
414
- }))));
415
- });
416
- /* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
417
- //# sourceMappingURL=SkuSelector.js.map
418
- // EXTERNAL MODULE: ../components/dist/esm/molecules/InputField/InputField.js
419
- var InputField = __webpack_require__(3779);
420
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/Table.js
421
-
422
- const Table = (0,external_react_.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
423
- return (external_react_default().createElement("div", { "data-fs-table": true },
424
- external_react_default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
425
- });
426
- /* harmony default export */ const Table_Table = (Table);
427
- //# sourceMappingURL=Table.js.map
428
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableBody.js
429
-
430
- const TableBody = (0,external_react_.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
431
- return (external_react_default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
432
- });
433
- /* harmony default export */ const Table_TableBody = (TableBody);
434
- //# sourceMappingURL=TableBody.js.map
435
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableRow.js
436
-
437
- const TableRow = (0,external_react_.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
438
- return (external_react_default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
439
- });
440
- /* harmony default export */ const Table_TableRow = (TableRow);
441
- //# sourceMappingURL=TableRow.js.map
442
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableCell.js
443
-
444
- const TableCell = (0,external_react_.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
445
- const Cell = variant === 'header' ? 'th' : 'td';
446
- 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));
447
- });
448
- /* harmony default export */ const Table_TableCell = (TableCell);
449
- //# sourceMappingURL=TableCell.js.map
450
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ShippingSimulation/ShippingSimulation.js
451
-
452
-
453
- 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 }) {
454
- const hasShippingOptions = !!options && options.length > 0;
455
- return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
456
- external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
457
- 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 }),
458
- 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,
459
- "I don't know my Postal Code",
460
- external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
461
- hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
462
- external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
463
- external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
464
- external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
465
- external_react_default().createElement(Table_Table, null,
466
- external_react_default().createElement(Table_TableBody, null, options.map((option) => (external_react_default().createElement(Table_TableRow, { key: option.carrier },
467
- external_react_default().createElement(Table_TableCell, { align: "left" }, option.carrier),
468
- external_react_default().createElement(Table_TableCell, null, option.localizedEstimates),
469
- external_react_default().createElement(Table_TableCell, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
470
- }
471
- /* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
472
- //# sourceMappingURL=ShippingSimulation.js.map
473
- // EXTERNAL MODULE: external "react-intersection-observer"
474
- var external_react_intersection_observer_ = __webpack_require__(9785);
475
- // EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
476
- var IconButton = __webpack_require__(7041);
477
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallerySelector.js
478
-
479
-
480
-
481
- const SCROLL_MARGIN_VALUE = 400;
482
- const moveScroll = (container, value) => {
483
- if (container) {
484
- if (container.scrollHeight > container.clientHeight) {
485
- // TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
486
- container.style.overflow = 'auto';
487
- window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
488
- setTimeout(() => (container.style.overflow = 'hidden'), 2000);
489
- }
490
- else {
491
- container.scrollLeft += value;
492
- }
493
- }
494
- };
495
- const hasScroll = (container) => {
496
- if (container) {
497
- return (container.scrollHeight > container.clientHeight ||
498
- container.scrollWidth > container.clientWidth);
499
- }
500
- return false;
501
- };
502
- 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', }) {
503
- const elementsRef = (0,external_react_.useRef)(null);
504
- const elementHasScroll = hasScroll(elementsRef.current);
505
- const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
506
- const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
507
- const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
508
- idx === 0 && setFirstImageInView(inView);
509
- idx === images.length - 1 && setLastImageInView(inView);
510
- }, [images.length]);
511
- return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel },
512
- elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
513
- 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) }))),
514
- external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
515
- return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
516
- 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' },
517
- external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
518
- })),
519
- elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
520
- 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) })))));
521
- }
522
- /* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
523
- //# sourceMappingURL=ImageGallerySelector.js.map
524
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallery.js
525
-
526
-
527
- const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, imagePosition = 'center', setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
528
- const hasSelector = images.length > 1;
529
- return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-fs-image-gallery-position": imagePosition, "data-testid": testId, ...otherProps },
530
- children,
531
- hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
532
- });
533
- /* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
534
- //# sourceMappingURL=ImageGallery.js.map
535
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGalleryViewer.js
536
-
537
- const ImageGalleryViewer = ({ children, }) => {
538
- return external_react_default().createElement((external_react_default()).Fragment, null, children);
539
- };
540
- /* harmony default export */ const ImageGallery_ImageGalleryViewer = (ImageGalleryViewer);
541
- //# sourceMappingURL=ImageGalleryViewer.js.map
542
- // EXTERNAL MODULE: external "next/router"
543
- var router_ = __webpack_require__(1853);
544
- ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
545
- const _excluded = ["images", "imagePosition"];
546
-
547
- 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; }
548
-
549
- 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; }
550
-
551
- 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; }
552
-
553
- 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; }
554
-
555
- 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; }
556
-
557
-
558
-
559
-
560
-
561
-
562
- const ImageComponent = ({
563
- url,
564
- alternateName
565
- }) => {
566
- return /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, {
567
- src: url,
568
- alt: alternateName,
569
- width: 68,
570
- height: 68
571
- });
572
- };
573
-
574
- const ImageGallery_ImageGallery_ImageGallery = _ref => {
575
- let {
576
- images,
577
- imagePosition
578
- } = _ref,
579
- otherProps = _objectWithoutProperties(_ref, _excluded);
580
-
581
- const {
582
- 0: selectedImageIdx,
583
- 1: setSelectedImageIdx
584
- } = (0,external_react_.useState)(0);
585
- const currentImage = images[selectedImageIdx] ?? images[0];
586
- const dynamicRoute = (0,router_.useRouter)().asPath;
587
- (0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
588
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGallery.Component, _objectSpread(_objectSpread(_objectSpread({}, Overrides_ImageGallery.props), {}, {
589
- images: images,
590
- ImageComponent: ImageComponent,
591
- selectedImageIdx: selectedImageIdx,
592
- setSelectedImageIdx: setSelectedImageIdx,
593
- imagePosition: imagePosition ?? Overrides_ImageGallery.props.imagePosition
594
- }, otherProps), {}, {
595
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGalleryViewer.Component, _objectSpread(_objectSpread({}, Overrides_ImageGalleryViewer.props), {}, {
596
- children: /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, _objectSpread(_objectSpread({
597
- sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
598
- width: 691,
599
- height: 691 * (3 / 4),
600
- loading: "eager"
601
- }, __experimentalImageGalleryImage.props), {}, {
602
- src: currentImage.url,
603
- alt: currentImage.alternateName
604
- }))
605
- }))
606
- }));
607
- };
608
-
609
- /* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
610
- // EXTERNAL MODULE: ./src/sdk/graphql/request.ts
611
- var request = __webpack_require__(180);
612
- ;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
613
-
614
- const query = "ShippingSimulationQuery";
615
- const getShippingSimulation = async ({
616
- items,
617
- postalCode,
618
- country
619
- }) => {
620
- const data = await (0,request/* request */.W)(query, {
621
- items,
622
- postalCode,
623
- country
624
- });
625
- return data.shipping;
626
- };
627
- /* harmony default export */ const shipping = ((/* unused pure expression or super */ null && (getShippingSimulation)));
628
- ;// CONCATENATED MODULE: ./src/sdk/shipping/useShippingSimulation.ts
629
- 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; }
630
-
631
- 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; }
632
-
633
- 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; }
634
-
635
-
636
-
637
- const createEmptySimulation = () => ({
638
- input: {
639
- postalCode: '',
640
- displayClearButton: false,
641
- errorMessage: ''
642
- },
643
- shippingSimulation: {
644
- location: '',
645
- options: []
646
- }
647
- });
648
-
649
- const reducer = (state, action) => {
650
- const {
651
- type
652
- } = action;
653
-
654
- switch (type) {
655
- case 'clear':
656
- {
657
- return createEmptySimulation();
658
- }
659
-
660
- case 'update':
661
- {
662
- const {
663
- payload
664
- } = action;
665
- return {
666
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload.input),
667
- shippingSimulation: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
668
- };
669
- }
670
-
671
- case 'onInput':
672
- {
673
- const {
674
- payload
675
- } = action;
676
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
677
- input: useShippingSimulation_objectSpread({}, payload)
678
- });
679
- }
680
-
681
- case 'onError':
682
- {
683
- const {
684
- payload
685
- } = action;
686
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
687
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload)
688
- });
689
- }
690
-
691
- default:
692
- throw new Error(`Action ${type} not implemented`);
693
- }
694
- };
695
-
696
- const useShippingSimulation = (shippingItem, fetchShippingSimulationFn, sessionPostalCode, country) => {
697
- const {
698
- 0: {
699
- input,
700
- shippingSimulation
701
- },
702
- 1: dispatch
703
- } = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
704
- const {
705
- postalCode: shippingPostalCode
706
- } = input;
707
- (0,external_react_.useEffect)(() => {
708
- if (!sessionPostalCode || shippingPostalCode) {
709
- return;
710
- } // Use sessionPostalCode if there is no shippingPostalCode
711
-
712
-
713
- async function fetchShipping() {
714
- const [location, options] = await fetchShippingSimulationFn(shippingItem, country, sessionPostalCode ?? '');
715
- dispatch({
716
- type: 'update',
717
- payload: {
718
- input: {
719
- postalCode: sessionPostalCode ?? '',
720
- displayClearButton: true,
721
- errorMessage: ''
722
- },
723
- shippingSimulation: {
724
- location,
725
- options
726
- }
727
- }
728
- });
729
- }
730
-
731
- fetchShipping();
732
- }, [country, fetchShippingSimulationFn, sessionPostalCode, shippingItem, shippingPostalCode]);
733
- const handleSubmit = (0,external_react_.useCallback)(async () => {
734
- try {
735
- const [location, options] = await fetchShippingSimulationFn(shippingItem, country, shippingPostalCode ?? '');
736
- dispatch({
737
- type: 'update',
738
- payload: {
739
- input: {
740
- displayClearButton: true,
741
- errorMessage: ''
742
- },
743
- shippingSimulation: {
744
- location,
745
- options
746
- }
747
- }
748
- });
749
- } catch (error) {
750
- dispatch({
751
- type: 'onError',
752
- payload: {
753
- displayClearButton: true,
754
- errorMessage: 'You entered an invalid Postal Code'
755
- }
756
- });
757
- }
758
- }, [country, fetchShippingSimulationFn, shippingItem, shippingPostalCode]);
759
- const handleOnInput = (0,external_react_.useCallback)(e => {
760
- const currentValue = e.currentTarget.value;
761
-
762
- if (currentValue) {
763
- dispatch({
764
- type: 'onInput',
765
- payload: {
766
- postalCode: currentValue,
767
- displayClearButton: false,
768
- errorMessage: ''
769
- }
770
- });
771
- } else {
772
- dispatch({
773
- type: 'clear'
774
- });
775
- }
776
- }, []);
777
- return {
778
- input,
779
- shippingSimulation,
780
- handleOnClear: () => {
781
- dispatch({
782
- type: 'clear'
783
- });
784
- },
785
- handleSubmit,
786
- handleOnInput
787
- };
788
- };
789
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
790
- const ShippingSimulation_excluded = ["productShippingInfo", "formatter", "inputLabel", "title", "idkPostalCodeLinkProps"];
791
-
792
- 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; }
793
-
794
- 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; }
795
-
796
- 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; }
797
-
798
- 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; }
799
-
800
- 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; }
801
-
802
-
803
-
804
-
805
-
806
-
807
-
808
- const fetchShippingSimulation = async (shippingItem, country, postalCode) => {
809
- const shipping = await getShippingSimulation({
810
- country,
811
- postalCode: postalCode,
812
- items: [shippingItem]
813
- });
814
- const location = [shipping?.address?.neighborhood, shipping?.address?.city].filter(Boolean).join(' / ') ?? '';
815
- const options = shipping?.logisticsInfo?.[0]?.slas ?? [];
816
- return [location, options];
817
- };
818
-
819
- function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
820
- let {
821
- productShippingInfo,
822
- formatter,
823
- inputLabel,
824
- title,
825
- idkPostalCodeLinkProps
826
- } = _ref,
827
- otherProps = ShippingSimulation_objectWithoutProperties(_ref, ShippingSimulation_excluded);
828
-
829
- const {
830
- country,
831
- postalCode: sessionPostalCode
832
- } = (0,session/* useSession */.kP)();
833
- const {
834
- input,
835
- shippingSimulation,
836
- handleSubmit,
837
- handleOnInput,
838
- handleOnClear
839
- } = useShippingSimulation(productShippingInfo, fetchShippingSimulation, sessionPostalCode, country);
840
- const {
841
- postalCode,
842
- displayClearButton,
843
- errorMessage
844
- } = input;
845
- const {
846
- location,
847
- options
848
- } = shippingSimulation;
849
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ShippingSimulation.Component, ShippingSimulation_objectSpread({
850
- formatter: formatter,
851
- onInput: handleOnInput,
852
- onSubmit: handleSubmit,
853
- onClear: handleOnClear,
854
- location: location,
855
- options: options,
856
- displayClearButton: displayClearButton,
857
- errorMessage: errorMessage,
858
- postalCode: postalCode,
859
- inputLabel: inputLabel,
860
- title: title,
861
- idkPostalCodeLinkProps: idkPostalCodeLinkProps
862
- }, otherProps));
863
- }
864
- ;// CONCATENATED MODULE: ./src/components/product/NotAvailableButton/NotAvailableButton.tsx
865
- // TODO: Remove this component when <OutOfStock /> is ready to use
866
-
867
-
868
-
869
- function NotAvailableButton({
870
- children
871
- }) {
872
- return /*#__PURE__*/jsx_runtime_.jsx(Button/* default */.Z, {
873
- variant: "primary",
874
- disabled: true,
875
- "data-fs-buy-button": true,
876
- children: children
877
- });
878
- }
879
-
880
- /* harmony default export */ const NotAvailableButton_NotAvailableButton = (NotAvailableButton);
881
- // EXTERNAL MODULE: ./src/utils/overrides.ts
882
- var overrides = __webpack_require__(9104);
883
- ;// CONCATENATED MODULE: ./src/customizations/components/overrides/ProductDetails.tsx
884
- // This is an example of how it can be used on the starter.
885
- const SECTION = 'ProductDetails';
886
- const override = {
887
- section: SECTION
888
- };
889
-
890
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/Overrides.tsx
891
-
892
-
893
-
894
-
895
-
896
-
897
-
898
- const {
899
- ProductTitle: Overrides_ProductTitle,
900
- DiscountBadge: Overrides_DiscountBadge,
901
- BuyButton: Overrides_BuyButton,
902
- Icon: Overrides_Icon,
903
- Price: Overrides_Price,
904
- QuantitySelector: Overrides_QuantitySelector,
905
- SkuSelector: Overrides_SkuSelector,
906
- ShippingSimulation: Overrides_ShippingSimulation,
907
- ImageGallery: Overrides_ImageGallery,
908
- ImageGalleryViewer: Overrides_ImageGalleryViewer,
909
- __experimentalImageGalleryImage,
910
- __experimentalImageGallery,
911
- __experimentalShippingSimulation,
912
- __experimentalNotAvailableButton
913
- } = (0,overrides/* getSectionOverrides */.f)({
914
- ProductTitle: ProductTitle_ProductTitle,
915
- DiscountBadge: DiscountBadge/* default */.Z,
916
- BuyButton: BuyButton_BuyButton,
917
- Icon: Icon/* default */.Z,
918
- Price: Price/* default */.Z,
919
- QuantitySelector: QuantitySelector/* default */.Z,
920
- SkuSelector: SkuSelector_SkuSelector,
921
- ShippingSimulation: ShippingSimulation_ShippingSimulation,
922
- ImageGallery: ImageGallery_ImageGallery,
923
- ImageGalleryViewer: ImageGallery_ImageGalleryViewer,
924
- __experimentalImageGalleryImage: Image/* default */.Z,
925
- __experimentalImageGallery: ui_ImageGallery_ImageGallery,
926
- __experimentalShippingSimulation: ShippingSimulation_ShippingSimulation_ShippingSimulation,
927
- __experimentalNotAvailableButton: NotAvailableButton_NotAvailableButton
928
- }, override);
929
-
930
- ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
931
- const Selectors_excluded = ["src", "alt"],
932
- _excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
933
-
934
- function Selectors_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; }
935
-
936
- function Selectors_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Selectors_ownKeys(Object(source), !0).forEach(function (key) { Selectors_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Selectors_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
937
-
938
- function Selectors_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; }
939
-
940
- function Selectors_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Selectors_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; }
941
-
942
- function Selectors_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; }
943
-
944
-
945
-
946
-
947
-
948
-
949
-
950
- const Selectors_ImageComponent = _ref => {
951
- let {
952
- src,
953
- alt
954
- } = _ref,
955
- otherProps = Selectors_objectWithoutProperties(_ref, Selectors_excluded);
956
-
957
- return /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, Selectors_objectSpread({
958
- src: src,
959
- alt: alt,
960
- width: 34,
961
- height: 34
962
- }, otherProps));
963
- };
964
-
965
- function Selectors(_ref2) {
966
- let {
967
- slugsMap,
968
- activeVariations,
969
- availableVariations
970
- } = _ref2,
971
- otherProps = Selectors_objectWithoutProperties(_ref2, _excluded2);
972
-
973
- return /*#__PURE__*/jsx_runtime_.jsx("section", Selectors_objectSpread(Selectors_objectSpread({}, otherProps), {}, {
974
- children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/(0,external_react_.createElement)(Overrides_SkuSelector.Component, Selectors_objectSpread(Selectors_objectSpread({
975
- ImageComponent: Selectors_ImageComponent
976
- }, Overrides_SkuSelector.props), {}, {
977
- key: skuVariant,
978
- skuPropertyName: skuVariant,
979
- availableVariations: availableVariations,
980
- activeVariations: activeVariations,
981
- slugsMap: slugsMap,
982
- linkProps: Selectors_objectSpread(Selectors_objectSpread({}, Overrides_SkuSelector.props.linkProps ?? {}), {}, {
983
- as: Overrides_SkuSelector.props.linkProps?.as ?? (link_default()),
984
- legacyBehavior: Overrides_SkuSelector.props.linkProps?.legacyBehavior ?? false
985
- })
986
- })))
987
- }));
988
- }
989
-
990
- /* harmony default export */ const SkuSelector_Selectors = (Selectors);
991
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
992
-
993
-
994
- function AddToCartLoadingSkeleton() {
995
- return (
996
- /*#__PURE__*/
997
- // Generated via https://skeletonreact.com/.
998
- (0,jsx_runtime_.jsxs)("svg", {
999
- role: "img",
1000
- width: "100%",
1001
- height: "48",
1002
- "aria-labelledby": "loading-aria",
1003
- viewBox: "0 0 112 48",
1004
- preserveAspectRatio: "none",
1005
- children: [/*#__PURE__*/jsx_runtime_.jsx("title", {
1006
- id: "loading-aria",
1007
- children: "Loading..."
1008
- }), /*#__PURE__*/jsx_runtime_.jsx("rect", {
1009
- x: "0",
1010
- y: "0",
1011
- width: "100%",
1012
- height: "100%",
1013
- clipPath: "url(#clip-path)",
1014
- style: {
1015
- fill: 'url("#fill")'
1016
- }
1017
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
1018
- children: [/*#__PURE__*/jsx_runtime_.jsx("clipPath", {
1019
- id: "clip-path",
1020
- children: /*#__PURE__*/jsx_runtime_.jsx("rect", {
1021
- x: "0",
1022
- y: "0",
1023
- rx: "2",
1024
- ry: "2",
1025
- width: "112",
1026
- height: "48"
1027
- })
1028
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
1029
- id: "fill",
1030
- children: [/*#__PURE__*/jsx_runtime_.jsx("stop", {
1031
- offset: "0.599964",
1032
- stopColor: "#f3f3f3",
1033
- stopOpacity: "1",
1034
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1035
- attributeName: "offset",
1036
- values: "-2; -2; 1",
1037
- keyTimes: "0; 0.25; 1",
1038
- dur: "2s",
1039
- repeatCount: "indefinite"
1040
- })
1041
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1042
- offset: "1.59996",
1043
- stopColor: "#ecebeb",
1044
- stopOpacity: "1",
1045
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1046
- attributeName: "offset",
1047
- values: "-1; -1; 2",
1048
- keyTimes: "0; 0.25; 1",
1049
- dur: "2s",
1050
- repeatCount: "indefinite"
1051
- })
1052
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1053
- offset: "2.59996",
1054
- stopColor: "#f3f3f3",
1055
- stopOpacity: "1",
1056
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1057
- attributeName: "offset",
1058
- values: "0; 0; 3",
1059
- keyTimes: "0; 0.25; 1",
1060
- dur: "2s",
1061
- repeatCount: "indefinite"
1062
- })
1063
- })]
1064
- })]
1065
- })]
1066
- })
1067
- );
1068
- }
1069
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/ProductDetailsSettings.tsx
1070
- 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; }
1071
-
1072
- 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; }
1073
-
1074
- 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; }
1075
-
1076
-
1077
-
1078
-
1079
-
1080
-
1081
-
1082
-
1083
-
1084
-
1085
-
1086
- function ProductDetailsSettings({
1087
- product,
1088
- buyButtonTitle,
1089
- isValidating,
1090
- quantity,
1091
- setQuantity,
1092
- buyButtonIcon: {
1093
- icon: buyButtonIconName = Overrides_Icon.props.name,
1094
- alt: buyButtonIconAlt = Overrides_Icon.props["aria-label"]
1095
- },
1096
- notAvailableButtonTitle
1097
- }) {
1098
- const {
1099
- id,
1100
- sku,
1101
- gtin,
1102
- name: variantName,
1103
- brand,
1104
- isVariantOf,
1105
- isVariantOf: {
1106
- skuVariants
1107
- },
1108
- image: productImages,
1109
- additionalProperty,
1110
- offers: {
1111
- lowPrice,
1112
- offers: [{
1113
- availability,
1114
- price,
1115
- listPrice,
1116
- seller
1117
- }]
1118
- }
1119
- } = product;
1120
- const buyProps = useBuyButton({
1121
- id,
1122
- price,
1123
- listPrice,
1124
- seller,
1125
- quantity,
1126
- itemOffered: {
1127
- sku,
1128
- name: variantName,
1129
- gtin,
1130
- image: productImages,
1131
- brand,
1132
- isVariantOf,
1133
- additionalProperty
1134
- }
1135
- });
1136
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1137
- const shouldShowDiscountedPrice = (0,external_react_.useMemo)(() => lowPrice !== listPrice, [lowPrice, listPrice]);
1138
-
1139
- const AddToCartButton = () => {
1140
- return outOfStock ?
1141
- /*#__PURE__*/
1142
- // TODO: Adds <OutOfStock /> when component is ready to use
1143
- jsx_runtime_.jsx(__experimentalNotAvailableButton.Component, {
1144
- children: notAvailableButtonTitle
1145
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_BuyButton.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_BuyButton.props), {}, {
1146
- icon: /*#__PURE__*/jsx_runtime_.jsx(Overrides_Icon.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_Icon.props), {}, {
1147
- name: buyButtonIconName,
1148
- "aria-label": buyButtonIconAlt
1149
- }))
1150
- }, buyProps), {}, {
1151
- children: buyButtonTitle || 'Add to Cart'
1152
- }));
1153
- };
1154
-
1155
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1156
- children: [!outOfStock && /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1157
- "data-fs-product-details-values": true,
1158
- children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
1159
- "data-fs-product-details-prices": true,
1160
- children: shouldShowDiscountedPrice ? /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1161
- children: [/*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1162
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1163
- testId: "list-price",
1164
- variant: "listing",
1165
- SRText: "Original price:"
1166
- }, Overrides_Price.props), {}, {
1167
- // Dynamic props shouldn't be overridable
1168
- // This decision can be reviewed later if needed
1169
- value: listPrice,
1170
- "data-value": listPrice
1171
- })), /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1172
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1173
- testId: "price",
1174
- variant: "spot",
1175
- className: "text__lead",
1176
- SRText: "Sale Price:"
1177
- }, Overrides_Price.props), {}, {
1178
- // Dynamic props shouldn't be overridable
1179
- // This decision can be reviewed later if needed
1180
- value: lowPrice,
1181
- "data-value": lowPrice
1182
- }))]
1183
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1184
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1185
- testId: "list-price",
1186
- variant: "spot",
1187
- className: "text__lead",
1188
- SRText: "Original price:"
1189
- }, Overrides_Price.props), {}, {
1190
- // Dynamic props shouldn't be overridable
1191
- // This decision can be reviewed later if needed
1192
- value: lowPrice,
1193
- "data-value": lowPrice
1194
- }))
1195
- }), /*#__PURE__*/jsx_runtime_.jsx(Overrides_QuantitySelector.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1196
- min: 1,
1197
- max: 10
1198
- }, Overrides_QuantitySelector.props), {}, {
1199
- // Dynamic props shouldn't be overridable
1200
- // This decision can be reviewed later if needed
1201
- onChange: setQuantity
1202
- }))]
1203
- }), skuVariants && /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_Selectors, {
1204
- slugsMap: skuVariants.slugsMap,
1205
- availableVariations: skuVariants.availableVariations,
1206
- activeVariations: skuVariants.activeVariations,
1207
- "data-fs-product-details-selectors": true
1208
- }), isValidating ?
1209
- /*#__PURE__*/
1210
-
1211
- /* NOTE:
1212
- A loading skeleton had to be used to avoid a Lighthouse's
1213
- non-composited animation violation due to the button transitioning its
1214
- background color when changing from its initial disabled to active state.
1215
- See full explanation on commit https://git.io/JyXV5. */
1216
- jsx_runtime_.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/jsx_runtime_.jsx(AddToCartButton, {})]
1217
- });
1218
- }
1219
-
1220
- /* harmony default export */ const ProductDetails_ProductDetailsSettings = (ProductDetailsSettings);
1221
- // EXTERNAL MODULE: ./src/components/sections/ProductDetails/section.module.scss
1222
- var section_module = __webpack_require__(9034);
1223
- var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
1224
- // EXTERNAL MODULE: ./src/sdk/overrides/PageProvider.tsx
1225
- var PageProvider = __webpack_require__(5953);
1226
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/ProductDetails.tsx
1227
- 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; }
1228
-
1229
- 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; }
1230
-
1231
- 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; }
1232
-
1233
-
1234
-
1235
-
1236
-
1237
-
1238
-
1239
-
1240
-
1241
-
1242
-
1243
-
1244
-
1245
-
1246
- function ProductDetails({
1247
- productTitle: {
1248
- refNumber: showRefNumber,
1249
- discountBadge: {
1250
- showDiscountBadge,
1251
- size: discountBadgeSize = Overrides_DiscountBadge.props.size
1252
- }
1253
- },
1254
- buyButton: {
1255
- icon: buyButtonIcon,
1256
- title: buyButtonTitle
1257
- },
1258
- shippingSimulator: {
1259
- title: shippingSimulatorTitle = __experimentalShippingSimulation.props.title,
1260
- inputLabel: shippingSimulatorInputLabel = __experimentalShippingSimulation.props.inputLabel,
1261
- shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle = __experimentalShippingSimulation.props.optionsLabel,
1262
- link: {
1263
- to: shippingSimulatorLinkUrl = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.href,
1264
- text: shippingSimulatorLinkText = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.children
1265
- }
1266
- },
1267
- productDescription: {
1268
- title: productDescriptionDetailsTitle,
1269
- initiallyExpanded: productDescriptionInitiallyExpanded,
1270
- displayDescription: shouldDisplayProductDescription
1271
- },
1272
- imageGallery: {
1273
- imagePosition = __experimentalImageGallery.props.imagePosition
1274
- },
1275
- notAvailableButton: {
1276
- title: notAvailableButtonTitle = __experimentalNotAvailableButton.props.title
1277
- }
1278
- }) {
1279
- const {
1280
- currency
1281
- } = (0,session/* useSession */.kP)();
1282
- const {
1283
- 0: quantity,
1284
- 1: setQuantity
1285
- } = (0,external_react_.useState)(1);
1286
- const context = (0,PageProvider/* usePDP */.al)();
1287
- const {
1288
- product,
1289
- isValidating
1290
- } = context?.data;
1291
-
1292
- if (!product) {
1293
- throw new Error('NotFound');
1294
- }
1295
-
1296
- const {
1297
- id,
1298
- sku,
1299
- gtin,
1300
- name: variantName,
1301
- brand,
1302
- isVariantOf,
1303
- description,
1304
- isVariantOf: {
1305
- name,
1306
- productGroupID: productId
1307
- },
1308
- image: productImages,
1309
- offers: {
1310
- offers: [{
1311
- availability,
1312
- price,
1313
- listPrice,
1314
- seller
1315
- }],
1316
- lowPrice
1317
- }
1318
- } = product;
1319
- (0,external_react_.useEffect)(() => {
1320
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
1321
- name: 'view_item',
1322
- params: {
1323
- currency: currency.code,
1324
- value: price,
1325
- items: [{
1326
- item_id: isVariantOf.productGroupID,
1327
- item_name: isVariantOf.name,
1328
- item_brand: brand.name,
1329
- item_variant: sku,
1330
- price,
1331
- discount: listPrice - price,
1332
- currency: currency.code,
1333
- item_variant_name: variantName,
1334
- product_reference_id: gtin
1335
- }]
1336
- }
1337
- });
1338
- }, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
1339
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1340
- return /*#__PURE__*/jsx_runtime_.jsx(Section/* default */.Z, {
1341
- className: `${(section_module_default()).section} section-product-details`,
1342
- children: /*#__PURE__*/jsx_runtime_.jsx("section", {
1343
- "data-fs-product-details": true,
1344
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1345
- "data-fs-product-details-body": true,
1346
- "data-fs-content": "product-details",
1347
- children: [/*#__PURE__*/jsx_runtime_.jsx("header", {
1348
- "data-fs-product-details-title": true,
1349
- "data-fs-product-details-section": true,
1350
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ProductTitle.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1351
- // TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
1352
- // Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
1353
- // 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.
1354
- title: /*#__PURE__*/jsx_runtime_.jsx("h1", {
1355
- children: name
1356
- })
1357
- }, Overrides_ProductTitle.props), {}, {
1358
- label: showDiscountBadge && /*#__PURE__*/jsx_runtime_.jsx(Overrides_DiscountBadge.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({}, Overrides_DiscountBadge.props), {}, {
1359
- size: discountBadgeSize // Dynamic props shouldn't be overridable
1360
- // This decision can be reviewed later if needed
1361
- ,
1362
- listPrice: listPrice,
1363
- spotPrice: lowPrice
1364
- })),
1365
- refNumber: showRefNumber && productId
1366
- }))
1367
- }), /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGallery.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1368
- "data-fs-product-details-gallery": true
1369
- }, __experimentalImageGallery.props), {}, {
1370
- imagePosition: imagePosition,
1371
- images: productImages
1372
- })), /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1373
- "data-fs-product-details-info": true,
1374
- children: [/*#__PURE__*/jsx_runtime_.jsx("section", {
1375
- "data-fs-product-details-settings": true,
1376
- "data-fs-product-details-section": true,
1377
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductDetails_ProductDetailsSettings, {
1378
- product: product,
1379
- isValidating: isValidating,
1380
- buyButtonTitle: buyButtonTitle,
1381
- quantity: quantity,
1382
- setQuantity: setQuantity,
1383
- buyButtonIcon: buyButtonIcon,
1384
- notAvailableButtonTitle: notAvailableButtonTitle
1385
- })
1386
- }), !outOfStock && /*#__PURE__*/jsx_runtime_.jsx(__experimentalShippingSimulation.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1387
- "data-fs-product-details-section": true,
1388
- "data-fs-product-details-shipping": true,
1389
- formatter: useFormattedPrice/* useFormattedPrice */.P
1390
- }, __experimentalShippingSimulation.props), {}, {
1391
- idkPostalCodeLinkProps: ProductDetails_objectSpread(ProductDetails_objectSpread({}, __experimentalShippingSimulation.props.idkPostalCodeLinkProps), {}, {
1392
- href: shippingSimulatorLinkUrl,
1393
- children: shippingSimulatorLinkText
1394
- }),
1395
- productShippingInfo: {
1396
- id,
1397
- quantity,
1398
- seller: seller.identifier
1399
- },
1400
- title: shippingSimulatorTitle,
1401
- inputLabel: shippingSimulatorInputLabel,
1402
- optionsLabel: shippingSimulatorOptionsTableTitle
1403
- }))]
1404
- }), shouldDisplayProductDescription && /*#__PURE__*/jsx_runtime_.jsx(ProductDescription_ProductDescription, {
1405
- initiallyExpanded: productDescriptionInitiallyExpanded,
1406
- descriptionData: [{
1407
- title: productDescriptionDetailsTitle,
1408
- content: description
1409
- }]
1410
- })]
1411
- })
1412
- })
1413
- });
1414
- }
1415
-
1416
- const fragment = "unknown";
1417
- /* harmony default export */ const ProductDetails_ProductDetails = (ProductDetails);
1418
-
1419
- /***/ }),
1420
-
1421
- /***/ 5779:
1422
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1423
-
1424
- "use strict";
1425
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1426
- __webpack_require__.r(__webpack_exports__);
1427
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1428
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1429
- /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
1430
- /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
1431
- /* harmony export */ });
1432
- /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4826);
1433
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6641);
1434
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_1__);
1435
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6330);
1436
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);
1437
- /* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2224);
1438
- /* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2951);
1439
- /* harmony import */ var src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(387);
1440
- /* harmony import */ var src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(994);
1441
- /* harmony import */ var src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3437);
1442
- /* harmony import */ var src_customizations_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(859);
1443
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7295);
1444
- /* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2541);
1445
- /* harmony import */ var src_server__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9685);
1446
- /* harmony import */ var src_server_cms__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9497);
1447
- /* harmony import */ var src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4074);
1448
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7183);
1449
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_16__);
1450
- /* harmony import */ var src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7853);
1451
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5953);
1452
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
1453
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
1454
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__, src_server__WEBPACK_IMPORTED_MODULE_14__]);
1455
- ([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__, src_server__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1456
- const _excluded = ["listPrice"];
1457
-
1458
- 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; }
1459
-
1460
- 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; }
1461
-
1462
- 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; }
1463
-
1464
- 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; }
1465
-
1466
- 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; }
1467
-
1468
-
1469
-
1470
-
1471
-
1472
-
1473
-
1474
-
1475
-
1476
-
1477
-
1478
-
1479
-
1480
-
1481
-
1482
-
1483
-
1484
-
1485
- /**
1486
- * Sections: Components imported from each store's custom components and '../components/sections' only.
1487
- * Do not import or render components from any other folder in here.
1488
- */
1489
-
1490
-
1491
-
1492
-
1493
- const COMPONENTS = _objectSpread({
1494
- Breadcrumb: src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
1495
- ProductDetails: src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
1496
- CrossSellingShelf: src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
1497
- BannerNewsletter: src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z
1498
- }, src_customizations_components__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z);
1499
-
1500
- // Array merging strategy from deepmerge that makes client arrays overwrite server array
1501
- // https://www.npmjs.com/package/deepmerge
1502
- const overwriteMerge = (_, sourceArray) => sourceArray;
1503
-
1504
- function Page({
1505
- data: server,
1506
- sections,
1507
- globalSections,
1508
- offers,
1509
- meta
1510
- }) {
1511
- const {
1512
- product
1513
- } = server;
1514
- const {
1515
- currency
1516
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_9__/* .useSession */ .kP)(); // Stale while revalidate the product for fetching the new price etc
1517
-
1518
- const {
1519
- data: client,
1520
- isValidating
1521
- } = (0,src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_10__/* .useProductQuery */ .F)(product.id, {
1522
- product: product
1523
- });
1524
- const context = {
1525
- data: _objectSpread(_objectSpread({}, deepmerge__WEBPACK_IMPORTED_MODULE_2___default()(server, client, {
1526
- arrayMerge: overwriteMerge
1527
- })), {}, {
1528
- isValidating
1529
- })
1530
- };
1531
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .ZP, _objectSpread(_objectSpread({}, globalSections), {}, {
1532
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.NextSeo, {
1533
- title: meta.title,
1534
- description: meta.description,
1535
- canonical: meta.canonical,
1536
- openGraph: {
1537
- type: 'og:product',
1538
- url: meta.canonical,
1539
- title: meta.title,
1540
- description: meta.description,
1541
- images: product.image.map(img => ({
1542
- url: img.url,
1543
- alt: img.alternateName
1544
- }))
1545
- },
1546
- additionalMetaTags: [{
1547
- property: 'product:price:amount',
1548
- content: product.offers.lowPrice?.toString() ?? undefined
1549
- }, {
1550
- property: 'product:price:currency',
1551
- content: currency.code
1552
- }]
1553
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.BreadcrumbJsonLd, {
1554
- itemListElements: product.breadcrumbList.itemListElement
1555
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.ProductJsonLd, {
1556
- productName: product.name,
1557
- description: product.description,
1558
- brand: product.brand.name,
1559
- sku: product.sku,
1560
- gtin: product.gtin,
1561
- releaseDate: product.releaseDate,
1562
- images: product.image.map(img => img.url) // Somehow, Google does not understand this valid Schema.org schema, so we need to do conversions
1563
- ,
1564
- offers: offers
1565
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, {
1566
- context: context,
1567
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
1568
- sections: sections,
1569
- components: COMPONENTS
1570
- })
1571
- })]
1572
- }));
1573
- }
1574
-
1575
- const query = "ServerProductPageQuery";
1576
- const getStaticProps = async ({
1577
- params,
1578
- previewData
1579
- }) => {
1580
- const slug = params?.slug ?? '';
1581
- const [searchResult, cmsPage, globalSections] = await Promise.all([(0,src_server__WEBPACK_IMPORTED_MODULE_14__/* .execute */ .h)({
1582
- variables: {
1583
- locator: [{
1584
- key: 'slug',
1585
- value: slug
1586
- }]
1587
- },
1588
- operationName: query
1589
- }), (0,src_server_cms__WEBPACK_IMPORTED_MODULE_15__/* .getPage */ .f)(_objectSpread(_objectSpread({}, previewData?.contentType === 'pdp' ? previewData : null), {}, {
1590
- contentType: 'pdp'
1591
- })), (0,src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_11__/* .getGlobalSectionsData */ .Tc)(previewData)]);
1592
- const {
1593
- data,
1594
- errors = []
1595
- } = searchResult;
1596
- const notFound = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError);
1597
-
1598
- if (notFound) {
1599
- return {
1600
- notFound: true
1601
- };
1602
- }
1603
-
1604
- if (errors.length > 0) {
1605
- throw errors[0];
1606
- }
1607
-
1608
- const {
1609
- seo
1610
- } = data.product;
1611
- const title = seo.title || (_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().seo.title);
1612
- const description = seo.description || (_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().seo.description);
1613
- const canonical = `${(_faststore_config__WEBPACK_IMPORTED_MODULE_16___default().storeUrl)}${seo.canonical}`;
1614
- const meta = {
1615
- title,
1616
- description,
1617
- canonical
1618
- };
1619
- let offer = {};
1620
-
1621
- if (data.product.offers.offers.length > 0) {
1622
- const _data$product$offers$ = data.product.offers.offers[0],
1623
- {
1624
- listPrice
1625
- } = _data$product$offers$,
1626
- offerData = _objectWithoutProperties(_data$product$offers$, _excluded);
1627
-
1628
- offer = offerData;
1629
- }
1630
-
1631
- const offers = _objectSpread(_objectSpread({}, offer), {}, {
1632
- priceCurrency: data.product.offers.priceCurrency,
1633
- url: canonical
1634
- });
1635
-
1636
- return {
1637
- props: _objectSpread(_objectSpread({
1638
- data
1639
- }, cmsPage), {}, {
1640
- meta,
1641
- offers,
1642
- globalSections,
1643
- key: slug
1644
- })
1645
- };
1646
- };
1647
- const getStaticPaths = async () => {
1648
- return {
1649
- paths: [],
1650
- fallback: 'blocking'
1651
- };
1652
- };
1653
- Page.displayName = 'Page';
1654
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_17__/* .mark */ .B)(Page));
1655
- __webpack_async_result__();
1656
- } catch(e) { __webpack_async_result__(e); } });
1657
-
1658
- /***/ }),
1659
-
1660
- /***/ 7853:
1661
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1662
-
1663
- "use strict";
1664
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1665
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1666
- /* harmony export */ "F": () => (/* binding */ useProductQuery)
1667
- /* harmony export */ });
1668
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1669
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1670
- /* harmony import */ var _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7732);
1671
- /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
1672
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__]);
1673
- _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1674
-
1675
-
1676
-
1677
- const query = "ClientProductQuery";
1678
- const useProductQuery = (productID, fallbackData) => {
1679
- const {
1680
- channel,
1681
- locale
1682
- } = (0,_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
1683
- const variables = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1684
- if (!channel) {
1685
- throw new Error(`useProductQuery: 'channel' from session is an empty string.`);
1686
- }
1687
-
1688
- return {
1689
- locator: [{
1690
- key: 'id',
1691
- value: productID
1692
- }, {
1693
- key: 'channel',
1694
- value: channel
1695
- }, {
1696
- key: 'locale',
1697
- value: locale
1698
- }]
1699
- };
1700
- }, [channel, locale, productID]);
1701
- return (0,_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__/* .useQuery */ .aM)(query, variables, {
1702
- fallbackData,
1703
- revalidateOnMount: true
1704
- });
1705
- };
1706
- __webpack_async_result__();
1707
- } catch(e) { __webpack_async_result__(e); } });
1708
-
1709
- /***/ }),
1710
-
1711
- /***/ 5411:
1712
- /***/ ((module) => {
1713
-
1714
- // Exports
1715
- module.exports = {
1716
- "section": "section_section__pVnFl"
1717
- };
1718
-
1719
-
1720
- /***/ }),
1721
-
1722
- /***/ 9034:
1723
- /***/ ((module) => {
1724
-
1725
- // Exports
1726
- module.exports = {
1727
- "section": "section_section__XsOoR"
1728
- };
1729
-
1730
-
1731
- /***/ }),
1732
-
1733
- /***/ 1718:
1734
- /***/ ((module) => {
1735
-
1736
- "use strict";
1737
- module.exports = require("@graphql-tools/utils");
1738
-
1739
- /***/ }),
1740
-
1741
- /***/ 4691:
1742
- /***/ ((module) => {
1743
-
1744
- "use strict";
1745
- module.exports = require("@opentelemetry/api");
1746
-
1747
- /***/ }),
1748
-
1749
- /***/ 8973:
1750
- /***/ ((module) => {
1751
-
1752
- "use strict";
1753
- module.exports = require("@opentelemetry/api-logs");
1754
-
1755
- /***/ }),
1756
-
1757
- /***/ 6969:
1758
- /***/ ((module) => {
1759
-
1760
- "use strict";
1761
- module.exports = require("@opentelemetry/exporter-logs-otlp-grpc");
1762
-
1763
- /***/ }),
1764
-
1765
- /***/ 5196:
1766
- /***/ ((module) => {
1767
-
1768
- "use strict";
1769
- module.exports = require("@opentelemetry/exporter-trace-otlp-grpc");
1770
-
1771
- /***/ }),
1772
-
1773
- /***/ 4161:
1774
- /***/ ((module) => {
1775
-
1776
- "use strict";
1777
- module.exports = require("@opentelemetry/resources");
1778
-
1779
- /***/ }),
1780
-
1781
- /***/ 2793:
1782
- /***/ ((module) => {
1783
-
1784
- "use strict";
1785
- module.exports = require("@opentelemetry/sdk-logs");
1786
-
1787
- /***/ }),
1788
-
1789
- /***/ 1283:
1790
- /***/ ((module) => {
1791
-
1792
- "use strict";
1793
- module.exports = require("@opentelemetry/sdk-trace-base");
1794
-
1795
- /***/ }),
1796
-
1797
- /***/ 6676:
1798
- /***/ ((module) => {
1799
-
1800
- "use strict";
1801
- module.exports = require("@vtex/client-cms");
1802
-
1803
- /***/ }),
1804
-
1805
- /***/ 6330:
1806
- /***/ ((module) => {
1807
-
1808
- "use strict";
1809
- module.exports = require("deepmerge");
1810
-
1811
- /***/ }),
1812
-
1813
- /***/ 8641:
1814
- /***/ ((module) => {
1815
-
1816
- "use strict";
1817
- module.exports = require("draftjs-to-html");
1818
-
1819
- /***/ }),
1820
-
1821
- /***/ 2404:
1822
- /***/ ((module) => {
1823
-
1824
- "use strict";
1825
- module.exports = require("fast-deep-equal");
1826
-
1827
- /***/ }),
1828
-
1829
- /***/ 7343:
1830
- /***/ ((module) => {
1831
-
1832
- "use strict";
1833
- module.exports = require("graphql");
1834
-
1835
- /***/ }),
1836
-
1837
- /***/ 6548:
1838
- /***/ ((module) => {
1839
-
1840
- "use strict";
1841
- module.exports = require("graphql/language");
1842
-
1843
- /***/ }),
1844
-
1845
- /***/ 3430:
1846
- /***/ ((module) => {
1847
-
1848
- "use strict";
1849
- module.exports = require("idb-keyval");
1850
-
1851
- /***/ }),
1852
-
1853
- /***/ 7881:
1854
- /***/ ((module) => {
1855
-
1856
- "use strict";
1857
- module.exports = require("isomorphic-unfetch");
1858
-
1859
- /***/ }),
1860
-
1861
- /***/ 6641:
1862
- /***/ ((module) => {
1863
-
1864
- "use strict";
1865
- module.exports = require("next-seo");
1866
-
1867
- /***/ }),
1868
-
1869
- /***/ 3280:
1870
- /***/ ((module) => {
1871
-
1872
- "use strict";
1873
- module.exports = require("next/dist/shared/lib/app-router-context.js");
1874
-
1875
- /***/ }),
1876
-
1877
- /***/ 2796:
1878
- /***/ ((module) => {
1879
-
1880
- "use strict";
1881
- module.exports = require("next/dist/shared/lib/head-manager-context.js");
1882
-
1883
- /***/ }),
1884
-
1885
- /***/ 4957:
1886
- /***/ ((module) => {
1887
-
1888
- "use strict";
1889
- module.exports = require("next/dist/shared/lib/head.js");
1890
-
1891
- /***/ }),
1892
-
1893
- /***/ 3539:
1894
- /***/ ((module) => {
1895
-
1896
- "use strict";
1897
- module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
1898
-
1899
- /***/ }),
1900
-
1901
- /***/ 4014:
1902
- /***/ ((module) => {
1903
-
1904
- "use strict";
1905
- module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
1906
-
1907
- /***/ }),
1908
-
1909
- /***/ 4486:
1910
- /***/ ((module) => {
1911
-
1912
- "use strict";
1913
- module.exports = require("next/dist/shared/lib/image-blur-svg.js");
1914
-
1915
- /***/ }),
1916
-
1917
- /***/ 744:
1918
- /***/ ((module) => {
1919
-
1920
- "use strict";
1921
- module.exports = require("next/dist/shared/lib/image-config-context.js");
1922
-
1923
- /***/ }),
1924
-
1925
- /***/ 5843:
1926
- /***/ ((module) => {
1927
-
1928
- "use strict";
1929
- module.exports = require("next/dist/shared/lib/image-config.js");
1930
-
1931
- /***/ }),
1932
-
1933
- /***/ 8524:
1934
- /***/ ((module) => {
1935
-
1936
- "use strict";
1937
- module.exports = require("next/dist/shared/lib/is-plain-object.js");
1938
-
1939
- /***/ }),
1940
-
1941
- /***/ 8020:
1942
- /***/ ((module) => {
1943
-
1944
- "use strict";
1945
- module.exports = require("next/dist/shared/lib/mitt.js");
1946
-
1947
- /***/ }),
1948
-
1949
- /***/ 4406:
1950
- /***/ ((module) => {
1951
-
1952
- "use strict";
1953
- module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
1954
-
1955
- /***/ }),
1956
-
1957
- /***/ 4964:
1958
- /***/ ((module) => {
1959
-
1960
- "use strict";
1961
- module.exports = require("next/dist/shared/lib/router-context.js");
1962
-
1963
- /***/ }),
1964
-
1965
- /***/ 3431:
1966
- /***/ ((module) => {
1967
-
1968
- "use strict";
1969
- module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
1970
-
1971
- /***/ }),
1972
-
1973
- /***/ 1751:
1974
- /***/ ((module) => {
1975
-
1976
- "use strict";
1977
- module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
1978
-
1979
- /***/ }),
1980
-
1981
- /***/ 6220:
1982
- /***/ ((module) => {
1983
-
1984
- "use strict";
1985
- module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
1986
-
1987
- /***/ }),
1988
-
1989
- /***/ 299:
1990
- /***/ ((module) => {
1991
-
1992
- "use strict";
1993
- module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
1994
-
1995
- /***/ }),
1996
-
1997
- /***/ 3938:
1998
- /***/ ((module) => {
1999
-
2000
- "use strict";
2001
- module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
2002
-
2003
- /***/ }),
2004
-
2005
- /***/ 9565:
2006
- /***/ ((module) => {
2007
-
2008
- "use strict";
2009
- module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
2010
-
2011
- /***/ }),
2012
-
2013
- /***/ 5789:
2014
- /***/ ((module) => {
2015
-
2016
- "use strict";
2017
- module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
2018
-
2019
- /***/ }),
2020
-
2021
- /***/ 1897:
2022
- /***/ ((module) => {
2023
-
2024
- "use strict";
2025
- module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
2026
-
2027
- /***/ }),
2028
-
2029
- /***/ 1428:
2030
- /***/ ((module) => {
2031
-
2032
- "use strict";
2033
- module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
2034
-
2035
- /***/ }),
2036
-
2037
- /***/ 8854:
2038
- /***/ ((module) => {
2039
-
2040
- "use strict";
2041
- module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
2042
-
2043
- /***/ }),
2044
-
2045
- /***/ 1292:
2046
- /***/ ((module) => {
2047
-
2048
- "use strict";
2049
- module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
2050
-
2051
- /***/ }),
2052
-
2053
- /***/ 4567:
2054
- /***/ ((module) => {
2055
-
2056
- "use strict";
2057
- module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
2058
-
2059
- /***/ }),
2060
-
2061
- /***/ 979:
2062
- /***/ ((module) => {
2063
-
2064
- "use strict";
2065
- module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
2066
-
2067
- /***/ }),
2068
-
2069
- /***/ 3297:
2070
- /***/ ((module) => {
2071
-
2072
- "use strict";
2073
- module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
2074
-
2075
- /***/ }),
2076
-
2077
- /***/ 6052:
2078
- /***/ ((module) => {
2079
-
2080
- "use strict";
2081
- module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
2082
-
2083
- /***/ }),
2084
-
2085
- /***/ 4226:
2086
- /***/ ((module) => {
2087
-
2088
- "use strict";
2089
- module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
2090
-
2091
- /***/ }),
2092
-
2093
- /***/ 5052:
2094
- /***/ ((module) => {
2095
-
2096
- "use strict";
2097
- module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
2098
-
2099
- /***/ }),
2100
-
2101
- /***/ 9232:
2102
- /***/ ((module) => {
2103
-
2104
- "use strict";
2105
- module.exports = require("next/dist/shared/lib/utils.js");
2106
-
2107
- /***/ }),
2108
-
2109
- /***/ 1853:
2110
- /***/ ((module) => {
2111
-
2112
- "use strict";
2113
- module.exports = require("next/router");
2114
-
2115
- /***/ }),
2116
-
2117
- /***/ 5471:
2118
- /***/ ((module) => {
2119
-
2120
- "use strict";
2121
- module.exports = require("p-limit");
2122
-
2123
- /***/ }),
2124
-
2125
- /***/ 1423:
2126
- /***/ ((module) => {
2127
-
2128
- "use strict";
2129
- module.exports = require("path");
2130
-
2131
- /***/ }),
2132
-
2133
- /***/ 6689:
2134
- /***/ ((module) => {
2135
-
2136
- "use strict";
2137
- module.exports = require("react");
2138
-
2139
- /***/ }),
2140
-
2141
- /***/ 6405:
2142
- /***/ ((module) => {
2143
-
2144
- "use strict";
2145
- module.exports = require("react-dom");
2146
-
2147
- /***/ }),
2148
-
2149
- /***/ 9785:
2150
- /***/ ((module) => {
2151
-
2152
- "use strict";
2153
- module.exports = require("react-intersection-observer");
2154
-
2155
- /***/ }),
2156
-
2157
- /***/ 3789:
2158
- /***/ ((module) => {
2159
-
2160
- "use strict";
2161
- module.exports = require("react-swipeable");
2162
-
2163
- /***/ }),
2164
-
2165
- /***/ 997:
2166
- /***/ ((module) => {
2167
-
2168
- "use strict";
2169
- module.exports = require("react/jsx-runtime");
2170
-
2171
- /***/ }),
2172
-
2173
- /***/ 3823:
2174
- /***/ ((module) => {
2175
-
2176
- "use strict";
2177
- module.exports = require("tabbable");
2178
-
2179
- /***/ }),
2180
-
2181
- /***/ 752:
2182
- /***/ ((module) => {
2183
-
2184
- "use strict";
2185
- module.exports = require("tslib");
2186
-
2187
- /***/ }),
2188
-
2189
- /***/ 9664:
2190
- /***/ ((module) => {
2191
-
2192
- "use strict";
2193
- module.exports = import("@envelop/core");;
2194
-
2195
- /***/ }),
2196
-
2197
- /***/ 7886:
2198
- /***/ ((module) => {
2199
-
2200
- "use strict";
2201
- module.exports = import("@envelop/graphql-jit");;
2202
-
2203
- /***/ }),
2204
-
2205
- /***/ 4656:
2206
- /***/ ((module) => {
2207
-
2208
- "use strict";
2209
- module.exports = import("@envelop/parser-cache");;
2210
-
2211
- /***/ }),
2212
-
2213
- /***/ 6093:
2214
- /***/ ((module) => {
2215
-
2216
- "use strict";
2217
- module.exports = import("@envelop/validation-cache");;
2218
-
2219
- /***/ }),
2220
-
2221
- /***/ 5774:
2222
- /***/ ((module) => {
2223
-
2224
- "use strict";
2225
- module.exports = import("@graphql-tools/load-files");;
2226
-
2227
- /***/ }),
2228
-
2229
- /***/ 6550:
2230
- /***/ ((module) => {
2231
-
2232
- "use strict";
2233
- module.exports = import("@graphql-tools/schema");;
2234
-
2235
- /***/ }),
2236
-
2237
- /***/ 7564:
2238
- /***/ ((module) => {
2239
-
2240
- "use strict";
2241
- module.exports = import("chalk");;
2242
-
2243
- /***/ }),
2244
-
2245
- /***/ 5941:
2246
- /***/ ((module) => {
2247
-
2248
- "use strict";
2249
- module.exports = import("swr");;
2250
-
2251
- /***/ }),
2252
-
2253
- /***/ 6113:
2254
- /***/ ((module) => {
2255
-
2256
- "use strict";
2257
- module.exports = require("crypto");
2258
-
2259
- /***/ })
2260
-
2261
- };
2262
- ;
2263
-
2264
- // load runtime
2265
- var __webpack_require__ = require("../../webpack-runtime.js");
2266
- __webpack_require__.C(exports);
2267
- var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
2268
- var __webpack_exports__ = __webpack_require__.X(0, [676,825,52,183,177,74,53,779,854,117,184,897,387,350,693], () => (__webpack_exec__(5779)));
2269
- module.exports = __webpack_exports__;
2270
-
2271
- })();