@mjhls/mjh-framework 1.0.108 → 1.0.109-4.test-v1

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