{"version":3,"sources":["webpack:///./src/app/pages/StaticPage.js","webpack:///./src/app/pages/NotFound.js"],"names":["StaticPage","prevProps","this","props","pageName","page","fetchStaticPage","staticPageView","location","pathname","visitorId","sessionId","setPageType","hasError","main","px","mt","sm","lg","w","title","div","maxWidth","mx","my","error","hasFetched","staticPage","name","content","description","isConnected","adPath","slotId","targeting","interstitial","collapseEmptyDiv","className","anchor","mapping","MAPPINGS","Interstitial","FORMATS","h1","text","borderWidth","borderStyle","borderColor","pb","mb","sectionLabel","dangerouslySetInnerHTML","__html","body","newspapers","display","gridTemplateColumns","gap","map","newspaper","href","newspaperPageUrl","target","src","logo","newspaperTitle","strong","textTransform","aboutLink","contactLink","advertisingLink","eEditionSubscribeLink","leaderboard","leaderboardtop","Component","connect","state","getVisitorId","getSessionId","dispatch","bindActionCreators","NotFound","staticContext","is404"],"mappings":"yZAaaA,EAAU,kHA8FpB,OA9FoB,+CACrB,SAAmBC,GACbC,KAAKC,MAAMC,WAAaF,KAAKC,MAAME,MACrCH,KAAKC,MAAMG,gBAAgBJ,KAAKC,MAAME,QAEzC,+BAED,WACEH,KAAKC,MAAMI,eAAeL,KAAKC,MAAMK,SAASC,SAAUP,KAAKC,MAAMO,UAAWR,KAAKC,MAAMQ,WACzFC,YAAY,WACPV,KAAKC,MAAMU,UACZX,KAAKC,MAAMG,gBAAgBJ,KAAKC,MAAME,QAE3C,oBAED,WACE,GAAIH,KAAKC,MAAMU,SACb,OACE,oBACE,EAAC,IAAEC,KAAI,CAACC,GAAI,GAAIC,GAAI,CAAEC,GAAI,OAAQC,GAAI,SAAWC,EAAE,QACjD,EAAC,UAAM,CAACC,MAAM,UACd,EAAC,IAAEC,IAAG,CAACF,EAAE,OAAOG,SAAU,KAAMC,GAAG,OAAOC,GAAI,IAC5C,qBAAWtB,KAAKC,MAAMsB,UAMhC,GAAIvB,KAAKC,MAAMuB,YAAcxB,KAAKC,MAAMwB,WAAY,CAClD,IAAItB,EAAOH,KAAKC,MAAMwB,WAE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BX,OAjBW,sDACZ,WACE,IAAQC,EAAkBhF,KAAKC,MAAvB+E,cACJA,IACFA,EAAcC,OAAQ,KAEzB,oBAED,WACgBjF,KAAKC,MACnB,OACE,oBACE,EAAC,IAAEkB,IAAG,CAACF,EAAE,OAAOG,SAAU,KAAMC,GAAG,OAAOC,GAAI,GAAIqB,YAAY,YAAYC,YAAY,QAAQC,YAAY,WACxG,EAAC,IAAEJ,GAAE,CAACC,KAAK,KAAKI,GAAI,IAAG,4BAI9B,EAjBW,CAAS0B,aAoBRO","file":"static/js/pages-StaticPage.aea1c00a.chunk.js","sourcesContent":["import React, { Component, Fragment, useEffect } from 'react'\nimport { bindActionCreators } from 'redux'\nimport { connect } from 'react-redux'\nimport { x } from '@xstyled/styled-components'\n\nimport { fetchStaticPage } from '../../store/staticPage'\nimport { staticPageView, setPageType } from '../../store/app'\nimport { getVisitorId, getSessionId } from '../../store/article'\nimport Helmet from 'react-helmet'\nimport Ad from '../components/Ad'\nimport {FORMATS, MAPPINGS} from '../components/AdFormats'\nimport NotFound from './NotFound'\n\nexport class StaticPage extends Component {\n  componentDidUpdate(prevProps) {\n    if (this.props.pageName !== this.props.page) {\n      this.props.fetchStaticPage(this.props.page)\n    }\n  }\n\n  componentDidMount() {\n    this.props.staticPageView(this.props.location.pathname, this.props.visitorId, this.props.sessionId)\n    setPageType('section')\n    if (!this.props.hasError) {\n        this.props.fetchStaticPage(this.props.page)\n    }\n  }\n\n  render() {\n    if (this.props.hasError) {\n      return (\n        <>\n          <x.main px={20} mt={{ sm: '96px', lg: '173px' }} w='100%'>\n            <Helmet title='ERROR' />\n            <x.div w='100%' maxWidth={1220} mx='auto' my={50}>\n              <p>Error: {this.props.error}</p>\n            </x.div>\n          </x.main>\n        </>\n      )\n    }\n    if (this.props.hasFetched && this.props.staticPage) {\n      let page = this.props.staticPage\n\n      if (page && page.title) {\n        return (\n          <>\n            <x.main px={20} mt={{ sm: '96px', lg: '173px' }} w='100%'>\n              <Helmet title={this.props.title} >\n                <meta name='description' content={this.props.description} />\n              </Helmet>\n              <Ad isConnected={this.props.isConnected} adPath={this.props.adPath} slotId='interstitial' targeting={{ interstitial: 'interstitial' }} collapseEmptyDiv className='advert' anchor='interstitial' mapping={MAPPINGS.Interstitial} {...FORMATS.interstitial} />\n              <x.div w='100%' maxWidth={1220} mx='auto' my={50}>\n                <x.h1 text='h1' borderWidth='0 0 1px 0' borderStyle='solid' borderColor='divider' pb={10} mb={20}>{this.props.sectionLabel || page.title}</x.h1>\n                <div className='static-pages' dangerouslySetInnerHTML={{ __html: page.body }} />\n                {page.newspapers &&\n                  <x.div className='newspapers' display='grid' gridTemplateColumns={{ sm: 'repeat(2, calc((100% - 20px) / 2))', lg: 'repeat(4, calc((100% - 120px) / 4))' }} gap={{ sm: '20', lg: '40' }}>\n                    {page.newspapers.map(newspaper => (\n                      <div>\n                        <figure>\n                          <a href={newspaper.newspaperPageUrl} target='_blank'>\n                            <img src={newspaper.logo} title={newspaper.newspaperTitle} />\n                          </a>\n                        </figure>\n                        <p>\n                          <x.strong textTransform='uppercase' text='large'>{newspaper.newspaperTitle}</x.strong><br />\n                          {newspaper.aboutLink && (\n                            <span><a href={newspaper.aboutLink} target='_blank'>About</a> | </span>\n                          )}\n                          {newspaper.contactLink && (\n                            <span><a href={newspaper.contactLink} target='_blank'>Contact</a><br /></span>\n                          )}\n                          {newspaper.advertisingLink && (\n                            <span><a href={newspaper.advertisingLink} target='_blank'>Advertise</a> | </span>\n                          )}\n                          {newspaper.eEditionSubscribeLink && (\n                            <a href={newspaper.eEditionSubscribeLink} target='_blank'>Subscribe</a>\n                          )}\n                        </p>\n                      </div>\n                    ))}\n                  </x.div>\n                }\n              </x.div>\n            </x.main>\n          </>\n        )\n      } else {\n        return (\n          <>\n            <Ad isConnected={this.props.isConnected} adPath={this.props.adPath} slotId='interstitial' targeting={{ interstitial: 'interstitial' }} collapseEmptyDiv className='advert' anchor='interstitial' mapping={MAPPINGS.Interstitial} {...FORMATS.interstitial} />\n            <Ad isConnected={this.props.isConnected} adPath={this.props.page} slotId='leaderboard-top' targeting={{ leaderboard: 'top' }} collapseEmptyDiv className='advert advert-leaderboard-top' mapping={MAPPINGS['Leaderboard']} {...FORMATS.leaderboardtop} />\n            <NotFound />\n            <Ad isConnected={this.props.isConnected} adPath={this.props.page} slotId='leaderboard-bot' targeting={{ leaderboard: 'bot' }} collapseEmptyDiv className='advert advert-leaderboard-bot' mapping={MAPPINGS['Leaderboard']} {...FORMATS.leaderboard} />\n          </>\n        )\n      }\n    } else {\n      return (\n        <>\n          <Helmet title='Article' />\n          <x.main px={20} mt={{ sm: '96px', lg: '173px' }} w='100%'>\n            <x.div w='100%' maxWidth={1220} mx='auto' mt={50} mb={30}>Loading...</x.div>\n          </x.main>\n        </>\n      )\n    }\n  }\n}\nconst mapStateToProps = (state) => ({ ...state.staticPage, visitorId: getVisitorId(state), sessionId: getSessionId(state) })\nconst mapDispatchToProps = (dispatch) => bindActionCreators({ fetchStaticPage, staticPageView }, dispatch)\n\nexport default connect(mapStateToProps, mapDispatchToProps)(StaticPage)\n","import React, { Component } from 'react'\nimport { x } from '@xstyled/styled-components'\n\nclass NotFound extends Component {\n  UNSAFE_componentWillMount () {\n    const { staticContext } = this.props\n    if (staticContext) {\n      staticContext.is404 = true\n    }\n  }\n\n  render () {\n    const props = this.props\n    return (\n      <>\n        <x.div w='100%' maxWidth={1220} mx='auto' my={50} borderWidth='0 0 1px 0' borderStyle='solid' borderColor='divider'>\n          <x.h1 text='h1' pb={20}>404 Page not found</x.h1>\n        </x.div>\n      </>\n    )\n  }\n}\n\nexport default NotFound\n"],"sourceRoot":""}