@mjhls/mjh-framework 1.0.280 → 1.0.282

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 (36) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{ADInfeed-f0bf34d7.js → ADInfeed-a33644bc.js} +1 -1
  3. package/dist/cjs/{AdSlot-9660e9aa.js → AdSlot-1886ea26.js} +2 -2
  4. package/dist/cjs/DeckContent.js +5 -5
  5. package/dist/cjs/DeckQueue.js +3 -3
  6. package/dist/cjs/{Dfp-36d51c84.js → Dfp-f75c65fd.js} +1 -1
  7. package/dist/cjs/{GridContent-4b4bbe7f.js → GridContent-26572c38.js} +5 -5
  8. package/dist/cjs/GridContent.js +7 -7
  9. package/dist/cjs/MasterDeck.js +3 -3
  10. package/dist/cjs/{Normal-878318e9.js → Normal-e68cf8f2.js} +5 -5
  11. package/dist/cjs/QueueDeckExpanded.js +4 -4
  12. package/dist/cjs/TemplateNormal.js +5 -5
  13. package/dist/cjs/VideoSeriesListing.js +2 -2
  14. package/dist/cjs/{debounce-fbfce522.js → debounce-ba3eaee2.js} +3 -0
  15. package/dist/cjs/{get-858530c2.js → get-de2660c3.js} +4 -1
  16. package/dist/cjs/index.js +1071 -321
  17. package/dist/cjs/{inherits-3fbaa008.js → inherits-dd435947.js} +1 -1
  18. package/dist/cjs/{promise-ea10b9c8.js → promise-2c453658.js} +1 -1
  19. package/dist/esm/{ADInfeed-cc019fcb.js → ADInfeed-fd816c1f.js} +1 -1
  20. package/dist/esm/{AdSlot-1f20130d.js → AdSlot-cc6a4f74.js} +2 -2
  21. package/dist/esm/DeckContent.js +5 -5
  22. package/dist/esm/DeckQueue.js +3 -3
  23. package/dist/esm/{Dfp-85f00c9b.js → Dfp-ea8d4531.js} +1 -1
  24. package/dist/esm/{GridContent-1292ff20.js → GridContent-2e9e7528.js} +5 -5
  25. package/dist/esm/GridContent.js +7 -7
  26. package/dist/esm/MasterDeck.js +3 -3
  27. package/dist/esm/{Normal-a2c50ae2.js → Normal-6a056c0d.js} +5 -5
  28. package/dist/esm/QueueDeckExpanded.js +4 -4
  29. package/dist/esm/TemplateNormal.js +5 -5
  30. package/dist/esm/VideoSeriesListing.js +2 -2
  31. package/dist/esm/{debounce-d15d4a31.js → debounce-93ab8f80.js} +1 -1
  32. package/dist/esm/{get-a0244443.js → get-9c285a85.js} +2 -2
  33. package/dist/esm/index.js +1073 -323
  34. package/dist/esm/{inherits-1d7657b5.js → inherits-2a854891.js} +1 -1
  35. package/dist/esm/{promise-eabb7f7e.js → promise-e3480f1c.js} +1 -1
  36. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -7,12 +7,12 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
8
8
  var _toObject = require('./_to-object-329a650b.js');
9
9
  require('./web.dom.iterable-0998bdc3.js');
10
- var debounce = require('./debounce-fbfce522.js');
10
+ var debounce = require('./debounce-ba3eaee2.js');
11
11
  var main = require('./main-0ea1b808.js');
12
12
  var toConsumableArray = require('./toConsumableArray-f05a306f.js');
13
13
  require('./core.get-iterator-method-e049ca4a.js');
14
14
  var _extends$2 = require('./extends-e94dbea5.js');
15
- var inherits$2 = require('./inherits-3fbaa008.js');
15
+ var inherits$2 = require('./inherits-dd435947.js');
16
16
  var React = require('react');
17
17
  var React__default = _interopDefault(React);
18
18
  var PropTypes = _interopDefault(require('prop-types'));
@@ -29,12 +29,12 @@ var index = require('./index-39beccb3.js');
29
29
  require('./index-fa0fb52c.js');
30
30
  var entities = require('./entities-310b46ee.js');
31
31
  var slicedToArray = require('./slicedToArray-e38fb29d.js');
32
- var AdSlot = require('./AdSlot-9660e9aa.js');
33
- require('./promise-ea10b9c8.js');
34
- require('./ADInfeed-f0bf34d7.js');
32
+ var AdSlot = require('./AdSlot-1886ea26.js');
33
+ require('./promise-2c453658.js');
34
+ require('./ADInfeed-a33644bc.js');
35
35
  var DeckContent = require('./DeckContent.js');
36
- require('./get-858530c2.js');
37
- var GridContent = require('./GridContent-4b4bbe7f.js');
36
+ var get$1 = require('./get-de2660c3.js');
37
+ var GridContent = require('./GridContent-26572c38.js');
38
38
  var DeckQueue = require('./DeckQueue.js');
39
39
  require('react-bootstrap/Media');
40
40
  var ThumbnailCard = require('./ThumbnailCard.js');
@@ -53,7 +53,7 @@ var IssueDeck = require('./IssueDeck.js');
53
53
  require('react-bootstrap/Badge');
54
54
  var IssueContentDeck = require('./IssueContentDeck.js');
55
55
  var Spinner = _interopDefault(require('react-bootstrap/Spinner'));
56
- var TemplateNormal = require('./Normal-878318e9.js');
56
+ var TemplateNormal = require('./Normal-e68cf8f2.js');
57
57
  require('react-bootstrap/ListGroup');
58
58
  var Head = _interopDefault(require('next/head'));
59
59
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -15137,81 +15137,854 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
15137
15137
  );
15138
15138
  };
15139
15139
 
15140
- var InscreenSensor = function (_React$Component) {
15141
- inherits$2._inherits(InscreenSensor, _React$Component);
15140
+ /**
15141
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
15142
+ * support for iteratee shorthands.
15143
+ *
15144
+ * @private
15145
+ * @param {Array} array The array to inspect.
15146
+ * @param {Function} predicate The function invoked per iteration.
15147
+ * @param {number} fromIndex The index to search from.
15148
+ * @param {boolean} [fromRight] Specify iterating from right to left.
15149
+ * @returns {number} Returns the index of the matched value, else `-1`.
15150
+ */
15151
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
15152
+ var length = array.length,
15153
+ index = fromIndex + (fromRight ? 1 : -1);
15142
15154
 
15143
- function InscreenSensor(props) {
15144
- inherits$2._classCallCheck(this, InscreenSensor);
15155
+ while ((fromRight ? index-- : ++index < length)) {
15156
+ if (predicate(array[index], index, array)) {
15157
+ return index;
15158
+ }
15159
+ }
15160
+ return -1;
15161
+ }
15145
15162
 
15146
- var _this = inherits$2._possibleConstructorReturn(this, (InscreenSensor.__proto__ || inherits$2._Object$getPrototypeOf(InscreenSensor)).call(this, props));
15163
+ var _baseFindIndex = baseFindIndex;
15147
15164
 
15148
- _this.scrollHandler = function () {
15149
- // this.checkInside()
15165
+ /**
15166
+ * The base implementation of `_.isNaN` without support for number objects.
15167
+ *
15168
+ * @private
15169
+ * @param {*} value The value to check.
15170
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
15171
+ */
15172
+ function baseIsNaN(value) {
15173
+ return value !== value;
15174
+ }
15150
15175
 
15151
- var visible = _this.checkInside();
15152
- if (visible != _this.visible) {
15153
- _this.visible = visible;
15154
- _this.props.onChange(visible);
15155
- }
15156
- };
15176
+ var _baseIsNaN = baseIsNaN;
15157
15177
 
15158
- _this.checkInside = function () {
15159
- var rect = _this.wraperRef.current.getBoundingClientRect();
15160
- var _this$props$offSetTop = _this.props.offSetTop,
15161
- offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
15162
- var top = rect.top,
15163
- height = rect.height;
15164
-
15165
- var bottom = top + height;
15166
- var viewHeight = window.innerHeight;
15167
- if (bottom < offSetTop) {
15168
- return false;
15169
- } else if (top > offSetTop && bottom <= viewHeight) {
15170
- return true;
15171
- } else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
15172
- return 'top';
15173
- } else if (bottom <= viewHeight) {
15174
- return 'bottom';
15175
- } else {
15176
- return false;
15177
- }
15178
- };
15178
+ /**
15179
+ * A specialized version of `_.indexOf` which performs strict equality
15180
+ * comparisons of values, i.e. `===`.
15181
+ *
15182
+ * @private
15183
+ * @param {Array} array The array to inspect.
15184
+ * @param {*} value The value to search for.
15185
+ * @param {number} fromIndex The index to search from.
15186
+ * @returns {number} Returns the index of the matched value, else `-1`.
15187
+ */
15188
+ function strictIndexOf(array, value, fromIndex) {
15189
+ var index = fromIndex - 1,
15190
+ length = array.length;
15179
15191
 
15180
- _this.wraperRef = React__default.createRef();
15181
- _this.visible = false;
15182
- return _this;
15192
+ while (++index < length) {
15193
+ if (array[index] === value) {
15194
+ return index;
15183
15195
  }
15196
+ }
15197
+ return -1;
15198
+ }
15184
15199
 
15185
- inherits$2._createClass(InscreenSensor, [{
15186
- key: 'componentDidMount',
15187
- value: function componentDidMount() {
15188
- this.visible = this.checkInside();
15189
- this.props.onChange(this.visible);
15190
- window.addEventListener('scroll', this.scrollHandler);
15191
- }
15192
- }, {
15193
- key: 'componentWillUnmount',
15194
- value: function componentWillUnmount() {
15195
- window.removeEventListener('scroll', this.scrollHandler);
15196
- }
15197
- }, {
15198
- key: 'render',
15199
- value: function render() {
15200
- var _props = this.props,
15201
- _props$className = _props.className,
15202
- className = _props$className === undefined ? '' : _props$className,
15203
- _props$style = _props.style,
15204
- style = _props$style === undefined ? {} : _props$style;
15200
+ var _strictIndexOf = strictIndexOf;
15205
15201
 
15206
- return React__default.createElement(
15207
- 'div',
15208
- { ref: this.wraperRef, className: className, style: style },
15209
- this.props.children
15210
- );
15211
- }
15212
- }]);
15202
+ /**
15203
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
15204
+ *
15205
+ * @private
15206
+ * @param {Array} array The array to inspect.
15207
+ * @param {*} value The value to search for.
15208
+ * @param {number} fromIndex The index to search from.
15209
+ * @returns {number} Returns the index of the matched value, else `-1`.
15210
+ */
15211
+ function baseIndexOf(array, value, fromIndex) {
15212
+ return value === value
15213
+ ? _strictIndexOf(array, value, fromIndex)
15214
+ : _baseFindIndex(array, _baseIsNaN, fromIndex);
15215
+ }
15216
+
15217
+ var _baseIndexOf = baseIndexOf;
15218
+
15219
+ /** Used as references for various `Number` constants. */
15220
+ var MAX_SAFE_INTEGER = 9007199254740991;
15221
+
15222
+ /**
15223
+ * Checks if `value` is a valid array-like length.
15224
+ *
15225
+ * **Note:** This method is loosely based on
15226
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
15227
+ *
15228
+ * @static
15229
+ * @memberOf _
15230
+ * @since 4.0.0
15231
+ * @category Lang
15232
+ * @param {*} value The value to check.
15233
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
15234
+ * @example
15235
+ *
15236
+ * _.isLength(3);
15237
+ * // => true
15238
+ *
15239
+ * _.isLength(Number.MIN_VALUE);
15240
+ * // => false
15241
+ *
15242
+ * _.isLength(Infinity);
15243
+ * // => false
15244
+ *
15245
+ * _.isLength('3');
15246
+ * // => false
15247
+ */
15248
+ function isLength(value) {
15249
+ return typeof value == 'number' &&
15250
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
15251
+ }
15252
+
15253
+ var isLength_1 = isLength;
15254
+
15255
+ /**
15256
+ * Checks if `value` is array-like. A value is considered array-like if it's
15257
+ * not a function and has a `value.length` that's an integer greater than or
15258
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
15259
+ *
15260
+ * @static
15261
+ * @memberOf _
15262
+ * @since 4.0.0
15263
+ * @category Lang
15264
+ * @param {*} value The value to check.
15265
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
15266
+ * @example
15267
+ *
15268
+ * _.isArrayLike([1, 2, 3]);
15269
+ * // => true
15270
+ *
15271
+ * _.isArrayLike(document.body.children);
15272
+ * // => true
15273
+ *
15274
+ * _.isArrayLike('abc');
15275
+ * // => true
15276
+ *
15277
+ * _.isArrayLike(_.noop);
15278
+ * // => false
15279
+ */
15280
+ function isArrayLike(value) {
15281
+ return value != null && isLength_1(value.length) && !get$1.isFunction_1(value);
15282
+ }
15283
+
15284
+ var isArrayLike_1 = isArrayLike;
15285
+
15286
+ /** `Object#toString` result references. */
15287
+ var stringTag = '[object String]';
15288
+
15289
+ /**
15290
+ * Checks if `value` is classified as a `String` primitive or object.
15291
+ *
15292
+ * @static
15293
+ * @since 0.1.0
15294
+ * @memberOf _
15295
+ * @category Lang
15296
+ * @param {*} value The value to check.
15297
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
15298
+ * @example
15299
+ *
15300
+ * _.isString('abc');
15301
+ * // => true
15302
+ *
15303
+ * _.isString(1);
15304
+ * // => false
15305
+ */
15306
+ function isString$1(value) {
15307
+ return typeof value == 'string' ||
15308
+ (!get$1.isArray_1(value) && debounce.isObjectLike_1(value) && debounce._baseGetTag(value) == stringTag);
15309
+ }
15310
+
15311
+ var isString_1 = isString$1;
15312
+
15313
+ /** Used as references for various `Number` constants. */
15314
+ var INFINITY = 1 / 0,
15315
+ MAX_INTEGER = 1.7976931348623157e+308;
15316
+
15317
+ /**
15318
+ * Converts `value` to a finite number.
15319
+ *
15320
+ * @static
15321
+ * @memberOf _
15322
+ * @since 4.12.0
15323
+ * @category Lang
15324
+ * @param {*} value The value to convert.
15325
+ * @returns {number} Returns the converted number.
15326
+ * @example
15327
+ *
15328
+ * _.toFinite(3.2);
15329
+ * // => 3.2
15330
+ *
15331
+ * _.toFinite(Number.MIN_VALUE);
15332
+ * // => 5e-324
15333
+ *
15334
+ * _.toFinite(Infinity);
15335
+ * // => 1.7976931348623157e+308
15336
+ *
15337
+ * _.toFinite('3.2');
15338
+ * // => 3.2
15339
+ */
15340
+ function toFinite(value) {
15341
+ if (!value) {
15342
+ return value === 0 ? value : 0;
15343
+ }
15344
+ value = debounce.toNumber_1(value);
15345
+ if (value === INFINITY || value === -INFINITY) {
15346
+ var sign = (value < 0 ? -1 : 1);
15347
+ return sign * MAX_INTEGER;
15348
+ }
15349
+ return value === value ? value : 0;
15350
+ }
15351
+
15352
+ var toFinite_1 = toFinite;
15353
+
15354
+ /**
15355
+ * Converts `value` to an integer.
15356
+ *
15357
+ * **Note:** This method is loosely based on
15358
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
15359
+ *
15360
+ * @static
15361
+ * @memberOf _
15362
+ * @since 4.0.0
15363
+ * @category Lang
15364
+ * @param {*} value The value to convert.
15365
+ * @returns {number} Returns the converted integer.
15366
+ * @example
15367
+ *
15368
+ * _.toInteger(3.2);
15369
+ * // => 3
15370
+ *
15371
+ * _.toInteger(Number.MIN_VALUE);
15372
+ * // => 0
15373
+ *
15374
+ * _.toInteger(Infinity);
15375
+ * // => 1.7976931348623157e+308
15376
+ *
15377
+ * _.toInteger('3.2');
15378
+ * // => 3
15379
+ */
15380
+ function toInteger(value) {
15381
+ var result = toFinite_1(value),
15382
+ remainder = result % 1;
15383
+
15384
+ return result === result ? (remainder ? result - remainder : result) : 0;
15385
+ }
15386
+
15387
+ var toInteger_1 = toInteger;
15388
+
15389
+ /**
15390
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
15391
+ * array of `object` property values corresponding to the property names
15392
+ * of `props`.
15393
+ *
15394
+ * @private
15395
+ * @param {Object} object The object to query.
15396
+ * @param {Array} props The property names to get values for.
15397
+ * @returns {Object} Returns the array of property values.
15398
+ */
15399
+ function baseValues(object, props) {
15400
+ return get$1._arrayMap(props, function(key) {
15401
+ return object[key];
15402
+ });
15403
+ }
15404
+
15405
+ var _baseValues = baseValues;
15406
+
15407
+ /**
15408
+ * The base implementation of `_.times` without support for iteratee shorthands
15409
+ * or max array length checks.
15410
+ *
15411
+ * @private
15412
+ * @param {number} n The number of times to invoke `iteratee`.
15413
+ * @param {Function} iteratee The function invoked per iteration.
15414
+ * @returns {Array} Returns the array of results.
15415
+ */
15416
+ function baseTimes(n, iteratee) {
15417
+ var index = -1,
15418
+ result = Array(n);
15419
+
15420
+ while (++index < n) {
15421
+ result[index] = iteratee(index);
15422
+ }
15423
+ return result;
15424
+ }
15425
+
15426
+ var _baseTimes = baseTimes;
15427
+
15428
+ /** `Object#toString` result references. */
15429
+ var argsTag = '[object Arguments]';
15430
+
15431
+ /**
15432
+ * The base implementation of `_.isArguments`.
15433
+ *
15434
+ * @private
15435
+ * @param {*} value The value to check.
15436
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
15437
+ */
15438
+ function baseIsArguments(value) {
15439
+ return debounce.isObjectLike_1(value) && debounce._baseGetTag(value) == argsTag;
15440
+ }
15441
+
15442
+ var _baseIsArguments = baseIsArguments;
15443
+
15444
+ /** Used for built-in method references. */
15445
+ var objectProto = Object.prototype;
15446
+
15447
+ /** Used to check objects for own properties. */
15448
+ var hasOwnProperty$1 = objectProto.hasOwnProperty;
15449
+
15450
+ /** Built-in value references. */
15451
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
15213
15452
 
15214
- return InscreenSensor;
15453
+ /**
15454
+ * Checks if `value` is likely an `arguments` object.
15455
+ *
15456
+ * @static
15457
+ * @memberOf _
15458
+ * @since 0.1.0
15459
+ * @category Lang
15460
+ * @param {*} value The value to check.
15461
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
15462
+ * else `false`.
15463
+ * @example
15464
+ *
15465
+ * _.isArguments(function() { return arguments; }());
15466
+ * // => true
15467
+ *
15468
+ * _.isArguments([1, 2, 3]);
15469
+ * // => false
15470
+ */
15471
+ var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
15472
+ return debounce.isObjectLike_1(value) && hasOwnProperty$1.call(value, 'callee') &&
15473
+ !propertyIsEnumerable.call(value, 'callee');
15474
+ };
15475
+
15476
+ var isArguments_1 = isArguments;
15477
+
15478
+ /**
15479
+ * This method returns `false`.
15480
+ *
15481
+ * @static
15482
+ * @memberOf _
15483
+ * @since 4.13.0
15484
+ * @category Util
15485
+ * @returns {boolean} Returns `false`.
15486
+ * @example
15487
+ *
15488
+ * _.times(2, _.stubFalse);
15489
+ * // => [false, false]
15490
+ */
15491
+ function stubFalse() {
15492
+ return false;
15493
+ }
15494
+
15495
+ var stubFalse_1 = stubFalse;
15496
+
15497
+ var isBuffer_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
15498
+ /** Detect free variable `exports`. */
15499
+ var freeExports = exports && !exports.nodeType && exports;
15500
+
15501
+ /** Detect free variable `module`. */
15502
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
15503
+
15504
+ /** Detect the popular CommonJS extension `module.exports`. */
15505
+ var moduleExports = freeModule && freeModule.exports === freeExports;
15506
+
15507
+ /** Built-in value references. */
15508
+ var Buffer = moduleExports ? debounce._root.Buffer : undefined;
15509
+
15510
+ /* Built-in method references for those with the same name as other `lodash` methods. */
15511
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
15512
+
15513
+ /**
15514
+ * Checks if `value` is a buffer.
15515
+ *
15516
+ * @static
15517
+ * @memberOf _
15518
+ * @since 4.3.0
15519
+ * @category Lang
15520
+ * @param {*} value The value to check.
15521
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
15522
+ * @example
15523
+ *
15524
+ * _.isBuffer(new Buffer(2));
15525
+ * // => true
15526
+ *
15527
+ * _.isBuffer(new Uint8Array(2));
15528
+ * // => false
15529
+ */
15530
+ var isBuffer = nativeIsBuffer || stubFalse_1;
15531
+
15532
+ module.exports = isBuffer;
15533
+ });
15534
+
15535
+ /** Used as references for various `Number` constants. */
15536
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
15537
+
15538
+ /** Used to detect unsigned integer values. */
15539
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
15540
+
15541
+ /**
15542
+ * Checks if `value` is a valid array-like index.
15543
+ *
15544
+ * @private
15545
+ * @param {*} value The value to check.
15546
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
15547
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
15548
+ */
15549
+ function isIndex(value, length) {
15550
+ var type = typeof value;
15551
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
15552
+
15553
+ return !!length &&
15554
+ (type == 'number' ||
15555
+ (type != 'symbol' && reIsUint.test(value))) &&
15556
+ (value > -1 && value % 1 == 0 && value < length);
15557
+ }
15558
+
15559
+ var _isIndex = isIndex;
15560
+
15561
+ /** `Object#toString` result references. */
15562
+ var argsTag$1 = '[object Arguments]',
15563
+ arrayTag = '[object Array]',
15564
+ boolTag = '[object Boolean]',
15565
+ dateTag = '[object Date]',
15566
+ errorTag = '[object Error]',
15567
+ funcTag = '[object Function]',
15568
+ mapTag = '[object Map]',
15569
+ numberTag = '[object Number]',
15570
+ objectTag = '[object Object]',
15571
+ regexpTag = '[object RegExp]',
15572
+ setTag = '[object Set]',
15573
+ stringTag$1 = '[object String]',
15574
+ weakMapTag = '[object WeakMap]';
15575
+
15576
+ var arrayBufferTag = '[object ArrayBuffer]',
15577
+ dataViewTag = '[object DataView]',
15578
+ float32Tag = '[object Float32Array]',
15579
+ float64Tag = '[object Float64Array]',
15580
+ int8Tag = '[object Int8Array]',
15581
+ int16Tag = '[object Int16Array]',
15582
+ int32Tag = '[object Int32Array]',
15583
+ uint8Tag = '[object Uint8Array]',
15584
+ uint8ClampedTag = '[object Uint8ClampedArray]',
15585
+ uint16Tag = '[object Uint16Array]',
15586
+ uint32Tag = '[object Uint32Array]';
15587
+
15588
+ /** Used to identify `toStringTag` values of typed arrays. */
15589
+ var typedArrayTags = {};
15590
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
15591
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
15592
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
15593
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
15594
+ typedArrayTags[uint32Tag] = true;
15595
+ typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
15596
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
15597
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
15598
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
15599
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
15600
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
15601
+ typedArrayTags[setTag] = typedArrayTags[stringTag$1] =
15602
+ typedArrayTags[weakMapTag] = false;
15603
+
15604
+ /**
15605
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
15606
+ *
15607
+ * @private
15608
+ * @param {*} value The value to check.
15609
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
15610
+ */
15611
+ function baseIsTypedArray(value) {
15612
+ return debounce.isObjectLike_1(value) &&
15613
+ isLength_1(value.length) && !!typedArrayTags[debounce._baseGetTag(value)];
15614
+ }
15615
+
15616
+ var _baseIsTypedArray = baseIsTypedArray;
15617
+
15618
+ /**
15619
+ * The base implementation of `_.unary` without support for storing metadata.
15620
+ *
15621
+ * @private
15622
+ * @param {Function} func The function to cap arguments for.
15623
+ * @returns {Function} Returns the new capped function.
15624
+ */
15625
+ function baseUnary(func) {
15626
+ return function(value) {
15627
+ return func(value);
15628
+ };
15629
+ }
15630
+
15631
+ var _baseUnary = baseUnary;
15632
+
15633
+ var _nodeUtil = _commonjsHelpers.createCommonjsModule(function (module, exports) {
15634
+ /** Detect free variable `exports`. */
15635
+ var freeExports = exports && !exports.nodeType && exports;
15636
+
15637
+ /** Detect free variable `module`. */
15638
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
15639
+
15640
+ /** Detect the popular CommonJS extension `module.exports`. */
15641
+ var moduleExports = freeModule && freeModule.exports === freeExports;
15642
+
15643
+ /** Detect free variable `process` from Node.js. */
15644
+ var freeProcess = moduleExports && debounce._freeGlobal.process;
15645
+
15646
+ /** Used to access faster Node.js helpers. */
15647
+ var nodeUtil = (function() {
15648
+ try {
15649
+ // Use `util.types` for Node.js 10+.
15650
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
15651
+
15652
+ if (types) {
15653
+ return types;
15654
+ }
15655
+
15656
+ // Legacy `process.binding('util')` for Node.js < 10.
15657
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
15658
+ } catch (e) {}
15659
+ }());
15660
+
15661
+ module.exports = nodeUtil;
15662
+ });
15663
+
15664
+ /* Node.js helper references. */
15665
+ var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
15666
+
15667
+ /**
15668
+ * Checks if `value` is classified as a typed array.
15669
+ *
15670
+ * @static
15671
+ * @memberOf _
15672
+ * @since 3.0.0
15673
+ * @category Lang
15674
+ * @param {*} value The value to check.
15675
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
15676
+ * @example
15677
+ *
15678
+ * _.isTypedArray(new Uint8Array);
15679
+ * // => true
15680
+ *
15681
+ * _.isTypedArray([]);
15682
+ * // => false
15683
+ */
15684
+ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
15685
+
15686
+ var isTypedArray_1 = isTypedArray;
15687
+
15688
+ /** Used for built-in method references. */
15689
+ var objectProto$1 = Object.prototype;
15690
+
15691
+ /** Used to check objects for own properties. */
15692
+ var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
15693
+
15694
+ /**
15695
+ * Creates an array of the enumerable property names of the array-like `value`.
15696
+ *
15697
+ * @private
15698
+ * @param {*} value The value to query.
15699
+ * @param {boolean} inherited Specify returning inherited property names.
15700
+ * @returns {Array} Returns the array of property names.
15701
+ */
15702
+ function arrayLikeKeys(value, inherited) {
15703
+ var isArr = get$1.isArray_1(value),
15704
+ isArg = !isArr && isArguments_1(value),
15705
+ isBuff = !isArr && !isArg && isBuffer_1(value),
15706
+ isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
15707
+ skipIndexes = isArr || isArg || isBuff || isType,
15708
+ result = skipIndexes ? _baseTimes(value.length, String) : [],
15709
+ length = result.length;
15710
+
15711
+ for (var key in value) {
15712
+ if ((inherited || hasOwnProperty$2.call(value, key)) &&
15713
+ !(skipIndexes && (
15714
+ // Safari 9 has enumerable `arguments.length` in strict mode.
15715
+ key == 'length' ||
15716
+ // Node.js 0.10 has enumerable non-index properties on buffers.
15717
+ (isBuff && (key == 'offset' || key == 'parent')) ||
15718
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
15719
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
15720
+ // Skip index properties.
15721
+ _isIndex(key, length)
15722
+ ))) {
15723
+ result.push(key);
15724
+ }
15725
+ }
15726
+ return result;
15727
+ }
15728
+
15729
+ var _arrayLikeKeys = arrayLikeKeys;
15730
+
15731
+ /** Used for built-in method references. */
15732
+ var objectProto$2 = Object.prototype;
15733
+
15734
+ /**
15735
+ * Checks if `value` is likely a prototype object.
15736
+ *
15737
+ * @private
15738
+ * @param {*} value The value to check.
15739
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
15740
+ */
15741
+ function isPrototype(value) {
15742
+ var Ctor = value && value.constructor,
15743
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$2;
15744
+
15745
+ return value === proto;
15746
+ }
15747
+
15748
+ var _isPrototype = isPrototype;
15749
+
15750
+ /**
15751
+ * Creates a unary function that invokes `func` with its argument transformed.
15752
+ *
15753
+ * @private
15754
+ * @param {Function} func The function to wrap.
15755
+ * @param {Function} transform The argument transform.
15756
+ * @returns {Function} Returns the new function.
15757
+ */
15758
+ function overArg(func, transform) {
15759
+ return function(arg) {
15760
+ return func(transform(arg));
15761
+ };
15762
+ }
15763
+
15764
+ var _overArg = overArg;
15765
+
15766
+ /* Built-in method references for those with the same name as other `lodash` methods. */
15767
+ var nativeKeys = _overArg(Object.keys, Object);
15768
+
15769
+ var _nativeKeys = nativeKeys;
15770
+
15771
+ /** Used for built-in method references. */
15772
+ var objectProto$3 = Object.prototype;
15773
+
15774
+ /** Used to check objects for own properties. */
15775
+ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
15776
+
15777
+ /**
15778
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
15779
+ *
15780
+ * @private
15781
+ * @param {Object} object The object to query.
15782
+ * @returns {Array} Returns the array of property names.
15783
+ */
15784
+ function baseKeys(object) {
15785
+ if (!_isPrototype(object)) {
15786
+ return _nativeKeys(object);
15787
+ }
15788
+ var result = [];
15789
+ for (var key in Object(object)) {
15790
+ if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
15791
+ result.push(key);
15792
+ }
15793
+ }
15794
+ return result;
15795
+ }
15796
+
15797
+ var _baseKeys = baseKeys;
15798
+
15799
+ /**
15800
+ * Creates an array of the own enumerable property names of `object`.
15801
+ *
15802
+ * **Note:** Non-object values are coerced to objects. See the
15803
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
15804
+ * for more details.
15805
+ *
15806
+ * @static
15807
+ * @since 0.1.0
15808
+ * @memberOf _
15809
+ * @category Object
15810
+ * @param {Object} object The object to query.
15811
+ * @returns {Array} Returns the array of property names.
15812
+ * @example
15813
+ *
15814
+ * function Foo() {
15815
+ * this.a = 1;
15816
+ * this.b = 2;
15817
+ * }
15818
+ *
15819
+ * Foo.prototype.c = 3;
15820
+ *
15821
+ * _.keys(new Foo);
15822
+ * // => ['a', 'b'] (iteration order is not guaranteed)
15823
+ *
15824
+ * _.keys('hi');
15825
+ * // => ['0', '1']
15826
+ */
15827
+ function keys$2(object) {
15828
+ return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
15829
+ }
15830
+
15831
+ var keys_1 = keys$2;
15832
+
15833
+ /**
15834
+ * Creates an array of the own enumerable string keyed property values of `object`.
15835
+ *
15836
+ * **Note:** Non-object values are coerced to objects.
15837
+ *
15838
+ * @static
15839
+ * @since 0.1.0
15840
+ * @memberOf _
15841
+ * @category Object
15842
+ * @param {Object} object The object to query.
15843
+ * @returns {Array} Returns the array of property values.
15844
+ * @example
15845
+ *
15846
+ * function Foo() {
15847
+ * this.a = 1;
15848
+ * this.b = 2;
15849
+ * }
15850
+ *
15851
+ * Foo.prototype.c = 3;
15852
+ *
15853
+ * _.values(new Foo);
15854
+ * // => [1, 2] (iteration order is not guaranteed)
15855
+ *
15856
+ * _.values('hi');
15857
+ * // => ['h', 'i']
15858
+ */
15859
+ function values(object) {
15860
+ return object == null ? [] : _baseValues(object, keys_1(object));
15861
+ }
15862
+
15863
+ var values_1 = values;
15864
+
15865
+ /* Built-in method references for those with the same name as other `lodash` methods. */
15866
+ var nativeMax = Math.max;
15867
+
15868
+ /**
15869
+ * Checks if `value` is in `collection`. If `collection` is a string, it's
15870
+ * checked for a substring of `value`, otherwise
15871
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15872
+ * is used for equality comparisons. If `fromIndex` is negative, it's used as
15873
+ * the offset from the end of `collection`.
15874
+ *
15875
+ * @static
15876
+ * @memberOf _
15877
+ * @since 0.1.0
15878
+ * @category Collection
15879
+ * @param {Array|Object|string} collection The collection to inspect.
15880
+ * @param {*} value The value to search for.
15881
+ * @param {number} [fromIndex=0] The index to search from.
15882
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
15883
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
15884
+ * @example
15885
+ *
15886
+ * _.includes([1, 2, 3], 1);
15887
+ * // => true
15888
+ *
15889
+ * _.includes([1, 2, 3], 1, 2);
15890
+ * // => false
15891
+ *
15892
+ * _.includes({ 'a': 1, 'b': 2 }, 1);
15893
+ * // => true
15894
+ *
15895
+ * _.includes('abcd', 'bc');
15896
+ * // => true
15897
+ */
15898
+ function includes(collection, value, fromIndex, guard) {
15899
+ collection = isArrayLike_1(collection) ? collection : values_1(collection);
15900
+ fromIndex = (fromIndex && !guard) ? toInteger_1(fromIndex) : 0;
15901
+
15902
+ var length = collection.length;
15903
+ if (fromIndex < 0) {
15904
+ fromIndex = nativeMax(length + fromIndex, 0);
15905
+ }
15906
+ return isString_1(collection)
15907
+ ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
15908
+ : (!!length && _baseIndexOf(collection, value, fromIndex) > -1);
15909
+ }
15910
+
15911
+ var includes_1 = includes;
15912
+
15913
+ var InscreenSensor = function (_React$Component) {
15914
+ inherits$2._inherits(InscreenSensor, _React$Component);
15915
+
15916
+ function InscreenSensor(props) {
15917
+ inherits$2._classCallCheck(this, InscreenSensor);
15918
+
15919
+ var _this = inherits$2._possibleConstructorReturn(this, (InscreenSensor.__proto__ || inherits$2._Object$getPrototypeOf(InscreenSensor)).call(this, props));
15920
+
15921
+ _this.scrollHandler = function () {
15922
+ // this.checkInside()
15923
+
15924
+ var visible = _this.checkInside();
15925
+ if (visible !== _this.visible) {
15926
+ _this.visible = visible;
15927
+ _this.props.onChange(visible);
15928
+ }
15929
+ };
15930
+
15931
+ _this.checkInside = function () {
15932
+ var rect = _this.wraperRef.current.getBoundingClientRect();
15933
+ var _this$props$offSetTop = _this.props.offSetTop,
15934
+ offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
15935
+ var top = rect.top,
15936
+ height = rect.height;
15937
+
15938
+ var bottom = top + height;
15939
+ var viewHeight = window.innerHeight;
15940
+ if (bottom < offSetTop) {
15941
+ return false;
15942
+ } else if (top > offSetTop && bottom <= viewHeight) {
15943
+ return true;
15944
+ } else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
15945
+ return 'top';
15946
+ } else if (bottom <= viewHeight) {
15947
+ return 'bottom';
15948
+ } else {
15949
+ return false;
15950
+ }
15951
+ };
15952
+
15953
+ _this.wraperRef = React__default.createRef();
15954
+ _this.visible = false;
15955
+ return _this;
15956
+ }
15957
+
15958
+ inherits$2._createClass(InscreenSensor, [{
15959
+ key: 'componentDidMount',
15960
+ value: function componentDidMount() {
15961
+ this.visible = this.checkInside();
15962
+ this.props.onChange(this.visible);
15963
+ window.addEventListener('scroll', this.scrollHandler);
15964
+ }
15965
+ }, {
15966
+ key: 'componentWillUnmount',
15967
+ value: function componentWillUnmount() {
15968
+ window.removeEventListener('scroll', this.scrollHandler);
15969
+ }
15970
+ }, {
15971
+ key: 'render',
15972
+ value: function render() {
15973
+ var _props = this.props,
15974
+ _props$className = _props.className,
15975
+ className = _props$className === undefined ? '' : _props$className,
15976
+ _props$style = _props.style,
15977
+ style = _props$style === undefined ? {} : _props$style;
15978
+
15979
+ return React__default.createElement(
15980
+ 'div',
15981
+ { ref: this.wraperRef, className: className, style: style },
15982
+ this.props.children
15983
+ );
15984
+ }
15985
+ }]);
15986
+
15987
+ return InscreenSensor;
15215
15988
  }(React__default.Component);
15216
15989
 
15217
15990
  var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
@@ -15253,11 +16026,38 @@ var Article = function Article(props) {
15253
16026
  } : _props$article$url;
15254
16027
  var url = _props$article$url.current,
15255
16028
  issue = _props$article.issue,
16029
+ regionalPages = props.regionalPages,
16030
+ nationalPage = props.nationalPage,
16031
+ ISIContent = props.ISIContent,
15256
16032
  changeUrl = props.changeUrl,
15257
- isCutomPage = props.isCutomPage,
15258
- shareOptions = props.shareOptions,
15259
- renderIsiContent = props.renderIsiContent,
15260
- urlFor = props.urlFor;
16033
+ shareOptions = props.shareOptions;
16034
+
16035
+
16036
+ var urlFor = function urlFor(source) {
16037
+ return index.imageUrlBuilder(client).image(source);
16038
+ };
16039
+
16040
+ var isCutomPage = function isCutomPage(article) {
16041
+ var url = article.url.current;
16042
+
16043
+ if (regionalPages || nationalPage) {
16044
+ return regionalPages.includes(url) || nationalPage === url;
16045
+ } else {
16046
+ return false;
16047
+ }
16048
+ };
16049
+
16050
+ var renderIsiContent = function renderIsiContent(article) {
16051
+ var url = article.url.current;
16052
+
16053
+ if (regionalPages.includes(url)) {
16054
+ return React__default.createElement(ISIContent, null);
16055
+ } else if (nationalPage === url) {
16056
+ return React__default.createElement(ISIContent, { national: true });
16057
+ }
16058
+ return null;
16059
+ };
16060
+
15261
16061
  var shareVia = shareOptions.shareVia,
15262
16062
  shareSubject = shareOptions.shareSubject,
15263
16063
  twitterSiteName = shareOptions.twitterSiteName,
@@ -15391,166 +16191,65 @@ var Article = function Article(props) {
15391
16191
  React__default.createElement('hr', { className: 'article-seperater' })
15392
16192
  );
15393
16193
  };
16194
+ var ArticleQueue = function ArticleQueue(props) {
16195
+ var website = props.website,
16196
+ Ads = props.Ads,
16197
+ mainNavCache = props.mainNavCache,
16198
+ subNavCache = props.subNavCache,
16199
+ isLiveSite = props.isLiveSite,
16200
+ _props$sponsoredTaxon = props.sponsoredTaxonomies,
16201
+ sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon;
15394
16202
 
15395
- var ArticleQueue = function (_React$Component) {
15396
- inherits$2._inherits(ArticleQueue, _React$Component);
15397
-
15398
- function ArticleQueue(props) {
15399
- inherits$2._classCallCheck(this, ArticleQueue);
15400
-
15401
- var _this = inherits$2._possibleConstructorReturn(this, (ArticleQueue.__proto__ || inherits$2._Object$getPrototypeOf(ArticleQueue)).call(this, props));
15402
-
15403
- _initialiseProps.call(_this);
15404
-
15405
- var _this$props$article = _this.props.article,
15406
- summary = _this$props$article.summary,
15407
- _this$props$article$s = _this$props$article.seo;
15408
- _this$props$article$s = _this$props$article$s === undefined ? {
15409
- meta_description: null
15410
- } : _this$props$article$s;
15411
- var description = _this$props$article$s.meta_description;
15412
-
15413
- var targeting = _this.getTargeting(_this.props.article);
15414
- var metaDescription = description ? description : summary ? summary : _this.getFirstLine(_this.props.article);
15415
- var article = _this.props.article;
15416
- article.Ads = _this.props.Ads.getRightItems(targeting);
15417
-
15418
- _this.state = {
15419
- config: {
15420
- navComponent: _this.props.website.navigation,
15421
- navItems: _this.props.mainNavCache,
15422
- columns: '3',
15423
- leftItems: _this.props.subNavCache,
15424
- rightItems: _this.props.Ads.getRightItems(targeting),
15425
- horizontalAD: _this.props.Ads.getHorizontal(targeting),
15426
- isLiveSite: _this.props.isLiveSite
15427
- },
15428
- title: _this.props.article.title,
15429
- summary: metaDescription,
15430
- queueData: [article],
15431
- keywords: [],
15432
- maxListLength: 10,
15433
- loading: false
15434
- }, _this.preVscroll = 0;
15435
- _this.isScrollDown = true;
15436
-
15437
- return _this;
15438
- }
15439
-
15440
- inherits$2._createClass(ArticleQueue, [{
15441
- key: 'componentDidMount',
15442
- value: function componentDidMount() {
15443
- window.addEventListener('scroll', this.scrollDirectionDetect);
15444
- }
15445
- }, {
15446
- key: 'componentWillUnmount',
15447
- value: function componentWillUnmount() {
15448
- window.removeEventListener('scroll', this.scrollDirectionDetect);
15449
- }
15450
- // To return the 1st Line of text in the article body
15451
-
15452
- }, {
15453
- key: 'render',
15454
- value: function render() {
15455
- var _this2 = this;
15456
-
15457
- var _state = this.state,
15458
- config = _state.config,
15459
- queueData = _state.queueData,
15460
- title = _state.title,
15461
- summary = _state.summary,
15462
- _state$keywords = _state.keywords,
15463
- keywords = _state$keywords === undefined ? [] : _state$keywords;
15464
- var _props = this.props,
15465
- website = _props.website,
15466
- shareOptions = _props.shareOptions;
15467
-
15468
-
15469
- return React__default.createElement(
15470
- TemplateNormal.TemplateNormal,
15471
- { config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: !main.main_36 },
15472
- React__default.createElement(
15473
- visibilitySensor.InfiniteScroll,
15474
- { dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
15475
- queueData.map(function (article, index) {
15476
- return React__default.createElement(Article, _extends$2._extends({
15477
- key: index,
15478
- urlFor: _this2.urlFor,
15479
- isCutomPage: _this2.isCutomPage,
15480
- renderIsiContent: _this2.renderIsiContent
15481
- }, _this2.props, {
15482
- shareOptions: shareOptions,
15483
- changeUrl: _this2.changeUrl,
15484
- article: article
15485
- }));
15486
- })
15487
- )
15488
- );
15489
- }
15490
- }]);
16203
+ var _useState = React.useState(''),
16204
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
16205
+ prevUrl = _useState2[0],
16206
+ setPrevUrl = _useState2[1];
15491
16207
 
15492
- return ArticleQueue;
15493
- }(React__default.Component);
16208
+ var _useState3 = React.useState([props.article]),
16209
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
16210
+ queueData = _useState4[0],
16211
+ setQueueData = _useState4[1];
15494
16212
 
15495
- var _initialiseProps = function _initialiseProps() {
15496
- var _this3 = this;
16213
+ var _useState5 = React.useState({}),
16214
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
16215
+ activeArticle = _useState6[0],
16216
+ setActiveArticle = _useState6[1];
15497
16217
 
15498
- this.scrollDirectionDetect = function (e) {
15499
- var window = e.currentTarget;
15500
- var isScrollDown = _this3.isScrollDown;
16218
+ var maxListLength = 10;
16219
+ var preVscroll = 0;
16220
+ var isScrollDown = true;
15501
16221
 
16222
+ var _activeArticle$title = activeArticle.title,
16223
+ title = _activeArticle$title === undefined ? '' : _activeArticle$title,
16224
+ _activeArticle$summar = activeArticle.summary,
16225
+ summary = _activeArticle$summar === undefined ? '' : _activeArticle$summar;
15502
16226
 
15503
- if (_this3.preVscroll > window.scrollY) {
15504
- if (!isScrollDown) {
15505
- _this3.isScrollDown = true;
15506
- }
15507
- } else if (_this3.preVscroll < window.scrollY) {
15508
- if (isScrollDown) {
15509
- _this3.isScrollDown = false;
15510
- }
15511
- }
15512
- _this3.preVscroll = window.scrollY;
15513
- };
15514
16227
 
15515
- this.loadmore = function () {
16228
+ var getFirstLine = function getFirstLine(article) {
16229
+ var _article$body = article.body,
16230
+ body = _article$body === undefined ? [] : _article$body;
15516
16231
 
15517
- var maxListLength = _this3.props.maxListLength ? _this3.props.maxListLength : _this3.state.maxListLength;
15518
- var queueData = [].concat(toConsumableArray._toConsumableArray(_this3.state.queueData));
15519
- var query = _this3.props.relatedArticleQuery;
15520
- var params = _this3.props.params;
15521
- if (queueData.length < maxListLength) {
15522
- params.index = queueData.length - 1;
15523
- var that = _this3;
15524
- _this3.props.client.fetch(query, params).then(function (article) {
15525
- if (article && article._id) {
15526
- var targeting = that.getTargeting(article);
15527
- article.Ads = that.props.Ads.getRightItems(targeting);
15528
- queueData.push(article);
15529
- that.setState({ queueData: queueData });
16232
+ var desc = '';
16233
+ body.some(function (children) {
16234
+ children.children && children.children.some(function (item) {
16235
+ if (item.text && String(item.text).trim().length > 0 && desc == '') {
16236
+ console.log(String(item.text));
16237
+ desc = String(item.text);
16238
+ return true;
15530
16239
  }
15531
16240
  });
15532
- }
15533
- };
15534
-
15535
- this.isCutomPage = function (article) {
15536
- var url = article.url.current;
15537
- var _props2 = _this3.props,
15538
- regionalPages = _props2.regionalPages,
15539
- nationalPage = _props2.nationalPage;
15540
-
15541
- if (regionalPages || nationalPage) {
15542
-
15543
- return regionalPages.includes(url) || nationalPage === url;
15544
- } else {
15545
- return false;
15546
- }
16241
+ if (desc !== '') {
16242
+ return true;
16243
+ }
16244
+ });
16245
+ return desc;
15547
16246
  };
15548
16247
 
15549
- this.urlFor = function (source) {
15550
- return index.imageUrlBuilder(_this3.props.client).image(source);
15551
- };
16248
+ if (summary.length === 0) {
16249
+ summary = getFirstLine(activeArticle);
16250
+ }
15552
16251
 
15553
- this.getTargeting = function (article) {
16252
+ var getTargeting = function getTargeting(article) {
15554
16253
  var _article$internalTag = article.internalTag,
15555
16254
  internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
15556
16255
  _article$userDefinedT = article.userDefinedTag,
@@ -15572,34 +16271,33 @@ var _initialiseProps = function _initialiseProps() {
15572
16271
  content_placement = article.content_placement;
15573
16272
 
15574
16273
  var context = url;
15575
- var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
16274
+ var localHistory = props.historyCookie ? JSON.parse(props.historyCookie) : [];
15576
16275
  if (!context && localHistory) {
15577
16276
  context = localHistory[localHistory.length - 1];
15578
16277
  }
15579
16278
  context = context && context.split('?')[0];
15580
16279
  context = context && context.split('&')[0];
15581
16280
  var content_placement_urls = [];
16281
+ if (content_placement && prevUrl && prevUrl.length) {
16282
+ content_placement.forEach(function (item) {
16283
+ if (includes_1(prevUrl, item.path)) {
16284
+ content_placement_urls.push(item.path);
16285
+ }
16286
+ });
16287
+ }
16288
+
15582
16289
  if (content_placement) {
15583
- if (content_placement.some(function (item) {
15584
- return context === item.path;
15585
- })) {
15586
- content_placement_urls = [context];
15587
- } else if (content_placement.some(function (item) {
15588
- return context === '/' + item.path;
15589
- })) {
15590
- content_placement_urls = [context.slice(1)];
15591
- } else {
16290
+ if (content_placement_urls.length === 0) {
15592
16291
  content_placement_urls = content_placement.map(function (item) {
15593
16292
  return item.path;
15594
16293
  });
15595
16294
  }
16295
+ } else {
16296
+ content_placement_urls = ['/'];
15596
16297
  }
15597
- if (document_group.length > 0) {
15598
- content_placement_urls = [];
15599
- }
15600
- var keywords = [].concat(toConsumableArray._toConsumableArray(internalTag), toConsumableArray._toConsumableArray(userDefinedTag), toConsumableArray._toConsumableArray(SponsorshipTag), toConsumableArray._toConsumableArray(seoTag));
16298
+ var articleKeywords = [].concat(toConsumableArray._toConsumableArray(internalTag), toConsumableArray._toConsumableArray(userDefinedTag), toConsumableArray._toConsumableArray(SponsorshipTag), toConsumableArray._toConsumableArray(seoTag));
15601
16299
  var targeting = {
15602
- tags: keywords,
16300
+ tags: articleKeywords,
15603
16301
  document_group: [document_group],
15604
16302
  document_url: [url],
15605
16303
  content_placement: content_placement_urls
@@ -15607,122 +16305,174 @@ var _initialiseProps = function _initialiseProps() {
15607
16305
  return targeting;
15608
16306
  };
15609
16307
 
15610
- this.checkSponseredArticle = function (article) {
16308
+ var _useState7 = React.useState(getTargeting(activeArticle)),
16309
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
16310
+ targeting = _useState8[0],
16311
+ setTargeting = _useState8[1];
16312
+
16313
+ var keywords = targeting && targeting.keywords ? targeting.keywords : [];
16314
+
16315
+ var config = {
16316
+ navComponent: website.navigation,
16317
+ navItems: mainNavCache,
16318
+ columns: '3',
16319
+ leftItems: subNavCache,
16320
+ rightItems: [],
16321
+ horizontalAD: {},
16322
+ isLiveSite: isLiveSite
16323
+ };
16324
+ props.article.Ads = [];
16325
+
16326
+ var _useState9 = React.useState(config),
16327
+ _useState10 = slicedToArray._slicedToArray(_useState9, 2),
16328
+ pageConfig = _useState10[0],
16329
+ setPageConfig = _useState10[1];
16330
+
16331
+ var checkSponseredArticle = function checkSponseredArticle(article) {
15611
16332
  var _article$taxonomyMapp = article.taxonomyMapping,
15612
16333
  taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
15613
16334
 
15614
- if (_this3.props.checkSponsered) {
15615
-
16335
+ if (props.checkSponsered) {
15616
16336
  return taxonomyMapping.some(function (item) {
15617
- return item._ref === 'ict_taxonomy_735_sponsoredresources';
16337
+ return includes_1(sponsoredTaxonomies, item._ref);
15618
16338
  });
15619
16339
  } else {
15620
16340
  return false;
15621
16341
  }
15622
16342
  };
15623
16343
 
15624
- this.renderIsiContent = function (article) {
15625
- var url = article.url.current;
15626
- var _props3 = _this3.props,
15627
- ISIContent = _props3.iSIContent,
15628
- regionalPages = _props3.regionalPages,
15629
- nationalPage = _props3.nationalPage;
15630
-
15631
- if (regionalPages.includes(url)) {
15632
- return React__default.createElement(ISIContent, null);
15633
- } else if (nationalPage === url) {
15634
- return React__default.createElement(ISIContent, { national: true });
16344
+ var updateConfig = function updateConfig(article) {
16345
+ if (prevUrl && prevUrl.length) {
16346
+ var _targeting = getTargeting(article);
16347
+ var _config = {
16348
+ navComponent: website.navigation,
16349
+ navItems: mainNavCache,
16350
+ columns: '3',
16351
+ leftItems: subNavCache,
16352
+ rightItems: checkSponseredArticle(article) ? [] : Ads.getRightItems(_targeting),
16353
+ horizontalAD: checkSponseredArticle(article) ? {} : Ads.getHorizontal(_targeting),
16354
+ isLiveSite: isLiveSite
16355
+ };
16356
+ setPageConfig(_config);
16357
+ if (!main.main_36) {
16358
+ debounce.lib_3.getGoogletag().then(function (googletag) {
16359
+ if (window.googletag && googletag.pubadsReady) {
16360
+ var slots = googletag.pubads().getSlots();
16361
+ slots.forEach(function (slot) {
16362
+ slot.clearTargeting();
16363
+ _Object$keys(_targeting).forEach(function (key) {
16364
+ slot.setTargeting(key, _targeting[key]);
16365
+ });
16366
+ });
16367
+ googletag.cmd.push(function () {
16368
+ googletag.pubads().refresh();
16369
+ });
16370
+ }
16371
+ });
16372
+ }
15635
16373
  }
15636
- return null;
15637
16374
  };
15638
16375
 
15639
- this.getFirstLine = function (article) {
15640
- var _article$body = article.body,
15641
- body = _article$body === undefined ? [] : _article$body;
16376
+ React.useEffect(function () {
16377
+ setPrevUrl(document && document.referrer ? document.referrer : '/');
16378
+ props.article.Ads = Ads.getRightItems(targeting);
16379
+ setActiveArticle(props.article);
16380
+ }, [setPrevUrl]);
15642
16381
 
15643
- var desc = '';
15644
- body.some(function (children) {
15645
- children.children && children.children.some(function (item) {
15646
- if (item.text && String(item.text).trim().length > 0 && desc == '') {
15647
- console.log(String(item.text));
15648
- desc = String(item.text);
15649
- return true;
15650
- }
15651
- });
15652
- if (desc !== '') {
15653
- return true;
16382
+ React.useEffect(function () {
16383
+ setActiveArticle(props.article);
16384
+ }, [prevUrl]);
16385
+
16386
+ React.useEffect(function () {
16387
+ updateConfig(activeArticle);
16388
+ }, [activeArticle]);
16389
+
16390
+ var scrollDirectionDetect = function scrollDirectionDetect(e) {
16391
+ var window = e.currentTarget;
16392
+ if (preVscroll > window.scrollY) {
16393
+ if (!isScrollDown) {
16394
+ isScrollDown = true;
15654
16395
  }
15655
- });
15656
- return desc;
16396
+ } else if (preVscroll < window.scrollY) {
16397
+ if (isScrollDown) {
16398
+ isScrollDown = false;
16399
+ }
16400
+ }
16401
+ preVscroll = window.scrollY;
15657
16402
  };
15658
16403
 
15659
- this.refreshAdd = function (path) {
15660
- var article = _this3.state.queueData.find(function (item) {
15661
- return item.url.current == path;
16404
+ React.useEffect(function () {
16405
+ window.addEventListener('scroll', scrollDirectionDetect);
16406
+ });
16407
+
16408
+ var loadmore = function loadmore() {
16409
+ var query = props.relatedArticleQuery;
16410
+ var params = props.params;
16411
+ var data = queueData.map(function (item) {
16412
+ return item;
15662
16413
  });
15663
- var title = article.title,
15664
- summary = article.summary,
15665
- _article$internalTag2 = article.internalTag,
15666
- internalTag = _article$internalTag2 === undefined ? [] : _article$internalTag2,
15667
- _article$userDefinedT2 = article.userDefinedTag,
15668
- userDefinedTag = _article$userDefinedT2 === undefined ? [] : _article$userDefinedT2,
15669
- _article$SponsorshipT2 = article.SponsorshipTag,
15670
- SponsorshipTag = _article$SponsorshipT2 === undefined ? [] : _article$SponsorshipT2,
15671
- _article$seoTag2 = article.seoTag,
15672
- seoTag = _article$seoTag2 === undefined ? [] : _article$seoTag2,
15673
- _article$seo = article.seo;
15674
- _article$seo = _article$seo === undefined ? {
15675
- meta_description: null
15676
- } : _article$seo;
15677
- var description = _article$seo.meta_description;
15678
-
15679
- var keywords = [].concat(toConsumableArray._toConsumableArray(internalTag), toConsumableArray._toConsumableArray(userDefinedTag), toConsumableArray._toConsumableArray(SponsorshipTag), toConsumableArray._toConsumableArray(seoTag));
15680
- var config = _extends$2._extends({}, _this3.state.config);
15681
- var targeting = _this3.getTargeting(article);
15682
- var rightItems = [];
15683
-
15684
- if (_this3.checkSponseredArticle(article)) {
15685
- rightItems = [];
15686
- } else {
15687
- rightItems = _this3.props.Ads.getRightItems(targeting);
16414
+ if (data && data.length < maxListLength) {
16415
+ params.index = data.length - 1;
16416
+ props.client.fetch(query, params).then(function (article) {
16417
+ if (article && article._id) {
16418
+ var _targeting2 = getTargeting(article);
16419
+ article.Ads = props.Ads.getRightItems(_targeting2);
16420
+ data.push(article);
16421
+ setQueueData(data);
16422
+ }
16423
+ });
15688
16424
  }
15689
- var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
15690
- config.rightItems = rightItems;
15691
- config.horizontalAD = horizontalAD;
15692
- var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
15693
- _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
15694
- if (!main.main_36) {
15695
- debounce.lib_3.refresh();
15696
- }
15697
- });
15698
16425
  };
15699
16426
 
15700
- this.changeUrl = function (path, visibility) {
15701
- var isScrollDown = _this3.isScrollDown;
16427
+ var refreshAdd = function refreshAdd(path) {
16428
+ var article = queueData.find(function (item) {
16429
+ return item.url.current === path;
16430
+ });
16431
+ var targeting = getTargeting(article);
16432
+ console.log('Forced Ad refresh', targeting);
16433
+ article.Ads = Ads.getRightItems(targeting);
16434
+ setActiveArticle(article);
16435
+ };
15702
16436
 
16437
+ var changeUrl = function changeUrl(path, visibility) {
15703
16438
  var newPath = '/view/' + path;
15704
16439
  if (!isScrollDown) {
15705
- if (visibility == 'top') {
15706
- // Router.push('/view/[url]', newPath, {shallow:true})
16440
+ if (visibility === 'top') {
16441
+ // Router.push('/view/[url]', newPath, { shallow: true })
15707
16442
  window.history.pushState({ page: path }, path, newPath);
15708
- if (_this3.props.pageview) {
15709
- _this3.props.pageview(newPath);
16443
+ if (props.pageview) {
16444
+ props.pageview(newPath);
15710
16445
  }
15711
-
15712
- _this3.refreshAdd(path);
16446
+ refreshAdd(path);
15713
16447
  }
15714
16448
  } else {
15715
- if (visibility == 'bottom') {
15716
- // Router.push('/view/[url]', newPath, {shallow:true})
16449
+ if (visibility === 'bottom') {
16450
+ // Router.push('/view/[url]', newPath, { shallow: true })
15717
16451
  window.history.pushState({ page: path }, path, newPath);
15718
- if (_this3.props.pageview) {
15719
- _this3.props.pageview(newPath);
16452
+ if (props.pageview) {
16453
+ props.pageview(newPath);
15720
16454
  }
15721
16455
 
15722
- _this3.refreshAdd(path);
16456
+ refreshAdd(path);
15723
16457
  }
15724
16458
  }
15725
16459
  };
16460
+
16461
+ if (prevUrl && prevUrl.length) {
16462
+ return React__default.createElement(
16463
+ TemplateNormal.TemplateNormal,
16464
+ { config: pageConfig, website: website, keywords: keywords, description: summary, title: title, showRightAd: !main.main_36 },
16465
+ React__default.createElement(
16466
+ visibilitySensor.InfiniteScroll,
16467
+ { dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
16468
+ queueData.map(function (article, index) {
16469
+ return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article }));
16470
+ })
16471
+ )
16472
+ );
16473
+ } else {
16474
+ return null;
16475
+ }
15726
16476
  };
15727
16477
 
15728
16478
  var KMTracker = function KMTracker(props) {