@mjhls/mjh-framework 1.0.394 → 1.0.396

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.
package/dist/esm/index.js CHANGED
@@ -6,7 +6,7 @@ import { m as main_39, a as main_16, b as main_38 } from './main-25bb2c75.js';
6
6
  import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-d7054876.js';
7
7
  import './_object-pie-33c40e79.js';
8
8
  import { _ as _extends$2, a as _Object$assign } from './extends-92072fff.js';
9
- import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1 } from './inherits-cacd91d8.js';
9
+ import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1, f as defineProperty$2 } from './inherits-dfba24f5.js';
10
10
  import { _ as _meta, a as _isArray } from './typeof-e4b50250.js';
11
11
  import React__default, { useState, useEffect, useRef } from 'react';
12
12
  import { l as lib_3, d as debounce_1, a as lib_1, i as isObjectLike_1, _ as _baseGetTag, t as toNumber_1, b as _root, c as _freeGlobal } from './debounce-df468b0e.js';
@@ -29,7 +29,7 @@ import { _ as _anInstance, a as _forOf, b as _redefineAll, c as _setSpecies } fr
29
29
  import { A as ADInfeed } from './ADInfeed-88c335d9.js';
30
30
  export { default as DeckContent } from './DeckContent.js';
31
31
  import { i as isFunction_1, a as isArray_1, _ as _arrayMap } from './get-53653403.js';
32
- export { A as AD, G as GridContent } from './GridContent-4a5cef9e.js';
32
+ export { A as AD, G as GridContent } from './GridContent-5fe7c99b.js';
33
33
  import { A as AuthorComponent } from './AuthorComponent-c9e46673.js';
34
34
  export { default as DeckQueue } from './DeckQueue.js';
35
35
  import 'react-bootstrap/Media';
@@ -52,8 +52,8 @@ export { default as IssueDeck } from './IssueDeck.js';
52
52
  import 'react-bootstrap/Badge';
53
53
  export { default as IssueContentDeck } from './IssueContentDeck.js';
54
54
  import Spinner from 'react-bootstrap/Spinner';
55
- import { M as MdPictureAsPdf } from './Normal-c171a945.js';
56
- export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-c171a945.js';
55
+ import { M as MdPictureAsPdf } from './Normal-da6eaaec.js';
56
+ export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-da6eaaec.js';
57
57
  import 'react-bootstrap/ListGroup';
58
58
  import Head from 'next/head';
59
59
  import Accordion from 'react-bootstrap/Accordion';
@@ -62,8 +62,8 @@ import { FacebookShareButton, FacebookIcon, TwitterShareButton, TwitterIcon, Lin
62
62
  import 'react-bootstrap/Nav';
63
63
  import 'react-bootstrap/Navbar';
64
64
  import 'react-bootstrap/NavDropdown';
65
- import 'react-bootstrap/Form';
66
- import 'react-bootstrap/FormControl';
65
+ import Form$1 from 'react-bootstrap/Form';
66
+ import FormControl from 'react-bootstrap/FormControl';
67
67
  import Pagination from 'react-bootstrap/Pagination';
68
68
  import dynamic from 'next/dynamic';
69
69
  import Carousel$1 from 'react-bootstrap/Carousel';
@@ -22213,4 +22213,1161 @@ var auth = {
22213
22213
  ProcessData: ProcessData_1
22214
22214
  };
22215
22215
 
22216
- export { AD300x250, AD300x250x600, ADFloatingFooter, ADFooter, ADGutter, ADSponsoredResources, ADWelcome, AccordionPanel, AdSlotsProvider, AlphabeticList, ArticleDetailDropdown, ArticleQueue, auth as Auth, Breadcrumbs$1 as Breadcrumbs, CMEDeck, ConferenceArticleCard, EventsDeck, Feature, fbsHero as ForbesHero, GridHero, Hero, HighlightenVideo, HorizontalHero, InfiniteScrollDeck, KMTracker, OncliveHero, OncliveLargeHero, PdfDownload, PopUpModal, PublicationLanding, RelatedContent, RelatedTopicsDropdown, SetCookie, SocialShare$1 as SocialShare, VerticalHero, YahooHero, getSerializers, getSeriesDetail };
22216
+ var renderAuthor$2 = function renderAuthor(authorName, authorURL, index, length) {
22217
+ var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
22218
+
22219
+ if (authorName && authorURL) {
22220
+ return React__default.createElement(
22221
+ 'span',
22222
+ null,
22223
+ React__default.createElement(
22224
+ 'a',
22225
+ { href: '/' + defaultUrl + '/' + authorURL.current, key: index },
22226
+ authorName
22227
+ ),
22228
+ length !== index + 1 && ' , '
22229
+ );
22230
+ } else if (authorName) {
22231
+ return React__default.createElement(
22232
+ 'span',
22233
+ { key: index },
22234
+ authorName,
22235
+ length !== index + 1 && ' , '
22236
+ );
22237
+ }
22238
+ };
22239
+
22240
+ var getContentPlacementUrl = function getContentPlacementUrl(cp) {
22241
+ var cp_url = '';
22242
+ if (cp.ancestor && typeof cp.ancestor == 'string') {
22243
+ cp_url += (cp_url === '' ? '' : '/') + cp.ancestor;
22244
+ }
22245
+
22246
+ if (!cp.ancestor && cp.parent && typeof cp.parent == 'string') {
22247
+ cp_url += (cp_url === '' ? '' : '/') + cp.parent;
22248
+ }
22249
+
22250
+ cp_url += (cp_url === '' ? '' : '/') + cp.path;
22251
+
22252
+ return cp_url;
22253
+ };
22254
+
22255
+ var getArticleSummary$1 = function getArticleSummary(article) {
22256
+ if (article.summary && article.summary.length > 0) {
22257
+ return article.summary;
22258
+ } else {
22259
+ var _article$body = article.body,
22260
+ body = _article$body === undefined ? [] : _article$body;
22261
+
22262
+ var desc = '';
22263
+ body.some(function (children) {
22264
+ children.children && children.children.some(function (item) {
22265
+ if (item.text && String(item.text).trim().length > 0 && desc === '') {
22266
+ desc = String(item.text);
22267
+ return true;
22268
+ }
22269
+ });
22270
+ if (desc !== '') {
22271
+ return true;
22272
+ }
22273
+ });
22274
+ return desc;
22275
+ }
22276
+ };
22277
+
22278
+ function urlFor$6(client, source) {
22279
+ return imageUrlBuilder(client).image(source);
22280
+ }
22281
+
22282
+ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
22283
+ if (!docGroup) {
22284
+ return null;
22285
+ }
22286
+ var url = void 0;
22287
+ if (docGroup.path.includes('/')) {
22288
+ return docGroup.path;
22289
+ }
22290
+
22291
+ if (docGroup.parent) {
22292
+ url = '/' + docGroup.parent.identifier.current;
22293
+ if (docGroup.parent.parent && docGroup.parent.parent.name) {
22294
+ url = '/' + docGroup.parent.parent.identifier.current + url;
22295
+ }
22296
+ }
22297
+
22298
+ if (!docGroup.thumbnail) ;
22299
+ url = url + '/' + docGroup.path;
22300
+
22301
+ return url;
22302
+ };
22303
+
22304
+ var getDocumentGroupName = function getDocumentGroupName(docGroup) {
22305
+ var name = void 0;
22306
+ if (!docGroup) {
22307
+ return null;
22308
+ }
22309
+
22310
+ if (docGroup.parent) {
22311
+ name = docGroup.parent.name;
22312
+
22313
+ if (docGroup.parent.parent && docGroup.parent.parent.name) {
22314
+ name = docGroup.parent.parent.name + ' | ' + name;
22315
+ }
22316
+ }
22317
+
22318
+ if (!docGroup.thumbnail) {
22319
+ name = name + ' | <b>' + docGroup.name + '</b>';
22320
+ }
22321
+
22322
+ return name;
22323
+ };
22324
+
22325
+ var DocumentGroup = function DocumentGroup(_ref) {
22326
+ var article = _ref.article,
22327
+ client = _ref.client;
22328
+
22329
+ if (!article.documentGroup) {
22330
+ return null;
22331
+ }
22332
+ var name = getDocumentGroupName(article.documentGroup);
22333
+ var url = getDocumentGroupUrl(article.documentGroup);
22334
+ var thumbnailUrl = false;
22335
+
22336
+ if (article.documentGroup.thumbnail) {
22337
+ thumbnailUrl = urlFor$6(client, article.documentGroup.thumbnail).url();
22338
+ }
22339
+
22340
+ return React__default.createElement(
22341
+ 'a',
22342
+ {
22343
+ href: url,
22344
+ className: 'doc-group',
22345
+ style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
22346
+ thumbnailUrl && React__default.createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
22347
+ React__default.createElement('p', {
22348
+ style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_39 ? 'left' : 'right', marginTop: '.25rem' },
22349
+ dangerouslySetInnerHTML: { __html: name } }),
22350
+ main_39 && !thumbnailUrl && React__default.createElement(
22351
+ 'style',
22352
+ { jsx: 'true' },
22353
+ '\n a.doc-group {\n display: block !important;\n padding: 0!important;\n }\n '
22354
+ )
22355
+ );
22356
+ };
22357
+
22358
+ var Article$1 = function Article(props) {
22359
+ var article = props.article;
22360
+ var client = props.client,
22361
+ pageview = props.pageview,
22362
+ videoAccountIDs = props.videoAccountIDs,
22363
+ drupalLeadSettings = props.drupalLeadSettings,
22364
+ currentPage = props.currentPage,
22365
+ _props$article = props.article,
22366
+ title = _props$article.title,
22367
+ _props$article$passwo = _props$article.passwordLock,
22368
+ passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
22369
+ authorDetails = _props$article.authorDetails,
22370
+ pageNumber = _props$article.pageNumber,
22371
+ published = _props$article.published,
22372
+ articleBody = _props$article.body,
22373
+ thumbnail = _props$article.thumbnail,
22374
+ content_placement = _props$article.content_placement,
22375
+ _props$article$url = _props$article.url;
22376
+ _props$article$url = _props$article$url === undefined ? {
22377
+ current: ''
22378
+ } : _props$article$url;
22379
+ var url = _props$article$url.current,
22380
+ issue = _props$article.issue,
22381
+ source = _props$article.source,
22382
+ regionalPages = props.regionalPages,
22383
+ nationalPage = props.nationalPage,
22384
+ ISIContent = props.ISIContent,
22385
+ shareOptions = props.shareOptions,
22386
+ cpModificationRequired = props.cpModificationRequired,
22387
+ authorPrefix = props.authorPrefix;
22388
+ var changeUrl = props.changeUrl;
22389
+
22390
+ var _useState = useState(null),
22391
+ _useState2 = _slicedToArray(_useState, 2),
22392
+ contextualADFlag = _useState2[0],
22393
+ setContextualADFlag = _useState2[1];
22394
+
22395
+ var summary = getArticleSummary$1(props.article);
22396
+
22397
+ var _useState3 = useState(1),
22398
+ _useState4 = _slicedToArray(_useState3, 2),
22399
+ auth = _useState4[0],
22400
+ setAuth = _useState4[1];
22401
+
22402
+ var _useState5 = useState(''),
22403
+ _useState6 = _slicedToArray(_useState5, 2),
22404
+ passwordKey = _useState6[0],
22405
+ setPasswordKey = _useState6[1];
22406
+
22407
+ var _useState7 = useState(false),
22408
+ _useState8 = _slicedToArray(_useState7, 2),
22409
+ showVotes = _useState8[0],
22410
+ setShowVotes = _useState8[1];
22411
+
22412
+ var isCutomPage = function isCutomPage(article) {
22413
+ var url = article.url.current;
22414
+
22415
+ if (regionalPages || nationalPage) {
22416
+ return regionalPages.includes(url) || nationalPage === url;
22417
+ } else {
22418
+ return false;
22419
+ }
22420
+ };
22421
+
22422
+ var renderIsiContent = function renderIsiContent(article) {
22423
+ var url = article.url.current;
22424
+
22425
+ if (regionalPages && ISIContent && regionalPages.includes(url)) {
22426
+ return React__default.createElement(ISIContent, null);
22427
+ } else if (nationalPage === url && ISIContent) {
22428
+ return React__default.createElement(ISIContent, { national: true });
22429
+ }
22430
+ return null;
22431
+ };
22432
+
22433
+ var renderRelevantTopicsDropdown = function renderRelevantTopicsDropdown() {
22434
+ if (content_placement && content_placement.length > 0) {
22435
+ return React__default.createElement(
22436
+ Dropdown,
22437
+ null,
22438
+ React__default.createElement(
22439
+ Dropdown.Toggle,
22440
+ { variant: 'primary', id: 'partner-dropdown' },
22441
+ 'Relevant Topics'
22442
+ ),
22443
+ React__default.createElement(
22444
+ Dropdown.Menu,
22445
+ null,
22446
+ content_placement.length > 0 ? content_placement.map(function (cp, index) {
22447
+ var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
22448
+ var href = '/' + cp_url;
22449
+ return React__default.createElement(
22450
+ Dropdown.Item,
22451
+ { key: index, href: href },
22452
+ cp.name
22453
+ );
22454
+ }) : null
22455
+ )
22456
+ );
22457
+ }
22458
+ return null;
22459
+ };
22460
+ var form = function form() {
22461
+ return React__default.createElement(
22462
+ React__default.Fragment,
22463
+ null,
22464
+ React__default.createElement(
22465
+ Head,
22466
+ null,
22467
+ React__default.createElement('meta', { name: 'googlebot', content: 'noindex' })
22468
+ ),
22469
+ React__default.createElement(
22470
+ 'div',
22471
+ { className: 'mt-5', style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
22472
+ React__default.createElement(
22473
+ Form$1,
22474
+ {
22475
+ inline: true,
22476
+ onSubmit: function onSubmit(e) {
22477
+ e.preventDefault();
22478
+ } },
22479
+ React__default.createElement(FormControl, { type: 'text', className: 'mr-sm-2', value: passwordKey, onChange: function onChange(e) {
22480
+ return setPasswordKey(e.target.value);
22481
+ }, placeholder: 'Password' }),
22482
+ React__default.createElement(
22483
+ Button,
22484
+ {
22485
+ variant: 'primary',
22486
+ onClick: function onClick() {
22487
+ if (passwordKey === props.article.password) {
22488
+ setAuth(2);
22489
+ } else {
22490
+ alert('Incorrect Password');
22491
+ }
22492
+ } },
22493
+ 'Submit'
22494
+ )
22495
+ )
22496
+ )
22497
+ );
22498
+ };
22499
+
22500
+ var renderBlockContent = function renderBlockContent(payload) {
22501
+ var _payload = payload,
22502
+ body = _payload.body;
22503
+
22504
+ var findIndex = function findIndex(arr) {
22505
+ var indexes = [];
22506
+ var _iteratorNormalCompletion = true;
22507
+ var _didIteratorError = false;
22508
+ var _iteratorError = undefined;
22509
+
22510
+ try {
22511
+ for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
22512
+ var ele = _step.value;
22513
+
22514
+ if (ele['_type'] === 'block' && ele.children.some(function (child) {
22515
+ return child.text.trim().length > 0;
22516
+ }) && ele['listItem'] !== 'bullet' && ele['style'] === 'normal' || ele['_type'] === 'figure') {
22517
+ indexes.push(arr.indexOf(ele));
22518
+ }
22519
+ }
22520
+ } catch (err) {
22521
+ _didIteratorError = true;
22522
+ _iteratorError = err;
22523
+ } finally {
22524
+ try {
22525
+ if (!_iteratorNormalCompletion && _iterator.return) {
22526
+ _iterator.return();
22527
+ }
22528
+ } finally {
22529
+ if (_didIteratorError) {
22530
+ throw _iteratorError;
22531
+ }
22532
+ }
22533
+ }
22534
+
22535
+ return indexes;
22536
+ };
22537
+ var indexes = findIndex(body);
22538
+ if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
22539
+ payload = _extends$2({}, payload, {
22540
+ contextualAD: _extends$2({}, payload.contextualAD, {
22541
+ slotId: (payload.contextualAD.slotId || 'native-ad') + '-' + payload._id
22542
+ }),
22543
+ contextualVideoAD: _extends$2({}, payload.contextualVideoAD, {
22544
+ slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
22545
+ })
22546
+ });
22547
+ var selectedIndex = indexes[1] + 1;
22548
+
22549
+ var checkIsAdFound = function checkIsAdFound(isFound) {
22550
+ if (!isFound) {
22551
+ var parent = document.getElementById('contextual-native-ad-' + payload._id);
22552
+ parent.style.height = '0%';
22553
+ parent.style.width = '0%';
22554
+ parent.style.display = 'none';
22555
+ setContextualADFlag(false);
22556
+ } else {
22557
+ setContextualADFlag(true);
22558
+ }
22559
+ };
22560
+
22561
+ var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
22562
+ if (!isFound) {
22563
+ var parent = document.getElementById('contextual-video-ad-' + payload._id);
22564
+ parent.style.height = '0%';
22565
+ parent.style.width = '0%';
22566
+ parent.style.display = 'none';
22567
+ setContextualADFlag(false);
22568
+ } else {
22569
+ setContextualADFlag(true);
22570
+ }
22571
+ };
22572
+
22573
+ return React__default.createElement(
22574
+ React__default.Fragment,
22575
+ null,
22576
+ React__default.createElement(BlockContent, _extends$2({
22577
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false, contextualADFlag),
22578
+ blocks: [].concat(_toConsumableArray(body.slice(0, selectedIndex))),
22579
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22580
+ }, client.config())),
22581
+ React__default.createElement('span', { className: 'clearfix' }),
22582
+ React__default.createElement(
22583
+ 'div',
22584
+ { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
22585
+ React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
22586
+ ),
22587
+ React__default.createElement('span', { className: 'clearfix' }),
22588
+ React__default.createElement(
22589
+ 'div',
22590
+ { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
22591
+ React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
22592
+ ),
22593
+ React__default.createElement(BlockContent, _extends$2({
22594
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
22595
+ blocks: [].concat(_toConsumableArray(body.slice(selectedIndex))),
22596
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22597
+ }, client.config()))
22598
+ );
22599
+ } else if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && !payload.contextualVideoAD) {
22600
+ payload = _extends$2({}, payload, {
22601
+ contextualAD: _extends$2({}, payload.contextualAD, {
22602
+ slotId: (payload.contextualAD.slotId || 'native-ad') + '-' + payload._id
22603
+ })
22604
+ });
22605
+ var _selectedIndex = indexes[1] + 1;
22606
+
22607
+ var _checkIsAdFound = function _checkIsAdFound(isFound) {
22608
+ if (!isFound) {
22609
+ var parent = document.getElementById('contextual-native-ad-' + payload._id);
22610
+ parent.style.height = '0%';
22611
+ parent.style.width = '0%';
22612
+ parent.style.display = 'none';
22613
+ setContextualADFlag(false);
22614
+ } else {
22615
+ setContextualADFlag(true);
22616
+ }
22617
+ };
22618
+
22619
+ return React__default.createElement(
22620
+ React__default.Fragment,
22621
+ null,
22622
+ React__default.createElement(BlockContent, _extends$2({
22623
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false, contextualADFlag),
22624
+ blocks: [].concat(_toConsumableArray(body.slice(0, _selectedIndex))),
22625
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22626
+ }, client.config())),
22627
+ React__default.createElement('span', { className: 'clearfix' }),
22628
+ React__default.createElement(
22629
+ 'div',
22630
+ { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
22631
+ React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound }))
22632
+ ),
22633
+ React__default.createElement(BlockContent, _extends$2({
22634
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
22635
+ blocks: [].concat(_toConsumableArray(body.slice(_selectedIndex))),
22636
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22637
+ }, client.config()))
22638
+ );
22639
+ } else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
22640
+ payload = _extends$2({}, payload, {
22641
+ contextualVideoAD: _extends$2({}, payload.contextualVideoAD, {
22642
+ slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
22643
+ })
22644
+ });
22645
+ var _selectedIndex2 = indexes[1] + 1;
22646
+
22647
+ var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
22648
+ if (!isFound) {
22649
+ var parent = document.getElementById('contextual-video-ad-' + payload._id);
22650
+ parent.style.height = '0%';
22651
+ parent.style.width = '0%';
22652
+ parent.style.display = 'none';
22653
+ setContextualADFlag(false);
22654
+ } else {
22655
+ if (body && body[1] && body[1]._type === 'figure') {
22656
+ setContextualADFlag(true);
22657
+ }
22658
+ }
22659
+ };
22660
+
22661
+ return React__default.createElement(
22662
+ React__default.Fragment,
22663
+ null,
22664
+ React__default.createElement(BlockContent, _extends$2({
22665
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false, contextualADFlag),
22666
+ blocks: [].concat(_toConsumableArray(body.slice(0, _selectedIndex2))),
22667
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22668
+ }, client.config())),
22669
+ React__default.createElement('span', { className: 'clearfix' }),
22670
+ React__default.createElement(
22671
+ 'div',
22672
+ { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
22673
+ React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
22674
+ ),
22675
+ React__default.createElement(BlockContent, _extends$2({
22676
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
22677
+ blocks: [].concat(_toConsumableArray(body.slice(_selectedIndex2))),
22678
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22679
+ }, client.config()))
22680
+ );
22681
+ } else {
22682
+ return React__default.createElement(BlockContent, _extends$2({
22683
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
22684
+ blocks: articleBody,
22685
+ imageOptions: { w: 320, h: 240, fit: 'max' }
22686
+ }, client.config()));
22687
+ }
22688
+ };
22689
+
22690
+ var detail = function detail() {
22691
+ var shareVia = shareOptions.shareVia,
22692
+ shareSubject = shareOptions.shareSubject,
22693
+ twitterSiteName = shareOptions.twitterSiteName,
22694
+ shareImageDefault = shareOptions.shareImageDefault,
22695
+ shareBaseUrl = shareOptions.shareBaseUrl,
22696
+ shareSiteTitle = shareOptions.shareSiteTitle;
22697
+
22698
+ var shareUrl = shareBaseUrl + props.article.url.current;
22699
+ var shareTitle = article.title;
22700
+ var shareSummary = article.summary;
22701
+ var shareImage = thumbnail && thumbnail.asset ? urlFor$6(props.client, thumbnail.asset).url() : shareImageDefault;
22702
+ var siteName = props.website && props.website.title ? props.website.title : '';
22703
+
22704
+ var meta = {
22705
+ shareTitle: shareTitle,
22706
+ shareSiteName: props.cache.siteSettingCache.name,
22707
+ shareSummary: shareSummary,
22708
+ shareUrl: shareUrl,
22709
+ shareImage: shareImage,
22710
+ shareVia: props.Settings.title
22711
+ };
22712
+ if (!props.infiniteScroll) {
22713
+ changeUrl = function changeUrl() {
22714
+ return null;
22715
+ };
22716
+ }
22717
+
22718
+ return React__default.createElement(
22719
+ React__default.Fragment,
22720
+ null,
22721
+ React__default.createElement(
22722
+ InscreenSensor,
22723
+ {
22724
+ offSetTop: 45,
22725
+ onChange: function onChange(visible) {
22726
+ if (visible !== false) {
22727
+ changeUrl(url, visible, meta);
22728
+ }
22729
+ } },
22730
+ React__default.createElement(
22731
+ 'div',
22732
+ null,
22733
+ React__default.createElement(
22734
+ Head,
22735
+ null,
22736
+ React__default.createElement(
22737
+ 'title',
22738
+ { key: 'title' },
22739
+ shareTitle + ' | ' + props.cache.siteSettingCache.name
22740
+ ),
22741
+ React__default.createElement('meta', { name: 'description', key: 'description', content: shareSummary }),
22742
+ passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
22743
+ React__default.createElement('meta', { property: 'og:url', content: shareUrl, key: 'og:url' }),
22744
+ React__default.createElement('meta', { property: 'og:title', content: shareTitle, key: 'og:title' }),
22745
+ React__default.createElement('meta', { property: 'og:image', content: shareImage, key: 'og:image' }),
22746
+ React__default.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
22747
+ React__default.createElement('meta', { property: 'og:description', content: shareSummary, key: 'og:description' }),
22748
+ React__default.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
22749
+ React__default.createElement('meta', { name: 'twitter:title', content: shareTitle, key: 'twitter:title' }),
22750
+ React__default.createElement('meta', { name: 'twitter:image', content: shareImage, key: 'twitter:image' }),
22751
+ React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
22752
+ React__default.createElement('meta', { name: 'twitter:description', content: shareSummary, key: 'twitter:description' }),
22753
+ React__default.createElement(
22754
+ 'noscript',
22755
+ null,
22756
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
22757
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
22758
+ )
22759
+ ),
22760
+ React__default.createElement(
22761
+ 'div',
22762
+ { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
22763
+ React__default.createElement(
22764
+ 'h1',
22765
+ { className: 'page-title' },
22766
+ title
22767
+ ),
22768
+ React__default.createElement(
22769
+ 'div',
22770
+ { className: 'mb-4 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
22771
+ React__default.createElement(
22772
+ 'style',
22773
+ { jsx: 'true' },
22774
+ '\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n '
22775
+ ),
22776
+ React__default.createElement(
22777
+ 'div',
22778
+ { className: 'left-wrap' },
22779
+ React__default.createElement(
22780
+ 'div',
22781
+ null,
22782
+ moment(published).format('LL')
22783
+ ),
22784
+ React__default.createElement(
22785
+ 'div',
22786
+ { className: 'mb-3' },
22787
+ authorDetails && authorDetails.map(function (authorDetail, index) {
22788
+ return React__default.createElement(
22789
+ 'span',
22790
+ { key: index },
22791
+ renderAuthor$2(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
22792
+ );
22793
+ }),
22794
+ React__default.createElement(
22795
+ 'div',
22796
+ null,
22797
+ source && React__default.createElement(
22798
+ 'p',
22799
+ null,
22800
+ source
22801
+ )
22802
+ ),
22803
+ issue && React__default.createElement(
22804
+ 'div',
22805
+ null,
22806
+ React__default.createElement(
22807
+ 'div',
22808
+ { className: 'volume-issue' },
22809
+ React__default.createElement(
22810
+ 'p',
22811
+ null,
22812
+ issue.volume && React__default.createElement(
22813
+ 'span',
22814
+ null,
22815
+ 'Volume ' + issue.volume,
22816
+ ','
22817
+ ),
22818
+ issue.issueNumber && React__default.createElement(
22819
+ 'span',
22820
+ null,
22821
+ ' Issue ' + issue.issueNumber
22822
+ )
22823
+ )
22824
+ )
22825
+ ),
22826
+ pageNumber && React__default.createElement(
22827
+ 'div',
22828
+ { className: 'article-pageNumber' },
22829
+ 'Page Number: ' + pageNumber
22830
+ )
22831
+ ),
22832
+ React__default.createElement(
22833
+ 'p',
22834
+ null,
22835
+ React__default.createElement(SocialShare$1, {
22836
+ shareUrl: shareUrl,
22837
+ shareTitle: shareTitle,
22838
+ shareVia: shareVia,
22839
+ shareSummary: shareSummary,
22840
+ shareSubject: shareSubject,
22841
+ shareImage: shareImage,
22842
+ size: 32,
22843
+ siteName: siteName,
22844
+ twitterSiteName: twitterSiteName,
22845
+ disableMeta: true
22846
+ })
22847
+ ),
22848
+ renderRelevantTopicsDropdown()
22849
+ ),
22850
+ React__default.createElement(
22851
+ 'div',
22852
+ null,
22853
+ React__default.createElement(DocumentGroup, { article: props.article, client: props.client })
22854
+ )
22855
+ ),
22856
+ React__default.createElement(
22857
+ 'p',
22858
+ null,
22859
+ React__default.createElement('div', null),
22860
+ React__default.createElement(
22861
+ 'em',
22862
+ null,
22863
+ summary
22864
+ ),
22865
+ React__default.createElement('br', null),
22866
+ React__default.createElement('br', null)
22867
+ ),
22868
+ React__default.createElement(
22869
+ 'div',
22870
+ { className: 'ad-box', style: { textAlign: 'center' } },
22871
+ main_39 && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
22872
+ if (index === 0) {
22873
+ return React__default.createElement(
22874
+ 'div',
22875
+ {
22876
+ key: index,
22877
+ id: 'addid-' + index,
22878
+ style: {
22879
+ display: 'flex',
22880
+ flex: '1 0 auto',
22881
+ justifyContent: 'center',
22882
+ alignItems: 'center',
22883
+ textAlign: 'center'
22884
+ } },
22885
+ ad.component
22886
+ );
22887
+ }
22888
+ })
22889
+ ),
22890
+ React__default.createElement(
22891
+ 'div',
22892
+ { className: 'block-content' },
22893
+ renderBlockContent(props.article),
22894
+ React__default.createElement(
22895
+ 'noscript',
22896
+ null,
22897
+ React__default.createElement(
22898
+ 'div',
22899
+ { style: { display: 'flex', justifyContent: 'center' }, className: 'series-links' },
22900
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement(
22901
+ 'a',
22902
+ { className: 'mx-3', href: props.article.seriesDetail.prevUrl },
22903
+ 'Previous ',
22904
+ props.article.seriesDetail.type
22905
+ ),
22906
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement(
22907
+ 'a',
22908
+ { className: 'mx-3', href: props.article.seriesDetail.nextUrl },
22909
+ 'Next ',
22910
+ props.article.seriesDetail.type
22911
+ )
22912
+ )
22913
+ ),
22914
+ issue && issue.url && React__default.createElement(
22915
+ 'a',
22916
+ { href: issue.url, target: '_blank', title: 'Download issue' },
22917
+ React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
22918
+ 'Download Issue : ',
22919
+ issue.name
22920
+ )
22921
+ )
22922
+ ),
22923
+ renderIsiContent(props.article)
22924
+ )
22925
+ ),
22926
+ main_39 && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
22927
+ if (index > 0) {
22928
+ return React__default.createElement(
22929
+ 'div',
22930
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
22931
+ ad.component
22932
+ );
22933
+ }
22934
+ }),
22935
+ React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
22936
+ React__default.createElement('hr', { className: 'article-seperater my-5' })
22937
+ );
22938
+ };
22939
+
22940
+ if (passwordLock) {
22941
+ if (auth === 2) {
22942
+ return detail();
22943
+ } else {
22944
+ return form();
22945
+ }
22946
+ } else {
22947
+ return detail();
22948
+ }
22949
+ };
22950
+
22951
+ var defineProperty$1 = createCommonjsModule(function (module, exports) {
22952
+
22953
+ exports.__esModule = true;
22954
+
22955
+
22956
+
22957
+ var _defineProperty2 = _interopRequireDefault(defineProperty$2);
22958
+
22959
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22960
+
22961
+ exports.default = function (obj, key, value) {
22962
+ if (key in obj) {
22963
+ (0, _defineProperty2.default)(obj, key, {
22964
+ value: value,
22965
+ enumerable: true,
22966
+ configurable: true,
22967
+ writable: true
22968
+ });
22969
+ } else {
22970
+ obj[key] = value;
22971
+ }
22972
+
22973
+ return obj;
22974
+ };
22975
+ });
22976
+
22977
+ var _defineProperty$1 = unwrapExports(defineProperty$1);
22978
+
22979
+ var getTargeting = function getTargeting(props) {
22980
+ var article = props.article,
22981
+ position = props.position,
22982
+ prevUrl = props.prevUrl,
22983
+ _props$cpModification = props.cpModificationRequired,
22984
+ cpModificationRequired = _props$cpModification === undefined ? true : _props$cpModification;
22985
+ var _article$internalTag = article.internalTag,
22986
+ internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
22987
+ _article$userDefinedT = article.userDefinedTag,
22988
+ userDefinedTag = _article$userDefinedT === undefined ? [] : _article$userDefinedT,
22989
+ _article$SponsorshipT = article.SponsorshipTag,
22990
+ SponsorshipTag = _article$SponsorshipT === undefined ? [] : _article$SponsorshipT,
22991
+ _article$seoTag = article.seoTag,
22992
+ seoTag = _article$seoTag === undefined ? [] : _article$seoTag,
22993
+ _article$url = article.url;
22994
+ _article$url = _article$url === undefined ? {
22995
+ current: ''
22996
+ } : _article$url;
22997
+ var url = _article$url.current,
22998
+ _article$documentGrou = article.documentGroup;
22999
+ _article$documentGrou = _article$documentGrou === undefined ? {
23000
+ path: ''
23001
+ } : _article$documentGrou;
23002
+ var document_group = _article$documentGrou.path,
23003
+ content_placement = article.content_placement;
23004
+
23005
+ var context = url;
23006
+ var localHistory = props.historyCookie ? JSON.parse(props.historyCookie) : [];
23007
+ if (!context && localHistory) {
23008
+ context = localHistory[localHistory.length - 1];
23009
+ }
23010
+ context = context && context.split('?')[0];
23011
+ context = context && context.split('&')[0];
23012
+ var content_placement_urls = [];
23013
+ if (content_placement && prevUrl && prevUrl.length) {
23014
+ content_placement.forEach(function (item) {
23015
+ var path = item.path;
23016
+ if (cpModificationRequired) {
23017
+ path = getContentPlacementUrl(item);
23018
+ }
23019
+
23020
+ if (includes_1(prevUrl, path)) {
23021
+ content_placement_urls.push(path);
23022
+ }
23023
+ });
23024
+ }
23025
+
23026
+ if (content_placement) {
23027
+ if (content_placement_urls.length === 0) {
23028
+ content_placement_urls = content_placement.map(function (item) {
23029
+ return cpModificationRequired ? getContentPlacementUrl(item) : item.path;
23030
+ });
23031
+ }
23032
+ } else {
23033
+ content_placement_urls = ['/'];
23034
+ }
23035
+ var articleKeywords = [].concat(_toConsumableArray(internalTag), _toConsumableArray(userDefinedTag), _toConsumableArray(SponsorshipTag), _toConsumableArray(seoTag));
23036
+ var targeting = {
23037
+ tags: articleKeywords,
23038
+ document_group: [document_group],
23039
+ document_url: [url],
23040
+ content_placement: content_placement_urls
23041
+ };
23042
+
23043
+ if (article.issue && article.issue.path) {
23044
+ targeting.issue_url = [article.issue.path];
23045
+ if (article.issue.publication && article.issue.publication.path) {
23046
+ targeting.publication_url = [article.issue.publication.path];
23047
+ }
23048
+ }
23049
+
23050
+ if (props.cache && props.cache.hyperTargeting) {
23051
+ targeting = _extends$2({}, targeting, { campaign_id: props.cache.hyperTargeting });
23052
+ }
23053
+
23054
+ if (position && position.length) {
23055
+ targeting['pos'] = position;
23056
+ }
23057
+ return targeting;
23058
+ };
23059
+
23060
+ var ArticleQueue$1 = function ArticleQueue(props) {
23061
+ var _props$prevUrl = props.prevUrl,
23062
+ Ads = props.Ads,
23063
+ _props$maxListLength = props.maxListLength,
23064
+ maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
23065
+ _props$sponsoredTaxon = props.sponsoredTaxonomies,
23066
+ sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
23067
+ _props$cpModification = props.cpModificationRequired,
23068
+ cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
23069
+ _props$authorPrefix = props.authorPrefix,
23070
+ authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix;
23071
+
23072
+
23073
+ var firstArticle = function firstArticle() {
23074
+ var article = _Object$assign({}, props.article);
23075
+ var targeting = getTargeting(props);
23076
+ article.Ads = Ads.getRightItems(targeting);
23077
+ return article;
23078
+ };
23079
+
23080
+ var _useState = useState([firstArticle()]),
23081
+ _useState2 = _slicedToArray(_useState, 2),
23082
+ queueData = _useState2[0],
23083
+ setQueueData = _useState2[1];
23084
+
23085
+ var refreshAD = function refreshAD(path) {
23086
+ if (!main_39) {
23087
+ var activeArticle = queueData.find(function (item) {
23088
+ return item.url.current === path;
23089
+ });
23090
+ var targeting = getTargeting(props);
23091
+ lib_3.getGoogletag().then(function (googletag) {
23092
+ if (window.googletag && googletag.pubadsReady) {
23093
+ var slots = googletag.pubads().getSlots();
23094
+ slots.forEach(function (slot) {
23095
+ var pos = slot.getTargeting('pos');
23096
+ slot.clearTargeting();
23097
+ _Object$keys(targeting).forEach(function (key) {
23098
+ slot.setTargeting(key, targeting[key]);
23099
+ });
23100
+ slot.setTargeting('pos', pos);
23101
+ });
23102
+ lib_3.refresh();
23103
+ }
23104
+ });
23105
+ }
23106
+ };
23107
+
23108
+ var checkSponseredArticle = function checkSponseredArticle(article) {
23109
+ var _article$taxonomyMapp = article.taxonomyMapping,
23110
+ taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
23111
+
23112
+ if (props.checkSponsered) {
23113
+ return taxonomyMapping.some(function (item) {
23114
+ return includes_1(sponsoredTaxonomies, item._ref);
23115
+ });
23116
+ } else {
23117
+ return false;
23118
+ }
23119
+ };
23120
+
23121
+ var preVscroll = 0;
23122
+ var isScrollDown = true;
23123
+
23124
+ var scrollDirectionDetect = function scrollDirectionDetect(e) {
23125
+ var window = e.currentTarget;
23126
+ if (preVscroll > window.scrollY) {
23127
+ if (!isScrollDown) {
23128
+ isScrollDown = true;
23129
+ }
23130
+ } else if (preVscroll < window.scrollY) {
23131
+ if (isScrollDown) {
23132
+ isScrollDown = false;
23133
+ }
23134
+ }
23135
+ preVscroll = window.scrollY;
23136
+ };
23137
+
23138
+ useEffect(function () {
23139
+ window.addEventListener('scroll', scrollDirectionDetect);
23140
+ return function () {
23141
+ return window.removeEventListener('scroll', scrollDirectionDetect);
23142
+ };
23143
+ });
23144
+
23145
+ var loadmore = function loadmore() {
23146
+ var query = props.relatedArticleQuery;
23147
+ var params = props.params;
23148
+ if (queueData && queueData.length < maxListLength) {
23149
+ params.index = queueData.length - 1;
23150
+ props.client.fetch(query, params).then(function (article) {
23151
+ if (article && article._id) {
23152
+ var targeting = getTargeting({ article: article });
23153
+ article.Ads = Ads.getRightItems(targeting);
23154
+ setQueueData([].concat(_toConsumableArray(queueData), [article]));
23155
+ }
23156
+ });
23157
+ }
23158
+ };
23159
+
23160
+ var changeMeta = function changeMeta(meta) {
23161
+ document.title = meta.shareTitle;
23162
+ document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
23163
+ document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
23164
+ document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
23165
+ document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
23166
+ document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
23167
+ document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
23168
+ document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
23169
+ document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
23170
+ document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
23171
+ };
23172
+
23173
+ var changeUrl = function changeUrl(path, visibility, meta) {
23174
+ var newPath = '/view/' + path;
23175
+ if (!isScrollDown) {
23176
+ if (visibility === 'top') {
23177
+ // router.push('/view/[url]', newPath, { shallow: true })
23178
+ window.history.pushState({ page: path }, path, newPath);
23179
+ if (props.pageview) {
23180
+ props.pageview(newPath);
23181
+ }
23182
+ refreshAD(path);
23183
+ changeMeta(meta);
23184
+ }
23185
+ } else {
23186
+ if (visibility === 'bottom') {
23187
+ // router.push('/view/[url]', newPath, { shallow: true })
23188
+ window.history.pushState({ page: path }, path, newPath);
23189
+ if (props.pageview) {
23190
+ props.pageview(newPath);
23191
+ }
23192
+ refreshAD(path);
23193
+ changeMeta(meta);
23194
+ }
23195
+ }
23196
+ };
23197
+
23198
+ return React__default.createElement(
23199
+ InfiniteScroll,
23200
+ { dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true, style: { overflow: 'hidden' } },
23201
+ queueData.map(function (article, index) {
23202
+ if (!checkSponseredArticle(article) && Ads.getVideoContextualAD) {
23203
+ article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props));
23204
+ }
23205
+ if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
23206
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(props));
23207
+ }
23208
+ return React__default.createElement(Article$1, _extends$2({ key: index }, props, { changeUrl: changeUrl, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
23209
+ })
23210
+ );
23211
+ };
23212
+
23213
+ var Articles = function Articles(props) {
23214
+ var _extends2;
23215
+
23216
+ var videoAccountIDs = props.videoAccountIDs,
23217
+ Ads = props.Ads,
23218
+ Settings = props.Settings,
23219
+ ISIContent = props.ISIContent,
23220
+ prevUrl = props.prevUrl,
23221
+ setActiveArticle = props.setActiveArticle,
23222
+ article = props.article,
23223
+ client = props.client,
23224
+ relatedArticleQuery = props.relatedArticleQuery,
23225
+ Website = props.Website,
23226
+ pageview = props.pageview,
23227
+ shareOptions = props.shareOptions,
23228
+ WAds = props.WAds,
23229
+ regionalPages = props.regionalPages,
23230
+ nationalPage = props.nationalPage;
23231
+ var taxonomyMapping = article.taxonomyMapping,
23232
+ _article$url = article.url;
23233
+ _article$url = _article$url === undefined ? {
23234
+ current: null
23235
+ } : _article$url;
23236
+ var url = _article$url.current,
23237
+ content_placement = article.content_placement;
23238
+
23239
+
23240
+ var taxonomy = [];
23241
+ content_placement.forEach(function (_ref2) {
23242
+ var path = _ref2.path,
23243
+ _id = _ref2._id;
23244
+
23245
+ if (includes_1(prevUrl, path)) taxonomy.push(_id);
23246
+ });
23247
+
23248
+ if (taxonomy.length === 0) {
23249
+ taxonomy = taxonomyMapping.map(function (_ref3) {
23250
+ var _ref = _ref3._ref;
23251
+ return _ref;
23252
+ });
23253
+ }
23254
+
23255
+ var params = {
23256
+ url: url,
23257
+ taxonomy: taxonomy,
23258
+ index: 0
23259
+ };
23260
+
23261
+ return React__default.createElement(ArticleQueue$1, _extends$2((_extends2 = {
23262
+ client: client,
23263
+ params: params,
23264
+ relatedArticleQuery: relatedArticleQuery,
23265
+ website: Website,
23266
+ checkSponsered: true,
23267
+ pageview: pageview,
23268
+ shareOptions: shareOptions,
23269
+ Ads: WAds,
23270
+ regionalPages: regionalPages,
23271
+ nationalPage: nationalPage
23272
+ }, _defineProperty$1(_extends2, 'pageview', pageview), _defineProperty$1(_extends2, 'onVote', function onVote() {}), _defineProperty$1(_extends2, 'ISIContent', ISIContent), _defineProperty$1(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty$1(_extends2, 'sponsoredTaxonomies', []), _defineProperty$1(_extends2, 'cpModificationRequired', true), _defineProperty$1(_extends2, 'Settings', Settings), _extends2), props));
23273
+ };
23274
+
23275
+ var View = function View(props) {
23276
+ var shareOptions = props.shareOptions,
23277
+ article = props.article;
23278
+ var _props$article = props.article,
23279
+ _props$article$passwo = _props$article.passwordLock,
23280
+ passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
23281
+ description = _props$article.description,
23282
+ title = _props$article.title;
23283
+
23284
+ //disable infinite scroll
23285
+
23286
+ var checkVideoSeries = function checkVideoSeries(article) {
23287
+ for (var i = 0; i < article.body.length; i++) {
23288
+ var row = article.body[i];
23289
+ if (typeof row.videos !== 'undefined') {
23290
+ return true;
23291
+ }
23292
+ }
23293
+ return false;
23294
+ };
23295
+ var isVideoSeries = checkVideoSeries(props.article);
23296
+ var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !article.ExcludeFromInfiniteScroll;
23297
+
23298
+ if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
23299
+ description = null;
23300
+ title = null;
23301
+ }
23302
+
23303
+ if (!needInfiniteScroll && !title) {
23304
+ title = props.article ? props.article.title : '';
23305
+ }
23306
+
23307
+ return React__default.createElement(
23308
+ React__default.Fragment,
23309
+ null,
23310
+ React__default.createElement(
23311
+ Head,
23312
+ null,
23313
+ React__default.createElement(
23314
+ 'title',
23315
+ { key: 'title' },
23316
+ article.title + ' | ' + props.cache.siteSettingCache.name
23317
+ ),
23318
+ React__default.createElement('meta', { name: 'description', key: 'description', content: shareOptions.shareSummary }),
23319
+ passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
23320
+ React__default.createElement('meta', { property: 'og:url', content: shareOptions.shareUrl, key: 'og:url' }),
23321
+ React__default.createElement('meta', { property: 'og:title', content: shareOptions.shareTitle, key: 'og:title' }),
23322
+ React__default.createElement('meta', { property: 'og:image', content: shareOptions.shareImage, key: 'og:image' }),
23323
+ React__default.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
23324
+ React__default.createElement('meta', { property: 'og:description', content: shareOptions.shareSummary, key: 'og:description' }),
23325
+ React__default.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
23326
+ React__default.createElement('meta', { name: 'twitter:title', content: shareOptions.shareTitle, key: 'twitter:title' }),
23327
+ React__default.createElement('meta', { name: 'twitter:image', content: shareOptions.shareImage, key: 'twitter:image' }),
23328
+ React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
23329
+ React__default.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' })
23330
+ ),
23331
+ !needInfiniteScroll ? React__default.createElement(Article$1, _extends$2({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends$2({ infiniteScroll: true }, props))
23332
+ );
23333
+ };
23334
+
23335
+ var getKeywords = function getKeywords(article) {
23336
+ var keywords = [];
23337
+ var internalTag = article.internalTag,
23338
+ userDefinedTag = article.userDefinedTag,
23339
+ SponsorshipTag = article.SponsorshipTag;
23340
+
23341
+
23342
+ if (internalTag) {
23343
+ internalTag.map(function (item) {
23344
+ keywords.push(item);
23345
+ });
23346
+ }
23347
+
23348
+ if (userDefinedTag) {
23349
+ userDefinedTag.map(function (item) {
23350
+ keywords.push(item);
23351
+ });
23352
+ }
23353
+
23354
+ if (SponsorshipTag) {
23355
+ SponsorshipTag.map(function (item) {
23356
+ keywords.push(item);
23357
+ });
23358
+ }
23359
+
23360
+ return keywords;
23361
+ };
23362
+
23363
+ var getQuery = function getQuery(type) {
23364
+ var today = moment().utc().format();
23365
+ switch (type) {
23366
+ case 'related':
23367
+ return '*[\n _type == "article" \n && defined(title) \n && defined(url) \n && !(_id in path("drafts.**")) \n && is_visible == true \n && published <= \'' + today + '\' \n && passwordLock!=true \n && taxonomyMapping[]._ref in $taxonomy \n && contentCategory->.name != \'Poll\' \n && contentCategory->.name != \'Slideshows\' \n && url.current != $url \n && !defined(body[].videos)\n ]| order(published desc)[$index]{\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\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 },\n documentGroup-> {\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 }';
23368
+ case 'article':
23369
+ return '*[\n _type == "article" \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && url.current == $url \n ][0]{\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\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 \'category\':contentCategory->{\n name\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 \n }';
23370
+ }
23371
+ };
23372
+
23373
+ export { AD300x250, AD300x250x600, ADFloatingFooter, ADFooter, ADGutter, ADSponsoredResources, ADWelcome, AccordionPanel, AdSlotsProvider, AlphabeticList, ArticleDetailDropdown, ArticleQueue, auth as Auth, Breadcrumbs$1 as Breadcrumbs, CMEDeck, ConferenceArticleCard, EventsDeck, Feature, fbsHero as ForbesHero, GridHero, Hero, HighlightenVideo, HorizontalHero, InfiniteScrollDeck, KMTracker, OncliveHero, OncliveLargeHero, PdfDownload, PopUpModal, PublicationLanding, RelatedContent, RelatedTopicsDropdown, SetCookie, SocialShare$1 as SocialShare, VerticalHero, View, YahooHero, getKeywords, getQuery, getSerializers, getSeriesDetail, getTargeting, urlFor$6 as urlFor };