@faststore/core 2.0.145-alpha.0 → 2.0.146-alpha.0

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 (158) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/build-manifest.json +132 -0
  3. package/.next/cache/.tsbuildinfo +1 -0
  4. package/.next/cache/config.json +7 -0
  5. package/.next/cache/eslint/.cache_1gneedd +1 -0
  6. package/.next/cache/next-server.js.nft.json +1 -0
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/export-marker.json +1 -0
  12. package/.next/images-manifest.json +1 -0
  13. package/.next/next-server.js.nft.json +1 -0
  14. package/.next/package.json +1 -0
  15. package/.next/prerender-manifest.json +1 -0
  16. package/.next/react-loadable-manifest.json +48 -0
  17. package/.next/required-server-files.json +1 -0
  18. package/.next/routes-manifest.json +1 -0
  19. package/.next/server/chunks/104.js +703 -0
  20. package/.next/server/chunks/123.js +58 -0
  21. package/.next/server/chunks/143.js +106 -0
  22. package/.next/server/chunks/183.js +80 -0
  23. package/.next/server/chunks/247.js +61 -0
  24. package/.next/server/chunks/280.js +324 -0
  25. package/.next/server/chunks/287.js +58 -0
  26. package/.next/server/chunks/312.js +670 -0
  27. package/.next/server/chunks/336.js +821 -0
  28. package/.next/server/chunks/350.js +142 -0
  29. package/.next/server/chunks/368.js +253 -0
  30. package/.next/server/chunks/401.js +7241 -0
  31. package/.next/server/chunks/431.js +7241 -0
  32. package/.next/server/chunks/502.js +600 -0
  33. package/.next/server/chunks/557.js +132 -0
  34. package/.next/server/chunks/576.js +80 -0
  35. package/.next/server/chunks/597.js +169 -0
  36. package/.next/server/chunks/608.js +644 -0
  37. package/.next/server/chunks/644.js +235 -0
  38. package/.next/server/chunks/664.js +3401 -0
  39. package/.next/server/chunks/676.js +32 -0
  40. package/.next/server/chunks/701.js +87 -0
  41. package/.next/server/chunks/74.js +2674 -0
  42. package/.next/server/chunks/746.js +225 -0
  43. package/.next/server/chunks/82.js +371 -0
  44. package/.next/server/chunks/854.js +72 -0
  45. package/.next/server/chunks/859.js +959 -0
  46. package/.next/server/chunks/874.js +487 -0
  47. package/.next/server/chunks/886.js +120 -0
  48. package/.next/server/chunks/907.js +1723 -0
  49. package/.next/server/chunks/98.js +124 -0
  50. package/.next/server/chunks/font-manifest.json +1 -0
  51. package/.next/server/font-manifest.json +1 -0
  52. package/.next/server/middleware-build-manifest.js +1 -0
  53. package/.next/server/middleware-manifest.json +6 -0
  54. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  55. package/.next/server/pages/404.js +393 -0
  56. package/.next/server/pages/404.js.nft.json +1 -0
  57. package/.next/server/pages/500.js +395 -0
  58. package/.next/server/pages/500.js.nft.json +1 -0
  59. package/.next/server/pages/[...slug].js +718 -0
  60. package/.next/server/pages/[...slug].js.nft.json +1 -0
  61. package/.next/server/pages/[slug]/p.js +2386 -0
  62. package/.next/server/pages/[slug]/p.js.nft.json +1 -0
  63. package/.next/server/pages/_app.js +368 -0
  64. package/.next/server/pages/_app.js.nft.json +1 -0
  65. package/.next/server/pages/_document.js +304 -0
  66. package/.next/server/pages/_document.js.nft.json +1 -0
  67. package/.next/server/pages/_error.js +164 -0
  68. package/.next/server/pages/_error.js.nft.json +1 -0
  69. package/.next/server/pages/account.js +370 -0
  70. package/.next/server/pages/account.js.nft.json +1 -0
  71. package/.next/server/pages/api/graphql.js +315 -0
  72. package/.next/server/pages/api/graphql.js.nft.json +1 -0
  73. package/.next/server/pages/api/preview.js +118 -0
  74. package/.next/server/pages/api/preview.js.nft.json +1 -0
  75. package/.next/server/pages/checkout.js +370 -0
  76. package/.next/server/pages/checkout.js.nft.json +1 -0
  77. package/.next/server/pages/en-US/404.html +81 -0
  78. package/.next/server/pages/en-US/404.json +1 -0
  79. package/.next/server/pages/en-US/500.html +81 -0
  80. package/.next/server/pages/en-US/500.json +1 -0
  81. package/.next/server/pages/en-US/account.html +81 -0
  82. package/.next/server/pages/en-US/account.json +1 -0
  83. package/.next/server/pages/en-US/checkout.html +81 -0
  84. package/.next/server/pages/en-US/checkout.json +1 -0
  85. package/.next/server/pages/en-US/login.html +81 -0
  86. package/.next/server/pages/en-US/login.json +1 -0
  87. package/.next/server/pages/en-US/s.html +81 -0
  88. package/.next/server/pages/en-US/s.json +1 -0
  89. package/.next/server/pages/en-US.html +81 -0
  90. package/.next/server/pages/en-US.json +1 -0
  91. package/.next/server/pages/index.js +966 -0
  92. package/.next/server/pages/index.js.nft.json +1 -0
  93. package/.next/server/pages/login.js +375 -0
  94. package/.next/server/pages/login.js.nft.json +1 -0
  95. package/.next/server/pages/s.js +457 -0
  96. package/.next/server/pages/s.js.nft.json +1 -0
  97. package/.next/server/pages-manifest.json +16 -0
  98. package/.next/server/webpack-api-runtime.js +229 -0
  99. package/.next/server/webpack-runtime.js +229 -0
  100. package/.next/static/QGL3gfKa2F4ppozosZML6/_buildManifest.js +1 -0
  101. package/.next/static/QGL3gfKa2F4ppozosZML6/_ssgManifest.js +1 -0
  102. package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
  103. package/.next/static/chunks/170.c17ce564bb568265.js +1 -0
  104. package/.next/static/chunks/226.b57e10ad9932f88c.js +1 -0
  105. package/.next/static/chunks/327-43715af4f3fffaf6.js +1 -0
  106. package/.next/static/chunks/336.0846f48eccce57e4.js +1 -0
  107. package/.next/static/chunks/366-4a0572a47e2225d9.js +1 -0
  108. package/.next/static/chunks/377-61e89c711b136605.js +1 -0
  109. package/.next/static/chunks/391-47b923ef44945418.js +1 -0
  110. package/.next/static/chunks/495.8ffebac98e9475dc.js +1 -0
  111. package/.next/static/chunks/502.ae82de1669112b15.js +1 -0
  112. package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +1 -0
  113. package/.next/static/chunks/597.c5cf3fbeae5ceb63.js +1 -0
  114. package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
  115. package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
  116. package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
  117. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
  118. package/.next/static/chunks/main-fd466221927468fd.js +1 -0
  119. package/.next/static/chunks/pages/404-459452495a0df278.js +1 -0
  120. package/.next/static/chunks/pages/500-008e30c48eceebed.js +1 -0
  121. package/.next/static/chunks/pages/[...slug]-3c749c7d8561eb90.js +1 -0
  122. package/.next/static/chunks/pages/[slug]/p-6597f93c2bfe07b3.js +1 -0
  123. package/.next/static/chunks/pages/_app-3e4e7e579cb0681a.js +1 -0
  124. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
  125. package/.next/static/chunks/pages/account-46263f0c100c3eae.js +1 -0
  126. package/.next/static/chunks/pages/checkout-20bb3710b24df3b6.js +1 -0
  127. package/.next/static/chunks/pages/index-49b7ee570f7cc4b7.js +1 -0
  128. package/.next/static/chunks/pages/login-f9d316d261fcc062.js +1 -0
  129. package/.next/static/chunks/pages/s-890c0c4b88484224.js +1 -0
  130. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
  131. package/.next/static/chunks/webpack-4e162ac7f81d85d4.js +1 -0
  132. package/.next/static/css/13a4da555ff5e3be.css +1 -0
  133. package/.next/static/css/2e00f7ba49c754b3.css +1 -0
  134. package/.next/static/css/2e9de35e0cb999e0.css +1 -0
  135. package/.next/static/css/43b1b3821e21630c.css +1 -0
  136. package/.next/static/css/48af598df5fe042d.css +1 -0
  137. package/.next/static/css/7701d01af31e31d1.css +1 -0
  138. package/.next/static/css/923c4a942e57bc91.css +1 -0
  139. package/.next/static/css/e02cdad8fc000339.css +1 -0
  140. package/.next/static/css/e434797816e17065.css +1 -0
  141. package/.next/static/css/e7a6f3559cf45c62.css +1 -0
  142. package/.next/trace +68 -0
  143. package/.turbo/turbo-build.log +2 -2
  144. package/CHANGELOG.md +6 -0
  145. package/cms/faststore/sections.json +1 -1
  146. package/package.json +2 -2
  147. package/public/~partytown/debug/partytown-atomics.js +556 -0
  148. package/public/~partytown/debug/partytown-media.js +374 -0
  149. package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
  150. package/public/~partytown/debug/partytown-sw.js +59 -0
  151. package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
  152. package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
  153. package/public/~partytown/debug/partytown.js +72 -0
  154. package/public/~partytown/partytown-atomics.js +2 -0
  155. package/public/~partytown/partytown-media.js +2 -0
  156. package/public/~partytown/partytown-sw.js +2 -0
  157. package/public/~partytown/partytown.js +2 -0
  158. package/src/pages/[...slug].tsx +1 -10
@@ -0,0 +1,2386 @@
1
+ (() => {
2
+ var exports = {};
3
+ exports.id = 103;
4
+ exports.ids = [103];
5
+ exports.modules = {
6
+
7
+ /***/ 7738:
8
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
+
10
+ "use strict";
11
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
13
+ /* harmony export */ });
14
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
15
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
16
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7578);
17
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5045);
18
+
19
+
20
+ function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
21
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { "data-fs-buy-button": true, icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { name: "ShoppingCart" }), iconPosition: "left", "data-testid": testId, ...otherProps }, children));
22
+ }
23
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BuyButton);
24
+ //# sourceMappingURL=BuyButton.js.map
25
+
26
+ /***/ }),
27
+
28
+ /***/ 1672:
29
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
30
+
31
+ "use strict";
32
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
34
+ /* harmony export */ });
35
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
36
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
37
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(783);
38
+
39
+
40
+ const ProductTitle = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
41
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
42
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-product-title-header": true },
43
+ title,
44
+ !!label && label),
45
+ (refNumber || ratingValue) && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { "data-fs-product-title-addendum": true },
46
+ ratingValue && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { value: ratingValue }),
47
+ refNumber && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
48
+ refTag,
49
+ " ",
50
+ refNumber))))));
51
+ });
52
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductTitle);
53
+ //# sourceMappingURL=ProductTitle.js.map
54
+
55
+ /***/ }),
56
+
57
+ /***/ 4707:
58
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
59
+
60
+ "use strict";
61
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
62
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
63
+ /* harmony export */ });
64
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
65
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
66
+
67
+ const Table = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
68
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-table": true },
69
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
70
+ });
71
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Table);
72
+ //# sourceMappingURL=Table.js.map
73
+
74
+ /***/ }),
75
+
76
+ /***/ 1566:
77
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
78
+
79
+ "use strict";
80
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
81
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
82
+ /* harmony export */ });
83
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
84
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
85
+
86
+ const TableBody = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
87
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
88
+ });
89
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableBody);
90
+ //# sourceMappingURL=TableBody.js.map
91
+
92
+ /***/ }),
93
+
94
+ /***/ 3111:
95
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
96
+
97
+ "use strict";
98
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
99
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
100
+ /* harmony export */ });
101
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
102
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
103
+
104
+ const TableCell = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
105
+ const Cell = variant === 'header' ? 'th' : 'td';
106
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
107
+ });
108
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableCell);
109
+ //# sourceMappingURL=TableCell.js.map
110
+
111
+ /***/ }),
112
+
113
+ /***/ 6037:
114
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
115
+
116
+ "use strict";
117
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
118
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
119
+ /* harmony export */ });
120
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
121
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
122
+
123
+ const TableRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
124
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
125
+ });
126
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableRow);
127
+ //# sourceMappingURL=TableRow.js.map
128
+
129
+ /***/ }),
130
+
131
+ /***/ 492:
132
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
133
+
134
+ "use strict";
135
+
136
+ // EXPORTS
137
+ __webpack_require__.d(__webpack_exports__, {
138
+ "Z": () => (/* reexport */ product_OutOfStock_OutOfStock)
139
+ });
140
+
141
+ // EXTERNAL MODULE: ../components/dist/hooks/UIProvider.js
142
+ var UIProvider = __webpack_require__(395);
143
+ // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
144
+ var Icon = __webpack_require__(5045);
145
+ // EXTERNAL MODULE: external "react"
146
+ var external_react_ = __webpack_require__(6689);
147
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
148
+ // EXTERNAL MODULE: ../components/dist/molecules/InputField/InputField.js
149
+ var InputField = __webpack_require__(8287);
150
+ // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
151
+ var Button = __webpack_require__(7578);
152
+ ;// CONCATENATED MODULE: ../components/dist/organisms/OutOfStock/OutOfStock.js
153
+
154
+
155
+ const OutOfStock = (0,external_react_.forwardRef)(function OutOfStock({ testId = 'fs-out-of-stock', title, buttonLabel = 'Notify Me', loadingLabel = 'Loading', inputLabel, subtitle, disabled, errorMessage, onSubmit, ...otherProps }, ref) {
156
+ return (external_react_default().createElement("form", { "data-fs-out-of-stock": true, ref: ref, "data-testid": testId, onSubmit: onSubmit, ...otherProps },
157
+ external_react_default().createElement("h2", { "data-fs-out-of-stock-title": true }, title),
158
+ subtitle && (external_react_default().createElement("p", { "data-fs-out-of-stock-message": true },
159
+ external_react_default().createElement(Icon/* default */.Z, { name: "BellRinging", width: 16, height: 16 }),
160
+ subtitle)),
161
+ external_react_default().createElement(InputField/* default */.Z, { id: "out-of-stock-email", name: "out-of-stock-email", label: inputLabel, "aria-label": inputLabel, error: errorMessage, required: true }),
162
+ external_react_default().createElement(Button/* default */.Z, { "data-fs-out-of-stock-button": true, type: "submit", loading: disabled, loadingLabel: loadingLabel, disabled: disabled, variant: "primary", icon: external_react_default().createElement(Icon/* default */.Z, { name: "BellRinging" }), iconPosition: "left" }, buttonLabel)));
163
+ });
164
+ /* harmony default export */ const OutOfStock_OutOfStock = (OutOfStock);
165
+ //# sourceMappingURL=OutOfStock.js.map
166
+ // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
167
+ var session = __webpack_require__(7295);
168
+ // EXTERNAL MODULE: external "react/jsx-runtime"
169
+ var jsx_runtime_ = __webpack_require__(997);
170
+ ;// CONCATENATED MODULE: ./src/components/product/OutOfStock/OutOfStock.tsx
171
+
172
+
173
+
174
+
175
+
176
+ function OutOfStock_OutOfStock_OutOfStock() {
177
+ const {
178
+ postalCode
179
+ } = (0,session/* useSession */.kP)();
180
+ const {
181
+ 0: isLoading,
182
+ 1: setIsLoading
183
+ } = (0,external_react_.useState)(false);
184
+ const {
185
+ 0: error,
186
+ 1: setError
187
+ } = (0,external_react_.useState)('');
188
+ const {
189
+ pushToast
190
+ } = (0,UIProvider/* useUI */.l)();
191
+
192
+ const handleSubmit = event => {
193
+ event.preventDefault();
194
+ setIsLoading(true); // TODO: Missing integration
195
+
196
+ try {
197
+ // Return to original state after 2s mockup
198
+ setTimeout(() => setIsLoading(false), 2000);
199
+ const formElement = event.currentTarget;
200
+ formElement.reset();
201
+ pushToast({
202
+ title: 'Subscribed successfully!',
203
+ message: "You'll be notified when this product is back to stock.",
204
+ status: 'INFO',
205
+ icon: /*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
206
+ name: "CircleWavyCheck",
207
+ width: 30,
208
+ height: 30
209
+ })
210
+ });
211
+ } catch (err) {
212
+ setError(err.message);
213
+ } finally {}
214
+ };
215
+
216
+ return /*#__PURE__*/jsx_runtime_.jsx(OutOfStock_OutOfStock, {
217
+ title: postalCode ? 'Unavailable in Your Location' : 'Out of Stock',
218
+ inputLabel: "Email",
219
+ subtitle: "Notify me when available",
220
+ onSubmit: handleSubmit,
221
+ disabled: isLoading,
222
+ errorMessage: error
223
+ });
224
+ }
225
+
226
+ /* harmony default export */ const product_OutOfStock_OutOfStock = (OutOfStock_OutOfStock_OutOfStock);
227
+ ;// CONCATENATED MODULE: ./src/components/product/OutOfStock/index.ts
228
+
229
+
230
+ /***/ }),
231
+
232
+ /***/ 2951:
233
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
234
+
235
+ "use strict";
236
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
237
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
238
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
239
+ /* harmony export */ });
240
+ /* harmony import */ var src_components_ui_BannerText__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6166);
241
+ /* harmony import */ var _Newsletter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7191);
242
+ /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7067);
243
+ /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5411);
244
+ /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_4__);
245
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
246
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
247
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Newsletter__WEBPACK_IMPORTED_MODULE_1__]);
248
+ _Newsletter__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+ function BannerNewsletter() {
257
+ return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(_Section__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
258
+ className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_4___default().section)} section-banner-newsletter layout__content`,
259
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
260
+ "data-fs-banner-newsletter": true,
261
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_ui_BannerText__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
262
+ title: "Get to Know Our Next Release",
263
+ caption: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. ",
264
+ actionLabel: "Shop Now",
265
+ actionPath: "/",
266
+ variant: "secondary",
267
+ colorVariant: "light"
268
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(_Newsletter__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
269
+ title: "Get News and Special Offers!",
270
+ description: "Receive our news and promotions in advance. Enjoy and get 10% off your first purchase. For more information click here.",
271
+ card: true,
272
+ lite: true
273
+ })]
274
+ })
275
+ });
276
+ }
277
+
278
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerNewsletter);
279
+ __webpack_async_result__();
280
+ } catch(e) { __webpack_async_result__(e); } });
281
+
282
+ /***/ }),
283
+
284
+ /***/ 994:
285
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
286
+
287
+ "use strict";
288
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
289
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
290
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
291
+ /* harmony export */ });
292
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
293
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
294
+ /* harmony import */ var _ProductShelf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7104);
295
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
296
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
297
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductShelf__WEBPACK_IMPORTED_MODULE_1__]);
298
+ _ProductShelf__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
299
+
300
+
301
+
302
+
303
+ const CrossSellingShelf = ({
304
+ items,
305
+ title,
306
+ context,
307
+ kind
308
+ }) => {
309
+ const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
310
+ key: kind,
311
+ value: context.isVariantOf.productGroupID
312
+ }], [kind, context.isVariantOf.productGroupID]);
313
+ return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_ProductShelf__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
314
+ first: items,
315
+ title: title,
316
+ selectedFacets: selectedFacets
317
+ });
318
+ };
319
+
320
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
321
+ __webpack_async_result__();
322
+ } catch(e) { __webpack_async_result__(e); } });
323
+
324
+ /***/ }),
325
+
326
+ /***/ 7990:
327
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
328
+
329
+ "use strict";
330
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
331
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332
+ /* harmony export */ "Z": () => (/* reexport safe */ _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__.Z)
333
+ /* harmony export */ });
334
+ /* harmony import */ var _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(994);
335
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__]);
336
+ _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
337
+
338
+ __webpack_async_result__();
339
+ } catch(e) { __webpack_async_result__(e); } });
340
+
341
+ /***/ }),
342
+
343
+ /***/ 4870:
344
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
345
+
346
+ "use strict";
347
+
348
+ // EXPORTS
349
+ __webpack_require__.d(__webpack_exports__, {
350
+ "Z": () => (/* reexport */ ProducDetailsContent_ProductDetailsContent)
351
+ });
352
+
353
+ // EXTERNAL MODULE: ../components/dist/molecules/Accordion/Accordion.js
354
+ var Accordion = __webpack_require__(9739);
355
+ // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionItem.js
356
+ var AccordionItem = __webpack_require__(5705);
357
+ // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionButton.js
358
+ var AccordionButton = __webpack_require__(7743);
359
+ // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionPanel.js
360
+ var AccordionPanel = __webpack_require__(331);
361
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/Table.js
362
+ var Table = __webpack_require__(4707);
363
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableBody.js
364
+ var TableBody = __webpack_require__(1566);
365
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableRow.js
366
+ var TableRow = __webpack_require__(6037);
367
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableCell.js
368
+ var TableCell = __webpack_require__(3111);
369
+ // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
370
+ var Icon = __webpack_require__(5045);
371
+ // EXTERNAL MODULE: ../components/dist/atoms/List/List.js
372
+ var List = __webpack_require__(1329);
373
+ // EXTERNAL MODULE: external "react"
374
+ var external_react_ = __webpack_require__(6689);
375
+ // EXTERNAL MODULE: external "react/jsx-runtime"
376
+ var jsx_runtime_ = __webpack_require__(997);
377
+ ;// CONCATENATED MODULE: ./src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx
378
+ 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; }
379
+
380
+ 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; }
381
+
382
+ 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; }
383
+
384
+
385
+
386
+
387
+
388
+
389
+ /**
390
+ * Maps 'initiallyExpanded' prop values to indices
391
+ */
392
+ const INITIALLY_EXPANDED_MAP = {
393
+ first: [0],
394
+ all: [0, 1, 2, 3],
395
+ none: []
396
+ };
397
+ /**
398
+ * Default article labels
399
+ */
400
+
401
+ const DEFAULT_LABELS = {
402
+ description: 'Description',
403
+ about: 'About this product',
404
+ highlights: 'Product highlights',
405
+ learnMore: 'Learn More'
406
+ };
407
+
408
+ function ProductDetailsContent({
409
+ initiallyExpanded = 'first',
410
+ labels: propLabels = {}
411
+ }) {
412
+ const {
413
+ 0: indices,
414
+ 1: setIndices
415
+ } = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
416
+
417
+ const onChange = index => {
418
+ setIndices(currentIndices => {
419
+ const newIndices = new Set(currentIndices);
420
+
421
+ if (currentIndices.has(index)) {
422
+ newIndices.delete(index);
423
+ } else {
424
+ newIndices.add(index);
425
+ }
426
+
427
+ return newIndices;
428
+ });
429
+ };
430
+
431
+ const labels = _objectSpread(_objectSpread({}, DEFAULT_LABELS), propLabels);
432
+
433
+ return /*#__PURE__*/jsx_runtime_.jsx("section", {
434
+ "data-fs-product-details-content": true,
435
+ children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(Accordion/* default */.Z, {
436
+ indices: indices,
437
+ onChange: onChange,
438
+ "aria-label": "Product Details Content",
439
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
440
+ as: "article",
441
+ index: 0,
442
+ "data-fs-product-details-description": true,
443
+ prefixId: "product-details-content",
444
+ children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
445
+ children: labels.description
446
+ }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
447
+ children: /*#__PURE__*/jsx_runtime_.jsx("p", {
448
+ className: "text__body",
449
+ children: "Sony WH-1000XM4 Wireless Industry Leading Noise Canceling Overhead Headphones with Mic for Phone-Call and Alexa Voice Control, Black."
450
+ })
451
+ })]
452
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
453
+ as: "article",
454
+ index: 1,
455
+ "data-fs-product-details-about": true,
456
+ prefixId: "product-details-content",
457
+ children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
458
+ children: labels.about
459
+ }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
460
+ children: /*#__PURE__*/jsx_runtime_.jsx(Table/* default */.Z, {
461
+ cellPadding: 0,
462
+ cellSpacing: 0,
463
+ className: "text__title-mini-alt",
464
+ children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableBody/* default */.Z, {
465
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
466
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
467
+ variant: "header",
468
+ align: "left",
469
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
470
+ "data-fs-accordion-item-button-icon": true,
471
+ name: "Ruler",
472
+ width: 18,
473
+ height: 18
474
+ }), /*#__PURE__*/jsx_runtime_.jsx("span", {
475
+ children: "Width"
476
+ })]
477
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
478
+ align: "right",
479
+ children: "1.50m"
480
+ })]
481
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
482
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
483
+ variant: "header",
484
+ align: "left",
485
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
486
+ "data-fs-accordion-item-button-icon": true,
487
+ name: "Ruler",
488
+ width: 18,
489
+ height: 18
490
+ }), "Height"]
491
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
492
+ align: "right",
493
+ children: "1.50m"
494
+ })]
495
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
496
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
497
+ variant: "header",
498
+ align: "left",
499
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
500
+ "data-fs-accordion-item-button-icon": true,
501
+ name: "Ruler",
502
+ width: 18,
503
+ height: 18
504
+ }), "Dimensions"]
505
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
506
+ align: "right",
507
+ children: "7.27 x 3.03 x 9.94 inches"
508
+ })]
509
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
510
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
511
+ variant: "header",
512
+ align: "left",
513
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
514
+ "data-fs-accordion-item-button-icon": true,
515
+ name: "Bag",
516
+ width: 18,
517
+ height: 18
518
+ }), "Weight"]
519
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
520
+ align: "right",
521
+ children: "12oz"
522
+ })]
523
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
524
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
525
+ variant: "header",
526
+ align: "left",
527
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
528
+ "data-fs-accordion-item-button-icon": true,
529
+ name: "RocketLaunch",
530
+ width: 18,
531
+ height: 18
532
+ }), "Days to ship"]
533
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
534
+ align: "right",
535
+ children: "11 Days"
536
+ })]
537
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
538
+ children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
539
+ variant: "header",
540
+ align: "left",
541
+ children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
542
+ "data-fs-accordion-item-button-icon": true,
543
+ name: "CircleWavyCheck",
544
+ width: 18,
545
+ height: 18
546
+ }), "Estimated"]
547
+ }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
548
+ align: "right",
549
+ children: "Nov 10th"
550
+ })]
551
+ })]
552
+ })
553
+ })
554
+ })]
555
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
556
+ as: "article",
557
+ className: "text__body",
558
+ index: 2,
559
+ "data-fs-product-details-highlights": true,
560
+ prefixId: "product-details-content",
561
+ children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
562
+ children: labels.highlights
563
+ }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
564
+ children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(List/* default */.Z, {
565
+ marker: true,
566
+ children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
567
+ children: "Industry-leading noise canceling with Dual Noise Sensor technology"
568
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
569
+ children: "Next-level music with Edge-AI, co-developed with Sony Music Studios Tokyo"
570
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
571
+ children: "Up to 30-hour battery life with quick charging (10 min charge for 5 hours of playback)"
572
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
573
+ children: "Touch Sensor controls to pause play skip tracks, control volume, activate your voice assistant, and answer phone calls"
574
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
575
+ children: "Speak-to-chat technology automatically reduces volume during conversations"
576
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
577
+ children: "Superior call quality with precise voice pickup"
578
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
579
+ children: "Wearing detection pauses playback when headphones are removed"
580
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
581
+ children: "Seamless multiple-device pairing"
582
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
583
+ children: "Adaptive Sound Control provides a personalized listening experience"
584
+ }), /*#__PURE__*/jsx_runtime_.jsx("li", {
585
+ children: "Updated design relieves pressure for long-lasting comfort"
586
+ })]
587
+ })
588
+ })]
589
+ }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
590
+ as: "article",
591
+ index: 3,
592
+ "data-fs-product-details-learn-more": true,
593
+ prefixId: "product-details-content",
594
+ children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
595
+ children: labels.learnMore
596
+ }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
597
+ children: /*#__PURE__*/jsx_runtime_.jsx("p", {
598
+ className: "text__body",
599
+ children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru."
600
+ })
601
+ })]
602
+ })]
603
+ })
604
+ });
605
+ }
606
+
607
+ /* harmony default export */ const ProducDetailsContent_ProductDetailsContent = (ProductDetailsContent);
608
+ ;// CONCATENATED MODULE: ./src/components/sections/ProducDetailsContent/index.ts
609
+
610
+
611
+ /***/ }),
612
+
613
+ /***/ 1750:
614
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
615
+
616
+ "use strict";
617
+
618
+ // EXPORTS
619
+ __webpack_require__.d(__webpack_exports__, {
620
+ "z": () => (/* binding */ Components)
621
+ });
622
+
623
+ // EXTERNAL MODULE: ../components/dist/atoms/Price/Price.js
624
+ var Price = __webpack_require__(7549);
625
+ // EXTERNAL MODULE: ../components/dist/molecules/DiscountBadge/DiscountBadge.js + 1 modules
626
+ var DiscountBadge = __webpack_require__(9875);
627
+ ;// CONCATENATED MODULE: ./src/customizations/components/overrides/ProductDetails.tsx
628
+ const SECTION = "ProductDetails";
629
+ const overrides = {
630
+ name: SECTION,
631
+ components: {}
632
+ };
633
+ /* harmony default export */ const ProductDetails = (overrides);
634
+ ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/Overrides.tsx
635
+ 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; }
636
+
637
+ 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; }
638
+
639
+ 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; }
640
+
641
+
642
+
643
+
644
+ const Components = _objectSpread({
645
+ Price: Price/* default */.Z,
646
+ DiscountBadge: DiscountBadge/* default */.Z
647
+ }, ProductDetails.components);
648
+
649
+
650
+
651
+ /***/ }),
652
+
653
+ /***/ 1644:
654
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
655
+
656
+ "use strict";
657
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
658
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
659
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
660
+ /* harmony export */ });
661
+ /* unused harmony export fragment */
662
+ /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(1072);
663
+ /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(123);
664
+ /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7738);
665
+ /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(1672);
666
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
667
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
668
+ /* harmony import */ var _Overrides__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1750);
669
+ /* harmony import */ var src_components_product_OutOfStock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(492);
670
+ /* harmony import */ var src_components_ui_ImageGallery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5693);
671
+ /* harmony import */ var src_components_ui_ShippingSimulation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(104);
672
+ /* harmony import */ var src_components_ui_SkuSelector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4475);
673
+ /* harmony import */ var src_sdk_cart_useBuyButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8892);
674
+ /* harmony import */ var src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5346);
675
+ /* harmony import */ var src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3874);
676
+ /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7295);
677
+ /* harmony import */ var _ProducDetailsContent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4870);
678
+ /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7067);
679
+ /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(9034);
680
+ /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_16__);
681
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(997);
682
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
683
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_8__]);
684
+ src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_8__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
685
+ 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; }
686
+
687
+ 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; }
688
+
689
+ 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; }
690
+
691
+
692
+
693
+
694
+
695
+ const {
696
+ Price,
697
+ DiscountBadge
698
+ } = _Overrides__WEBPACK_IMPORTED_MODULE_1__/* .Components */ .z;
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+ function ProductDetails({
715
+ context: staleProduct
716
+ }) {
717
+ const {
718
+ currency
719
+ } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_9__/* .useSession */ .kP)();
720
+ const {
721
+ 0: addQuantity,
722
+ 1: setAddQuantity
723
+ } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1); // Stale while revalidate the product for fetching the new price etc
724
+
725
+ const {
726
+ data,
727
+ isValidating
728
+ } = (0,src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_8__/* .useProduct */ .i)(staleProduct.id, {
729
+ product: staleProduct
730
+ });
731
+
732
+ if (!data) {
733
+ throw new Error('NotFound');
734
+ }
735
+
736
+ const {
737
+ product: {
738
+ id,
739
+ sku,
740
+ gtin,
741
+ name: variantName,
742
+ brand,
743
+ isVariantOf,
744
+ isVariantOf: {
745
+ name,
746
+ productGroupID: productId,
747
+ skuVariants
748
+ },
749
+ image: productImages,
750
+ offers: {
751
+ offers: [{
752
+ availability,
753
+ price,
754
+ listPrice,
755
+ seller
756
+ }],
757
+ lowPrice
758
+ },
759
+ breadcrumbList: breadcrumbs,
760
+ additionalProperty
761
+ }
762
+ } = data;
763
+ const buyDisabled = availability !== 'https://schema.org/InStock';
764
+ const buyProps = (0,src_sdk_cart_useBuyButton__WEBPACK_IMPORTED_MODULE_6__/* .useBuyButton */ .Q)({
765
+ id,
766
+ price,
767
+ listPrice,
768
+ seller,
769
+ quantity: addQuantity,
770
+ itemOffered: {
771
+ sku,
772
+ name: variantName,
773
+ gtin,
774
+ image: productImages,
775
+ brand,
776
+ isVariantOf,
777
+ additionalProperty
778
+ }
779
+ });
780
+
781
+ const ProductDetailsSection = () => {
782
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
783
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("section", {
784
+ "data-fs-product-details-values": true,
785
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
786
+ "data-fs-product-details-prices": true,
787
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(Price, {
788
+ value: listPrice,
789
+ formatter: src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_7__/* .useFormattedPrice */ .P,
790
+ testId: "list-price",
791
+ "data-value": listPrice,
792
+ variant: "listing",
793
+ SRText: "Original price:"
794
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(Price, {
795
+ value: lowPrice,
796
+ formatter: src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_7__/* .useFormattedPrice */ .P,
797
+ testId: "price",
798
+ "data-value": lowPrice,
799
+ variant: "spot",
800
+ className: "text__lead",
801
+ SRText: "Sale Price:"
802
+ })]
803
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
804
+ min: 1,
805
+ max: 10,
806
+ onChange: setAddQuantity
807
+ })]
808
+ }), skuVariants && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(src_components_ui_SkuSelector__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
809
+ slugsMap: skuVariants.slugsMap,
810
+ availableVariations: skuVariants.availableVariations,
811
+ activeVariations: skuVariants.activeVariations,
812
+ "data-fs-product-details-selectors": true
813
+ }),
814
+ /* NOTE: A loading skeleton had to be used to avoid a Lighthouse's
815
+ non-composited animation violation due to the button transitioning its
816
+ background color when changing from its initial disabled to active state.
817
+ See full explanation on commit https://git.io/JyXV5. */
818
+ isValidating ? /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, _objectSpread(_objectSpread({
819
+ disabled: buyDisabled
820
+ }, buyProps), {}, {
821
+ children: "Add to Cart"
822
+ }))]
823
+ });
824
+ };
825
+
826
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
827
+ (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_15__/* .sendAnalyticsEvent */ ._)({
828
+ name: 'view_item',
829
+ params: {
830
+ currency: currency.code,
831
+ value: price,
832
+ items: [{
833
+ item_id: isVariantOf.productGroupID,
834
+ item_name: isVariantOf.name,
835
+ item_brand: brand.name,
836
+ item_variant: sku,
837
+ price,
838
+ discount: listPrice - price,
839
+ currency: currency.code,
840
+ item_variant_name: variantName,
841
+ product_reference_id: gtin
842
+ }]
843
+ }
844
+ });
845
+ }, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
846
+ return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(_Section__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
847
+ className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_16___default().section)} section-product-details layout__content layout__section`,
848
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("section", {
849
+ "data-fs-product-details": true,
850
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("section", {
851
+ "data-fs-product-details-body": true,
852
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("header", {
853
+ "data-fs-product-details-title": true,
854
+ "data-fs-product-details-section": true,
855
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
856
+ title: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("h1", {
857
+ children: name
858
+ }),
859
+ label: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(DiscountBadge, {
860
+ listPrice: listPrice,
861
+ spotPrice: lowPrice,
862
+ size: "big"
863
+ }),
864
+ refNumber: productId
865
+ })
866
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(src_components_ui_ImageGallery__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
867
+ "data-fs-product-details-gallery": true,
868
+ images: productImages
869
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("section", {
870
+ "data-fs-product-details-info": true,
871
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("section", {
872
+ "data-fs-product-details-settings": true,
873
+ "data-fs-product-details-section": true,
874
+ children: availability ? /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(ProductDetailsSection, {}) : /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(src_components_product_OutOfStock__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {})
875
+ }), availability && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(src_components_ui_ShippingSimulation__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
876
+ "data-fs-product-details-section": true,
877
+ "data-fs-product-details-shipping": true,
878
+ productShippingInfo: {
879
+ id,
880
+ quantity: addQuantity,
881
+ seller: seller.identifier
882
+ },
883
+ formatter: src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_7__/* .useFormattedPrice */ .P
884
+ })]
885
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx(_ProducDetailsContent__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {})]
886
+ })
887
+ })
888
+ });
889
+ }
890
+
891
+ function AddToCartLoadingSkeleton() {
892
+ // Generated via https://skeletonreact.com/.
893
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("svg", {
894
+ role: "img",
895
+ width: "100%",
896
+ height: "48",
897
+ "aria-labelledby": "loading-aria",
898
+ viewBox: "0 0 112 48",
899
+ preserveAspectRatio: "none",
900
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("title", {
901
+ id: "loading-aria",
902
+ children: "Loading..."
903
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("rect", {
904
+ x: "0",
905
+ y: "0",
906
+ width: "100%",
907
+ height: "100%",
908
+ clipPath: "url(#clip-path)",
909
+ style: {
910
+ fill: 'url("#fill")'
911
+ }
912
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("defs", {
913
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("clipPath", {
914
+ id: "clip-path",
915
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("rect", {
916
+ x: "0",
917
+ y: "0",
918
+ rx: "2",
919
+ ry: "2",
920
+ width: "112",
921
+ height: "48"
922
+ })
923
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("linearGradient", {
924
+ id: "fill",
925
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("stop", {
926
+ offset: "0.599964",
927
+ stopColor: "#f3f3f3",
928
+ stopOpacity: "1",
929
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("animate", {
930
+ attributeName: "offset",
931
+ values: "-2; -2; 1",
932
+ keyTimes: "0; 0.25; 1",
933
+ dur: "2s",
934
+ repeatCount: "indefinite"
935
+ })
936
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("stop", {
937
+ offset: "1.59996",
938
+ stopColor: "#ecebeb",
939
+ stopOpacity: "1",
940
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("animate", {
941
+ attributeName: "offset",
942
+ values: "-1; -1; 2",
943
+ keyTimes: "0; 0.25; 1",
944
+ dur: "2s",
945
+ repeatCount: "indefinite"
946
+ })
947
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("stop", {
948
+ offset: "2.59996",
949
+ stopColor: "#f3f3f3",
950
+ stopOpacity: "1",
951
+ children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx("animate", {
952
+ attributeName: "offset",
953
+ values: "0; 0; 3",
954
+ keyTimes: "0; 0.25; 1",
955
+ dur: "2s",
956
+ repeatCount: "indefinite"
957
+ })
958
+ })]
959
+ })]
960
+ })]
961
+ });
962
+ }
963
+
964
+ const fragment = "unknown";
965
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductDetails);
966
+ __webpack_async_result__();
967
+ } catch(e) { __webpack_async_result__(e); } });
968
+
969
+ /***/ }),
970
+
971
+ /***/ 3220:
972
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
973
+
974
+ "use strict";
975
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
976
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
977
+ /* harmony export */ "Z": () => (/* reexport safe */ _ProductDetails__WEBPACK_IMPORTED_MODULE_0__.Z)
978
+ /* harmony export */ });
979
+ /* harmony import */ var _ProductDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1644);
980
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductDetails__WEBPACK_IMPORTED_MODULE_0__]);
981
+ _ProductDetails__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
982
+
983
+ __webpack_async_result__();
984
+ } catch(e) { __webpack_async_result__(e); } });
985
+
986
+ /***/ }),
987
+
988
+ /***/ 5693:
989
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
990
+
991
+ "use strict";
992
+
993
+ // EXPORTS
994
+ __webpack_require__.d(__webpack_exports__, {
995
+ "Z": () => (/* reexport */ ui_ImageGallery_ImageGallery)
996
+ });
997
+
998
+ // EXTERNAL MODULE: external "react"
999
+ var external_react_ = __webpack_require__(6689);
1000
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1001
+ // EXTERNAL MODULE: external "react-intersection-observer"
1002
+ var external_react_intersection_observer_ = __webpack_require__(9785);
1003
+ // EXTERNAL MODULE: ../components/dist/molecules/IconButton/IconButton.js
1004
+ var IconButton = __webpack_require__(2765);
1005
+ // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
1006
+ var Icon = __webpack_require__(5045);
1007
+ // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
1008
+ var Button = __webpack_require__(7578);
1009
+ ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageGallerySelector.js
1010
+
1011
+
1012
+
1013
+ const SCROLL_MARGIN_VALUE = 400;
1014
+ const moveScroll = (container, value) => {
1015
+ if (container) {
1016
+ if (container.scrollHeight > container.clientHeight) {
1017
+ // TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
1018
+ container.style.overflow = 'auto';
1019
+ window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
1020
+ setTimeout(() => (container.style.overflow = 'hidden'), 2000);
1021
+ }
1022
+ else {
1023
+ container.scrollLeft += value;
1024
+ }
1025
+ }
1026
+ };
1027
+ const hasScroll = (container) => {
1028
+ if (container) {
1029
+ return (container.scrollHeight > container.clientHeight ||
1030
+ container.scrollWidth > container.clientWidth);
1031
+ }
1032
+ return false;
1033
+ };
1034
+ 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', }) {
1035
+ const elementsRef = (0,external_react_.useRef)(null);
1036
+ const elementHasScroll = hasScroll(elementsRef.current);
1037
+ const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
1038
+ const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
1039
+ const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
1040
+ idx === 0 && setFirstImageInView(inView);
1041
+ idx === images.length - 1 && setLastImageInView(inView);
1042
+ }, [images.length]);
1043
+ return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel, "aria-roledescription": "carousel" },
1044
+ elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
1045
+ 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) }))),
1046
+ external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
1047
+ return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
1048
+ 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' },
1049
+ external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
1050
+ })),
1051
+ elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
1052
+ 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) })))));
1053
+ }
1054
+ /* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
1055
+ //# sourceMappingURL=ImageGallerySelector.js.map
1056
+ ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageGallery.js
1057
+
1058
+
1059
+ const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
1060
+ const hasSelector = images.length > 1;
1061
+ return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-testid": testId, ...otherProps },
1062
+ children,
1063
+ hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
1064
+ });
1065
+ /* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
1066
+ //# sourceMappingURL=ImageGallery.js.map
1067
+ ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageZoom.js
1068
+
1069
+ const ImageZoom = ({ children }) => {
1070
+ return external_react_default().createElement((external_react_default()).Fragment, null, children);
1071
+ };
1072
+ /* harmony default export */ const ImageGallery_ImageZoom = (ImageZoom);
1073
+ //# sourceMappingURL=ImageZoom.js.map
1074
+ // EXTERNAL MODULE: external "next/router"
1075
+ var router_ = __webpack_require__(1853);
1076
+ // EXTERNAL MODULE: ./src/components/ui/Image/index.ts + 2 modules
1077
+ var Image = __webpack_require__(9266);
1078
+ // EXTERNAL MODULE: external "react/jsx-runtime"
1079
+ var jsx_runtime_ = __webpack_require__(997);
1080
+ ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
1081
+ const _excluded = ["images"];
1082
+
1083
+ 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; }
1084
+
1085
+ 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; }
1086
+
1087
+ 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; }
1088
+
1089
+ 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; }
1090
+
1091
+ 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; }
1092
+
1093
+
1094
+
1095
+
1096
+
1097
+
1098
+
1099
+ const ImageComponent = ({
1100
+ url,
1101
+ alternateName
1102
+ }) => /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, {
1103
+ src: url,
1104
+ alt: alternateName,
1105
+ width: 68,
1106
+ height: 68
1107
+ });
1108
+
1109
+ const ImageGallery_ImageGallery_ImageGallery = _ref => {
1110
+ let {
1111
+ images
1112
+ } = _ref,
1113
+ otherProps = _objectWithoutProperties(_ref, _excluded);
1114
+
1115
+ const {
1116
+ 0: selectedImageIdx,
1117
+ 1: setSelectedImageIdx
1118
+ } = (0,external_react_.useState)(0);
1119
+ const currentImage = images[selectedImageIdx] ?? images[0];
1120
+ const dynamicRoute = (0,router_.useRouter)().asPath;
1121
+ (0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
1122
+ return /*#__PURE__*/jsx_runtime_.jsx(ImageGallery_ImageGallery, _objectSpread(_objectSpread({
1123
+ images: images,
1124
+ ImageComponent: ImageComponent,
1125
+ selectedImageIdx: selectedImageIdx,
1126
+ setSelectedImageIdx: setSelectedImageIdx
1127
+ }, otherProps), {}, {
1128
+ children: /*#__PURE__*/jsx_runtime_.jsx(ImageGallery_ImageZoom, {
1129
+ children: /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, {
1130
+ src: currentImage.url,
1131
+ alt: currentImage.alternateName,
1132
+ sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
1133
+ width: 691,
1134
+ height: 691 * (3 / 4),
1135
+ loading: "eager"
1136
+ })
1137
+ })
1138
+ }));
1139
+ };
1140
+
1141
+ /* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
1142
+ ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/index.ts
1143
+
1144
+
1145
+ /***/ }),
1146
+
1147
+ /***/ 104:
1148
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1149
+
1150
+ "use strict";
1151
+
1152
+ // EXPORTS
1153
+ __webpack_require__.d(__webpack_exports__, {
1154
+ "Z": () => (/* reexport */ ShippingSimulation_ShippingSimulation_ShippingSimulation)
1155
+ });
1156
+
1157
+ // EXTERNAL MODULE: external "react"
1158
+ var external_react_ = __webpack_require__(6689);
1159
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1160
+ // EXTERNAL MODULE: ../components/dist/molecules/InputField/InputField.js
1161
+ var InputField = __webpack_require__(8287);
1162
+ // EXTERNAL MODULE: ../components/dist/atoms/Link/Link.js
1163
+ var Link = __webpack_require__(7865);
1164
+ // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
1165
+ var Icon = __webpack_require__(5045);
1166
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/Table.js
1167
+ var Table = __webpack_require__(4707);
1168
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableBody.js
1169
+ var TableBody = __webpack_require__(1566);
1170
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableRow.js
1171
+ var TableRow = __webpack_require__(6037);
1172
+ // EXTERNAL MODULE: ../components/dist/molecules/Table/TableCell.js
1173
+ var TableCell = __webpack_require__(3111);
1174
+ // EXTERNAL MODULE: ../components/dist/atoms/Price/Price.js
1175
+ var Price = __webpack_require__(7549);
1176
+ ;// CONCATENATED MODULE: ../components/dist/organisms/ShippingSimulation/ShippingSimulation.js
1177
+
1178
+
1179
+ 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 }) {
1180
+ const hasShippingOptions = !!options && options.length > 0;
1181
+ return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
1182
+ external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
1183
+ 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 }),
1184
+ 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,
1185
+ "I don't know my Postal Code",
1186
+ external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
1187
+ hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
1188
+ external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
1189
+ external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
1190
+ external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
1191
+ external_react_default().createElement(Table/* default */.Z, null,
1192
+ external_react_default().createElement(TableBody/* default */.Z, null, options.map((option) => (external_react_default().createElement(TableRow/* default */.Z, { key: option.carrier },
1193
+ external_react_default().createElement(TableCell/* default */.Z, { align: "left" }, option.carrier),
1194
+ external_react_default().createElement(TableCell/* default */.Z, null, option.localizedEstimates),
1195
+ external_react_default().createElement(TableCell/* default */.Z, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
1196
+ }
1197
+ /* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
1198
+ //# sourceMappingURL=ShippingSimulation.js.map
1199
+ // EXTERNAL MODULE: ./src/sdk/graphql/request.ts
1200
+ var request = __webpack_require__(180);
1201
+ ;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
1202
+
1203
+ const query = "ShippingSimulationQuery";
1204
+ const getShippingSimulation = async ({
1205
+ items,
1206
+ postalCode,
1207
+ country
1208
+ }) => {
1209
+ const data = await (0,request/* request */.W)(query, {
1210
+ items,
1211
+ postalCode,
1212
+ country
1213
+ });
1214
+ return data.shipping;
1215
+ };
1216
+ /* harmony default export */ const shipping = ((/* unused pure expression or super */ null && (getShippingSimulation)));
1217
+ // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
1218
+ var session = __webpack_require__(7295);
1219
+ ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/useShippingSimulation.ts
1220
+ 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; }
1221
+
1222
+ 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; }
1223
+
1224
+ 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; }
1225
+
1226
+
1227
+
1228
+ const createEmptySimulation = () => ({
1229
+ input: {
1230
+ postalCode: '',
1231
+ displayClearButton: false,
1232
+ errorMessage: ''
1233
+ },
1234
+ shippingSimulation: {
1235
+ location: '',
1236
+ options: []
1237
+ }
1238
+ });
1239
+
1240
+ const reducer = (state, action) => {
1241
+ const {
1242
+ type
1243
+ } = action;
1244
+
1245
+ switch (type) {
1246
+ case 'clear':
1247
+ {
1248
+ return createEmptySimulation();
1249
+ }
1250
+
1251
+ case 'update':
1252
+ {
1253
+ const {
1254
+ payload
1255
+ } = action;
1256
+ return {
1257
+ input: _objectSpread(_objectSpread({}, state.input), payload.input),
1258
+ shippingSimulation: _objectSpread(_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
1259
+ };
1260
+ }
1261
+
1262
+ case 'onInput':
1263
+ {
1264
+ const {
1265
+ payload
1266
+ } = action;
1267
+ return _objectSpread(_objectSpread({}, state), {}, {
1268
+ input: _objectSpread({}, payload)
1269
+ });
1270
+ }
1271
+
1272
+ case 'onError':
1273
+ {
1274
+ const {
1275
+ payload
1276
+ } = action;
1277
+ return _objectSpread(_objectSpread({}, state), {}, {
1278
+ input: _objectSpread(_objectSpread({}, state.input), payload)
1279
+ });
1280
+ }
1281
+
1282
+ default:
1283
+ throw new Error(`Action ${type} not implemented`);
1284
+ }
1285
+ };
1286
+
1287
+ const useShippingSimulation = (shippingItem, fetchShippingSimulationFn, sessionPostalCode, country) => {
1288
+ const {
1289
+ 0: {
1290
+ input,
1291
+ shippingSimulation
1292
+ },
1293
+ 1: dispatch
1294
+ } = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
1295
+ const {
1296
+ postalCode: shippingPostalCode
1297
+ } = input;
1298
+ (0,external_react_.useEffect)(() => {
1299
+ if (!sessionPostalCode || shippingPostalCode) {
1300
+ return;
1301
+ } // Use sessionPostalCode if there is no shippingPostalCode
1302
+
1303
+
1304
+ async function fetchShipping() {
1305
+ const [location, options] = await fetchShippingSimulationFn(shippingItem, country, sessionPostalCode ?? '');
1306
+ dispatch({
1307
+ type: 'update',
1308
+ payload: {
1309
+ input: {
1310
+ postalCode: sessionPostalCode ?? '',
1311
+ displayClearButton: true,
1312
+ errorMessage: ''
1313
+ },
1314
+ shippingSimulation: {
1315
+ location,
1316
+ options
1317
+ }
1318
+ }
1319
+ });
1320
+ }
1321
+
1322
+ fetchShipping();
1323
+ }, [country, fetchShippingSimulationFn, sessionPostalCode, shippingItem, shippingPostalCode]);
1324
+ const handleSubmit = (0,external_react_.useCallback)(async () => {
1325
+ try {
1326
+ const [location, options] = await fetchShippingSimulationFn(shippingItem, country, shippingPostalCode ?? '');
1327
+ dispatch({
1328
+ type: 'update',
1329
+ payload: {
1330
+ input: {
1331
+ displayClearButton: true,
1332
+ errorMessage: ''
1333
+ },
1334
+ shippingSimulation: {
1335
+ location,
1336
+ options
1337
+ }
1338
+ }
1339
+ });
1340
+ } catch (error) {
1341
+ dispatch({
1342
+ type: 'onError',
1343
+ payload: {
1344
+ displayClearButton: true,
1345
+ errorMessage: 'You entered an invalid Postal Code'
1346
+ }
1347
+ });
1348
+ }
1349
+ }, [country, fetchShippingSimulationFn, shippingItem, shippingPostalCode]);
1350
+ const handleOnInput = (0,external_react_.useCallback)(e => {
1351
+ const currentValue = e.currentTarget.value;
1352
+
1353
+ if (currentValue) {
1354
+ dispatch({
1355
+ type: 'onInput',
1356
+ payload: {
1357
+ postalCode: currentValue,
1358
+ displayClearButton: false,
1359
+ errorMessage: ''
1360
+ }
1361
+ });
1362
+ } else {
1363
+ dispatch({
1364
+ type: 'clear'
1365
+ });
1366
+ }
1367
+ }, []);
1368
+ return {
1369
+ input,
1370
+ shippingSimulation,
1371
+ handleOnClear: () => {
1372
+ dispatch({
1373
+ type: 'clear'
1374
+ });
1375
+ },
1376
+ handleSubmit,
1377
+ handleOnInput
1378
+ };
1379
+ };
1380
+ // EXTERNAL MODULE: external "react/jsx-runtime"
1381
+ var jsx_runtime_ = __webpack_require__(997);
1382
+ ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
1383
+ const _excluded = ["productShippingInfo", "formatter"];
1384
+
1385
+ 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; }
1386
+
1387
+ 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; }
1388
+
1389
+ 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; }
1390
+
1391
+ 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; }
1392
+
1393
+ 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; }
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+ const fetchShippingSimulation = async (shippingItem, country, postalCode) => {
1402
+ const shipping = await getShippingSimulation({
1403
+ country,
1404
+ postalCode: postalCode,
1405
+ items: [shippingItem]
1406
+ });
1407
+ const location = [shipping?.address?.neighborhood, shipping?.address?.city].filter(Boolean).join(' / ') ?? '';
1408
+ const options = shipping?.logisticsInfo?.[0]?.slas ?? [];
1409
+ return [location, options];
1410
+ };
1411
+
1412
+ function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
1413
+ let {
1414
+ productShippingInfo,
1415
+ formatter
1416
+ } = _ref,
1417
+ otherProps = _objectWithoutProperties(_ref, _excluded);
1418
+
1419
+ const {
1420
+ country,
1421
+ postalCode: sessionPostalCode
1422
+ } = (0,session/* useSession */.kP)();
1423
+ const {
1424
+ input,
1425
+ shippingSimulation,
1426
+ handleSubmit,
1427
+ handleOnInput,
1428
+ handleOnClear
1429
+ } = useShippingSimulation(productShippingInfo, fetchShippingSimulation, sessionPostalCode, country);
1430
+ const {
1431
+ postalCode,
1432
+ displayClearButton,
1433
+ errorMessage
1434
+ } = input;
1435
+ const {
1436
+ location,
1437
+ options
1438
+ } = shippingSimulation;
1439
+ return /*#__PURE__*/jsx_runtime_.jsx(ShippingSimulation_ShippingSimulation, ShippingSimulation_objectSpread({
1440
+ formatter: formatter,
1441
+ onInput: handleOnInput,
1442
+ onSubmit: handleSubmit,
1443
+ onClear: handleOnClear,
1444
+ location: location,
1445
+ options: options,
1446
+ displayClearButton: displayClearButton,
1447
+ errorMessage: errorMessage,
1448
+ postalCode: postalCode
1449
+ }, otherProps));
1450
+ }
1451
+ ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/index.ts
1452
+
1453
+
1454
+ /***/ }),
1455
+
1456
+ /***/ 4475:
1457
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1458
+
1459
+ "use strict";
1460
+
1461
+ // EXPORTS
1462
+ __webpack_require__.d(__webpack_exports__, {
1463
+ "Z": () => (/* reexport */ SkuSelector_Selectors)
1464
+ });
1465
+
1466
+ // EXTERNAL MODULE: external "react"
1467
+ var external_react_ = __webpack_require__(6689);
1468
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1469
+ // EXTERNAL MODULE: ../components/dist/atoms/Label/Label.js
1470
+ var Label = __webpack_require__(7216);
1471
+ // EXTERNAL MODULE: ../components/dist/atoms/Link/Link.js
1472
+ var Link = __webpack_require__(7865);
1473
+ // EXTERNAL MODULE: ../components/dist/atoms/SROnly/SROnly.js
1474
+ var SROnly = __webpack_require__(2691);
1475
+ ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/useDefineVariant.js
1476
+
1477
+ const getImageName = (src) => {
1478
+ const sourcePath = new URL(src).pathname;
1479
+ const imageName = sourcePath.split('/').slice(-1)[0];
1480
+ return imageName;
1481
+ };
1482
+ const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
1483
+ if (variant)
1484
+ return variant;
1485
+ const allOptionsHaveHexColor = options.every((option) => option.hexColor);
1486
+ if (allOptionsHaveHexColor) {
1487
+ return 'color';
1488
+ }
1489
+ const firstImageName = options[0]?.src && getImageName(options[0].src);
1490
+ const areSourcesEqualsOrNull = options.every((option) => {
1491
+ if (!option.src) {
1492
+ return true;
1493
+ }
1494
+ const optionImageName = getImageName(option.src);
1495
+ return optionImageName === firstImageName;
1496
+ });
1497
+ if (!areSourcesEqualsOrNull) {
1498
+ return 'image';
1499
+ }
1500
+ return 'label';
1501
+ }, [options, variant]);
1502
+ //# sourceMappingURL=useDefineVariant.js.map
1503
+ ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/useSkuSlug.js
1504
+
1505
+ function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
1506
+ const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
1507
+ if (slugsMapKey in slugsMap) {
1508
+ return slugsMap[slugsMapKey];
1509
+ }
1510
+ const possibleVariants = Object.keys(slugsMap);
1511
+ const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
1512
+ return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
1513
+ }
1514
+ const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
1515
+ const getItemHref = (0,external_react_.useCallback)((option) => {
1516
+ if (getItemHrefProp)
1517
+ return { getItemHrefProp };
1518
+ const currentItemHref = `/${getSkuSlug(slugsMap, {
1519
+ ...activeVariations,
1520
+ [skuPropertyName]: option.value,
1521
+ }, skuPropertyName)}/p`;
1522
+ return currentItemHref;
1523
+ }, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
1524
+ return { getItemHref };
1525
+ };
1526
+ //# sourceMappingURL=useSkuSlug.js.map
1527
+ ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/SkuSelector.js
1528
+
1529
+
1530
+
1531
+
1532
+ // TODO: Change by ImageComponent when it be right
1533
+ const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
1534
+ const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
1535
+ const activeSelectorValue = activeVariations[skuPropertyName];
1536
+ const options = availableVariations[skuPropertyName];
1537
+ const variant = useDefineVariant(options, variantProp);
1538
+ const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
1539
+ return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
1540
+ skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
1541
+ skuPropertyName,
1542
+ ": ",
1543
+ external_react_default().createElement("strong", null, activeSelectorValue))),
1544
+ external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
1545
+ 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] },
1546
+ external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
1547
+ external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
1548
+ variant === 'label' && external_react_default().createElement("span", null, option.value),
1549
+ variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
1550
+ external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
1551
+ variant === 'color' && (external_react_default().createElement("span", null,
1552
+ external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
1553
+ '--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
1554
+ } })))));
1555
+ }))));
1556
+ });
1557
+ /* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
1558
+ //# sourceMappingURL=SkuSelector.js.map
1559
+ // EXTERNAL MODULE: ./node_modules/next/link.js
1560
+ var next_link = __webpack_require__(1664);
1561
+ var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
1562
+ // EXTERNAL MODULE: ./src/components/ui/Image/index.ts + 2 modules
1563
+ var Image = __webpack_require__(9266);
1564
+ // EXTERNAL MODULE: external "react/jsx-runtime"
1565
+ var jsx_runtime_ = __webpack_require__(997);
1566
+ ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
1567
+ const _excluded = ["src", "alt"],
1568
+ _excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
1569
+
1570
+ 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; }
1571
+
1572
+ 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; }
1573
+
1574
+ 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; }
1575
+
1576
+ 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; }
1577
+
1578
+ 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; }
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+ const ImageComponent = _ref => {
1586
+ let {
1587
+ src,
1588
+ alt
1589
+ } = _ref,
1590
+ otherProps = _objectWithoutProperties(_ref, _excluded);
1591
+
1592
+ return /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, _objectSpread({
1593
+ src: src,
1594
+ alt: alt,
1595
+ width: 34,
1596
+ height: 34
1597
+ }, otherProps));
1598
+ };
1599
+
1600
+ function Selectors(_ref2) {
1601
+ let {
1602
+ slugsMap,
1603
+ activeVariations,
1604
+ availableVariations
1605
+ } = _ref2,
1606
+ otherProps = _objectWithoutProperties(_ref2, _excluded2);
1607
+
1608
+ return /*#__PURE__*/jsx_runtime_.jsx("section", _objectSpread(_objectSpread({}, otherProps), {}, {
1609
+ children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_SkuSelector, {
1610
+ skuPropertyName: skuVariant,
1611
+ availableVariations: availableVariations,
1612
+ ImageComponent: ImageComponent,
1613
+ activeVariations: activeVariations,
1614
+ slugsMap: slugsMap,
1615
+ linkProps: {
1616
+ as: (link_default()),
1617
+ legacyBehavior: false
1618
+ }
1619
+ }, skuVariant))
1620
+ }));
1621
+ }
1622
+
1623
+ /* harmony default export */ const SkuSelector_Selectors = (Selectors);
1624
+ ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/index.ts
1625
+
1626
+
1627
+ /***/ }),
1628
+
1629
+ /***/ 4601:
1630
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
1631
+
1632
+ "use strict";
1633
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1634
+ __webpack_require__.r(__webpack_exports__);
1635
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1636
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1637
+ /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
1638
+ /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
1639
+ /* harmony export */ });
1640
+ /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4826);
1641
+ /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6641);
1642
+ /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_1__);
1643
+ /* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2224);
1644
+ /* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2951);
1645
+ /* harmony import */ var src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2874);
1646
+ /* harmony import */ var src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7990);
1647
+ /* harmony import */ var src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3220);
1648
+ /* harmony import */ var src_customizations_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(859);
1649
+ /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7295);
1650
+ /* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2541);
1651
+ /* harmony import */ var src_server__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(9685);
1652
+ /* harmony import */ var src_server_cms__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5764);
1653
+ /* harmony import */ var src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4074);
1654
+ /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7183);
1655
+ /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_13__);
1656
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(997);
1657
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
1658
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__, src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__, src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__, src_server__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__]);
1659
+ ([src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__, src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__, src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__, src_server__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1660
+ 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; }
1661
+
1662
+ 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; }
1663
+
1664
+ 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; }
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+
1680
+ /**
1681
+ * Sections: Components imported from each store's custom components and '../components/sections' only.
1682
+ * Do not import or render components from any other folder in here.
1683
+ */
1684
+
1685
+
1686
+
1687
+
1688
+ const COMPONENTS = _objectSpread({
1689
+ Breadcrumb: src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
1690
+ ProductDetails: src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
1691
+ CrossSellingShelf: src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
1692
+ BannerNewsletter: src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
1693
+ }, src_customizations_components__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
1694
+
1695
+ function Page({
1696
+ product,
1697
+ sections,
1698
+ globalSections
1699
+ }) {
1700
+ const {
1701
+ currency
1702
+ } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_8__/* .useSession */ .kP)();
1703
+ const {
1704
+ seo
1705
+ } = product;
1706
+ const title = seo.title || (_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().seo.title);
1707
+ const description = seo.description || (_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().seo.description);
1708
+ const canonical = `${(_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().storeUrl)}${seo.canonical}`;
1709
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, _objectSpread(_objectSpread({}, globalSections), {}, {
1710
+ children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.NextSeo, {
1711
+ title: title,
1712
+ description: description,
1713
+ canonical: canonical,
1714
+ openGraph: {
1715
+ type: 'og:product',
1716
+ url: canonical,
1717
+ title,
1718
+ description,
1719
+ images: product.image.map(img => ({
1720
+ url: img.url,
1721
+ alt: img.alternateName
1722
+ }))
1723
+ },
1724
+ additionalMetaTags: [{
1725
+ property: 'product:price:amount',
1726
+ content: product.offers.lowPrice?.toString() ?? undefined
1727
+ }, {
1728
+ property: 'product:price:currency',
1729
+ content: currency.code
1730
+ }]
1731
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.BreadcrumbJsonLd, {
1732
+ itemListElements: product.breadcrumbList.itemListElement
1733
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.ProductJsonLd, {
1734
+ productName: product.name,
1735
+ description: product.description,
1736
+ brand: product.brand.name,
1737
+ sku: product.sku,
1738
+ gtin: product.gtin,
1739
+ releaseDate: product.releaseDate,
1740
+ images: product.image.map(img => img.url) // Somehow, Google does not understand this valid Schema.org schema, so we need to do conversions
1741
+ ,
1742
+ offersType: "AggregateOffer",
1743
+ offers: _objectSpread(_objectSpread(_objectSpread({}, product.offers), product.offers.offers[0]), {}, {
1744
+ url: canonical
1745
+ })
1746
+ }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
1747
+ context: product,
1748
+ sections: sections,
1749
+ components: COMPONENTS
1750
+ })]
1751
+ }));
1752
+ }
1753
+
1754
+ const query = "ServerProductPageQuery";
1755
+ const getStaticProps = async ({
1756
+ params,
1757
+ previewData
1758
+ }) => {
1759
+ const slug = params?.slug ?? '';
1760
+ const [searchResult, cmsPage, globalSections] = await Promise.all([(0,src_server__WEBPACK_IMPORTED_MODULE_10__/* .execute */ .h)({
1761
+ variables: {
1762
+ slug
1763
+ },
1764
+ operationName: query
1765
+ }), (0,src_server_cms__WEBPACK_IMPORTED_MODULE_11__/* .getPage */ .f)(_objectSpread(_objectSpread({}, previewData?.contentType === 'pdp' ? previewData : null), {}, {
1766
+ contentType: 'pdp'
1767
+ })), (0,src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* .getGlobalSectionsData */ .Tc)(previewData)]);
1768
+ const {
1769
+ data,
1770
+ errors = []
1771
+ } = searchResult;
1772
+ const notFound = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError);
1773
+
1774
+ if (notFound) {
1775
+ return {
1776
+ notFound: true
1777
+ };
1778
+ }
1779
+
1780
+ if (errors.length > 0) {
1781
+ throw errors[0];
1782
+ }
1783
+
1784
+ return {
1785
+ props: _objectSpread(_objectSpread(_objectSpread({}, data), cmsPage), {}, {
1786
+ globalSections
1787
+ })
1788
+ };
1789
+ };
1790
+ const getStaticPaths = async () => {
1791
+ return {
1792
+ paths: [],
1793
+ fallback: 'blocking'
1794
+ };
1795
+ };
1796
+ Page.displayName = 'Page';
1797
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_9__/* .mark */ .B)(Page));
1798
+ __webpack_async_result__();
1799
+ } catch(e) { __webpack_async_result__(e); } });
1800
+
1801
+ /***/ }),
1802
+
1803
+ /***/ 8892:
1804
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1805
+
1806
+ "use strict";
1807
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1808
+ /* harmony export */ "Q": () => (/* binding */ useBuyButton)
1809
+ /* harmony export */ });
1810
+ /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1072);
1811
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1812
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1813
+ /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
1814
+ /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(395);
1815
+ /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6073);
1816
+
1817
+
1818
+
1819
+
1820
+
1821
+ const useBuyButton = item => {
1822
+ const {
1823
+ openCart
1824
+ } = (0,_faststore_ui__WEBPACK_IMPORTED_MODULE_3__/* .useUI */ .l)();
1825
+ const {
1826
+ currency: {
1827
+ code
1828
+ }
1829
+ } = (0,_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
1830
+ const onClick = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(e => {
1831
+ e.preventDefault();
1832
+
1833
+ if (!item) {
1834
+ return;
1835
+ }
1836
+
1837
+ (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_4__/* .sendAnalyticsEvent */ ._)({
1838
+ name: 'add_to_cart',
1839
+ params: {
1840
+ currency: code,
1841
+ // TODO: In the future, we can explore more robust ways of
1842
+ // calculating the value (gift items, discounts, etc.).
1843
+ value: item.price * item.quantity,
1844
+ items: [{
1845
+ item_id: item.itemOffered.isVariantOf.productGroupID,
1846
+ item_name: item.itemOffered.isVariantOf.name,
1847
+ item_brand: item.itemOffered.brand.name,
1848
+ item_variant: item.itemOffered.sku,
1849
+ quantity: item.quantity,
1850
+ price: item.price,
1851
+ discount: item.listPrice - item.price,
1852
+ currency: code,
1853
+ item_variant_name: item.itemOffered.name,
1854
+ product_reference_id: item.itemOffered.gtin
1855
+ }]
1856
+ }
1857
+ });
1858
+ _index__WEBPACK_IMPORTED_MODULE_2__/* .cartStore.addItem */ .i8.addItem(item);
1859
+ openCart();
1860
+ }, [code, item, openCart]);
1861
+ return {
1862
+ onClick,
1863
+ 'data-testid': 'buy-button',
1864
+ 'data-sku': item?.itemOffered.sku,
1865
+ 'data-seller': item?.seller.identifier
1866
+ };
1867
+ };
1868
+
1869
+ /***/ }),
1870
+
1871
+ /***/ 3874:
1872
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
1873
+
1874
+ "use strict";
1875
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1876
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1877
+ /* harmony export */ "i": () => (/* binding */ useProduct)
1878
+ /* harmony export */ });
1879
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1880
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1881
+ /* harmony import */ var _graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7732);
1882
+ /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7295);
1883
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__]);
1884
+ _graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1885
+
1886
+
1887
+
1888
+ const query = "BrowserProductQuery";
1889
+ const useProduct = (productID, fallbackData) => {
1890
+ const {
1891
+ channel,
1892
+ locale
1893
+ } = (0,_session__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .kP)();
1894
+ const variables = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1895
+ if (!channel) {
1896
+ throw new Error(`useProduct: 'channel' from session is an empty string.`);
1897
+ }
1898
+
1899
+ return {
1900
+ locator: [{
1901
+ key: 'id',
1902
+ value: productID
1903
+ }, {
1904
+ key: 'channel',
1905
+ value: channel
1906
+ }, {
1907
+ key: 'locale',
1908
+ value: locale
1909
+ }]
1910
+ };
1911
+ }, [channel, locale, productID]);
1912
+ return (0,_graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__/* .useQuery */ .aM)(query, variables, {
1913
+ fallbackData,
1914
+ revalidateOnMount: true
1915
+ });
1916
+ };
1917
+ __webpack_async_result__();
1918
+ } catch(e) { __webpack_async_result__(e); } });
1919
+
1920
+ /***/ }),
1921
+
1922
+ /***/ 5411:
1923
+ /***/ ((module) => {
1924
+
1925
+ // Exports
1926
+ module.exports = {
1927
+ "section": "section_section__pVnFl"
1928
+ };
1929
+
1930
+
1931
+ /***/ }),
1932
+
1933
+ /***/ 9034:
1934
+ /***/ ((module) => {
1935
+
1936
+ // Exports
1937
+ module.exports = {
1938
+ "section": "section_section__XsOoR"
1939
+ };
1940
+
1941
+
1942
+ /***/ }),
1943
+
1944
+ /***/ 5490:
1945
+ /***/ ((module) => {
1946
+
1947
+ "use strict";
1948
+ module.exports = require("@faststore/graphql-utils");
1949
+
1950
+ /***/ }),
1951
+
1952
+ /***/ 6676:
1953
+ /***/ ((module) => {
1954
+
1955
+ "use strict";
1956
+ module.exports = require("@vtex/client-cms");
1957
+
1958
+ /***/ }),
1959
+
1960
+ /***/ 2404:
1961
+ /***/ ((module) => {
1962
+
1963
+ "use strict";
1964
+ module.exports = require("fast-deep-equal");
1965
+
1966
+ /***/ }),
1967
+
1968
+ /***/ 7343:
1969
+ /***/ ((module) => {
1970
+
1971
+ "use strict";
1972
+ module.exports = require("graphql");
1973
+
1974
+ /***/ }),
1975
+
1976
+ /***/ 6548:
1977
+ /***/ ((module) => {
1978
+
1979
+ "use strict";
1980
+ module.exports = require("graphql/language");
1981
+
1982
+ /***/ }),
1983
+
1984
+ /***/ 3430:
1985
+ /***/ ((module) => {
1986
+
1987
+ "use strict";
1988
+ module.exports = require("idb-keyval");
1989
+
1990
+ /***/ }),
1991
+
1992
+ /***/ 7881:
1993
+ /***/ ((module) => {
1994
+
1995
+ "use strict";
1996
+ module.exports = require("isomorphic-unfetch");
1997
+
1998
+ /***/ }),
1999
+
2000
+ /***/ 6641:
2001
+ /***/ ((module) => {
2002
+
2003
+ "use strict";
2004
+ module.exports = require("next-seo");
2005
+
2006
+ /***/ }),
2007
+
2008
+ /***/ 3280:
2009
+ /***/ ((module) => {
2010
+
2011
+ "use strict";
2012
+ module.exports = require("next/dist/shared/lib/app-router-context.js");
2013
+
2014
+ /***/ }),
2015
+
2016
+ /***/ 2796:
2017
+ /***/ ((module) => {
2018
+
2019
+ "use strict";
2020
+ module.exports = require("next/dist/shared/lib/head-manager-context.js");
2021
+
2022
+ /***/ }),
2023
+
2024
+ /***/ 4957:
2025
+ /***/ ((module) => {
2026
+
2027
+ "use strict";
2028
+ module.exports = require("next/dist/shared/lib/head.js");
2029
+
2030
+ /***/ }),
2031
+
2032
+ /***/ 3539:
2033
+ /***/ ((module) => {
2034
+
2035
+ "use strict";
2036
+ module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
2037
+
2038
+ /***/ }),
2039
+
2040
+ /***/ 4014:
2041
+ /***/ ((module) => {
2042
+
2043
+ "use strict";
2044
+ module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
2045
+
2046
+ /***/ }),
2047
+
2048
+ /***/ 4486:
2049
+ /***/ ((module) => {
2050
+
2051
+ "use strict";
2052
+ module.exports = require("next/dist/shared/lib/image-blur-svg.js");
2053
+
2054
+ /***/ }),
2055
+
2056
+ /***/ 744:
2057
+ /***/ ((module) => {
2058
+
2059
+ "use strict";
2060
+ module.exports = require("next/dist/shared/lib/image-config-context.js");
2061
+
2062
+ /***/ }),
2063
+
2064
+ /***/ 5843:
2065
+ /***/ ((module) => {
2066
+
2067
+ "use strict";
2068
+ module.exports = require("next/dist/shared/lib/image-config.js");
2069
+
2070
+ /***/ }),
2071
+
2072
+ /***/ 8524:
2073
+ /***/ ((module) => {
2074
+
2075
+ "use strict";
2076
+ module.exports = require("next/dist/shared/lib/is-plain-object.js");
2077
+
2078
+ /***/ }),
2079
+
2080
+ /***/ 8020:
2081
+ /***/ ((module) => {
2082
+
2083
+ "use strict";
2084
+ module.exports = require("next/dist/shared/lib/mitt.js");
2085
+
2086
+ /***/ }),
2087
+
2088
+ /***/ 4406:
2089
+ /***/ ((module) => {
2090
+
2091
+ "use strict";
2092
+ module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
2093
+
2094
+ /***/ }),
2095
+
2096
+ /***/ 4964:
2097
+ /***/ ((module) => {
2098
+
2099
+ "use strict";
2100
+ module.exports = require("next/dist/shared/lib/router-context.js");
2101
+
2102
+ /***/ }),
2103
+
2104
+ /***/ 3431:
2105
+ /***/ ((module) => {
2106
+
2107
+ "use strict";
2108
+ module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
2109
+
2110
+ /***/ }),
2111
+
2112
+ /***/ 1751:
2113
+ /***/ ((module) => {
2114
+
2115
+ "use strict";
2116
+ module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
2117
+
2118
+ /***/ }),
2119
+
2120
+ /***/ 6220:
2121
+ /***/ ((module) => {
2122
+
2123
+ "use strict";
2124
+ module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
2125
+
2126
+ /***/ }),
2127
+
2128
+ /***/ 299:
2129
+ /***/ ((module) => {
2130
+
2131
+ "use strict";
2132
+ module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
2133
+
2134
+ /***/ }),
2135
+
2136
+ /***/ 3938:
2137
+ /***/ ((module) => {
2138
+
2139
+ "use strict";
2140
+ module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
2141
+
2142
+ /***/ }),
2143
+
2144
+ /***/ 9565:
2145
+ /***/ ((module) => {
2146
+
2147
+ "use strict";
2148
+ module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
2149
+
2150
+ /***/ }),
2151
+
2152
+ /***/ 5789:
2153
+ /***/ ((module) => {
2154
+
2155
+ "use strict";
2156
+ module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
2157
+
2158
+ /***/ }),
2159
+
2160
+ /***/ 1897:
2161
+ /***/ ((module) => {
2162
+
2163
+ "use strict";
2164
+ module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
2165
+
2166
+ /***/ }),
2167
+
2168
+ /***/ 1428:
2169
+ /***/ ((module) => {
2170
+
2171
+ "use strict";
2172
+ module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
2173
+
2174
+ /***/ }),
2175
+
2176
+ /***/ 8854:
2177
+ /***/ ((module) => {
2178
+
2179
+ "use strict";
2180
+ module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
2181
+
2182
+ /***/ }),
2183
+
2184
+ /***/ 1292:
2185
+ /***/ ((module) => {
2186
+
2187
+ "use strict";
2188
+ module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
2189
+
2190
+ /***/ }),
2191
+
2192
+ /***/ 4567:
2193
+ /***/ ((module) => {
2194
+
2195
+ "use strict";
2196
+ module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
2197
+
2198
+ /***/ }),
2199
+
2200
+ /***/ 979:
2201
+ /***/ ((module) => {
2202
+
2203
+ "use strict";
2204
+ module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
2205
+
2206
+ /***/ }),
2207
+
2208
+ /***/ 3297:
2209
+ /***/ ((module) => {
2210
+
2211
+ "use strict";
2212
+ module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
2213
+
2214
+ /***/ }),
2215
+
2216
+ /***/ 6052:
2217
+ /***/ ((module) => {
2218
+
2219
+ "use strict";
2220
+ module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
2221
+
2222
+ /***/ }),
2223
+
2224
+ /***/ 4226:
2225
+ /***/ ((module) => {
2226
+
2227
+ "use strict";
2228
+ module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
2229
+
2230
+ /***/ }),
2231
+
2232
+ /***/ 5052:
2233
+ /***/ ((module) => {
2234
+
2235
+ "use strict";
2236
+ module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
2237
+
2238
+ /***/ }),
2239
+
2240
+ /***/ 9232:
2241
+ /***/ ((module) => {
2242
+
2243
+ "use strict";
2244
+ module.exports = require("next/dist/shared/lib/utils.js");
2245
+
2246
+ /***/ }),
2247
+
2248
+ /***/ 1853:
2249
+ /***/ ((module) => {
2250
+
2251
+ "use strict";
2252
+ module.exports = require("next/router");
2253
+
2254
+ /***/ }),
2255
+
2256
+ /***/ 5471:
2257
+ /***/ ((module) => {
2258
+
2259
+ "use strict";
2260
+ module.exports = require("p-limit");
2261
+
2262
+ /***/ }),
2263
+
2264
+ /***/ 6689:
2265
+ /***/ ((module) => {
2266
+
2267
+ "use strict";
2268
+ module.exports = require("react");
2269
+
2270
+ /***/ }),
2271
+
2272
+ /***/ 6405:
2273
+ /***/ ((module) => {
2274
+
2275
+ "use strict";
2276
+ module.exports = require("react-dom");
2277
+
2278
+ /***/ }),
2279
+
2280
+ /***/ 9785:
2281
+ /***/ ((module) => {
2282
+
2283
+ "use strict";
2284
+ module.exports = require("react-intersection-observer");
2285
+
2286
+ /***/ }),
2287
+
2288
+ /***/ 3789:
2289
+ /***/ ((module) => {
2290
+
2291
+ "use strict";
2292
+ module.exports = require("react-swipeable");
2293
+
2294
+ /***/ }),
2295
+
2296
+ /***/ 997:
2297
+ /***/ ((module) => {
2298
+
2299
+ "use strict";
2300
+ module.exports = require("react/jsx-runtime");
2301
+
2302
+ /***/ }),
2303
+
2304
+ /***/ 3823:
2305
+ /***/ ((module) => {
2306
+
2307
+ "use strict";
2308
+ module.exports = require("tabbable");
2309
+
2310
+ /***/ }),
2311
+
2312
+ /***/ 752:
2313
+ /***/ ((module) => {
2314
+
2315
+ "use strict";
2316
+ module.exports = require("tslib");
2317
+
2318
+ /***/ }),
2319
+
2320
+ /***/ 9664:
2321
+ /***/ ((module) => {
2322
+
2323
+ "use strict";
2324
+ module.exports = import("@envelop/core");;
2325
+
2326
+ /***/ }),
2327
+
2328
+ /***/ 7886:
2329
+ /***/ ((module) => {
2330
+
2331
+ "use strict";
2332
+ module.exports = import("@envelop/graphql-jit");;
2333
+
2334
+ /***/ }),
2335
+
2336
+ /***/ 4656:
2337
+ /***/ ((module) => {
2338
+
2339
+ "use strict";
2340
+ module.exports = import("@envelop/parser-cache");;
2341
+
2342
+ /***/ }),
2343
+
2344
+ /***/ 6093:
2345
+ /***/ ((module) => {
2346
+
2347
+ "use strict";
2348
+ module.exports = import("@envelop/validation-cache");;
2349
+
2350
+ /***/ }),
2351
+
2352
+ /***/ 7564:
2353
+ /***/ ((module) => {
2354
+
2355
+ "use strict";
2356
+ module.exports = import("chalk");;
2357
+
2358
+ /***/ }),
2359
+
2360
+ /***/ 5941:
2361
+ /***/ ((module) => {
2362
+
2363
+ "use strict";
2364
+ module.exports = import("swr");;
2365
+
2366
+ /***/ }),
2367
+
2368
+ /***/ 6113:
2369
+ /***/ ((module) => {
2370
+
2371
+ "use strict";
2372
+ module.exports = require("crypto");
2373
+
2374
+ /***/ })
2375
+
2376
+ };
2377
+ ;
2378
+
2379
+ // load runtime
2380
+ var __webpack_require__ = require("../../webpack-runtime.js");
2381
+ __webpack_require__.C(exports);
2382
+ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
2383
+ var __webpack_exports__ = __webpack_require__.X(0, [608,676,664,401,336,183,644,886,74,247,287,854,280,368,104,874,350,82,123], () => (__webpack_exec__(4601)));
2384
+ module.exports = __webpack_exports__;
2385
+
2386
+ })();