@mjhls/mjh-framework 1.0.694-beta.0 → 1.0.694-beta.2

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 (89) hide show
  1. package/dist/cjs/AD.js +1 -1
  2. package/dist/cjs/AD300x250.js +2 -2
  3. package/dist/cjs/AD300x250x600.js +2 -2
  4. package/dist/cjs/AD728x90.js +2 -2
  5. package/dist/cjs/ADFloatingFooter.js +2 -2
  6. package/dist/cjs/ADGutter.js +2 -2
  7. package/dist/cjs/ADSkyscraper.js +2 -2
  8. package/dist/cjs/ADSponsoredResources.js +2 -2
  9. package/dist/cjs/ADWebcast.js +2 -2
  10. package/dist/cjs/ADWelcome.js +2 -2
  11. package/dist/cjs/AdSlot.js +2 -2
  12. package/dist/cjs/ArticleSeriesListing.js +2 -2
  13. package/dist/cjs/CMEDeck.js +2 -2
  14. package/dist/cjs/Column2.js +2 -2
  15. package/dist/cjs/Column3.js +3 -3
  16. package/dist/cjs/DeckContent.js +3 -3
  17. package/dist/cjs/DeckQueue.js +3 -3
  18. package/dist/cjs/{Dfp-f6a18ed2.js → Dfp-1a9e2305.js} +2 -2
  19. package/dist/cjs/ExternalResources.js +3 -3
  20. package/dist/cjs/GridContent.js +5 -5
  21. package/dist/cjs/IssueLanding.js +4 -4
  22. package/dist/cjs/LeftNav.js +2 -2
  23. package/dist/cjs/MasterDeck.js +4 -4
  24. package/dist/cjs/PartnerDetailListing.js +5 -5
  25. package/dist/cjs/QueueDeckExpanded.js +4 -4
  26. package/dist/cjs/SideFooter.js +2 -2
  27. package/dist/cjs/TemplateNormal.js +3 -3
  28. package/dist/cjs/VideoSeriesListing.js +2 -2
  29. package/dist/cjs/View.js +178 -139
  30. package/dist/cjs/{debounce-eb287781.js → debounce-0106f44a.js} +1 -1
  31. package/dist/cjs/{get-68c52cb1.js → get-445b7179.js} +4 -1
  32. package/dist/cjs/getQuery.js +2 -2
  33. package/dist/cjs/getRelatedArticle.js +29 -57
  34. package/dist/cjs/getSerializers.js +3 -3
  35. package/dist/cjs/index.js +349 -13
  36. package/dist/cjs/{isSymbol-04666465.js → isSymbol-488934a7.js} +2 -0
  37. package/dist/esm/AD.js +1 -1
  38. package/dist/esm/AD300x250.js +3 -3
  39. package/dist/esm/AD300x250x600.js +3 -3
  40. package/dist/esm/AD728x90.js +3 -3
  41. package/dist/esm/ADFloatingFooter.js +3 -3
  42. package/dist/esm/ADGutter.js +3 -3
  43. package/dist/esm/ADSkyscraper.js +3 -3
  44. package/dist/esm/ADSponsoredResources.js +3 -3
  45. package/dist/esm/ADWebcast.js +3 -3
  46. package/dist/esm/ADWelcome.js +3 -3
  47. package/dist/esm/AdSlot.js +3 -3
  48. package/dist/esm/ArticleSeriesListing.js +2 -2
  49. package/dist/esm/Auth.js +1 -1
  50. package/dist/esm/Beam.js +1 -1
  51. package/dist/esm/CMEDeck.js +3 -3
  52. package/dist/esm/Column2.js +3 -3
  53. package/dist/esm/Column3.js +4 -4
  54. package/dist/esm/DeckContent.js +4 -4
  55. package/dist/esm/DeckQueue.js +3 -3
  56. package/dist/esm/{Dfp-96b49def.js → Dfp-0fc96a5d.js} +2 -2
  57. package/dist/esm/ExternalResources.js +4 -4
  58. package/dist/esm/GridContent.js +6 -6
  59. package/dist/esm/HamMagazine.js +1 -1
  60. package/dist/esm/IssueLanding.js +5 -5
  61. package/dist/esm/LeftNav.js +3 -3
  62. package/dist/esm/MasterDeck.js +5 -5
  63. package/dist/esm/NavDvm.js +1 -1
  64. package/dist/esm/NavMagazine.js +1 -1
  65. package/dist/esm/NavNative.js +1 -1
  66. package/dist/esm/NavNormal.js +1 -1
  67. package/dist/esm/PartnerDetailListing.js +6 -6
  68. package/dist/esm/QueueDeckExpanded.js +5 -5
  69. package/dist/esm/Segment.js +1 -1
  70. package/dist/esm/SideFooter.js +3 -3
  71. package/dist/esm/TemplateNormal.js +4 -4
  72. package/dist/esm/VideoSeriesFilter.js +1 -1
  73. package/dist/esm/VideoSeriesListing.js +2 -2
  74. package/dist/esm/View.js +179 -140
  75. package/dist/esm/{asyncToGenerator-7c654f36.js → asyncToGenerator-d0f08f8d.js} +1 -1
  76. package/dist/esm/{debounce-1a993acf.js → debounce-3ab4e0ad.js} +1 -1
  77. package/dist/esm/{get-5ee14cda.js → get-a36cf4c6.js} +2 -2
  78. package/dist/esm/getQuery.js +2 -2
  79. package/dist/esm/getRelatedArticle.js +30 -58
  80. package/dist/esm/getSerializers.js +4 -4
  81. package/dist/esm/index.js +349 -13
  82. package/dist/esm/{isSymbol-807e927e.js → isSymbol-5eb15258.js} +1 -1
  83. package/package.json +1 -1
  84. /package/dist/cjs/{ADInfeed-2fe7211c.js → ADInfeed-4ef14853.js} +0 -0
  85. /package/dist/cjs/{ADlgInfeed-14e17b43.js → ADlgInfeed-d42cc813.js} +0 -0
  86. /package/dist/cjs/{index-a5919bab.js → index-26569dcc.js} +0 -0
  87. /package/dist/esm/{ADInfeed-eae71d07.js → ADInfeed-ddbadcd3.js} +0 -0
  88. /package/dist/esm/{ADlgInfeed-c619fe64.js → ADlgInfeed-4d228100.js} +0 -0
  89. /package/dist/esm/{index-c376cd8e.js → index-42fd3adb.js} +0 -0
package/dist/esm/View.js CHANGED
@@ -20,8 +20,8 @@ import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
21
  import { m as moment } from './moment-e2f9b20c.js';
22
22
  import { useRouter } from 'next/router';
23
- import './isSymbol-807e927e.js';
24
- import './debounce-1a993acf.js';
23
+ import './isSymbol-5eb15258.js';
24
+ import './debounce-3ab4e0ad.js';
25
25
  import { I as InfiniteScroll } from './index.es-29c1cef5.js';
26
26
  import 'react-dom';
27
27
  import './index-73819142.js';
@@ -30,7 +30,7 @@ import { m as main_36 } from './main-5d1e4bd3.js';
30
30
  import './entities-7cc3bf45.js';
31
31
  import { _ as _JSON$stringify } from './stringify-008c8802.js';
32
32
  import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-7021e5df.js';
33
- import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
33
+ import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-d0f08f8d.js';
34
34
  import './_set-species-cede29f8.js';
35
35
  import './Segment.js';
36
36
  import './Beam.js';
@@ -42,8 +42,9 @@ import 'react-bootstrap';
42
42
  import './iconBase-602d52fe.js';
43
43
  import './index.esm-29e48d38.js';
44
44
  import Button from 'react-bootstrap/Button';
45
+ import { _ as _defineProperty } from './defineProperty-b798470d.js';
45
46
  import Form from 'react-bootstrap/Form';
46
- import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-c376cd8e.js';
47
+ import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-42fd3adb.js';
47
48
  import './util-7700fc59.js';
48
49
  import './brightcove-react-player-loader.es-83f53e4e.js';
49
50
  import 'react-bootstrap/Pagination';
@@ -247,7 +248,7 @@ var ISI = function ISI(props) {
247
248
  );
248
249
  };
249
250
 
250
- var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n padding-bottom: 0.75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 15px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff !important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: none;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n width: 100%;\r\n margin-bottom: 0.5rem;\r\n padding: 0;\r\n }\r\n .RelatedArticles-module_cardTitle__3P-Ib {\r\n font-size: 0.75rem;\r\n margin-bottom: 0;\r\n }\r\n}\r\n";
251
+ var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n padding-bottom: 0.75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 15px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff !important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n width: 100%;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n width: 100%;\r\n height: auto;\r\n\r\n max-height: 175px;\r\n object-fit: contain;\r\n margin-bottom: 1rem;\r\n }\r\n}\r\n";
251
252
  var styles = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
252
253
  styleInject(css);
253
254
 
@@ -483,73 +484,65 @@ var Article = function Article(props) {
483
484
  };
484
485
 
485
486
  var RelevantTopics = function RelevantTopics() {
486
- if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
487
- var relatedLinks = [];
488
- if (documentGroupMapping && documentGroupMapping.length > 0) {
489
- documentGroupMapping.forEach(function (documentGroup) {
490
- if (documentGroup.parent) {
491
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
487
+ if (content_placement && content_placement.length > 0 || documentGroupMapping) {
488
+ return React__default.createElement(
489
+ 'div',
490
+ { style: { color: '#262626' } },
491
+ React__default.createElement(
492
+ 'p',
493
+ { className: 'mb-0' },
494
+ React__default.createElement(
495
+ 'b',
496
+ null,
497
+ 'Related Content:'
498
+ )
499
+ ),
500
+ documentGroupMapping && documentGroupMapping.map(function (documentGroup) {
501
+ if (!documentGroup.parent) {
502
+ return null;
492
503
  }
493
- });
494
- }
495
- if (content_placement && content_placement.length > 0) {
496
- content_placement.filter(function (item) {
497
- return item.path !== 'news';
498
- }).forEach(function (cp) {
504
+
505
+ return React__default.createElement(
506
+ React__default.Fragment,
507
+ null,
508
+ React__default.createElement(
509
+ 'span',
510
+ { className: '' },
511
+ React__default.createElement(
512
+ 'a',
513
+ {
514
+ className: 'related-links',
515
+ style: { color: 'blue' },
516
+ href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
517
+ documentGroup.name
518
+ )
519
+ ),
520
+ content_placement && content_placement.length ? ' | ' : null
521
+ );
522
+ }),
523
+ content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
499
524
  var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
500
525
  var href = '/' + cp_url;
501
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
502
- });
503
- }
504
- if (relatedLinks && relatedLinks.length > 0) {
505
- return React__default.createElement(
506
- 'div',
507
- null,
508
- relatedLinks.map(function (relatedLink, index) {
509
- return React__default.createElement(
526
+ return React__default.createElement(
527
+ React__default.Fragment,
528
+ { key: index },
529
+ React__default.createElement(
510
530
  'span',
511
- { key: index, className: 'related-link' },
531
+ null,
512
532
  React__default.createElement(
513
533
  'a',
514
- { className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
515
- relatedLink.label
516
- ),
517
- React__default.createElement(
518
- 'style',
519
- { jsx: 'true' },
520
- '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
534
+ { className: 'related-links', key: index, href: href, style: { color: 'blue' } },
535
+ cp.name
521
536
  )
522
- );
523
- })
524
- );
525
- }
526
- return null;
537
+ ),
538
+ content_placement.length > index + 1 ? ' | ' : null
539
+ );
540
+ }) : null
541
+ );
527
542
  }
528
543
  return null;
529
544
  };
530
545
 
531
- var RelatedContent = function RelatedContent() {
532
- return React__default.createElement(
533
- 'section',
534
- { className: 'my-1' },
535
- React__default.createElement(
536
- 'p',
537
- { className: 'mb-0' },
538
- React__default.createElement(
539
- 'b',
540
- null,
541
- 'Related Content:'
542
- )
543
- ),
544
- React__default.createElement(RelevantTopics, null),
545
- React__default.createElement(
546
- 'div',
547
- { className: 'pt-2' },
548
- React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
549
- )
550
- );
551
- };
552
-
553
546
  var form = function form() {
554
547
  return React__default.createElement(
555
548
  React__default.Fragment,
@@ -1008,7 +1001,20 @@ var Article = function Article(props) {
1008
1001
  )
1009
1002
  ),
1010
1003
  React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
1011
- showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null)
1004
+ showRelatedArticles && !showIsi && React__default.createElement(
1005
+ React__default.Fragment,
1006
+ null,
1007
+ React__default.createElement(
1008
+ 'div',
1009
+ null,
1010
+ React__default.createElement(RelevantTopics, null)
1011
+ ),
1012
+ React__default.createElement(
1013
+ 'div',
1014
+ { className: 'pt-2' },
1015
+ React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
1016
+ )
1017
+ )
1012
1018
  ),
1013
1019
  renderIsiContent(props.article)
1014
1020
  ),
@@ -1173,77 +1179,50 @@ var ArticleQueue = function ArticleQueue(props) {
1173
1179
  }, 1000);
1174
1180
  }, [queueData.length]);
1175
1181
 
1176
- var loadmore = function () {
1177
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
1178
- var index, article, startingIndex, endingIndex, targeting;
1179
- return regenerator.wrap(function _callee$(_context) {
1180
- while (1) {
1181
- switch (_context.prev = _context.next) {
1182
- case 0:
1183
- if (!(queueData && queueData.length < maxListLength)) {
1184
- _context.next = 27;
1185
- break;
1182
+ var loadmore = function loadmore() {
1183
+ var query = props.relatedArticleQuery;
1184
+ var params = props.params;
1185
+ if (queueData && queueData.length < maxListLength) {
1186
+ params.index = queueData.length - 1;
1187
+ props.client.fetch(query, params).then(function () {
1188
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(article) {
1189
+ var startingIndex, endingIndex, targeting;
1190
+ return regenerator.wrap(function _callee$(_context) {
1191
+ while (1) {
1192
+ switch (_context.prev = _context.next) {
1193
+ case 0:
1194
+ if (!(article && article._id)) {
1195
+ _context.next = 9;
1196
+ break;
1197
+ }
1198
+
1199
+ //query next 4 related article without repeating previous 4 related articles
1200
+ startingIndex = queueData.length + 1;
1201
+ endingIndex = startingIndex + 2;
1202
+ _context.next = 5;
1203
+ return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
1204
+
1205
+ case 5:
1206
+ article.relatedArticle = _context.sent;
1207
+ targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1208
+
1209
+ article.Ads = Ads.getRightItems(targeting);
1210
+ setQueueData([].concat(_toConsumableArray(queueData), [article]));
1211
+
1212
+ case 9:
1213
+ case 'end':
1214
+ return _context.stop();
1186
1215
  }
1216
+ }
1217
+ }, _callee, _this);
1218
+ }));
1187
1219
 
1188
- index = queueData.length - 1;
1189
- article = null;
1190
- _context.prev = 3;
1191
- _context.next = 6;
1192
- return getRelatedArticle(null, props.client, props.article, prevUrl, index);
1193
-
1194
- case 6:
1195
- article = _context.sent;
1196
- _context.next = 12;
1197
- break;
1198
-
1199
- case 9:
1200
- _context.prev = 9;
1201
- _context.t0 = _context['catch'](3);
1202
-
1203
- console.error(_context.t0);
1204
-
1205
- case 12:
1206
- if (!(article && article._id)) {
1207
- _context.next = 27;
1208
- break;
1209
- }
1210
-
1211
- //query next 4 related article without repeating previous 4 related articles
1212
- startingIndex = queueData.length + 1;
1213
- endingIndex = startingIndex + 2;
1214
- _context.prev = 15;
1215
- _context.next = 18;
1216
- return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
1217
-
1218
- case 18:
1219
- article.relatedArticle = _context.sent;
1220
- _context.next = 24;
1221
- break;
1222
-
1223
- case 21:
1224
- _context.prev = 21;
1225
- _context.t1 = _context['catch'](15);
1226
-
1227
- console.error(_context.t1);
1228
-
1229
- case 24:
1230
- targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1231
-
1232
- article.Ads = Ads.getRightItems(targeting);
1233
- setQueueData([].concat(_toConsumableArray(queueData), [article]));
1234
-
1235
- case 27:
1236
- case 'end':
1237
- return _context.stop();
1238
- }
1239
- }
1240
- }, _callee, _this, [[3, 9], [15, 21]]);
1241
- }));
1242
-
1243
- return function loadmore() {
1244
- return _ref.apply(this, arguments);
1245
- };
1246
- }();
1220
+ return function (_x) {
1221
+ return _ref.apply(this, arguments);
1222
+ };
1223
+ }());
1224
+ }
1225
+ };
1247
1226
 
1248
1227
  var changeMeta = function changeMeta(meta) {
1249
1228
  document.title = meta.shareTitle;
@@ -1315,6 +1294,74 @@ var ArticleQueue = function ArticleQueue(props) {
1315
1294
  );
1316
1295
  };
1317
1296
 
1297
+ var Articles = function Articles(props) {
1298
+ var _extends2;
1299
+
1300
+ var videoAccountIDs = props.videoAccountIDs,
1301
+ Ads = props.Ads,
1302
+ cpModificationRequired = props.cpModificationRequired,
1303
+ Settings = props.Settings,
1304
+ ISIContent = props.ISIContent,
1305
+ prevUrl = props.prevUrl,
1306
+ setActiveArticle = props.setActiveArticle,
1307
+ article = props.article,
1308
+ client = props.client,
1309
+ relatedArticleQuery = props.relatedArticleQuery,
1310
+ Website = props.Website,
1311
+ pageview = props.pageview,
1312
+ shareOptions = props.shareOptions,
1313
+ WAds = props.WAds,
1314
+ regionalPages = props.regionalPages,
1315
+ nationalPage = props.nationalPage,
1316
+ canonicalTag = props.canonicalTag;
1317
+ var taxonomyMapping = article.taxonomyMapping,
1318
+ _article$url = article.url;
1319
+ _article$url = _article$url === undefined ? {
1320
+ current: null
1321
+ } : _article$url;
1322
+ var url = _article$url.current,
1323
+ content_placement = article.content_placement;
1324
+
1325
+
1326
+ var taxonomy = [];
1327
+ content_placement.forEach(function (_ref2) {
1328
+ var path = _ref2.path,
1329
+ _id = _ref2._id;
1330
+
1331
+ var prev_url_to_check = prevUrl;
1332
+ if (prev_url_to_check.includes('?')) {
1333
+ prev_url_to_check = prev_url_to_check.split('?')[0];
1334
+ }
1335
+ if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
1336
+ });
1337
+
1338
+ if (taxonomy.length === 0) {
1339
+ taxonomy = taxonomyMapping.map(function (_ref3) {
1340
+ var _ref = _ref3._ref;
1341
+ return _ref;
1342
+ });
1343
+ }
1344
+
1345
+ var params = {
1346
+ url: url,
1347
+ taxonomy: taxonomy,
1348
+ index: 0
1349
+ };
1350
+
1351
+ return React__default.createElement(ArticleQueue, _extends((_extends2 = {
1352
+ client: client,
1353
+ params: params,
1354
+ relatedArticleQuery: relatedArticleQuery,
1355
+ website: Website,
1356
+ checkSponsered: true,
1357
+ pageview: pageview,
1358
+ shareOptions: shareOptions,
1359
+ Ads: WAds,
1360
+ regionalPages: regionalPages,
1361
+ nationalPage: nationalPage
1362
+ }, _defineProperty(_extends2, 'pageview', pageview), _defineProperty(_extends2, 'onVote', function onVote() {}), _defineProperty(_extends2, 'ISIContent', ISIContent), _defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty(_extends2, 'sponsoredTaxonomies', []), _defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), _defineProperty(_extends2, 'Settings', Settings), _defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
1363
+ };
1364
+
1318
1365
  var _this$1 = undefined;
1319
1366
 
1320
1367
  var View = function View(props) {
@@ -1493,15 +1540,7 @@ var View = function View(props) {
1493
1540
  props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
1494
1541
  )
1495
1542
  ),
1496
- !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(ArticleQueue, _extends({
1497
- infiniteScroll: true,
1498
- showRelatedArticles: showRelatedArticles,
1499
- canonicalTag: canonicalTag,
1500
- checkSponsered: true,
1501
- Ads: props.WAds,
1502
- onVote: function onVote() {},
1503
- sponsoredTaxonomies: []
1504
- }, props))
1543
+ !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles, canonicalTag: canonicalTag }, props))
1505
1544
  );
1506
1545
  };
1507
1546
 
@@ -1342,4 +1342,4 @@ exports.default = function (fn) {
1342
1342
 
1343
1343
  var _asyncToGenerator = unwrapExports(asyncToGenerator);
1344
1344
 
1345
- export { _Promise as _, _asyncToGenerator as a, regenerator as r };
1345
+ export { _asyncToGenerator as _, _Promise as a, regenerator as r };
@@ -1,4 +1,4 @@
1
- import { _ as _root, i as isSymbol_1, a as isObject_1 } from './isSymbol-807e927e.js';
1
+ import { _ as _root, d as isSymbol_1, e as isObject_1 } from './isSymbol-5eb15258.js';
2
2
 
3
3
  /**
4
4
  * Gets the timestamp of the number of milliseconds that have elapsed since
@@ -1,4 +1,4 @@
1
- import { i as isSymbol_1, a as isObject_1, b as _baseGetTag, _ as _root, c as _Symbol } from './isSymbol-807e927e.js';
1
+ import { d as isSymbol_1, e as isObject_1, b as _baseGetTag, _ as _root, a as _Symbol } from './isSymbol-5eb15258.js';
2
2
 
3
3
  /**
4
4
  * Checks if `value` is classified as an `Array` object.
@@ -987,4 +987,4 @@ function get(object, path, defaultValue) {
987
987
 
988
988
  var get_1 = get;
989
989
 
990
- export { get_1 as g };
990
+ export { _getNative as _, _toSource as a, _Map as b, get_1 as g };
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
8
8
 
9
9
  switch (type) {
10
10
  case 'related':
11
- return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
11
+ return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
12
12
  case 'article':
13
- return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
13
+ return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
14
14
  case 'publication':
15
15
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
16
16
  case 'issue':
@@ -5,7 +5,7 @@ import './_library-528f1934.js';
5
5
  import './_iter-detect-59409a32.js';
6
6
  import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
- import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
8
+ import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-d0f08f8d.js';
9
9
  import './_set-species-cede29f8.js';
10
10
  import { c as cookie } from './index-db3bb315.js';
11
11
  import getQuery from './getQuery.js';
@@ -362,33 +362,28 @@ var dist_3 = dist.parseCookies;
362
362
  var _this = undefined;
363
363
 
364
364
  var getRelatedArticle = function () {
365
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
365
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
366
366
  var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
367
367
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
368
368
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
369
369
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
370
370
  var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
371
371
 
372
- var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, conditions, cookies, prevSlugs, articles, query;
372
+ var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
373
373
 
374
374
  return regenerator.wrap(function _callee$(_context) {
375
375
  while (1) {
376
376
  switch (_context.prev = _context.next) {
377
377
  case 0:
378
- _article$url = article.url;
378
+ taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
379
379
  _article$url = _article$url === undefined ? {
380
380
  current: null
381
381
  } : _article$url;
382
- url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
383
- content_placement = article.content_placement;
384
- references = [];
382
+ url = _article$url.current, content_placement = article.content_placement;
383
+ taxonomy = [];
384
+ //404 articles were throwing server error
385
385
 
386
-
387
- content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
388
- var identifier = _ref2.identifier;
389
- return identifier !== 'news';
390
- });
391
- if (content_placement && content_placement.length > 0) {
386
+ if (content_placement) {
392
387
  content_placement.forEach(function (_ref3) {
393
388
  var path = _ref3.path,
394
389
  _id = _ref3._id;
@@ -400,30 +395,26 @@ var getRelatedArticle = function () {
400
395
  if (prev_url_to_check.includes('?')) {
401
396
  prev_url_to_check = prev_url_to_check.split('?')[0];
402
397
  }
403
- if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
398
+ if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
404
399
  });
405
- if (references.length === 0) {
406
- content_placement.forEach(function (_ref4) {
407
- var _id = _ref4._id;
408
-
409
- if (_id) references.push(_id);
410
- });
411
- }
412
400
  }
413
401
 
414
- if (documentGroupMapping && documentGroupMapping.length > 0) {
415
- documentGroupMapping.forEach(function (_ref5) {
416
- var _id = _ref5._id;
402
+ //404 articles were throwing server error
403
+ if (taxonomy.length === 0 && taxonomyMapping) {
404
+ taxonomyMapping.forEach(function (_ref4) {
405
+ var _ref = _ref4._ref;
417
406
 
418
- if (_id) references.push(_id);
407
+ if (_ref) {
408
+ taxonomy.push(_ref);
409
+ }
419
410
  });
420
411
  }
421
412
 
422
- if (issueGroup && issueGroup._ref) {
423
- references.push(issueGroup._ref);
424
- }
425
-
426
- params = { url: url, references: references, index: articleCount };
413
+ params = {
414
+ url: url,
415
+ taxonomy: taxonomy,
416
+ index: articleCount
417
+ };
427
418
  conditions = '';
428
419
 
429
420
  if (ctx && url) {
@@ -435,43 +426,24 @@ var getRelatedArticle = function () {
435
426
  conditions = '&& !(url.current in [' + prevSlugs + '])';
436
427
  } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
437
428
  }
429
+ relatedArticleQuery = getQuery('related', conditions, '', articleCount);
430
+ _context.next = 12;
431
+ return client.fetch(relatedArticleQuery, params);
438
432
 
439
- articles = null;
440
-
441
- if (!(params.references && params.references.length > 0)) {
442
- _context.next = 24;
443
- break;
444
- }
445
-
446
- query = getQuery('related', conditions, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '&& references($references)');
447
- _context.prev = 15;
448
- _context.next = 18;
449
- return client.fetch(query, params);
450
-
451
- case 18:
452
- articles = _context.sent;
453
- _context.next = 24;
454
- break;
455
-
456
- case 21:
457
- _context.prev = 21;
458
- _context.t0 = _context['catch'](15);
459
-
460
- console.error(_context.t0);
461
-
462
- case 24:
463
- return _context.abrupt('return', articles);
433
+ case 12:
434
+ relatedArticle = _context.sent;
435
+ return _context.abrupt('return', relatedArticle);
464
436
 
465
- case 25:
437
+ case 14:
466
438
  case 'end':
467
439
  return _context.stop();
468
440
  }
469
441
  }
470
- }, _callee, _this, [[15, 21]]);
442
+ }, _callee, _this);
471
443
  }));
472
444
 
473
445
  return function getRelatedArticle() {
474
- return _ref.apply(this, arguments);
446
+ return _ref2.apply(this, arguments);
475
447
  };
476
448
  }();
477
449
 
@@ -20,8 +20,8 @@ import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
21
  import './moment-e2f9b20c.js';
22
22
  import 'next/router';
23
- import './isSymbol-807e927e.js';
24
- import './debounce-1a993acf.js';
23
+ import './isSymbol-5eb15258.js';
24
+ import './debounce-3ab4e0ad.js';
25
25
  import 'react-dom';
26
26
  import './index-73819142.js';
27
27
  import './index-5f9f807a.js';
@@ -29,7 +29,7 @@ import './main-5d1e4bd3.js';
29
29
  import './entities-7cc3bf45.js';
30
30
  import './stringify-008c8802.js';
31
31
  import './slicedToArray-7021e5df.js';
32
- import './asyncToGenerator-7c654f36.js';
32
+ import './asyncToGenerator-d0f08f8d.js';
33
33
  import './_set-species-cede29f8.js';
34
34
  import './Segment.js';
35
35
  import './Beam.js';
@@ -41,7 +41,7 @@ import 'react-bootstrap';
41
41
  import './iconBase-602d52fe.js';
42
42
  import './index.esm-29e48d38.js';
43
43
  import 'react-bootstrap/Button';
44
- export { g as default } from './index-c376cd8e.js';
44
+ export { g as default } from './index-42fd3adb.js';
45
45
  import './util-7700fc59.js';
46
46
  import './brightcove-react-player-loader.es-83f53e4e.js';
47
47
  import 'react-bootstrap/Pagination';