@mjhls/mjh-framework 1.0.108 → 1.0.109-8.1

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