react-lazy-load-image-component 1.5.1 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc +5 -4
- package/.eslintrc +2 -2
- package/build/index.js +1 -1462
- package/package.json +26 -26
- package/src/hoc/trackWindowScroll.js +5 -5
- package/src/utils/get-scroll-ancestor.ts +35 -0
- package/webpack.config.js +20 -11
- package/src/utils/get-scroll-element.js +0 -39
package/build/index.js
CHANGED
@@ -1,1462 +1 @@
|
|
1
|
-
module.exports = (function(e) {
|
2
|
-
var t = {};
|
3
|
-
function r(n) {
|
4
|
-
if (t[n]) return t[n].exports;
|
5
|
-
var o = (t[n] = { i: n, l: !1, exports: {} });
|
6
|
-
return e[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports;
|
7
|
-
}
|
8
|
-
return (
|
9
|
-
(r.m = e),
|
10
|
-
(r.c = t),
|
11
|
-
(r.d = function(e, t, n) {
|
12
|
-
r.o(e, t) ||
|
13
|
-
Object.defineProperty(e, t, { enumerable: !0, get: n });
|
14
|
-
}),
|
15
|
-
(r.r = function(e) {
|
16
|
-
'undefined' != typeof Symbol &&
|
17
|
-
Symbol.toStringTag &&
|
18
|
-
Object.defineProperty(e, Symbol.toStringTag, {
|
19
|
-
value: 'Module',
|
20
|
-
}),
|
21
|
-
Object.defineProperty(e, '__esModule', { value: !0 });
|
22
|
-
}),
|
23
|
-
(r.t = function(e, t) {
|
24
|
-
if ((1 & t && (e = r(e)), 8 & t)) return e;
|
25
|
-
if (4 & t && 'object' == typeof e && e && e.__esModule) return e;
|
26
|
-
var n = Object.create(null);
|
27
|
-
if (
|
28
|
-
(r.r(n),
|
29
|
-
Object.defineProperty(n, 'default', {
|
30
|
-
enumerable: !0,
|
31
|
-
value: e,
|
32
|
-
}),
|
33
|
-
2 & t && 'string' != typeof e)
|
34
|
-
)
|
35
|
-
for (var o in e)
|
36
|
-
r.d(
|
37
|
-
n,
|
38
|
-
o,
|
39
|
-
function(t) {
|
40
|
-
return e[t];
|
41
|
-
}.bind(null, o)
|
42
|
-
);
|
43
|
-
return n;
|
44
|
-
}),
|
45
|
-
(r.n = function(e) {
|
46
|
-
var t =
|
47
|
-
e && e.__esModule
|
48
|
-
? function() {
|
49
|
-
return e.default;
|
50
|
-
}
|
51
|
-
: function() {
|
52
|
-
return e;
|
53
|
-
};
|
54
|
-
return r.d(t, 'a', t), t;
|
55
|
-
}),
|
56
|
-
(r.o = function(e, t) {
|
57
|
-
return Object.prototype.hasOwnProperty.call(e, t);
|
58
|
-
}),
|
59
|
-
(r.p = ''),
|
60
|
-
r((r.s = 8))
|
61
|
-
);
|
62
|
-
})([
|
63
|
-
function(e, t) {
|
64
|
-
e.exports = require('react');
|
65
|
-
},
|
66
|
-
function(e, t, r) {
|
67
|
-
e.exports = r(10)();
|
68
|
-
},
|
69
|
-
function(e, t, r) {
|
70
|
-
'use strict';
|
71
|
-
Object.defineProperty(t, '__esModule', { value: !0 }),
|
72
|
-
(t.default = function() {
|
73
|
-
return (
|
74
|
-
'undefined' != typeof window &&
|
75
|
-
'IntersectionObserver' in window &&
|
76
|
-
'isIntersecting' in
|
77
|
-
window.IntersectionObserverEntry.prototype
|
78
|
-
);
|
79
|
-
});
|
80
|
-
},
|
81
|
-
function(e, t, r) {
|
82
|
-
'use strict';
|
83
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
84
|
-
var n = (function() {
|
85
|
-
function e(e, t) {
|
86
|
-
for (var r = 0; r < t.length; r++) {
|
87
|
-
var n = t[r];
|
88
|
-
(n.enumerable = n.enumerable || !1),
|
89
|
-
(n.configurable = !0),
|
90
|
-
'value' in n && (n.writable = !0),
|
91
|
-
Object.defineProperty(e, n.key, n);
|
92
|
-
}
|
93
|
-
}
|
94
|
-
return function(t, r, n) {
|
95
|
-
return r && e(t.prototype, r), n && e(t, n), t;
|
96
|
-
};
|
97
|
-
})(),
|
98
|
-
o = u(r(0)),
|
99
|
-
i = r(1),
|
100
|
-
a = u(r(4)),
|
101
|
-
s = u(r(12)),
|
102
|
-
l = u(r(2));
|
103
|
-
function u(e) {
|
104
|
-
return e && e.__esModule ? e : { default: e };
|
105
|
-
}
|
106
|
-
var c = (function(e) {
|
107
|
-
function t(e) {
|
108
|
-
!(function(e, t) {
|
109
|
-
if (!(e instanceof t))
|
110
|
-
throw new TypeError(
|
111
|
-
'Cannot call a class as a function'
|
112
|
-
);
|
113
|
-
})(this, t);
|
114
|
-
var r = (function(e, t) {
|
115
|
-
if (!e)
|
116
|
-
throw new ReferenceError(
|
117
|
-
"this hasn't been initialised - super() hasn't been called"
|
118
|
-
);
|
119
|
-
return !t ||
|
120
|
-
('object' != typeof t && 'function' != typeof t)
|
121
|
-
? e
|
122
|
-
: t;
|
123
|
-
})(
|
124
|
-
this,
|
125
|
-
(t.__proto__ || Object.getPrototypeOf(t)).call(this, e)
|
126
|
-
),
|
127
|
-
n = e.afterLoad,
|
128
|
-
o = e.beforeLoad,
|
129
|
-
i = e.scrollPosition,
|
130
|
-
a = e.visibleByDefault;
|
131
|
-
return (
|
132
|
-
(r.state = { visible: a }),
|
133
|
-
a && (o(), n()),
|
134
|
-
(r.onVisible = r.onVisible.bind(r)),
|
135
|
-
(r.isScrollTracked = Boolean(
|
136
|
-
i &&
|
137
|
-
Number.isFinite(i.x) &&
|
138
|
-
i.x >= 0 &&
|
139
|
-
Number.isFinite(i.y) &&
|
140
|
-
i.y >= 0
|
141
|
-
)),
|
142
|
-
r
|
143
|
-
);
|
144
|
-
}
|
145
|
-
return (
|
146
|
-
(function(e, t) {
|
147
|
-
if ('function' != typeof t && null !== t)
|
148
|
-
throw new TypeError(
|
149
|
-
'Super expression must either be null or a function, not ' +
|
150
|
-
typeof t
|
151
|
-
);
|
152
|
-
(e.prototype = Object.create(t && t.prototype, {
|
153
|
-
constructor: {
|
154
|
-
value: e,
|
155
|
-
enumerable: !1,
|
156
|
-
writable: !0,
|
157
|
-
configurable: !0,
|
158
|
-
},
|
159
|
-
})),
|
160
|
-
t &&
|
161
|
-
(Object.setPrototypeOf
|
162
|
-
? Object.setPrototypeOf(e, t)
|
163
|
-
: (e.__proto__ = t));
|
164
|
-
})(t, e),
|
165
|
-
n(t, [
|
166
|
-
{
|
167
|
-
key: 'componentDidUpdate',
|
168
|
-
value: function(e, t) {
|
169
|
-
t.visible !== this.state.visible &&
|
170
|
-
this.props.afterLoad();
|
171
|
-
},
|
172
|
-
},
|
173
|
-
{
|
174
|
-
key: 'onVisible',
|
175
|
-
value: function() {
|
176
|
-
this.props.beforeLoad(),
|
177
|
-
this.setState({ visible: !0 });
|
178
|
-
},
|
179
|
-
},
|
180
|
-
{
|
181
|
-
key: 'render',
|
182
|
-
value: function() {
|
183
|
-
if (this.state.visible) return this.props.children;
|
184
|
-
var e = this.props,
|
185
|
-
t = e.className,
|
186
|
-
r = e.delayMethod,
|
187
|
-
n = e.delayTime,
|
188
|
-
i = e.height,
|
189
|
-
u = e.placeholder,
|
190
|
-
c = e.scrollPosition,
|
191
|
-
f = e.style,
|
192
|
-
p = e.threshold,
|
193
|
-
d = e.useIntersectionObserver,
|
194
|
-
y = e.width;
|
195
|
-
return this.isScrollTracked ||
|
196
|
-
(d && (0, l.default)())
|
197
|
-
? o.default.createElement(a.default, {
|
198
|
-
className: t,
|
199
|
-
height: i,
|
200
|
-
onVisible: this.onVisible,
|
201
|
-
placeholder: u,
|
202
|
-
scrollPosition: c,
|
203
|
-
style: f,
|
204
|
-
threshold: p,
|
205
|
-
useIntersectionObserver: d,
|
206
|
-
width: y,
|
207
|
-
})
|
208
|
-
: o.default.createElement(s.default, {
|
209
|
-
className: t,
|
210
|
-
delayMethod: r,
|
211
|
-
delayTime: n,
|
212
|
-
height: i,
|
213
|
-
onVisible: this.onVisible,
|
214
|
-
placeholder: u,
|
215
|
-
style: f,
|
216
|
-
threshold: p,
|
217
|
-
width: y,
|
218
|
-
});
|
219
|
-
},
|
220
|
-
},
|
221
|
-
]),
|
222
|
-
t
|
223
|
-
);
|
224
|
-
})(o.default.Component);
|
225
|
-
(c.propTypes = {
|
226
|
-
afterLoad: i.PropTypes.func,
|
227
|
-
beforeLoad: i.PropTypes.func,
|
228
|
-
useIntersectionObserver: i.PropTypes.bool,
|
229
|
-
visibleByDefault: i.PropTypes.bool,
|
230
|
-
}),
|
231
|
-
(c.defaultProps = {
|
232
|
-
afterLoad: function() {
|
233
|
-
return {};
|
234
|
-
},
|
235
|
-
beforeLoad: function() {
|
236
|
-
return {};
|
237
|
-
},
|
238
|
-
useIntersectionObserver: !0,
|
239
|
-
visibleByDefault: !1,
|
240
|
-
}),
|
241
|
-
(t.default = c);
|
242
|
-
},
|
243
|
-
function(e, t, r) {
|
244
|
-
'use strict';
|
245
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
246
|
-
var n =
|
247
|
-
Object.assign ||
|
248
|
-
function(e) {
|
249
|
-
for (var t = 1; t < arguments.length; t++) {
|
250
|
-
var r = arguments[t];
|
251
|
-
for (var n in r)
|
252
|
-
Object.prototype.hasOwnProperty.call(r, n) &&
|
253
|
-
(e[n] = r[n]);
|
254
|
-
}
|
255
|
-
return e;
|
256
|
-
},
|
257
|
-
o = (function() {
|
258
|
-
function e(e, t) {
|
259
|
-
for (var r = 0; r < t.length; r++) {
|
260
|
-
var n = t[r];
|
261
|
-
(n.enumerable = n.enumerable || !1),
|
262
|
-
(n.configurable = !0),
|
263
|
-
'value' in n && (n.writable = !0),
|
264
|
-
Object.defineProperty(e, n.key, n);
|
265
|
-
}
|
266
|
-
}
|
267
|
-
return function(t, r, n) {
|
268
|
-
return r && e(t.prototype, r), n && e(t, n), t;
|
269
|
-
};
|
270
|
-
})(),
|
271
|
-
i = u(r(0)),
|
272
|
-
a = u(r(5)),
|
273
|
-
s = r(1),
|
274
|
-
l = u(r(2));
|
275
|
-
function u(e) {
|
276
|
-
return e && e.__esModule ? e : { default: e };
|
277
|
-
}
|
278
|
-
var c = function(e) {
|
279
|
-
e.forEach(function(e) {
|
280
|
-
e.isIntersecting && e.target.onVisible();
|
281
|
-
});
|
282
|
-
},
|
283
|
-
f = {},
|
284
|
-
p = function(e) {
|
285
|
-
return (
|
286
|
-
(f[e] =
|
287
|
-
f[e] ||
|
288
|
-
new IntersectionObserver(c, { rootMargin: e + 'px' })),
|
289
|
-
f[e]
|
290
|
-
);
|
291
|
-
},
|
292
|
-
d = (function(e) {
|
293
|
-
function t(e) {
|
294
|
-
!(function(e, t) {
|
295
|
-
if (!(e instanceof t))
|
296
|
-
throw new TypeError(
|
297
|
-
'Cannot call a class as a function'
|
298
|
-
);
|
299
|
-
})(this, t);
|
300
|
-
var r = (function(e, t) {
|
301
|
-
if (!e)
|
302
|
-
throw new ReferenceError(
|
303
|
-
"this hasn't been initialised - super() hasn't been called"
|
304
|
-
);
|
305
|
-
return !t ||
|
306
|
-
('object' != typeof t && 'function' != typeof t)
|
307
|
-
? e
|
308
|
-
: t;
|
309
|
-
})(
|
310
|
-
this,
|
311
|
-
(t.__proto__ || Object.getPrototypeOf(t)).call(this, e)
|
312
|
-
);
|
313
|
-
if (
|
314
|
-
((r.supportsObserver =
|
315
|
-
!e.scrollPosition &&
|
316
|
-
e.useIntersectionObserver &&
|
317
|
-
(0, l.default)()),
|
318
|
-
r.supportsObserver)
|
319
|
-
) {
|
320
|
-
var n = e.threshold;
|
321
|
-
r.observer = p(n);
|
322
|
-
}
|
323
|
-
return r;
|
324
|
-
}
|
325
|
-
return (
|
326
|
-
(function(e, t) {
|
327
|
-
if ('function' != typeof t && null !== t)
|
328
|
-
throw new TypeError(
|
329
|
-
'Super expression must either be null or a function, not ' +
|
330
|
-
typeof t
|
331
|
-
);
|
332
|
-
(e.prototype = Object.create(t && t.prototype, {
|
333
|
-
constructor: {
|
334
|
-
value: e,
|
335
|
-
enumerable: !1,
|
336
|
-
writable: !0,
|
337
|
-
configurable: !0,
|
338
|
-
},
|
339
|
-
})),
|
340
|
-
t &&
|
341
|
-
(Object.setPrototypeOf
|
342
|
-
? Object.setPrototypeOf(e, t)
|
343
|
-
: (e.__proto__ = t));
|
344
|
-
})(t, e),
|
345
|
-
o(t, [
|
346
|
-
{
|
347
|
-
key: 'componentDidMount',
|
348
|
-
value: function() {
|
349
|
-
this.placeholder &&
|
350
|
-
this.observer &&
|
351
|
-
((this.placeholder.onVisible = this.props.onVisible),
|
352
|
-
this.observer.observe(this.placeholder)),
|
353
|
-
this.supportsObserver ||
|
354
|
-
this.updateVisibility();
|
355
|
-
},
|
356
|
-
},
|
357
|
-
{
|
358
|
-
key: 'componentWillUnmount',
|
359
|
-
value: function() {
|
360
|
-
this.observer &&
|
361
|
-
this.observer.unobserve(this.placeholder);
|
362
|
-
},
|
363
|
-
},
|
364
|
-
{
|
365
|
-
key: 'componentDidUpdate',
|
366
|
-
value: function() {
|
367
|
-
this.supportsObserver ||
|
368
|
-
this.updateVisibility();
|
369
|
-
},
|
370
|
-
},
|
371
|
-
{
|
372
|
-
key: 'getPlaceholderBoundingBox',
|
373
|
-
value: function() {
|
374
|
-
var e =
|
375
|
-
arguments.length > 0 &&
|
376
|
-
void 0 !== arguments[0]
|
377
|
-
? arguments[0]
|
378
|
-
: this.props.scrollPosition,
|
379
|
-
t = this.placeholder.getBoundingClientRect(),
|
380
|
-
r = a.default.findDOMNode(this.placeholder)
|
381
|
-
.style,
|
382
|
-
n = {
|
383
|
-
left:
|
384
|
-
parseInt(
|
385
|
-
r.getPropertyValue(
|
386
|
-
'margin-left'
|
387
|
-
),
|
388
|
-
10
|
389
|
-
) || 0,
|
390
|
-
top:
|
391
|
-
parseInt(
|
392
|
-
r.getPropertyValue(
|
393
|
-
'margin-top'
|
394
|
-
),
|
395
|
-
10
|
396
|
-
) || 0,
|
397
|
-
};
|
398
|
-
return {
|
399
|
-
bottom: e.y + t.bottom + n.top,
|
400
|
-
left: e.x + t.left + n.left,
|
401
|
-
right: e.x + t.right + n.left,
|
402
|
-
top: e.y + t.top + n.top,
|
403
|
-
};
|
404
|
-
},
|
405
|
-
},
|
406
|
-
{
|
407
|
-
key: 'isPlaceholderInViewport',
|
408
|
-
value: function() {
|
409
|
-
if (
|
410
|
-
'undefined' == typeof window ||
|
411
|
-
!this.placeholder
|
412
|
-
)
|
413
|
-
return !1;
|
414
|
-
var e = this.props,
|
415
|
-
t = e.scrollPosition,
|
416
|
-
r = e.threshold,
|
417
|
-
n = this.getPlaceholderBoundingBox(t),
|
418
|
-
o = t.y + window.innerHeight,
|
419
|
-
i = t.x,
|
420
|
-
a = t.x + window.innerWidth,
|
421
|
-
s = t.y;
|
422
|
-
return Boolean(
|
423
|
-
s - r <= n.bottom &&
|
424
|
-
o + r >= n.top &&
|
425
|
-
i - r <= n.right &&
|
426
|
-
a + r >= n.left
|
427
|
-
);
|
428
|
-
},
|
429
|
-
},
|
430
|
-
{
|
431
|
-
key: 'updateVisibility',
|
432
|
-
value: function() {
|
433
|
-
this.isPlaceholderInViewport() &&
|
434
|
-
this.props.onVisible();
|
435
|
-
},
|
436
|
-
},
|
437
|
-
{
|
438
|
-
key: 'render',
|
439
|
-
value: function() {
|
440
|
-
var e = this,
|
441
|
-
t = this.props,
|
442
|
-
r = t.className,
|
443
|
-
o = t.height,
|
444
|
-
a = t.placeholder,
|
445
|
-
s = t.style,
|
446
|
-
l = t.width;
|
447
|
-
if (a && 'function' != typeof a.type)
|
448
|
-
return i.default.cloneElement(a, {
|
449
|
-
ref: function(t) {
|
450
|
-
return (e.placeholder = t);
|
451
|
-
},
|
452
|
-
});
|
453
|
-
var u = n({ display: 'inline-block' }, s);
|
454
|
-
return (
|
455
|
-
void 0 !== l && (u.width = l),
|
456
|
-
void 0 !== o && (u.height = o),
|
457
|
-
i.default.createElement(
|
458
|
-
'span',
|
459
|
-
{
|
460
|
-
className: r,
|
461
|
-
ref: function(t) {
|
462
|
-
return (e.placeholder = t);
|
463
|
-
},
|
464
|
-
style: u,
|
465
|
-
},
|
466
|
-
a
|
467
|
-
)
|
468
|
-
);
|
469
|
-
},
|
470
|
-
},
|
471
|
-
]),
|
472
|
-
t
|
473
|
-
);
|
474
|
-
})(i.default.Component);
|
475
|
-
(d.propTypes = {
|
476
|
-
onVisible: s.PropTypes.func.isRequired,
|
477
|
-
className: s.PropTypes.string,
|
478
|
-
height: s.PropTypes.oneOfType([
|
479
|
-
s.PropTypes.number,
|
480
|
-
s.PropTypes.string,
|
481
|
-
]),
|
482
|
-
placeholder: s.PropTypes.element,
|
483
|
-
threshold: s.PropTypes.number,
|
484
|
-
useIntersectionObserver: s.PropTypes.bool,
|
485
|
-
scrollPosition: s.PropTypes.shape({
|
486
|
-
x: s.PropTypes.number.isRequired,
|
487
|
-
y: s.PropTypes.number.isRequired,
|
488
|
-
}),
|
489
|
-
width: s.PropTypes.oneOfType([
|
490
|
-
s.PropTypes.number,
|
491
|
-
s.PropTypes.string,
|
492
|
-
]),
|
493
|
-
}),
|
494
|
-
(d.defaultProps = {
|
495
|
-
className: '',
|
496
|
-
placeholder: null,
|
497
|
-
threshold: 100,
|
498
|
-
useIntersectionObserver: !0,
|
499
|
-
}),
|
500
|
-
(t.default = d);
|
501
|
-
},
|
502
|
-
function(e, t) {
|
503
|
-
e.exports = require('react-dom');
|
504
|
-
},
|
505
|
-
function(e, t, r) {
|
506
|
-
'use strict';
|
507
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
508
|
-
var n =
|
509
|
-
Object.assign ||
|
510
|
-
function(e) {
|
511
|
-
for (var t = 1; t < arguments.length; t++) {
|
512
|
-
var r = arguments[t];
|
513
|
-
for (var n in r)
|
514
|
-
Object.prototype.hasOwnProperty.call(r, n) &&
|
515
|
-
(e[n] = r[n]);
|
516
|
-
}
|
517
|
-
return e;
|
518
|
-
},
|
519
|
-
o = (function() {
|
520
|
-
function e(e, t) {
|
521
|
-
for (var r = 0; r < t.length; r++) {
|
522
|
-
var n = t[r];
|
523
|
-
(n.enumerable = n.enumerable || !1),
|
524
|
-
(n.configurable = !0),
|
525
|
-
'value' in n && (n.writable = !0),
|
526
|
-
Object.defineProperty(e, n.key, n);
|
527
|
-
}
|
528
|
-
}
|
529
|
-
return function(t, r, n) {
|
530
|
-
return r && e(t.prototype, r), n && e(t, n), t;
|
531
|
-
};
|
532
|
-
})(),
|
533
|
-
i = p(r(0)),
|
534
|
-
a = p(r(5)),
|
535
|
-
s = r(1),
|
536
|
-
l = p(r(13)),
|
537
|
-
u = p(r(14)),
|
538
|
-
c = p(r(2)),
|
539
|
-
f = p(r(15));
|
540
|
-
function p(e) {
|
541
|
-
return e && e.__esModule ? e : { default: e };
|
542
|
-
}
|
543
|
-
function d(e, t) {
|
544
|
-
if (!e)
|
545
|
-
throw new ReferenceError(
|
546
|
-
"this hasn't been initialised - super() hasn't been called"
|
547
|
-
);
|
548
|
-
return !t || ('object' != typeof t && 'function' != typeof t)
|
549
|
-
? e
|
550
|
-
: t;
|
551
|
-
}
|
552
|
-
var y = function() {
|
553
|
-
return 'undefined' == typeof window
|
554
|
-
? 0
|
555
|
-
: window.scrollX || window.pageXOffset;
|
556
|
-
},
|
557
|
-
h = function() {
|
558
|
-
return 'undefined' == typeof window
|
559
|
-
? 0
|
560
|
-
: window.scrollY || window.pageYOffset;
|
561
|
-
};
|
562
|
-
t.default = function(e) {
|
563
|
-
var t = (function(t) {
|
564
|
-
function r(e) {
|
565
|
-
!(function(e, t) {
|
566
|
-
if (!(e instanceof t))
|
567
|
-
throw new TypeError(
|
568
|
-
'Cannot call a class as a function'
|
569
|
-
);
|
570
|
-
})(this, r);
|
571
|
-
var t = d(
|
572
|
-
this,
|
573
|
-
(r.__proto__ || Object.getPrototypeOf(r)).call(this, e)
|
574
|
-
);
|
575
|
-
if (
|
576
|
-
((t.useIntersectionObserver =
|
577
|
-
e.useIntersectionObserver && (0, c.default)()),
|
578
|
-
t.useIntersectionObserver)
|
579
|
-
)
|
580
|
-
return d(t);
|
581
|
-
var n = t.onChangeScroll.bind(t);
|
582
|
-
return (
|
583
|
-
'debounce' === e.delayMethod
|
584
|
-
? (t.delayedScroll = (0, l.default)(n, e.delayTime))
|
585
|
-
: 'throttle' === e.delayMethod &&
|
586
|
-
(t.delayedScroll = (0, u.default)(
|
587
|
-
n,
|
588
|
-
e.delayTime
|
589
|
-
)),
|
590
|
-
(t.state = { scrollPosition: { x: y(), y: h() } }),
|
591
|
-
(t.baseComponentRef = i.default.createRef()),
|
592
|
-
t
|
593
|
-
);
|
594
|
-
}
|
595
|
-
return (
|
596
|
-
(function(e, t) {
|
597
|
-
if ('function' != typeof t && null !== t)
|
598
|
-
throw new TypeError(
|
599
|
-
'Super expression must either be null or a function, not ' +
|
600
|
-
typeof t
|
601
|
-
);
|
602
|
-
(e.prototype = Object.create(t && t.prototype, {
|
603
|
-
constructor: {
|
604
|
-
value: e,
|
605
|
-
enumerable: !1,
|
606
|
-
writable: !0,
|
607
|
-
configurable: !0,
|
608
|
-
},
|
609
|
-
})),
|
610
|
-
t &&
|
611
|
-
(Object.setPrototypeOf
|
612
|
-
? Object.setPrototypeOf(e, t)
|
613
|
-
: (e.__proto__ = t));
|
614
|
-
})(r, t),
|
615
|
-
o(r, [
|
616
|
-
{
|
617
|
-
key: 'componentDidMount',
|
618
|
-
value: function() {
|
619
|
-
this.addListeners();
|
620
|
-
},
|
621
|
-
},
|
622
|
-
{
|
623
|
-
key: 'componentWillUnmount',
|
624
|
-
value: function() {
|
625
|
-
this.removeListeners();
|
626
|
-
},
|
627
|
-
},
|
628
|
-
{
|
629
|
-
key: 'componentDidUpdate',
|
630
|
-
value: function() {
|
631
|
-
'undefined' == typeof window ||
|
632
|
-
this.useIntersectionObserver ||
|
633
|
-
((0, f.default)(
|
634
|
-
a.default.findDOMNode(
|
635
|
-
this.baseComponentRef.current
|
636
|
-
)
|
637
|
-
) !== this.scrollElement &&
|
638
|
-
(this.removeListeners(),
|
639
|
-
this.addListeners()));
|
640
|
-
},
|
641
|
-
},
|
642
|
-
{
|
643
|
-
key: 'addListeners',
|
644
|
-
value: function() {
|
645
|
-
'undefined' == typeof window ||
|
646
|
-
this.useIntersectionObserver ||
|
647
|
-
((this.scrollElement = (0, f.default)(
|
648
|
-
a.default.findDOMNode(
|
649
|
-
this.baseComponentRef.current
|
650
|
-
)
|
651
|
-
)),
|
652
|
-
this.scrollElement.addEventListener(
|
653
|
-
'scroll',
|
654
|
-
this.delayedScroll,
|
655
|
-
{ passive: !0 }
|
656
|
-
),
|
657
|
-
window.addEventListener(
|
658
|
-
'resize',
|
659
|
-
this.delayedScroll,
|
660
|
-
{ passive: !0 }
|
661
|
-
),
|
662
|
-
this.scrollElement !== window &&
|
663
|
-
window.addEventListener(
|
664
|
-
'scroll',
|
665
|
-
this.delayedScroll,
|
666
|
-
{ passive: !0 }
|
667
|
-
));
|
668
|
-
},
|
669
|
-
},
|
670
|
-
{
|
671
|
-
key: 'removeListeners',
|
672
|
-
value: function() {
|
673
|
-
'undefined' == typeof window ||
|
674
|
-
this.useIntersectionObserver ||
|
675
|
-
(this.scrollElement.removeEventListener(
|
676
|
-
'scroll',
|
677
|
-
this.delayedScroll
|
678
|
-
),
|
679
|
-
window.removeEventListener(
|
680
|
-
'resize',
|
681
|
-
this.delayedScroll
|
682
|
-
),
|
683
|
-
this.scrollElement !== window &&
|
684
|
-
window.removeEventListener(
|
685
|
-
'scroll',
|
686
|
-
this.delayedScroll
|
687
|
-
));
|
688
|
-
},
|
689
|
-
},
|
690
|
-
{
|
691
|
-
key: 'onChangeScroll',
|
692
|
-
value: function() {
|
693
|
-
this.useIntersectionObserver ||
|
694
|
-
this.setState({
|
695
|
-
scrollPosition: { x: y(), y: h() },
|
696
|
-
});
|
697
|
-
},
|
698
|
-
},
|
699
|
-
{
|
700
|
-
key: 'render',
|
701
|
-
value: function() {
|
702
|
-
var t = this.props,
|
703
|
-
r =
|
704
|
-
(t.delayMethod,
|
705
|
-
t.delayTime,
|
706
|
-
(function(e, t) {
|
707
|
-
var r = {};
|
708
|
-
for (var n in e)
|
709
|
-
t.indexOf(n) >= 0 ||
|
710
|
-
(Object.prototype.hasOwnProperty.call(
|
711
|
-
e,
|
712
|
-
n
|
713
|
-
) &&
|
714
|
-
(r[n] = e[n]));
|
715
|
-
return r;
|
716
|
-
})(t, ['delayMethod', 'delayTime'])),
|
717
|
-
o = this.useIntersectionObserver
|
718
|
-
? null
|
719
|
-
: this.state.scrollPosition;
|
720
|
-
return i.default.createElement(
|
721
|
-
e,
|
722
|
-
n(
|
723
|
-
{
|
724
|
-
ref: this.baseComponentRef,
|
725
|
-
scrollPosition: o,
|
726
|
-
},
|
727
|
-
r
|
728
|
-
)
|
729
|
-
);
|
730
|
-
},
|
731
|
-
},
|
732
|
-
]),
|
733
|
-
r
|
734
|
-
);
|
735
|
-
})(i.default.Component);
|
736
|
-
return (
|
737
|
-
(t.propTypes = {
|
738
|
-
delayMethod: s.PropTypes.oneOf(['debounce', 'throttle']),
|
739
|
-
delayTime: s.PropTypes.number,
|
740
|
-
useIntersectionObserver: s.PropTypes.bool,
|
741
|
-
}),
|
742
|
-
(t.defaultProps = {
|
743
|
-
delayMethod: 'throttle',
|
744
|
-
delayTime: 300,
|
745
|
-
useIntersectionObserver: !0,
|
746
|
-
}),
|
747
|
-
t
|
748
|
-
);
|
749
|
-
};
|
750
|
-
},
|
751
|
-
function(e, t) {
|
752
|
-
var r;
|
753
|
-
r = (function() {
|
754
|
-
return this;
|
755
|
-
})();
|
756
|
-
try {
|
757
|
-
r = r || new Function('return this')();
|
758
|
-
} catch (e) {
|
759
|
-
'object' == typeof window && (r = window);
|
760
|
-
}
|
761
|
-
e.exports = r;
|
762
|
-
},
|
763
|
-
function(e, t, r) {
|
764
|
-
'use strict';
|
765
|
-
Object.defineProperty(t, '__esModule', { value: !0 }),
|
766
|
-
(t.trackWindowScroll = t.LazyLoadComponent = t.LazyLoadImage = void 0);
|
767
|
-
var n = a(r(9)),
|
768
|
-
o = a(r(3)),
|
769
|
-
i = a(r(6));
|
770
|
-
function a(e) {
|
771
|
-
return e && e.__esModule ? e : { default: e };
|
772
|
-
}
|
773
|
-
(t.LazyLoadImage = n.default),
|
774
|
-
(t.LazyLoadComponent = o.default),
|
775
|
-
(t.trackWindowScroll = i.default);
|
776
|
-
},
|
777
|
-
function(e, t, r) {
|
778
|
-
'use strict';
|
779
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
780
|
-
var n =
|
781
|
-
Object.assign ||
|
782
|
-
function(e) {
|
783
|
-
for (var t = 1; t < arguments.length; t++) {
|
784
|
-
var r = arguments[t];
|
785
|
-
for (var n in r)
|
786
|
-
Object.prototype.hasOwnProperty.call(r, n) &&
|
787
|
-
(e[n] = r[n]);
|
788
|
-
}
|
789
|
-
return e;
|
790
|
-
},
|
791
|
-
o = (function() {
|
792
|
-
function e(e, t) {
|
793
|
-
for (var r = 0; r < t.length; r++) {
|
794
|
-
var n = t[r];
|
795
|
-
(n.enumerable = n.enumerable || !1),
|
796
|
-
(n.configurable = !0),
|
797
|
-
'value' in n && (n.writable = !0),
|
798
|
-
Object.defineProperty(e, n.key, n);
|
799
|
-
}
|
800
|
-
}
|
801
|
-
return function(t, r, n) {
|
802
|
-
return r && e(t.prototype, r), n && e(t, n), t;
|
803
|
-
};
|
804
|
-
})(),
|
805
|
-
i = l(r(0)),
|
806
|
-
a = r(1),
|
807
|
-
s = l(r(3));
|
808
|
-
function l(e) {
|
809
|
-
return e && e.__esModule ? e : { default: e };
|
810
|
-
}
|
811
|
-
var u = (function(e) {
|
812
|
-
function t(e) {
|
813
|
-
!(function(e, t) {
|
814
|
-
if (!(e instanceof t))
|
815
|
-
throw new TypeError(
|
816
|
-
'Cannot call a class as a function'
|
817
|
-
);
|
818
|
-
})(this, t);
|
819
|
-
var r = (function(e, t) {
|
820
|
-
if (!e)
|
821
|
-
throw new ReferenceError(
|
822
|
-
"this hasn't been initialised - super() hasn't been called"
|
823
|
-
);
|
824
|
-
return !t ||
|
825
|
-
('object' != typeof t && 'function' != typeof t)
|
826
|
-
? e
|
827
|
-
: t;
|
828
|
-
})(
|
829
|
-
this,
|
830
|
-
(t.__proto__ || Object.getPrototypeOf(t)).call(this, e)
|
831
|
-
);
|
832
|
-
return (r.state = { loaded: !1 }), r;
|
833
|
-
}
|
834
|
-
return (
|
835
|
-
(function(e, t) {
|
836
|
-
if ('function' != typeof t && null !== t)
|
837
|
-
throw new TypeError(
|
838
|
-
'Super expression must either be null or a function, not ' +
|
839
|
-
typeof t
|
840
|
-
);
|
841
|
-
(e.prototype = Object.create(t && t.prototype, {
|
842
|
-
constructor: {
|
843
|
-
value: e,
|
844
|
-
enumerable: !1,
|
845
|
-
writable: !0,
|
846
|
-
configurable: !0,
|
847
|
-
},
|
848
|
-
})),
|
849
|
-
t &&
|
850
|
-
(Object.setPrototypeOf
|
851
|
-
? Object.setPrototypeOf(e, t)
|
852
|
-
: (e.__proto__ = t));
|
853
|
-
})(t, e),
|
854
|
-
o(t, [
|
855
|
-
{
|
856
|
-
key: 'onImageLoad',
|
857
|
-
value: function() {
|
858
|
-
var e = this;
|
859
|
-
return this.state.loaded
|
860
|
-
? null
|
861
|
-
: function() {
|
862
|
-
e.props.afterLoad(),
|
863
|
-
e.setState({ loaded: !0 });
|
864
|
-
};
|
865
|
-
},
|
866
|
-
},
|
867
|
-
{
|
868
|
-
key: 'getImg',
|
869
|
-
value: function() {
|
870
|
-
var e = this.props,
|
871
|
-
t =
|
872
|
-
(e.afterLoad,
|
873
|
-
e.beforeLoad,
|
874
|
-
e.delayMethod,
|
875
|
-
e.delayTime,
|
876
|
-
e.effect,
|
877
|
-
e.placeholder,
|
878
|
-
e.placeholderSrc,
|
879
|
-
e.scrollPosition,
|
880
|
-
e.threshold,
|
881
|
-
e.useIntersectionObserver,
|
882
|
-
e.visibleByDefault,
|
883
|
-
e.wrapperClassName,
|
884
|
-
e.wrapperProps,
|
885
|
-
(function(e, t) {
|
886
|
-
var r = {};
|
887
|
-
for (var n in e)
|
888
|
-
t.indexOf(n) >= 0 ||
|
889
|
-
(Object.prototype.hasOwnProperty.call(
|
890
|
-
e,
|
891
|
-
n
|
892
|
-
) &&
|
893
|
-
(r[n] = e[n]));
|
894
|
-
return r;
|
895
|
-
})(e, [
|
896
|
-
'afterLoad',
|
897
|
-
'beforeLoad',
|
898
|
-
'delayMethod',
|
899
|
-
'delayTime',
|
900
|
-
'effect',
|
901
|
-
'placeholder',
|
902
|
-
'placeholderSrc',
|
903
|
-
'scrollPosition',
|
904
|
-
'threshold',
|
905
|
-
'useIntersectionObserver',
|
906
|
-
'visibleByDefault',
|
907
|
-
'wrapperClassName',
|
908
|
-
'wrapperProps',
|
909
|
-
]));
|
910
|
-
return i.default.createElement(
|
911
|
-
'img',
|
912
|
-
n({ onLoad: this.onImageLoad() }, t)
|
913
|
-
);
|
914
|
-
},
|
915
|
-
},
|
916
|
-
{
|
917
|
-
key: 'getLazyLoadImage',
|
918
|
-
value: function() {
|
919
|
-
var e = this.props,
|
920
|
-
t = e.beforeLoad,
|
921
|
-
r = e.className,
|
922
|
-
n = e.delayMethod,
|
923
|
-
o = e.delayTime,
|
924
|
-
a = e.height,
|
925
|
-
l = e.placeholder,
|
926
|
-
u = e.scrollPosition,
|
927
|
-
c = e.style,
|
928
|
-
f = e.threshold,
|
929
|
-
p = e.useIntersectionObserver,
|
930
|
-
d = e.visibleByDefault,
|
931
|
-
y = e.width;
|
932
|
-
return i.default.createElement(
|
933
|
-
s.default,
|
934
|
-
{
|
935
|
-
beforeLoad: t,
|
936
|
-
className: r,
|
937
|
-
delayMethod: n,
|
938
|
-
delayTime: o,
|
939
|
-
height: a,
|
940
|
-
placeholder: l,
|
941
|
-
scrollPosition: u,
|
942
|
-
style: c,
|
943
|
-
threshold: f,
|
944
|
-
useIntersectionObserver: p,
|
945
|
-
visibleByDefault: d,
|
946
|
-
width: y,
|
947
|
-
},
|
948
|
-
this.getImg()
|
949
|
-
);
|
950
|
-
},
|
951
|
-
},
|
952
|
-
{
|
953
|
-
key: 'getWrappedLazyLoadImage',
|
954
|
-
value: function(e) {
|
955
|
-
var t = this.props,
|
956
|
-
r = t.effect,
|
957
|
-
o = t.height,
|
958
|
-
a = t.placeholderSrc,
|
959
|
-
s = t.width,
|
960
|
-
l = t.wrapperClassName,
|
961
|
-
u = t.wrapperProps,
|
962
|
-
c = this.state.loaded,
|
963
|
-
f = c ? ' lazy-load-image-loaded' : '';
|
964
|
-
return i.default.createElement(
|
965
|
-
'span',
|
966
|
-
n(
|
967
|
-
{
|
968
|
-
className:
|
969
|
-
l +
|
970
|
-
' lazy-load-image-background ' +
|
971
|
-
r +
|
972
|
-
f,
|
973
|
-
style: {
|
974
|
-
backgroundImage:
|
975
|
-
c || !a ? '' : 'url(' + a + ')',
|
976
|
-
backgroundSize:
|
977
|
-
c || !a ? '' : '100% 100%',
|
978
|
-
display: 'inline-block',
|
979
|
-
height: o,
|
980
|
-
width: s,
|
981
|
-
},
|
982
|
-
},
|
983
|
-
u
|
984
|
-
),
|
985
|
-
e
|
986
|
-
);
|
987
|
-
},
|
988
|
-
},
|
989
|
-
{
|
990
|
-
key: 'render',
|
991
|
-
value: function() {
|
992
|
-
var e = this.props,
|
993
|
-
t = e.effect,
|
994
|
-
r = e.placeholderSrc,
|
995
|
-
n = e.visibleByDefault,
|
996
|
-
o = e.wrapperClassName,
|
997
|
-
i = e.wrapperProps,
|
998
|
-
a = this.getLazyLoadImage();
|
999
|
-
return ((t || r) && !n) || o || i
|
1000
|
-
? this.getWrappedLazyLoadImage(a)
|
1001
|
-
: a;
|
1002
|
-
},
|
1003
|
-
},
|
1004
|
-
]),
|
1005
|
-
t
|
1006
|
-
);
|
1007
|
-
})(i.default.Component);
|
1008
|
-
(u.propTypes = {
|
1009
|
-
afterLoad: a.PropTypes.func,
|
1010
|
-
beforeLoad: a.PropTypes.func,
|
1011
|
-
delayMethod: a.PropTypes.string,
|
1012
|
-
delayTime: a.PropTypes.number,
|
1013
|
-
effect: a.PropTypes.string,
|
1014
|
-
placeholderSrc: a.PropTypes.string,
|
1015
|
-
threshold: a.PropTypes.number,
|
1016
|
-
useIntersectionObserver: a.PropTypes.bool,
|
1017
|
-
visibleByDefault: a.PropTypes.bool,
|
1018
|
-
wrapperClassName: a.PropTypes.string,
|
1019
|
-
wrapperProps: a.PropTypes.object,
|
1020
|
-
}),
|
1021
|
-
(u.defaultProps = {
|
1022
|
-
afterLoad: function() {
|
1023
|
-
return {};
|
1024
|
-
},
|
1025
|
-
beforeLoad: function() {
|
1026
|
-
return {};
|
1027
|
-
},
|
1028
|
-
delayMethod: 'throttle',
|
1029
|
-
delayTime: 300,
|
1030
|
-
effect: '',
|
1031
|
-
placeholderSrc: null,
|
1032
|
-
threshold: 100,
|
1033
|
-
useIntersectionObserver: !0,
|
1034
|
-
visibleByDefault: !1,
|
1035
|
-
wrapperClassName: '',
|
1036
|
-
}),
|
1037
|
-
(t.default = u);
|
1038
|
-
},
|
1039
|
-
function(e, t, r) {
|
1040
|
-
'use strict';
|
1041
|
-
var n = r(11);
|
1042
|
-
function o() {}
|
1043
|
-
function i() {}
|
1044
|
-
(i.resetWarningCache = o),
|
1045
|
-
(e.exports = function() {
|
1046
|
-
function e(e, t, r, o, i, a) {
|
1047
|
-
if (a !== n) {
|
1048
|
-
var s = new Error(
|
1049
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types'
|
1050
|
-
);
|
1051
|
-
throw ((s.name = 'Invariant Violation'), s);
|
1052
|
-
}
|
1053
|
-
}
|
1054
|
-
function t() {
|
1055
|
-
return e;
|
1056
|
-
}
|
1057
|
-
e.isRequired = e;
|
1058
|
-
var r = {
|
1059
|
-
array: e,
|
1060
|
-
bool: e,
|
1061
|
-
func: e,
|
1062
|
-
number: e,
|
1063
|
-
object: e,
|
1064
|
-
string: e,
|
1065
|
-
symbol: e,
|
1066
|
-
any: e,
|
1067
|
-
arrayOf: t,
|
1068
|
-
element: e,
|
1069
|
-
elementType: e,
|
1070
|
-
instanceOf: t,
|
1071
|
-
node: e,
|
1072
|
-
objectOf: t,
|
1073
|
-
oneOf: t,
|
1074
|
-
oneOfType: t,
|
1075
|
-
shape: t,
|
1076
|
-
exact: t,
|
1077
|
-
checkPropTypes: i,
|
1078
|
-
resetWarningCache: o,
|
1079
|
-
};
|
1080
|
-
return (r.PropTypes = r), r;
|
1081
|
-
});
|
1082
|
-
},
|
1083
|
-
function(e, t, r) {
|
1084
|
-
'use strict';
|
1085
|
-
e.exports = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
1086
|
-
},
|
1087
|
-
function(e, t, r) {
|
1088
|
-
'use strict';
|
1089
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
1090
|
-
var n = (function() {
|
1091
|
-
function e(e, t) {
|
1092
|
-
for (var r = 0; r < t.length; r++) {
|
1093
|
-
var n = t[r];
|
1094
|
-
(n.enumerable = n.enumerable || !1),
|
1095
|
-
(n.configurable = !0),
|
1096
|
-
'value' in n && (n.writable = !0),
|
1097
|
-
Object.defineProperty(e, n.key, n);
|
1098
|
-
}
|
1099
|
-
}
|
1100
|
-
return function(t, r, n) {
|
1101
|
-
return r && e(t.prototype, r), n && e(t, n), t;
|
1102
|
-
};
|
1103
|
-
})(),
|
1104
|
-
o = s(r(0)),
|
1105
|
-
i = s(r(4)),
|
1106
|
-
a = s(r(6));
|
1107
|
-
function s(e) {
|
1108
|
-
return e && e.__esModule ? e : { default: e };
|
1109
|
-
}
|
1110
|
-
var l = (function(e) {
|
1111
|
-
function t(e) {
|
1112
|
-
return (
|
1113
|
-
(function(e, t) {
|
1114
|
-
if (!(e instanceof t))
|
1115
|
-
throw new TypeError(
|
1116
|
-
'Cannot call a class as a function'
|
1117
|
-
);
|
1118
|
-
})(this, t),
|
1119
|
-
(function(e, t) {
|
1120
|
-
if (!e)
|
1121
|
-
throw new ReferenceError(
|
1122
|
-
"this hasn't been initialised - super() hasn't been called"
|
1123
|
-
);
|
1124
|
-
return !t ||
|
1125
|
-
('object' != typeof t && 'function' != typeof t)
|
1126
|
-
? e
|
1127
|
-
: t;
|
1128
|
-
})(
|
1129
|
-
this,
|
1130
|
-
(t.__proto__ || Object.getPrototypeOf(t)).call(this, e)
|
1131
|
-
)
|
1132
|
-
);
|
1133
|
-
}
|
1134
|
-
return (
|
1135
|
-
(function(e, t) {
|
1136
|
-
if ('function' != typeof t && null !== t)
|
1137
|
-
throw new TypeError(
|
1138
|
-
'Super expression must either be null or a function, not ' +
|
1139
|
-
typeof t
|
1140
|
-
);
|
1141
|
-
(e.prototype = Object.create(t && t.prototype, {
|
1142
|
-
constructor: {
|
1143
|
-
value: e,
|
1144
|
-
enumerable: !1,
|
1145
|
-
writable: !0,
|
1146
|
-
configurable: !0,
|
1147
|
-
},
|
1148
|
-
})),
|
1149
|
-
t &&
|
1150
|
-
(Object.setPrototypeOf
|
1151
|
-
? Object.setPrototypeOf(e, t)
|
1152
|
-
: (e.__proto__ = t));
|
1153
|
-
})(t, e),
|
1154
|
-
n(t, [
|
1155
|
-
{
|
1156
|
-
key: 'render',
|
1157
|
-
value: function() {
|
1158
|
-
return o.default.createElement(
|
1159
|
-
i.default,
|
1160
|
-
this.props
|
1161
|
-
);
|
1162
|
-
},
|
1163
|
-
},
|
1164
|
-
]),
|
1165
|
-
t
|
1166
|
-
);
|
1167
|
-
})(o.default.Component);
|
1168
|
-
t.default = (0, a.default)(l);
|
1169
|
-
},
|
1170
|
-
function(e, t, r) {
|
1171
|
-
(function(t) {
|
1172
|
-
var r = 'Expected a function',
|
1173
|
-
n = NaN,
|
1174
|
-
o = '[object Symbol]',
|
1175
|
-
i = /^\s+|\s+$/g,
|
1176
|
-
a = /^[-+]0x[0-9a-f]+$/i,
|
1177
|
-
s = /^0b[01]+$/i,
|
1178
|
-
l = /^0o[0-7]+$/i,
|
1179
|
-
u = parseInt,
|
1180
|
-
c = 'object' == typeof t && t && t.Object === Object && t,
|
1181
|
-
f =
|
1182
|
-
'object' == typeof self &&
|
1183
|
-
self &&
|
1184
|
-
self.Object === Object &&
|
1185
|
-
self,
|
1186
|
-
p = c || f || Function('return this')(),
|
1187
|
-
d = Object.prototype.toString,
|
1188
|
-
y = Math.max,
|
1189
|
-
h = Math.min,
|
1190
|
-
b = function() {
|
1191
|
-
return p.Date.now();
|
1192
|
-
};
|
1193
|
-
function v(e) {
|
1194
|
-
var t = typeof e;
|
1195
|
-
return !!e && ('object' == t || 'function' == t);
|
1196
|
-
}
|
1197
|
-
function m(e) {
|
1198
|
-
if ('number' == typeof e) return e;
|
1199
|
-
if (
|
1200
|
-
(function(e) {
|
1201
|
-
return (
|
1202
|
-
'symbol' == typeof e ||
|
1203
|
-
((function(e) {
|
1204
|
-
return !!e && 'object' == typeof e;
|
1205
|
-
})(e) &&
|
1206
|
-
d.call(e) == o)
|
1207
|
-
);
|
1208
|
-
})(e)
|
1209
|
-
)
|
1210
|
-
return n;
|
1211
|
-
if (v(e)) {
|
1212
|
-
var t = 'function' == typeof e.valueOf ? e.valueOf() : e;
|
1213
|
-
e = v(t) ? t + '' : t;
|
1214
|
-
}
|
1215
|
-
if ('string' != typeof e) return 0 === e ? e : +e;
|
1216
|
-
e = e.replace(i, '');
|
1217
|
-
var r = s.test(e);
|
1218
|
-
return r || l.test(e)
|
1219
|
-
? u(e.slice(2), r ? 2 : 8)
|
1220
|
-
: a.test(e)
|
1221
|
-
? n
|
1222
|
-
: +e;
|
1223
|
-
}
|
1224
|
-
e.exports = function(e, t, n) {
|
1225
|
-
var o,
|
1226
|
-
i,
|
1227
|
-
a,
|
1228
|
-
s,
|
1229
|
-
l,
|
1230
|
-
u,
|
1231
|
-
c = 0,
|
1232
|
-
f = !1,
|
1233
|
-
p = !1,
|
1234
|
-
d = !0;
|
1235
|
-
if ('function' != typeof e) throw new TypeError(r);
|
1236
|
-
function w(t) {
|
1237
|
-
var r = o,
|
1238
|
-
n = i;
|
1239
|
-
return (o = i = void 0), (c = t), (s = e.apply(n, r));
|
1240
|
-
}
|
1241
|
-
function O(e) {
|
1242
|
-
var r = e - u;
|
1243
|
-
return void 0 === u || r >= t || r < 0 || (p && e - c >= a);
|
1244
|
-
}
|
1245
|
-
function g() {
|
1246
|
-
var e = b();
|
1247
|
-
if (O(e)) return P(e);
|
1248
|
-
l = setTimeout(
|
1249
|
-
g,
|
1250
|
-
(function(e) {
|
1251
|
-
var r = t - (e - u);
|
1252
|
-
return p ? h(r, a - (e - c)) : r;
|
1253
|
-
})(e)
|
1254
|
-
);
|
1255
|
-
}
|
1256
|
-
function P(e) {
|
1257
|
-
return (l = void 0), d && o ? w(e) : ((o = i = void 0), s);
|
1258
|
-
}
|
1259
|
-
function T() {
|
1260
|
-
var e = b(),
|
1261
|
-
r = O(e);
|
1262
|
-
if (((o = arguments), (i = this), (u = e), r)) {
|
1263
|
-
if (void 0 === l)
|
1264
|
-
return (function(e) {
|
1265
|
-
return (
|
1266
|
-
(c = e),
|
1267
|
-
(l = setTimeout(g, t)),
|
1268
|
-
f ? w(e) : s
|
1269
|
-
);
|
1270
|
-
})(u);
|
1271
|
-
if (p) return (l = setTimeout(g, t)), w(u);
|
1272
|
-
}
|
1273
|
-
return void 0 === l && (l = setTimeout(g, t)), s;
|
1274
|
-
}
|
1275
|
-
return (
|
1276
|
-
(t = m(t) || 0),
|
1277
|
-
v(n) &&
|
1278
|
-
((f = !!n.leading),
|
1279
|
-
(a = (p = 'maxWait' in n)
|
1280
|
-
? y(m(n.maxWait) || 0, t)
|
1281
|
-
: a),
|
1282
|
-
(d = 'trailing' in n ? !!n.trailing : d)),
|
1283
|
-
(T.cancel = function() {
|
1284
|
-
void 0 !== l && clearTimeout(l),
|
1285
|
-
(c = 0),
|
1286
|
-
(o = u = i = l = void 0);
|
1287
|
-
}),
|
1288
|
-
(T.flush = function() {
|
1289
|
-
return void 0 === l ? s : P(b());
|
1290
|
-
}),
|
1291
|
-
T
|
1292
|
-
);
|
1293
|
-
};
|
1294
|
-
}.call(this, r(7)));
|
1295
|
-
},
|
1296
|
-
function(e, t, r) {
|
1297
|
-
(function(t) {
|
1298
|
-
var r = 'Expected a function',
|
1299
|
-
n = NaN,
|
1300
|
-
o = '[object Symbol]',
|
1301
|
-
i = /^\s+|\s+$/g,
|
1302
|
-
a = /^[-+]0x[0-9a-f]+$/i,
|
1303
|
-
s = /^0b[01]+$/i,
|
1304
|
-
l = /^0o[0-7]+$/i,
|
1305
|
-
u = parseInt,
|
1306
|
-
c = 'object' == typeof t && t && t.Object === Object && t,
|
1307
|
-
f =
|
1308
|
-
'object' == typeof self &&
|
1309
|
-
self &&
|
1310
|
-
self.Object === Object &&
|
1311
|
-
self,
|
1312
|
-
p = c || f || Function('return this')(),
|
1313
|
-
d = Object.prototype.toString,
|
1314
|
-
y = Math.max,
|
1315
|
-
h = Math.min,
|
1316
|
-
b = function() {
|
1317
|
-
return p.Date.now();
|
1318
|
-
};
|
1319
|
-
function v(e, t, n) {
|
1320
|
-
var o,
|
1321
|
-
i,
|
1322
|
-
a,
|
1323
|
-
s,
|
1324
|
-
l,
|
1325
|
-
u,
|
1326
|
-
c = 0,
|
1327
|
-
f = !1,
|
1328
|
-
p = !1,
|
1329
|
-
d = !0;
|
1330
|
-
if ('function' != typeof e) throw new TypeError(r);
|
1331
|
-
function v(t) {
|
1332
|
-
var r = o,
|
1333
|
-
n = i;
|
1334
|
-
return (o = i = void 0), (c = t), (s = e.apply(n, r));
|
1335
|
-
}
|
1336
|
-
function O(e) {
|
1337
|
-
var r = e - u;
|
1338
|
-
return void 0 === u || r >= t || r < 0 || (p && e - c >= a);
|
1339
|
-
}
|
1340
|
-
function g() {
|
1341
|
-
var e = b();
|
1342
|
-
if (O(e)) return P(e);
|
1343
|
-
l = setTimeout(
|
1344
|
-
g,
|
1345
|
-
(function(e) {
|
1346
|
-
var r = t - (e - u);
|
1347
|
-
return p ? h(r, a - (e - c)) : r;
|
1348
|
-
})(e)
|
1349
|
-
);
|
1350
|
-
}
|
1351
|
-
function P(e) {
|
1352
|
-
return (l = void 0), d && o ? v(e) : ((o = i = void 0), s);
|
1353
|
-
}
|
1354
|
-
function T() {
|
1355
|
-
var e = b(),
|
1356
|
-
r = O(e);
|
1357
|
-
if (((o = arguments), (i = this), (u = e), r)) {
|
1358
|
-
if (void 0 === l)
|
1359
|
-
return (function(e) {
|
1360
|
-
return (
|
1361
|
-
(c = e),
|
1362
|
-
(l = setTimeout(g, t)),
|
1363
|
-
f ? v(e) : s
|
1364
|
-
);
|
1365
|
-
})(u);
|
1366
|
-
if (p) return (l = setTimeout(g, t)), v(u);
|
1367
|
-
}
|
1368
|
-
return void 0 === l && (l = setTimeout(g, t)), s;
|
1369
|
-
}
|
1370
|
-
return (
|
1371
|
-
(t = w(t) || 0),
|
1372
|
-
m(n) &&
|
1373
|
-
((f = !!n.leading),
|
1374
|
-
(a = (p = 'maxWait' in n)
|
1375
|
-
? y(w(n.maxWait) || 0, t)
|
1376
|
-
: a),
|
1377
|
-
(d = 'trailing' in n ? !!n.trailing : d)),
|
1378
|
-
(T.cancel = function() {
|
1379
|
-
void 0 !== l && clearTimeout(l),
|
1380
|
-
(c = 0),
|
1381
|
-
(o = u = i = l = void 0);
|
1382
|
-
}),
|
1383
|
-
(T.flush = function() {
|
1384
|
-
return void 0 === l ? s : P(b());
|
1385
|
-
}),
|
1386
|
-
T
|
1387
|
-
);
|
1388
|
-
}
|
1389
|
-
function m(e) {
|
1390
|
-
var t = typeof e;
|
1391
|
-
return !!e && ('object' == t || 'function' == t);
|
1392
|
-
}
|
1393
|
-
function w(e) {
|
1394
|
-
if ('number' == typeof e) return e;
|
1395
|
-
if (
|
1396
|
-
(function(e) {
|
1397
|
-
return (
|
1398
|
-
'symbol' == typeof e ||
|
1399
|
-
((function(e) {
|
1400
|
-
return !!e && 'object' == typeof e;
|
1401
|
-
})(e) &&
|
1402
|
-
d.call(e) == o)
|
1403
|
-
);
|
1404
|
-
})(e)
|
1405
|
-
)
|
1406
|
-
return n;
|
1407
|
-
if (m(e)) {
|
1408
|
-
var t = 'function' == typeof e.valueOf ? e.valueOf() : e;
|
1409
|
-
e = m(t) ? t + '' : t;
|
1410
|
-
}
|
1411
|
-
if ('string' != typeof e) return 0 === e ? e : +e;
|
1412
|
-
e = e.replace(i, '');
|
1413
|
-
var r = s.test(e);
|
1414
|
-
return r || l.test(e)
|
1415
|
-
? u(e.slice(2), r ? 2 : 8)
|
1416
|
-
: a.test(e)
|
1417
|
-
? n
|
1418
|
-
: +e;
|
1419
|
-
}
|
1420
|
-
e.exports = function(e, t, n) {
|
1421
|
-
var o = !0,
|
1422
|
-
i = !0;
|
1423
|
-
if ('function' != typeof e) throw new TypeError(r);
|
1424
|
-
return (
|
1425
|
-
m(n) &&
|
1426
|
-
((o = 'leading' in n ? !!n.leading : o),
|
1427
|
-
(i = 'trailing' in n ? !!n.trailing : i)),
|
1428
|
-
v(e, t, { leading: o, maxWait: t, trailing: i })
|
1429
|
-
);
|
1430
|
-
};
|
1431
|
-
}.call(this, r(7)));
|
1432
|
-
},
|
1433
|
-
function(e, t, r) {
|
1434
|
-
'use strict';
|
1435
|
-
Object.defineProperty(t, '__esModule', { value: !0 });
|
1436
|
-
var n = function(e, t) {
|
1437
|
-
return 'undefined' == typeof getComputedStyle
|
1438
|
-
? e.style[t]
|
1439
|
-
: getComputedStyle(e, null).getPropertyValue(t);
|
1440
|
-
},
|
1441
|
-
o = function(e) {
|
1442
|
-
return (
|
1443
|
-
n(e, 'overflow') + n(e, 'overflow-y') + n(e, 'overflow-x')
|
1444
|
-
);
|
1445
|
-
};
|
1446
|
-
t.default = function(e) {
|
1447
|
-
if (!(e instanceof HTMLElement)) return window;
|
1448
|
-
for (
|
1449
|
-
var t = e;
|
1450
|
-
t &&
|
1451
|
-
t !== document.body &&
|
1452
|
-
t !== document.documentElement &&
|
1453
|
-
t.parentNode;
|
1454
|
-
|
1455
|
-
) {
|
1456
|
-
if (/(scroll|auto)/.test(o(t))) return t;
|
1457
|
-
t = t.parentNode;
|
1458
|
-
}
|
1459
|
-
return window;
|
1460
|
-
};
|
1461
|
-
},
|
1462
|
-
]);
|
1
|
+
(()=>{var e={296:(e,t,r)=>{var o=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,a=u||l||Function("return this")(),f=Object.prototype.toString,p=Math.max,y=Math.min,d=function(){return a.Date.now()};function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=i.test(e);return r||s.test(e)?c(e.slice(2),r?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,r){var o,n,i,s,c,u,l=0,a=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var r=o,i=n;return o=n=void 0,l=t,s=e.apply(i,r)}function O(e){return l=e,c=setTimeout(g,t),a?m(e):s}function w(e){var r=e-u;return void 0===u||r>=t||r<0||f&&e-l>=i}function g(){var e=d();if(w(e))return P(e);c=setTimeout(g,function(e){var r=t-(e-u);return f?y(r,i-(e-l)):r}(e))}function P(e){return c=void 0,v&&o?m(e):(o=n=void 0,s)}function T(){var e=d(),r=w(e);if(o=arguments,n=this,u=e,r){if(void 0===c)return O(u);if(f)return c=setTimeout(g,t),m(u)}return void 0===c&&(c=setTimeout(g,t)),s}return t=h(t)||0,b(r)&&(a=!!r.leading,i=(f="maxWait"in r)?p(h(r.maxWait)||0,t):i,v="trailing"in r?!!r.trailing:v),T.cancel=function(){void 0!==c&&clearTimeout(c),l=0,o=u=n=c=void 0},T.flush=function(){return void 0===c?s:P(d())},T}},96:(e,t,r)=>{var o="Expected a function",n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),p=Object.prototype.toString,y=Math.max,d=Math.min,b=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=s.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError(o);return h(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),function(e,t,r){var n,i,s,c,u,l,a=0,f=!1,p=!1,m=!0;if("function"!=typeof e)throw new TypeError(o);function O(t){var r=n,o=i;return n=i=void 0,a=t,c=e.apply(o,r)}function w(e){return a=e,u=setTimeout(P,t),f?O(e):c}function g(e){var r=e-l;return void 0===l||r>=t||r<0||p&&e-a>=s}function P(){var e=b();if(g(e))return T(e);u=setTimeout(P,function(e){var r=t-(e-l);return p?d(r,s-(e-a)):r}(e))}function T(e){return u=void 0,m&&n?O(e):(n=i=void 0,c)}function j(){var e=b(),r=g(e);if(n=arguments,i=this,l=e,r){if(void 0===u)return w(l);if(p)return u=setTimeout(P,t),O(l)}return void 0===u&&(u=setTimeout(P,t)),c}return t=v(t)||0,h(r)&&(f=!!r.leading,s=(p="maxWait"in r)?y(v(r.maxWait)||0,t):s,m="trailing"in r?!!r.trailing:m),j.cancel=function(){void 0!==u&&clearTimeout(u),a=0,n=l=i=u=void 0},j.flush=function(){return void 0===u?c:T(b())},j}(e,t,{leading:n,maxWait:t,trailing:i})}},703:(e,t,r)=>{"use strict";var o=r(414);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,i,s){if(s!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{LazyLoadComponent:()=>J,LazyLoadImage:()=>ie,trackWindowScroll:()=>C});const e=require("react");var t=r.n(e),n=r(697);const i=require("react-dom");var s=r.n(i);function c(){return"undefined"!=typeof window&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){e.forEach((function(e){e.isIntersecting&&e.target.onVisible()}))},h={},v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(v,e);var r,o,n,i,u=(n=v,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(n);if(i){var r=d(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return y(this,e)});function v(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),(t=u.call(this,e)).supportsObserver=!e.scrollPosition&&e.useIntersectionObserver&&c(),t.supportsObserver){var r=e.threshold;t.observer=function(e){return h[e]=h[e]||new IntersectionObserver(b,{rootMargin:e+"px"}),h[e]}(r)}return t}return r=v,(o=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollPosition,t=this.placeholder.getBoundingClientRect(),r=s().findDOMNode(this.placeholder).style,o={left:parseInt(r.getPropertyValue("margin-left"),10)||0,top:parseInt(r.getPropertyValue("margin-top"),10)||0};return{bottom:e.y+t.bottom+o.top,left:e.x+t.left+o.left,right:e.x+t.right+o.left,top:e.y+t.top+o.top}}},{key:"isPlaceholderInViewport",value:function(){if("undefined"==typeof window||!this.placeholder)return!1;var e=this.props,t=e.scrollPosition,r=e.threshold,o=this.getPlaceholderBoundingBox(t),n=t.y+window.innerHeight,i=t.x,s=t.x+window.innerWidth,c=t.y;return Boolean(c-r<=o.bottom&&n+r>=o.top&&i-r<=o.right&&s+r>=o.left)}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var e=this,r=this.props,o=r.className,n=r.height,i=r.placeholder,s=r.style,c=r.width;if(i&&"function"!=typeof i.type)return t().cloneElement(i,{ref:function(t){return e.placeholder=t}});var u=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({display:"inline-block"},s);return void 0!==c&&(u.width=c),void 0!==n&&(u.height=n),t().createElement("span",{className:o,ref:function(t){return e.placeholder=t},style:u},i)}}])&&f(r.prototype,o),v}(t().Component);v.propTypes={onVisible:n.PropTypes.func.isRequired,className:n.PropTypes.string,height:n.PropTypes.oneOfType([n.PropTypes.number,n.PropTypes.string]),placeholder:n.PropTypes.element,threshold:n.PropTypes.number,useIntersectionObserver:n.PropTypes.bool,scrollPosition:n.PropTypes.shape({x:n.PropTypes.number.isRequired,y:n.PropTypes.number.isRequired}),width:n.PropTypes.oneOfType([n.PropTypes.number,n.PropTypes.string])},v.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const m=v;var O=r(296),w=r.n(O),g=r(96),P=r.n(g),T=function(e){var t=getComputedStyle(e,null);return t.getPropertyValue("overflow")+t.getPropertyValue("overflow-y")+t.getPropertyValue("overflow-x")};const j=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t instanceof HTMLElement;){if(/(scroll|auto)/.test(T(t)))return t;t=t.parentNode}return window};function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var E=["delayMethod","delayTime"];function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function I(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){if(t&&("object"===S(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return R(e)}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var D=function(){return"undefined"==typeof window?0:window.scrollX||window.pageXOffset},N=function(){return"undefined"==typeof window?0:window.scrollY||window.pageYOffset};const C=function(e){var r=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&L(e,t)}(a,r);var o,n,i,u,l=(i=a,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=k(i);if(u){var r=k(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return x(this,e)});function a(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=l.call(this,e)).useIntersectionObserver=e.useIntersectionObserver&&c(),r.useIntersectionObserver)return x(r);var o=r.onChangeScroll.bind(R(r));return"debounce"===e.delayMethod?r.delayedScroll=w()(o,e.delayTime):"throttle"===e.delayMethod&&(r.delayedScroll=P()(o,e.delayTime)),r.state={scrollPosition:{x:D(),y:N()}},r.baseComponentRef=t().createRef(),r}return o=a,(n=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){"undefined"==typeof window||this.useIntersectionObserver||j(s().findDOMNode(this.baseComponentRef.current))!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement=j(s().findDOMNode(this.baseComponentRef.current)),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:D(),y:N()}})}},{key:"render",value:function(){var r=this.props,o=(r.delayMethod,r.delayTime,function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(r,E)),n=this.useIntersectionObserver?null:this.state.scrollPosition;return t().createElement(e,_({forwardRef:this.baseComponentRef,scrollPosition:n},o))}}])&&I(o.prototype,n),a}(t().Component);return r.propTypes={delayMethod:n.PropTypes.oneOf(["debounce","throttle"]),delayTime:n.PropTypes.number,useIntersectionObserver:n.PropTypes.bool},r.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},r};function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)}(c,e);var r,o,n,i,s=(n=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(n);if(i){var r=z(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return W(this,e)});function c(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,e)}return r=c,(o=[{key:"render",value:function(){return t().createElement(m,this.props)}}])&&B(r.prototype,o),c}(t().Component);const U=C($);function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Y(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return X(e)}function X(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&H(e,t)}(u,e);var r,o,n,i,s=(n=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(n);if(i){var r=A(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Y(this,e)});function u(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=s.call(this,e);var r=e.afterLoad,o=e.beforeLoad,n=e.scrollPosition,i=e.visibleByDefault;return t.state={visible:i},i&&(o(),r()),t.onVisible=t.onVisible.bind(X(t)),t.isScrollTracked=Boolean(n&&Number.isFinite(n.x)&&n.x>=0&&Number.isFinite(n.y)&&n.y>=0),t}return r=u,(o=[{key:"componentDidUpdate",value:function(e,t){t.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var e=this.props,r=e.className,o=e.delayMethod,n=e.delayTime,i=e.height,s=e.placeholder,u=e.scrollPosition,l=e.style,a=e.threshold,f=e.useIntersectionObserver,p=e.width;return this.isScrollTracked||f&&c()?t().createElement(m,{className:r,height:i,onVisible:this.onVisible,placeholder:s,scrollPosition:u,style:l,threshold:a,useIntersectionObserver:f,width:p}):t().createElement(U,{className:r,delayMethod:o,delayTime:n,height:i,onVisible:this.onVisible,placeholder:s,style:l,threshold:a,width:p})}}])&&F(r.prototype,o),u}(t().Component);G.propTypes={afterLoad:n.PropTypes.func,beforeLoad:n.PropTypes.func,useIntersectionObserver:n.PropTypes.bool,visibleByDefault:n.PropTypes.bool},G.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const J=G;function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function Z(){return(Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function ee(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e,t){if(t&&("object"===K(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(c,e);var r,o,n,i,s=(n=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oe(n);if(i){var r=oe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return re(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=s.call(this,e)).state={loaded:!1},t}return r=c,(o=[{key:"onImageLoad",value:function(){var e=this;return this.state.loaded?null:function(){e.props.afterLoad(),e.setState({loaded:!0})}}},{key:"getImg",value:function(){var e=this.props,r=(e.afterLoad,e.beforeLoad,e.delayMethod,e.delayTime,e.effect,e.placeholder,e.placeholderSrc,e.scrollPosition,e.threshold,e.useIntersectionObserver,e.visibleByDefault,e.wrapperClassName,e.wrapperProps,function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,Q));return t().createElement("img",Z({onLoad:this.onImageLoad()},r))}},{key:"getLazyLoadImage",value:function(){var e=this.props,r=e.beforeLoad,o=e.className,n=e.delayMethod,i=e.delayTime,s=e.height,c=e.placeholder,u=e.scrollPosition,l=e.style,a=e.threshold,f=e.useIntersectionObserver,p=e.visibleByDefault,y=e.width;return t().createElement(J,{beforeLoad:r,className:o,delayMethod:n,delayTime:i,height:s,placeholder:c,scrollPosition:u,style:l,threshold:a,useIntersectionObserver:f,visibleByDefault:p,width:y},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(e){var r=this.props,o=r.effect,n=r.height,i=r.placeholderSrc,s=r.width,c=r.wrapperClassName,u=r.wrapperProps,l=this.state.loaded,a=l?" lazy-load-image-loaded":"";return t().createElement("span",Z({className:c+" lazy-load-image-background "+o+a,style:{backgroundImage:l||!i?"":"url(".concat(i,")"),backgroundSize:l||!i?"":"100% 100%",color:"transparent",display:"inline-block",height:n,width:s}},u),e)}},{key:"render",value:function(){var e=this.props,t=e.effect,r=e.placeholderSrc,o=e.visibleByDefault,n=e.wrapperClassName,i=e.wrapperProps,s=this.getLazyLoadImage();return(t||r)&&!o||n||i?this.getWrappedLazyLoadImage(s):s}}])&&ee(r.prototype,o),c}(t().Component);ne.propTypes={afterLoad:n.PropTypes.func,beforeLoad:n.PropTypes.func,delayMethod:n.PropTypes.string,delayTime:n.PropTypes.number,effect:n.PropTypes.string,placeholderSrc:n.PropTypes.string,threshold:n.PropTypes.number,useIntersectionObserver:n.PropTypes.bool,visibleByDefault:n.PropTypes.bool,wrapperClassName:n.PropTypes.string,wrapperProps:n.PropTypes.object},ne.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const ie=ne})(),module.exports=o})();
|