{"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":["mapStyles","styles","opacity","transform","offset","AnimatedSwitchPagination","props","useEffect","window","scrollTo","className","runOnMount","location","pathname","atEnter","action","history","atLeave","atActive","data-test-id","children","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","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","WhiteWidth","maxWidth","isFullScreen","margin","padding","isSellerDashboardPreview","isSellerProducts","phoneLandscapeMaxAndSmaller","isMyProfile","Content","contentMarginTop","marginBottom","isSellerProfile","widerPage","tabletLandscapeMaxAndSmaller","phoneLandscapeMinAndSmaller","navigationItemStylingFix","cursor","NavLink","verticalAlign","Navigation","linkName","currentPath","getCurrentPath","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","isSettingsPage","isTimeoutPage","isSuccessPage","isLandingPage","isSellerDashboard","tabIndex","onKeyDown","handleBackButton","data-testid","aria-label","_closeLink","React","createRef","this","current","focus","style","dir","renderBackButton","href","flowCancelUrl","ref","Component","matchUrl","urlMatchArr","positions","paths","i","Layout","document","getElementById","scrollTop","match","url","isNewUser","isPersonalProfileSlug","isVisaPlus","id","SPINNER_ID","size","screenReaderText","theme","isNativeApp","Boolean","isIOS","navigator","platform","test","onProfileSave","photoDataURI","profileSave","profileImageChanged","reAuth"],"mappings":";;;;;;;;;;;0mBA8BA,IAAMA,EAAY,SAAAC,GAAM,MAAK,CAC3BC,QAASD,EAAOC,QAChBC,UAAW,cAAF,OAAgBF,EAAOG,OAAvB,SAGJ,SAASC,EAAyBC,GAKvC,OAJAC,qBAAU,WACRC,OAAOC,SAAS,EAAG,MAInB,kBAAC,IAAD,aACEC,UAAU,iBACVC,WAAkC,MAAtBC,SAASC,UA7BlB,CACLC,QAAS,CACPV,OAAmB,UAHAW,EA+BCT,EAAMU,QAAQD,QA5BN,KAAO,IACnCb,QAAS,GAEXe,QAAS,CACPb,OAAmB,SAAXW,GAAqB,IAAM,IACnCb,QAAS,GAEXgB,SAAU,CACRd,OAAQ,EACRF,QAAS,IAgBX,CAIEF,UAAWA,EACXmB,eAAa,yBAEZb,EAAMc,UAnCb,IAAyBL,EAwCVM,sBAAWhB,I;;;;;;;;;;;;;;;;;;;gHC9CtBiB,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,WACxBtB,OAAOI,SAASoB,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,UAl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D,eAAgBA,EAChBhD,UAAWL,GAAeI,EAC1BV,aAAcA,GAEbwE,KAAK7J,MAAMc,gB,GAvFHwJ,aA8FNvJ,sBAAW6J,I;;;;;oFC3a1B,sGAOO,IAAMc,EAAcC,QACP,oBAAXzL,QAA0BA,OAAOqB,QAGpCqK,EAAQD,QACM,oBAAXzL,QACLA,OAAO2L,WACP3L,OAAO2L,UAAUC,UACjB,mBAAmBC,KAAKF,UAAUC,WAc/B,SAASE,IAA0D,6DAAJ,GAAI,IAA1CC,oBAA0C,MAA3B,GAA2B,EACnEP,IAGAE,GACH1L,OAAOqB,OAAO2K,cAIZD,GAAgBL,GAClB1L,OAAOqB,OAAO4K,oBAAoBF,IAe/B,SAASG,IACd,OAAOlM,OAAOqB,OAAO6K","file":"ppme-shared.bundle.js","sourcesContent":["// @flow\n\nimport React, { useEffect } 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\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\nconst mapStyles = styles => ({\n opacity: styles.opacity,\n transform: `translateX(${styles.offset}px)`,\n})\n\nexport function AnimatedSwitchPagination(props: Props) {\n useEffect(() => {\n window.scrollTo(0, 0)\n })\n\n return (\n \n {props.children}\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'\nimport {\n phoneLandscapeMaxAndSmaller,\n tabletLandscapeMaxAndSmaller,\n phoneLandscapeMinAndSmaller,\n} from '../../lib/styles/media-queries'\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.WhiteWidth,\n height: '100%',\n maxWidth: !props.isFullScreen && '700px',\n margin: '0 auto',\n padding: '0 20px',\n background:\n props.isSellerDashboardPreview || props.isSellerProducts\n ? 'none'\n : '#ffffff',\n [phoneLandscapeMaxAndSmaller]: {\n width: '100%',\n padding: props.isMyProfile ? '0' : '0 20px',\n },\n}))\nconst Content = glamorous.div(props => ({\n marginTop: props.contentMarginTop,\n marginBottom: props.isFullScreen ? 0 : 104,\n padding: !props.isSellerProfile\n ? '0 25%'\n : props.widerPage\n ? '0 13%'\n : '0 25%',\n [tabletLandscapeMaxAndSmaller]: {\n padding: '0 12.5%',\n },\n [phoneLandscapeMaxAndSmaller]: {\n padding: '0 8.33%',\n },\n [phoneLandscapeMinAndSmaller]: {\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)\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) {\n this._closeLink.current.focus()\n }\n }\n\n getCurrentPath = history => {\n return _.get(history, 'location.pathname', '')\n }\n\n trackClick = linkName => {\n const currentPath = this.getCurrentPath(this.props.history)\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 = this.getCurrentPath(this.props.history)\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 = this.getCurrentPath(this.props.history)\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) {\n this._closeLink.current.focus()\n }\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}\n\n// NOTE: Update all matches to use this function\n/**\n *\n * @param {*} urlMatchArr - contains url split by '/'\n * @param {*} positions - array containing indices in urlMatchArr we want to check\n * @param {*} path - array containing path string to be matched with indices\n * @returns whether a url matches what we are expecting\n */\nconst matchUrl = (urlMatchArr, positions, paths) => {\n for (let i = 0; i < positions.length; i++) {\n if (urlMatchArr[positions[i]] !== paths[i]) {\n return false\n }\n }\n return true\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 const isSellerProducts = isSellerProfile && urlMatchArr[5] === 'products'\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 // We are expecting index 1 of urlMatchArr to be 'my' and index 2 to be 'createusername'\n const isPersonalProfileSlug = matchUrl(\n urlMatchArr,\n [1, 2],\n ['my', 'createusername'],\n )\n const isVisaPlus = matchUrl(urlMatchArr, [1], ['visa-plus'])\n const isFullScreen = isPersonalProfileSlug || isVisaPlus\n\n let WhiteWidth = '66.6%'\n let contentMarginTop = 104\n if (isFullScreen) {\n WhiteWidth = '100%'\n contentMarginTop = 0\n } else if (isSellerProfile) {\n WhiteWidth = '90%'\n }\n\n if (isSettingsPage) {\n contentMarginTop = 84\n }\n\n return (\n \n \n \n \n \n {!isFullScreen &&\n !isNewUser &&\n !isNativeApp &&\n !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":""}