{"version":3,"sources":["components/AddFI/AddBank/Query/index.js","components/AddFI/AddCard/Forms/SelectComboCardType/index.js","components/AddFI/AddCard/Forms/SupportedFundingSourceIcons/SupportedFundingSourceIconsBR/query.gql.js","shared/components/Link/index.js","shared/components/Link/styles.css","components/AddOption/index.js","components/AddOption/styles.css","components/AddFI/BankAsDebit/index.js","components/AddressForm/query.js","components/AddFILink/AddFILinkContainer.js","components/AddFILink/AddFILink.js"],"names":["LOCALE_PATTERN_QUERY","COMBO_CARD_ELMO_EXPERIMENT_QUERY","Feature","id","shouldLoadFeatureComponent","props","treatments","allQueryData","data","elmoExperiment","updateFeature","find","treatment","treatmentName","queries","query","variables","app","res","filters","key","value","getCountry","SUPPORTED_FUNDING_SOURCES_QUERY","Link","tag","href","newProps","tabIndex","className","cx","styles","link","type","React","createElement","children","module","exports","AddOption","label","action","containerClassName","onClick","dataTestId","getPayload","linkClassName","withPlusIcon","onMouseOver","prefetchQueries","getPayloadParams","textClassName","rest","shouldFetch","length","handlePrefetch","e","preventDefault","prefetchData","resources","classNames","container","data-testid","logger","fpti","client_epoch_ts","Date","now","onFocus","textContent","defaultProps","BANK_AS_DEBIT_QUERY","definitions","names","filter","definition","kind","name","DisallowedInstrumentFragment","FundingOptionFragment","checkBankAsDebitEligibility","checkoutSession","disallowedInstruments","fundingOptions","lengthOfDisallowedCreditCards","item","BankAsDebit","LoadingComponent","InterstitialLoading","token","getToken","fetchPolicy","subscribeTo","ADDRESS_METADATA_QUERY","getLabelContent","contingencies","customProps","features","billingChargePattern","merchantCountry","checkoutSessionType","EXPIRED_CREDIT_CARD","getContent","ADD_BANK_OR_CARD","enabled","resolvedTreatment","BANK_AS_DEBIT","experiment","isAddBankAsDebitEligible","isINDomesticBACreditOnly","userCountry","handleClickAddFundingOption","entryPoint","isAddBankOrCardEnabled","isAddFiEnabled","isAddCardFlow","showCloseBtn","requireRiskyLogin","getIsRememberedAuthState","url","getFallback","endpoint","window","location","assign","redirectToRiskyLogin","reason","destination","extraParams","lite","fromLite","ulClientKey","ulClientRedirect","onlyDisplayBankAsDebit","addCardFlow","visible","updateCardNotification","TRANSITION_PAYLOAD","from","to","entry_point","withAddFILinkContainer","WrappedComponent","enabledFeatures","isBankEnabled","isComboCardEnabled","SELECT_COMBO_CARD_TYPE","ADD_POTENTIAL_CARD","ADD_FI","role","payload","lang","getLocale","country","BILLING_ADDRESS_QUERY","GET_SUPPORTED_CARDS_QUERY","context","skipFallback","getPrefetchQueries","concat","elmoPayload","attributes"],"mappings":"4FAEA,kCAAO,IAAMA,EAAoB,ujD,8ICMpBC,EAAgC,2pEAyB9BC,gBAAQ,CACrBC,GAAI,yBACJC,2BAXiC,SAACC,GAAW,IAAD,QACtCC,GAAkB,OAALD,QAAK,IAALA,GAAA,UAAAA,EAAOE,oBAAP,mBAAsB,UAAtB,mBAA0BC,YAA1B,mBAAgCC,sBAAhC,eAAgDH,aAAc,GAGjF,OAFAI,YAAc,yBAA0B,CAAEF,KAAM,CAAEF,gBAGhDA,EAAWK,MAAK,SAACC,GAAD,MAA4C,6BAApB,OAATA,QAAS,IAATA,OAAA,EAAAA,EAAWC,oBAAgD,GAO5FC,QAAS,CACP,CACEC,MAAOd,EACPe,UAAW,CACTC,IAAK,oBACLC,IAAK,qBACLC,QAAS,CACP,CACEC,IAAK,YACLC,MAAO,qBAET,CACED,IAAK,UACLC,MAAOC,oBAhBJpB,EAsBZ,sFAAM,0DAAN,oEAAa,0BAAb,wF,kDCrDH,kCAAO,IAAMqB,EAA+B,2rD,iCCF5C,yFAKe,SAASC,EAAKnB,GAC3B,IAAMoB,EAAMpB,EAAMqB,KAAO,IAAM,SAC3BC,EAAWtB,EAWf,MATY,WAARoB,IACFE,EAAQ,iBACHtB,EADG,CAENuB,SAAU,EACVC,UAAWC,IAAGC,IAAOC,KAAM3B,EAAMwB,WACjCI,KAAM,YAIHC,IAAMC,cAAcV,EAAKE,EAAUtB,EAAM+B,Y,oBCjBlDC,EAAOC,QAAU,CAAC,sBAAsB,UAA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AAwB4G,gBAYgBiC,KAAK,SAASzH,UAAW,GAC/E,kBAACkH,EAAD,CAAkBtG,MAAOA,EAAOuG,gBAAiBA,Q,sWCtGzD,IAAM9F,EAAkB,CACtB,CACElC,MAAO8E,IACPyD,QAAS,CACPC,KAAMC,cACNC,QAASnI,gBAGb,CACEP,MAAO2I,IACPJ,QAAS,CACP7D,MAAOC,gBAGX,CACE3E,MAAO4I,IACPL,QAAS,CACP7D,MAAOC,cACP+D,QAASnI,eAEXsI,QAAS,CACPC,cAAc,KAKdC,EAAqB,SAAC,GAAyB,IACnD,EADkD,EAAtBf,iBACqC,GAAzDC,EAAR,EAAQA,cAAeC,EAAvB,EAAuBA,mBAKvB,GAJqB3B,cAKnB,MAAO,GAGT,GAAI0B,EACF,OAAO/F,EAAgB8G,OAAO,CAC5BhJ,MAAOf,IACPsJ,QAAS,CACPC,KAAMC,cACNC,QAASnI,iBAKf,GAAI2H,EAAoB,CACtB,IAAMe,EAAc,CAClB/I,IAAK,oBACLC,IAAK,qBACLC,QAAS,CACP,CACEC,IAAK,YACLC,MAAO,qBAET,CACED,IAAK,UACLC,MAAOC,iBAKb,OAAO2B,EAAgB8G,OACrB,CACEhJ,MAAOd,IACPqJ,QAASU,GAEX,CACEjJ,MAAOQ,IACP+H,QAAS,CAAE7D,MAAOC,iBAKxB,OAAOzC,GAgBM4F,uBAVG,SAAC,GAA+C,IAA7CrG,EAA4C,EAA5CA,MAAOuG,EAAqC,EAArCA,gBAAoBkB,E,oIAAiB,gCAC/D,OACE,kBAAC,IAAD,GACEzH,MAAOA,EACPS,gBAAiB6G,EAAmB,CAAEf,qBAClCkB","file":"js/AddFILink~21833f8f.2effe82f.js","sourcesContent":["import gql from 'graphql-tag';\n\nexport const LOCALE_PATTERN_QUERY = gql`\n query LocalePatternQuery($country: CountryCodes!, $lang: CheckoutContentLanguageCode!) {\n localeMetadata {\n date(countryCode: $country, languageCode: $lang) {\n displayFormat\n datePattern\n }\n }\n }\n`;\n","/**\n * Feature for the combo card type selector for BR user\n */\nimport gql from 'graphql-tag';\nimport Feature from '@/components/Feature';\nimport { getCountry } from '@paypalcorp/c3-shared-globals';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\n\nexport const COMBO_CARD_ELMO_EXPERIMENT_QUERY = gql`\n query ComboCardElmoExperiment(\n $app: String\n $filters: [ElmoFilterInput]\n $res: String!\n $uid: String = \"\"\n ) {\n elmoExperiment(app: $app, filters: $filters, res: $res, uid: $uid) {\n treatments {\n experimentName\n treatmentName\n }\n }\n }\n`;\n\nconst shouldLoadFeatureComponent = (props) => {\n const treatments = props?.allQueryData?.[0]?.data?.elmoExperiment?.treatments || [];\n updateFeature('SELECT_COMBO_CARD_TYPE', { data: { treatments } });\n\n return (\n treatments.find((treatment) => treatment?.treatmentName === 'Trmt_Combo_Cards_Brazil') || false\n );\n};\n\nexport default Feature({\n id: 'SELECT_COMBO_CARD_TYPE',\n shouldLoadFeatureComponent,\n queries: [\n {\n query: COMBO_CARD_ELMO_EXPERIMENT_QUERY,\n variables: {\n app: 'checkoutuinodeweb',\n res: 'Combo_Cards_Brazil',\n filters: [\n {\n key: 'Component',\n value: 'checkoutuinodeweb',\n },\n {\n key: 'Country',\n value: getCountry(),\n },\n ],\n },\n },\n ],\n})(() => import('./SelectComboCardType'));\n","import gql from 'graphql-tag';\n\nexport const SUPPORTED_FUNDING_SOURCES_QUERY = gql`\n query SupportedFundingSourcesQuery($token: String!) {\n checkoutSession(token: $token) {\n supportedFundingSources {\n issuers {\n name\n usage\n issuerLogoUrl {\n href\n }\n rank\n }\n }\n }\n }\n`;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport styles from './styles.css';\n\nexport default function Link(props) {\n const tag = props.href ? 'a' : 'button';\n let newProps = props;\n\n if (tag === 'button') {\n newProps = {\n ...props,\n tabIndex: 0,\n className: cx(styles.link, props.className),\n type: 'button',\n };\n }\n\n return React.createElement(tag, newProps, props.children);\n}\n\nLink.propTypes = {\n href: PropTypes.string,\n className: PropTypes.string,\n};\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"ppui-color-blue-600\":\"#0070ba\",\"ppuiColorBlue600\":\"#0070ba\",\"ppui-color-blue-800\":\"#003087\",\"ppuiColorBlue800\":\"#003087\",\"link\":\"Link_link_12w0g\"};","import React from 'react';\nimport classNames from 'classnames';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport PropTypes from 'prop-types';\nimport { prefetchData } from '@paypalcorp/c3-util-store';\nimport { PlusSVG } from '@/shared/components/Icons';\nimport Link from '@/shared/components/Link';\nimport styles from './styles.css';\n\nfunction AddOption({\n href,\n label,\n action,\n containerClassName,\n onClick,\n dataTestId,\n getPayload,\n linkClassName,\n onMouseOver,\n withPlusIcon,\n prefetchQueries,\n getPayloadParams,\n textClassName,\n ...rest\n}) {\n const shouldFetch = prefetchQueries.length !== 0;\n\n const handleClick = (e) => {\n // Analytics wants to measure how long the user action took, logging the time right at the time of click\n\n if (getPayload) {\n logger.fpti(action, getPayload({ action, client_epoch_ts: Date.now(), ...getPayloadParams }));\n }\n\n if (!href && onClick) {\n e && e.preventDefault();\n onClick(e);\n }\n };\n\n const handlePrefetch = (e) => {\n e && e.preventDefault();\n\n if (!shouldFetch) {\n return;\n }\n\n return prefetchData({ resources: prefetchQueries })(e);\n };\n\n return (\n
\n \n {withPlusIcon && }\n {label}\n \n
\n );\n}\n\nAddOption.defaultProps = {\n withPlusIcon: true,\n prefetchQueries: [],\n};\n\nAddOption.propTypes = {\n href: PropTypes.string,\n onClick: PropTypes.func,\n action: PropTypes.string,\n onMouseOver: PropTypes.func,\n dataTestId: PropTypes.string,\n withPlusIcon: PropTypes.bool,\n prefetchQueries: PropTypes.array,\n label: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.object.isRequired]).isRequired,\n getPayload: PropTypes.func,\n getPayloadParams: PropTypes.object,\n};\n\nexport default AddOption;\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"container\":\"AddOption_container_1YSQc\",\"link\":\"AddOption_link_8_YEt\",\"textContent\":\"AddOption_textContent_wSzDs\"};","import gql from 'graphql-tag';\nimport Feature from '@/components/Feature';\nimport { getToken } from '@paypalcorp/c3-shared-globals';\nimport { InterstitialLoading } from '@/shared/components/Loading';\nimport {\n DisallowedInstrumentFragment,\n FundingOptionFragment,\n} from '@paypalcorp/c3-graphql-fragments';\n\nconst BANK_AS_DEBIT_QUERY = gql`\n ${DisallowedInstrumentFragment}\n ${FundingOptionFragment}\n query DisallowedInstrumentQuery($token: String!) {\n checkoutSession(token: $token) {\n disallowedInstruments {\n ...DisallowedInstrumentFragment\n }\n fundingOptions(returnAllPlans: true, groupSourcesOnType: INCENTIVE) {\n ...FundingOptionFragment\n }\n }\n }\n`;\n\n/*\nOnly display Bank As debit component, if There are no Funding instrument or disallowed\nInstrument in customer's wallet. IF it is a Balance instrument then that is considered\nto be a invalid instrument. Customer wallet should be a 'true' empty wallet.\n */\nexport const checkBankAsDebitEligibility = (checkoutSession) => {\n const { disallowedInstruments = [], fundingOptions = [] } = checkoutSession || {};\n const lengthOfDisallowedCreditCards =\n disallowedInstruments.filter((item) => item.type === 'CREDIT_CARD')?.length || 0;\n const lengthOfFundingOptions = fundingOptions?.length || 0;\n\n return lengthOfFundingOptions === 0 && lengthOfDisallowedCreditCards === 0;\n};\n\nconst BankAsDebit = Feature({\n id: 'BANK_AS_DEBIT',\n LoadingComponent: InterstitialLoading,\n queries: [\n {\n query: BANK_AS_DEBIT_QUERY,\n variables: {\n token: getToken(),\n },\n fetchPolicy: 'cache-only',\n },\n ],\n subscribeTo: ['LINK_CARD_BY_PTHREE'],\n})(() => import('./bankAsDebit'));\n\nexport default BankAsDebit;\n","import gql from 'graphql-tag';\n\nexport const ADDRESS_METADATA_QUERY = gql`\n query AddressFormMetadataQuery($country: CountryCodes!, $lang: CheckoutContentLanguageCode!) {\n localeMetadata {\n address(countryCode: $country, languageCode: $lang) {\n layout {\n name\n regex\n minLength\n maxLength\n isRequired\n }\n strings {\n line1Label\n line2Label\n cityLabel\n stateLabel\n postcodeLabel\n stateList {\n value\n displayText\n }\n }\n }\n territories(countryCode: $country, languageCode: $lang) {\n code\n internationalDialingCode\n name\n region\n }\n }\n }\n`;\n","import React from 'react';\n\nimport { logger, TRANSITION_PAYLOAD } from '@paypalcorp/c3-util-logger';\nimport getContent from '@/lib/content';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\nimport { redirectToRiskyLogin } from '@/lib/redirects';\nimport { getCountry, getFallback } from '@paypalcorp/c3-shared-globals';\nimport { isINDomesticBACreditOnly } from '@/lib/checkoutSession';\nimport { getIsRememberedAuthState } from '@/authStates';\nimport { checkBankAsDebitEligibility } from '@/components/AddFI/BankAsDebit';\n\nconst isAddBankAsDebitEligible = (props) => {\n const { resolvedTreatment } = props.features.BANK_AS_DEBIT?.experiment || {};\n const { checkoutSession = {} } = props.allQueryData?.[1]?.data ?? {};\n\n return resolvedTreatment !== 'CONTROL' && checkBankAsDebitEligibility(checkoutSession);\n};\n\nconst getLabelContent = (props) => {\n const { contingencies,customProps, features } = props;\n const { billingChargePattern, merchantCountry, checkoutSessionType } = customProps;\n const { EXPIRED_CREDIT_CARD } = contingencies;\n \n if (EXPIRED_CREDIT_CARD) {\n return getContent('addCard.updateExpiredCreditCard.title');\n } else if (features.ADD_BANK_OR_CARD.enabled || isAddBankAsDebitEligible(props)) {\n return getContent('addFi.title.addPaymentMethod');\n } else if (\n isINDomesticBACreditOnly({\n billingChargePattern,\n checkoutSessionType,\n merchantCountry,\n userCountry: getCountry(),\n })\n ) {\n return getContent('addFi.title.addCreditCard');\n } else {\n return getContent('addFi.title.addDebitOrCreditCard');\n }\n};\n\nexport function handleClickAddFundingOption({\n entryPoint,\n isAddBankOrCardEnabled,\n isAddCardFlow,\n isAddFiEnabled,\n showCloseBtn,\n}) {\n const requireRiskyLogin = getIsRememberedAuthState();\n\n if (!isAddFiEnabled) {\n const { endpoint } = getFallback() || {};\n const reason = isAddBankOrCardEnabled ? 'addBank' : 'addCard';\n const url = `${endpoint}&reason=${reason}`;\n\n return window.location.assign(url);\n }\n\n // Risky login is required any logged user with a `REMEMBERED` auth state which includes\n // one touched, SMS OTP, implicit UDT and `link & pay` (Billing agreement) use cases as of now\n if (requireRiskyLogin) {\n return redirectToRiskyLogin({\n reason: 'ADD_FI',\n destination: 'ADD_FI',\n extraParams: {\n lite: 1,\n fromLite: 1,\n ulClientKey: 'loginAddCard',\n ulClientRedirect: 'insufficientPermission',\n },\n });\n }\n\n // when user clicks AddFILink, hide potential cards from interstitial\n if (showCloseBtn) {\n updateFeature('ADD_POTENTIAL_CARD', {\n data: {\n onlyDisplayBankAsDebit: true,\n addCardFlow: false, // reset interstitial close button state\n },\n });\n }\n\n // by default clicking on button should open Add Card interstitial\n // for CPA when the link shows update we set the variable to true, resetting it to have the correct header\n updateFeature('ADD_FI', { visible: true, data: { entryPoint, updateCardNotification: false } });\n\n logger.fpti(\n 'addFi',\n TRANSITION_PAYLOAD({ from: 'review', to: 'prepare_add_fi', entry_point: entryPoint })\n );\n}\n\n/**\n * HOC for all Add FI links\n */\nexport const withAddFILinkContainer = (WrappedComponent) => {\n return function AddFILinkContainer(props) {\n const onClickHandler = () => {\n handleClickAddFundingOption({\n isAddBankOrCardEnabled: features.ADD_BANK_OR_CARD.enabled,\n isAddCardFlow: features?.ADD_POTENTIAL_CARD?.data?.addCardFlow,\n isAddFiEnabled: features.ADD_FI.enabled,\n showCloseBtn: features?.ADD_FI?.data?.showCloseBtn,\n });\n };\n\n const { features } = props;\n const label = getLabelContent(props);\n const enabledFeatures = {\n isBankEnabled: features?.ADD_BANK_OR_CARD?.enabled,\n isComboCardEnabled: features?.SELECT_COMBO_CARD_TYPE?.enabled,\n };\n\n return (\n
\n \n
\n );\n };\n};\n","import React from 'react';\n\nimport { getToken, getCountry, getLocale } from '@paypalcorp/c3-shared-globals';\n\nimport AddOption from '@/components/AddOption';\nimport { ADDRESS_METADATA_QUERY } from '@/components/AddressForm/query';\nimport { BILLING_ADDRESS_QUERY } from '@/components/AddFI/query.gql';\nimport { GET_SUPPORTED_CARDS_QUERY } from '@/components/AddFI/AddCard/query.gql';\nimport { getIsRememberedAuthState } from '@/authStates';\nimport { withAddFILinkContainer } from './AddFILinkContainer';\nimport { LOCALE_PATTERN_QUERY } from '@/components/AddFI/AddBank/Query';\nimport { COMBO_CARD_ELMO_EXPERIMENT_QUERY } from '@/components/AddFI/AddCard/Forms/SelectComboCardType';\nimport { SUPPORTED_FUNDING_SOURCES_QUERY } from '@/components/AddFI/AddCard/Forms/SupportedFundingSourceIcons/SupportedFundingSourceIconsBR/query.gql';\n\nconst prefetchQueries = [\n {\n query: ADDRESS_METADATA_QUERY,\n payload: {\n lang: getLocale(),\n country: getCountry(),\n },\n },\n {\n query: BILLING_ADDRESS_QUERY,\n payload: {\n token: getToken(),\n },\n },\n {\n query: GET_SUPPORTED_CARDS_QUERY,\n payload: {\n token: getToken(),\n country: getCountry(),\n },\n context: {\n skipFallback: true,\n },\n },\n];\n\nconst getPrefetchQueries = ({ enabledFeatures }) => {\n const { isBankEnabled, isComboCardEnabled } = enabledFeatures || {};\n const isRemembered = getIsRememberedAuthState();\n\n // For SCA scenarios:\n // If the global auth state is REMEMBERED but the access token is PARTIALLY AUTHENTICATED, stop the pre-fetch and redirect and to risky login.\n if (isRemembered) {\n return [];\n }\n\n if (isBankEnabled) {\n return prefetchQueries.concat({\n query: LOCALE_PATTERN_QUERY,\n payload: {\n lang: getLocale(),\n country: getCountry(),\n },\n });\n }\n\n if (isComboCardEnabled) {\n const elmoPayload = {\n app: 'checkoutuinodeweb',\n res: 'Combo_Cards_Brazil',\n filters: [\n {\n key: 'Component',\n value: 'checkoutuinodeweb',\n },\n {\n key: 'Country',\n value: getCountry(),\n },\n ],\n };\n\n return prefetchQueries.concat(\n {\n query: COMBO_CARD_ELMO_EXPERIMENT_QUERY,\n payload: elmoPayload,\n },\n {\n query: SUPPORTED_FUNDING_SOURCES_QUERY,\n payload: { token: getToken() },\n }\n );\n }\n\n return prefetchQueries;\n};\n\n/**\n * Render add FI link button to show / hide the AddFI Interstitial\n */\nconst AddFILink = ({ label, enabledFeatures, ...attributes }) => {\n return (\n \n );\n};\n\nexport default withAddFILinkContainer(AddFILink);\n"],"sourceRoot":""}