{"version":3,"sources":["webpack:///./pagination/index.js","webpack:///./utils/session-timer.js","webpack:///./screens/session-timer/index.js","webpack:///./screens/simplelayout/index.js","webpack:///./utils/venice.js"],"names":["AnimatedSwitchPagination","previousPage","undefined","currentPage","stack","styles","offset","opacity","transform","window","scrollTo","className","runOnMount","location","pathname","atEnter","action","this","props","history","atLeave","atActive","mapStyles","children","Component","withRouter","signoutTimer","warningTimer","onWarning","init","options","clientData","isUserLoggedIn","venice","setTimeout","startWebAuthTimer","assign","STYLES","MODAL","css","zIndex","Wrapper","glamorous","div","display","justifyContent","Container","flexDirection","alignItems","ButtonContainer","marginTop","l10n","getContent","SessionTimer","useState","isOpen","setIsOpen","isLoading","setIsLoading","useEffect","initSessionTimer","onSubmit","a","axios","clearTimeout","ReactDOM","unstable_batchedUpdates","hideLogo","title","hideTitle","overpanel","onClose","closeOnBackgroundClick","closeButtonLabel","src","ILLUSTRATIONS","WARNING","alt","width","height","disabled","onClick","position","background","tableLayout","top","SpinnerContainer","left","backgroundColor","animation","White","right","overflow","overflowY","isSellerProfile","maxWidth","margin","padding","isSellerDashboardPreview","isMyProfile","Content","isSettingsPage","marginBottom","isProfileTreatment","widerPage","navigationItemStylingFix","cursor","NavLink","verticalAlign","Navigation","linkName","currentPath","isSellerRoute","split","trackAction","trackSellerClick","pathName","subPathName","INSTRUMENTATION","INSTRUMENTATION_MAP","NEW","Events","tracking","slug","hasSlugInUrl","includes","pathSplit","length","index","SELLER_INSTRUMENTATION_MAP","state","error","headerKey","instrumentationObj","decisionMsg","photoFlow","isMediaservError","error_source","error_code","photo_uploaded_flag","e","type","key","trackClick","push","isSellerSettings","replace","goBack","showBackLink","isTimeoutPage","isSuccessPage","isLandingPage","isSellerDashboard","tabIndex","onKeyDown","handleBackButton","data-testid","aria-label","_closeLink","React","createRef","current","focus","style","dir","renderBackButton","href","flowCancelUrl","ref","Layout","document","getElementById","scrollTop","urlMatchArr","match","url","isNewUser","id","SPINNER_ID","size","screenReaderText","isNativeApp","Boolean","isIOS","navigator","platform","test","onShareText","obj","shareText","text","onProfileSave","photoDataURI","profileSave","profileImageChanged","reAuth"],"mappings":";;;;;;;;;;;yzDAqCMA,E,oOACI,CACNC,kBAAcC,EACdC,iBAAaD,EACbE,MAAO,K,wCAGG,SAAAC,GACV,IAAIC,EAASD,EAAOC,OAGpB,OAFAA,EAAS,GAAH,OAAMA,EAAN,MAEC,CACLC,QAASF,EAAOE,QAChBC,UAAW,cAAF,OAAgBF,EAAhB,S,+DAIb,WACEG,OAAOC,SAAS,EAAG,K,oBAGrB,WACE,OACE,kBAAC,IAAD,aACEC,UAAU,iBACVC,WAAkC,MAAtBC,SAASC,UAzCpB,CACLC,QAAS,CACPT,OAAmB,UAHAU,EA2CGC,KAAKC,MAAMC,QAAQH,QAxCb,KAAO,IACnCT,QAAS,GAEXa,QAAS,CACPd,OAAmB,SAAXU,GAAqB,IAAM,IACnCT,QAAS,GAEXc,SAAU,CACRf,OAAQ,EACRC,QAAS,IA4BT,CAIEe,UAAWL,KAAKK,YAEfL,KAAKC,MAAMK,UA9CpB,IAAyBP,M,GAiBcQ,aAmCxBC,sBAAWzB,I;;;;;;;;;;;;;;;;;;;gHCjEtB0B,EACAC,EACAC,E,wwBAEJ,SAASC,EAAKC,GACPC,IAAWC,iBAIhBJ,EAAYE,EAAQF,UAChBK,IASJC,WAAWD,IADK,MAAQ,GAAK,KAL3BE,KASJ,SAASA,IAEPR,EAAeO,YAAW,WACxBN,IACAF,EAAeQ,YAAW,WACxBzB,OAAOI,SAASuB,OAAO,aACtB,OALW,MCblB,IAAMC,EAAS,CACbC,MAAOC,cAAI,CAAEC,OAAQ,SAGjBC,EAAUC,IAAUC,IAAI,CAC5BC,QAAS,OACTC,eAAgB,WAEZC,EAAYJ,IAAUC,IAAI,CAC9BC,QAAS,OACTG,cAAe,SACfC,WAAY,WAGRC,EAAkBP,IAAUC,IAAI,CAAEO,UAAW,SAE7CC,EAAOC,YAAW,uBAoETC,UAlEf,WACE,MAA4BC,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,GACmB,aAAnB+E,EAAY,IACW,IAAvBA,EAAY9C,OACRiD,EAAY,IAAMjJ,IAAY,2BAC9BsH,EAAmC,oBAAnBwB,EAAY,GAElC,OACE,kBAACpI,EAAD,KACE,kBAAC6C,EAAD,CAAkB2F,GAAIC,IAAYf,MAAO,CAAEvH,QAAS,SAClD,uBAASuI,KAAK,KAAKC,iBAAkBjI,EAAK,sBAE5C,kBAACuC,EAAD,CACEuF,GAAG,kCACH9E,YAAaA,EACbL,gBAAiBA,EACjBI,yBAA0BA,IAExB8E,IAAcK,MAAgBnF,GAC9B,kBAACW,EAAD,CACE1F,QAASF,KAAKC,MAAMC,QACpBgF,YAAaA,EACbE,eAAgBA,EAChBmD,kBAAmBA,EACnBH,cAAeA,EACfC,cAAeA,EACfC,cAAeA,EACfN,iBAAkBA,IAGtB,kBAAC7C,EAAD,CACEG,mBACExE,IAAWwE,qBAAuBT,EAEpCO,eAAgBA,EAChBG,UAAWL,GAAeL,GAEzB7E,KAAKC,MAAMK,gB,GAvDHC,aA8DNC,sBAAWgJ,I;;;;;iGCvW1B,wIAOO,IAAMY,EAAcC,QACP,oBAAX7K,QAA0BA,OAAOwB,QAGpCsJ,EAAQD,QACM,oBAAX7K,QACLA,OAAO+K,WACP/K,OAAO+K,UAAUC,UACjB,mBAAmBC,KAAKF,UAAUC,WAI/B,SAASE,EAAYC,GACrBP,IACDE,EACF9K,OAAOwB,OAAO4J,UAAUD,GAExBnL,OAAOwB,OAAO4J,UAAUD,EAAIE,OAKzB,SAASC,IAA0D,6DAAJ,GAAI,IAA1CC,oBAA0C,MAA3B,GAA2B,EACnEX,IAGAE,GACH9K,OAAOwB,OAAOgK,cAIZD,GAAgBT,GAClB9K,OAAOwB,OAAOiK,oBAAoBF,IAe/B,SAASG,IACd,OAAO1L,OAAOwB,OAAOkK","file":"ppme-shared.bundle.js","sourcesContent":["// @flow\n\nimport React, { Component } from 'react'\nimport { AnimatedSwitch } from 'react-router-transition'\nimport { withRouter } from 'react-router-dom'\nimport type { RouterHistory } from 'react-router'\nimport './index.css'\n\ntype Props = {\n children: React$Element,\n history: RouterHistory,\n}\n\ntype State = {\n invert: boolean,\n currentPage: ?string,\n previousPage: ?string,\n stack: Array,\n}\n\nfunction pageTransitions(action) {\n return {\n atEnter: {\n offset: action === 'PUSH' ? 600 : -600,\n opacity: 1,\n },\n atLeave: {\n offset: action === 'PUSH' ? -600 : 600,\n opacity: 0,\n },\n atActive: {\n offset: 0,\n opacity: 1,\n },\n }\n}\n\nclass AnimatedSwitchPagination extends Component {\n state = {\n previousPage: undefined,\n currentPage: undefined,\n stack: [],\n }\n\n mapStyles = styles => {\n let offset = styles.offset\n offset = `${offset}px`\n\n return {\n opacity: styles.opacity,\n transform: `translateX(${offset})`,\n }\n }\n\n componentWillReceiveProps() {\n window.scrollTo(0, 0)\n }\n\n render() {\n return (\n \n {this.props.children}\n \n )\n }\n}\n\nexport default withRouter(AnimatedSwitchPagination)\n","// @flow\n// after 15 minutes of inactivity, the user's session expires\n// we warn them of this after 14 minutes to give them a minute to interact\n// with the app and extend their session.\nimport * as venice from './venice'\nimport clientData from './client-data'\n\nlet signoutTimer\nlet warningTimer\nlet onWarning\n\nfunction init(options) {\n if (!clientData.isUserLoggedIn) {\n // no reason to log them out if they're not logged in\n return\n }\n onWarning = options.onWarning\n if (venice.isNativeApp) {\n startNativeAuthTimer()\n } else {\n startWebAuthTimer()\n }\n}\n\nfunction startNativeAuthTimer() {\n const TIMEOUT = 15.02 * 60 * 1000 // 15 minutes and 1.2 seconds\n setTimeout(venice.reAuth, TIMEOUT)\n}\n\nfunction startWebAuthTimer() {\n const TIMEOUT = 14 * 60 * 1000 // 14 minutes\n warningTimer = setTimeout(() => {\n onWarning()\n signoutTimer = setTimeout(() => {\n window.location.assign('/signin')\n }, 60 * 1000) // 1 minute\n }, TIMEOUT)\n}\n\nfunction onSessionExtended() {\n clearTimeout(signoutTimer)\n clearTimeout(warningTimer)\n startWebAuthTimer()\n}\n\nexport { init, onSessionExtended }\n","// @flow\n\nimport React, { useState, useEffect } from 'react'\nimport ReactDOM from 'react-dom'\nimport glamorous from 'glamorous'\nimport { css } from 'glamor'\nimport getContent from 'pp-react-l10n'\nimport axios from 'axios'\nimport { Modal, Button } from '@paypalcorp/pp-react'\n\nimport { ILLUSTRATIONS } from 'utils/constants'\n\nimport {\n init as initSessionTimer,\n onSessionExtended,\n} from 'utils/session-timer'\n\nconst STYLES = {\n MODAL: css({ zIndex: 99999 }),\n}\n\nconst Wrapper = glamorous.div({\n display: 'flex',\n justifyContent: 'center',\n})\nconst Container = glamorous.div({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n})\n\nconst ButtonContainer = glamorous.div({ marginTop: '2rem' })\n\nconst l10n = getContent('pages/session-timer')\n\nfunction SessionTimer() {\n const [isOpen, setIsOpen] = useState(false)\n const [isLoading, setIsLoading] = useState(false)\n\n useEffect(() => {\n initSessionTimer({\n onWarning: () => {\n setIsOpen(true)\n },\n })\n }, [])\n\n const onClose = () => {\n setIsOpen(false)\n }\n\n const onSubmit = async () => {\n // double check since React does not guarantee renders between event boundaries\n if (isLoading) {\n return\n }\n\n setIsLoading(true)\n\n try {\n await axios('/auth/extend')\n\n onSessionExtended()\n\n ReactDOM.unstable_batchedUpdates(() => {\n setIsLoading(false)\n setIsOpen(false)\n })\n } catch (e) {\n setIsLoading(false)\n }\n }\n\n return (\n \n \n \n \"\"\n

{l10n('session.all_done')}

\n {l10n('session.we_will_log_you_out')}\n \n \n \n
\n
\n \n )\n}\n\nexport default SessionTimer\n","// @flow\nimport React, { Component } from 'react'\nimport glamorous from 'glamorous'\nimport getContent from 'pp-react-l10n'\nimport { withRouter } from 'react-router-dom'\nimport { LoadingSpinner as Spinner } from '@paypalcorp/pp-react'\nimport type { RouterHistory } from 'react-router'\nimport clientData from 'utils/client-data'\nimport _ from 'lodash'\nimport { isNativeApp } from 'utils/venice'\nimport { SPINNER_ID } from 'utils/loader'\nimport {\n INSTRUMENTATION_MAP,\n SELLER_INSTRUMENTATION_MAP,\n} from 'utils/constants'\nimport { tracking, trackAction } from '../../lib/analytics'\nimport Events from 'lib/analytics/event-tags'\nconst l10n = getContent('pages/settings')\nconst Wrapper = glamorous.div({\n position: 'absolute',\n zIndex: '1050',\n width: '100%',\n height: '100%',\n background: '#f4f6f9',\n display: 'table',\n tableLayout: 'fixed',\n top: '0',\n})\nconst SpinnerContainer = glamorous.div({\n position: 'fixed',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'rgba(255, 255, 255, 0.6)',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n animation: 'vx_fade-in 0.3s ease-out 0s both',\n zIndex: 1,\n})\nconst White = glamorous.div(props => ({\n position: 'fixed',\n right: 0,\n left: 0,\n // super important for animations to work because as our route\n // \"leaves\" to the right/left of the screen, it will be hidden\n overflow: 'hidden',\n overflowY: 'auto',\n width: props.isSellerProfile ? '90%' : '66.6%',\n height: '100%',\n maxWidth: '700px',\n margin: '0 auto',\n padding: '0 20px',\n background: props.isSellerDashboardPreview ? 'none' : '#ffffff',\n '@media (max-width: 640px)': {\n width: '100%',\n padding: props.isMyProfile ? '0' : '0 20px',\n },\n}))\nconst Content = glamorous.div(props => ({\n marginTop: props.isSettingsPage ? 84 : 104,\n marginBottom: 104,\n padding: props.isProfileTreatment\n ? '0 25%'\n : props.widerPage\n ? '0 13%'\n : '0 25%',\n '@media (max-width: 1024px)': {\n padding: '0 12.5%',\n },\n '@media (max-width: 640px)': {\n padding: '0 8.33%',\n },\n '@media (max-width: 480px)': {\n padding: '0',\n },\n}))\n// the x and back button on the modal corners has a weird bounding\n// box due to use of padding instead of margin\nconst navigationItemStylingFix = {\n padding: 0,\n margin: '24px 4px 0',\n cursor: 'pointer',\n}\nconst NavLink = glamorous.a(\n 'vx_backBtn vx_backBtn_flow',\n navigationItemStylingFix,\n {\n display: 'flex',\n alignItems: 'center',\n height: '1.5em',\n\n // these overrides are to ensure the back arrow always points backwards\n // this overrides the [dir=rtl] style ruls from vx\n ':before': {\n verticalAlign: 'inherit',\n transform: 'none',\n marginTop: -2,\n },\n },\n)\ntype NavigationProps = {\n history: RouterHistory,\n isMyProfile: boolean,\n isSettingsPage: boolean,\n isTimeoutPage: boolean,\n isSellerDashboard: boolean,\n isSuccessPage: boolean,\n isLandingPage: boolean,\n isSellerSettings: boolean,\n}\nclass Navigation extends Component {\n constructor(props) {\n super(props)\n this._closeLink = React.createRef()\n }\n componentDidMount() {\n // for a11y, set the focus on the close link everytime it renders\n if (this._closeLink.current) this._closeLink.current.focus()\n }\n trackClick = linkName => {\n const currentPath = _.get(this.props, 'history.location.pathname', '')\n const isSellerRoute = currentPath.split('/')[1] === 'seller'\n\n // FPTI back instrumentation handled automatically via event handlers\n if (linkName === 'close') {\n trackAction('close')\n }\n\n if (isSellerRoute) {\n return this.trackSellerClick(linkName)\n }\n\n let pathName = currentPath.split('/')[2]\n const subPathName = currentPath.split('/')[3]\n if (subPathName) {\n pathName += `/${subPathName}`\n }\n\n const INSTRUMENTATION = INSTRUMENTATION_MAP[pathName]\n if (\n INSTRUMENTATION &&\n INSTRUMENTATION.NEW &&\n INSTRUMENTATION.NEW[linkName] &&\n Events[INSTRUMENTATION.NEW[linkName]]\n ) {\n tracking(Events[INSTRUMENTATION.NEW[linkName]]({}))\n }\n }\n trackSellerClick = linkName => {\n const slug = _.get(clientData, 'sellerProfileDetails.id')\n const currentPath = _.get(this.props, 'history.location.pathname', '')\n const hasSlugInUrl = slug && currentPath.includes(slug)\n const pathSplit = currentPath.split('/')\n if (!pathSplit.length) return\n\n // Start index if slug is there should be 3 so we can strip\n // out the slug to check SELLER_INSTRUMENTATION_MAP\n let index = hasSlugInUrl ? 3 : 2\n\n let pathName = pathSplit[index]\n index++\n\n while (index <= pathSplit.length - 1) {\n pathName += `/${pathSplit[index]}`\n index++\n }\n\n const INSTRUMENTATION = SELLER_INSTRUMENTATION_MAP[pathName]\n\n if (\n INSTRUMENTATION &&\n INSTRUMENTATION[linkName] &&\n Events[INSTRUMENTATION[linkName]]\n ) {\n if (pathName === 'error') {\n const {\n location: {\n state: {\n error: {\n headerKey = '',\n instrumentationObj: {\n decisionMsg = '',\n photoFlow = 'profile',\n isMediaservError = false,\n },\n } = {},\n } = {},\n } = {},\n } = this.props.history\n if (headerKey === 'badPhoto') {\n tracking(\n Events[INSTRUMENTATION[linkName]]({\n error_source: 'image_screen',\n error_code: decisionMsg,\n photo_uploaded_flag: photoFlow,\n }),\n )\n } else if (headerKey === 'uploadPhoto' && isMediaservError) {\n // isMediaservError distinction is needed for instrumentation since Edit photo uses the same error codes to display the error screen\n tracking(\n Events[INSTRUMENTATION[linkName]]({\n error_source: 'mediaserv',\n error_code: 'SERVICE_ERROR',\n photo_uploaded_flag: photoFlow,\n }),\n )\n }\n } else {\n tracking(Events[INSTRUMENTATION[linkName]]({}))\n }\n }\n }\n handleBackButton = e => {\n const currentPath = _.get(this.props, 'history.location.pathname', '')\n if (e.type === 'click' || e.key === 'Enter') {\n this.trackClick('back')\n if (this.props.isMyProfile) {\n this.props.history.push('/my/settings')\n } else if (this.props.isSellerSettings) {\n this.props.history.push(currentPath.replace('/settings', '/dashboard'))\n } else {\n this.props.history.goBack()\n }\n }\n }\n componentDidUpdate() {\n if (this._closeLink.current) this._closeLink.current.focus()\n }\n\n renderBackButton = () => {\n const showBackLink = !(\n this.props.isSettingsPage ||\n this.props.isTimeoutPage ||\n this.props.isSuccessPage ||\n this.props.isLandingPage ||\n this.props.isSellerDashboard\n )\n\n return (\n <>\n {showBackLink ? (\n \n \n {this.props.isMyProfile\n ? l10n('button.manage')\n : l10n('button.back')}\n \n \n ) : null}\n \n )\n }\n\n render() {\n // the navigation flow is directionality specific and should always go\n // from left to right. So we'll make sure things flow that way here too\n return (\n
\n {this.renderBackButton()}\n {!this.props.isTimeoutPage ? (\n this.trackClick('close')}\n >\n {l10n('icon.close')}\n \n ) : null}\n
\n )\n }\n}\ntype LayoutProps = {\n children: Node,\n history: RouterHistory,\n match: {\n url: string,\n },\n}\nclass Layout extends Component {\n componentDidUpdate() {\n const overpanel = document.getElementById('core-white-overpanel-navigation')\n if (overpanel) {\n overpanel.scrollTop = 0\n }\n }\n render() {\n const urlMatchArr = this.props.match.url.split('/')\n const isMyProfile = urlMatchArr[2] === 'profile'\n const isSellerProfile = urlMatchArr[1] === 'seller'\n const isSettingsPage = urlMatchArr[2] === 'settings'\n const isSuccessPage = isSellerProfile && urlMatchArr[2] === 'success'\n const isLandingPage = isSellerProfile && urlMatchArr[2] === 'landing'\n const isSellerDashboard = isSellerProfile && urlMatchArr[3] === 'dashboard'\n const isSellerDashboardPreview =\n isSellerDashboard && urlMatchArr[4] === 'preview'\n // Match length to ensure it only matches '/settings' and not '/setttings/*'\n const isSellerSettings =\n isSellerProfile &&\n urlMatchArr[3] === 'settings' &&\n urlMatchArr.length === 4\n const isNewUser = _.get(clientData, 'myProfileData.isNewUser')\n const isTimeoutPage = urlMatchArr[2] === 'session-timeout'\n\n return (\n \n \n \n \n \n {!isNewUser && !isNativeApp && !isSellerDashboardPreview && (\n \n )}\n \n {this.props.children}\n \n \n \n )\n }\n}\nexport default withRouter(Layout)\n","/**\n * For mobile apps communicate through the venice bridge when certain\n * events happen.\n *\n * @flow\n */\n\nexport const isNativeApp = Boolean(\n typeof window !== 'undefined' && window.venice,\n)\n\nconst isIOS = Boolean(\n typeof window !== 'undefined' &&\n window.navigator &&\n window.navigator.platform &&\n /iPad|iPhone|iPod/.test(navigator.platform),\n)\n\ntype ShareText = { text: string, url: string }\nexport function onShareText(obj: ShareText) {\n if (!isNativeApp) return\n if (isIOS) {\n window.venice.shareText(obj)\n } else {\n window.venice.shareText(obj.text)\n }\n}\n\ntype ProfileOptions = { profilePhotoUrl?: string }\nexport function onProfileSave({ photoDataURI = '' }: ProfileOptions = {}) {\n if (!isNativeApp) return\n\n // doesn't seem to exist for IOS at least\n if (!isIOS) {\n window.venice.profileSave()\n }\n\n // we need to check these methods exist, becuase they don't always...\n if (photoDataURI && isIOS) {\n window.venice.profileImageChanged(photoDataURI)\n }\n}\n\n// this is something about resetting the image\n// when we don't go through with profile creation\nexport function onProfileCancel() {\n if (!isNativeApp) return\n\n // doesn't seem to exist for IOS at least\n if (window.venice.profileCancel) {\n window.venice.profileCancel()\n }\n}\n\nexport function reAuth() {\n return window.venice.reAuth()\n}\n"],"sourceRoot":""}