@faststore/core 2.0.125-alpha.0 → 2.0.129-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 (165) hide show
  1. package/.turbo/turbo-build.log +9 -21
  2. package/CHANGELOG.md +12 -0
  3. package/package.json +4 -4
  4. package/src/components/cms/GlobalSections.tsx +1 -2
  5. package/src/components/cms/RenderSections.tsx +1 -1
  6. package/src/components/sections/ProductShelf/ProductShelf.tsx +11 -14
  7. package/src/components/sections/ProductShelf/section.module.scss +20 -0
  8. package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +2 -2
  9. package/src/components/ui/Carousel/Carousel.tsx +2 -9
  10. package/.next/BUILD_ID +0 -1
  11. package/.next/build-manifest.json +0 -120
  12. package/.next/cache/.tsbuildinfo +0 -1
  13. package/.next/cache/config.json +0 -7
  14. package/.next/cache/eslint/.cache_1gneedd +0 -1
  15. package/.next/cache/next-server.js.nft.json +0 -1
  16. package/.next/cache/webpack/client-production/0.pack +0 -0
  17. package/.next/cache/webpack/client-production/index.pack +0 -0
  18. package/.next/cache/webpack/server-production/0.pack +0 -0
  19. package/.next/cache/webpack/server-production/index.pack +0 -0
  20. package/.next/export-marker.json +0 -1
  21. package/.next/images-manifest.json +0 -1
  22. package/.next/next-server.js.nft.json +0 -1
  23. package/.next/package.json +0 -1
  24. package/.next/prerender-manifest.json +0 -1
  25. package/.next/react-loadable-manifest.json +0 -52
  26. package/.next/required-server-files.json +0 -1
  27. package/.next/routes-manifest.json +0 -1
  28. package/.next/server/chunks/104.js +0 -295
  29. package/.next/server/chunks/120.js +0 -435
  30. package/.next/server/chunks/123.js +0 -58
  31. package/.next/server/chunks/143.js +0 -106
  32. package/.next/server/chunks/154.js +0 -206
  33. package/.next/server/chunks/183.js +0 -80
  34. package/.next/server/chunks/247.js +0 -61
  35. package/.next/server/chunks/254.js +0 -159
  36. package/.next/server/chunks/256.js +0 -1787
  37. package/.next/server/chunks/280.js +0 -322
  38. package/.next/server/chunks/287.js +0 -58
  39. package/.next/server/chunks/312.js +0 -674
  40. package/.next/server/chunks/336.js +0 -820
  41. package/.next/server/chunks/350.js +0 -142
  42. package/.next/server/chunks/398.js +0 -132
  43. package/.next/server/chunks/401.js +0 -7241
  44. package/.next/server/chunks/431.js +0 -7241
  45. package/.next/server/chunks/502.js +0 -603
  46. package/.next/server/chunks/554.js +0 -264
  47. package/.next/server/chunks/557.js +0 -135
  48. package/.next/server/chunks/576.js +0 -80
  49. package/.next/server/chunks/597.js +0 -169
  50. package/.next/server/chunks/608.js +0 -515
  51. package/.next/server/chunks/664.js +0 -3401
  52. package/.next/server/chunks/676.js +0 -32
  53. package/.next/server/chunks/74.js +0 -2598
  54. package/.next/server/chunks/746.js +0 -249
  55. package/.next/server/chunks/82.js +0 -371
  56. package/.next/server/chunks/854.js +0 -72
  57. package/.next/server/chunks/859.js +0 -959
  58. package/.next/server/chunks/872.js +0 -358
  59. package/.next/server/chunks/886.js +0 -120
  60. package/.next/server/chunks/98.js +0 -124
  61. package/.next/server/chunks/font-manifest.json +0 -1
  62. package/.next/server/font-manifest.json +0 -1
  63. package/.next/server/middleware-build-manifest.js +0 -1
  64. package/.next/server/middleware-manifest.json +0 -6
  65. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  66. package/.next/server/pages/404.js +0 -414
  67. package/.next/server/pages/404.js.nft.json +0 -1
  68. package/.next/server/pages/500.js +0 -384
  69. package/.next/server/pages/500.js.nft.json +0 -1
  70. package/.next/server/pages/[...slug].js +0 -700
  71. package/.next/server/pages/[...slug].js.nft.json +0 -1
  72. package/.next/server/pages/[slug]/p.js +0 -2382
  73. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  74. package/.next/server/pages/_app.js +0 -368
  75. package/.next/server/pages/_app.js.nft.json +0 -1
  76. package/.next/server/pages/_document.js +0 -304
  77. package/.next/server/pages/_document.js.nft.json +0 -1
  78. package/.next/server/pages/_error.js +0 -164
  79. package/.next/server/pages/_error.js.nft.json +0 -1
  80. package/.next/server/pages/account.js +0 -370
  81. package/.next/server/pages/account.js.nft.json +0 -1
  82. package/.next/server/pages/api/graphql.js +0 -315
  83. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  84. package/.next/server/pages/api/preview.js +0 -118
  85. package/.next/server/pages/api/preview.js.nft.json +0 -1
  86. package/.next/server/pages/checkout.js +0 -370
  87. package/.next/server/pages/checkout.js.nft.json +0 -1
  88. package/.next/server/pages/en-US/404.html +0 -81
  89. package/.next/server/pages/en-US/404.json +0 -1
  90. package/.next/server/pages/en-US/500.html +0 -81
  91. package/.next/server/pages/en-US/500.json +0 -1
  92. package/.next/server/pages/en-US/account.html +0 -81
  93. package/.next/server/pages/en-US/account.json +0 -1
  94. package/.next/server/pages/en-US/checkout.html +0 -81
  95. package/.next/server/pages/en-US/checkout.json +0 -1
  96. package/.next/server/pages/en-US/login.html +0 -81
  97. package/.next/server/pages/en-US/login.json +0 -1
  98. package/.next/server/pages/en-US/s.html +0 -81
  99. package/.next/server/pages/en-US/s.json +0 -1
  100. package/.next/server/pages/en-US.html +0 -81
  101. package/.next/server/pages/en-US.json +0 -1
  102. package/.next/server/pages/index.js +0 -580
  103. package/.next/server/pages/index.js.nft.json +0 -1
  104. package/.next/server/pages/login.js +0 -396
  105. package/.next/server/pages/login.js.nft.json +0 -1
  106. package/.next/server/pages/s.js +0 -438
  107. package/.next/server/pages/s.js.nft.json +0 -1
  108. package/.next/server/pages-manifest.json +0 -16
  109. package/.next/server/webpack-api-runtime.js +0 -229
  110. package/.next/server/webpack-runtime.js +0 -229
  111. package/.next/static/E3svUtP3jVTE--NFE5Ka5/_buildManifest.js +0 -1
  112. package/.next/static/E3svUtP3jVTE--NFE5Ka5/_ssgManifest.js +0 -1
  113. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  114. package/.next/static/chunks/170.b45293edb4f089c8.js +0 -1
  115. package/.next/static/chunks/226.b57e10ad9932f88c.js +0 -1
  116. package/.next/static/chunks/336.84e96cd7aa2412bc.js +0 -1
  117. package/.next/static/chunks/495.e6b60941cc3e82e4.js +0 -1
  118. package/.next/static/chunks/533-7ddbc43c0305df0c.js +0 -1
  119. package/.next/static/chunks/54.1d3e6cb43b5b1626.js +0 -1
  120. package/.next/static/chunks/597.d0da2018cc312352.js +0 -1
  121. package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
  122. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  123. package/.next/static/chunks/706-abfba2e18f084aed.js +0 -1
  124. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  125. package/.next/static/chunks/832-5460e7c4690723c9.js +0 -1
  126. package/.next/static/chunks/861-d1a326525092ab9c.js +0 -1
  127. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  128. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  129. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  130. package/.next/static/chunks/pages/404-ac22e12eb22b9c50.js +0 -1
  131. package/.next/static/chunks/pages/500-7b708e8b89389d0e.js +0 -1
  132. package/.next/static/chunks/pages/[...slug]-53c0858024f06998.js +0 -1
  133. package/.next/static/chunks/pages/[slug]/p-fdc9d52c82f44e5d.js +0 -1
  134. package/.next/static/chunks/pages/_app-b601536188b9a919.js +0 -1
  135. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  136. package/.next/static/chunks/pages/account-04a0a6c07709c50e.js +0 -1
  137. package/.next/static/chunks/pages/checkout-2ed6b828bb6ed7e6.js +0 -1
  138. package/.next/static/chunks/pages/index-dc845df360bc3a28.js +0 -1
  139. package/.next/static/chunks/pages/login-3bb40d77e6ee120a.js +0 -1
  140. package/.next/static/chunks/pages/s-8fec20c40a2bd7da.js +0 -1
  141. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  142. package/.next/static/chunks/webpack-aff0e2e4ba699b8a.js +0 -1
  143. package/.next/static/css/025f924b9633ecd3.css +0 -1
  144. package/.next/static/css/2253644409b99b98.css +0 -1
  145. package/.next/static/css/364c439adafef5c8.css +0 -1
  146. package/.next/static/css/4b7b7b64ae6afe67.css +0 -1
  147. package/.next/static/css/4e0fc649e912b30f.css +0 -1
  148. package/.next/static/css/501cb58eaa378545.css +0 -1
  149. package/.next/static/css/587c27bbda64e700.css +0 -1
  150. package/.next/static/css/5f1b35b69b2ba1f7.css +0 -1
  151. package/.next/static/css/7a8417de90d11c60.css +0 -1
  152. package/.next/static/css/7df2581c69fe96b4.css +0 -1
  153. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  154. package/.next/trace +0 -66
  155. package/public/~partytown/debug/partytown-atomics.js +0 -556
  156. package/public/~partytown/debug/partytown-media.js +0 -374
  157. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  158. package/public/~partytown/debug/partytown-sw.js +0 -59
  159. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  160. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  161. package/public/~partytown/debug/partytown.js +0 -72
  162. package/public/~partytown/partytown-atomics.js +0 -2
  163. package/public/~partytown/partytown-media.js +0 -2
  164. package/public/~partytown/partytown-sw.js +0 -2
  165. package/public/~partytown/partytown.js +0 -2
@@ -1,515 +0,0 @@
1
- exports.id = 608;
2
- exports.ids = [608];
3
- exports.modules = {
4
-
5
- /***/ 1432:
6
- /***/ ((module, exports, __webpack_require__) => {
7
-
8
- "client";
9
- "use strict";
10
-
11
- Object.defineProperty(exports, "__esModule", ({
12
- value: true
13
- }));
14
- exports["default"] = Image;
15
-
16
- var _extends = (__webpack_require__(6495)/* ["default"] */ .Z);
17
-
18
- var _interop_require_default = (__webpack_require__(2648)/* ["default"] */ .Z);
19
-
20
- var _interop_require_wildcard = (__webpack_require__(1598)/* ["default"] */ .Z);
21
-
22
- var _object_without_properties_loose = (__webpack_require__(7273)/* ["default"] */ .Z);
23
-
24
- var _react = _interop_require_wildcard(__webpack_require__(6689));
25
-
26
- var _head = _interop_require_default(__webpack_require__(4957));
27
-
28
- var _imageBlurSvg = __webpack_require__(4486);
29
-
30
- var _imageConfig = __webpack_require__(5843);
31
-
32
- var _imageConfigContext = __webpack_require__(744);
33
-
34
- var _utils = __webpack_require__(9232);
35
-
36
- function Image(_param) {
37
- var {
38
- src,
39
- sizes,
40
- unoptimized = false,
41
- priority = false,
42
- loading,
43
- className,
44
- quality,
45
- width,
46
- height,
47
- fill,
48
- style,
49
- onLoadingComplete,
50
- placeholder = 'empty',
51
- blurDataURL
52
- } = _param,
53
- all = _object_without_properties_loose(_param, ["src", "sizes", "unoptimized", "priority", "loading", "className", "quality", "width", "height", "fill", "style", "onLoadingComplete", "placeholder", "blurDataURL"]);
54
-
55
- const configContext = (0, _react).useContext(_imageConfigContext.ImageConfigContext);
56
- const config = (0, _react).useMemo(() => {
57
- const c = configEnv || configContext || _imageConfig.imageConfigDefault;
58
- const allSizes = [...c.deviceSizes, ...c.imageSizes].sort((a, b) => a - b);
59
- const deviceSizes = c.deviceSizes.sort((a, b) => a - b);
60
- return _extends({}, c, {
61
- allSizes,
62
- deviceSizes
63
- });
64
- }, [configContext]);
65
- let rest = all;
66
- let loader = defaultLoader;
67
-
68
- if ('loader' in rest) {
69
- if (rest.loader) {
70
- const customImageLoader = rest.loader;
71
-
72
- var _tmp;
73
-
74
- _tmp = obj => {
75
- const {
76
- config: _
77
- } = obj,
78
- opts = _object_without_properties_loose(obj, ["config"]); // The config object is internal only so we must
79
- // not pass it to the user-defined loader()
80
-
81
-
82
- return customImageLoader(opts);
83
- }, loader = _tmp, _tmp;
84
- } // Remove property so it's not spread on <img>
85
-
86
-
87
- delete rest.loader;
88
- }
89
-
90
- let staticSrc = '';
91
- let widthInt = getInt(width);
92
- let heightInt = getInt(height);
93
- let blurWidth;
94
- let blurHeight;
95
-
96
- if (isStaticImport(src)) {
97
- const staticImageData = isStaticRequire(src) ? src.default : src;
98
-
99
- if (!staticImageData.src) {
100
- throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(staticImageData)}`);
101
- }
102
-
103
- if (!staticImageData.height || !staticImageData.width) {
104
- throw new Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(staticImageData)}`);
105
- }
106
-
107
- blurWidth = staticImageData.blurWidth;
108
- blurHeight = staticImageData.blurHeight;
109
- blurDataURL = blurDataURL || staticImageData.blurDataURL;
110
- staticSrc = staticImageData.src;
111
-
112
- if (!fill) {
113
- if (!widthInt && !heightInt) {
114
- widthInt = staticImageData.width;
115
- heightInt = staticImageData.height;
116
- } else if (widthInt && !heightInt) {
117
- const ratio = widthInt / staticImageData.width;
118
- heightInt = Math.round(staticImageData.height * ratio);
119
- } else if (!widthInt && heightInt) {
120
- const ratio = heightInt / staticImageData.height;
121
- widthInt = Math.round(staticImageData.width * ratio);
122
- }
123
- }
124
- }
125
-
126
- src = typeof src === 'string' ? src : staticSrc;
127
- let isLazy = !priority && (loading === 'lazy' || typeof loading === 'undefined');
128
-
129
- if (src.startsWith('data:') || src.startsWith('blob:')) {
130
- // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
131
- unoptimized = true;
132
- isLazy = false;
133
- }
134
-
135
- if (config.unoptimized) {
136
- unoptimized = true;
137
- }
138
-
139
- const [blurComplete, setBlurComplete] = (0, _react).useState(false);
140
- const [showAltText, setShowAltText] = (0, _react).useState(false);
141
- const qualityInt = getInt(quality);
142
-
143
- if (false) {}
144
-
145
- const imgStyle = Object.assign(fill ? {
146
- position: 'absolute',
147
- height: '100%',
148
- width: '100%',
149
- left: 0,
150
- top: 0,
151
- right: 0,
152
- bottom: 0
153
- } : {}, showAltText ? {} : {
154
- color: 'transparent'
155
- }, style);
156
- const blurStyle = placeholder === 'blur' && blurDataURL && !blurComplete ? {
157
- backgroundSize: imgStyle.objectFit || 'cover',
158
- backgroundPosition: imgStyle.objectPosition || '50% 50%',
159
- backgroundRepeat: 'no-repeat',
160
- backgroundImage: `url("data:image/svg+xml;charset=utf-8,${(0, _imageBlurSvg).getImageBlurSvg({
161
- widthInt,
162
- heightInt,
163
- blurWidth,
164
- blurHeight,
165
- blurDataURL
166
- })}")`
167
- } : {};
168
-
169
- if (false) {}
170
-
171
- const imgAttributes = generateImgAttrs({
172
- config,
173
- src,
174
- unoptimized,
175
- width: widthInt,
176
- quality: qualityInt,
177
- sizes,
178
- loader
179
- });
180
- let srcString = src;
181
-
182
- if (false) {}
183
-
184
- let imageSrcSetPropName = 'imagesrcset';
185
- let imageSizesPropName = 'imagesizes';
186
-
187
- if (true) {
188
- imageSrcSetPropName = 'imageSrcSet';
189
- imageSizesPropName = 'imageSizes';
190
- }
191
-
192
- const linkProps = {
193
- // Note: imagesrcset and imagesizes are not in the link element type with react 17.
194
- [imageSrcSetPropName]: imgAttributes.srcSet,
195
- [imageSizesPropName]: imgAttributes.sizes,
196
- crossOrigin: rest.crossOrigin
197
- };
198
- const onLoadingCompleteRef = (0, _react).useRef(onLoadingComplete);
199
- (0, _react).useEffect(() => {
200
- onLoadingCompleteRef.current = onLoadingComplete;
201
- }, [onLoadingComplete]);
202
-
203
- const imgElementArgs = _extends({
204
- isLazy,
205
- imgAttributes,
206
- heightInt,
207
- widthInt,
208
- qualityInt,
209
- className,
210
- imgStyle,
211
- blurStyle,
212
- loading,
213
- config,
214
- fill,
215
- unoptimized,
216
- placeholder,
217
- loader,
218
- srcString,
219
- onLoadingCompleteRef,
220
- setBlurComplete,
221
- setShowAltText
222
- }, rest);
223
-
224
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ImageElement, Object.assign({}, imgElementArgs)), priority ? // Note how we omit the `href` attribute, as it would only be relevant
225
- // for browsers that do not support `imagesrcset`, and in those cases
226
- // it would likely cause the incorrect image to be preloaded.
227
- //
228
- // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
229
-
230
- /*#__PURE__*/
231
- _react.default.createElement(_head.default, null, /*#__PURE__*/_react.default.createElement("link", Object.assign({
232
- key: '__nimg-' + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes,
233
- rel: "preload",
234
- as: "image",
235
- href: imgAttributes.srcSet ? undefined : imgAttributes.src
236
- }, linkProps))) : null);
237
- }
238
-
239
- 'client';
240
- const configEnv = {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false};
241
- const allImgs = new Map();
242
- let perfObserver;
243
-
244
- if (true) {
245
- global.__NEXT_IMAGE_IMPORTED = true;
246
- }
247
-
248
- const VALID_LOADING_VALUES = (/* unused pure expression or super */ null && (['lazy', 'eager', undefined]));
249
-
250
- function isStaticRequire(src) {
251
- return src.default !== undefined;
252
- }
253
-
254
- function isStaticImageData(src) {
255
- return src.src !== undefined;
256
- }
257
-
258
- function isStaticImport(src) {
259
- return typeof src === 'object' && (isStaticRequire(src) || isStaticImageData(src));
260
- }
261
-
262
- function getWidths({
263
- deviceSizes,
264
- allSizes
265
- }, width, sizes) {
266
- if (sizes) {
267
- // Find all the "vw" percent sizes used in the sizes prop
268
- const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
269
- const percentSizes = [];
270
-
271
- for (let match; match = viewportWidthRe.exec(sizes); match) {
272
- percentSizes.push(parseInt(match[2]));
273
- }
274
-
275
- if (percentSizes.length) {
276
- const smallestRatio = Math.min(...percentSizes) * 0.01;
277
- return {
278
- widths: allSizes.filter(s => s >= deviceSizes[0] * smallestRatio),
279
- kind: 'w'
280
- };
281
- }
282
-
283
- return {
284
- widths: allSizes,
285
- kind: 'w'
286
- };
287
- }
288
-
289
- if (typeof width !== 'number') {
290
- return {
291
- widths: deviceSizes,
292
- kind: 'w'
293
- };
294
- }
295
-
296
- const widths = [...new Set( // > This means that most OLED screens that say they are 3x resolution,
297
- // > are actually 3x in the green color, but only 1.5x in the red and
298
- // > blue colors. Showing a 3x resolution image in the app vs a 2x
299
- // > resolution image will be visually the same, though the 3x image
300
- // > takes significantly more data. Even true 3x resolution screens are
301
- // > wasteful as the human eye cannot see that level of detail without
302
- // > something like a magnifying glass.
303
- // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
304
- [width, width * 2
305
- /*, width * 3*/
306
- ].map(w => allSizes.find(p => p >= w) || allSizes[allSizes.length - 1]))];
307
- return {
308
- widths,
309
- kind: 'x'
310
- };
311
- }
312
-
313
- function generateImgAttrs({
314
- config,
315
- src,
316
- unoptimized,
317
- width,
318
- quality,
319
- sizes,
320
- loader
321
- }) {
322
- if (unoptimized) {
323
- return {
324
- src,
325
- srcSet: undefined,
326
- sizes: undefined
327
- };
328
- }
329
-
330
- const {
331
- widths,
332
- kind
333
- } = getWidths(config, width, sizes);
334
- const last = widths.length - 1;
335
- return {
336
- sizes: !sizes && kind === 'w' ? '100vw' : sizes,
337
- srcSet: widths.map((w, i) => `${loader({
338
- config,
339
- src,
340
- quality,
341
- width: w
342
- })} ${kind === 'w' ? w : i + 1}${kind}`).join(', '),
343
- // It's intended to keep `src` the last attribute because React updates
344
- // attributes in order. If we keep `src` the first one, Safari will
345
- // immediately start to fetch `src`, before `sizes` and `srcSet` are even
346
- // updated by React. That causes multiple unnecessary requests if `srcSet`
347
- // and `sizes` are defined.
348
- // This bug cannot be reproduced in Chrome or Firefox.
349
- src: loader({
350
- config,
351
- src,
352
- quality,
353
- width: widths[last]
354
- })
355
- };
356
- }
357
-
358
- function getInt(x) {
359
- if (typeof x === 'number' || typeof x === 'undefined') {
360
- return x;
361
- }
362
-
363
- if (typeof x === 'string' && /^[0-9]+$/.test(x)) {
364
- return parseInt(x, 10);
365
- }
366
-
367
- return NaN;
368
- } // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
369
- // handler instead of the img's onLoad attribute.
370
-
371
-
372
- function handleLoading(img, src, placeholder, onLoadingCompleteRef, setBlurComplete) {
373
- if (!img || img['data-loaded-src'] === src) {
374
- return;
375
- }
376
-
377
- img['data-loaded-src'] = src;
378
- const p = 'decode' in img ? img.decode() : Promise.resolve();
379
- p.catch(() => {}).then(() => {
380
- if (!img.parentNode) {
381
- // Exit early in case of race condition:
382
- // - onload() is called
383
- // - decode() is called but incomplete
384
- // - unmount is called
385
- // - decode() completes
386
- return;
387
- }
388
-
389
- if (placeholder === 'blur') {
390
- setBlurComplete(true);
391
- }
392
-
393
- if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) {
394
- onLoadingCompleteRef.current(img);
395
- }
396
-
397
- if (false) {}
398
- });
399
- }
400
-
401
- const ImageElement = _param => {
402
- var {
403
- imgAttributes,
404
- heightInt,
405
- widthInt,
406
- qualityInt,
407
- className,
408
- imgStyle,
409
- blurStyle,
410
- isLazy,
411
- fill,
412
- placeholder,
413
- loading,
414
- srcString,
415
- config,
416
- unoptimized,
417
- loader,
418
- onLoadingCompleteRef,
419
- setBlurComplete,
420
- setShowAltText,
421
- onLoad,
422
- onError
423
- } = _param,
424
- rest = _object_without_properties_loose(_param, ["imgAttributes", "heightInt", "widthInt", "qualityInt", "className", "imgStyle", "blurStyle", "isLazy", "fill", "placeholder", "loading", "srcString", "config", "unoptimized", "loader", "onLoadingCompleteRef", "setBlurComplete", "setShowAltText", "onLoad", "onError"]);
425
-
426
- loading = isLazy ? 'lazy' : loading;
427
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("img", Object.assign({}, rest, imgAttributes, {
428
- width: widthInt,
429
- height: heightInt,
430
- decoding: "async",
431
- "data-nimg": `future${fill ? '-fill' : ''}`,
432
- className: className,
433
- // @ts-ignore - TODO: upgrade to `@types/react@17`
434
- loading: loading,
435
- style: _extends({}, imgStyle, blurStyle),
436
- ref: (0, _react).useCallback(img => {
437
- if (!img) {
438
- return;
439
- }
440
-
441
- if (onError) {
442
- // If the image has an error before react hydrates, then the error is lost.
443
- // The workaround is to wait until the image is mounted which is after hydration,
444
- // then we set the src again to trigger the error handler (if there was an error).
445
- // eslint-disable-next-line no-self-assign
446
- img.src = img.src;
447
- }
448
-
449
- if (false) {}
450
-
451
- if (img.complete) {
452
- handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
453
- }
454
- }, [srcString, placeholder, onLoadingCompleteRef, setBlurComplete, onError]),
455
- onLoad: event => {
456
- const img = event.currentTarget;
457
- handleLoading(img, srcString, placeholder, onLoadingCompleteRef, setBlurComplete);
458
-
459
- if (onLoad) {
460
- onLoad(event);
461
- }
462
- },
463
- onError: event => {
464
- // if the real image fails to load, this will ensure "alt" is visible
465
- setShowAltText(true);
466
-
467
- if (placeholder === 'blur') {
468
- // If the real image fails to load, this will still remove the placeholder.
469
- setBlurComplete(true);
470
- }
471
-
472
- if (onError) {
473
- onError(event);
474
- }
475
- }
476
- })));
477
- };
478
-
479
- function defaultLoader({
480
- config,
481
- src,
482
- width,
483
- quality
484
- }) {
485
- if (false) {}
486
-
487
- if (src.endsWith('.svg') && !config.dangerouslyAllowSVG) {
488
- // Special case to make svg serve as-is to avoid proxying
489
- // through the built-in Image Optimization API.
490
- return src;
491
- }
492
-
493
- return `${config.path}?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 75}`;
494
- }
495
-
496
- if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
497
- Object.defineProperty(exports.default, '__esModule', {
498
- value: true
499
- });
500
- Object.assign(exports.default, exports);
501
- module.exports = exports.default;
502
- }
503
-
504
- /***/ }),
505
-
506
- /***/ 1608:
507
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
508
-
509
- module.exports = __webpack_require__(1432)
510
-
511
-
512
- /***/ })
513
-
514
- };
515
- ;