@mjhls/mjh-framework 1.0.204 → 1.0.206

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD-e2479b7c.js +31 -0
  3. package/dist/cjs/DeckContent.js +430 -0
  4. package/dist/cjs/DeckQueue.js +366 -0
  5. package/dist/cjs/Dfp-d94f7f73.js +97 -0
  6. package/dist/cjs/GridContent.js +613 -0
  7. package/dist/cjs/GroupDeck.js +156 -0
  8. package/dist/cjs/IssueContentDeck.js +81 -0
  9. package/dist/cjs/IssueDeck.js +144 -0
  10. package/dist/cjs/MasterDeck.js +340 -0
  11. package/dist/cjs/Normal-7dd8c339.js +2374 -0
  12. package/dist/cjs/PublicationDeck.js +81 -0
  13. package/dist/cjs/QueueDeckExpanded.js +559 -0
  14. package/dist/cjs/TaxonomyCard-7b5b4298.js +1045 -0
  15. package/dist/cjs/TaxonomyCard.js +18 -0
  16. package/dist/cjs/TemplateNormal.js +29 -0
  17. package/dist/cjs/ThumbnailCard.js +58 -0
  18. package/dist/cjs/Ustream-0d3dd953.js +122 -0
  19. package/dist/cjs/Ustream.js +10 -0
  20. package/dist/cjs/VideoSeriesListing.js +248 -0
  21. package/dist/cjs/YoutubeGroup-4cf7a4aa.js +228 -0
  22. package/dist/cjs/YoutubeGroup.js +13 -0
  23. package/dist/cjs/_babelHelpers-f321c258.js +119 -0
  24. package/dist/cjs/_commonjsHelpers-3fc1f64e.js +20 -0
  25. package/dist/cjs/debounce-286eb3fb.js +279 -0
  26. package/dist/cjs/entities-3e0b4a16.js +506 -0
  27. package/dist/cjs/get-06aac51b.js +992 -0
  28. package/dist/cjs/index-0d0efcfa.js +610 -0
  29. package/dist/cjs/index-a4c53ff4.js +551 -0
  30. package/dist/cjs/index.es-2289df51.js +5028 -0
  31. package/dist/cjs/index.esm-340d3792.js +113 -0
  32. package/dist/cjs/index.js +12044 -0
  33. package/dist/cjs/isSymbol-311eb805.js +209 -0
  34. package/dist/cjs/main-58839f4e.js +858 -0
  35. package/dist/cjs/visibility-sensor-5c5a7302.js +2251 -0
  36. package/dist/esm/AD-1b2a3dd3.js +26 -0
  37. package/dist/esm/DeckContent.js +424 -0
  38. package/dist/esm/DeckQueue.js +360 -0
  39. package/dist/esm/Dfp-ab7941d3.js +92 -0
  40. package/dist/esm/GridContent.js +607 -0
  41. package/dist/esm/GroupDeck.js +151 -0
  42. package/dist/esm/IssueContentDeck.js +76 -0
  43. package/dist/esm/IssueDeck.js +139 -0
  44. package/dist/esm/MasterDeck.js +334 -0
  45. package/dist/esm/Normal-403c5666.js +2354 -0
  46. package/dist/esm/PublicationDeck.js +76 -0
  47. package/dist/esm/QueueDeckExpanded.js +553 -0
  48. package/dist/esm/TaxonomyCard-f9c93953.js +1039 -0
  49. package/dist/esm/TaxonomyCard.js +12 -0
  50. package/dist/esm/TemplateNormal.js +23 -0
  51. package/dist/esm/ThumbnailCard.js +53 -0
  52. package/dist/esm/Ustream-6bb45fe7.js +116 -0
  53. package/dist/esm/Ustream.js +4 -0
  54. package/dist/esm/VideoSeriesListing.js +242 -0
  55. package/dist/esm/YoutubeGroup-dc617e8b.js +222 -0
  56. package/dist/esm/YoutubeGroup.js +7 -0
  57. package/dist/esm/_babelHelpers-67c05996.js +111 -0
  58. package/dist/esm/_commonjsHelpers-ae1b5db5.js +15 -0
  59. package/dist/esm/debounce-a0242b4a.js +277 -0
  60. package/dist/esm/entities-e85d3a4a.js +503 -0
  61. package/dist/esm/get-b684ff61.js +990 -0
  62. package/dist/esm/index-3c1ee9ab.js +605 -0
  63. package/dist/esm/index-ca4ff5cb.js +548 -0
  64. package/dist/esm/index.es-f369b3e8.js +5022 -0
  65. package/dist/esm/index.esm-536609db.js +103 -0
  66. package/dist/esm/index.js +11991 -0
  67. package/dist/esm/isSymbol-c2b7d05a.js +203 -0
  68. package/dist/esm/main-dea495b7.js +851 -0
  69. package/dist/esm/visibility-sensor-3cfe6713.js +2243 -0
  70. package/package.json +8 -7
  71. package/dist/index.es.js +0 -30261
  72. package/dist/index.es.js.map +0 -1
  73. package/dist/index.js +0 -30320
  74. package/dist/index.js.map +0 -1
@@ -0,0 +1,2243 @@
1
+ import React__default from 'react';
2
+ import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-ae1b5db5.js';
3
+ import PropTypes from 'prop-types';
4
+ import reactDom from 'react-dom';
5
+
6
+ var domain;
7
+
8
+ // This constructor is used to store event handlers. Instantiating this is
9
+ // faster than explicitly calling `Object.create(null)` to get a "clean" empty
10
+ // object (tested with v8 v4.9).
11
+ function EventHandlers() {}
12
+ EventHandlers.prototype = Object.create(null);
13
+
14
+ function EventEmitter() {
15
+ EventEmitter.init.call(this);
16
+ }
17
+
18
+ // nodejs oddity
19
+ // require('events') === require('events').EventEmitter
20
+ EventEmitter.EventEmitter = EventEmitter;
21
+
22
+ EventEmitter.usingDomains = false;
23
+
24
+ EventEmitter.prototype.domain = undefined;
25
+ EventEmitter.prototype._events = undefined;
26
+ EventEmitter.prototype._maxListeners = undefined;
27
+
28
+ // By default EventEmitters will print a warning if more than 10 listeners are
29
+ // added to it. This is a useful default which helps finding memory leaks.
30
+ EventEmitter.defaultMaxListeners = 10;
31
+
32
+ EventEmitter.init = function() {
33
+ this.domain = null;
34
+ if (EventEmitter.usingDomains) {
35
+ // if there is an active domain, then attach to it.
36
+ if (domain.active ) ;
37
+ }
38
+
39
+ if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
40
+ this._events = new EventHandlers();
41
+ this._eventsCount = 0;
42
+ }
43
+
44
+ this._maxListeners = this._maxListeners || undefined;
45
+ };
46
+
47
+ // Obviously not all Emitters should be limited to 10. This function allows
48
+ // that to be increased. Set to zero for unlimited.
49
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
50
+ if (typeof n !== 'number' || n < 0 || isNaN(n))
51
+ throw new TypeError('"n" argument must be a positive number');
52
+ this._maxListeners = n;
53
+ return this;
54
+ };
55
+
56
+ function $getMaxListeners(that) {
57
+ if (that._maxListeners === undefined)
58
+ return EventEmitter.defaultMaxListeners;
59
+ return that._maxListeners;
60
+ }
61
+
62
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
63
+ return $getMaxListeners(this);
64
+ };
65
+
66
+ // These standalone emit* functions are used to optimize calling of event
67
+ // handlers for fast cases because emit() itself often has a variable number of
68
+ // arguments and can be deoptimized because of that. These functions always have
69
+ // the same number of arguments and thus do not get deoptimized, so the code
70
+ // inside them can execute faster.
71
+ function emitNone(handler, isFn, self) {
72
+ if (isFn)
73
+ handler.call(self);
74
+ else {
75
+ var len = handler.length;
76
+ var listeners = arrayClone(handler, len);
77
+ for (var i = 0; i < len; ++i)
78
+ listeners[i].call(self);
79
+ }
80
+ }
81
+ function emitOne(handler, isFn, self, arg1) {
82
+ if (isFn)
83
+ handler.call(self, arg1);
84
+ else {
85
+ var len = handler.length;
86
+ var listeners = arrayClone(handler, len);
87
+ for (var i = 0; i < len; ++i)
88
+ listeners[i].call(self, arg1);
89
+ }
90
+ }
91
+ function emitTwo(handler, isFn, self, arg1, arg2) {
92
+ if (isFn)
93
+ handler.call(self, arg1, arg2);
94
+ else {
95
+ var len = handler.length;
96
+ var listeners = arrayClone(handler, len);
97
+ for (var i = 0; i < len; ++i)
98
+ listeners[i].call(self, arg1, arg2);
99
+ }
100
+ }
101
+ function emitThree(handler, isFn, self, arg1, arg2, arg3) {
102
+ if (isFn)
103
+ handler.call(self, arg1, arg2, arg3);
104
+ else {
105
+ var len = handler.length;
106
+ var listeners = arrayClone(handler, len);
107
+ for (var i = 0; i < len; ++i)
108
+ listeners[i].call(self, arg1, arg2, arg3);
109
+ }
110
+ }
111
+
112
+ function emitMany(handler, isFn, self, args) {
113
+ if (isFn)
114
+ handler.apply(self, args);
115
+ else {
116
+ var len = handler.length;
117
+ var listeners = arrayClone(handler, len);
118
+ for (var i = 0; i < len; ++i)
119
+ listeners[i].apply(self, args);
120
+ }
121
+ }
122
+
123
+ EventEmitter.prototype.emit = function emit(type) {
124
+ var er, handler, len, args, i, events, domain;
125
+ var doError = (type === 'error');
126
+
127
+ events = this._events;
128
+ if (events)
129
+ doError = (doError && events.error == null);
130
+ else if (!doError)
131
+ return false;
132
+
133
+ domain = this.domain;
134
+
135
+ // If there is no 'error' event listener then throw.
136
+ if (doError) {
137
+ er = arguments[1];
138
+ if (domain) {
139
+ if (!er)
140
+ er = new Error('Uncaught, unspecified "error" event');
141
+ er.domainEmitter = this;
142
+ er.domain = domain;
143
+ er.domainThrown = false;
144
+ domain.emit('error', er);
145
+ } else if (er instanceof Error) {
146
+ throw er; // Unhandled 'error' event
147
+ } else {
148
+ // At least give some kind of context to the user
149
+ var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
150
+ err.context = er;
151
+ throw err;
152
+ }
153
+ return false;
154
+ }
155
+
156
+ handler = events[type];
157
+
158
+ if (!handler)
159
+ return false;
160
+
161
+ var isFn = typeof handler === 'function';
162
+ len = arguments.length;
163
+ switch (len) {
164
+ // fast cases
165
+ case 1:
166
+ emitNone(handler, isFn, this);
167
+ break;
168
+ case 2:
169
+ emitOne(handler, isFn, this, arguments[1]);
170
+ break;
171
+ case 3:
172
+ emitTwo(handler, isFn, this, arguments[1], arguments[2]);
173
+ break;
174
+ case 4:
175
+ emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
176
+ break;
177
+ // slower
178
+ default:
179
+ args = new Array(len - 1);
180
+ for (i = 1; i < len; i++)
181
+ args[i - 1] = arguments[i];
182
+ emitMany(handler, isFn, this, args);
183
+ }
184
+
185
+ return true;
186
+ };
187
+
188
+ function _addListener(target, type, listener, prepend) {
189
+ var m;
190
+ var events;
191
+ var existing;
192
+
193
+ if (typeof listener !== 'function')
194
+ throw new TypeError('"listener" argument must be a function');
195
+
196
+ events = target._events;
197
+ if (!events) {
198
+ events = target._events = new EventHandlers();
199
+ target._eventsCount = 0;
200
+ } else {
201
+ // To avoid recursion in the case that type === "newListener"! Before
202
+ // adding it to the listeners, first emit "newListener".
203
+ if (events.newListener) {
204
+ target.emit('newListener', type,
205
+ listener.listener ? listener.listener : listener);
206
+
207
+ // Re-assign `events` because a newListener handler could have caused the
208
+ // this._events to be assigned to a new object
209
+ events = target._events;
210
+ }
211
+ existing = events[type];
212
+ }
213
+
214
+ if (!existing) {
215
+ // Optimize the case of one listener. Don't need the extra array object.
216
+ existing = events[type] = listener;
217
+ ++target._eventsCount;
218
+ } else {
219
+ if (typeof existing === 'function') {
220
+ // Adding the second element, need to change to array.
221
+ existing = events[type] = prepend ? [listener, existing] :
222
+ [existing, listener];
223
+ } else {
224
+ // If we've already got an array, just append.
225
+ if (prepend) {
226
+ existing.unshift(listener);
227
+ } else {
228
+ existing.push(listener);
229
+ }
230
+ }
231
+
232
+ // Check for listener leak
233
+ if (!existing.warned) {
234
+ m = $getMaxListeners(target);
235
+ if (m && m > 0 && existing.length > m) {
236
+ existing.warned = true;
237
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
238
+ existing.length + ' ' + type + ' listeners added. ' +
239
+ 'Use emitter.setMaxListeners() to increase limit');
240
+ w.name = 'MaxListenersExceededWarning';
241
+ w.emitter = target;
242
+ w.type = type;
243
+ w.count = existing.length;
244
+ emitWarning(w);
245
+ }
246
+ }
247
+ }
248
+
249
+ return target;
250
+ }
251
+ function emitWarning(e) {
252
+ typeof console.warn === 'function' ? console.warn(e) : console.log(e);
253
+ }
254
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
255
+ return _addListener(this, type, listener, false);
256
+ };
257
+
258
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
259
+
260
+ EventEmitter.prototype.prependListener =
261
+ function prependListener(type, listener) {
262
+ return _addListener(this, type, listener, true);
263
+ };
264
+
265
+ function _onceWrap(target, type, listener) {
266
+ var fired = false;
267
+ function g() {
268
+ target.removeListener(type, g);
269
+ if (!fired) {
270
+ fired = true;
271
+ listener.apply(target, arguments);
272
+ }
273
+ }
274
+ g.listener = listener;
275
+ return g;
276
+ }
277
+
278
+ EventEmitter.prototype.once = function once(type, listener) {
279
+ if (typeof listener !== 'function')
280
+ throw new TypeError('"listener" argument must be a function');
281
+ this.on(type, _onceWrap(this, type, listener));
282
+ return this;
283
+ };
284
+
285
+ EventEmitter.prototype.prependOnceListener =
286
+ function prependOnceListener(type, listener) {
287
+ if (typeof listener !== 'function')
288
+ throw new TypeError('"listener" argument must be a function');
289
+ this.prependListener(type, _onceWrap(this, type, listener));
290
+ return this;
291
+ };
292
+
293
+ // emits a 'removeListener' event iff the listener was removed
294
+ EventEmitter.prototype.removeListener =
295
+ function removeListener(type, listener) {
296
+ var list, events, position, i, originalListener;
297
+
298
+ if (typeof listener !== 'function')
299
+ throw new TypeError('"listener" argument must be a function');
300
+
301
+ events = this._events;
302
+ if (!events)
303
+ return this;
304
+
305
+ list = events[type];
306
+ if (!list)
307
+ return this;
308
+
309
+ if (list === listener || (list.listener && list.listener === listener)) {
310
+ if (--this._eventsCount === 0)
311
+ this._events = new EventHandlers();
312
+ else {
313
+ delete events[type];
314
+ if (events.removeListener)
315
+ this.emit('removeListener', type, list.listener || listener);
316
+ }
317
+ } else if (typeof list !== 'function') {
318
+ position = -1;
319
+
320
+ for (i = list.length; i-- > 0;) {
321
+ if (list[i] === listener ||
322
+ (list[i].listener && list[i].listener === listener)) {
323
+ originalListener = list[i].listener;
324
+ position = i;
325
+ break;
326
+ }
327
+ }
328
+
329
+ if (position < 0)
330
+ return this;
331
+
332
+ if (list.length === 1) {
333
+ list[0] = undefined;
334
+ if (--this._eventsCount === 0) {
335
+ this._events = new EventHandlers();
336
+ return this;
337
+ } else {
338
+ delete events[type];
339
+ }
340
+ } else {
341
+ spliceOne(list, position);
342
+ }
343
+
344
+ if (events.removeListener)
345
+ this.emit('removeListener', type, originalListener || listener);
346
+ }
347
+
348
+ return this;
349
+ };
350
+
351
+ EventEmitter.prototype.removeAllListeners =
352
+ function removeAllListeners(type) {
353
+ var listeners, events;
354
+
355
+ events = this._events;
356
+ if (!events)
357
+ return this;
358
+
359
+ // not listening for removeListener, no need to emit
360
+ if (!events.removeListener) {
361
+ if (arguments.length === 0) {
362
+ this._events = new EventHandlers();
363
+ this._eventsCount = 0;
364
+ } else if (events[type]) {
365
+ if (--this._eventsCount === 0)
366
+ this._events = new EventHandlers();
367
+ else
368
+ delete events[type];
369
+ }
370
+ return this;
371
+ }
372
+
373
+ // emit removeListener for all listeners on all events
374
+ if (arguments.length === 0) {
375
+ var keys = Object.keys(events);
376
+ for (var i = 0, key; i < keys.length; ++i) {
377
+ key = keys[i];
378
+ if (key === 'removeListener') continue;
379
+ this.removeAllListeners(key);
380
+ }
381
+ this.removeAllListeners('removeListener');
382
+ this._events = new EventHandlers();
383
+ this._eventsCount = 0;
384
+ return this;
385
+ }
386
+
387
+ listeners = events[type];
388
+
389
+ if (typeof listeners === 'function') {
390
+ this.removeListener(type, listeners);
391
+ } else if (listeners) {
392
+ // LIFO order
393
+ do {
394
+ this.removeListener(type, listeners[listeners.length - 1]);
395
+ } while (listeners[0]);
396
+ }
397
+
398
+ return this;
399
+ };
400
+
401
+ EventEmitter.prototype.listeners = function listeners(type) {
402
+ var evlistener;
403
+ var ret;
404
+ var events = this._events;
405
+
406
+ if (!events)
407
+ ret = [];
408
+ else {
409
+ evlistener = events[type];
410
+ if (!evlistener)
411
+ ret = [];
412
+ else if (typeof evlistener === 'function')
413
+ ret = [evlistener.listener || evlistener];
414
+ else
415
+ ret = unwrapListeners(evlistener);
416
+ }
417
+
418
+ return ret;
419
+ };
420
+
421
+ EventEmitter.listenerCount = function(emitter, type) {
422
+ if (typeof emitter.listenerCount === 'function') {
423
+ return emitter.listenerCount(type);
424
+ } else {
425
+ return listenerCount.call(emitter, type);
426
+ }
427
+ };
428
+
429
+ EventEmitter.prototype.listenerCount = listenerCount;
430
+ function listenerCount(type) {
431
+ var events = this._events;
432
+
433
+ if (events) {
434
+ var evlistener = events[type];
435
+
436
+ if (typeof evlistener === 'function') {
437
+ return 1;
438
+ } else if (evlistener) {
439
+ return evlistener.length;
440
+ }
441
+ }
442
+
443
+ return 0;
444
+ }
445
+
446
+ EventEmitter.prototype.eventNames = function eventNames() {
447
+ return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
448
+ };
449
+
450
+ // About 1.5x faster than the two-arg version of Array#splice().
451
+ function spliceOne(list, index) {
452
+ for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
453
+ list[i] = list[k];
454
+ list.pop();
455
+ }
456
+
457
+ function arrayClone(arr, i) {
458
+ var copy = new Array(i);
459
+ while (i--)
460
+ copy[i] = arr[i];
461
+ return copy;
462
+ }
463
+
464
+ function unwrapListeners(arr) {
465
+ var ret = new Array(arr.length);
466
+ for (var i = 0; i < ret.length; ++i) {
467
+ ret[i] = arr[i].listener || arr[i];
468
+ }
469
+ return ret;
470
+ }
471
+
472
+ var utils = createCommonjsModule(function (module, exports) {
473
+
474
+ Object.defineProperty(exports, "__esModule", {
475
+ value: true
476
+ });
477
+ exports.loadGPTScript = loadGPTScript;
478
+
479
+ function doloadGPTScript(resolve, reject) {
480
+ window.googletag = window.googletag || {};
481
+ window.googletag.cmd = window.googletag.cmd || [];
482
+ var scriptTag = document.createElement('script');
483
+ scriptTag.src = "".concat(document.location.protocol, "//securepubads.g.doubleclick.net/tag/js/gpt.js");
484
+ scriptTag.async = true;
485
+ scriptTag.type = 'text/javascript';
486
+
487
+ scriptTag.onerror = function scriptTagOnError(errs) {
488
+ reject(errs);
489
+ };
490
+
491
+ scriptTag.onload = function scriptTagOnLoad() {
492
+ resolve(window.googletag);
493
+ };
494
+
495
+ document.getElementsByTagName('head')[0].appendChild(scriptTag);
496
+ }
497
+
498
+ function loadGPTScript() {
499
+ return new Promise(function (resolve, reject) {
500
+ doloadGPTScript(resolve, reject);
501
+ });
502
+ }
503
+ });
504
+
505
+ unwrapExports(utils);
506
+ var utils_1 = utils.loadGPTScript;
507
+
508
+ var manager = createCommonjsModule(function (module, exports) {
509
+
510
+ Object.defineProperty(exports, "__esModule", {
511
+ value: true
512
+ });
513
+ exports.default = void 0;
514
+
515
+
516
+
517
+ var Utils = _interopRequireWildcard(utils);
518
+
519
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
520
+
521
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
522
+
523
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
524
+
525
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
526
+
527
+ var loadPromise = null;
528
+ var googleGPTScriptLoadPromise = null;
529
+ var singleRequestEnabled = true;
530
+ var disableInitialLoadEnabled = false;
531
+ var lazyLoadEnabled = false;
532
+ var lazyLoadConfig = null;
533
+ var servePersonalizedAds = true;
534
+ var registeredSlots = {};
535
+ var managerAlreadyInitialized = false;
536
+ var globalTargetingArguments = {};
537
+ var globalAdSenseAttributes = {};
538
+ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0), {
539
+ singleRequestIsEnabled: function singleRequestIsEnabled() {
540
+ return singleRequestEnabled;
541
+ },
542
+ configureSingleRequest: function configureSingleRequest(value) {
543
+ singleRequestEnabled = !!value;
544
+ },
545
+ disableInitialLoadIsEnabled: function disableInitialLoadIsEnabled() {
546
+ return disableInitialLoadEnabled;
547
+ },
548
+ configureDisableInitialLoad: function configureDisableInitialLoad(value) {
549
+ disableInitialLoadEnabled = !!value;
550
+ },
551
+ configureLazyLoad: function configureLazyLoad() {
552
+ var enable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
553
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
554
+ var conf = null;
555
+
556
+ if (config !== null && _typeof(config) === 'object') {
557
+ conf = _objectSpread({}, config);
558
+ }
559
+
560
+ lazyLoadEnabled = !!enable;
561
+ lazyLoadConfig = conf;
562
+ },
563
+ lazyLoadIsEnabled: function lazyLoadIsEnabled() {
564
+ return lazyLoadEnabled;
565
+ },
566
+ getLazyLoadConfig: function getLazyLoadConfig() {
567
+ return lazyLoadConfig;
568
+ },
569
+ getAdSenseAttribute: function getAdSenseAttribute(key) {
570
+ return globalAdSenseAttributes[key];
571
+ },
572
+ configurePersonalizedAds: function configurePersonalizedAds(value) {
573
+ servePersonalizedAds = value;
574
+ },
575
+ personalizedAdsEnabled: function personalizedAdsEnabled() {
576
+ return servePersonalizedAds;
577
+ },
578
+ setAdSenseAttribute: function setAdSenseAttribute(key, value) {
579
+ this.setAdSenseAttributes(_defineProperty({}, key, value));
580
+ },
581
+ getAdSenseAttributes: function getAdSenseAttributes() {
582
+ return _objectSpread({}, globalAdSenseAttributes);
583
+ },
584
+ setAdSenseAttributes: function setAdSenseAttributes(attrs) {
585
+ Object.assign(globalAdSenseAttributes, attrs);
586
+
587
+ if (managerAlreadyInitialized === true) {
588
+ this.getGoogletag().then(function (googletag) {
589
+ googletag.cmd.push(function () {
590
+ var pubadsService = googletag.pubads();
591
+ Object.keys(globalAdSenseAttributes).forEach(function (key) {
592
+ pubadsService.set(key, globalTargetingArguments[key]);
593
+ });
594
+ });
595
+ });
596
+ }
597
+ },
598
+ setTargetingArguments: function setTargetingArguments(data) {
599
+ Object.assign(globalTargetingArguments, data);
600
+
601
+ if (managerAlreadyInitialized === true) {
602
+ this.getGoogletag().then(function (googletag) {
603
+ googletag.cmd.push(function () {
604
+ var pubadsService = googletag.pubads();
605
+ Object.keys(globalTargetingArguments).forEach(function (varName) {
606
+ if (pubadsService) {
607
+ pubadsService.setTargeting(varName, globalTargetingArguments[varName]);
608
+ }
609
+ });
610
+ });
611
+ });
612
+ }
613
+ },
614
+ getTargetingArguments: function getTargetingArguments() {
615
+ return _objectSpread({}, globalTargetingArguments);
616
+ },
617
+ getSlotProperty: function getSlotProperty(slotId, propName) {
618
+ var slot = this.getRegisteredSlots()[slotId];
619
+ var ret = null;
620
+
621
+ if (slot !== undefined) {
622
+ ret = slot[propName] || ret;
623
+ }
624
+
625
+ return ret;
626
+ },
627
+ getSlotTargetingArguments: function getSlotTargetingArguments(slotId) {
628
+ var propValue = this.getSlotProperty(slotId, 'targetingArguments');
629
+ return propValue ? _objectSpread({}, propValue) : null;
630
+ },
631
+ getSlotAdSenseAttributes: function getSlotAdSenseAttributes(slotId) {
632
+ var propValue = this.getSlotProperty(slotId, 'adSenseAttributes');
633
+ return propValue ? _objectSpread({}, propValue) : null;
634
+ },
635
+ init: function init() {
636
+ var _this = this;
637
+
638
+ if (managerAlreadyInitialized === false) {
639
+ managerAlreadyInitialized = true;
640
+ this.getGoogletag().then(function (googletag) {
641
+ googletag.cmd.push(function () {
642
+ var pubadsService = googletag.pubads();
643
+ pubadsService.addEventListener('slotRenderEnded', function (event) {
644
+ var slotId = event.slot.getSlotElementId();
645
+
646
+ _this.emit('slotRenderEnded', {
647
+ slotId: slotId,
648
+ event: event
649
+ });
650
+ });
651
+ pubadsService.addEventListener('impressionViewable', function (event) {
652
+ var slotId = event.slot.getSlotElementId();
653
+
654
+ _this.emit('impressionViewable', {
655
+ slotId: slotId,
656
+ event: event
657
+ });
658
+ });
659
+ pubadsService.addEventListener('slotVisibilityChanged', function (event) {
660
+ var slotId = event.slot.getSlotElementId();
661
+
662
+ _this.emit('slotVisibilityChanged', {
663
+ slotId: slotId,
664
+ event: event
665
+ });
666
+ });
667
+ pubadsService.setRequestNonPersonalizedAds(_this.personalizedAdsEnabled() ? 0 : 1);
668
+ });
669
+ });
670
+ }
671
+ },
672
+ getGoogletag: function getGoogletag() {
673
+ if (googleGPTScriptLoadPromise === null) {
674
+ googleGPTScriptLoadPromise = Utils.loadGPTScript();
675
+ }
676
+
677
+ return googleGPTScriptLoadPromise;
678
+ },
679
+ setCollapseEmptyDivs: function setCollapseEmptyDivs(collapse) {
680
+ this.collapseEmptyDivs = collapse;
681
+ },
682
+ load: function load() {
683
+ var _this2 = this;
684
+
685
+ for (var _len = arguments.length, slots = new Array(_len), _key = 0; _key < _len; _key++) {
686
+ slots[_key] = arguments[_key];
687
+ }
688
+
689
+ if (loadPromise === null) {
690
+ loadPromise = this.doLoad.apply(this, slots);
691
+ } else {
692
+ loadPromise = loadPromise.then(function () {
693
+ return _this2.doLoad.apply(_this2, slots);
694
+ });
695
+ }
696
+ },
697
+ doLoad: function doLoad() {
698
+ this.init();
699
+ var availableSlots = {};
700
+
701
+ for (var _len2 = arguments.length, slots = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
702
+ slots[_key2] = arguments[_key2];
703
+ }
704
+
705
+ if (slots.length > 0) {
706
+ availableSlots = slots.filter(function (slotId) {
707
+ return Object.prototype.hasOwnProperty.call(registeredSlots, slotId);
708
+ });
709
+ } else {
710
+ availableSlots = Object.keys(registeredSlots);
711
+ }
712
+
713
+ availableSlots = availableSlots.filter(function (id) {
714
+ return !registeredSlots[id].loading && !registeredSlots[id].gptSlot;
715
+ });
716
+ availableSlots.forEach(function (slotId) {
717
+ registeredSlots[slotId].loading = true;
718
+ });
719
+ return this.gptLoadAds(availableSlots);
720
+ },
721
+ gptLoadAds: function gptLoadAds(slotsToInitialize) {
722
+ var _this3 = this;
723
+
724
+ return new Promise(function (resolve) {
725
+ _this3.getGoogletag().then(function (googletag) {
726
+ _this3.configureInitialOptions(googletag);
727
+
728
+ slotsToInitialize.forEach(function (currentSlotId) {
729
+ registeredSlots[currentSlotId].loading = false;
730
+ googletag.cmd.push(function () {
731
+ var slot = registeredSlots[currentSlotId];
732
+ var gptSlot;
733
+ var adUnit = "".concat(slot.dfpNetworkId, "/").concat(slot.adUnit);
734
+
735
+ if (slot.renderOutOfThePage === true) {
736
+ gptSlot = googletag.defineOutOfPageSlot(adUnit, currentSlotId);
737
+ } else {
738
+ gptSlot = googletag.defineSlot(adUnit, slot.sizes, currentSlotId);
739
+ }
740
+
741
+ if (gptSlot !== null) {
742
+ slot.gptSlot = gptSlot;
743
+
744
+ var slotTargetingArguments = _this3.getSlotTargetingArguments(currentSlotId);
745
+
746
+ if (slotTargetingArguments !== null) {
747
+ Object.keys(slotTargetingArguments).forEach(function (varName) {
748
+ if (slot && slot.gptSlot) {
749
+ slot.gptSlot.setTargeting(varName, slotTargetingArguments[varName]);
750
+ }
751
+ });
752
+ }
753
+
754
+ var slotAdSenseAttributes = _this3.getSlotAdSenseAttributes(currentSlotId);
755
+
756
+ if (slotAdSenseAttributes !== null) {
757
+ Object.keys(slotAdSenseAttributes).forEach(function (varName) {
758
+ slot.gptSlot.set(varName, slotAdSenseAttributes[varName]);
759
+ });
760
+ }
761
+
762
+ slot.gptSlot.addService(googletag.pubads());
763
+
764
+ if (slot.sizeMapping) {
765
+ var smbuilder = googletag.sizeMapping();
766
+ slot.sizeMapping.forEach(function (mapping) {
767
+ smbuilder = smbuilder.addSize(mapping.viewport, mapping.sizes);
768
+ });
769
+ slot.gptSlot.defineSizeMapping(smbuilder.build());
770
+ }
771
+ }
772
+ });
773
+ });
774
+
775
+ _this3.configureOptions(googletag);
776
+
777
+ googletag.cmd.push(function () {
778
+ googletag.enableServices();
779
+
780
+ if (!_this3.disableInitialLoadIsEnabled()) {
781
+ slotsToInitialize.forEach(function (theSlotId) {
782
+ googletag.display(theSlotId);
783
+ });
784
+ }
785
+
786
+ resolve();
787
+ });
788
+ });
789
+ });
790
+ },
791
+ // configure those gpt parameters that need to be set before pubsads service
792
+ // initialization.
793
+ configureInitialOptions: function configureInitialOptions(googletag) {
794
+ var _this4 = this;
795
+
796
+ googletag.cmd.push(function () {
797
+ if (_this4.disableInitialLoadIsEnabled()) {
798
+ googletag.pubads().disableInitialLoad();
799
+ }
800
+ });
801
+ },
802
+ configureOptions: function configureOptions(googletag) {
803
+ var _this5 = this;
804
+
805
+ googletag.cmd.push(function () {
806
+ var pubadsService = googletag.pubads();
807
+ pubadsService.setRequestNonPersonalizedAds(_this5.personalizedAdsEnabled() ? 0 : 1);
808
+
809
+ var targetingArguments = _this5.getTargetingArguments(); // set global targetting arguments
810
+
811
+
812
+ Object.keys(targetingArguments).forEach(function (varName) {
813
+ if (pubadsService) {
814
+ pubadsService.setTargeting(varName, targetingArguments[varName]);
815
+ }
816
+ }); // set global adSense attributes
817
+
818
+ var adSenseAttributes = _this5.getAdSenseAttributes();
819
+
820
+ Object.keys(adSenseAttributes).forEach(function (key) {
821
+ pubadsService.set(key, adSenseAttributes[key]);
822
+ });
823
+
824
+ if (_this5.lazyLoadIsEnabled()) {
825
+ var args = [];
826
+
827
+ var config = _this5.getLazyLoadConfig();
828
+
829
+ if (config !== null) {
830
+ args.push(config);
831
+ }
832
+
833
+ pubadsService.enableLazyLoad.call(args);
834
+ }
835
+
836
+ if (_this5.singleRequestIsEnabled()) {
837
+ pubadsService.enableSingleRequest();
838
+ }
839
+
840
+ if (_this5.collapseEmptyDivs === true || _this5.collapseEmptyDivs === false) {
841
+ pubadsService.collapseEmptyDivs(_this5.collapseEmptyDivs);
842
+ }
843
+ });
844
+ },
845
+ getRefreshableSlots: function getRefreshableSlots() {
846
+ var slots = {};
847
+
848
+ for (var _len3 = arguments.length, slotsArray = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
849
+ slotsArray[_key3] = arguments[_key3];
850
+ }
851
+
852
+ if (slotsArray.length === 0) {
853
+ var slotsToRefresh = Object.keys(registeredSlots).map(function (k) {
854
+ return registeredSlots[k];
855
+ });
856
+ return slotsToRefresh.reduce(function (last, slot) {
857
+ if (slot.slotShouldRefresh() === true) {
858
+ slots[slot.slotId] = slot;
859
+ }
860
+
861
+ return slots;
862
+ }, slots);
863
+ }
864
+
865
+ return slotsArray.reduce(function (last, slotId) {
866
+ var slot = registeredSlots[slotId];
867
+
868
+ if (typeof slot !== 'undefined') {
869
+ slots[slotId] = slot;
870
+ }
871
+
872
+ return slots;
873
+ }, slots);
874
+ },
875
+ refresh: function refresh() {
876
+ if (loadPromise === null) {
877
+ this.load();
878
+ } else {
879
+ this.gptRefreshAds(Object.keys(this.getRefreshableSlots.apply(this, arguments)));
880
+ }
881
+ },
882
+ gptRefreshAds: function gptRefreshAds(slots) {
883
+ var _this6 = this;
884
+
885
+ return this.getGoogletag().then(function (googletag) {
886
+ _this6.configureOptions(googletag);
887
+
888
+ googletag.cmd.push(function () {
889
+ var pubadsService = googletag.pubads();
890
+ pubadsService.refresh(slots.map(function (slotId) {
891
+ return registeredSlots[slotId].gptSlot;
892
+ }));
893
+ });
894
+ });
895
+ },
896
+ reload: function reload() {
897
+ var _this7 = this;
898
+
899
+ return this.destroyGPTSlots.apply(this, arguments).then(function () {
900
+ return _this7.load();
901
+ });
902
+ },
903
+ destroyGPTSlots: function destroyGPTSlots() {
904
+ var _this8 = this;
905
+
906
+ for (var _len4 = arguments.length, slotsToDestroy = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
907
+ slotsToDestroy[_key4] = arguments[_key4];
908
+ }
909
+
910
+ if (slotsToDestroy.length === 0) {
911
+ // eslint-disable-next-line no-param-reassign
912
+ slotsToDestroy = Object.keys(registeredSlots);
913
+ }
914
+
915
+ return new Promise(function (resolve) {
916
+ var slots = []; // eslint-disable-next-line guard-for-in,no-restricted-syntax
917
+
918
+ for (var idx in slotsToDestroy) {
919
+ var slotId = slotsToDestroy[idx];
920
+ var slot = registeredSlots[slotId];
921
+ slots.push(slot);
922
+ }
923
+
924
+ _this8.getGoogletag().then(function (googletag) {
925
+ googletag.cmd.push(function () {
926
+ if (managerAlreadyInitialized === true) {
927
+ if (slotsToDestroy.length > 0) {
928
+ // eslint-disable-next-line guard-for-in,no-restricted-syntax
929
+ for (var _idx in slots) {
930
+ var _slot = slots[_idx];
931
+ slots.push(_slot.gptSlot);
932
+ delete _slot.gptSlot;
933
+ }
934
+
935
+ googletag.destroySlots(slots);
936
+ } else {
937
+ googletag.destroySlots();
938
+ }
939
+ }
940
+
941
+ resolve(slotsToDestroy);
942
+ });
943
+ });
944
+ });
945
+ },
946
+ registerSlot: function registerSlot(_ref) {
947
+ var _this9 = this;
948
+
949
+ var slotId = _ref.slotId,
950
+ dfpNetworkId = _ref.dfpNetworkId,
951
+ adUnit = _ref.adUnit,
952
+ sizes = _ref.sizes,
953
+ renderOutOfThePage = _ref.renderOutOfThePage,
954
+ sizeMapping = _ref.sizeMapping,
955
+ adSenseAttributes = _ref.adSenseAttributes,
956
+ targetingArguments = _ref.targetingArguments,
957
+ slotShouldRefresh = _ref.slotShouldRefresh;
958
+ var autoLoad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
959
+
960
+ if (!Object.prototype.hasOwnProperty.call(registeredSlots, slotId)) {
961
+ registeredSlots[slotId] = {
962
+ slotId: slotId,
963
+ sizes: sizes,
964
+ renderOutOfThePage: renderOutOfThePage,
965
+ dfpNetworkId: dfpNetworkId,
966
+ adUnit: adUnit,
967
+ adSenseAttributes: adSenseAttributes,
968
+ targetingArguments: targetingArguments,
969
+ sizeMapping: sizeMapping,
970
+ slotShouldRefresh: slotShouldRefresh,
971
+ loading: false
972
+ };
973
+ this.emit('slotRegistered', {
974
+ slotId: slotId
975
+ });
976
+
977
+ if (autoLoad === true && loadPromise !== null) {
978
+ loadPromise = loadPromise.catch().then(function () {
979
+ var slot = registeredSlots[slotId];
980
+
981
+ if (typeof slot !== 'undefined') {
982
+ var loading = slot.loading,
983
+ gptSlot = slot.gptSlot;
984
+
985
+ if (loading === false && !gptSlot) {
986
+ _this9.load(slotId);
987
+ }
988
+ }
989
+ });
990
+ }
991
+ }
992
+ },
993
+ unregisterSlot: function unregisterSlot(_ref2) {
994
+ var slotId = _ref2.slotId;
995
+ this.destroyGPTSlots(slotId);
996
+ delete registeredSlots[slotId];
997
+ },
998
+ getRegisteredSlots: function getRegisteredSlots() {
999
+ return registeredSlots;
1000
+ },
1001
+ attachSlotRenderEnded: function attachSlotRenderEnded(cb) {
1002
+ this.on('slotRenderEnded', cb);
1003
+ },
1004
+ detachSlotRenderEnded: function detachSlotRenderEnded(cb) {
1005
+ this.removeListener('slotRenderEnded', cb);
1006
+ },
1007
+ attachSlotVisibilityChanged: function attachSlotVisibilityChanged(cb) {
1008
+ this.on('slotVisibilityChanged', cb);
1009
+ },
1010
+ detachSlotVisibilityChanged: function detachSlotVisibilityChanged(cb) {
1011
+ this.removeListener('slotVisibilityChanged', cb);
1012
+ },
1013
+ attachSlotIsViewable: function attachSlotIsViewable(cb) {
1014
+ this.on('impressionViewable', cb);
1015
+ },
1016
+ detachSlotIsViewable: function detachSlotIsViewable(cb) {
1017
+ this.removeListener('impressionViewable', cb);
1018
+ }
1019
+ });
1020
+ var _default = DFPManager;
1021
+ exports.default = _default;
1022
+ });
1023
+
1024
+ unwrapExports(manager);
1025
+
1026
+ var dfpslotsprovider = createCommonjsModule(function (module, exports) {
1027
+
1028
+ Object.defineProperty(exports, "__esModule", {
1029
+ value: true
1030
+ });
1031
+ exports.default = exports.Context = void 0;
1032
+
1033
+ var _react = _interopRequireDefault(React__default);
1034
+
1035
+ var _propTypes = _interopRequireDefault(PropTypes);
1036
+
1037
+ var _manager = _interopRequireDefault(manager);
1038
+
1039
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1040
+
1041
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1042
+
1043
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1044
+
1045
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1046
+
1047
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1048
+
1049
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1050
+
1051
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1052
+
1053
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1054
+
1055
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1056
+
1057
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1058
+
1059
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1060
+
1061
+ // React.createContext is undefined for React < 16.3
1062
+ var Context = _react.default.createContext ? _react.default.createContext({
1063
+ dfpNetworkId: null,
1064
+ dfpAdUnit: null,
1065
+ dfpSizeMapping: null,
1066
+ dfpTargetingArguments: null,
1067
+ newSlotCallback: null
1068
+ }) : null;
1069
+ exports.Context = Context;
1070
+
1071
+ var DFPSlotsProvider =
1072
+ /*#__PURE__*/
1073
+ function (_React$Component) {
1074
+ _inherits(DFPSlotsProvider, _React$Component);
1075
+
1076
+ function DFPSlotsProvider(props) {
1077
+ var _this;
1078
+
1079
+ _classCallCheck(this, DFPSlotsProvider);
1080
+
1081
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(DFPSlotsProvider).call(this, props));
1082
+ _this.loadAdsIfPossible = _this.loadAdsIfPossible.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1083
+ _this.newSlotCallback = _this.newSlotCallback.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1084
+ _this.applyConfigs = _this.applyConfigs.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1085
+ _this.shouldReloadConfig = _this.shouldReloadConfig.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1086
+ _this.attachLoadCallback = _this.attachLoadCallback.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1087
+ _this.getContextValue = _this.getContextValue.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1088
+ _this.loadAlreadyCalled = false;
1089
+ _this.loadCallbackAttached = false;
1090
+ _this.shouldReloadAds = false;
1091
+ _this.totalSlots = 0;
1092
+ _this.contextValue = {};
1093
+
1094
+ if (Context === null) {
1095
+ _this.getChildContext = function () {
1096
+ return _this.getContextValue();
1097
+ };
1098
+ }
1099
+
1100
+ return _this;
1101
+ }
1102
+
1103
+ _createClass(DFPSlotsProvider, [{
1104
+ key: "componentDidMount",
1105
+ value: function componentDidMount() {
1106
+ this.applyConfigs();
1107
+
1108
+ if (this.props.autoLoad && !this.loadAdsIfPossible()) {
1109
+ this.attachLoadCallback();
1110
+ }
1111
+ }
1112
+ }, {
1113
+ key: "shouldComponentUpdate",
1114
+ value: function shouldComponentUpdate(nextProps) {
1115
+ this.shouldReloadAds = this.shouldReloadConfig(nextProps);
1116
+
1117
+ if (nextProps.children !== this.props.children) {
1118
+ return true;
1119
+ }
1120
+
1121
+ if (nextProps.autoLoad && !this.props.autoLoad) {
1122
+ return true;
1123
+ }
1124
+
1125
+ return this.shouldReloadAds;
1126
+ }
1127
+ }, {
1128
+ key: "componentDidUpdate",
1129
+ value: function componentDidUpdate() {
1130
+ this.applyConfigs();
1131
+
1132
+ if (this.props.autoLoad) {
1133
+ if (this.loadAlreadyCalled) {
1134
+ if (this.shouldReloadAds) {
1135
+ _manager.default.reload();
1136
+ }
1137
+ } else if (!this.loadAdsIfPossible()) {
1138
+ this.attachLoadCallback();
1139
+ }
1140
+ }
1141
+
1142
+ this.shouldReloadAds = false;
1143
+ }
1144
+ }, {
1145
+ key: "getContextValue",
1146
+ value: function getContextValue() {
1147
+ var _this$props = this.props,
1148
+ dfpNetworkId = _this$props.dfpNetworkId,
1149
+ dfpAdUnit = _this$props.adUnit,
1150
+ dfpSizeMapping = _this$props.sizeMapping,
1151
+ dfpTargetingArguments = _this$props.targetingArguments,
1152
+ _this$contextValue = this.contextValue,
1153
+ ctxDfpNetworkId = _this$contextValue.dfpNetworkId,
1154
+ ctxDfpAdUnit = _this$contextValue.adUnit,
1155
+ ctxDfpSizeMapping = _this$contextValue.sizeMapping,
1156
+ ctxDfpTargetingArguments = _this$contextValue.targetingArguments; // performance: update context value object only when any of its
1157
+ // props is updated.
1158
+
1159
+ if (dfpNetworkId !== ctxDfpNetworkId || dfpAdUnit !== ctxDfpAdUnit || dfpSizeMapping !== ctxDfpSizeMapping || dfpTargetingArguments !== ctxDfpTargetingArguments) {
1160
+ this.contextValue = {
1161
+ dfpNetworkId: dfpNetworkId,
1162
+ dfpAdUnit: dfpAdUnit,
1163
+ dfpSizeMapping: dfpSizeMapping,
1164
+ dfpTargetingArguments: dfpTargetingArguments,
1165
+ newSlotCallback: this.newSlotCallback
1166
+ };
1167
+ }
1168
+
1169
+ return this.contextValue;
1170
+ }
1171
+ }, {
1172
+ key: "applyConfigs",
1173
+ value: function applyConfigs() {
1174
+ _manager.default.configurePersonalizedAds(this.props.personalizedAds);
1175
+
1176
+ _manager.default.configureSingleRequest(this.props.singleRequest);
1177
+
1178
+ _manager.default.configureDisableInitialLoad(this.props.disableInitialLoad);
1179
+
1180
+ _manager.default.configureLazyLoad(!!this.props.lazyLoad, typeof this.props.lazyLoad === 'boolean' ? null : this.props.lazyLoad);
1181
+
1182
+ _manager.default.setAdSenseAttributes(this.props.adSenseAttributes);
1183
+
1184
+ _manager.default.setCollapseEmptyDivs(this.props.collapseEmptyDivs);
1185
+ }
1186
+ }, {
1187
+ key: "attachLoadCallback",
1188
+ value: function attachLoadCallback() {
1189
+ if (this.loadCallbackAttached === false) {
1190
+ _manager.default.on('slotRegistered', this.loadAdsIfPossible);
1191
+
1192
+ this.loadCallbackAttached = true;
1193
+ return true;
1194
+ }
1195
+
1196
+ return false;
1197
+ } // pretty strait-forward interface that children ad slots use to register
1198
+ // with their DFPSlotProvider parent node.
1199
+
1200
+ }, {
1201
+ key: "newSlotCallback",
1202
+ value: function newSlotCallback() {
1203
+ this.totalSlots++;
1204
+ } // Checks all the mounted children ads have been already registered
1205
+ // in the DFPManager before trying to call the gpt load scripts.
1206
+ // This is helpful when trying to fetch ads with a single request.
1207
+
1208
+ }, {
1209
+ key: "loadAdsIfPossible",
1210
+ value: function loadAdsIfPossible() {
1211
+ var r = false;
1212
+
1213
+ if (Object.keys(_manager.default.getRegisteredSlots()).length >= this.totalSlots) {
1214
+ _manager.default.removeListener('slotRegistered', this.loadAdsIfPossible);
1215
+
1216
+ _manager.default.load();
1217
+
1218
+ this.loadAlreadyCalled = true;
1219
+ this.loadCallbackAttached = false;
1220
+ r = true;
1221
+ }
1222
+
1223
+ return r;
1224
+ }
1225
+ }, {
1226
+ key: "shouldReloadConfig",
1227
+ value: function shouldReloadConfig(nextProps) {
1228
+ var reloadConfig = nextProps.autoReload || this.props.autoReload;
1229
+
1230
+ if (this.props.autoLoad || nextProps.autoLoad) {
1231
+ if (_typeof(reloadConfig) === 'object') {
1232
+ var attrs = Object.keys(reloadConfig); // eslint-disable-next-line guard-for-in, no-restricted-syntax
1233
+
1234
+ for (var i in attrs) {
1235
+ var propName = attrs[i]; // eslint-disable-next-line
1236
+
1237
+ if (reloadConfig[propName] === true && this.props[propName] !== nextProps[propName]) {
1238
+ return true;
1239
+ }
1240
+ }
1241
+ }
1242
+ }
1243
+
1244
+ return false;
1245
+ }
1246
+ }, {
1247
+ key: "render",
1248
+ value: function render() {
1249
+ var children = this.props.children;
1250
+
1251
+ if (Context === null) {
1252
+ return children;
1253
+ }
1254
+
1255
+ return _react.default.createElement(Context.Provider, {
1256
+ value: this.getContextValue()
1257
+ }, children);
1258
+ }
1259
+ }]);
1260
+
1261
+ return DFPSlotsProvider;
1262
+ }(_react.default.Component);
1263
+
1264
+ exports.default = DFPSlotsProvider;
1265
+
1266
+ _defineProperty(DFPSlotsProvider, "propTypes", {
1267
+ children: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.array]).isRequired,
1268
+ autoLoad: _propTypes.default.bool,
1269
+ autoReload: _propTypes.default.shape({
1270
+ dfpNetworkId: _propTypes.default.bool,
1271
+ personalizedAds: _propTypes.default.bool,
1272
+ singleRequest: _propTypes.default.bool,
1273
+ disableInitialLoad: _propTypes.default.bool,
1274
+ adUnit: _propTypes.default.bool,
1275
+ sizeMapping: _propTypes.default.bool,
1276
+ adSenseAttributes: _propTypes.default.bool,
1277
+ targetingArguments: _propTypes.default.bool,
1278
+ collapseEmptyDivs: _propTypes.default.bool,
1279
+ lazyLoad: _propTypes.default.bool
1280
+ }),
1281
+ dfpNetworkId: _propTypes.default.string.isRequired,
1282
+ personalizedAds: _propTypes.default.bool,
1283
+ singleRequest: _propTypes.default.bool,
1284
+ disableInitialLoad: _propTypes.default.bool,
1285
+ adUnit: _propTypes.default.string,
1286
+ sizeMapping: _propTypes.default.arrayOf(_propTypes.default.object),
1287
+ adSenseAttributes: _propTypes.default.object,
1288
+ targetingArguments: _propTypes.default.object,
1289
+ collapseEmptyDivs: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
1290
+ adSenseAttrs: _propTypes.default.object,
1291
+ lazyLoad: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
1292
+ fetchMarginPercent: _propTypes.default.number,
1293
+ renderMarginPercent: _propTypes.default.number,
1294
+ mobileScaling: _propTypes.default.number
1295
+ })])
1296
+ });
1297
+
1298
+ _defineProperty(DFPSlotsProvider, "defaultProps", {
1299
+ autoLoad: true,
1300
+ autoReload: {
1301
+ dfpNetworkId: false,
1302
+ personalizedAds: false,
1303
+ singleRequest: false,
1304
+ disableInitialLoad: false,
1305
+ adUnit: false,
1306
+ sizeMapping: false,
1307
+ adSenseAttributes: false,
1308
+ targetingArguments: false,
1309
+ collapseEmptyDivs: false,
1310
+ lazyLoad: false
1311
+ },
1312
+ personalizedAds: true,
1313
+ singleRequest: true,
1314
+ disableInitialLoad: false,
1315
+ collapseEmptyDivs: null,
1316
+ lazyLoad: false
1317
+ });
1318
+
1319
+ if (Context === null) {
1320
+ // React < 16.3
1321
+ DFPSlotsProvider.childContextTypes = {
1322
+ dfpNetworkId: _propTypes.default.string,
1323
+ dfpAdUnit: _propTypes.default.string,
1324
+ dfpSizeMapping: _propTypes.default.arrayOf(_propTypes.default.object),
1325
+ dfpTargetingArguments: _propTypes.default.object,
1326
+ newSlotCallback: _propTypes.default.func
1327
+ };
1328
+ }
1329
+ });
1330
+
1331
+ unwrapExports(dfpslotsprovider);
1332
+ var dfpslotsprovider_1 = dfpslotsprovider.Context;
1333
+
1334
+ var adslot = createCommonjsModule(function (module, exports) {
1335
+
1336
+ Object.defineProperty(exports, "__esModule", {
1337
+ value: true
1338
+ });
1339
+ exports.default = exports.AdSlot = void 0;
1340
+
1341
+ var _react = _interopRequireDefault(React__default);
1342
+
1343
+ var _propTypes = _interopRequireDefault(PropTypes);
1344
+
1345
+ var _manager = _interopRequireDefault(manager);
1346
+
1347
+
1348
+
1349
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1350
+
1351
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1352
+
1353
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1354
+
1355
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
1356
+
1357
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1358
+
1359
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1360
+
1361
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1362
+
1363
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1364
+
1365
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1366
+
1367
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1368
+
1369
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1370
+
1371
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1372
+
1373
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1374
+
1375
+ var dynamicAdCount = 0;
1376
+
1377
+ var AdSlot =
1378
+ /*#__PURE__*/
1379
+ function (_React$Component) {
1380
+ _inherits(AdSlot, _React$Component);
1381
+
1382
+ function AdSlot(props) {
1383
+ var _this;
1384
+
1385
+ _classCallCheck(this, AdSlot);
1386
+
1387
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(AdSlot).call(this, props));
1388
+ _this.doRegisterSlot = _this.doRegisterSlot.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1389
+ _this.generateSlotId = _this.generateSlotId.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1390
+ _this.getSlotId = _this.getSlotId.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1391
+ _this.mapContextToAdSlotProps = _this.mapContextToAdSlotProps.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1392
+ _this.slotShouldRefresh = _this.slotShouldRefresh.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1393
+ _this.slotRenderEnded = _this.slotRenderEnded.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1394
+ _this.slotRegisterCallback = _this.slotRegisterCallback.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1395
+ _this.slotIsViewable = _this.slotIsViewable.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1396
+ _this.slotVisibilityChanged = _this.slotVisibilityChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1397
+ _this.getClasses = _this.getClasses.bind(_assertThisInitialized(_assertThisInitialized(_this)));
1398
+ _this.state = {
1399
+ slotId: _this.props.slotId || null,
1400
+ className: _this.props.className || ''
1401
+ };
1402
+ _this.adElementRef = _react.default.createRef ? _react.default.createRef() : function (element) {
1403
+ _this.adElementRef = element;
1404
+ };
1405
+ return _this;
1406
+ }
1407
+
1408
+ _createClass(AdSlot, [{
1409
+ key: "componentDidMount",
1410
+ value: function componentDidMount() {
1411
+ // register this ad-unit in the <DFPSlotProvider>, when available.
1412
+ if (this.context !== undefined && this.context.newSlotCallback) {
1413
+ this.context.newSlotCallback();
1414
+ }
1415
+
1416
+ this.registerSlot();
1417
+ }
1418
+ }, {
1419
+ key: "componentWillUnmount",
1420
+ value: function componentWillUnmount() {
1421
+ this.unregisterSlot();
1422
+ }
1423
+ }, {
1424
+ key: "getSlotId",
1425
+ value: function getSlotId() {
1426
+ return this.props.slotId || this.state.slotId;
1427
+ }
1428
+ }, {
1429
+ key: "getClasses",
1430
+ value: function getClasses() {
1431
+ var baseClass = 'adunitContainer';
1432
+ var extraClasses = this.state.className.split(' ');
1433
+ extraClasses.push(baseClass);
1434
+ return extraClasses;
1435
+ }
1436
+ }, {
1437
+ key: "generateSlotId",
1438
+ value: function generateSlotId() {
1439
+ return "adSlot-".concat(dynamicAdCount++);
1440
+ }
1441
+ }, {
1442
+ key: "mapContextToAdSlotProps",
1443
+ value: function mapContextToAdSlotProps() {
1444
+ var context = this.context;
1445
+ var mappedProps = {};
1446
+
1447
+ if (context.dfpNetworkId !== undefined) {
1448
+ mappedProps.dfpNetworkId = context.dfpNetworkId;
1449
+ }
1450
+
1451
+ if (context.dfpAdUnit !== undefined) {
1452
+ mappedProps.adUnit = context.dfpAdUnit;
1453
+ }
1454
+
1455
+ if (context.dfpSizeMapping !== undefined) {
1456
+ mappedProps.sizeMapping = context.dfpSizeMapping;
1457
+ }
1458
+
1459
+ if (context.dfpTargetingArguments !== undefined) {
1460
+ mappedProps.targetingArguments = context.dfpTargetingArguments;
1461
+ }
1462
+
1463
+ return mappedProps;
1464
+ }
1465
+ }, {
1466
+ key: "doRegisterSlot",
1467
+ value: function doRegisterSlot() {
1468
+ _manager.default.registerSlot(_objectSpread({}, this.mapContextToAdSlotProps(), this.props, this.state, {
1469
+ slotShouldRefresh: this.slotShouldRefresh
1470
+ }));
1471
+
1472
+ if (this.props.fetchNow === true) {
1473
+ _manager.default.load(this.getSlotId());
1474
+ }
1475
+
1476
+ _manager.default.attachSlotRenderEnded(this.slotRenderEnded);
1477
+
1478
+ _manager.default.attachSlotIsViewable(this.slotIsViewable);
1479
+
1480
+ _manager.default.attachSlotVisibilityChanged(this.slotVisibilityChanged);
1481
+
1482
+ this.slotRegisterCallback();
1483
+ }
1484
+ }, {
1485
+ key: "registerSlot",
1486
+ value: function registerSlot() {
1487
+ if (this.state.slotId === null) {
1488
+ this.setState({
1489
+ slotId: this.generateSlotId()
1490
+ }, this.doRegisterSlot);
1491
+ } else {
1492
+ this.doRegisterSlot();
1493
+ }
1494
+ }
1495
+ }, {
1496
+ key: "unregisterSlot",
1497
+ value: function unregisterSlot() {
1498
+ _manager.default.unregisterSlot(_objectSpread({}, this.mapContextToAdSlotProps(), this.props, this.state));
1499
+
1500
+ _manager.default.detachSlotRenderEnded(this.slotRenderEnded);
1501
+
1502
+ _manager.default.detachSlotIsViewable(this.slotIsViewable);
1503
+
1504
+ _manager.default.detachSlotVisibilityChanged(this.slotVisibilityChanged);
1505
+ }
1506
+ }, {
1507
+ key: "slotRenderEnded",
1508
+ value: function slotRenderEnded(eventData) {
1509
+ if (eventData.slotId === this.getSlotId()) {
1510
+ if (this.props.onSlotRender !== undefined) {
1511
+ // now that slot has rendered we have access to the ref
1512
+ var params = _objectSpread({}, eventData, {
1513
+ adElementRef: this.adElementRef
1514
+ });
1515
+
1516
+ this.props.onSlotRender(params);
1517
+ }
1518
+ }
1519
+ }
1520
+ }, {
1521
+ key: "slotRegisterCallback",
1522
+ value: function slotRegisterCallback() {
1523
+ if (typeof this.props.onSlotRegister === 'function') {
1524
+ this.props.onSlotRegister({
1525
+ slotId: this.getSlotId(),
1526
+ sizes: this.props.sizes,
1527
+ slotCount: dynamicAdCount,
1528
+ adElementRef: this.adElementRef
1529
+ });
1530
+ }
1531
+ }
1532
+ }, {
1533
+ key: "slotIsViewable",
1534
+ value: function slotIsViewable(eventData) {
1535
+ if (eventData.slotId === this.getSlotId()) {
1536
+ if (this.props.onSlotIsViewable !== undefined) {
1537
+ this.props.onSlotIsViewable(eventData);
1538
+ }
1539
+ }
1540
+ }
1541
+ }, {
1542
+ key: "slotVisibilityChanged",
1543
+ value: function slotVisibilityChanged(eventData) {
1544
+ if (eventData.slotId === this.getSlotId()) {
1545
+ if (this.props.onSlotVisibilityChanged !== undefined) {
1546
+ this.props.onSlotVisibilityChanged(eventData);
1547
+ }
1548
+ }
1549
+ }
1550
+ }, {
1551
+ key: "slotShouldRefresh",
1552
+ value: function slotShouldRefresh() {
1553
+ var r = true;
1554
+
1555
+ if (this.props.shouldRefresh !== undefined) {
1556
+ r = this.props.shouldRefresh(_objectSpread({}, this.mapContextToAdSlotProps(), this.props, {
1557
+ slotId: this.getSlotId()
1558
+ }));
1559
+ }
1560
+
1561
+ return r;
1562
+ }
1563
+ }, {
1564
+ key: "render",
1565
+ value: function render() {
1566
+ var slotId = this.state.slotId;
1567
+ var props = {
1568
+ className: 'adBox'
1569
+ };
1570
+
1571
+ if (slotId !== null) {
1572
+ props.id = slotId;
1573
+ }
1574
+
1575
+ return _react.default.createElement("div", {
1576
+ className: this.getClasses().join(' ').trim()
1577
+ }, _react.default.createElement("div", _extends({
1578
+ ref: this.adElementRef
1579
+ }, props)));
1580
+ }
1581
+ }]);
1582
+
1583
+ return AdSlot;
1584
+ }(_react.default.Component);
1585
+
1586
+ exports.AdSlot = AdSlot;
1587
+
1588
+ _defineProperty(AdSlot, "propTypes", {
1589
+ dfpNetworkId: _propTypes.default.string,
1590
+ adUnit: _propTypes.default.string,
1591
+ sizes: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.string])),
1592
+ renderOutOfThePage: _propTypes.default.bool,
1593
+ sizeMapping: _propTypes.default.arrayOf(_propTypes.default.object),
1594
+ fetchNow: _propTypes.default.bool,
1595
+ adSenseAttributes: _propTypes.default.object,
1596
+ targetingArguments: _propTypes.default.object,
1597
+ onSlotRender: _propTypes.default.func,
1598
+ onSlotRegister: _propTypes.default.func,
1599
+ onSlotIsViewable: _propTypes.default.func,
1600
+ onSlotVisibilityChanged: _propTypes.default.func,
1601
+ shouldRefresh: _propTypes.default.func,
1602
+ slotId: _propTypes.default.string,
1603
+ className: _propTypes.default.string
1604
+ });
1605
+
1606
+ _defineProperty(AdSlot, "defaultProps", {
1607
+ fetchNow: false
1608
+ });
1609
+
1610
+ if (dfpslotsprovider.Context === null) {
1611
+ // React < 16.3
1612
+ AdSlot.contextTypes = {
1613
+ dfpNetworkId: _propTypes.default.string,
1614
+ dfpAdUnit: _propTypes.default.string,
1615
+ dfpSizeMapping: _propTypes.default.arrayOf(_propTypes.default.object),
1616
+ dfpTargetingArguments: _propTypes.default.object,
1617
+ newSlotCallback: _propTypes.default.func
1618
+ };
1619
+ } else {
1620
+ AdSlot.contextType = dfpslotsprovider.Context;
1621
+ }
1622
+
1623
+ var _default = AdSlot;
1624
+ exports.default = _default;
1625
+ });
1626
+
1627
+ unwrapExports(adslot);
1628
+ var adslot_1 = adslot.AdSlot;
1629
+
1630
+ var lib = createCommonjsModule(function (module, exports) {
1631
+
1632
+ Object.defineProperty(exports, "__esModule", {
1633
+ value: true
1634
+ });
1635
+ exports.DFPSlotsProvider = exports.AdSlot = exports.DFPManager = void 0;
1636
+
1637
+ var _manager = _interopRequireDefault(manager);
1638
+
1639
+ var _adslot = _interopRequireDefault(adslot);
1640
+
1641
+ var _dfpslotsprovider = _interopRequireDefault(dfpslotsprovider);
1642
+
1643
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1644
+
1645
+ var DFPManager = _manager.default;
1646
+ exports.DFPManager = DFPManager;
1647
+ var AdSlot = _adslot.default;
1648
+ exports.AdSlot = AdSlot;
1649
+ var DFPSlotsProvider = _dfpslotsprovider.default;
1650
+ exports.DFPSlotsProvider = DFPSlotsProvider;
1651
+ });
1652
+
1653
+ unwrapExports(lib);
1654
+ var lib_1 = lib.DFPSlotsProvider;
1655
+ var lib_2 = lib.AdSlot;
1656
+ var lib_3 = lib.DFPManager;
1657
+
1658
+ var visibilitySensor = createCommonjsModule(function (module, exports) {
1659
+ (function webpackUniversalModuleDefinition(root, factory) {
1660
+ module.exports = factory(React__default, reactDom);
1661
+ })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
1662
+ return /******/ (function(modules) { // webpackBootstrap
1663
+ /******/ // The module cache
1664
+ /******/ var installedModules = {};
1665
+ /******/
1666
+ /******/ // The require function
1667
+ /******/ function __webpack_require__(moduleId) {
1668
+ /******/
1669
+ /******/ // Check if module is in cache
1670
+ /******/ if(installedModules[moduleId]) {
1671
+ /******/ return installedModules[moduleId].exports;
1672
+ /******/ }
1673
+ /******/ // Create a new module (and put it into the cache)
1674
+ /******/ var module = installedModules[moduleId] = {
1675
+ /******/ i: moduleId,
1676
+ /******/ l: false,
1677
+ /******/ exports: {}
1678
+ /******/ };
1679
+ /******/
1680
+ /******/ // Execute the module function
1681
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1682
+ /******/
1683
+ /******/ // Flag the module as loaded
1684
+ /******/ module.l = true;
1685
+ /******/
1686
+ /******/ // Return the exports of the module
1687
+ /******/ return module.exports;
1688
+ /******/ }
1689
+ /******/
1690
+ /******/
1691
+ /******/ // expose the modules object (__webpack_modules__)
1692
+ /******/ __webpack_require__.m = modules;
1693
+ /******/
1694
+ /******/ // expose the module cache
1695
+ /******/ __webpack_require__.c = installedModules;
1696
+ /******/
1697
+ /******/ // define getter function for harmony exports
1698
+ /******/ __webpack_require__.d = function(exports, name, getter) {
1699
+ /******/ if(!__webpack_require__.o(exports, name)) {
1700
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
1701
+ /******/ }
1702
+ /******/ };
1703
+ /******/
1704
+ /******/ // define __esModule on exports
1705
+ /******/ __webpack_require__.r = function(exports) {
1706
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1707
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1708
+ /******/ }
1709
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1710
+ /******/ };
1711
+ /******/
1712
+ /******/ // create a fake namespace object
1713
+ /******/ // mode & 1: value is a module id, require it
1714
+ /******/ // mode & 2: merge all properties of value into the ns
1715
+ /******/ // mode & 4: return value when already ns object
1716
+ /******/ // mode & 8|1: behave like require
1717
+ /******/ __webpack_require__.t = function(value, mode) {
1718
+ /******/ if(mode & 1) value = __webpack_require__(value);
1719
+ /******/ if(mode & 8) return value;
1720
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
1721
+ /******/ var ns = Object.create(null);
1722
+ /******/ __webpack_require__.r(ns);
1723
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
1724
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
1725
+ /******/ return ns;
1726
+ /******/ };
1727
+ /******/
1728
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1729
+ /******/ __webpack_require__.n = function(module) {
1730
+ /******/ var getter = module && module.__esModule ?
1731
+ /******/ function getDefault() { return module['default']; } :
1732
+ /******/ function getModuleExports() { return module; };
1733
+ /******/ __webpack_require__.d(getter, 'a', getter);
1734
+ /******/ return getter;
1735
+ /******/ };
1736
+ /******/
1737
+ /******/ // Object.prototype.hasOwnProperty.call
1738
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
1739
+ /******/
1740
+ /******/ // __webpack_public_path__
1741
+ /******/ __webpack_require__.p = "";
1742
+ /******/
1743
+ /******/
1744
+ /******/ // Load entry module and return exports
1745
+ /******/ return __webpack_require__(__webpack_require__.s = 4);
1746
+ /******/ })
1747
+ /************************************************************************/
1748
+ /******/ ([
1749
+ /* 0 */
1750
+ /***/ (function(module, exports, __webpack_require__) {
1751
+
1752
+ /**
1753
+ * Copyright (c) 2013-present, Facebook, Inc.
1754
+ *
1755
+ * This source code is licensed under the MIT license found in the
1756
+ * LICENSE file in the root directory of this source tree.
1757
+ */
1758
+
1759
+ {
1760
+ // By explicitly using `prop-types` you are opting into new production behavior.
1761
+ // http://fb.me/prop-types-in-prod
1762
+ module.exports = __webpack_require__(5)();
1763
+ }
1764
+
1765
+
1766
+ /***/ }),
1767
+ /* 1 */
1768
+ /***/ (function(module, exports) {
1769
+
1770
+ module.exports = __WEBPACK_EXTERNAL_MODULE__1__;
1771
+
1772
+ /***/ }),
1773
+ /* 2 */
1774
+ /***/ (function(module, exports) {
1775
+
1776
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
1777
+
1778
+ /***/ }),
1779
+ /* 3 */
1780
+ /***/ (function(module, exports) {
1781
+
1782
+ // Tell whether the rect is visible, given an offset
1783
+ //
1784
+ // return: boolean
1785
+ module.exports = function (offset, rect, containmentRect) {
1786
+ var offsetDir = offset.direction;
1787
+ var offsetVal = offset.value; // Rules for checking different kind of offsets. In example if the element is
1788
+ // 90px below viewport and offsetTop is 100, it is considered visible.
1789
+
1790
+ switch (offsetDir) {
1791
+ case 'top':
1792
+ return containmentRect.top + offsetVal < rect.top && containmentRect.bottom > rect.bottom && containmentRect.left < rect.left && containmentRect.right > rect.right;
1793
+
1794
+ case 'left':
1795
+ return containmentRect.left + offsetVal < rect.left && containmentRect.bottom > rect.bottom && containmentRect.top < rect.top && containmentRect.right > rect.right;
1796
+
1797
+ case 'bottom':
1798
+ return containmentRect.bottom - offsetVal > rect.bottom && containmentRect.left < rect.left && containmentRect.right > rect.right && containmentRect.top < rect.top;
1799
+
1800
+ case 'right':
1801
+ return containmentRect.right - offsetVal > rect.right && containmentRect.left < rect.left && containmentRect.top < rect.top && containmentRect.bottom > rect.bottom;
1802
+ }
1803
+ };
1804
+
1805
+ /***/ }),
1806
+ /* 4 */
1807
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1808
+ __webpack_require__.r(__webpack_exports__);
1809
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return VisibilitySensor; });
1810
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
1811
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1812
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
1813
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
1814
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
1815
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
1816
+ /* harmony import */ var _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
1817
+ /* harmony import */ var _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3__);
1818
+
1819
+
1820
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1821
+
1822
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1823
+
1824
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1825
+
1826
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1827
+
1828
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1829
+
1830
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1831
+
1832
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1833
+
1834
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1835
+
1836
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1837
+
1838
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1839
+
1840
+
1841
+
1842
+
1843
+
1844
+
1845
+ function normalizeRect(rect) {
1846
+ if (rect.width === undefined) {
1847
+ rect.width = rect.right - rect.left;
1848
+ }
1849
+
1850
+ if (rect.height === undefined) {
1851
+ rect.height = rect.bottom - rect.top;
1852
+ }
1853
+
1854
+ return rect;
1855
+ }
1856
+
1857
+ var VisibilitySensor =
1858
+ /*#__PURE__*/
1859
+ function (_React$Component) {
1860
+ _inherits(VisibilitySensor, _React$Component);
1861
+
1862
+ function VisibilitySensor(props) {
1863
+ var _this;
1864
+
1865
+ _classCallCheck(this, VisibilitySensor);
1866
+
1867
+ _this = _possibleConstructorReturn(this, _getPrototypeOf(VisibilitySensor).call(this, props));
1868
+
1869
+ _defineProperty(_assertThisInitialized(_this), "getContainer", function () {
1870
+ return _this.props.containment || window;
1871
+ });
1872
+
1873
+ _defineProperty(_assertThisInitialized(_this), "addEventListener", function (target, event, delay, throttle) {
1874
+ if (!_this.debounceCheck) {
1875
+ _this.debounceCheck = {};
1876
+ }
1877
+
1878
+ var timeout;
1879
+ var func;
1880
+
1881
+ var later = function later() {
1882
+ timeout = null;
1883
+
1884
+ _this.check();
1885
+ };
1886
+
1887
+ if (throttle > -1) {
1888
+ func = function func() {
1889
+ if (!timeout) {
1890
+ timeout = setTimeout(later, throttle || 0);
1891
+ }
1892
+ };
1893
+ } else {
1894
+ func = function func() {
1895
+ clearTimeout(timeout);
1896
+ timeout = setTimeout(later, delay || 0);
1897
+ };
1898
+ }
1899
+
1900
+ var info = {
1901
+ target: target,
1902
+ fn: func,
1903
+ getLastTimeout: function getLastTimeout() {
1904
+ return timeout;
1905
+ }
1906
+ };
1907
+ target.addEventListener(event, info.fn);
1908
+ _this.debounceCheck[event] = info;
1909
+ });
1910
+
1911
+ _defineProperty(_assertThisInitialized(_this), "startWatching", function () {
1912
+ if (_this.debounceCheck || _this.interval) {
1913
+ return;
1914
+ }
1915
+
1916
+ if (_this.props.intervalCheck) {
1917
+ _this.interval = setInterval(_this.check, _this.props.intervalDelay);
1918
+ }
1919
+
1920
+ if (_this.props.scrollCheck) {
1921
+ _this.addEventListener(_this.getContainer(), "scroll", _this.props.scrollDelay, _this.props.scrollThrottle);
1922
+ }
1923
+
1924
+ if (_this.props.resizeCheck) {
1925
+ _this.addEventListener(window, "resize", _this.props.resizeDelay, _this.props.resizeThrottle);
1926
+ } // if dont need delayed call, check on load ( before the first interval fires )
1927
+
1928
+
1929
+ !_this.props.delayedCall && _this.check();
1930
+ });
1931
+
1932
+ _defineProperty(_assertThisInitialized(_this), "stopWatching", function () {
1933
+ if (_this.debounceCheck) {
1934
+ // clean up event listeners and their debounce callers
1935
+ for (var debounceEvent in _this.debounceCheck) {
1936
+ if (_this.debounceCheck.hasOwnProperty(debounceEvent)) {
1937
+ var debounceInfo = _this.debounceCheck[debounceEvent];
1938
+ clearTimeout(debounceInfo.getLastTimeout());
1939
+ debounceInfo.target.removeEventListener(debounceEvent, debounceInfo.fn);
1940
+ _this.debounceCheck[debounceEvent] = null;
1941
+ }
1942
+ }
1943
+ }
1944
+
1945
+ _this.debounceCheck = null;
1946
+
1947
+ if (_this.interval) {
1948
+ _this.interval = clearInterval(_this.interval);
1949
+ }
1950
+ });
1951
+
1952
+ _defineProperty(_assertThisInitialized(_this), "check", function () {
1953
+ var el = _this.node;
1954
+ var rect;
1955
+ var containmentRect; // if the component has rendered to null, dont update visibility
1956
+
1957
+ if (!el) {
1958
+ return _this.state;
1959
+ }
1960
+
1961
+ rect = normalizeRect(_this.roundRectDown(el.getBoundingClientRect()));
1962
+
1963
+ if (_this.props.containment) {
1964
+ var containmentDOMRect = _this.props.containment.getBoundingClientRect();
1965
+
1966
+ containmentRect = {
1967
+ top: containmentDOMRect.top,
1968
+ left: containmentDOMRect.left,
1969
+ bottom: containmentDOMRect.bottom,
1970
+ right: containmentDOMRect.right
1971
+ };
1972
+ } else {
1973
+ containmentRect = {
1974
+ top: 0,
1975
+ left: 0,
1976
+ bottom: window.innerHeight || document.documentElement.clientHeight,
1977
+ right: window.innerWidth || document.documentElement.clientWidth
1978
+ };
1979
+ } // Check if visibility is wanted via offset?
1980
+
1981
+
1982
+ var offset = _this.props.offset || {};
1983
+ var hasValidOffset = _typeof(offset) === "object";
1984
+
1985
+ if (hasValidOffset) {
1986
+ containmentRect.top += offset.top || 0;
1987
+ containmentRect.left += offset.left || 0;
1988
+ containmentRect.bottom -= offset.bottom || 0;
1989
+ containmentRect.right -= offset.right || 0;
1990
+ }
1991
+
1992
+ var visibilityRect = {
1993
+ top: rect.top >= containmentRect.top,
1994
+ left: rect.left >= containmentRect.left,
1995
+ bottom: rect.bottom <= containmentRect.bottom,
1996
+ right: rect.right <= containmentRect.right
1997
+ }; // https://github.com/joshwnj/react-visibility-sensor/pull/114
1998
+
1999
+ var hasSize = rect.height > 0 && rect.width > 0;
2000
+ var isVisible = hasSize && visibilityRect.top && visibilityRect.left && visibilityRect.bottom && visibilityRect.right; // check for partial visibility
2001
+
2002
+ if (hasSize && _this.props.partialVisibility) {
2003
+ var partialVisible = rect.top <= containmentRect.bottom && rect.bottom >= containmentRect.top && rect.left <= containmentRect.right && rect.right >= containmentRect.left; // account for partial visibility on a single edge
2004
+
2005
+ if (typeof _this.props.partialVisibility === "string") {
2006
+ partialVisible = visibilityRect[_this.props.partialVisibility];
2007
+ } // if we have minimum top visibility set by props, lets check, if it meets the passed value
2008
+ // so if for instance element is at least 200px in viewport, then show it.
2009
+
2010
+
2011
+ isVisible = _this.props.minTopValue ? partialVisible && rect.top <= containmentRect.bottom - _this.props.minTopValue : partialVisible;
2012
+ } // Deprecated options for calculating offset.
2013
+
2014
+
2015
+ if (typeof offset.direction === "string" && typeof offset.value === "number") {
2016
+ console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }", offset.direction, offset.value);
2017
+ isVisible = _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3___default()(offset, rect, containmentRect);
2018
+ }
2019
+
2020
+ var state = _this.state; // notify the parent when the value changes
2021
+
2022
+ if (_this.state.isVisible !== isVisible) {
2023
+ state = {
2024
+ isVisible: isVisible,
2025
+ visibilityRect: visibilityRect
2026
+ };
2027
+
2028
+ _this.setState(state);
2029
+
2030
+ if (_this.props.onChange) _this.props.onChange(isVisible);
2031
+ }
2032
+
2033
+ return state;
2034
+ });
2035
+
2036
+ _this.state = {
2037
+ isVisible: null,
2038
+ visibilityRect: {}
2039
+ };
2040
+ return _this;
2041
+ }
2042
+
2043
+ _createClass(VisibilitySensor, [{
2044
+ key: "componentDidMount",
2045
+ value: function componentDidMount() {
2046
+ this.node = react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this);
2047
+
2048
+ if (this.props.active) {
2049
+ this.startWatching();
2050
+ }
2051
+ }
2052
+ }, {
2053
+ key: "componentWillUnmount",
2054
+ value: function componentWillUnmount() {
2055
+ this.stopWatching();
2056
+ }
2057
+ }, {
2058
+ key: "componentDidUpdate",
2059
+ value: function componentDidUpdate(prevProps) {
2060
+ // re-register node in componentDidUpdate if children diffs [#103]
2061
+ this.node = react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this);
2062
+
2063
+ if (this.props.active && !prevProps.active) {
2064
+ this.setState({
2065
+ isVisible: null,
2066
+ visibilityRect: {}
2067
+ });
2068
+ this.startWatching();
2069
+ } else if (!this.props.active) {
2070
+ this.stopWatching();
2071
+ }
2072
+ }
2073
+ }, {
2074
+ key: "roundRectDown",
2075
+ value: function roundRectDown(rect) {
2076
+ return {
2077
+ top: Math.floor(rect.top),
2078
+ left: Math.floor(rect.left),
2079
+ bottom: Math.floor(rect.bottom),
2080
+ right: Math.floor(rect.right)
2081
+ };
2082
+ }
2083
+ /**
2084
+ * Check if the element is within the visible viewport
2085
+ */
2086
+
2087
+ }, {
2088
+ key: "render",
2089
+ value: function render() {
2090
+ if (this.props.children instanceof Function) {
2091
+ return this.props.children({
2092
+ isVisible: this.state.isVisible,
2093
+ visibilityRect: this.state.visibilityRect
2094
+ });
2095
+ }
2096
+
2097
+ return react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.only(this.props.children);
2098
+ }
2099
+ }]);
2100
+
2101
+ return VisibilitySensor;
2102
+ }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
2103
+
2104
+ _defineProperty(VisibilitySensor, "defaultProps", {
2105
+ active: true,
2106
+ partialVisibility: false,
2107
+ minTopValue: 0,
2108
+ scrollCheck: false,
2109
+ scrollDelay: 250,
2110
+ scrollThrottle: -1,
2111
+ resizeCheck: false,
2112
+ resizeDelay: 250,
2113
+ resizeThrottle: -1,
2114
+ intervalCheck: true,
2115
+ intervalDelay: 100,
2116
+ delayedCall: false,
2117
+ offset: {},
2118
+ containment: null,
2119
+ children: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null)
2120
+ });
2121
+
2122
+ _defineProperty(VisibilitySensor, "propTypes", {
2123
+ onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
2124
+ active: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
2125
+ partialVisibility: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(["top", "right", "bottom", "left"])]),
2126
+ delayedCall: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
2127
+ offset: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({
2128
+ top: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2129
+ left: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2130
+ bottom: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2131
+ right: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
2132
+ }), // deprecated offset property
2133
+ prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({
2134
+ direction: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(["top", "right", "bottom", "left"]),
2135
+ value: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
2136
+ })]),
2137
+ scrollCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
2138
+ scrollDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2139
+ scrollThrottle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2140
+ resizeCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
2141
+ resizeDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2142
+ resizeThrottle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2143
+ intervalCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
2144
+ intervalDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
2145
+ containment: typeof window !== "undefined" ? prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(window.Element) : prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any,
2146
+ children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func]),
2147
+ minTopValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
2148
+ });
2149
+
2150
+
2151
+
2152
+ /***/ }),
2153
+ /* 5 */
2154
+ /***/ (function(module, exports, __webpack_require__) {
2155
+ /**
2156
+ * Copyright (c) 2013-present, Facebook, Inc.
2157
+ *
2158
+ * This source code is licensed under the MIT license found in the
2159
+ * LICENSE file in the root directory of this source tree.
2160
+ */
2161
+
2162
+
2163
+
2164
+ var ReactPropTypesSecret = __webpack_require__(6);
2165
+
2166
+ function emptyFunction() {}
2167
+ function emptyFunctionWithReset() {}
2168
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
2169
+
2170
+ module.exports = function() {
2171
+ function shim(props, propName, componentName, location, propFullName, secret) {
2172
+ if (secret === ReactPropTypesSecret) {
2173
+ // It is still safe when called from React.
2174
+ return;
2175
+ }
2176
+ var err = new Error(
2177
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2178
+ 'Use PropTypes.checkPropTypes() to call them. ' +
2179
+ 'Read more at http://fb.me/use-check-prop-types'
2180
+ );
2181
+ err.name = 'Invariant Violation';
2182
+ throw err;
2183
+ } shim.isRequired = shim;
2184
+ function getShim() {
2185
+ return shim;
2186
+ } // Important!
2187
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2188
+ var ReactPropTypes = {
2189
+ array: shim,
2190
+ bool: shim,
2191
+ func: shim,
2192
+ number: shim,
2193
+ object: shim,
2194
+ string: shim,
2195
+ symbol: shim,
2196
+
2197
+ any: shim,
2198
+ arrayOf: getShim,
2199
+ element: shim,
2200
+ elementType: shim,
2201
+ instanceOf: getShim,
2202
+ node: shim,
2203
+ objectOf: getShim,
2204
+ oneOf: getShim,
2205
+ oneOfType: getShim,
2206
+ shape: getShim,
2207
+ exact: getShim,
2208
+
2209
+ checkPropTypes: emptyFunctionWithReset,
2210
+ resetWarningCache: emptyFunction
2211
+ };
2212
+
2213
+ ReactPropTypes.PropTypes = ReactPropTypes;
2214
+
2215
+ return ReactPropTypes;
2216
+ };
2217
+
2218
+
2219
+ /***/ }),
2220
+ /* 6 */
2221
+ /***/ (function(module, exports, __webpack_require__) {
2222
+ /**
2223
+ * Copyright (c) 2013-present, Facebook, Inc.
2224
+ *
2225
+ * This source code is licensed under the MIT license found in the
2226
+ * LICENSE file in the root directory of this source tree.
2227
+ */
2228
+
2229
+
2230
+
2231
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2232
+
2233
+ module.exports = ReactPropTypesSecret;
2234
+
2235
+
2236
+ /***/ })
2237
+ /******/ ]);
2238
+ });
2239
+ });
2240
+
2241
+ var VisibilitySensor = unwrapExports(visibilitySensor);
2242
+
2243
+ export { VisibilitySensor as V, lib_1 as a, lib_2 as b, lib_3 as l };