@mjhls/mjh-framework 1.0.109-8.bc2 → 1.0.109

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 (370) hide show
  1. package/README.md +5 -1
  2. package/dist/index.es.js +20606 -0
  3. package/dist/index.es.js.map +1 -0
  4. package/dist/index.js +20644 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +26 -55
  7. package/dist/cjs/AD.js +0 -32
  8. package/dist/cjs/AD300x250.js +0 -95
  9. package/dist/cjs/AD300x250x600.js +0 -112
  10. package/dist/cjs/AD728x90.js +0 -109
  11. package/dist/cjs/ADFloatingFooter.js +0 -151
  12. package/dist/cjs/ADFooter.js +0 -53
  13. package/dist/cjs/ADGutter.js +0 -123
  14. package/dist/cjs/ADInfeed-7c075eda.js +0 -75
  15. package/dist/cjs/ADSkyscraper.js +0 -125
  16. package/dist/cjs/ADSponsoredResources.js +0 -122
  17. package/dist/cjs/ADWebcast.js +0 -127
  18. package/dist/cjs/ADWelcome.js +0 -166
  19. package/dist/cjs/ADlgInfeed-d4f556bd.js +0 -69
  20. package/dist/cjs/AccordionPanel.js +0 -94
  21. package/dist/cjs/AdSlot.js +0 -283
  22. package/dist/cjs/AdSlotsProvider.js +0 -184
  23. package/dist/cjs/AlgoliaSearch.js +0 -15221
  24. package/dist/cjs/AlphabeticList.js +0 -134
  25. package/dist/cjs/ArticleCarousel.js +0 -45
  26. package/dist/cjs/ArticleProgramLandingPage.js +0 -186
  27. package/dist/cjs/ArticleSeriesLandingPage.js +0 -162
  28. package/dist/cjs/ArticleSeriesListing.js +0 -314
  29. package/dist/cjs/AuthWrapper.js +0 -1526
  30. package/dist/cjs/AuthorComponent-7d00f6d5.js +0 -96
  31. package/dist/cjs/Beam.js +0 -405
  32. package/dist/cjs/BlockContent-96b44364.js +0 -916
  33. package/dist/cjs/Breadcrumbs.js +0 -117
  34. package/dist/cjs/CEDeckSupabase.js +0 -444
  35. package/dist/cjs/CMEDeck.js +0 -444
  36. package/dist/cjs/Column1.js +0 -36
  37. package/dist/cjs/Column2.js +0 -73
  38. package/dist/cjs/Column3.js +0 -140
  39. package/dist/cjs/ConferenceArticleCard.js +0 -94
  40. package/dist/cjs/ConferenceBanner-213003ce.js +0 -24
  41. package/dist/cjs/ContentCardPaginated.js +0 -416
  42. package/dist/cjs/DeckContent.js +0 -507
  43. package/dist/cjs/DeckQueue.js +0 -402
  44. package/dist/cjs/DeckQueuePaginated.js +0 -347
  45. package/dist/cjs/Dfp-67646058.js +0 -103
  46. package/dist/cjs/EventsDeck.js +0 -856
  47. package/dist/cjs/ExternalResources.js +0 -220
  48. package/dist/cjs/Feature.js +0 -132
  49. package/dist/cjs/ForbesHero.js +0 -138
  50. package/dist/cjs/GridContent.js +0 -828
  51. package/dist/cjs/GridContentPaginated.js +0 -703
  52. package/dist/cjs/GridHero.js +0 -148
  53. package/dist/cjs/GroupDeck.js +0 -314
  54. package/dist/cjs/HamMagazine.js +0 -664
  55. package/dist/cjs/Header.js +0 -65
  56. package/dist/cjs/HealthCareProfessionalModal.js +0 -78
  57. package/dist/cjs/Hero.js +0 -49
  58. package/dist/cjs/HighlightenVideo.js +0 -69
  59. package/dist/cjs/HorizontalArticleListing.js +0 -167
  60. package/dist/cjs/HorizontalHero.js +0 -112
  61. package/dist/cjs/ImageSlider-7c995858.js +0 -2808
  62. package/dist/cjs/IssueContentDeck.js +0 -242
  63. package/dist/cjs/IssueDeck.js +0 -267
  64. package/dist/cjs/IssueLanding.js +0 -176
  65. package/dist/cjs/KMTracker.js +0 -27
  66. package/dist/cjs/LeftNav.js +0 -153
  67. package/dist/cjs/MasterDeck.js +0 -555
  68. package/dist/cjs/MasterDeckPaginated.js +0 -468
  69. package/dist/cjs/MediaSeriesCard.js +0 -134
  70. package/dist/cjs/MediaSeriesLanding.js +0 -507
  71. package/dist/cjs/MediaSeriesLandingPaginated.js +0 -532
  72. package/dist/cjs/NavDvm.js +0 -278
  73. package/dist/cjs/NavFooter-b7b16d48.js +0 -72
  74. package/dist/cjs/NavMagazine.js +0 -615
  75. package/dist/cjs/NavNative.js +0 -880
  76. package/dist/cjs/OncliveHero.js +0 -80
  77. package/dist/cjs/OncliveLargeHero.js +0 -242
  78. package/dist/cjs/PageFilter.js +0 -72
  79. package/dist/cjs/Pagination-6359861a.js +0 -97
  80. package/dist/cjs/PartnerDetailListing.js +0 -374
  81. package/dist/cjs/PartnerDetailListingPaginated.js +0 -365
  82. package/dist/cjs/PdfDownload.js +0 -28
  83. package/dist/cjs/PixelTracking.js +0 -191
  84. package/dist/cjs/PodcastsLanding.js +0 -234
  85. package/dist/cjs/PopUpModal.js +0 -58
  86. package/dist/cjs/PtceDeck.js +0 -150
  87. package/dist/cjs/PubSection.js +0 -120
  88. package/dist/cjs/PubToc.js +0 -88
  89. package/dist/cjs/PublicationDeck.js +0 -184
  90. package/dist/cjs/PublicationFeature-4b68e0db.js +0 -130
  91. package/dist/cjs/PublicationLanding.js +0 -826
  92. package/dist/cjs/QueueDeckExpanded.js +0 -1540
  93. package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1387
  94. package/dist/cjs/RecentNews.js +0 -91
  95. package/dist/cjs/RelatedContent.js +0 -115
  96. package/dist/cjs/RelatedTopicsDropdown.js +0 -90
  97. package/dist/cjs/RolesDeck.js +0 -94
  98. package/dist/cjs/Schema.js +0 -102
  99. package/dist/cjs/Search.js +0 -66
  100. package/dist/cjs/Segment.js +0 -458
  101. package/dist/cjs/SeriesListingDeck.js +0 -247
  102. package/dist/cjs/SeriesSlider-086a8319.js +0 -332
  103. package/dist/cjs/SetCookie.js +0 -10
  104. package/dist/cjs/SideFooter.js +0 -152
  105. package/dist/cjs/SocialIcons.js +0 -103
  106. package/dist/cjs/SocialSearchComponent-d7e5d3a6.js +0 -213
  107. package/dist/cjs/SocialShare.js +0 -74
  108. package/dist/cjs/TaxonomyCard.js +0 -256
  109. package/dist/cjs/TaxonomyDescription.js +0 -208
  110. package/dist/cjs/TemplateNormal.js +0 -204
  111. package/dist/cjs/ThumbnailCard.js +0 -60
  112. package/dist/cjs/Tooltip-b8516cbf.js +0 -9541
  113. package/dist/cjs/Ustream.js +0 -157
  114. package/dist/cjs/VerticalHero.js +0 -75
  115. package/dist/cjs/VideoProgramLandingPage.js +0 -262
  116. package/dist/cjs/VideoSeriesCard.js +0 -88
  117. package/dist/cjs/VideoSeriesFilter.js +0 -129
  118. package/dist/cjs/VideoSeriesLandingPage.js +0 -178
  119. package/dist/cjs/VideoSeriesListing.js +0 -421
  120. package/dist/cjs/View.js +0 -2835
  121. package/dist/cjs/YahooHero.js +0 -127
  122. package/dist/cjs/YoutubeGroup.js +0 -372
  123. package/dist/cjs/_commonjsHelpers-06173234.js +0 -25
  124. package/dist/cjs/_is-array-54228b29.js +0 -74
  125. package/dist/cjs/_iter-detect-b1df62f0.js +0 -52
  126. package/dist/cjs/_library-dd23b178.js +0 -5
  127. package/dist/cjs/_object-sap-d1978572.js +0 -16
  128. package/dist/cjs/_object-to-array-9337ba83.js +0 -25
  129. package/dist/cjs/_set-species-0c7864a2.js +0 -55
  130. package/dist/cjs/asyncToGenerator-65df6bf8.js +0 -1347
  131. package/dist/cjs/brightcove-react-player-loader.es-35faab67.js +0 -2232
  132. package/dist/cjs/checkSisterSite-c3a4ac98.js +0 -19
  133. package/dist/cjs/core.get-iterator-method-5643aa10.js +0 -584
  134. package/dist/cjs/debounce-d4a2369b.js +0 -216
  135. package/dist/cjs/define-property-e8404b64.js +0 -20
  136. package/dist/cjs/defineProperty-19580e93.js +0 -71
  137. package/dist/cjs/defineProperty-9673846a.js +0 -34
  138. package/dist/cjs/entities-df1aed86.js +0 -510
  139. package/dist/cjs/eq-5fc26c07.js +0 -79
  140. package/dist/cjs/extends-be0d85bc.js +0 -100
  141. package/dist/cjs/faundadb.js +0 -765
  142. package/dist/cjs/get-5839e5b5.js +0 -920
  143. package/dist/cjs/getContentCategory-f38a4c00.js +0 -11
  144. package/dist/cjs/getKeywords.js +0 -46
  145. package/dist/cjs/getPtceActivities.js +0 -90
  146. package/dist/cjs/getQuery.js +0 -27
  147. package/dist/cjs/getRelatedArticle.js +0 -766
  148. package/dist/cjs/getRootDocGroup.js +0 -63
  149. package/dist/cjs/getSerializers.js +0 -66
  150. package/dist/cjs/getSeriesDetail.js +0 -40
  151. package/dist/cjs/getTIData.js +0 -93
  152. package/dist/cjs/getTargeting-5b954783.js +0 -164
  153. package/dist/cjs/getTargeting.js +0 -12
  154. package/dist/cjs/iconBase-be4097c0.js +0 -104
  155. package/dist/cjs/index-187c967e.js +0 -54
  156. package/dist/cjs/index-3177f564.js +0 -1573
  157. package/dist/cjs/index-65621b6c.js +0 -613
  158. package/dist/cjs/index-7435b964.js +0 -1683
  159. package/dist/cjs/index-a26637a3.js +0 -11764
  160. package/dist/cjs/index-d48b231c.js +0 -556
  161. package/dist/cjs/index-ff83a88b.js +0 -104
  162. package/dist/cjs/index.es-1ab8dda7.js +0 -445
  163. package/dist/cjs/index.esm-2ea9e9ff.js +0 -98
  164. package/dist/cjs/index.esm-c1e16606.js +0 -13
  165. package/dist/cjs/index.esm-d51c9ac6.js +0 -25
  166. package/dist/cjs/index.esm-d81454e7.js +0 -19
  167. package/dist/cjs/index.js +0 -638
  168. package/dist/cjs/inherits-e47b5342.js +0 -188
  169. package/dist/cjs/isSymbol-03abbdf0.js +0 -209
  170. package/dist/cjs/js.cookie-a511c430.js +0 -160
  171. package/dist/cjs/keys-e982b3fa.js +0 -25
  172. package/dist/cjs/lodash-f0783643.js +0 -17195
  173. package/dist/cjs/main-ae8472f3.js +0 -969
  174. package/dist/cjs/moment-f730814d.js +0 -5684
  175. package/dist/cjs/react-social-icons-2c5c389a.js +0 -616
  176. package/dist/cjs/slicedToArray-067dd3bc.js +0 -95
  177. package/dist/cjs/smoothscroll-99df7f93.js +0 -438
  178. package/dist/cjs/stringify-f7a37a8d.js +0 -17
  179. package/dist/cjs/style-inject.es-dcee06b6.js +0 -30
  180. package/dist/cjs/timeDifferenceCalc.js +0 -39
  181. package/dist/cjs/toConsumableArray-d7797c2b.js +0 -74
  182. package/dist/cjs/toNumber-5e1fac58.js +0 -104
  183. package/dist/cjs/typeof-220bbf73.js +0 -382
  184. package/dist/cjs/urlFor.js +0 -66
  185. package/dist/cjs/urlForFile-5084fc48.js +0 -29
  186. package/dist/cjs/ustream-api-3819e4aa.js +0 -106
  187. package/dist/cjs/visibility-sensor-56020df6.js +0 -597
  188. package/dist/cjs/web.dom.iterable-d98303e0.js +0 -50
  189. package/dist/esm/AD.js +0 -26
  190. package/dist/esm/AD300x250.js +0 -89
  191. package/dist/esm/AD300x250x600.js +0 -106
  192. package/dist/esm/AD728x90.js +0 -103
  193. package/dist/esm/ADFloatingFooter.js +0 -145
  194. package/dist/esm/ADFooter.js +0 -47
  195. package/dist/esm/ADGutter.js +0 -117
  196. package/dist/esm/ADInfeed-3442c999.js +0 -68
  197. package/dist/esm/ADSkyscraper.js +0 -119
  198. package/dist/esm/ADSponsoredResources.js +0 -116
  199. package/dist/esm/ADWebcast.js +0 -121
  200. package/dist/esm/ADWelcome.js +0 -160
  201. package/dist/esm/ADlgInfeed-30649360.js +0 -63
  202. package/dist/esm/AccordionPanel.js +0 -87
  203. package/dist/esm/AdSlot.js +0 -276
  204. package/dist/esm/AdSlotsProvider.js +0 -177
  205. package/dist/esm/AlgoliaSearch.js +0 -15214
  206. package/dist/esm/AlphabeticList.js +0 -128
  207. package/dist/esm/ArticleCarousel.js +0 -39
  208. package/dist/esm/ArticleProgramLandingPage.js +0 -180
  209. package/dist/esm/ArticleSeriesLandingPage.js +0 -156
  210. package/dist/esm/ArticleSeriesListing.js +0 -307
  211. package/dist/esm/AuthWrapper.js +0 -1520
  212. package/dist/esm/AuthorComponent-d9653ae5.js +0 -90
  213. package/dist/esm/Beam.js +0 -403
  214. package/dist/esm/BlockContent-1e73bd2c.js +0 -909
  215. package/dist/esm/Breadcrumbs.js +0 -110
  216. package/dist/esm/CEDeckSupabase.js +0 -438
  217. package/dist/esm/CMEDeck.js +0 -438
  218. package/dist/esm/Column1.js +0 -28
  219. package/dist/esm/Column2.js +0 -65
  220. package/dist/esm/Column3.js +0 -132
  221. package/dist/esm/ConferenceArticleCard.js +0 -88
  222. package/dist/esm/ConferenceBanner-8792ebd2.js +0 -18
  223. package/dist/esm/ContentCardPaginated.js +0 -405
  224. package/dist/esm/DeckContent.js +0 -497
  225. package/dist/esm/DeckQueue.js +0 -392
  226. package/dist/esm/DeckQueuePaginated.js +0 -336
  227. package/dist/esm/Dfp-3b6eb620.js +0 -96
  228. package/dist/esm/EventsDeck.js +0 -843
  229. package/dist/esm/ExternalResources.js +0 -213
  230. package/dist/esm/Feature.js +0 -125
  231. package/dist/esm/ForbesHero.js +0 -132
  232. package/dist/esm/GridContent.js +0 -818
  233. package/dist/esm/GridContentPaginated.js +0 -692
  234. package/dist/esm/GridHero.js +0 -142
  235. package/dist/esm/GroupDeck.js +0 -308
  236. package/dist/esm/HamMagazine.js +0 -651
  237. package/dist/esm/Header.js +0 -54
  238. package/dist/esm/HealthCareProfessionalModal.js +0 -70
  239. package/dist/esm/Hero.js +0 -43
  240. package/dist/esm/HighlightenVideo.js +0 -63
  241. package/dist/esm/HorizontalArticleListing.js +0 -161
  242. package/dist/esm/HorizontalHero.js +0 -106
  243. package/dist/esm/ImageSlider-75f7b81a.js +0 -2799
  244. package/dist/esm/IssueContentDeck.js +0 -232
  245. package/dist/esm/IssueDeck.js +0 -257
  246. package/dist/esm/IssueLanding.js +0 -170
  247. package/dist/esm/KMTracker.js +0 -25
  248. package/dist/esm/LeftNav.js +0 -143
  249. package/dist/esm/MasterDeck.js +0 -548
  250. package/dist/esm/MasterDeckPaginated.js +0 -460
  251. package/dist/esm/MediaSeriesCard.js +0 -128
  252. package/dist/esm/MediaSeriesLanding.js +0 -500
  253. package/dist/esm/MediaSeriesLandingPaginated.js +0 -525
  254. package/dist/esm/NavDvm.js +0 -265
  255. package/dist/esm/NavFooter-4bcffccb.js +0 -66
  256. package/dist/esm/NavMagazine.js +0 -602
  257. package/dist/esm/NavNative.js +0 -864
  258. package/dist/esm/OncliveHero.js +0 -74
  259. package/dist/esm/OncliveLargeHero.js +0 -236
  260. package/dist/esm/PageFilter.js +0 -66
  261. package/dist/esm/Pagination-9fe9f61d.js +0 -90
  262. package/dist/esm/PartnerDetailListing.js +0 -368
  263. package/dist/esm/PartnerDetailListingPaginated.js +0 -359
  264. package/dist/esm/PdfDownload.js +0 -22
  265. package/dist/esm/PixelTracking.js +0 -182
  266. package/dist/esm/PodcastsLanding.js +0 -227
  267. package/dist/esm/PopUpModal.js +0 -51
  268. package/dist/esm/PtceDeck.js +0 -144
  269. package/dist/esm/PubSection.js +0 -114
  270. package/dist/esm/PubToc.js +0 -82
  271. package/dist/esm/PublicationDeck.js +0 -174
  272. package/dist/esm/PublicationFeature-6c334891.js +0 -121
  273. package/dist/esm/PublicationLanding.js +0 -816
  274. package/dist/esm/QueueDeckExpanded.js +0 -1534
  275. package/dist/esm/QueueDeckExpandedPaginated.js +0 -1381
  276. package/dist/esm/RecentNews.js +0 -85
  277. package/dist/esm/RelatedContent.js +0 -109
  278. package/dist/esm/RelatedTopicsDropdown.js +0 -82
  279. package/dist/esm/RolesDeck.js +0 -84
  280. package/dist/esm/Schema.js +0 -96
  281. package/dist/esm/Search.js +0 -57
  282. package/dist/esm/Segment.js +0 -456
  283. package/dist/esm/SeriesListingDeck.js +0 -241
  284. package/dist/esm/SeriesSlider-acbdf4c9.js +0 -326
  285. package/dist/esm/SetCookie.js +0 -8
  286. package/dist/esm/SideFooter.js +0 -146
  287. package/dist/esm/SocialIcons.js +0 -97
  288. package/dist/esm/SocialSearchComponent-9e65c8d6.js +0 -204
  289. package/dist/esm/SocialShare.js +0 -67
  290. package/dist/esm/TaxonomyCard.js +0 -246
  291. package/dist/esm/TaxonomyDescription.js +0 -201
  292. package/dist/esm/TemplateNormal.js +0 -197
  293. package/dist/esm/ThumbnailCard.js +0 -53
  294. package/dist/esm/Tooltip-fe0ed92d.js +0 -9532
  295. package/dist/esm/Ustream.js +0 -151
  296. package/dist/esm/VerticalHero.js +0 -69
  297. package/dist/esm/VideoProgramLandingPage.js +0 -253
  298. package/dist/esm/VideoSeriesCard.js +0 -82
  299. package/dist/esm/VideoSeriesFilter.js +0 -123
  300. package/dist/esm/VideoSeriesLandingPage.js +0 -172
  301. package/dist/esm/VideoSeriesListing.js +0 -414
  302. package/dist/esm/View.js +0 -2825
  303. package/dist/esm/YahooHero.js +0 -121
  304. package/dist/esm/YoutubeGroup.js +0 -366
  305. package/dist/esm/_commonjsHelpers-0c4b6f40.js +0 -19
  306. package/dist/esm/_is-array-68c79b29.js +0 -71
  307. package/dist/esm/_iter-detect-2f89237f.js +0 -48
  308. package/dist/esm/_library-528f1934.js +0 -3
  309. package/dist/esm/_object-sap-14bd8e96.js +0 -14
  310. package/dist/esm/_object-to-array-9dfdfb29.js +0 -23
  311. package/dist/esm/_set-species-7d3317b7.js +0 -50
  312. package/dist/esm/asyncToGenerator-1ebeb135.js +0 -1343
  313. package/dist/esm/brightcove-react-player-loader.es-a2422c4b.js +0 -2226
  314. package/dist/esm/checkSisterSite-a7218fda.js +0 -17
  315. package/dist/esm/core.get-iterator-method-95db387d.js +0 -547
  316. package/dist/esm/debounce-533d9748.js +0 -214
  317. package/dist/esm/define-property-433c51d3.js +0 -18
  318. package/dist/esm/defineProperty-e5afb9eb.js +0 -32
  319. package/dist/esm/defineProperty-e8022d1e.js +0 -66
  320. package/dist/esm/entities-6d9154b4.js +0 -507
  321. package/dist/esm/eq-bdcbf886.js +0 -76
  322. package/dist/esm/extends-2f4448b8.js +0 -94
  323. package/dist/esm/faundadb.js +0 -754
  324. package/dist/esm/get-3c308da4.js +0 -918
  325. package/dist/esm/getContentCategory-15dcc413.js +0 -9
  326. package/dist/esm/getKeywords.js +0 -44
  327. package/dist/esm/getPtceActivities.js +0 -88
  328. package/dist/esm/getQuery.js +0 -25
  329. package/dist/esm/getRelatedArticle.js +0 -764
  330. package/dist/esm/getRootDocGroup.js +0 -61
  331. package/dist/esm/getSerializers.js +0 -60
  332. package/dist/esm/getSeriesDetail.js +0 -38
  333. package/dist/esm/getTIData.js +0 -91
  334. package/dist/esm/getTargeting-b62a177c.js +0 -161
  335. package/dist/esm/getTargeting.js +0 -6
  336. package/dist/esm/iconBase-ccc56b97.js +0 -81
  337. package/dist/esm/index-3f5c03b2.js +0 -553
  338. package/dist/esm/index-4550ef23.js +0 -1571
  339. package/dist/esm/index-5cc7b406.js +0 -1674
  340. package/dist/esm/index-755f2cc2.js +0 -605
  341. package/dist/esm/index-a68bfe70.js +0 -11743
  342. package/dist/esm/index-c7e2ac95.js +0 -52
  343. package/dist/esm/index-c8d5e72b.js +0 -99
  344. package/dist/esm/index.es-a6137319.js +0 -439
  345. package/dist/esm/index.esm-1bd8a0a8.js +0 -18
  346. package/dist/esm/index.esm-9508070a.js +0 -91
  347. package/dist/esm/index.esm-9b042655.js +0 -10
  348. package/dist/esm/index.esm-eb1e8e80.js +0 -14
  349. package/dist/esm/index.js +0 -531
  350. package/dist/esm/inherits-96c84cbd.js +0 -179
  351. package/dist/esm/isSymbol-a7e9aafe.js +0 -203
  352. package/dist/esm/js.cookie-6874175c.js +0 -158
  353. package/dist/esm/keys-185288f4.js +0 -23
  354. package/dist/esm/lodash-f97fd99a.js +0 -17193
  355. package/dist/esm/main-754d4992.js +0 -956
  356. package/dist/esm/moment-48faeb9c.js +0 -5682
  357. package/dist/esm/react-social-icons-9be47857.js +0 -609
  358. package/dist/esm/slicedToArray-72ed566b.js +0 -92
  359. package/dist/esm/smoothscroll-fa4e3f8c.js +0 -436
  360. package/dist/esm/stringify-1e2a5946.js +0 -15
  361. package/dist/esm/style-inject.es-1f59c1d0.js +0 -28
  362. package/dist/esm/timeDifferenceCalc.js +0 -37
  363. package/dist/esm/toConsumableArray-e6f28e5c.js +0 -71
  364. package/dist/esm/toNumber-5aeba6e7.js +0 -102
  365. package/dist/esm/typeof-3ab7d3b6.js +0 -378
  366. package/dist/esm/urlFor.js +0 -64
  367. package/dist/esm/urlForFile-2e523b67.js +0 -27
  368. package/dist/esm/ustream-api-63a164b3.js +0 -104
  369. package/dist/esm/visibility-sensor-72fd8f8b.js +0 -590
  370. package/dist/esm/web.dom.iterable-3fffc027.js +0 -48
package/dist/esm/View.js DELETED
@@ -1,2825 +0,0 @@
1
- import { _ as _asyncToGenerator, r as regenerator, a as _Promise } from './asyncToGenerator-1ebeb135.js';
2
- import { _ as _extends, a as _Object$assign } from './extends-2f4448b8.js';
3
- import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-72ed566b.js';
4
- import React__default, { useState, useRef, useEffect, forwardRef } from 'react';
5
- import Head from 'next/head';
6
- import { useRouter } from 'next/router';
7
- import { _ as _JSON$stringify } from './stringify-1e2a5946.js';
8
- import { _ as _toConsumableArray } from './toConsumableArray-e6f28e5c.js';
9
- import { m as moment } from './moment-48faeb9c.js';
10
- import { B as BlockContent } from './BlockContent-1e73bd2c.js';
11
- import { m as main_43 } from './main-754d4992.js';
12
- import 'react-bootstrap/Dropdown';
13
- import Form from 'react-bootstrap/Form';
14
- import FormControl from 'react-bootstrap/FormControl';
15
- import Button from 'react-bootstrap/Button';
16
- import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
17
- import SocialShare from './SocialShare.js';
18
- import { r as renderAuthor, g as getSerializers } from './index-a68bfe70.js';
19
- import DFPAdSlot from './AdSlot.js';
20
- import { S as SeriesSlider } from './SeriesSlider-acbdf4c9.js';
21
- import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-b62a177c.js';
22
- import getKeywords from './getKeywords.js';
23
- import urlFor from './urlFor.js';
24
- import { u as urlForFile } from './urlForFile-2e523b67.js';
25
- import { _ as _typeof } from './typeof-3ab7d3b6.js';
26
- import { b as FaMinus, c as FaPlus } from './index.esm-1bd8a0a8.js';
27
- import { s as styleInject } from './style-inject.es-1f59c1d0.js';
28
- import './index-755f2cc2.js';
29
- import { DiscussionEmbed } from 'disqus-react';
30
- import Schema from './Schema.js';
31
- import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
32
- import { PixelTrackingArticle } from './PixelTracking.js';
33
- import { _ as _Object$keys } from './keys-185288f4.js';
34
- import { I as InfiniteScroll } from './index.es-a6137319.js';
35
- import { l as lib_3 } from './index-5cc7b406.js';
36
- import getRelatedArticle from './getRelatedArticle.js';
37
- import getQuery from './getQuery.js';
38
- import getSeriesDetail from './getSeriesDetail.js';
39
- import './core.get-iterator-method-95db387d.js';
40
- import './web.dom.iterable-3fffc027.js';
41
- import './_library-528f1934.js';
42
- import './_set-species-7d3317b7.js';
43
- import './_iter-detect-2f89237f.js';
44
- import 'prop-types';
45
- import './index-3f5c03b2.js';
46
- import 'react-dom';
47
- import 'react-share';
48
- import 'react-bootstrap';
49
- import './index-c7e2ac95.js';
50
- import './Beam.js';
51
- import './Segment.js';
52
- import './brightcove-react-player-loader.es-a2422c4b.js';
53
- import './_object-to-array-9dfdfb29.js';
54
- import 'react-bootstrap/Modal';
55
- import 'react-ga';
56
- import './GroupDeck.js';
57
- import './smoothscroll-fa4e3f8c.js';
58
- import './_is-array-68c79b29.js';
59
- import 'react-bootstrap/Pagination';
60
- import './entities-6d9154b4.js';
61
- import 'react-bootstrap/Row';
62
- import 'react-bootstrap/Col';
63
- import './inherits-96c84cbd.js';
64
- import './_object-sap-14bd8e96.js';
65
- import './define-property-433c51d3.js';
66
- import './index.esm-eb1e8e80.js';
67
- import './iconBase-ccc56b97.js';
68
- import 'react-bootstrap/Figure';
69
- import 'react-bootstrap/OverlayTrigger';
70
- import 'react-bootstrap/Tooltip';
71
- import 'react-bootstrap/Popover';
72
- import './checkSisterSite-a7218fda.js';
73
- import './debounce-533d9748.js';
74
- import './isSymbol-a7e9aafe.js';
75
- import './toNumber-5aeba6e7.js';
76
-
77
- var getArticleSummary = function getArticleSummary(article) {
78
- if (article.summary && article.summary.length > 0) {
79
- return article.summary;
80
- } else {
81
- return false;
82
- }
83
- };
84
-
85
- var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
86
- if (!docGroup) {
87
- return null;
88
- }
89
- var url = void 0;
90
- try {
91
- if (docGroup.path && docGroup.path.includes('/') && (!docGroup.parent || !docGroup.parent.parent)) {
92
- return '/' + docGroup.path;
93
- }
94
- } catch (e) {
95
- console.log(e.message);
96
- }
97
- // Checking if Parent has Parent
98
- try {
99
- if (docGroup.path && docGroup.path.includes('/') && docGroup.parent && docGroup.parent.parent) {
100
- if (docGroup.path.includes(docGroup.parent.identifier.current)) {
101
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.path;
102
- } else {
103
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
104
- }
105
- }
106
- } catch (e) {
107
- console.log(e.message);
108
- }
109
-
110
- try {
111
- if (docGroup.parent && docGroup.parent.identifier && docGroup.parent.parent && docGroup.parent.parent.identifier && docGroup.parent.identifier.current.includes('/') && docGroup.parent.identifier.current.split('/')[0] === docGroup.parent.parent.identifier.current) {
112
- return '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
113
- }
114
- } catch (e) {
115
- console.log(e.message);
116
- }
117
-
118
- if (docGroup.parent) {
119
- url = '/' + docGroup.parent.identifier.current;
120
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
121
- url = '/' + docGroup.parent.parent.identifier.current + url;
122
- }
123
- }
124
-
125
- if (typeof url !== 'undefined') {
126
- url = url + '/' + docGroup.path;
127
- } else {
128
- // url = '/' + docGroup.path
129
- return null;
130
- }
131
-
132
- return url;
133
- };
134
-
135
- var getDocumentGroupName = function getDocumentGroupName(docGroup) {
136
- var name = void 0;
137
- if (!docGroup) {
138
- return null;
139
- }
140
-
141
- if (docGroup.parent) {
142
- name = docGroup.parent.name;
143
-
144
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
145
- name = docGroup.parent.parent.name + ' | ' + name;
146
- }
147
- }
148
-
149
- if (typeof name !== 'undefined') {
150
- name = name + ' | <b>' + docGroup.name + '</b>';
151
- } else {
152
- // name = '<b>' + docGroup.name + '</b>'
153
- return null;
154
- }
155
-
156
- return name && typeof name != 'undefined' ? name : null;
157
- };
158
-
159
- var DocumentGroup = function DocumentGroup(_ref) {
160
- var article = _ref.article,
161
- client = _ref.client;
162
-
163
-
164
- var mediaSeriesGroup = null;
165
- var disableThumbnail = false;
166
-
167
- if (article.documentGroup && article.documentGroup.hideThumbnail === true) {
168
- disableThumbnail = true;
169
- }
170
-
171
- if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
172
- mediaSeriesGroup = article.documentGroup;
173
- }
174
- if (!article.documentGroup && article.documentGroupMapping) {
175
- for (var i = 0; i < article.documentGroupMapping.length; i++) {
176
- if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
177
- mediaSeriesGroup = article.documentGroupMapping[i];
178
- break;
179
- }
180
- }
181
- }
182
-
183
- if (!mediaSeriesGroup) {
184
- return null;
185
- }
186
-
187
- var name = getDocumentGroupName(mediaSeriesGroup);
188
- var url = getDocumentGroupUrl(mediaSeriesGroup);
189
- var thumbnailUrl = false;
190
-
191
- if (mediaSeriesGroup.thumbnail) {
192
- thumbnailUrl = urlFor({ client: client, source: mediaSeriesGroup.thumbnail });
193
- }
194
- var margin = article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'none' : '1rem';
195
- return React__default.createElement(
196
- 'div',
197
- null,
198
- React__default.createElement(
199
- 'p',
200
- { style: { textAlign: 'center', fontWeight: 600 } },
201
- article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
202
- ),
203
- url && name && React__default.createElement(
204
- 'a',
205
- {
206
- href: url,
207
- className: 'doc-group',
208
- style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
209
- thumbnailUrl && !disableThumbnail && React__default.createElement('img', { style: { maxWidth: '210px', maxHeight: '100px', marginTop: margin }, src: thumbnailUrl, alt: name }),
210
- (disableThumbnail || !thumbnailUrl) && React__default.createElement('p', {
211
- style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_43 ? 'left' : 'right', marginTop: '.25rem' },
212
- dangerouslySetInnerHTML: { __html: name } }),
213
- main_43 && !thumbnailUrl && React__default.createElement(
214
- 'style',
215
- { jsx: 'true' },
216
- '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
217
- )
218
- )
219
- );
220
- };
221
-
222
- var findIndex = function findIndex(arr) {
223
- var indexes = [];
224
- if ((typeof arr === 'undefined' ? 'undefined' : _typeof(arr)) === 'object') {
225
- var _iteratorNormalCompletion = true;
226
- var _didIteratorError = false;
227
- var _iteratorError = undefined;
228
-
229
- try {
230
- for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
231
- var ele = _step.value;
232
-
233
- if (ele['_type'] === 'block' && ele.children.some(function (child) {
234
- return child.text.trim().length > 0;
235
- }) && ele['listItem'] !== 'bullet' &&
236
- // To skip li tags when setting contextual native ads
237
- ele['listItem'] !== 'number' && ele['style'] === 'normal' || ele['_type'] === 'figure') {
238
- indexes.push(arr.indexOf(ele));
239
- }
240
- }
241
- } catch (err) {
242
- _didIteratorError = true;
243
- _iteratorError = err;
244
- } finally {
245
- try {
246
- if (!_iteratorNormalCompletion && _iterator.return) {
247
- _iterator.return();
248
- }
249
- } finally {
250
- if (_didIteratorError) {
251
- throw _iteratorError;
252
- }
253
- }
254
- }
255
- }
256
- return indexes;
257
- };
258
-
259
- var ISI = function ISI(props) {
260
- var children = props.children;
261
-
262
- var _useState = useState(false),
263
- _useState2 = _slicedToArray(_useState, 2),
264
- active = _useState2[0],
265
- setActive = _useState2[1];
266
-
267
- var _useState3 = useState(false),
268
- _useState4 = _slicedToArray(_useState3, 2),
269
- bottomOfArticle = _useState4[0],
270
- setbottomOfArticle = _useState4[1];
271
-
272
- var isi = useRef();
273
-
274
- useEffect(function () {
275
- if (active) {
276
- var offset = '5rem';
277
- var nav = document.getElementsByTagName('header');
278
- if (nav && nav.length > 0) {
279
- offset = nav[0].offsetHeight + 'px';
280
- }
281
- isi.current.style.maxHeight = 'calc(100% - ' + offset + ')';
282
- isi.current.style.overflowY = 'scroll';
283
- } else {
284
- isi.current.style.maxHeight = '';
285
- isi.current.style.overflowY = '';
286
- }
287
- }, [active]);
288
- useEffect(function () {
289
- var detectBottomOfArticle = function detectBottomOfArticle() {
290
- var article_body = document.getElementById('article__block');
291
- var isi = document.getElementById('isi');
292
- var articleBottomPosition = article_body.getBoundingClientRect().bottom - window.innerHeight;
293
- // console.log(articleBottomPosition, bottomOfArticle)
294
- if (articleBottomPosition < 30 && !isi.classList.contains('in-view')) {
295
- setbottomOfArticle(true);
296
- }
297
- if (articleBottomPosition > 60 && isi.classList.contains('in-view')) {
298
- setbottomOfArticle(false);
299
- }
300
- };
301
- window.addEventListener('scroll', detectBottomOfArticle);
302
- return function () {
303
- return window.removeEventListener('scroll', detectBottomOfArticle);
304
- };
305
- }, []);
306
-
307
- useEffect(function () {
308
- var isi = document.getElementById('isi');
309
- if (bottomOfArticle) {
310
- toggleSticky(true);
311
- isi.classList.add('in-view');
312
- if (active) {
313
- setActive(false);
314
- }
315
- }
316
- if (!bottomOfArticle) {
317
- toggleSticky(false);
318
- isi.classList.remove('in-view');
319
- }
320
- }, [bottomOfArticle]);
321
-
322
- var toggleSticky = function toggleSticky(sticky) {
323
- var isiToggle = document.getElementById('isiToggle');
324
- var isiContent = document.getElementById('isiContent');
325
- var isi = document.getElementById('isi');
326
- if (sticky) {
327
- isi.style.bottom = '-200px';
328
- setTimeout(function () {
329
- isi.style.maxHeight = 'unset';
330
- isi.style.position = 'relative';
331
- isi.style.boxShadow = 'none';
332
- isi.style.zIndex = '1';
333
- isi.style.marginTop = '-25rem';
334
- isi.style.marginBottom = '15rem';
335
- isiToggle.style.display = 'none';
336
- isiContent.style.padding = '0';
337
- }, 300);
338
- } else if (!sticky) {
339
-
340
- isi.style.marginBottom = '0';
341
- isi.style.maxHeight = '12rem';
342
- isi.style.position = 'fixed';
343
- isi.style.boxShadow = '0 0 1rem 0 rgba(0, 0, 0, 0.5)';
344
- isi.style.zIndex = '99999';
345
-
346
- isiToggle.style.display = 'block';
347
- isiContent.style.padding = '1rem';
348
- setTimeout(function () {
349
- isi.style.bottom = '0';
350
- isi.style.marginTop = '0';
351
- }, 300);
352
- }
353
- };
354
- return React__default.createElement(
355
- React__default.Fragment,
356
- null,
357
- React__default.createElement(
358
- 'div',
359
- { id: 'isi', ref: isi },
360
- React__default.createElement(
361
- 'div',
362
- { id: 'isiContent' },
363
- React__default.createElement(
364
- 'div',
365
- { onClick: function onClick() {
366
- return setActive(function (prev) {
367
- return !prev;
368
- });
369
- }, id: 'isiToggle' },
370
- active ? React__default.createElement(
371
- 'p',
372
- null,
373
- 'Close ',
374
- React__default.createElement(FaMinus, null)
375
- ) : React__default.createElement(
376
- 'p',
377
- null,
378
- 'See More ',
379
- React__default.createElement(FaPlus, null)
380
- )
381
- ),
382
- children
383
- )
384
- ),
385
- React__default.createElement(
386
- 'style',
387
- { jsx: true },
388
- '\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 12rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n width: 100%;\n box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.5);\n transition: bottom .5s ease , margin-top .3s, max-height .2s;\n }\n #isiContent {\n width: 100%;\n max-width: 1000px;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n padding: 1rem;\n font-size: 1rem;\n }\n #isi::-webkit-scrollbar {\n display: none;\n }\n #isiToggle {\n position: absolute;\n top: 0;\n right: 0;\n padding: 1rem;\n font-weight: bold;\n cursor: pointer;\n font-size: 1rem;\n }\n #isiToggle p {\n margin: 0;\n }\n '
389
- )
390
- );
391
- };
392
-
393
- var css$1 = ".RelatedArticles-module_mediaContainer__10h9k {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n margin: 0 -1rem;\n}\n.RelatedArticles-module_mediaCard__3wQbn {\n margin: 0 1rem 1rem;\n width: calc(33% - 1rem);\n display: column;\n flex-direction: row;\n margin-bottom: 0.75rem;\n padding-bottom: 0.75rem;\n border-bottom: none;\n}\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\n border-bottom: none;\n}\n.RelatedArticles-module_cardTitle__3P-Ib {\n font-weight: bold;\n color: #252525;\n margin-bottom: 0.25rem;\n font-size: 15px;\n}\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\n color: #000;\n font-weight: bold;\n}\n.RelatedArticles-module_cardDate__1wOR5 {\n color: var(--dark);\n display: block;\n background: #fff !important;\n margin-bottom: 0;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 {\n display: block;\n text-align: center;\n margin-bottom: 0.5rem;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\n height: 135px;\n width: 100%;\n object-fit: cover;\n object-position: center;\n}\n@media screen and (max-width: 1064px) {\n}\n@media screen and (max-width: 968px) {\n .RelatedArticles-module_mediaContainer__10h9k {\n flex-wrap: wrap;\n }\n .RelatedArticles-module_imgWrapper__5Jx_4 {\n display: none;\n }\n .RelatedArticles-module_mediaCard__3wQbn {\n width: 100%;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n .RelatedArticles-module_cardTitle__3P-Ib {\n font-size: 0.75rem;\n margin-bottom: 0;\n }\n}\n";
394
- var styles$1 = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
395
- styleInject(css$1);
396
-
397
- var RelatedArticle = function RelatedArticle(_ref) {
398
- var articles = _ref.articles,
399
- client = _ref.client,
400
- fallbackImage = _ref.fallbackImage,
401
- _ref$showRelatedArtic = _ref.showRelatedArticleFallbackImage,
402
- showRelatedArticleFallbackImage = _ref$showRelatedArtic === undefined ? true : _ref$showRelatedArtic;
403
-
404
- if (!articles || articles.length == 0 || !articles[0]) {
405
- return null;
406
- }
407
- return React__default.createElement(
408
- 'div',
409
- { className: styles$1.mediaContainer },
410
- articles.map(function (article, index) {
411
- if (article && article.url && article.url.current) {
412
- return React__default.createElement(
413
- 'div',
414
- { id: 'related-card', key: index, className: styles$1.mediaCard },
415
- React__default.createElement(
416
- 'a',
417
- { className: styles$1.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
418
- article.thumbnail ? React__default.createElement('img', {
419
- style: { objectFit: 'cover', objectPosition: 'center' },
420
- src: article.thumbnail && urlFor({ client: client, source: article.thumbnail.asset, imageWidth: 250 }),
421
- alt: article.title
422
- }) : React__default.createElement(
423
- React__default.Fragment,
424
- null,
425
- fallbackImage && showRelatedArticleFallbackImage && React__default.createElement('img', { src: fallbackImage, alt: 'website logo', style: { objectFit: 'contain' } })
426
- )
427
- ),
428
- React__default.createElement(
429
- 'div',
430
- { className: styles$1.mediaBody },
431
- React__default.createElement(
432
- 'a',
433
- { href: '/view/' + (article.url ? article.url.current : '') },
434
- React__default.createElement(
435
- 'div',
436
- { className: styles$1.cardTitle },
437
- article.title
438
- )
439
- )
440
- )
441
- );
442
- }
443
- })
444
- );
445
- };
446
-
447
- var getSocialShareDisableFlag = function getSocialShareDisableFlag(article) {
448
- //Need to check Taxonomy, DocumentGroup, and Authors for showSocialShare
449
- var showSocialShare = true;
450
- if (article.showSocialShare === true) {
451
- return showSocialShare;
452
- }
453
-
454
- if (article.showSocialShare === false) {
455
- showSocialShare = false;
456
- return showSocialShare;
457
- }
458
-
459
- if (article.content_placement && article.content_placement.length > 0) {
460
- //loop through each
461
- article.content_placement.forEach(function (category) {
462
- if (category.showSocialShare === false) {
463
- showSocialShare = false;
464
- }
465
- });
466
- }
467
- if (article.authorDetails && article.authorDetails.length > 0) {
468
- article.authorDetails.forEach(function (author) {
469
- if (author.showSocialShare === false) {
470
- showSocialShare = false;
471
- }
472
- });
473
- }
474
- if (article.documentGroup && article.documentGroup.length > 0) {
475
- article.documentGroup.forEach(function (docGroup) {
476
- if (docGroup.showSocialShare === false) {
477
- showSocialShare = false;
478
- }
479
- });
480
- }
481
- if (article.documentGroupMapping && article.documentGroupMapping.length > 0) {
482
- article.documentGroupMapping.forEach(function (docGroup) {
483
- if (docGroup.showSocialShare === false) {
484
- showSocialShare = false;
485
- }
486
- });
487
- }
488
-
489
- return showSocialShare;
490
- };
491
-
492
- var FileSaver_min = createCommonjsModule(function (module, exports) {
493
- (function(a,b){b();})(commonjsGlobal,function(){function b(a,b){return "undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c);},d.onerror=function(){console.error("could not download file");},d.send();}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send();}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"));}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b);}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal?commonjsGlobal:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href);},4E4),setTimeout(function(){e(j);},0));}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else {var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i);});}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null;},k.readAsDataURL(b);}else {var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m);},4E4);}});f.saveAs=g.saveAs=g,(module.exports=g);});
494
-
495
-
496
- });
497
-
498
- var css = ".RecommendedArticles-module_recommendTitle__2kUji {\n border-bottom: 2px solid var(--secondary-blue);\n font-size: 1.5rem;\n font-weight: bold;\n color: #0d335a;\n padding: 0.5rem;\n}\n.RecommendedArticles-module_recommendContainer__sZukI {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: 0 -0.5rem;\n}\n.RecommendedArticles-module_recommendTop__1_yqw {\n margin: 0.5rem;\n width: 100%;\n flex-basis: 100%;\n display: flex;\n\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu {\n min-width: 55%;\n width: 55%;\n height: 100%;\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.RecommendedArticles-module_recommendTopBody__-13FI {\n margin-left: 1rem;\n line-height: 1.3;\n color: #121212;\n display: flex;\n flex-direction: column;\n}\n.RecommendedArticles-module_topTitle__2EafN {\n font-size: 25px;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topBody__2_VNi {\n font-size: 19px;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topLink__2RnXu {\n font-size: 19px;\n color: rgb(43, 43, 151);\n text-decoration: underline;\n margin-top: auto;\n}\n.RecommendedArticles-module_smContainer__4byBO {\n width: calc(25% - 1rem);\n margin: 0 0.5rem;\n}\n.RecommendedArticles-module_smImage__TYZGY img {\n width: 100%;\n}\n.RecommendedArticles-module_title__3q1ud {\n margin-top: 1rem;\n line-height: 1.2;\n color: #121212;\n}\n.RecommendedArticles-module_category__2jRto {\n text-transform: uppercase;\n font-size: 16px;\n letter-spacing: 2px;\n margin: 0.25rem 0;\n}\n\n/* media query */\n\n@media screen and (max-width: 1399px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 21px;\n }\n .RecommendedArticles-module_topBody__2_VNi {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 1191px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 23px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 17px;\n }\n}\n@media screen and (max-width: 968px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 18px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 768px) {\n .RecommendedArticles-module_recommendTop__1_yqw {\n flex-direction: column;\n }\n .RecommendedArticles-module_recommendTopImg__1b9gu,\n .RecommendedArticles-module_recommendTopBody__-13FI {\n width: 100%;\n margin: 0;\n }\n .RecommendedArticles-module_recommendTopBody__-13FI {\n margin-bottom: 1rem;\n }\n .RecommendedArticles-module_smContainer__4byBO {\n width: calc(50% - 1rem);\n }\n}";
499
- var styles = { "recommendTitle": "RecommendedArticles-module_recommendTitle__2kUji", "recommendContainer": "RecommendedArticles-module_recommendContainer__sZukI", "recommendTop": "RecommendedArticles-module_recommendTop__1_yqw", "recommendTopImg": "RecommendedArticles-module_recommendTopImg__1b9gu", "recommendTopBody": "RecommendedArticles-module_recommendTopBody__-13FI", "topTitle": "RecommendedArticles-module_topTitle__2EafN", "topBody": "RecommendedArticles-module_topBody__2_VNi", "topLink": "RecommendedArticles-module_topLink__2RnXu", "smContainer": "RecommendedArticles-module_smContainer__4byBO", "smImage": "RecommendedArticles-module_smImage__TYZGY", "title": "RecommendedArticles-module_title__3q1ud", "category": "RecommendedArticles-module_category__2jRto" };
500
- styleInject(css);
501
-
502
- var _this$2 = undefined;
503
-
504
- var Recommended = function Recommended(props) {
505
- var article = props.article,
506
- client = props.client,
507
- _props$index = props.index,
508
- index = _props$index === undefined ? 0 : _props$index,
509
- cpModificationRequired = props.cpModificationRequired,
510
- emailList = props.emailList,
511
- articleRecsQuery = props.articleRecsQuery;
512
-
513
- var _useState = useState(false),
514
- _useState2 = _slicedToArray(_useState, 2),
515
- segmentLoaded = _useState2[0],
516
- setSegmentLoaded = _useState2[1];
517
-
518
- var _useState3 = useState([]),
519
- _useState4 = _slicedToArray(_useState3, 2),
520
- articles = _useState4[0],
521
- setArticles = _useState4[1];
522
-
523
- var _useState5 = useState('loading'),
524
- _useState6 = _slicedToArray(_useState5, 2),
525
- loaded = _useState6[0],
526
- setLoaded = _useState6[1]; // loading, loaded, failed
527
-
528
-
529
- var starting = index * 5;
530
- var emailTracked = useRef(false);
531
-
532
- var contentMapping = {
533
- videos: 'video',
534
- articles: 'article',
535
- podcasts: 'podcast'
536
- };
537
- var mainCategories = article.content_placement.filter(function (cp) {
538
- return cp.usedForRecommendations === true;
539
- }).map(function (cp) {
540
- return cp.name;
541
- }).sort();
542
-
543
- useEffect(function () {
544
- try {
545
- if (!segmentLoaded) {
546
- return;
547
- }
548
- if (mainCategories.length > 0) {
549
- analytics.track('Article Category Viewed', {
550
- 'categories.$': _JSON$stringify(mainCategories)
551
- });
552
- }
553
- var getSegmentProfile = function () {
554
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
555
- var anonymousId, traits, i, response, data, addTaxonomyName, favoriteCategories, articlesCategory, videosCategory, podcastCategory, taxonomyCategories, taxonomies, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts, recs;
556
-
557
- return regenerator.wrap(function _callee$(_context) {
558
- while (1) {
559
- switch (_context.prev = _context.next) {
560
- case 0:
561
- anonymousId = analytics.user().anonymousId();
562
- traits = analytics.user().traits();
563
- // console.log('anonymousId', anonymousId)
564
-
565
- if (!(traits && traits.email)) {
566
- _context.next = 11;
567
- break;
568
- }
569
-
570
- i = 0;
571
-
572
- case 4:
573
- if (!(i < emailList.length)) {
574
- _context.next = 11;
575
- break;
576
- }
577
-
578
- if (!(traits.email === emailList[i].email)) {
579
- _context.next = 8;
580
- break;
581
- }
582
-
583
- emailTracked.current = true;
584
- return _context.abrupt('break', 11);
585
-
586
- case 8:
587
- i++;
588
- _context.next = 4;
589
- break;
590
-
591
- case 11:
592
- _context.next = 13;
593
- return fetch('/api/getSegmentProfile?anonymousId=' + anonymousId, {
594
- method: 'GET'
595
- });
596
-
597
- case 13:
598
- response = _context.sent;
599
- _context.next = 16;
600
- return response.json();
601
-
602
- case 16:
603
- data = _context.sent;
604
-
605
- if (!(emailTracked.current || data && data.traits)) {
606
- _context.next = 54;
607
- break;
608
- }
609
-
610
- // console.log('%csegment user profile', 'font-size:1.5rem;color:#000000;padding:1rem;background-color:yellow;', data.traits)
611
- addTaxonomyName = function addTaxonomyName(taxArr) {
612
- if (!taxArr) return '';
613
- var query = ' && ( ';
614
- taxArr.forEach(function (item, index) {
615
- if (index === 0) {
616
- query = query + ('name == \'' + item + '\'');
617
- } else {
618
- query = query + (' || name == \'' + item + '\'');
619
- }
620
- });
621
-
622
- query = query + ' )';
623
-
624
- return query;
625
- };
626
-
627
- favoriteCategories = data.traits.most_frequent_article_category ? JSON.parse(data.traits.most_frequent_article_category) : null;
628
-
629
- // grab contentCategory ID
630
-
631
- _context.next = 22;
632
- return client.fetch("*[_type == 'contentCategory' && name == 'Articles'][0]{_id}");
633
-
634
- case 22:
635
- articlesCategory = _context.sent;
636
- _context.next = 25;
637
- return client.fetch("*[_type == 'contentCategory' && name == 'Videos'][0]{_id}");
638
-
639
- case 25:
640
- videosCategory = _context.sent;
641
- _context.next = 28;
642
- return client.fetch("*[_type == 'contentCategory' && name == 'Podcasts'][0]{_id}");
643
-
644
- case 28:
645
- podcastCategory = _context.sent;
646
- _context.next = 31;
647
- return client.fetch('*[_type == \'taxonomy\' ' + addTaxonomyName(favoriteCategories) + ']');
648
-
649
- case 31:
650
- taxonomyCategories = _context.sent;
651
- taxonomies = '';
652
-
653
- taxonomyCategories.forEach(function (taxonomy, index) {
654
- if (index === 0) {
655
- taxonomies = taxonomies + (' && ( references(\'' + taxonomy._id + '\')');
656
- } else {
657
- taxonomies = taxonomies + (' || references(\'' + taxonomy._id + '\')');
658
- }
659
- });
660
- taxonomies = taxonomies + ' )';
661
- // grab 3 articles from sanity different from the one currently being read
662
- articlesQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + articlesCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 5) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
663
- videosQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + videosCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 1) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
664
- podcastQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + podcastCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 2) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
665
- params = {
666
- id: article._id
667
- };
668
- _context.next = 41;
669
- return _Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params), client.fetch(articleRecsQuery)]);
670
-
671
- case 41:
672
- _ref2 = _context.sent;
673
- _ref3 = _slicedToArray(_ref2, 4);
674
- _articles = _ref3[0];
675
- videos = _ref3[1];
676
- podcasts = _ref3[2];
677
- recs = _ref3[3];
678
-
679
- if (_articles.length === 0) setLoaded('failed');
680
-
681
- if (!(emailTracked.current && recs)) {
682
- _context.next = 51;
683
- break;
684
- }
685
-
686
- setArticles(recs);
687
- return _context.abrupt('return');
688
-
689
- case 51:
690
- if (_articles && !emailTracked.current) {
691
- if (videos[0] && _articles[2]) {
692
- _articles[2] = videos[0];
693
- }
694
- if (videos[1] && _articles[4]) {
695
- _articles[4] = videos[1];
696
- }
697
- if (podcasts[0] && _articles[3]) {
698
- _articles[3] = podcasts[0];
699
- }
700
- setArticles(_articles);
701
- }
702
- _context.next = 55;
703
- break;
704
-
705
- case 54:
706
- setLoaded('failed');
707
-
708
- case 55:
709
- case 'end':
710
- return _context.stop();
711
- }
712
- }
713
- }, _callee, _this$2);
714
- }));
715
-
716
- return function getSegmentProfile() {
717
- return _ref.apply(this, arguments);
718
- };
719
- }();
720
- getSegmentProfile();
721
- } catch (err) {
722
- console.log(err);
723
- setLoaded('failed');
724
- }
725
- }, [segmentLoaded]);
726
-
727
- useEffect(function () {
728
- if (articles && articles.length > 0) {
729
- setLoaded('loaded');
730
- }
731
- }, [articles]);
732
-
733
- useEffect(function () {
734
- try {
735
- analytics.ready(function () {
736
- setSegmentLoaded(function () {
737
- return 'loaded';
738
- });
739
- });
740
- } catch (err) {
741
- console.log(err);
742
- setLoaded('failed');
743
- }
744
- }, []);
745
-
746
- return React__default.createElement(
747
- 'div',
748
- { id: 'recommended', style: { minHeight: '150px' } },
749
- loaded === 'loaded' && React__default.createElement(
750
- React__default.Fragment,
751
- null,
752
- React__default.createElement(
753
- 'h4',
754
- { className: styles.recommendTitle },
755
- 'Recommended For You'
756
- ),
757
- React__default.createElement(
758
- 'div',
759
- { className: styles.recommendContainer, id: 'recommendedContent' },
760
- articles.map(function (article, index) {
761
- if (index === 0) {
762
- return React__default.createElement(
763
- 'div',
764
- { key: article._id + ('-' + index), className: styles.recommendTop },
765
- React__default.createElement(
766
- 'div',
767
- { className: styles.recommendTopImg },
768
- React__default.createElement(
769
- 'a',
770
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
771
- React__default.createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 306, imageWidth: 544 }) })
772
- )
773
- ),
774
- React__default.createElement(
775
- 'div',
776
- { className: styles.recommendTopBody },
777
- React__default.createElement(
778
- 'div',
779
- { className: styles.topTitle },
780
- article.title
781
- ),
782
- React__default.createElement(
783
- 'p',
784
- { className: styles.topBody },
785
- article.summary
786
- ),
787
- React__default.createElement(
788
- 'a',
789
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit', className: styles.topLink },
790
- '>> ',
791
- 'Read Article'
792
- )
793
- )
794
- );
795
- } else {
796
- return React__default.createElement(
797
- 'div',
798
- { key: article._id + ('-' + index), className: styles.smContainer },
799
- React__default.createElement(
800
- 'div',
801
- { className: styles.category },
802
- contentMapping && contentMapping[article.contentCategory.name] && contentMapping[article.contentCategory.name.toLowerCase()] ? contentMapping[article.contentCategory.name.toLowerCase()] : article.contentCategory.name
803
- ),
804
- React__default.createElement(
805
- 'a',
806
- { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
807
- React__default.createElement(
808
- 'div',
809
- { className: styles.smImage },
810
- React__default.createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 270, imageWidth: 480 }) })
811
- ),
812
- React__default.createElement(
813
- 'div',
814
- { className: styles.title },
815
- article.title
816
- )
817
- )
818
- );
819
- }
820
- })
821
- )
822
- ),
823
- loaded === 'failed' && React__default.createElement(
824
- 'section',
825
- { id: 'related-content-section', className: 'my-1' },
826
- (article.relatedArticle || RelevantTopics({ article: article })) && React__default.createElement(
827
- 'p',
828
- { className: 'mb-0' },
829
- React__default.createElement(
830
- 'b',
831
- null,
832
- 'Related Content:'
833
- )
834
- ),
835
- React__default.createElement(RelevantTopics, { article: article, cpModificationRequired: cpModificationRequired, Settings: props.Settings }),
836
- React__default.createElement(
837
- 'div',
838
- { className: 'pt-2' },
839
- React__default.createElement(RelatedArticle, {
840
- articles: article.relatedArticle,
841
- client: client,
842
- fallbackImage: props.Settings.logo,
843
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
844
- })
845
- )
846
- )
847
- );
848
- };
849
-
850
- var RelevantTopics = function RelevantTopics(props) {
851
- var article = props.article,
852
- cpModificationRequired = props.cpModificationRequired;
853
- var content_placement = article.content_placement,
854
- documentGroupMapping = article.documentGroupMapping,
855
- issueGroup = article.issueGroup;
856
-
857
- if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
858
- var relatedLinks = [];
859
- if (documentGroupMapping && documentGroupMapping.length > 0) {
860
- documentGroupMapping.forEach(function (documentGroup) {
861
- if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
862
- return null;
863
- }
864
- if (documentGroup.parent) {
865
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{
866
- label: documentGroup.name,
867
- href: cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path
868
- }]);
869
- }
870
- });
871
- }
872
- if (content_placement && content_placement.length > 0) {
873
- content_placement.filter(function (item) {
874
- return item.path !== 'news';
875
- }).forEach(function (cp) {
876
- if (cp.excludeRelatedContents) {
877
- return null;
878
- }
879
- var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
880
- var href = '/' + cp_url;
881
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
882
- });
883
- }
884
- if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
885
- var _props$Settings$issue = props.Settings.issueMapping,
886
- issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
887
-
888
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
889
- }
890
- if (relatedLinks && relatedLinks.length > 0) {
891
- return React__default.createElement(
892
- 'div',
893
- null,
894
- relatedLinks.map(function (relatedLink, index) {
895
- if (relatedLink && relatedLink.href && relatedLink.label) {
896
- return React__default.createElement(
897
- 'span',
898
- { key: relatedLink.label, className: 'related-link' },
899
- React__default.createElement(
900
- 'a',
901
- { className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
902
- relatedLink.label
903
- ),
904
- React__default.createElement(
905
- 'style',
906
- { jsx: 'true' },
907
- '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
908
- )
909
- );
910
- }
911
- })
912
- );
913
- }
914
- return null;
915
- }
916
- return null;
917
- };
918
-
919
- var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
920
-
921
- for (var i = 0; i < docGroupArray.length; i++) {
922
- if (docGroupArray[i].isSeries) {
923
- return docGroupArray[i];
924
- }
925
- }
926
-
927
- return false;
928
- };
929
-
930
- var Article = React__default.memo(forwardRef(function (props, ref) {
931
- var onVote = function () {
932
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
933
- var response, result;
934
- return regenerator.wrap(function _callee$(_context) {
935
- while (1) {
936
- switch (_context.prev = _context.next) {
937
- case 0:
938
- _context.next = 2;
939
- return fetch('/api/polls/vote', {
940
- method: 'POST',
941
- headers: { 'Content-Type': 'application/json' },
942
- body: _JSON$stringify({ articleId: props.article._id, nodeKey: nodeKey, selectedChoice: selectedChoice, body: articleBody })
943
- });
944
-
945
- case 2:
946
- response = _context.sent;
947
-
948
- if (!response.ok) {
949
- _context.next = 11;
950
- break;
951
- }
952
-
953
- _context.next = 6;
954
- return response.json();
955
-
956
- case 6:
957
- result = _context.sent;
958
-
959
- setArticleBody(result.body);
960
-
961
- console.log('Voted successfully');
962
- _context.next = 12;
963
- break;
964
-
965
- case 11:
966
- console.log('Unable to vote!');
967
-
968
- case 12:
969
- case 'end':
970
- return _context.stop();
971
- }
972
- }
973
- }, _callee, this);
974
- }));
975
-
976
- return function onVote(_x, _x2) {
977
- return _ref.apply(this, arguments);
978
- };
979
- }();
980
-
981
- var article = props.article,
982
- Ads = props.Ads,
983
- showRelatedArticles = props.showRelatedArticles,
984
- _props$hideFBShare = props.hideFBShare,
985
- hideFBShare = _props$hideFBShare === undefined ? false : _props$hideFBShare,
986
- _props$hidePinterestS = props.hidePinterestShare,
987
- hidePinterestShare = _props$hidePinterestS === undefined ? false : _props$hidePinterestS,
988
- onChangeArticle = props.onChangeArticle,
989
- _props$showSocialShar = props.showSocialShare,
990
- showSocialShare = _props$showSocialShar === undefined ? true : _props$showSocialShar;
991
- var client = props.client,
992
- pageview = props.pageview,
993
- videoAccountIDs = props.videoAccountIDs,
994
- drupalLeadSettings = props.drupalLeadSettings,
995
- currentPage = props.currentPage,
996
- _props$showAuthorDeta = props.showAuthorDetails,
997
- showAuthorDetails = _props$showAuthorDeta === undefined ? false : _props$showAuthorDeta,
998
- audioAutoplay = props.audioAutoplay,
999
- _props$article = props.article,
1000
- title = _props$article.title,
1001
- _props$article$passwo = _props$article.passwordLock,
1002
- passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
1003
- authorDetails = _props$article.authorDetails,
1004
- pageNumber = _props$article.pageNumber,
1005
- published = _props$article.published,
1006
- _props$article$showPu = _props$article.showPublished,
1007
- showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
1008
- body = _props$article.body,
1009
- thumbnail = _props$article.thumbnail,
1010
- content_placement = _props$article.content_placement,
1011
- _props$article$url = _props$article.url;
1012
- _props$article$url = _props$article$url === undefined ? {
1013
- current: ''
1014
- } : _props$article$url;
1015
- var url = _props$article$url.current,
1016
- issue = _props$article.issue,
1017
- source = _props$article.source,
1018
- documentGroupMapping = _props$article.documentGroupMapping,
1019
- issueGroup = _props$article.issueGroup,
1020
- showIsi = _props$article.showIsi,
1021
- isi = _props$article.isi,
1022
- _props$article$displa = _props$article.display_summary,
1023
- display_summary = _props$article$displa === undefined ? true : _props$article$displa,
1024
- regionalPages = props.regionalPages,
1025
- nationalPage = props.nationalPage,
1026
- ISIContent = props.ISIContent,
1027
- shareOptions = props.shareOptions,
1028
- cpModificationRequired = props.cpModificationRequired,
1029
- authorPrefix = props.authorPrefix,
1030
- _props$lgContextAd = props.lgContextAd,
1031
- lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
1032
- queueData = props.queueData,
1033
- _props$sponsoredFlag = props.sponsoredFlag,
1034
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
1035
- _props$authorImgHeigh = props.authorImgHeight,
1036
- authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
1037
- props.active;
1038
- var _props$refreshFlag = props.refreshFlag,
1039
- refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
1040
- disqusConfig = props.disqusConfig,
1041
- showDisqus = props.showDisqus,
1042
- _props$downloadCitati = props.downloadCitation,
1043
- downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati,
1044
- _props$useSegmentReco = props.useSegmentRecommendedArticles,
1045
- useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco,
1046
- showIssueNameOnly = props.showIssueNameOnly,
1047
- showPageNumber = props.showPageNumber,
1048
- emailList = props.emailList,
1049
- articleRecs = props.articleRecs;
1050
-
1051
-
1052
- var parentRisToggle = issueGroup && issueGroup.parent && issueGroup.parent.risMapping ? issueGroup.parent.risMapping.show_download_ris_button : null;
1053
- var issueGroupRisToggle = issueGroup && issueGroup.risMapping ? issueGroup.risMapping.show_download_ris_button : null;
1054
-
1055
- var sliderData = props.sliderData;
1056
-
1057
- var disableEpisodeNumber = false;
1058
- var articleRecsQuery = '*[_type == \'article\' && url.current in ';
1059
-
1060
- if (article && article.documentGroup && article.documentGroup.disableEpisodeNumber === true) {
1061
- disableEpisodeNumber = true;
1062
- }
1063
- var logicforDisplayingEpisodeNumber = !disableEpisodeNumber;
1064
- var targeting = getTargeting(props);
1065
- // remove slider data if toggled
1066
- if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
1067
- sliderData = null;
1068
- }
1069
- // build query string for article recs, pass down as props
1070
- if (articleRecs) {
1071
- articleRecs.forEach(function (rec, ind) {
1072
- ind === 0 ? articleRecsQuery = articleRecsQuery.concat('[\'' + rec + '\', ') : ind === articleRecs.length - 1 ? articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\']]') : articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\', ');
1073
- });
1074
- }
1075
- // next video url
1076
- if (sliderData) {
1077
- var nextArticle = void 0;
1078
- sliderData.forEach(function (data, index) {
1079
- if (data.url.current === props.article.url.current) {
1080
- nextArticle = index + 1;
1081
- }
1082
- });
1083
-
1084
- if (nextArticle && sliderData[nextArticle]) {
1085
- article.nextVideo = sliderData[nextArticle].url.current;
1086
- }
1087
- }
1088
-
1089
- // if showSocialShare is not disabled for entire site, check article taxonomy, docgroup, authors for showSocialShare === false
1090
- if (showSocialShare) {
1091
- showSocialShare = getSocialShareDisableFlag(props.article);
1092
- }
1093
-
1094
- // If sponsored flag, disable contextual ads
1095
- if (sponsoredFlag || article.disableNativeAds) {
1096
- article.contextualVideoAD = false;
1097
- article.contextualAD = false;
1098
- }
1099
-
1100
- if (article.disableRelatedContent || sponsoredFlag) {
1101
- showRelatedArticles = false;
1102
- }
1103
- // This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
1104
- if (!sponsoredFlag && Ads.getVideoContextualAD) {
1105
- article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
1106
- }
1107
- if (!sponsoredFlag && Ads.getNativeContextualAD && !article.disableNativeAds) {
1108
- article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
1109
- }
1110
-
1111
- var _useState = useState(null),
1112
- _useState2 = _slicedToArray(_useState, 2),
1113
- contextualADFlag = _useState2[0],
1114
- setContextualADFlag = _useState2[1];
1115
- // Setting new Flag 'visibleFlag' to know when the article is visible so that new contextual ad can be appended into DOM.
1116
-
1117
-
1118
- var _useState3 = useState(false),
1119
- _useState4 = _slicedToArray(_useState3, 2),
1120
- visibleFlag = _useState4[0],
1121
- setVisibleFlag = _useState4[1];
1122
-
1123
- var summary = getArticleSummary(props.article);
1124
-
1125
- var _useState5 = useState(1),
1126
- _useState6 = _slicedToArray(_useState5, 2),
1127
- auth = _useState6[0],
1128
- setAuth = _useState6[1];
1129
-
1130
- var _useState7 = useState(''),
1131
- _useState8 = _slicedToArray(_useState7, 2),
1132
- passwordKey = _useState8[0],
1133
- setPasswordKey = _useState8[1];
1134
-
1135
- var _useState9 = useState(body),
1136
- _useState10 = _slicedToArray(_useState9, 2),
1137
- articleBody = _useState10[0],
1138
- setArticleBody = _useState10[1];
1139
-
1140
- var _useState11 = useState(0),
1141
- _useState12 = _slicedToArray(_useState11, 2),
1142
- containerHeight = _useState12[0],
1143
- setContainerHeight = _useState12[1];
1144
-
1145
- var _useState13 = useState(true),
1146
- _useState14 = _slicedToArray(_useState13, 2);
1147
- _useState14[0];
1148
- var setPreviewAd = _useState14[1];
1149
-
1150
- var _useState15 = useState(props.index === 0),
1151
- _useState16 = _slicedToArray(_useState15, 2),
1152
- isFirstArticle = _useState16[0],
1153
- setIsFirstArticle = _useState16[1];
1154
-
1155
- useEffect(function () {
1156
- var path = window && window.location && window.location.search;
1157
- // Setting flag for Ad-preview URLs
1158
- setPreviewAd(path.split('&').some(function (param) {
1159
- return param.includes('creativeId');
1160
- }));
1161
- setContainerHeight(window.innerHeight);
1162
- }, []);
1163
-
1164
- var isCutomPage = function isCutomPage(article) {
1165
- var url = article.url.current;
1166
-
1167
- if (regionalPages || nationalPage) {
1168
- return regionalPages.includes(url) || nationalPage === url;
1169
- } else {
1170
- return false;
1171
- }
1172
- };
1173
- var renderAuthorBiography = function renderAuthorBiography(biography) {
1174
- if (biography) {
1175
- return React__default.createElement(BlockContent, _extends({
1176
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
1177
- blocks: [biography]
1178
- }, client.config()));
1179
- }
1180
- };
1181
-
1182
- var getAbstract = function getAbstract() {
1183
- return article.abstract && article.abstract.map(function (block) {
1184
- if (block.children) {
1185
- return block.children.map(function (child) {
1186
- if (child._type === 'span') return child.text;
1187
- });
1188
- }
1189
- }).join(' ');
1190
- };
1191
-
1192
- var renderIsiContent = function renderIsiContent(article) {
1193
- var url = article.url.current;
1194
-
1195
- if (regionalPages && ISIContent && regionalPages.includes(url)) {
1196
- return React__default.createElement(ISIContent, null);
1197
- } else if (nationalPage === url && ISIContent) {
1198
- return React__default.createElement(ISIContent, { national: true });
1199
- }
1200
- return null;
1201
- };
1202
- var generateRIS = function generateRIS() {
1203
- var fileContent = 'TY - JOUR\n';
1204
- if (issue) {
1205
- if (article.title) {
1206
- fileContent += 'TI - ' + article.title + '\n'; // Title - TI
1207
- fileContent += 'T1 - ' + article.title + '\n'; // Title - T1
1208
- }
1209
- if (authorDetails && authorDetails.length) {
1210
- authorDetails.map(function (authorDetail, index) {
1211
- return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
1212
- } // Author
1213
- );
1214
- }
1215
- if (issue.publication && issue.publication.name) {
1216
- fileContent += 'T2 - ' + issue.publication.name + '\n'; // Secondary Title - T2
1217
- fileContent += 'JF - ' + issue.publication.name + '\n'; // Journal Name - JF
1218
- }
1219
- if (issue.name) {
1220
- fileContent += 'T3 - ' + issue.name + '\n'; // Issue Name - T3
1221
- }
1222
- if (issue.abbreviatedJournal) {
1223
- fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; // Journal Name - JO
1224
- }
1225
- if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; // Abstract - AB
1226
- if (article.abstract) fileContent += 'N2 - ' + getAbstract() + '\n'; // Abstract - N2
1227
- if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; // Issue Number - IS
1228
- fileContent += 'PB - MJH Life Sciences\n'; // Publisher - PB
1229
- if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; // Published Year - PY
1230
- if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; // Volume - VL
1231
- if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; // Link to PDF - L1
1232
- if (shareOptions && shareOptions.shareBaseUrl) {
1233
- fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Link to Full-text - L2
1234
- fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Doc URL - UR
1235
- }
1236
- if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; // Website Link - LK
1237
- if (issue.isbn_issn) {
1238
- fileContent += 'SN - ' + issue.isbn_issn + '\n'; // ISSN/ISBN - TI
1239
- }
1240
- if (pageNumber) {
1241
- if (pageNumber.includes('-')) {
1242
- fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; // Start Page - SP
1243
- fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; // End Page - EP
1244
- } else {
1245
- fileContent += 'SP - ' + pageNumber + '\n';
1246
- }
1247
- }
1248
- if (article.published) fileContent += 'Y1 - ' + moment(published).format('DD-MMMM-YYYY') + '\n'; // Primary Date - Y1
1249
- fileContent += 'Y2 - ' + moment().format('DD-MMMM-YYYY') + '\n'; // Access Date - Y2
1250
- }
1251
- fileContent += 'ER -\n'; // End of Record
1252
- return fileContent;
1253
- };
1254
- var getAuthorList = function getAuthorList() {
1255
- var authorList = '';
1256
- if (authorDetails && authorDetails.length > 0) {
1257
- authorDetails.map(function (author) {
1258
- if (author.lastName && author.firstName) authorList += author.lastName + ',' + author.firstName + ';';else if (author.displayName) authorList += author.displayName + ';';
1259
- });
1260
- }
1261
- return authorList;
1262
- };
1263
- var downloadRIS = function downloadRIS() {
1264
- var fileContent = generateRIS();
1265
- var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
1266
- FileSaver_min.saveAs(file, 'citation-' + url + '.ris');
1267
- };
1268
-
1269
- var RelevantTopics = function RelevantTopics() {
1270
- if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
1271
- var relatedLinks = [];
1272
- if (documentGroupMapping && documentGroupMapping.length > 0) {
1273
- documentGroupMapping.forEach(function (documentGroup) {
1274
- if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
1275
- return null;
1276
- }
1277
-
1278
- // let doc_url = cpModificationRequired
1279
- // ? getDocumentGroupUrl(documentGroup)
1280
- // : documentGroup.ancestor
1281
- // ? documentGroup.parent && !documentGroup.path.includes('/')
1282
- // ? `/${documentGroup.ancestor}/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.ancestor}/${documentGroup.path}` : documentGroup.parent
1283
- // ? !documentGroup.path.includes('/')
1284
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.path}` : `/${documentGroup.path}`
1285
-
1286
- var docUrl = '/' + documentGroup.path;
1287
-
1288
- if (cpModificationRequired) {
1289
- docUrl = getDocumentGroupUrl(documentGroup);
1290
- } else {
1291
- try {
1292
- if (documentGroup.ancestor) {
1293
- if (documentGroup.parent && documentGroup.path.findIndex('/') < 0) {
1294
- docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1295
- } else {
1296
- docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.path;
1297
- }
1298
- } else if (documentGroup.parent) {
1299
- if (documentGroup.path.findIndex('/') < 0) {
1300
- docUrl = '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1301
- } else {
1302
- docUrl = '/' + documentGroup.path;
1303
- }
1304
- }
1305
- } catch (e) {
1306
- console.log(e.message);
1307
- }
1308
- }
1309
-
1310
- var href = '' + docUrl;
1311
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: href }]);
1312
- // if (documentGroup.parent) {
1313
- // relatedLinks = [
1314
- // ...relatedLinks,
1315
- // {
1316
- // label: documentGroup.name,
1317
- // href: cpModificationRequired
1318
- // ? getDocumentGroupUrl(documentGroup)
1319
- // : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/')
1320
- // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}`
1321
- // : `/${documentGroup.path}`
1322
- // }
1323
- // ]
1324
- // }
1325
- });
1326
- }
1327
- if (content_placement && content_placement.length > 0) {
1328
- content_placement.filter(function (item) {
1329
- return item.path !== 'news';
1330
- }).forEach(function (cp) {
1331
- if (cp.excludeRelatedContents) {
1332
- return null;
1333
- }
1334
- var cp_url = '' + cp.path;
1335
- try {
1336
- cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && cp.path.indexOf('/') < 0 ? cp.ancestor + '/' + cp.parent + '/' + cp.path : !cp.path.indexOf(cp.ancestor) < 0 ? cp.ancestor + '/' + cp.path : '' + cp.path : cp.parent ? !cp.path.indexOf('/') < 0 ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1337
- } catch (e) {
1338
- console.log(e.message);
1339
- }
1340
- var href = '/' + cp_url;
1341
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
1342
- });
1343
- }
1344
-
1345
- if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
1346
- var _props$Settings$issue = props.Settings.issueMapping,
1347
- issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
1348
-
1349
- relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
1350
- }
1351
- if (relatedLinks && relatedLinks.length > 0) {
1352
- return React__default.createElement(
1353
- 'div',
1354
- null,
1355
- relatedLinks.map(function (relatedLink, index) {
1356
- if (relatedLink && relatedLink.href && relatedLink.label) {
1357
- if (relatedLink.href === 'null') return;
1358
- return React__default.createElement(
1359
- 'span',
1360
- { key: index, className: 'related-link' },
1361
- React__default.createElement(
1362
- 'a',
1363
- { className: 'related-links article', style: { color: 'blue' }, href: relatedLink.href },
1364
- relatedLink.label
1365
- ),
1366
- React__default.createElement(
1367
- 'style',
1368
- { jsx: 'true' },
1369
- '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
1370
- )
1371
- );
1372
- }
1373
- })
1374
- );
1375
- }
1376
- return null;
1377
- }
1378
- return null;
1379
- };
1380
-
1381
- var RelatedContent = React__default.memo(function () {
1382
- return React__default.createElement(
1383
- 'div',
1384
- null,
1385
- useSegmentRecommendedArticles ? React__default.createElement(Recommended, {
1386
- client: client,
1387
- article: article,
1388
- index: props.index,
1389
- Settings: props.Settings,
1390
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage,
1391
- cpModificationRequired: cpModificationRequired,
1392
- emailList: emailList,
1393
- articleRecsQuery: articleRecsQuery
1394
- }) : React__default.createElement(
1395
- 'section',
1396
- { id: 'related-content-section', className: 'my-1' },
1397
- (article.relatedArticle || RelevantTopics()) && React__default.createElement(
1398
- 'p',
1399
- { className: 'mb-0' },
1400
- React__default.createElement(
1401
- 'b',
1402
- null,
1403
- 'Related Content:'
1404
- )
1405
- ),
1406
- React__default.createElement(RelevantTopics, null),
1407
- React__default.createElement(
1408
- 'div',
1409
- { className: 'pt-2' },
1410
- React__default.createElement(RelatedArticle, {
1411
- articles: article.relatedArticle,
1412
- client: client,
1413
- fallbackImage: props.Settings.logo,
1414
- showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
1415
- })
1416
- )
1417
- )
1418
- );
1419
- });
1420
-
1421
- var form = function form() {
1422
- return React__default.createElement(
1423
- React__default.Fragment,
1424
- null,
1425
- React__default.createElement(
1426
- Head,
1427
- null,
1428
- React__default.createElement('meta', { name: 'googlebot', content: 'noindex' })
1429
- ),
1430
- React__default.createElement(
1431
- 'div',
1432
- { className: 'mt-5', style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
1433
- React__default.createElement(
1434
- Form,
1435
- {
1436
- inline: true,
1437
- onSubmit: function onSubmit(e) {
1438
- e.preventDefault();
1439
- } },
1440
- React__default.createElement(FormControl, { type: 'text', className: 'mr-sm-2', value: passwordKey, onChange: function onChange(e) {
1441
- return setPasswordKey(e.target.value);
1442
- }, placeholder: 'Password' }),
1443
- React__default.createElement(
1444
- Button,
1445
- {
1446
- variant: 'primary',
1447
- onClick: function onClick() {
1448
- if (passwordKey === props.article.password) {
1449
- setAuth(2);
1450
- } else {
1451
- alert('Incorrect Password');
1452
- }
1453
- } },
1454
- 'Submit'
1455
- )
1456
- )
1457
- )
1458
- );
1459
- };
1460
-
1461
- var renderBlockContent = function renderBlockContent(payload, meta, authorImgHeight) {
1462
- var _payload = payload,
1463
- body = _payload.body;
1464
-
1465
- var indexes = findIndex(body);
1466
- var seriesInfo = checkIfMediaSeriesHasVideo(article);
1467
- var isMediaSeries = false;
1468
- if (article.documentGroup && article.documentGroup.isSeries) {
1469
- isMediaSeries = true;
1470
- } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1471
- isMediaSeries = true;
1472
- }
1473
-
1474
- if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
1475
- payload = _extends({}, payload, {
1476
- contextualAD: _extends({}, payload.contextualAD, {
1477
- slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id
1478
- }),
1479
- contextualVideoAD: _extends({}, payload.contextualVideoAD, {
1480
- slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1481
- })
1482
- });
1483
- var selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1484
- if (seriesInfo.hasVideo) {
1485
- selectedIndex = seriesInfo.videoIndex;
1486
- }
1487
-
1488
- var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
1489
- if (!isFound) {
1490
- var parent = document.getElementById('contextual-video-ad-' + payload._id);
1491
- parent.style.height = '0%';
1492
- parent.style.width = '0%';
1493
- parent.style.display = 'none';
1494
- setContextualADFlag(false);
1495
- } else {
1496
- setContextualADFlag(true);
1497
- }
1498
- };
1499
- return React__default.createElement(
1500
- React__default.Fragment,
1501
- null,
1502
- React__default.createElement(BlockContent, _extends({
1503
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1504
- blocks: [].concat(_toConsumableArray(articleBody.slice(0, selectedIndex))),
1505
- imageOptions: { w: 320, h: 240, fit: 'max' }
1506
- }, client.config())),
1507
- React__default.createElement('span', { className: 'clearfix' }),
1508
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1509
- React__default.createElement(
1510
- 'div',
1511
- { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1512
- React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1513
- ),
1514
- React__default.createElement(
1515
- 'style',
1516
- { jsx: 'true' },
1517
- '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1518
- ),
1519
- React__default.createElement('span', { className: 'clearfix' }),
1520
- React__default.createElement(
1521
- 'div',
1522
- { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1523
- React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsVideoAdFound }))
1524
- ),
1525
- React__default.createElement(BlockContent, _extends({
1526
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1527
- blocks: [].concat(_toConsumableArray(articleBody.slice(selectedIndex))),
1528
- imageOptions: { w: 320, h: 240, fit: 'max' }
1529
- }, client.config()))
1530
- );
1531
- } else if (indexes.length >= 2 && body.length >= 3 && payload.contextualAD && !payload.contextualVideoAD) {
1532
- payload = _extends({}, payload, {
1533
- contextualAD: _extends({}, payload.contextualAD, {
1534
- slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id,
1535
- className: 'ADFluid',
1536
- // Fetching new contextual targeting based on the current active article.
1537
- targeting: getTargeting(props, 'native-ad'),
1538
- // Adding new ad size for large contextual ad for desktop screen width >= 1400
1539
- sizes: lgContextAd ? [[728, 90], 'fluid', [300, 100]] : ['fluid', [300, 100]],
1540
- sizeMapping: lgContextAd ? [{
1541
- viewport: [1400, 0],
1542
- sizes: [[728, 90], 'fluid', [300, 100]]
1543
- }, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : [{ viewport: [0, 0], sizes: ['fluid', [300, 100]] }]
1544
- })
1545
- });
1546
- var _selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1547
- if (seriesInfo.hasVideo) {
1548
- _selectedIndex = seriesInfo.videoIndex;
1549
- }
1550
- return React__default.createElement(
1551
- React__default.Fragment,
1552
- null,
1553
- React__default.createElement(BlockContent, _extends({
1554
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1555
- blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex))),
1556
- imageOptions: { w: 320, h: 240, fit: 'max' }
1557
- }, client.config())),
1558
- contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
1559
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1560
- (visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
1561
- React__default.Fragment,
1562
- null,
1563
- React__default.createElement(
1564
- 'div',
1565
- { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1566
- React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1567
- ),
1568
- React__default.createElement(
1569
- 'style',
1570
- { jsx: 'true' },
1571
- '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1572
- )
1573
- ),
1574
- contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
1575
- React__default.createElement(BlockContent, _extends({
1576
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1577
- blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex))),
1578
- imageOptions: { w: 320, h: 240, fit: 'max' }
1579
- }, client.config()))
1580
- );
1581
- } else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
1582
- payload = _extends({}, payload, {
1583
- contextualVideoAD: _extends({}, payload.contextualVideoAD, {
1584
- slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1585
- })
1586
- });
1587
- var _selectedIndex2 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1588
- if (seriesInfo.hasVideo) {
1589
- _selectedIndex2 = seriesInfo.videoIndex;
1590
- }
1591
- var checkIsAdFound = function checkIsAdFound(isFound) {
1592
- if (!isFound) {
1593
- var parent = document.getElementById('contextual-video-ad-' + payload._id);
1594
- parent.style.height = '0%';
1595
- parent.style.width = '0%';
1596
- parent.style.display = 'none';
1597
- setContextualADFlag(false);
1598
- } else {
1599
- if (body && body[1] && body[1]._type === 'figure') {
1600
- setContextualADFlag(true);
1601
- }
1602
- }
1603
- };
1604
-
1605
- return React__default.createElement(
1606
- React__default.Fragment,
1607
- null,
1608
- React__default.createElement(BlockContent, _extends({
1609
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1610
- blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex2))),
1611
- imageOptions: { w: 320, h: 240, fit: 'max' }
1612
- }, client.config())),
1613
- React__default.createElement('span', { className: 'clearfix' }),
1614
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1615
- React__default.createElement(
1616
- 'div',
1617
- { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1618
- React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsAdFound }))
1619
- ),
1620
- React__default.createElement(BlockContent, _extends({
1621
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1622
- blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex2))),
1623
- imageOptions: { w: 320, h: 240, fit: 'max' }
1624
- }, client.config()))
1625
- );
1626
- } else {
1627
- var _selectedIndex3 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1628
- if (seriesInfo.hasVideo) {
1629
- _selectedIndex3 = seriesInfo.videoIndex;
1630
- }
1631
-
1632
- return React__default.createElement(
1633
- 'div',
1634
- null,
1635
- React__default.createElement(BlockContent, _extends({
1636
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, false, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1637
- blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
1638
- imageOptions: { w: 320, h: 240, fit: 'max' }
1639
- }, client.config())),
1640
- isMediaSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1641
- article.documentGroup && article.documentGroup.isSeries && React__default.createElement(BlockContent, _extends({
1642
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1643
- blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex3))),
1644
- imageOptions: { w: 320, h: 240, fit: 'max' }
1645
- }, client.config()))
1646
- );
1647
- }
1648
- };
1649
-
1650
- var checkIfVideoSeries = function checkIfVideoSeries(article) {
1651
- if (!article || !article.body) {
1652
- return false;
1653
- }
1654
-
1655
- for (var i = 0; i < article.body.length; i++) {
1656
- var block = article.body[i];
1657
- if (block._type === 'youtubeGallery') {
1658
- return true;
1659
- }
1660
- }
1661
-
1662
- return false;
1663
- };
1664
- var checkIfFormAssembly = function checkIfFormAssembly(article) {
1665
- if (!article || !article.body) {
1666
- return false;
1667
- }
1668
-
1669
- for (var i = 0; i < article.body.length; i++) {
1670
- var block = article.body[i];
1671
- if (block._type === 'formassembly') {
1672
- return true;
1673
- }
1674
- }
1675
- return false;
1676
- };
1677
- var checkIfMediaSeriesHasVideo = function checkIfMediaSeriesHasVideo(article) {
1678
- var seriesInfo = { hasVideo: false, videoIndex: 0 };
1679
- if (!article || !article.body) {
1680
- return false;
1681
- }
1682
-
1683
- for (var i = 0; i < article.body.length; i++) {
1684
- var block = article.body[i];
1685
- if (block._type == 'video' || block._type == 'youtube' || block._type == 'audio') {
1686
- seriesInfo.hasVideo = true;
1687
- seriesInfo.videoIndex = i + 1;
1688
- }
1689
- }
1690
-
1691
- return seriesInfo;
1692
- };
1693
-
1694
- var detail = function detail() {
1695
- var shareVia = shareOptions.shareVia,
1696
- shareSubject = shareOptions.shareSubject,
1697
- twitterSiteName = shareOptions.twitterSiteName,
1698
- shareImageDefault = shareOptions.shareImageDefault,
1699
- shareBaseUrl = shareOptions.shareBaseUrl;
1700
- shareOptions.shareSiteTitle;
1701
-
1702
- var shareUrl = shareBaseUrl + props.article.url.current;
1703
- var shareTitle = article.title;
1704
- var shareSummary = article.summary;
1705
- var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1706
- var siteName = props.Website && props.Website.title ? props.Website.title : '';
1707
- var shareKeywords = getKeywords(props.article).join(',');
1708
-
1709
- var meta = {
1710
- shareTitle: shareTitle,
1711
- shareSiteName: props.cache.siteSettingCache.name,
1712
- shareSummary: shareSummary,
1713
- shareUrl: shareUrl,
1714
- shareImage: shareImage,
1715
- shareVia: props.Settings.title,
1716
- shareKeywords: shareKeywords
1717
- };
1718
- if (!props.infiniteScroll) {
1719
- onChangeArticle = function onChangeArticle() {
1720
- return null;
1721
- };
1722
- }
1723
- var fetchCurrentEpisode = function fetchCurrentEpisode(sliderData, article) {
1724
- if (!sliderData) return null;
1725
- var episode = null;
1726
- sliderData.forEach(function (seriesArticle, index) {
1727
- if (seriesArticle.title === article.title) {
1728
- episode = index + 1;
1729
- }
1730
- });
1731
- return episode;
1732
- };
1733
- // pixels from bottom of window to change trigger visibility change
1734
- var triggerOffset = 20;
1735
- var isVideoSeries = checkIfVideoSeries(article);
1736
- var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
1737
- var isMediaSeries = false;
1738
- var mediaSeriesName = '';
1739
- var seriesInfo = checkIfMediaSeriesHasVideo(article);
1740
- var isFormAssembly = checkIfFormAssembly(article);
1741
-
1742
- if (article.documentGroup && article.documentGroup.isSeries) {
1743
- isMediaSeries = true;
1744
- mediaSeriesName = article.documentGroup.name;
1745
- }
1746
- if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1747
- isMediaSeries = true;
1748
- mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1749
- }
1750
-
1751
- var baseUrl = client ? client.config().baseUrl : '';
1752
-
1753
- return React__default.createElement(
1754
- React__default.Fragment,
1755
- null,
1756
- React__default.createElement(
1757
- VisibilitySensor,
1758
- {
1759
- partialVisibility: true,
1760
- offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
1761
- onChange: function onChange(isVisible) {
1762
- if (isVisible && !isFirstArticle) {
1763
- var pageviewProperties = _extends({}, targeting, {
1764
- category: article && article.category ? article.category.name : ''
1765
- });
1766
- onChangeArticle(url, meta, pageviewProperties);
1767
- setVisibleFlag(function () {
1768
- return true;
1769
- });
1770
- }
1771
- if (isFirstArticle) {
1772
- setIsFirstArticle(false);
1773
- }
1774
- } },
1775
- React__default.createElement(
1776
- 'div',
1777
- { id: 'article__block', style: { position: 'relative' }, ref: ref },
1778
- React__default.createElement(PixelTrackingArticle, { article: article, infiniteScroll: props.infiniteScroll }),
1779
- React__default.createElement(
1780
- 'div',
1781
- { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) || showIsi && Array.isArray(isi) && isi.length > 0 ? '15rem' : 0 } },
1782
- issue && React__default.createElement(
1783
- Head,
1784
- null,
1785
- article.title && React__default.createElement('meta', { name: 'citation_title', content: article.title }),
1786
- published && React__default.createElement('meta', { name: 'citation_date', content: moment(published).format('LL') }),
1787
- issue.publication && issue.publication.name && React__default.createElement('meta', { name: 'citation_journal_title', content: issue.publication.name }),
1788
- issue.year && React__default.createElement('meta', { name: 'citation_year', content: issue.year }),
1789
- issue.volume && React__default.createElement('meta', { name: 'citation_volume', content: issue.volume }),
1790
- issue.issueNumber && React__default.createElement('meta', { name: 'citation_issue', content: issue.issueNumber }),
1791
- article.pageNumber && React__default.createElement('meta', { name: 'citation_firstpage', content: article.pageNumber }),
1792
- article.pageNumber && React__default.createElement('meta', { name: 'citation_lastpage', content: article.pageNumber }),
1793
- issue.name && React__default.createElement('meta', { name: 'citation_series_title', content: issue.name }),
1794
- issue.isbn_issn && React__default.createElement('meta', { name: 'citation_isbn', content: issue.isbn_issn }),
1795
- article.abstract && React__default.createElement('meta', { name: 'citation_abstract', content: getAbstract() }),
1796
- React__default.createElement('meta', { name: 'citation_author', content: getAuthorList() }),
1797
- React__default.createElement('meta', { name: 'citation_publisher', content: 'MJH Life Sciences' }),
1798
- issue.pdf && React__default.createElement('meta', { name: 'citation_pdf_url', content: urlForFile({ asset: issue.pdf }, baseUrl) })
1799
- ),
1800
- isVideoSeries && renderBlockContent(article, meta, authorImgHeight),
1801
- !isVideoSeries && React__default.createElement(
1802
- 'div',
1803
- null,
1804
- isMediaSeries && React__default.createElement(
1805
- 'p',
1806
- { style: { fontSize: '14px' } },
1807
- disableEpisodeNumber ? '' + mediaSeriesName : mediaSeriesName + ' - Episode ' + episodeNumber
1808
- ),
1809
- React__default.createElement(
1810
- 'h1',
1811
- { className: 'page-title', style: { fontSize: '1.9rem' } },
1812
- title
1813
- )
1814
- ),
1815
- React__default.createElement(
1816
- 'div',
1817
- {
1818
- className: 'mb-3 doc-group-container',
1819
- style: {
1820
- display: 'flex',
1821
- justifyContent: 'space-between',
1822
- alignItems: article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'flex-start' : 'flex-end',
1823
- margin: '0, 0, 1rem, 0'
1824
- // margin: article.documentGroup && article.documentGroup.thumbnail && article.documentGroup.thumbnail.caption ? '1rem 0 1rem 0' : '0 0 1rem 0'
1825
- } },
1826
- React__default.createElement(
1827
- 'style',
1828
- { jsx: 'true' },
1829
- '\n .social-ris-container {\n display: flex;\n justify-content: space-between;\n }\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 .social-ris-container {\n flex-direction: column;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n .left-wrap {\n width: 100%;\n }\n '
1830
- ),
1831
- React__default.createElement(
1832
- 'div',
1833
- { className: 'left-wrap' },
1834
- !isVideoSeries && !isFormAssembly && showPublished && React__default.createElement(
1835
- 'div',
1836
- null,
1837
- 'Published on:',
1838
- '\xA0',
1839
- React__default.createElement(
1840
- 'time',
1841
- {
1842
- className: 'meta-date',
1843
- dateTime: moment(published).utc().format(moment.HTML5_FMT.DATETIME_LOCAL_MS) },
1844
- moment(published).format('LL')
1845
- )
1846
- )
1847
- /* Show Published date */
1848
- ,
1849
- React__default.createElement(
1850
- 'div',
1851
- { className: 'mb-3' },
1852
- !isVideoSeries && authorDetails && authorDetails.map(function (authorDetail, index) {
1853
- return React__default.createElement(
1854
- 'span',
1855
- { key: index },
1856
- renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor({ client: props.client, source: authorDetail.profileImage, imageHeight: authorImgHeight }), showAuthorDetails)
1857
- );
1858
- }),
1859
- React__default.createElement(
1860
- 'div',
1861
- null,
1862
- source && React__default.createElement(
1863
- 'p',
1864
- {
1865
- style: {
1866
- display: 'inline-block',
1867
- padding: '0 .25rem',
1868
- color: 'var(--franchise-primary, #484848)',
1869
- borderRadius: '2px',
1870
- fontWeight: 'bold',
1871
- border: '2px solid var(--franchise-primary, #484848)'
1872
- },
1873
- className: 'source-label' },
1874
- source
1875
- )
1876
- ),
1877
- issue && React__default.createElement(
1878
- 'div',
1879
- { className: 'volume-issue' },
1880
- issue.publication && issue.publication.name && React__default.createElement(
1881
- 'span',
1882
- { className: 'mb-0-pub' },
1883
- React__default.createElement(
1884
- 'b',
1885
- null,
1886
- issue.publication.name
1887
- ),
1888
- ',',
1889
- ' '
1890
- ),
1891
- issue.name && showIssueNameOnly === undefined ? React__default.createElement(
1892
- 'span',
1893
- { className: 'mb-0' },
1894
- issue.name,
1895
- ', '
1896
- ) : issue.name && showIssueNameOnly === false ? React__default.createElement(
1897
- 'span',
1898
- { className: 'mb-0' },
1899
- issue.name,
1900
- ', '
1901
- ) : null,
1902
- issue.volume && React__default.createElement(
1903
- 'span',
1904
- null,
1905
- 'Volume ' + issue.volume,
1906
- ', '
1907
- ),
1908
- issue.issueNumber && React__default.createElement(
1909
- 'span',
1910
- null,
1911
- ' Issue ' + issue.issueNumber
1912
- )
1913
- ),
1914
- pageNumber && showPageNumber ? React__default.createElement(
1915
- 'div',
1916
- { className: 'article-pageNumber' },
1917
- 'Pages: ' + pageNumber
1918
- ) : pageNumber && showPageNumber === undefined ? React__default.createElement(
1919
- 'div',
1920
- { className: 'article-pageNumber' },
1921
- 'Pages: ' + pageNumber
1922
- ) : null,
1923
- props.article.doiLink && React__default.createElement(
1924
- 'div',
1925
- null,
1926
- React__default.createElement(
1927
- 'a',
1928
- { href: props.article.doiLink },
1929
- props.article.doiLink
1930
- )
1931
- )
1932
- ),
1933
- React__default.createElement(
1934
- 'div',
1935
- { className: 'social-ris-container' },
1936
- !isVideoSeries && showSocialShare && React__default.createElement(
1937
- 'p',
1938
- null,
1939
- React__default.createElement(SocialShare, {
1940
- shareUrl: shareUrl,
1941
- shareTitle: shareTitle,
1942
- shareVia: shareVia,
1943
- shareSummary: shareSummary,
1944
- shareSubject: shareSubject,
1945
- shareImage: shareImage,
1946
- size: 32,
1947
- siteName: siteName,
1948
- twitterSiteName: twitterSiteName,
1949
- disableMeta: true,
1950
- hidePinterest: hidePinterestShare,
1951
- hideFacebook: hideFBShare
1952
- })
1953
- ),
1954
- downloadCitation && (parentRisToggle || issueGroupRisToggle) ? React__default.createElement(
1955
- Button,
1956
- { className: 'ris-download-button', onClick: function onClick() {
1957
- return downloadRIS();
1958
- } },
1959
- 'Download RIS'
1960
- ) : null
1961
- )
1962
- ),
1963
- React__default.createElement(
1964
- 'div',
1965
- null,
1966
- React__default.createElement(DocumentGroup, { article: props.article, client: props.client })
1967
- )
1968
- ),
1969
- !isVideoSeries && summary && display_summary && React__default.createElement(
1970
- 'p',
1971
- null,
1972
- React__default.createElement(
1973
- 'em',
1974
- null,
1975
- summary
1976
- )
1977
- ),
1978
- React__default.createElement(
1979
- 'div',
1980
- { className: 'ad-box', style: { textAlign: 'center' } },
1981
- main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
1982
- if (index === 0) {
1983
- return React__default.createElement(
1984
- 'div',
1985
- {
1986
- key: index,
1987
- id: 'addid-' + index,
1988
- style: {
1989
- display: 'flex',
1990
- flex: '1 0 auto',
1991
- justifyContent: 'center',
1992
- alignItems: 'center',
1993
- textAlign: 'center'
1994
- } },
1995
- ad.component
1996
- );
1997
- }
1998
- })
1999
- ),
2000
- React__default.createElement(
2001
- 'div',
2002
- { className: 'block-content mt-3' },
2003
- !isVideoSeries && renderBlockContent(article, meta),
2004
- React__default.createElement('div', { className: 'clearfix' }),
2005
- React__default.createElement(
2006
- 'noscript',
2007
- null,
2008
- React__default.createElement(
2009
- 'div',
2010
- { style: { display: 'flex', justifyContent: 'center' }, className: 'series-links' },
2011
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement(
2012
- 'a',
2013
- { className: 'mx-3', href: props.article.seriesDetail.prevUrl },
2014
- 'Previous ',
2015
- props.article.seriesDetail.type
2016
- ),
2017
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement(
2018
- 'a',
2019
- { className: 'mx-3', href: props.article.seriesDetail.nextUrl },
2020
- 'Next ',
2021
- props.article.seriesDetail.type
2022
- )
2023
- )
2024
- ),
2025
- React__default.createElement(
2026
- 'div',
2027
- { className: 'downloads-container' },
2028
- issue && issue.pdf && React__default.createElement(
2029
- 'a',
2030
- { rel: 'noopener', href: urlForFile({ asset: issue.pdf }, baseUrl), target: '_blank', title: 'Download issue' },
2031
- React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
2032
- article && article.pdfUrl && article.pdfUrl.hasOwnProperty('caption') && article.pdfUrl.caption,
2033
- article && article.pdfUrl && !article.pdfUrl.caption && 'Download Issue: ' + issue.name,
2034
- article && !article.pdfUrl && 'Download Issue: ' + issue.name
2035
- )
2036
- )
2037
- ),
2038
- React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
2039
- article.documentGroup && article.documentGroup.isSeries && sliderData && !seriesInfo.hasVideo && React__default.createElement(
2040
- 'div',
2041
- null,
2042
- false ,
2043
- React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber })
2044
- ),
2045
- showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null),
2046
- disqusConfig && showDisqus && React__default.createElement(
2047
- 'div',
2048
- { id: 'disqusContainer' },
2049
- React__default.createElement(DiscussionEmbed, {
2050
- shortname: disqusConfig.shortname,
2051
- config: {
2052
- url: disqusConfig.url,
2053
- identifier: disqusConfig.identifier,
2054
- title: disqusConfig.title
2055
- }
2056
- })
2057
- )
2058
- ),
2059
- renderIsiContent(props.article)
2060
- )
2061
- ),
2062
- showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
2063
- ISI,
2064
- null,
2065
- React__default.createElement(BlockContent, {
2066
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, article.Ads, targeting),
2067
- blocks: isi
2068
- })
2069
- ),
2070
- main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
2071
- if (index > 0) {
2072
- return React__default.createElement(
2073
- 'div',
2074
- { key: index, id: 'addid-' + index },
2075
- ad.component
2076
- );
2077
- }
2078
- }),
2079
- React__default.createElement(
2080
- 'noscript',
2081
- null,
2082
- props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default.createElement(
2083
- 'div',
2084
- { style: { textAlign: 'center' } },
2085
- React__default.createElement(
2086
- 'a',
2087
- { href: '/view/' + props.article.relatedArticle[0].url.current },
2088
- 'Related Article ',
2089
- '>>>'
2090
- )
2091
- )
2092
- ),
2093
- props.infiniteScroll && React__default.createElement('hr', { className: 'article-seperater mb-5 mt-3' }),
2094
- React__default.createElement(Schema, { article: props.article, Website: props.Website, client: props.client })
2095
- );
2096
- };
2097
-
2098
- if (passwordLock) {
2099
- if (auth === 2) {
2100
- return detail();
2101
- } else {
2102
- return form();
2103
- }
2104
- } else {
2105
- return detail();
2106
- }
2107
- }), function (prevProps, nextProps) {
2108
- if (prevProps.article._id === nextProps.article._id) return true;
2109
- return false;
2110
- });
2111
-
2112
- var _this$1 = undefined;
2113
-
2114
- var ArticleQueue = function ArticleQueue(props) {
2115
- var router = useRouter();
2116
-
2117
- var _props$prevUrl = props.prevUrl,
2118
- prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
2119
- Ads = props.Ads,
2120
- _props$maxListLength = props.maxListLength,
2121
- maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength;
2122
- props.sponsoredTaxonomies;
2123
- var _props$cpModification = props.cpModificationRequired,
2124
- cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
2125
- _props$authorPrefix = props.authorPrefix,
2126
- authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
2127
- showRelatedArticles = props.showRelatedArticles,
2128
- canonicalTag = props.canonicalTag,
2129
- _props$disablePrevUrl = props.disablePrevUrlCheckContentPlacement,
2130
- disablePrevUrlCheckContentPlacement = _props$disablePrevUrl === undefined ? false : _props$disablePrevUrl;
2131
-
2132
- var _useState = useState(0),
2133
- _useState2 = _slicedToArray(_useState, 2),
2134
- containerHeight = _useState2[0],
2135
- setContainerHeight = _useState2[1];
2136
-
2137
- useEffect(function () {
2138
- var checkFullScreen = function checkFullScreen() {
2139
- if (window.innerWidth == screen.width && window.innerHeight == screen.height) {
2140
- return true;
2141
- } else {
2142
- return false;
2143
- }
2144
- };
2145
- setContainerHeight(function () {
2146
- return window.innerHeight;
2147
- });
2148
- var handleResize = function handleResize() {
2149
- return !checkFullScreen() && setContainerHeight(function () {
2150
- return window.innerHeight;
2151
- });
2152
- };
2153
- window.addEventListener('resize', handleResize);
2154
- return function () {
2155
- return window.removeEventListener('resize', handleResize);
2156
- };
2157
- }, []);
2158
-
2159
- var firstArticle = function firstArticle() {
2160
- var article = _Object$assign({}, props.article);
2161
- var targeting = getTargeting(props);
2162
- article.Ads = Ads.getRightItems(targeting);
2163
- return article;
2164
- };
2165
-
2166
- var _useState3 = useState([firstArticle()]),
2167
- _useState4 = _slicedToArray(_useState3, 2),
2168
- queueData = _useState4[0],
2169
- setQueueData = _useState4[1];
2170
-
2171
- var _useState5 = useState(queueData[0]._id),
2172
- _useState6 = _slicedToArray(_useState5, 2),
2173
- active = _useState6[0],
2174
- setActive = _useState6[1];
2175
-
2176
- var refreshAD = function refreshAD(path) {
2177
- var activeArticle = queueData.find(function (item) {
2178
- return item.url.current === path;
2179
- });
2180
- var targeting = getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2181
- if (!main_43) {
2182
- lib_3.getGoogletag().then(function (googletag) {
2183
- if (window.googletag && googletag.pubadsReady) {
2184
- var slots = googletag.pubads().getSlots();
2185
- slots.forEach(function (slot) {
2186
- var pos = slot.getTargeting('pos');
2187
- slot.clearTargeting();
2188
- _Object$keys(targeting).forEach(function (key) {
2189
- slot.setTargeting(key, targeting[key]);
2190
- });
2191
- slot.setTargeting('pos', pos);
2192
- });
2193
- lib_3.refresh();
2194
- }
2195
- });
2196
- }
2197
- //Refresh leaderboard ad on mobile
2198
- if (main_43) {
2199
- var leaderboardSlotId = '';
2200
- lib_3.getGoogletag().then(function (googletag) {
2201
- if (window.googletag && googletag.pubadsReady) {
2202
- var slots = googletag.pubads().getSlots();
2203
- slots.forEach(function (slot) {
2204
- var pos = slot.getTargeting('pos');
2205
- if (pos == 'top-mobile') {
2206
- //gets the slotId of the leaderboard ad to refresh
2207
- leaderboardSlotId = slot.getSlotId().getDomId();
2208
- slot.clearTargeting();
2209
- _Object$keys(targeting).forEach(function (key) {
2210
- slot.setTargeting(key, targeting[key]);
2211
- });
2212
- slot.setTargeting('pos', pos);
2213
- }
2214
- });
2215
- lib_3.refresh(leaderboardSlotId);
2216
- }
2217
- });
2218
- }
2219
- };
2220
-
2221
- var hasVerticalScroll = function hasVerticalScroll() {
2222
- if (window.innerHeight) {
2223
- return document.body.offsetHeight > window.innerHeight;
2224
- } else {
2225
- return document.documentElement.scrollHeight > document.documentElement.offsetHeight || document.body.scrollHeight > document.body.offsetHeight;
2226
- }
2227
- };
2228
-
2229
- useEffect(function () {
2230
- // Fetching related article after component mounted if vertical scroll not found
2231
- setTimeout(function () {
2232
- if (!hasVerticalScroll()) {
2233
- loadmore();
2234
- }
2235
- }, 1000);
2236
- }, [queueData.length]);
2237
-
2238
- var loadmore = function () {
2239
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
2240
- var index, article, startingIndex, endingIndex, targeting;
2241
- return regenerator.wrap(function _callee$(_context) {
2242
- while (1) {
2243
- switch (_context.prev = _context.next) {
2244
- case 0:
2245
- if (!(queueData && queueData.length < maxListLength)) {
2246
- _context.next = 27;
2247
- break;
2248
- }
2249
-
2250
- index = queueData.length - 1;
2251
- article = null;
2252
- _context.prev = 3;
2253
- _context.next = 6;
2254
- return getRelatedArticle(null, props.client, props.article, prevUrl, index);
2255
-
2256
- case 6:
2257
- article = _context.sent;
2258
- _context.next = 12;
2259
- break;
2260
-
2261
- case 9:
2262
- _context.prev = 9;
2263
- _context.t0 = _context['catch'](3);
2264
-
2265
- console.error(_context.t0);
2266
-
2267
- case 12:
2268
- if (!(article && article._id)) {
2269
- _context.next = 27;
2270
- break;
2271
- }
2272
-
2273
- //query next 4 related article without repeating previous 4 related articles
2274
- startingIndex = queueData.length + 1;
2275
- endingIndex = startingIndex + 2;
2276
- _context.prev = 15;
2277
- _context.next = 18;
2278
- return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
2279
-
2280
- case 18:
2281
- article.relatedArticle = _context.sent;
2282
- _context.next = 24;
2283
- break;
2284
-
2285
- case 21:
2286
- _context.prev = 21;
2287
- _context.t1 = _context['catch'](15);
2288
-
2289
- console.error(_context.t1);
2290
-
2291
- case 24:
2292
- targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2293
-
2294
- article.Ads = Ads.getRightItems(targeting);
2295
- setQueueData([].concat(_toConsumableArray(queueData), [article]));
2296
-
2297
- case 27:
2298
- case 'end':
2299
- return _context.stop();
2300
- }
2301
- }
2302
- }, _callee, _this$1, [[3, 9], [15, 21]]);
2303
- }));
2304
-
2305
- return function loadmore() {
2306
- return _ref.apply(this, arguments);
2307
- };
2308
- }();
2309
-
2310
- var currentPath = router && router.asPath;
2311
- var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2312
- return eachDocument.urlSeo == currentPath;
2313
- });
2314
-
2315
- var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2316
- var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2317
- // let urlSeo = seoLinks && seoLinks.length ==1 && seoLinks[0].urlSeo
2318
-
2319
- var changeMetaFromSanity = function changeMetaFromSanity(metaDescription, metaTitle, oldMeta) {
2320
- document.title = metaTitle;
2321
- //this was throwing an error if there was no description, doing a check for the description meta
2322
- if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', metaDescription);
2323
- if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2324
- if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2325
- if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2326
- if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2327
- if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2328
- if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2329
- if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2330
- if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2331
- //this was throwing an error if there was no description, doing a check for the description meta
2332
- if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', metaDescription);
2333
- if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2334
- document.querySelector('link[rel="canonical"]').setAttribute('href', oldMeta.shareUrl);
2335
- }
2336
- };
2337
-
2338
- var changeMeta = function changeMeta(meta) {
2339
- document.title = meta.shareTitle;
2340
- //this was throwing an error if there was no description, doing a check for the description meta
2341
- if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
2342
- if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2343
- if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2344
- if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2345
- if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2346
- if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2347
- if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2348
- if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2349
- if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2350
- //this was throwing an error if there was no description, doing a check for the description meta
2351
- if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
2352
- if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2353
- document.querySelector('link[rel="canonical"]').setAttribute('href', meta.shareUrl);
2354
- }
2355
- };
2356
-
2357
- var onChangeArticle = function onChangeArticle(path, meta, pageviewProperties) {
2358
- var newPath = '/view/' + path;
2359
- var activeArticle = queueData.find(function (item) {
2360
- return item.url.current === path;
2361
- });
2362
- setActive(function () {
2363
- return activeArticle._id;
2364
- });
2365
- // Change URL and do other changes
2366
- window.history.pushState({ page: path }, meta.shareTitle, newPath);
2367
-
2368
- if (metaDescriptionSanity && metaTitleSanity && currentPath == newPath) {
2369
- changeMetaFromSanity(metaDescriptionSanity, metaTitleSanity, meta);
2370
- } else {
2371
- changeMeta(meta);
2372
- }
2373
- if (props.setCustomDimensions) {
2374
- props.setCustomDimensions(activeArticle, '200', prevUrl, '');
2375
- }
2376
- if (props.pageview) props.pageview(newPath, null, pageviewProperties);
2377
- if (props.gtagSetCustomDimensions) props.gtagSetCustomDimensions(activeArticle, '200', prevUrl, '', true);
2378
- refreshAD(path);
2379
- };
2380
-
2381
- return React__default.createElement(
2382
- InfiniteScroll,
2383
- { dataLength: queueData.length, next: loadmore, scrollThreshold: '40%', hasMore: true, style: { overflow: 'hidden' } },
2384
- queueData.map(function (article, index) {
2385
- return React__default.createElement(
2386
- React__default.Fragment,
2387
- { key: index },
2388
- React__default.createElement(Article, _extends({}, props, {
2389
- containerHeight: containerHeight,
2390
- onChangeArticle: onChangeArticle,
2391
- authorPrfix: authorPrefix,
2392
- article: article,
2393
- cpModificationRequired: cpModificationRequired,
2394
- active: active === article._id
2395
- // Passing queueData to check for single article
2396
- , queueData: queueData,
2397
- showRelatedArticles: showRelatedArticles,
2398
- index: index,
2399
- showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null,
2400
- showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null
2401
- }))
2402
- );
2403
- })
2404
- );
2405
- };
2406
-
2407
- var _this = undefined;
2408
-
2409
- var View = function View(props) {
2410
- var router = useRouter();
2411
- var shareOptions = props.shareOptions,
2412
- article = props.article,
2413
- _props$article = props.article,
2414
- hideComments = _props$article.hideComments,
2415
- content_placement = _props$article.content_placement,
2416
- _props$sponsoredFlag = props.sponsoredFlag,
2417
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag;
2418
- props.sponsoredTaxonomies;
2419
- var Ads = props.Ads,
2420
- setCustomDimensions = props.setCustomDimensions,
2421
- gtagSetCustomDimensions = props.gtagSetCustomDimensions,
2422
- statusCode = props.statusCode,
2423
- prevUrl = props.prevUrl,
2424
- pageview = props.pageview,
2425
- _props$showRelatedArt = props.showRelatedArticles,
2426
- showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt,
2427
- _props$canonicalTag = props.canonicalTag,
2428
- canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag,
2429
- _props$infiniteScroll = props.infiniteScrollFlag,
2430
- infiniteScrollFlag = _props$infiniteScroll === undefined ? true : _props$infiniteScroll,
2431
- emailList = props.emailList,
2432
- articleRecs = props.articleRecs;
2433
- var _props$article2 = props.article,
2434
- _props$article2$passw = _props$article2.passwordLock,
2435
- passwordLock = _props$article2$passw === undefined ? false : _props$article2$passw;
2436
- _props$article2.description;
2437
- var title = _props$article2.title,
2438
- seriesShareOptions = _props$article2.seriesShareOptions;
2439
-
2440
- var _useState = useState(0),
2441
- _useState2 = _slicedToArray(_useState, 2),
2442
- currentPage = _useState2[0],
2443
- setCurrentPage = _useState2[1];
2444
- // Logging GA pageview for the initial article with custom dimensions
2445
-
2446
-
2447
- useEffect(function () {
2448
- if (pageview && setCustomDimensions) {
2449
- var timer = void 0;
2450
- var pageviewProperties = _extends({}, getTargeting(props), {
2451
- category: article && article.category ? article.category.name : ''
2452
- });
2453
- var waitAndExicute = function waitAndExicute() {
2454
- if (typeof window.GA_INITIALIZED !== 'undefined') {
2455
- setCustomDimensions(article, statusCode, prevUrl, '');
2456
- pageview(router.asPath, null, pageviewProperties);
2457
- } else timer = setTimeout(waitAndExicute, 1000);
2458
- };
2459
- waitAndExicute();
2460
- return function () {
2461
- clearTimeout(timer);
2462
- };
2463
- } else if (gtagSetCustomDimensions) {
2464
- var _timer = void 0;
2465
- var _waitAndExicute = function _waitAndExicute() {
2466
- if (typeof window.GA_INITIALIZED !== 'undefined') {
2467
- gtagSetCustomDimensions(article, statusCode, prevUrl, '', false);
2468
- } else _timer = setTimeout(_waitAndExicute, 1000);
2469
- };
2470
- _waitAndExicute();
2471
- return function () {
2472
- clearTimeout(_timer);
2473
- };
2474
- }
2475
- }, []);
2476
-
2477
- var isVideoSeries = false;
2478
- // check for certain serializers that need to disable infinite scroll
2479
- var checkBodyForDisableInfiniteScroll = function checkBodyForDisableInfiniteScroll(article) {
2480
- if (!article || !article.body) {
2481
- return false;
2482
- }
2483
- for (var i = 0; i < article.body.length; i++) {
2484
- if (article.body[i]._type === 'articleSeries' || article.body[i]._type === 'slideshows' || article.body[i]._type === 'quiz') {
2485
- return true;
2486
- }
2487
- var row = article.body[i];
2488
- if (typeof row.videos !== 'undefined') {
2489
- isVideoSeries = true;
2490
- return true;
2491
- }
2492
- }
2493
- return false;
2494
- };
2495
-
2496
- var isMediaSeries = false;
2497
-
2498
- if (article.documentGroup && article.documentGroup.isSeries) {
2499
- isMediaSeries = true;
2500
- }
2501
- if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2502
- isMediaSeries = true;
2503
- }
2504
-
2505
- var disableInfiniteScroll = checkBodyForDisableInfiniteScroll(props.article);
2506
- var commentsEnabledInTaxonomy = Array.isArray(content_placement) && content_placement.some(function (t) {
2507
- return t.showComments === true;
2508
- });
2509
- var showDisqus = commentsEnabledInTaxonomy || hideComments === false;
2510
- var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && !isMediaSeries && !showDisqus;
2511
-
2512
- if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
2513
- title = null;
2514
- }
2515
-
2516
- if (!needInfiniteScroll && !title) {
2517
- title = props.article ? props.article.title : '';
2518
- }
2519
- // add mobile ads to articles not using infinite scroll
2520
- if (!needInfiniteScroll) {
2521
- var targeting = getTargeting(props);
2522
- article.Ads = Ads.getRightItems(targeting);
2523
- if (!sponsoredFlag && Ads.getVideoContextualAD) {
2524
- article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
2525
- }
2526
- if (!sponsoredFlag && Ads.getNativeContextualAD) {
2527
- article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
2528
- }
2529
- }
2530
- useEffect(function () {
2531
- router.asPath && router.asPath.length > 0 && router.asPath.includes('?') && router.asPath.split('?')[1].split('&').forEach(function (item) {
2532
- if (item.includes('page=')) {
2533
- setCurrentPage(item.split('=')[1]);
2534
- } else {
2535
- setCurrentPage(0);
2536
- }
2537
- });
2538
- if (!router.asPath.includes('page=') && currentPage !== 0) {
2539
- setCurrentPage(0);
2540
- }
2541
- }, [router]);
2542
-
2543
- var meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.meta_description ? '' + article.seo.meta_description + (currentPage > 0 ? ' | Page ' + currentPage : '') : shareOptions.shareSummary ? '' + shareOptions.shareSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + (currentPage > 0 ? 'Page ' + currentPage : '');
2544
-
2545
- if (isVideoSeries) {
2546
- meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '';
2547
- }
2548
-
2549
- var currentPath = router && router.asPath;
2550
- var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2551
- return eachDocument.urlSeo == currentPath;
2552
- });
2553
-
2554
- var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2555
- var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2556
- return React__default.createElement(
2557
- React__default.Fragment,
2558
- null,
2559
- React__default.createElement(
2560
- Head,
2561
- null,
2562
- React__default.createElement(
2563
- 'title',
2564
- { key: 'title' },
2565
- metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article && article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + article.title + (currentPage > 0 ? ' | Page ' + currentPage : '')
2566
- ),
2567
- metaDescriptionSanity ? React__default.createElement('meta', { name: 'description', key: 'description', content: metaDescriptionSanity }) : meta_description && React__default.createElement('meta', { name: 'description', key: 'description', content: meta_description }),
2568
- React__default.createElement('meta', { name: 'keywords', content: getKeywords(article).join(','), key: 'keywords' }),
2569
- passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
2570
- !passwordLock && (article.applyNoIndexTag || article.applyNoFollowTag) && React__default.createElement('meta', {
2571
- name: 'robots',
2572
- content: article.applyNoIndexTag && article.applyNoFollowTag ? 'noindex, nofollow' : article.applyNoIndexTag && !article.applyNoFollowTag ? 'noindex' : 'nofollow'
2573
- }),
2574
- React__default.createElement('meta', {
2575
- property: 'og:url',
2576
- content: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2577
- key: 'og:url'
2578
- }),
2579
- React__default.createElement('meta', {
2580
- property: 'og:title',
2581
- content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2582
- key: 'og:title'
2583
- }),
2584
- React__default.createElement('meta', {
2585
- property: 'og:image',
2586
- content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2587
- key: 'og:image'
2588
- }),
2589
- React__default.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
2590
- metaDescriptionSanity ? React__default.createElement('meta', { property: 'og:description', key: 'og:description', content: metaDescriptionSanity }) : meta_description && React__default.createElement('meta', { property: 'og:description', key: 'og:description', content: meta_description }),
2591
- React__default.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
2592
- React__default.createElement('meta', {
2593
- name: 'twitter:title',
2594
- content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2595
- key: 'twitter:title'
2596
- }),
2597
- React__default.createElement('meta', {
2598
- name: 'twitter:image',
2599
- content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2600
- key: 'twitter:image'
2601
- }),
2602
- React__default.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
2603
- metaDescriptionSanity ? React__default.createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: metaDescriptionSanity }) : meta_description && React__default.createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: meta_description }),
2604
- canonicalTag && React__default.createElement('link', {
2605
- rel: 'canonical',
2606
- href: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2607
- key: 'canonical'
2608
- }),
2609
- React__default.createElement(
2610
- 'noscript',
2611
- null,
2612
- props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
2613
- props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
2614
- )
2615
- ),
2616
- !needInfiniteScroll ? React__default.createElement(Article, _extends({
2617
- infiniteScroll: false,
2618
- showRelatedArticles: showRelatedArticles,
2619
- showDisqus: showDisqus,
2620
- emailList: emailList,
2621
- articleRecs: articleRecs
2622
- }, props, {
2623
- showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null,
2624
- showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null
2625
- })) : React__default.createElement(ArticleQueue, _extends({
2626
- infiniteScroll: true,
2627
- showRelatedArticles: showRelatedArticles,
2628
- canonicalTag: canonicalTag,
2629
- checkSponsered: true,
2630
- Ads: props.WAds,
2631
- onVote: function onVote() {},
2632
- sponsoredTaxonomies: []
2633
- }, props))
2634
- );
2635
- };
2636
-
2637
- // This should be called in /view/[url] getInitialProps to fetch the article data and related articles. This will also set the sponsoredFlag to true if any taxonomies have disabled ads.
2638
- View.returnGetInitialProps = function () {
2639
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
2640
- var context = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
2641
-
2642
- var article, relatedArticleQuery, sliderData, statusCode, sliderArticles, _sliderArticles, _context$query$series, seriesArticle, sponsoredFlag;
2643
-
2644
- return regenerator.wrap(function _callee$(_context) {
2645
- while (1) {
2646
- switch (_context.prev = _context.next) {
2647
- case 0:
2648
- _context.next = 2;
2649
- return client.fetch(getQuery('article'), { url: url });
2650
-
2651
- case 2:
2652
- article = _context.sent;
2653
- relatedArticleQuery = getQuery('related');
2654
-
2655
- article.seriesDetail = getSeriesDetail(article, seriesVid);
2656
- sliderData = [];
2657
- statusCode = 200;
2658
-
2659
- if (!article || !article._id || !article.body) {
2660
- statusCode = 404;
2661
- }
2662
-
2663
- if (!(article.documentGroup && article.documentGroup.isSeries)) {
2664
- _context.next = 15;
2665
- break;
2666
- }
2667
-
2668
- _context.next = 11;
2669
- return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2670
-
2671
- case 11:
2672
- sliderArticles = _context.sent;
2673
-
2674
- sliderData = sliderArticles;
2675
- _context.next = 20;
2676
- break;
2677
-
2678
- case 15:
2679
- if (!(article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries)) {
2680
- _context.next = 20;
2681
- break;
2682
- }
2683
-
2684
- _context.next = 18;
2685
- return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroupMapping[0]._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2686
-
2687
- case 18:
2688
- _sliderArticles = _context.sent;
2689
-
2690
- sliderData = _sliderArticles;
2691
-
2692
- case 20:
2693
- _context$query$series = context.query.seriesArticle, seriesArticle = _context$query$series === undefined ? false : _context$query$series;
2694
-
2695
- if ((seriesArticle || seriesVid) && article.body) {
2696
- article.body.map(function (block) {
2697
- if (block._type === 'articleSeries' && block.articles && block.articles.length > 0) {
2698
- block.articles.map(function (subArticle) {
2699
- if (subArticle.param.current === seriesArticle) {
2700
- var seriesShareOptions = {
2701
- seriesUrl: '?seriesArticle=' + seriesArticle,
2702
- seriesTitle: subArticle.title,
2703
- seriesSummary: subArticle.summary,
2704
- seriesThumbnail: subArticle.thumbnail && subArticle.thumbnail.asset ? urlFor({ client: client, source: subArticle.thumbnail.asset }) : null
2705
- };
2706
- article.seriesShareOptions = seriesShareOptions;
2707
- }
2708
- });
2709
- }
2710
- if (block._type === 'youtubeGallery' && block.videos && block.videos.length > 0) {
2711
- block.videos.map(function (video, index) {
2712
- if (index + 1 === Number(seriesVid)) {
2713
- var seriesShareOptions = {
2714
- seriesUrl: '?seriesVid=' + seriesVid,
2715
- seriesTitle: video.title,
2716
- seriesSummary: video.intro,
2717
- seriesThumbnail: video.thumbnail && video.thumbnail.asset ? urlFor({ client: client, source: video.thumbnail.asset }) : null
2718
- };
2719
- article.seriesShareOptions = seriesShareOptions;
2720
- }
2721
- });
2722
- }
2723
- });
2724
- }
2725
- sponsoredFlag = false;
2726
-
2727
- // check for disableAds flag on each taxonomoy
2728
-
2729
- if (article && article.content_placement) {
2730
- article.content_placement.forEach(function (x) {
2731
- if (x.disableAds) {
2732
- sponsoredFlag = true;
2733
- }
2734
- if (x.applyNoIndexTag) {
2735
- article.applyNoIndexTag = true;
2736
- }
2737
- if (x.applyNoFollowTag) {
2738
- article.applyNoFollowTag = true;
2739
- }
2740
- if (x.disableNativeAds) {
2741
- article.disableNativeAds = true;
2742
- }
2743
- });
2744
- }
2745
- // check for disableAds flag on content category
2746
- if (article.category && article.category.disableAds) {
2747
- sponsoredFlag = true;
2748
- }
2749
-
2750
- if (!article.disableRelatedContent) {
2751
- _context.next = 30;
2752
- break;
2753
- }
2754
-
2755
- article.relatedArticle = null;
2756
- _context.next = 34;
2757
- break;
2758
-
2759
- case 30:
2760
- if (!article) {
2761
- _context.next = 34;
2762
- break;
2763
- }
2764
-
2765
- _context.next = 33;
2766
- return getRelatedArticle(context, client, article, prevUrl, '0..2');
2767
-
2768
- case 33:
2769
- article.relatedArticle = _context.sent;
2770
-
2771
- case 34:
2772
-
2773
- //check documentGroup and documentGroupMapping for disableNativeAds:true
2774
- if (!article.disableNativeAds) {
2775
- if (article.documentGroup && article.documentGroup.length) {
2776
- article.documentGroup.forEach(function (docGroup) {
2777
- var node = docGroup.parent ? docGroup.parent : null;
2778
- if (docGroup.disableNativeAds) {
2779
- article.disableNativeAds = true;
2780
- }
2781
- while (node) {
2782
- if (node.disableNativeAds) [article.disableNativeAds = true];
2783
- node = node.parent || null;
2784
- }
2785
- });
2786
- }
2787
- if (article.documentGroupMapping && article.documentGroupMapping.length) {
2788
- article.documentGroupMapping.forEach(function (docGroup) {
2789
- var node = docGroup.parent ? docGroup.parent : null;
2790
- if (docGroup.disableNativeAds) {
2791
- article.disableNativeAds = true;
2792
- }
2793
- while (node) {
2794
- if (node.disableNativeAds) [article.disableNativeAds = true];
2795
- node = node.parent || null;
2796
- }
2797
- });
2798
- }
2799
- }
2800
-
2801
- return _context.abrupt('return', {
2802
- url: url,
2803
- sao: sao,
2804
- statusCode: statusCode,
2805
- prevUrl: prevUrl,
2806
- relatedArticleQuery: relatedArticleQuery,
2807
- article: article,
2808
- sliderData: sliderData,
2809
- sponsoredFlag: sponsoredFlag
2810
- });
2811
-
2812
- case 36:
2813
- case 'end':
2814
- return _context.stop();
2815
- }
2816
- }
2817
- }, _callee, _this);
2818
- }));
2819
-
2820
- return function (_x, _x2, _x3, _x4, _x5) {
2821
- return _ref.apply(this, arguments);
2822
- };
2823
- }();
2824
-
2825
- export { View as default };