@mjhls/mjh-framework 1.0.880-beta.0 → 1.0.881-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AlgoliaSearch.js +38 -37
  3. package/dist/cjs/ArticleCarousel.js +2 -1
  4. package/dist/cjs/ArticleProgramLandingPage.js +4 -3
  5. package/dist/cjs/ArticleSeriesLandingPage.js +8 -1
  6. package/dist/cjs/ArticleSeriesListing.js +2 -1
  7. package/dist/cjs/Auth.js +6 -6
  8. package/dist/cjs/{BlockContent-9c6b07ad.js → BlockContent-091a991f.js} +2 -2
  9. package/dist/cjs/ConferenceArticleCard.js +3 -2
  10. package/dist/cjs/DeckContent.js +5 -4
  11. package/dist/cjs/DeckQueue.js +285 -5
  12. package/dist/cjs/EventsDeck.js +11 -11
  13. package/dist/cjs/ExternalResources.js +7 -6
  14. package/dist/cjs/Feature.js +3 -2
  15. package/dist/cjs/ForbesHero.js +7 -6
  16. package/dist/cjs/GridContent.js +16 -15
  17. package/dist/cjs/GridHero.js +7 -6
  18. package/dist/cjs/GroupDeck.js +7 -6
  19. package/dist/cjs/Hero.js +3 -2
  20. package/dist/cjs/HorizontalArticleListing.js +4 -3
  21. package/dist/cjs/HorizontalHero.js +3 -2
  22. package/dist/cjs/IssueContentDeck.js +8 -7
  23. package/dist/cjs/IssueDeck.js +6 -5
  24. package/dist/cjs/IssueLanding.js +7 -4
  25. package/dist/cjs/MasterDeck.js +550 -35
  26. package/dist/cjs/MediaSeriesLanding.js +269 -266
  27. package/dist/cjs/OncliveHero.js +3 -2
  28. package/dist/cjs/OncliveLargeHero.js +10 -9
  29. package/dist/cjs/{Pagination-9cb60fba.js → Pagination-d6a59f99.js} +3 -2
  30. package/dist/cjs/PartnerDetailListing.js +10 -7
  31. package/dist/cjs/PubSection.js +5 -2
  32. package/dist/cjs/PublicationDeck.js +6 -5
  33. package/dist/cjs/PublicationLanding.js +3 -3
  34. package/dist/cjs/QueueDeckExpanded.js +1547 -43
  35. package/dist/cjs/RelatedContent.js +5 -4
  36. package/dist/cjs/SeriesListingDeck.js +3 -2
  37. package/dist/cjs/{SeriesSlider-ec146338.js → SeriesSlider-49b81b0b.js} +6 -6
  38. package/dist/cjs/TaxonomyCard.js +6 -5
  39. package/dist/cjs/TaxonomyDescription.js +4 -3
  40. package/dist/cjs/ThumbnailCard.js +5 -4
  41. package/dist/cjs/VerticalHero.js +3 -2
  42. package/dist/cjs/VideoProgramLandingPage.js +4 -3
  43. package/dist/cjs/VideoSeriesCard.js +5 -4
  44. package/dist/cjs/VideoSeriesLandingPage.js +9 -4
  45. package/dist/cjs/VideoSeriesListing.js +2 -1
  46. package/dist/cjs/View.js +12 -11
  47. package/dist/cjs/YahooHero.js +6 -5
  48. package/dist/cjs/YoutubeGroup.js +10 -9
  49. package/dist/cjs/getRelatedArticle.js +6 -6
  50. package/dist/cjs/getSerializers.js +4 -3
  51. package/dist/cjs/{urlFor-3a61226f.js → index-be0c82be.js} +1 -58
  52. package/dist/cjs/{index-17c6af5a.js → index-bf60a71c.js} +99 -72
  53. package/dist/cjs/index.js +11 -10
  54. package/dist/cjs/urlFor.js +57 -3
  55. package/dist/esm/AlgoliaSearch.js +2 -1
  56. package/dist/esm/ArticleCarousel.js +2 -1
  57. package/dist/esm/ArticleProgramLandingPage.js +4 -3
  58. package/dist/esm/ArticleSeriesLandingPage.js +8 -1
  59. package/dist/esm/ArticleSeriesListing.js +2 -1
  60. package/dist/esm/{BlockContent-f4515898.js → BlockContent-e9b4ddcf.js} +1 -1
  61. package/dist/esm/ConferenceArticleCard.js +2 -1
  62. package/dist/esm/DeckContent.js +2 -1
  63. package/dist/esm/DeckQueue.js +282 -2
  64. package/dist/esm/EventsDeck.js +1 -1
  65. package/dist/esm/ExternalResources.js +4 -3
  66. package/dist/esm/Feature.js +2 -1
  67. package/dist/esm/ForbesHero.js +2 -1
  68. package/dist/esm/GridContent.js +2 -1
  69. package/dist/esm/GridHero.js +2 -1
  70. package/dist/esm/GroupDeck.js +2 -1
  71. package/dist/esm/Hero.js +2 -1
  72. package/dist/esm/HorizontalArticleListing.js +4 -3
  73. package/dist/esm/HorizontalHero.js +2 -1
  74. package/dist/esm/IssueContentDeck.js +2 -1
  75. package/dist/esm/IssueDeck.js +2 -1
  76. package/dist/esm/IssueLanding.js +7 -4
  77. package/dist/esm/MasterDeck.js +550 -35
  78. package/dist/esm/MediaSeriesLanding.js +8 -5
  79. package/dist/esm/OncliveHero.js +2 -1
  80. package/dist/esm/OncliveLargeHero.js +2 -1
  81. package/dist/esm/{Pagination-256b60e5.js → Pagination-f7c4c5ae.js} +3 -2
  82. package/dist/esm/PartnerDetailListing.js +7 -4
  83. package/dist/esm/PubSection.js +5 -2
  84. package/dist/esm/PublicationDeck.js +2 -1
  85. package/dist/esm/QueueDeckExpanded.js +1533 -29
  86. package/dist/esm/RelatedContent.js +2 -1
  87. package/dist/esm/SeriesListingDeck.js +3 -2
  88. package/dist/esm/{SeriesSlider-d6561e33.js → SeriesSlider-ce19fa25.js} +1 -1
  89. package/dist/esm/TaxonomyCard.js +3 -2
  90. package/dist/esm/TaxonomyDescription.js +4 -3
  91. package/dist/esm/ThumbnailCard.js +2 -1
  92. package/dist/esm/VerticalHero.js +2 -1
  93. package/dist/esm/VideoProgramLandingPage.js +4 -3
  94. package/dist/esm/VideoSeriesCard.js +2 -1
  95. package/dist/esm/VideoSeriesLandingPage.js +8 -3
  96. package/dist/esm/VideoSeriesListing.js +2 -1
  97. package/dist/esm/View.js +5 -4
  98. package/dist/esm/YahooHero.js +2 -1
  99. package/dist/esm/YoutubeGroup.js +2 -1
  100. package/dist/esm/getSerializers.js +4 -3
  101. package/dist/esm/{urlFor-23b2244b.js → index-73819142.js} +1 -58
  102. package/dist/esm/{index-a35a5c39.js → index-e495ac6f.js} +40 -13
  103. package/dist/esm/index.js +8 -7
  104. package/dist/esm/urlFor.js +60 -2
  105. package/package.json +1 -1
@@ -22,10 +22,13 @@ var Router__default = _interopDefault(Router);
22
22
  require('./isSymbol-04666465.js');
23
23
  require('./debounce-529c8d06.js');
24
24
  require('./toNumber-36d1e7e5.js');
25
+ var index_es = require('./index.es-9110add6.js');
25
26
  require('react-dom');
27
+ var visibilitySensor = require('./visibility-sensor-ad5e3116.js');
26
28
  var slicedToArray = require('./slicedToArray-f6d4eaa8.js');
27
- var urlFor = require('./urlFor-3a61226f.js');
28
- var index$1 = require('./index-96b3db50.js');
29
+ require('./index-be0c82be.js');
30
+ var urlFor = require('./urlFor.js');
31
+ var index$2 = require('./index-96b3db50.js');
29
32
  var main = require('./main-02daeefe.js');
30
33
  var entities = require('./entities-310b46ee.js');
31
34
  require('./stringify-bbc68047.js');
@@ -38,9 +41,9 @@ var lodash = require('./lodash-fc2922d0.js');
38
41
  var ADlgInfeed = require('./ADlgInfeed-c39c7131.js');
39
42
  var getContentCategory = require('./getContentCategory-f38a4c00.js');
40
43
  var AuthorComponent = require('./AuthorComponent-02e827ae.js');
44
+ var Pagination = require('./Pagination-d6a59f99.js');
41
45
  var reactBootstrap = require('react-bootstrap');
42
46
  var timeDifferenceCalc = require('./timeDifferenceCalc.js');
43
- var Pagination = require('./Pagination-9cb60fba.js');
44
47
 
45
48
  var _this = undefined;
46
49
 
@@ -49,7 +52,7 @@ var renderCardImage = function renderCardImage(row, client) {
49
52
  var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
50
53
  var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
51
54
  var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
52
- return urlFor.urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
55
+ return urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
53
56
  };
54
57
 
55
58
  var checkExternalUrl = function checkExternalUrl(url) {
@@ -189,7 +192,7 @@ var CardLoader = function CardLoader(_ref) {
189
192
  'a',
190
193
  { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
191
194
  React__default.createElement(
192
- index$1.LazyLoad,
195
+ index$2.LazyLoad,
193
196
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
194
197
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
195
198
  ),
@@ -258,7 +261,7 @@ var CardLoader = function CardLoader(_ref) {
258
261
  )
259
262
  ),
260
263
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
261
- index$1.LazyLoad,
264
+ index$2.LazyLoad,
262
265
  { height: 50 },
263
266
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
264
267
  ),
@@ -336,7 +339,7 @@ var CardLoader = function CardLoader(_ref) {
336
339
  'a',
337
340
  { href: article.url.current, className: 'feature-wrapper' },
338
341
  React__default.createElement(
339
- index$1.LazyLoad,
342
+ index$2.LazyLoad,
340
343
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
341
344
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
342
345
  ),
@@ -416,7 +419,7 @@ var CardLoader = function CardLoader(_ref) {
416
419
  )
417
420
  ),
418
421
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
419
- index$1.LazyLoad,
422
+ index$2.LazyLoad,
420
423
  { height: 50 },
421
424
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
422
425
  ),
@@ -502,7 +505,7 @@ var CardLoader = function CardLoader(_ref) {
502
505
  'a',
503
506
  { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
504
507
  React__default.createElement(
505
- index$1.LazyLoad,
508
+ index$2.LazyLoad,
506
509
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
507
510
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
508
511
  ),
@@ -574,7 +577,7 @@ var CardLoader = function CardLoader(_ref) {
574
577
  'div',
575
578
  { className: 'author-sec', style: { lineHeight: 1.5 } },
576
579
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
577
- index$1.LazyLoad,
580
+ index$2.LazyLoad,
578
581
  { height: 50 },
579
582
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
580
583
  )
@@ -670,7 +673,7 @@ var CardLoader = function CardLoader(_ref) {
670
673
  'a',
671
674
  { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
672
675
  React__default.createElement(
673
- index$1.LazyLoad,
676
+ index$2.LazyLoad,
674
677
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
675
678
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
676
679
  ),
@@ -739,7 +742,7 @@ var CardLoader = function CardLoader(_ref) {
739
742
  )
740
743
  ),
741
744
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
742
- index$1.LazyLoad,
745
+ index$2.LazyLoad,
743
746
  { height: 50 },
744
747
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
745
748
  ),
@@ -817,7 +820,7 @@ var CardLoader = function CardLoader(_ref) {
817
820
  'a',
818
821
  { href: article.url.current, className: 'feature-wrapper' },
819
822
  React__default.createElement(
820
- index$1.LazyLoad,
823
+ index$2.LazyLoad,
821
824
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
822
825
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
823
826
  ),
@@ -886,7 +889,7 @@ var CardLoader = function CardLoader(_ref) {
886
889
  )
887
890
  ),
888
891
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
889
- index$1.LazyLoad,
892
+ index$2.LazyLoad,
890
893
  { height: 50 },
891
894
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
892
895
  ),
@@ -972,7 +975,7 @@ var CardLoader = function CardLoader(_ref) {
972
975
  'a',
973
976
  { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
974
977
  React__default.createElement(
975
- index$1.LazyLoad,
978
+ index$2.LazyLoad,
976
979
  { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
977
980
  article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
978
981
  ),
@@ -1044,7 +1047,7 @@ var CardLoader = function CardLoader(_ref) {
1044
1047
  'div',
1045
1048
  { className: 'author-sec', style: { lineHeight: 1.5 } },
1046
1049
  showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1047
- index$1.LazyLoad,
1050
+ index$2.LazyLoad,
1048
1051
  { height: 50 },
1049
1052
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1050
1053
  )
@@ -1216,10 +1219,15 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1216
1219
  data = _useState4[0],
1217
1220
  setData = _useState4[1];
1218
1221
 
1219
- var _useState5 = React.useState(initialCurrentPage || 1),
1222
+ var _useState5 = React.useState(false),
1220
1223
  _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1221
- currentPage = _useState6[0],
1222
- setCurrentPage = _useState6[1];
1224
+ isDataLoading = _useState6[0],
1225
+ setIsDataLoading = _useState6[1];
1226
+
1227
+ var _useState7 = React.useState(initialCurrentPage || 1),
1228
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1229
+ currentPage = _useState8[0],
1230
+ setCurrentPage = _useState8[1];
1223
1231
 
1224
1232
  var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : params && params.from && params.to ? params.to - params.from : 10;
1225
1233
 
@@ -1267,7 +1275,10 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1267
1275
  while (1) {
1268
1276
  switch (_context.prev = _context.next) {
1269
1277
  case 0:
1270
- setData(null);
1278
+ setIsDataLoading(true);
1279
+ setCurrentPage(selectedPage);
1280
+ seoPaginate && seoPagination(selectedPage);
1281
+ index.lib_3.refresh();
1271
1282
  document.body.scrollTop = 0;
1272
1283
  document.documentElement.scrollTop = 0;
1273
1284
  start = (selectedPage - 1) * itemsPerPage;
@@ -1275,35 +1286,33 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1275
1286
  from: start,
1276
1287
  to: start + itemsPerPage
1277
1288
  });
1278
- _context.prev = 5;
1279
- _context.next = 8;
1289
+ _context.prev = 8;
1290
+ _context.next = 11;
1280
1291
  return client.fetch(query, newParams);
1281
1292
 
1282
- case 8:
1293
+ case 11:
1283
1294
  newData = _context.sent;
1284
1295
 
1285
1296
  if (pointer && pointerArray) newData = newData[pointerArray][pointer];
1286
1297
  if (newData && newData.length > 0) {
1298
+ setIsDataLoading(false);
1287
1299
  setData(newData);
1288
- seoPaginate && seoPagination(selectedPage);
1289
- setCurrentPage(selectedPage);
1290
- index.lib_3.refresh();
1291
1300
  }
1292
- _context.next = 16;
1301
+ _context.next = 19;
1293
1302
  break;
1294
1303
 
1295
- case 13:
1296
- _context.prev = 13;
1297
- _context.t0 = _context['catch'](5);
1304
+ case 16:
1305
+ _context.prev = 16;
1306
+ _context.t0 = _context['catch'](8);
1298
1307
 
1299
1308
  console.error(_context.t0);
1300
1309
 
1301
- case 16:
1310
+ case 19:
1302
1311
  case 'end':
1303
1312
  return _context.stop();
1304
1313
  }
1305
1314
  }
1306
- }, _callee, _this, [[5, 13]]);
1315
+ }, _callee, _this, [[8, 16]]);
1307
1316
  }));
1308
1317
 
1309
1318
  return function handlePageChange(_x5) {
@@ -1314,7 +1323,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1314
1323
  return React__default.createElement(
1315
1324
  'div',
1316
1325
  { className: 'queuedeck-expanded' },
1317
- !data ? React__default.createElement(
1326
+ isDataLoading ? React__default.createElement(
1318
1327
  'div',
1319
1328
  { className: 'd-flex justify-content-center', style: { marginTop: '100px' } },
1320
1329
  React__default.createElement(
@@ -1351,19 +1360,1514 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
1351
1360
  showTimeDif: showTimeDiff,
1352
1361
  showTaxonomies: showTaxonomies,
1353
1362
  showIntro: showIntro
1354
- })
1355
- ),
1356
- React__default.createElement(
1357
- 'div',
1358
- { className: 'pagination-wrapper ' + (!data ? 'd-none' : 'd-block') },
1359
- React__default.createElement(Pagination.Pagination, { pageCount: Math.ceil(totalDataCount / itemsPerPage), pageRangeDisplayed: main.main_36 ? 3 : 9, initialPage: currentPage, onPageChange: handlePageChange }),
1363
+ }),
1360
1364
  React__default.createElement(
1361
- 'style',
1362
- { jsx: 'true' },
1363
- '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
1365
+ 'div',
1366
+ { className: 'pagination-wrapper' },
1367
+ React__default.createElement(Pagination.Pagination, { pageCount: Math.ceil(totalDataCount / itemsPerPage), pageRangeDisplayed: main.main_36 ? 3 : 9, currentPage: currentPage, onPageChange: handlePageChange }),
1368
+ React__default.createElement(
1369
+ 'style',
1370
+ { jsx: 'true' },
1371
+ '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
1372
+ )
1373
+ )
1374
+ )
1375
+ );
1376
+ };
1377
+
1378
+ var renderCardImage$1 = function renderCardImage(row, client) {
1379
+ var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1380
+ var imageWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1381
+ var imageMaxHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1382
+ var imageFit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
1383
+
1384
+ var url = urlFor({ client: client, source: row.thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageMaxHeight: imageMaxHeight, imageFit: imageFit });
1385
+
1386
+ return url;
1387
+ };
1388
+
1389
+ var loadMore = function loadMore(values, setValues, itemsPerPage) {
1390
+ console.log('Values:::', values);
1391
+ setValues({
1392
+ page: values.page + 1,
1393
+ from: values.from + itemsPerPage,
1394
+ to: values.to + itemsPerPage
1395
+ });
1396
+ };
1397
+
1398
+ var loadData = function loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray) {
1399
+ params = _extends._extends({}, params, {
1400
+ from: values.from,
1401
+ to: values.to
1402
+ });
1403
+ client.fetch(query, params).then(function (dataArr) {
1404
+ if (pointer && pointerArray) {
1405
+ dataArr = dataArr[pointerArray][pointer];
1406
+ }
1407
+
1408
+ if (!dataArr) {
1409
+ dataArr = [];
1410
+ }
1411
+
1412
+ dataArr = dataArr.map(function (item) {
1413
+ return _extends._extends({}, item, {
1414
+ pageNumber: values.page
1415
+ });
1416
+ });
1417
+
1418
+ if (dataArr.length > 0) {
1419
+ setData(function (prevData) {
1420
+ return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(dataArr));
1421
+ });
1422
+ setLastDataSize(dataArr.length);
1423
+ setScrolling(true);
1424
+ } else {
1425
+ setLastDataSize(0);
1426
+ setScrolling(false);
1427
+ }
1428
+ });
1429
+ };
1430
+
1431
+ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
1432
+ if (seoPaginate) {
1433
+ var path = router.asPath;
1434
+ var qrIndex = path.indexOf('?');
1435
+ var pathname = router.pathname;
1436
+ var queryString = '';
1437
+
1438
+ if (qrIndex > 0) {
1439
+ path = path.substring(1, qrIndex);
1440
+
1441
+ var partialQS = router.asPath.substring(qrIndex + 1);
1442
+ var partialQSArr = partialQS.split('&');
1443
+
1444
+ // exclude page=xxx from query string
1445
+ partialQSArr.map(function (item) {
1446
+ var itemArr = item.split('=');
1447
+ var key = itemArr[0];
1448
+ var val = itemArr[1];
1449
+
1450
+ if (key !== 'page') {
1451
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
1452
+ }
1453
+ });
1454
+ }
1455
+
1456
+ if (queryString.length > 0) {
1457
+ path += '?' + queryString;
1458
+ }
1459
+
1460
+ pageNumber = parseInt(pageNumber);
1461
+ // const index = Number(itemIndex)
1462
+ // const perPage = Number(itemsPerPage)
1463
+
1464
+ // pageNumber = Math.ceil((index + 1) / perPage)
1465
+
1466
+ if (currentPage !== pageNumber) {
1467
+ index.lib_3.refresh();
1468
+
1469
+ setCurrentPage(pageNumber);
1470
+ if (path[0] !== '/') {
1471
+ path = '/' + path;
1472
+ }
1473
+
1474
+ var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
1475
+
1476
+ // if (pageview) {
1477
+ // pageview(newPath)
1478
+ // }
1479
+
1480
+ router.push(pathname, newPath, {
1481
+ shallow: true
1482
+ });
1483
+ }
1484
+ }
1485
+ };
1486
+
1487
+ var checkExternalUrl$1 = function checkExternalUrl(url) {
1488
+ return new RegExp(['http', 'https'].join('|')).test(url);
1489
+ };
1490
+
1491
+ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro) {
1492
+ var numberOfItemsBeforeAd = data.length < 6 ? data.length : 6;
1493
+ var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
1494
+ return [].concat(toConsumableArray._toConsumableArray(arr.slice(0, index)), [newElement], toConsumableArray._toConsumableArray(arr.slice(index)));
1495
+ };
1496
+
1497
+ var _useState = React.useState(!showBI || !brandInsightAd ? true : false),
1498
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
1499
+ dataRemapped = _useState2[0],
1500
+ setDataRemapped = _useState2[1];
1501
+ // Need to pass flag "lgInfeedAd={true}" along with brandInsightAd from site level for large infeed-ad to render
1502
+ // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
1503
+
1504
+
1505
+ if (lgInfeedAd && brandInsightAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
1506
+ var lgInfeed = {
1507
+ _type: 'lg-infeed',
1508
+ adUnit: brandInsightAd.adUnit,
1509
+ className: 'lg-infeed',
1510
+ networkID: brandInsightAd.networkID,
1511
+ sizes: [728, 90],
1512
+ // Adding sizeMapping for showing ad above 1400px
1513
+ sizeMapping: [{
1514
+ viewport: [1400, 0],
1515
+ sizes: [[728, 90]]
1516
+ }, { viewport: [0, 0], sizes: [] }],
1517
+ targeting: {
1518
+ content_placement: brandInsightAd.targeting.content_placement,
1519
+ document_url: brandInsightAd.targeting.document_url,
1520
+ rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
1521
+ },
1522
+ /* Passing refresh flag */
1523
+ refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
1524
+ };
1525
+
1526
+ var chunks = lodash.lodash.chunk(data, 6).map(function (chunk) {
1527
+ var set = lodash.lodash.chunk(chunk, 2);
1528
+ for (var i = 0; i < set.length; i++) {
1529
+ if (i !== set.length - 1) {
1530
+ set[i].push(lgInfeed);
1531
+ }
1532
+ }
1533
+ return lodash.lodash.flattenDeep(set);
1534
+ });
1535
+ data = lodash.lodash.flatten(chunks);
1536
+ !dataRemapped && setDataRemapped(true); // To detect if appending of insights ads are completed
1537
+ }
1538
+
1539
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
1540
+ React.useEffect(function () {
1541
+ if (typeof window !== 'undefined' && (!lgInfeedAd || !brandInsightAd || window.innerWidth < 1400) && !dataRemapped) {
1542
+ setDataRemapped(true);
1543
+ }
1544
+ }, []);
1545
+
1546
+ if (showBI && brandInsightAd) {
1547
+ // Checking window and lgInfeedAd flag in desktop view ( window >= 1400px ).
1548
+ if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) brandInsightAd.interval = 8;
1549
+ var pos = 0;
1550
+ for (var i = 1; pos < data.length; i++) {
1551
+ var inFeedAd = {
1552
+ adUnit: brandInsightAd.adUnit,
1553
+ className: brandInsightAd.className,
1554
+ networkID: brandInsightAd.networkID,
1555
+ sizes: brandInsightAd.sizes,
1556
+ slotId: brandInsightAd.slotId + '_' + i,
1557
+ targeting: {
1558
+ pos: 'infeed',
1559
+ content_placement: brandInsightAd.targeting.content_placement,
1560
+ document_url: brandInsightAd.targeting.document_url,
1561
+ rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
1562
+ },
1563
+ _type: 'brandInsightAd',
1564
+ /* Passing refresh flag */
1565
+ refreshFlag: brandInsightAd.refreshFlag ? brandInsightAd.refreshFlag : false
1566
+ };
1567
+
1568
+ data = insertBrandInsightAd(data, pos, inFeedAd);
1569
+ pos += brandInsightAd.interval + 1;
1570
+ }
1571
+ }
1572
+
1573
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
1574
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
1575
+ // 'articleCount' will be the indexes of only the articles in the deck.
1576
+ var articleCount = -1;
1577
+ data = data.map(function (ele, i) {
1578
+ if (ele._type === 'lg-infeed') {
1579
+ // Setting pos as top2 for the first occurence of large infeed ad
1580
+ // const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
1581
+ return _extends._extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends._extends({}, ele.targeting, { pos: 'lg-infeed' }) });
1582
+ } else if (ele._type === 'article') {
1583
+ // incrementing 'articleCount' for each article.
1584
+ ++articleCount;
1585
+ return _extends._extends({}, ele, { articleCount: articleCount });
1586
+ } else {
1587
+ return ele;
1588
+ }
1589
+ });
1590
+
1591
+ var featureCount = 0;
1592
+ return React__default.createElement(
1593
+ 'div',
1594
+ null,
1595
+ data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
1596
+ data.map(function (article, index) {
1597
+ var pageNumber = article.pageNumber || values.page;
1598
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
1599
+
1600
+ if (article._type === 'feature') {
1601
+ featureCount++;
1602
+ if (article.blank || checkExternalUrl$1(article.url.current)) {
1603
+ return React__default.createElement(
1604
+ visibilitySensor.VisibilitySensor,
1605
+ {
1606
+ key: article._id ? article._id : index,
1607
+ partialVisibility: true,
1608
+ onChange: function onChange(isVisible) {
1609
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
1610
+ } },
1611
+ React__default.createElement(
1612
+ React__default.Fragment,
1613
+ null,
1614
+ React__default.createElement(
1615
+ reactBootstrap.Media,
1616
+ {
1617
+ key: article._id ? article._id : index,
1618
+ className: 'feature-media',
1619
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1620
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1621
+ 'a',
1622
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
1623
+ React__default.createElement(
1624
+ index$2.LazyLoad,
1625
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1626
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1627
+ ),
1628
+ article.source && React__default.createElement(
1629
+ 'div',
1630
+ { className: 'content-category-label' },
1631
+ React__default.createElement(
1632
+ 'div',
1633
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1634
+ article.source
1635
+ )
1636
+ )
1637
+ ),
1638
+ React__default.createElement(
1639
+ reactBootstrap.Media.Body,
1640
+ null,
1641
+ React__default.createElement(
1642
+ 'a',
1643
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
1644
+ article.title && React__default.createElement(
1645
+ 'h4',
1646
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1647
+ article.title
1648
+ )
1649
+ ),
1650
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1651
+ 'p',
1652
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1653
+ moment.moment(article.published).format('MMMM DD, YYYY')
1654
+ ),
1655
+ showTimeDiff && article.published && React__default.createElement(
1656
+ 'p',
1657
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1658
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1659
+ if (index > 3) {
1660
+ return null;
1661
+ }
1662
+ if (index === 3) {
1663
+ return React__default.createElement(
1664
+ React__default.Fragment,
1665
+ null,
1666
+ React__default.createElement(
1667
+ 'em',
1668
+ { style: { marginRight: '.5rem' } },
1669
+ '...'
1670
+ )
1671
+ );
1672
+ }
1673
+ return React__default.createElement(
1674
+ React__default.Fragment,
1675
+ null,
1676
+ React__default.createElement(
1677
+ 'em',
1678
+ null,
1679
+ taxonomy.name
1680
+ ),
1681
+ ' |',
1682
+ ' '
1683
+ );
1684
+ }),
1685
+ ' ',
1686
+ React__default.createElement(
1687
+ 'span',
1688
+ { style: { display: 'inline-block' } },
1689
+ timeDifferenceCalc(article.published)
1690
+ )
1691
+ ),
1692
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1693
+ index$2.LazyLoad,
1694
+ { height: 50 },
1695
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1696
+ ),
1697
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1698
+ 'div',
1699
+ { className: 'content-category-label' },
1700
+ React__default.createElement(
1701
+ 'div',
1702
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1703
+ article.source
1704
+ )
1705
+ ),
1706
+ React__default.createElement(
1707
+ 'div',
1708
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1709
+ showCategory && article.contentCategory && React__default.createElement(
1710
+ 'p',
1711
+ {
1712
+ className: 'article-category',
1713
+ style: {
1714
+ background: '#3FB618',
1715
+ color: '#ffffff',
1716
+ marginBottom: '.25rem',
1717
+ display: 'inline-block',
1718
+ padding: '0 .25rem',
1719
+ fontSize: '.8rem'
1720
+ } },
1721
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
1722
+ ),
1723
+ article.issueSection && article.issueSection.name && React__default.createElement(
1724
+ 'p',
1725
+ {
1726
+ className: 'issueSection',
1727
+ style: {
1728
+ background: '#000000',
1729
+ color: '#ffffff',
1730
+ marginBottom: '.25rem',
1731
+ marginLeft: '.25rem',
1732
+ display: 'inline-block',
1733
+ padding: '0 .25rem',
1734
+ fontSize: '.8rem'
1735
+ } },
1736
+ article.issueSection.name
1737
+ )
1738
+ ),
1739
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
1740
+ 'div',
1741
+ { className: 'pubInfo' },
1742
+ article.volume && React__default.createElement(
1743
+ 'p',
1744
+ { className: 'qdeVolume' },
1745
+ article.volume
1746
+ ),
1747
+ article.issue && React__default.createElement(
1748
+ 'p',
1749
+ { className: 'qdeIssue' },
1750
+ article.issue
1751
+ )
1752
+ ),
1753
+ showIntro && article.summary && React__default.createElement(
1754
+ 'p',
1755
+ { className: 'pt-2 card-text' },
1756
+ entities.clean_html_1(article.summary)
1757
+ )
1758
+ )
1759
+ )
1760
+ )
1761
+ );
1762
+ } else {
1763
+ return React__default.createElement(
1764
+ visibilitySensor.VisibilitySensor,
1765
+ {
1766
+ key: article._id ? article._id : index,
1767
+ partialVisibility: true,
1768
+ onChange: function onChange(isVisible) {
1769
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
1770
+ } },
1771
+ React__default.createElement(
1772
+ React__default.Fragment,
1773
+ null,
1774
+ React__default.createElement(
1775
+ reactBootstrap.Media,
1776
+ {
1777
+ key: article._id ? article._id : index,
1778
+ className: 'feature-media',
1779
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1780
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1781
+ 'a',
1782
+ { href: article.url.current, className: 'feature-wrapper' },
1783
+ React__default.createElement(
1784
+ index$2.LazyLoad,
1785
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1786
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1787
+ ),
1788
+ article.source && React__default.createElement(
1789
+ 'div',
1790
+ { className: 'content-category-label' },
1791
+ React__default.createElement(
1792
+ 'div',
1793
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1794
+ article.source
1795
+ )
1796
+ )
1797
+ ),
1798
+ React__default.createElement(
1799
+ reactBootstrap.Media.Body,
1800
+ null,
1801
+ React__default.createElement(
1802
+ 'a',
1803
+ { href: article.url.current },
1804
+ article.title && React__default.createElement(
1805
+ 'h4',
1806
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1807
+ article.title
1808
+ )
1809
+ ),
1810
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1811
+ 'p',
1812
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1813
+ moment.moment(article.published).format('MMMM DD, YYYY')
1814
+ ),
1815
+ showTimeDiff && article.published && React__default.createElement(
1816
+ 'p',
1817
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1818
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1819
+ if (index > 3) {
1820
+ return null;
1821
+ }
1822
+ if (index === 3) {
1823
+ return React__default.createElement(
1824
+ React__default.Fragment,
1825
+ null,
1826
+ React__default.createElement(
1827
+ 'em',
1828
+ { style: { marginRight: '.5rem' } },
1829
+ '...'
1830
+ )
1831
+ );
1832
+ }
1833
+ if (index === 3) {
1834
+ return React__default.createElement(
1835
+ React__default.Fragment,
1836
+ null,
1837
+ React__default.createElement(
1838
+ 'em',
1839
+ { style: { marginRight: '.5rem' } },
1840
+ '...'
1841
+ )
1842
+ );
1843
+ }
1844
+ return React__default.createElement(
1845
+ React__default.Fragment,
1846
+ null,
1847
+ React__default.createElement(
1848
+ 'em',
1849
+ null,
1850
+ taxonomy.name
1851
+ ),
1852
+ ' |',
1853
+ ' '
1854
+ );
1855
+ }),
1856
+ ' ',
1857
+ React__default.createElement(
1858
+ 'span',
1859
+ { style: { display: 'inline-block' } },
1860
+ timeDifferenceCalc(article.published)
1861
+ )
1862
+ ),
1863
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
1864
+ index$2.LazyLoad,
1865
+ { height: 50 },
1866
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
1867
+ ),
1868
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
1869
+ 'div',
1870
+ { className: 'content-category-label' },
1871
+ React__default.createElement(
1872
+ 'div',
1873
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1874
+ article.source
1875
+ )
1876
+ ),
1877
+ React__default.createElement(
1878
+ 'div',
1879
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
1880
+ showCategory && article.contentCategory && React__default.createElement(
1881
+ 'p',
1882
+ {
1883
+ className: 'article-category',
1884
+ style: {
1885
+ background: '#3FB618',
1886
+ color: '#ffffff',
1887
+ marginBottom: '.25rem',
1888
+ display: 'inline-block',
1889
+ padding: '0 .25rem',
1890
+ fontSize: '.8rem'
1891
+ } },
1892
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
1893
+ ),
1894
+ article.issueSection && article.issueSection.name && React__default.createElement(
1895
+ 'p',
1896
+ {
1897
+ className: 'issueSection',
1898
+ style: {
1899
+ background: '#000000',
1900
+ color: '#ffffff',
1901
+ marginBottom: '.25rem',
1902
+ marginLeft: '.25rem',
1903
+ display: 'inline-block',
1904
+ padding: '0 .25rem',
1905
+ fontSize: '.8rem'
1906
+ } },
1907
+ article.issueSection.name
1908
+ )
1909
+ ),
1910
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
1911
+ 'div',
1912
+ { className: 'pubInfo' },
1913
+ article.volume && React__default.createElement(
1914
+ 'p',
1915
+ { className: 'qdeVolume' },
1916
+ article.volume
1917
+ ),
1918
+ article.issue && React__default.createElement(
1919
+ 'p',
1920
+ { className: 'qdeIssue' },
1921
+ article.issue
1922
+ )
1923
+ ),
1924
+ showIntro && article.summary && React__default.createElement(
1925
+ 'p',
1926
+ { className: 'pt-2 card-text' },
1927
+ entities.clean_html_1(article.summary)
1928
+ )
1929
+ )
1930
+ )
1931
+ )
1932
+ );
1933
+ }
1934
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
1935
+ return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
1936
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
1937
+ return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
1938
+ }
1939
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
1940
+ return React__default.createElement(
1941
+ visibilitySensor.VisibilitySensor,
1942
+ {
1943
+ key: article._id ? article._id : index,
1944
+ onChange: function onChange(isVisible) {
1945
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
1946
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
1947
+ } },
1948
+ React__default.createElement(
1949
+ React__default.Fragment,
1950
+ null,
1951
+ React__default.createElement(
1952
+ reactBootstrap.Media,
1953
+ {
1954
+ key: article._id ? article._id : index,
1955
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
1956
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
1957
+ 'a',
1958
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
1959
+ React__default.createElement(
1960
+ index$2.LazyLoad,
1961
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
1962
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
1963
+ ),
1964
+ article.source && React__default.createElement(
1965
+ 'div',
1966
+ { className: 'content-category-label' },
1967
+ React__default.createElement(
1968
+ 'div',
1969
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
1970
+ article.source
1971
+ )
1972
+ )
1973
+ ),
1974
+ React__default.createElement(
1975
+ reactBootstrap.Media.Body,
1976
+ null,
1977
+ React__default.createElement(
1978
+ 'a',
1979
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
1980
+ article.title && React__default.createElement(
1981
+ 'h4',
1982
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
1983
+ article.title
1984
+ )
1985
+ ),
1986
+ showPublished && !showTimeDiff && article.published && React__default.createElement(
1987
+ 'p',
1988
+ { className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
1989
+ moment.moment(article.published).format('MMMM DD, YYYY')
1990
+ ),
1991
+ showTimeDiff && article.published && React__default.createElement(
1992
+ 'p',
1993
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
1994
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
1995
+ if (index > 3) {
1996
+ return null;
1997
+ }
1998
+ if (index === 3) {
1999
+ return React__default.createElement(
2000
+ React__default.Fragment,
2001
+ null,
2002
+ React__default.createElement(
2003
+ 'em',
2004
+ { style: { marginRight: '.5rem' } },
2005
+ '...'
2006
+ )
2007
+ );
2008
+ }
2009
+ return React__default.createElement(
2010
+ React__default.Fragment,
2011
+ null,
2012
+ React__default.createElement(
2013
+ 'em',
2014
+ null,
2015
+ taxonomy.name
2016
+ ),
2017
+ ' |',
2018
+ ' '
2019
+ );
2020
+ }),
2021
+ ' ',
2022
+ React__default.createElement(
2023
+ 'span',
2024
+ { style: { display: 'inline-block' } },
2025
+ timeDifferenceCalc(article.published)
2026
+ )
2027
+ ),
2028
+ React__default.createElement(
2029
+ 'div',
2030
+ { className: 'author-sec', style: { lineHeight: 1.5 } },
2031
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2032
+ index$2.LazyLoad,
2033
+ { height: 50 },
2034
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2035
+ )
2036
+ ),
2037
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2038
+ 'div',
2039
+ { className: 'content-category-label' },
2040
+ React__default.createElement(
2041
+ 'div',
2042
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2043
+ article.source
2044
+ )
2045
+ ),
2046
+ React__default.createElement(
2047
+ 'div',
2048
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2049
+ showCategory && article.contentCategory && React__default.createElement(
2050
+ 'p',
2051
+ {
2052
+ className: 'article-category',
2053
+ style: {
2054
+ background: '#3FB618',
2055
+ color: '#ffffff',
2056
+ marginBottom: '.25rem',
2057
+ display: 'inline-block',
2058
+ padding: '0 .25rem',
2059
+ fontSize: '.8rem'
2060
+ } },
2061
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
2062
+ ),
2063
+ article.issueSection && article.issueSection.name && React__default.createElement(
2064
+ 'p',
2065
+ {
2066
+ className: 'issueSection',
2067
+ style: {
2068
+ background: '#000000',
2069
+ color: '#ffffff',
2070
+ marginBottom: '.25rem',
2071
+ marginLeft: '.25rem',
2072
+ display: 'inline-block',
2073
+ padding: '0 .25rem',
2074
+ fontSize: '.8rem'
2075
+ } },
2076
+ article.issueSection.name
2077
+ )
2078
+ ),
2079
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2080
+ 'div',
2081
+ { className: 'pubInfo' },
2082
+ article.volume && React__default.createElement(
2083
+ 'p',
2084
+ { className: 'qdeVolume' },
2085
+ article.volume
2086
+ ),
2087
+ article.issue && React__default.createElement(
2088
+ 'p',
2089
+ { className: 'qdeIssue' },
2090
+ article.issue
2091
+ )
2092
+ ),
2093
+ showIntro && article.summary && React__default.createElement(
2094
+ 'p',
2095
+ { className: 'pt-2 card-text' },
2096
+ entities.clean_html_1(article.summary)
2097
+ )
2098
+ )
2099
+ ),
2100
+ React__default.createElement(
2101
+ 'div',
2102
+ null,
2103
+ main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd$1(index, numberOfItemsBeforeAd, rightItems)
2104
+ )
2105
+ )
2106
+ );
2107
+ } else return null;
2108
+ }) :
2109
+ // For Javascript Disabled Cases
2110
+ React__default.createElement(
2111
+ 'noscript',
2112
+ null,
2113
+ data.map(function (article, index) {
2114
+ var pageNumber = article.pageNumber || values.page;
2115
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
2116
+
2117
+ if (article._type === 'feature') {
2118
+ featureCount++;
2119
+ if (article.blank || checkExternalUrl$1(article.url.current)) {
2120
+ return React__default.createElement(
2121
+ visibilitySensor.VisibilitySensor,
2122
+ {
2123
+ key: article._id ? article._id : index,
2124
+ partialVisibility: true,
2125
+ onChange: function onChange(isVisible) {
2126
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
2127
+ } },
2128
+ React__default.createElement(
2129
+ React__default.Fragment,
2130
+ null,
2131
+ React__default.createElement(
2132
+ reactBootstrap.Media,
2133
+ {
2134
+ key: article._id ? article._id : index,
2135
+ className: 'feature-media',
2136
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2137
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2138
+ 'a',
2139
+ { rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
2140
+ React__default.createElement(
2141
+ index$2.LazyLoad,
2142
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2143
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2144
+ ),
2145
+ article.source && React__default.createElement(
2146
+ 'div',
2147
+ { className: 'content-category-label' },
2148
+ React__default.createElement(
2149
+ 'div',
2150
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2151
+ article.source
2152
+ )
2153
+ )
2154
+ ),
2155
+ React__default.createElement(
2156
+ reactBootstrap.Media.Body,
2157
+ null,
2158
+ React__default.createElement(
2159
+ 'a',
2160
+ { rel: 'noopener', href: article.url.current, target: '_blank' },
2161
+ article.title && React__default.createElement(
2162
+ 'h4',
2163
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2164
+ article.title
2165
+ )
2166
+ ),
2167
+ showPublished && article.published && React__default.createElement(
2168
+ 'p',
2169
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2170
+ moment.moment(article.published).format('MMMM DD, YYYY')
2171
+ ),
2172
+ showTimeDiff && article.published && React__default.createElement(
2173
+ 'p',
2174
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2175
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2176
+ if (index > 3) {
2177
+ return null;
2178
+ }
2179
+ if (index === 3) {
2180
+ return React__default.createElement(
2181
+ React__default.Fragment,
2182
+ null,
2183
+ React__default.createElement(
2184
+ 'em',
2185
+ { style: { marginRight: '.5rem' } },
2186
+ '...'
2187
+ )
2188
+ );
2189
+ }
2190
+ return React__default.createElement(
2191
+ React__default.Fragment,
2192
+ null,
2193
+ React__default.createElement(
2194
+ 'em',
2195
+ null,
2196
+ taxonomy.name
2197
+ ),
2198
+ ' |',
2199
+ ' '
2200
+ );
2201
+ }),
2202
+ ' ',
2203
+ React__default.createElement(
2204
+ 'span',
2205
+ { style: { display: 'inline-block' } },
2206
+ timeDifferenceCalc(article.published)
2207
+ )
2208
+ ),
2209
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2210
+ index$2.LazyLoad,
2211
+ { height: 50 },
2212
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2213
+ ),
2214
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2215
+ 'div',
2216
+ { className: 'content-category-label' },
2217
+ React__default.createElement(
2218
+ 'div',
2219
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2220
+ article.source
2221
+ )
2222
+ ),
2223
+ React__default.createElement(
2224
+ 'div',
2225
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2226
+ showCategory && article.contentCategory && React__default.createElement(
2227
+ 'p',
2228
+ {
2229
+ className: 'article-category',
2230
+ style: {
2231
+ background: '#3FB618',
2232
+ color: '#ffffff',
2233
+ marginBottom: '.25rem',
2234
+ display: 'inline-block',
2235
+ padding: '0 .25rem',
2236
+ fontSize: '.8rem'
2237
+ } },
2238
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
2239
+ ),
2240
+ article.issueSection && article.issueSection.name && React__default.createElement(
2241
+ 'p',
2242
+ {
2243
+ className: 'issueSection',
2244
+ style: {
2245
+ background: '#000000',
2246
+ color: '#ffffff',
2247
+ marginBottom: '.25rem',
2248
+ marginLeft: '.25rem',
2249
+ display: 'inline-block',
2250
+ padding: '0 .25rem',
2251
+ fontSize: '.8rem'
2252
+ } },
2253
+ article.issueSection.name
2254
+ )
2255
+ ),
2256
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2257
+ 'div',
2258
+ { className: 'pubInfo' },
2259
+ article.volume && React__default.createElement(
2260
+ 'p',
2261
+ { className: 'qdeVolume' },
2262
+ article.volume
2263
+ ),
2264
+ article.issue && React__default.createElement(
2265
+ 'p',
2266
+ { className: 'qdeIssue' },
2267
+ article.issue
2268
+ )
2269
+ ),
2270
+ showIntro && article.summary && React__default.createElement(
2271
+ 'p',
2272
+ { className: 'pt-2 card-text' },
2273
+ entities.clean_html_1(article.summary)
2274
+ )
2275
+ )
2276
+ )
2277
+ )
2278
+ );
2279
+ } else {
2280
+ return React__default.createElement(
2281
+ visibilitySensor.VisibilitySensor,
2282
+ {
2283
+ key: article._id ? article._id : index,
2284
+ partialVisibility: true,
2285
+ onChange: function onChange(isVisible) {
2286
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
2287
+ } },
2288
+ React__default.createElement(
2289
+ React__default.Fragment,
2290
+ null,
2291
+ React__default.createElement(
2292
+ reactBootstrap.Media,
2293
+ {
2294
+ key: article._id ? article._id : index,
2295
+ className: 'feature-media',
2296
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2297
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2298
+ 'a',
2299
+ { href: article.url.current, className: 'feature-wrapper' },
2300
+ React__default.createElement(
2301
+ index$2.LazyLoad,
2302
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2303
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2304
+ ),
2305
+ article.source && React__default.createElement(
2306
+ 'div',
2307
+ { className: 'content-category-label' },
2308
+ React__default.createElement(
2309
+ 'div',
2310
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2311
+ article.source
2312
+ )
2313
+ )
2314
+ ),
2315
+ React__default.createElement(
2316
+ reactBootstrap.Media.Body,
2317
+ null,
2318
+ React__default.createElement(
2319
+ 'a',
2320
+ { href: article.url.current },
2321
+ article.title && React__default.createElement(
2322
+ 'h4',
2323
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2324
+ article.title
2325
+ )
2326
+ ),
2327
+ showPublished && article.published && React__default.createElement(
2328
+ 'p',
2329
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2330
+ moment.moment(article.published).format('MMMM DD, YYYY')
2331
+ ),
2332
+ showTimeDiff && article.published && React__default.createElement(
2333
+ 'p',
2334
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2335
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2336
+ if (index > 3) {
2337
+ return null;
2338
+ }
2339
+ if (index === 3) {
2340
+ return React__default.createElement(
2341
+ React__default.Fragment,
2342
+ null,
2343
+ React__default.createElement(
2344
+ 'em',
2345
+ { style: { marginRight: '.5rem' } },
2346
+ '...'
2347
+ )
2348
+ );
2349
+ }
2350
+ return React__default.createElement(
2351
+ React__default.Fragment,
2352
+ null,
2353
+ React__default.createElement(
2354
+ 'em',
2355
+ null,
2356
+ taxonomy.name
2357
+ ),
2358
+ ' |',
2359
+ ' '
2360
+ );
2361
+ }),
2362
+ ' ',
2363
+ React__default.createElement(
2364
+ 'span',
2365
+ { style: { display: 'inline-block' } },
2366
+ timeDifferenceCalc(article.published)
2367
+ )
2368
+ ),
2369
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2370
+ index$2.LazyLoad,
2371
+ { height: 50 },
2372
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2373
+ ),
2374
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2375
+ 'div',
2376
+ { className: 'content-category-label' },
2377
+ React__default.createElement(
2378
+ 'div',
2379
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2380
+ article.source
2381
+ )
2382
+ ),
2383
+ React__default.createElement(
2384
+ 'div',
2385
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2386
+ showCategory && article.contentCategory && React__default.createElement(
2387
+ 'p',
2388
+ {
2389
+ className: 'article-category',
2390
+ style: {
2391
+ background: '#3FB618',
2392
+ color: '#ffffff',
2393
+ marginBottom: '.25rem',
2394
+ display: 'inline-block',
2395
+ padding: '0 .25rem',
2396
+ fontSize: '.8rem'
2397
+ } },
2398
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
2399
+ ),
2400
+ article.issueSection && article.issueSection.name && React__default.createElement(
2401
+ 'p',
2402
+ {
2403
+ className: 'issueSection',
2404
+ style: {
2405
+ background: '#000000',
2406
+ color: '#ffffff',
2407
+ marginBottom: '.25rem',
2408
+ marginLeft: '.25rem',
2409
+ display: 'inline-block',
2410
+ padding: '0 .25rem',
2411
+ fontSize: '.8rem'
2412
+ } },
2413
+ article.issueSection.name
2414
+ )
2415
+ ),
2416
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2417
+ 'div',
2418
+ { className: 'pubInfo' },
2419
+ article.volume && React__default.createElement(
2420
+ 'p',
2421
+ { className: 'qdeVolume' },
2422
+ article.volume
2423
+ ),
2424
+ article.issue && React__default.createElement(
2425
+ 'p',
2426
+ { className: 'qdeIssue' },
2427
+ article.issue
2428
+ )
2429
+ ),
2430
+ showIntro && article.summary && React__default.createElement(
2431
+ 'p',
2432
+ { className: 'pt-2 card-text' },
2433
+ entities.clean_html_1(article.summary)
2434
+ )
2435
+ )
2436
+ )
2437
+ )
2438
+ );
2439
+ }
2440
+ } else if (article._type === 'lg-infeed' && article.adUnit) {
2441
+ return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
2442
+ } else if (article._type === 'brandInsightAd' && article.adUnit) {
2443
+ return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
2444
+ }
2445
+ if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
2446
+ return React__default.createElement(
2447
+ visibilitySensor.VisibilitySensor,
2448
+ {
2449
+ key: article._id ? article._id : index,
2450
+ onChange: function onChange(isVisible) {
2451
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
2452
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index);
2453
+ } },
2454
+ React__default.createElement(
2455
+ React__default.Fragment,
2456
+ null,
2457
+ React__default.createElement(
2458
+ reactBootstrap.Media,
2459
+ {
2460
+ key: article._id ? article._id : index,
2461
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
2462
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
2463
+ 'a',
2464
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
2465
+ React__default.createElement(
2466
+ index$2.LazyLoad,
2467
+ { height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder$1, null) },
2468
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage$1(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
2469
+ ),
2470
+ article.source && React__default.createElement(
2471
+ 'div',
2472
+ { className: 'content-category-label' },
2473
+ React__default.createElement(
2474
+ 'div',
2475
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2476
+ article.source
2477
+ )
2478
+ )
2479
+ ),
2480
+ React__default.createElement(
2481
+ reactBootstrap.Media.Body,
2482
+ null,
2483
+ React__default.createElement(
2484
+ 'a',
2485
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
2486
+ article.title && React__default.createElement(
2487
+ 'h4',
2488
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
2489
+ article.title
2490
+ )
2491
+ ),
2492
+ showPublished && article.published && React__default.createElement(
2493
+ 'p',
2494
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
2495
+ moment.moment(article.published).format('MMMM DD, YYYY')
2496
+ ),
2497
+ showTimeDiff && article.published && React__default.createElement(
2498
+ 'p',
2499
+ { className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
2500
+ showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
2501
+ if (index > 3) {
2502
+ return null;
2503
+ }
2504
+ if (index === 3) {
2505
+ return React__default.createElement(
2506
+ React__default.Fragment,
2507
+ null,
2508
+ React__default.createElement(
2509
+ 'em',
2510
+ { style: { marginRight: '.5rem' } },
2511
+ '...'
2512
+ )
2513
+ );
2514
+ }
2515
+ return React__default.createElement(
2516
+ React__default.Fragment,
2517
+ null,
2518
+ React__default.createElement(
2519
+ 'em',
2520
+ null,
2521
+ taxonomy.name
2522
+ ),
2523
+ ' |',
2524
+ ' '
2525
+ );
2526
+ }),
2527
+ ' ',
2528
+ React__default.createElement(
2529
+ 'span',
2530
+ { style: { display: 'inline-block' } },
2531
+ timeDifferenceCalc(article.published)
2532
+ )
2533
+ ),
2534
+ React__default.createElement(
2535
+ 'div',
2536
+ { className: 'author-sec', style: { lineHeight: 1.5 } },
2537
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
2538
+ index$2.LazyLoad,
2539
+ { height: 50 },
2540
+ React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
2541
+ )
2542
+ ),
2543
+ !article.thumbnail && !defaultImage && article.source && React__default.createElement(
2544
+ 'div',
2545
+ { className: 'content-category-label' },
2546
+ React__default.createElement(
2547
+ 'div',
2548
+ { className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
2549
+ article.source
2550
+ )
2551
+ ),
2552
+ React__default.createElement(
2553
+ 'div',
2554
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
2555
+ showCategory && article.contentCategory && React__default.createElement(
2556
+ 'p',
2557
+ {
2558
+ className: 'article-category',
2559
+ style: {
2560
+ background: '#3FB618',
2561
+ color: '#ffffff',
2562
+ marginBottom: '.25rem',
2563
+ display: 'inline-block',
2564
+ padding: '0 .25rem',
2565
+ fontSize: '.8rem'
2566
+ } },
2567
+ getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
2568
+ ),
2569
+ article.issueSection && article.issueSection.name && React__default.createElement(
2570
+ 'p',
2571
+ {
2572
+ className: 'issueSection',
2573
+ style: {
2574
+ background: '#000000',
2575
+ color: '#ffffff',
2576
+ marginBottom: '.25rem',
2577
+ marginLeft: '.25rem',
2578
+ display: 'inline-block',
2579
+ padding: '0 .25rem',
2580
+ fontSize: '.8rem'
2581
+ } },
2582
+ article.issueSection.name
2583
+ )
2584
+ ),
2585
+ showPubInfo && (article.issue || article.volume) && React__default.createElement(
2586
+ 'div',
2587
+ { className: 'pubInfo' },
2588
+ article.volume && React__default.createElement(
2589
+ 'p',
2590
+ { className: 'qdeVolume' },
2591
+ article.volume
2592
+ ),
2593
+ article.issue && React__default.createElement(
2594
+ 'p',
2595
+ { className: 'qdeIssue' },
2596
+ article.issue
2597
+ )
2598
+ ),
2599
+ showIntro && article.summary && React__default.createElement(
2600
+ 'p',
2601
+ { className: 'pt-2 card-text' },
2602
+ entities.clean_html_1(article.summary)
2603
+ )
2604
+ )
2605
+ ),
2606
+ React__default.createElement(
2607
+ 'div',
2608
+ null,
2609
+ main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd$1(index, numberOfItemsBeforeAd, rightItems)
2610
+ )
2611
+ )
2612
+ );
2613
+ } else return null;
2614
+ })
2615
+ ) : React__default.createElement(
2616
+ 'div',
2617
+ null,
2618
+ React__default.createElement(
2619
+ 'h5',
2620
+ null,
2621
+ React__default.createElement(
2622
+ 'em',
2623
+ null,
2624
+ 'New content coming soon, please check back later.'
2625
+ )
2626
+ )
2627
+ ),
2628
+ React__default.createElement(
2629
+ 'style',
2630
+ { jsx: 'true' },
2631
+ '\n .displayLabelThumb {\n margin: 0 auto;\n margin-top: -1.25rem;\n background-color: white;\n position: relative;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n width: fit-content;\n width: -moz-fit-content;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .sanityDisplayLabel {\n max-width: 100%;\n }\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
2632
+ )
2633
+ );
2634
+ };
2635
+
2636
+ var ImagePlaceholder$1 = function ImagePlaceholder() {
2637
+ return React__default.createElement(
2638
+ React__default.Fragment,
2639
+ null,
2640
+ React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
2641
+ React__default.createElement(
2642
+ 'style',
2643
+ { jsx: 'true' },
2644
+ '\n .queuedeck-exp-image-placeholder {\n width: 240px;\n height: 0;\n padding-top: calc(240px * 9 / 16);\n margin: 0 1rem 0 0;\n }\n @media only screen and (max-width: 767px) {\n .queuedeck-exp-image-placeholder {\n width: 100%;\n height: 0;\n padding-top: calc(100% * 9 / 16);\n margin: 0 0 1rem 0;\n }\n }\n '
2645
+ )
2646
+ );
2647
+ };
2648
+
2649
+ var renderMobileAd$1 = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
2650
+ var i = numberOfItemsBeforeAd < 6 ? 0 : ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
2651
+ return React__default.createElement(
2652
+ 'div',
2653
+ { style: { display: 'flex', flex: '1 0 auto' } },
2654
+ rightItems[i].component
2655
+ );
2656
+ };
2657
+
2658
+ var usePrevious$1 = function usePrevious(value) {
2659
+ var ref = React.useRef();
2660
+ React.useEffect(function () {
2661
+ ref.current = value;
2662
+ });
2663
+ return ref.current;
2664
+ };
2665
+
2666
+ var QueueDeckExpanded$1 = function QueueDeckExpanded$1(props) {
2667
+ if (props.totalDataCount) return React__default.createElement(QueueDeckExpanded, props);
2668
+ var router = Router.useRouter();
2669
+
2670
+ // Logging GA Pageview on path change
2671
+ var prevPath = usePrevious$1(lodash.lodash.get(router, 'asPath', undefined));
2672
+ React.useEffect(function () {
2673
+ var pageview = props.pageview;
2674
+
2675
+ var currentPath = router.asPath;
2676
+ if (prevPath && prevPath !== currentPath && pageview) {
2677
+ pageview(router.asPath);
2678
+ }
2679
+ }, [router]);
2680
+
2681
+ var initialData = props.dataRecord,
2682
+ client = props.client,
2683
+ params = props.params,
2684
+ query = props.query,
2685
+ autoScroll = props.autoScroll,
2686
+ pointer = props.pointer,
2687
+ pointerArray = props.pointerArray,
2688
+ mapping = props.mapping,
2689
+ seoPaginate = props.seoPaginate,
2690
+ pageview = props.pageview,
2691
+ defaultImage = props.defaultImage,
2692
+ showAuthor = props.showAuthor,
2693
+ showCategory = props.showCategory,
2694
+ imageHeight = props.imageHeight,
2695
+ imageWidth = props.imageWidth,
2696
+ imageMaxHeight = props.imageMaxHeight,
2697
+ imageFit = props.imageFit,
2698
+ rightItems = props.rightItems,
2699
+ brandInsightAd = props.brandInsightAd,
2700
+ _props$showBI = props.showBI,
2701
+ showBI = _props$showBI === undefined ? false : _props$showBI,
2702
+ _props$heroContent = props.heroContent,
2703
+ heroContent = _props$heroContent === undefined ? 0 : _props$heroContent,
2704
+ _props$lgInfeedAd = props.lgInfeedAd,
2705
+ lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd,
2706
+ _props$showPubInfo = props.showPubInfo,
2707
+ showPubInfo = _props$showPubInfo === undefined ? false : _props$showPubInfo,
2708
+ _props$showTimeDiff = props.showTimeDiff,
2709
+ showTimeDiff = _props$showTimeDiff === undefined ? false : _props$showTimeDiff,
2710
+ _props$showTaxonomies = props.showTaxonomies,
2711
+ showTaxonomies = _props$showTaxonomies === undefined ? false : _props$showTaxonomies,
2712
+ _props$showIntro = props.showIntro,
2713
+ showIntro = _props$showIntro === undefined ? true : _props$showIntro,
2714
+ _props$contentCategor = props.contentCategoryMapping,
2715
+ contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor;
2716
+ var initialCurrentPage = props.currentPage,
2717
+ showPublished = props.showPublished;
2718
+
2719
+ var _useState3 = React.useState(initialData),
2720
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
2721
+ data = _useState4[0],
2722
+ setData = _useState4[1];
2723
+
2724
+ var _useState5 = React.useState(true),
2725
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
2726
+ scrolling = _useState6[0],
2727
+ setScrolling = _useState6[1];
2728
+
2729
+ var _useState7 = React.useState(initialCurrentPage || 1),
2730
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
2731
+ currentPage = _useState8[0],
2732
+ setCurrentPage = _useState8[1];
2733
+
2734
+ var _useState9 = React.useState(initialData ? initialData.length : 0),
2735
+ _useState10 = slicedToArray._slicedToArray(_useState9, 2),
2736
+ lastDataSize = _useState10[0],
2737
+ setLastDataSize = _useState10[1];
2738
+
2739
+ var _useState11 = React.useState({
2740
+ from: params ? params.from : 0,
2741
+ to: params ? params.to : 0,
2742
+ page: initialCurrentPage ? initialCurrentPage : 1
2743
+ }),
2744
+ _useState12 = slicedToArray._slicedToArray(_useState11, 2),
2745
+ values = _useState12[0],
2746
+ setValues = _useState12[1];
2747
+
2748
+ var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : 10;
2749
+
2750
+ var prevValues = usePrevious$1(values);
2751
+
2752
+ var renderManualPagination = function renderManualPagination(currentPage) {
2753
+ if (lastDataSize < itemsPerPage) {
2754
+ return null;
2755
+ }
2756
+
2757
+ return React__default.createElement(
2758
+ 'div',
2759
+ { className: 'd-flex justify-content-between' },
2760
+ currentPage && currentPage > 1 && React__default.createElement(
2761
+ 'a',
2762
+ { href: '?page=' + (currentPage - 1) },
2763
+ '<< Previous'
2764
+ ),
2765
+ React__default.createElement(
2766
+ 'a',
2767
+ { href: '?page=' + (currentPage + 1) },
2768
+ 'Next >>'
2769
+ )
2770
+ );
2771
+ };
2772
+
2773
+ // check for change in filter parameters from client side and refresh the page
2774
+ React.useEffect(function () {
2775
+ if (initialData && data !== initialData && initialData.length >= 0) {
2776
+ setData(initialData);
2777
+ setCurrentPage(initialCurrentPage ? initialCurrentPage : 1);
2778
+ setValues({
2779
+ from: params ? params.from : 0,
2780
+ to: params ? params.to : 0,
2781
+ page: initialCurrentPage ? initialCurrentPage : 1
2782
+ });
2783
+ if (initialData.length > 0) {
2784
+ setScrolling(true);
2785
+ }
2786
+ }
2787
+ }, [initialData]);
2788
+
2789
+ React.useEffect(function () {
2790
+ if (prevValues) {
2791
+ if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.to) {
2792
+ loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray);
2793
+ }
2794
+ }
2795
+ }, [values, prevValues, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray]);
2796
+
2797
+ // useEffect(() => {
2798
+ // document.addEventListener('scroll', trackScrolling)
2799
+ // return () => {
2800
+ // document.removeEventListener('scroll', trackScrolling)
2801
+ // }
2802
+ // }, [currentPage])
2803
+
2804
+ // const trackScrolling = (current) => {
2805
+ // if (window.pageYOffset === 0) {
2806
+ // if (currentPage > 1) {
2807
+ // changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1)
2808
+ // }
2809
+ // }
2810
+ // }
2811
+
2812
+ return React__default.createElement(
2813
+ 'div',
2814
+ null,
2815
+ autoScroll ? React__default.createElement(
2816
+ React__default.Fragment,
2817
+ null,
2818
+ React__default.createElement(
2819
+ index_es.InfiniteScroll,
2820
+ { dataLength: data && data.length, next: function next() {
2821
+ return loadMore(values, setValues, itemsPerPage);
2822
+ }, hasMore: scrolling, scrollThreshold: 0.9 },
2823
+ React__default.createElement(
2824
+ reactBootstrap.Container,
2825
+ null,
2826
+ cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
2827
+ )
2828
+ ),
2829
+ React__default.createElement(
2830
+ 'noscript',
2831
+ null,
2832
+ renderManualPagination(currentPage)
2833
+ )
2834
+ ) : React__default.createElement(
2835
+ React__default.Fragment,
2836
+ null,
2837
+ React__default.createElement(
2838
+ reactBootstrap.Container,
2839
+ null,
2840
+ cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
2841
+ ),
2842
+ React__default.createElement(
2843
+ 'div',
2844
+ { style: { padding: '0px 10px' } },
2845
+ scrolling ? React__default.createElement(
2846
+ 'button',
2847
+ {
2848
+ className: 'load-more-btn',
2849
+ style: { margin: 'auto', width: '100%' },
2850
+ onClick: function onClick(e) {
2851
+ loadMore(values, setValues, itemsPerPage);
2852
+ } },
2853
+ 'Load More'
2854
+ ) : React__default.createElement(
2855
+ 'p',
2856
+ { style: { textAlign: 'center' } },
2857
+ React__default.createElement(
2858
+ 'b',
2859
+ null,
2860
+ 'End of data'
2861
+ )
2862
+ )
2863
+ ),
2864
+ React__default.createElement(
2865
+ 'noscript',
2866
+ null,
2867
+ renderManualPagination(currentPage)
1364
2868
  )
1365
2869
  )
1366
2870
  );
1367
2871
  };
1368
2872
 
1369
- module.exports = QueueDeckExpanded;
2873
+ module.exports = QueueDeckExpanded$1;