{"version":3,"sources":["components/CheckoutButton/constants.js","lib/landingPage.js","lib/contingencies.js","lib/apolloLinks/spinnerLink.js","lib/apolloLinks/instrumentationLink.js","lib/apolloLinks/authLink.js","lib/checkoutError.js","lib/fraudNet.js","shared/components/SpinnerOverlay/styles.css","shared/components/EmptyLoader/index.js","components/Feature/index.js","lib/credit.js","lib/cookie.js","shared/components/Spinner/styles.css","lib/cplUtils.js","components/CreditOffer/index.js","components/CreditOffer/Mutation/index.js","components/CreditOffer/utils.js","authStates.js","shared/components/LoadingContainer/index.js","components/CreditOffer/Loading/index.js","shared/components/Spinner/index.js","shared/components/SpinnerOverlay/index.js","components/Disclaimer/CPADisclaimer/query.gql.js","components/SharedCard/constants.js","lib/apolloCache.js","components/SharedCard/SharedCardWait/Mutation/index.js","lib/utils.js","lib/redirects.js","lib/invalidateCheckoutSessionPlan.js","lib/preRenderSteps.js","lib/linkCardByPthree/index.js","lib/linkCardByPthree/performReplanAfterPthreeFlow.js","AppBootstrap.js","C3Bootstrap.js","AppIndex.js","lib/fiBalance/checkFIBalance.js","lib/fiBalance/index.js","lib/configureApolloClient.js","features.js","components/Spinner/ReturnToMerchantSpinner/index.js","components/Feature/FeatureContainer.js","components/Feature/AnimatedContainer.js","lib/windowEligibility.js","App.js","components/CreditOffer/Loading/styles.css","components/ErrorBoundary/ErrorBoundary.js","components/ErrorBoundary/index.js","polyfills.js","index.js","preInit.js","App.global.css","components/Spinner/DefaultSpinner/index.js","components/Spinner/index.js","lib/content.js","lib/lazyLoad.js","components/ReturnFromCredit/utils.js","components/Feature/hooks.js"],"names":["SHOW_POLICIES_COUNTRIES_LIST","LANDING_PAGE","REVIEW","CHOICE","HANDLED_CONTINGENCIES","SHARED_CARD_CONTINGENCIES","GLOBAL_CONTINGENCIES_HANDLERS","VERIFY_USER_IDENTITY","errorData","step_up_context","redirectToAuthChallenge","redirectGenericError","PAYER_ACTION_REQUIRED","message","cause","resolution","resolutionName","name","isIframe","fallback","reason","redirectToNegativeBalanceRecovery","PAYER_AUTHENTICATION_REQUIRED","logger","cal","info","isObject","redirectToRiskyLogin","extraParams","lite","fromLite","invalidateCheckoutSessionPlan","ulClientKey","ulClientRedirect","LINK_AND_PAY_TOKENS_MISMATCH","redirectToLogout","hermes","PAYER_INVALID_FOR_PAYMENT","TRANSACTION_REFUSED","code","replace","UNRECOVERABLE_ERROR","spinnerLink","ApolloLink","operation","forward","operationName","variables","operationType","getOperationType","spinnerType","SPINNER_TYPES","DEFAULT","PROCESS_CARD","PROCESS_INCENTIVE","cryptocurrencyQuoteId","CRYPTO_SELLING","triggerToggleSpinner","visible","updateFeature","data","type","Observable","observer","subscription","subscribe","next","result","error","statusCode","complete","bind","unsubscribe","instrumentationLink","logFlushed","payload","payloadResolvers","is_gambling","get","Object","keys","forEach","key","undefined","addToPayload","value","isUndefined","this","logPayload","fpti","TRANSITION_PAYLOAD","from","to","logPayloadIfReady","some","k","resolveAndLog","window","logCPLPhase","resolvedValue","err","stack","toString","request","authLink","headers","accessToken","getAccessToken","setContext","prevContext","oldAccessToken","newAccessToken","params","euat","location","hash","substr","LOG_PREFIX","attemptRedirect","fallbackSettings","getFallback","Error","e","fallbackTriggered","redirectOnError","CheckoutError","networkError","checkoutError","parsedError","graphQLErrors","length","details","map","parseError","includes","ecToken","getGlobals","user","timestamp","Date","now","token","soldOutUrl","soldoutUrl","APP_NAME","getClientMetadataID","defaultID","urlParams","xprops","clientMetadataID","initFraudNet","getToken","fraudNetEndpoint","deployEnv","fraudNetConfig","userToken","sourceId","endpoint","addCrossOrigin","production","typingSpeed","delegate","fields","id","min","fraudNet","module","exports","EmptyLoader","resolveWrappedComponentByExperiment","wrappedComponent","experimentResult","prop","mapContingencies","contingencies","reduce","obj","mapFeature","feature","mapFeatures","features","mapQueriesData","queries","nullToUndefined","push","getQueriesByFetchPolicy","fetchPolicy","negation","filter","q","resolveLazyFeatureComponent","WrappedComponent","finalData","LoadingComponent","ErrorComponent","country","Feature","FeatureComponents","ResolvedWrappedComponent","experiment","getResolvedTreatment","wrappersByExperiment","experiments","wrappersByCountry","countrySpecific","countrySpecificWrapper","resolveWrappedComponent","lazyComponent","loading","config","interstitialOptions","interstitial","shouldAutoDisplayComponent","shouldLoadFeatureComponent","shouldLoadFeatureInstance","withoutLoadingState","subscribeTo","animateOptions","shouldKeepLoadingStateOnError","subscribeToContingencies","Composed","props","cacheOnlyGqlQueries","cacheOnlyGqlQueryResult","useGqlNetworkQuery","featuresQueryResult","mapFeaturesQueryResult","useFeatureQuery","find","f","getFeatureById","contingenciesQueryResult","contingency","indexOf","mapContingenciesQueryResult","useContingencyQuery","networkGqlQueries","networkGqlQueryResult","skip","enabled","queriesResult","isGqlLoading","getIsGqlQueriesLoading","isGqlDataResolved","getIsGqlDataResolved","hasError","getIsGqlHasError","getShouldLoadLoadingComponent","allQueryData","customProps","shouldLoadFeature","isFunction","Boolean","getShouldLoadFeatureComponent","autoDisplay","isControl","getShouldAutoDisplayComponent","shouldTriggerInitialCPLEvent","updateHasContingencies","disableInitialCPLEvent","shouldLoadInstance","getShouldLoadFeatureInstance","onBeforeCloseFn","showCloseBtnFunc","showCloseBtn","headerTitleFunc","headerTitle","typeFunc","resolveInterstitialOptions","FeatureComponent","getCountry","FeatureContainer","render","React","PureComponent","CLEAR_CHECKOUT_SESSION_CREDIT_FINANCING_OPTION_MUTATION","creditPpcOffersGqlParams","areCookiesDisabled","filterOutCreditInstruments","fundingOption","isPayLaterFundingInstrument","fundingInstrument","clearCreditFinancingOption","getClient","mutate","mutation","context","skipFallback","then","catch","finally","returnFromCreditPayInFull","status","CHECKOUT_BUTTON_STATES","RESOLVED","flow","setCookieEnabled","navigator","cookieEnabled","PAGE","ECONSENT","ADD_FI","ADD_SHIPPING_ADDRESS","_store","triggerInitialCPLEvent","hasContingencies","triggerCPLLatencyMetricsFPTI","page","timeToInteract","cplPhases","comp","rest","query","chunk","serverSideCplMetrics","toLowerCase","start","tt","populateServerSideCplMetrics","visibilityEvents","hidden","timeTaken","populateVisibilityMetrics","cplLatencyMetrics","state_name","transition_name","page_name","cpl_comp_metrics","JSON","stringify","cpl_query_metrics","cpl_chunk_metrics","total_page_load_time","updateTriggerInitialCPLEvent","state","getTimeToInteract","cpl","logPerformance","action","uicomp","uitype","CreditOfferFragment","definitions","names","definition","kind","FundingOptionFragment","CreditFinancingOptionFragment","CreditOffer","planningBatch","getCreditOffer","content","every","placement","choiceLandingPage","SELECT_FI","landingPage","Loading","US","GB","CREATE_CREDIT_KEY_MUTATION","createReturnUri","returnUriBase","protocol","host","newParams","buildURL","mapCreditPPCOffer","presentmentType","creditPPCOffers","offer","Product","PresentmentType","prevOffer","currentOffer","rank","checkoutSession","fundingOptions","flags","showPPCreditOffer","Array","isArray","OfferCategory","REVIEW_PAYLOAD","isCreditSecondButton","getCredit","creditFundingInstrument","getCreditFundingInstrument","allPlans","plan","isSelected","isPreferred","showPPCReuseBanner","filteredCreditPPCOffers","redirectToHermesCape","creditOffer","offerType","OfferType","isInstallmentCreditType","redirectToCapeWithCreditKey","creditFundingInstrumentId","userSelectedAddressId","userSelectedPreferredShippingAddressId","pageContext","getPageContext","isCrossCurrencyTransaction","creditIncentiveDetails","getCreditIncentiveDetails","cartAmount","CartAmount","cartCurrency","CartAmountCurrencyCode","warn","triggerCreateCreditKeyMutation","response","createCapeMayflyPayload","redirectToCape","creditSecondButtonRedirect","creditRedirectExperiment","newUser","isEligibleForCreditSecondButton","ppc_ineligible","fallbackToHermes","getIsRememberedAuthState","getAuthState","getIsUserOneTouchLogin","getClaims","getIsUserSkipFacebookLogin","getIsUserDeviceTokenImplicitLogin","className","data-testid","children","clipPathId","uniqueStr","gradientId","styles","viewBox","preserveAspectRatio","clipPath","x","y","width","height","fill","rx","ry","offset","stopColor","stopOpacity","attributeName","values","dur","repeatCount","Spinner","SpinnerImage","SpinnerLoader","SpinnerOverlay","extraMessage","tabIndex","role","cx","SpinnerMessage","SpinnerContent","CPA_DISCLAIMER_QUERY","apolloInMemoryCache","options","InMemoryCache","dataIdFromObject","object","__typename","addressId","defaultDataIdFromObject","CHECKOUT_SESSION_REPLAN_MUTATION","PaymentContingenciesFragment","DeclinedInstrumentFragment","_isViewportSmall","_getDeviceAndNetworkInfo","_isIframe","isPopup","_isPopup","_resetParams","_params","isIncontext","isLegacyIncontext","isNewIncontext","postToMerchantForOldIncontext","msg","flush","opener","userAgent","match","postMessage","bridge","frames","PayPalBridge","returnToParent","isVzeroIntegration","incontext","nolegacy","setDestination","featureId","BrowserStorage","set","clearDestination","remove","isDestination","destination","memoized","storageDestination","split","destFeatureId","reset","getProtocolType","url","urlType","deepLinkRegex","RegExp","nonStandardRegex","standardRegex","relativePathRegex","isDeepLink","test","isNonStandard","isStandard","isRelativePath","creditOfferType","isPaypalCreditFundingInstrument","selectedFundingOption","item","isIncentivesPlan","fundingSources","incentives","source","getGplOffer","creditAsFIOffers","product","gplAmountDueTodayDetails","installmentsSchedules","gplAmountDueToday","downPayment","installmentsSchedule","paymentType","totalPayment","dueDate","getContent","getEligibilityForAPQ","treatment_name","getIntegrationPayload","sdkMeta","xComponent","xcomponent","BLACKLISTED_REDIRECT_QUERY_PARAMS","flushLogsAndRedirect","redirect","Promise","resolve","logName","doRedirect","redirected","setTimeout","mapCheckoutJsContext","returnUrl","cancelUrl","billingToken","intent","orderID","payerID","userId","paymentToken","paymentID","paymentId","returnCancel","currencyCode","merchantName","errorCode","native_xo","reconstructReturnUrl","RETURN_PAYLOAD","currency_code","onCancel","updateParent","ERROR_PAYLOAD","returnToMerchantAfterApprove","approveMemberPaymentResultPayload","buyer","cart","RETURN_TO_MERCHANT","updatedReturnUrl","onAuthorize","vzero","getConnectURL","connectURL","assign","rejectOnTimeout","getIsResolveThreeDS","payment_id","return_url","updated_return_url","merchant_name","returnAuthorize","href","queryParams","btoa","cancelLink","genericErrorUrl","paramKeys","blacklistedKey","redirectToOpenBanking","encryptedId","openBankingUrl","redirectToP3Flow","partnerName","currentQueryParam","partner_name","returnUri","p3StartUrl","negativeBalanceRecoveryUrl","uri","negativeBalanceRecoveryEndpoint","redirectToLogin","ctx","ulAsLandingUrl","pathname","logoutUrl","redirectedToAuthChallenge","stepupContext","atoSuccess","authEndPoint","authNodeWebEndpoint","authchallengeEndpoint","authChallengeUrl","baseUrl","hashUrl","defaultRemoved","hermesUrl","blacklistRegex","join","windowOpen","reject","isUnsafeRedirect","inputUrl","open","previousParams","previousQueryString","fallbackUrl","isVzero","redirectUri","redirect_uri","fromNative","invalidIntegrationType","native","payer_id","opType","return_uri","finalReturnUrl","reconstruct_return_url","redirectOnThreeDSFailed","originApp","threeDSFailed","THREE_DS_PAYLOAD","redirectUrl","redirectToSameLocationWithNewParam","newUrl","redirectToMNWAddBank","INVALIDATE_CHECKOUT_SESSION_PLAN_MUTATION","invalidateCheckoutSessionPlanIfNeeded","client","executePreRenderSteps","checkP3ReturnStep","success_card_num","failed_card_num","errorStatus","successCardNum","parseInt","failedCardNum","logHelper","logFPTI","checkRealTimeCardAddHelper","eventType","checkRealTimeCardAdd","isSuccessCardExists","isFailedCardExists","isNaN","intErrorCode","intErrorDesc","GENERIC_PAYLOAD","int_error_code","int_error_desc","STATE_NAME","addCard","fi_count","flowStatus","pthreeFailureReason","threeDsExperienceVars","checkCardAdd","numberOfCards","contentKey","updateFeatures","display","initAppQuery","AppBootstrap","ready","componentDidMount","formFactor","logPerformanceNow","integrationType","windowName","networkAndDeviceData","getDeviceAndNetworkInfo","appPerformanceEvents","paypal","allowIframe","top","globals","updateGlobals","access_token","onAuth","checkFIBalanceStep","transition","LOG_TRANSITIONS","BOOTSTRAP","setState","cartTotal","merchantId","onInit","landingUrl","initIncontextFromData","currencyValue","mrid","curr","amt","attachPaJsFpti","TRANSACTION_DETAILS","Component","C3Bootstrap","entry","lang","getLocale","AddCard","ThreeDS","nonce","AppIndex","createCache","stylisPlugins","getDirectionality","stylisRTL","App","CLEAR_REAL_TIME_BALANCE_CONTINGENCY","checkRealTimeBalance","bankId","checkFIBalance","clearRealTimeBalanceContingency","hasFI","fi","INITIAL","blackListedFI","createClient","queryEndpoint","auth","enableBatching","enableRetry","cache","mockLink","schemaLink","setFeatures","continueButtonAction","creditFIOption","forceRadioButton","preferredFundingOptionId","selectedFundingOptionId","usePayAfterDelivery","useSplitBalance","isEnabledForCountry","ElmoExperiment","initWithDefaultTreatment","rewardAmount","rewardCurrency","rewardSelected","TREATMENTS","TREATMENT_1","updateCardNotification","address","card","checkoutButtonLabelOverride","validShippingMethod","inContingencyFlow","showDescriptor","creditOfferLabel","continueButtonText","isChangeShippingLinkClicked","toggle","shareAddressWithDonatee","IS_STICKY_ENABLED","selected","normalizedAddress","originalAddress","giveAtCheckoutOpted","giveAtCheckoutNonProfitId","treatments","isCapOpen","selectedCRCOfferID","isGPLFi","bankData","hideDeclineNotification","addBankAsDebit","p3Enabled","isSplitReady","userCanSplit","showSplitContinue","showSplitExperience","isNewCard","fundingInstrumentId","phone","number","countryCode","eConsentTriggerRefresh","acknowledged","fundingInstrumentIdToSelect","isAPQEligible","httpLink","createHttpLink","credentials","batchLink","BatchHttpLink","planningBatchLink","splitLink","getContext","errorLink","onError","desc","errorCodes","Set","getIsLinkAndPay","isContingency","contingencyCode","updateContingency","process","retryLink","RetryLink","delay","initial","max","jitter","attempts","count","skipRetry","batching","retry","apolloCache","apolloClient","ApolloClient","link","apolloLinks","apqSplitLink","createPersistedQueryLink","concat","apqHttpLink","getLinks","resolvers","writeData","defaultApolloCacheState","setClient","ReturnToMerchantSpinner","TREATMENT_2","TREATMENT_3","LazyInterstitialContainer","callOnPropChange","prevProps","propValue","onAutoDisplayChange","onShouldLoadFeatureChange","eligible","logExperiment","eligibility","setEnablement","shouldLoadFeaturePayload","autoDisplayPayload","setEnablementPayload","componentDidUpdate","prevState","snapshot","renderWrappedComponent","isLoading","renderInterstitial","renderWithAnimateHeight","animateOpacity","animateContainerClass","animateHeight","Fragment","AnimatedContainer","attributes","useState","shouldRender","setRender","useEffect","duration","isTesting","style","overflow","onAnimationEnd","windowEligible","eligibleForHermione","incontextUnsupportedMessenger","experience","messenger","isPartnerIntegration","isCreditApplyReturnFlow","success","isSkipFacebookLoginFlow","isNewContext","isLegacyContext","ppFrameRedirect","btQueryParams","bt_int_type","webview","isWebView","eligibility_reason","windowEligibility","Hermione","ThreeDSFullPageApp","LinkPayApp","hot","ErrorBoundary","__webpack_public_path__","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","closest","s","el","document","documentElement","contains","parentElement","parentNode","nodeType","setPrototypeOf","__proto__","tslib","require","hoistNonReactStatics","__extends","target","apply","Number","__webpack_nonce__","MockedMode","lazy","INIT","initialData","initGlobals","initContent","init","loggerEndpoint","externalName","internalName","experienceName","context_type","common","integration_type","configureApolloClient","MockedModeLoader","Application","ReactDOM","getIsMockedMode","Suspense","getElementById","startApp","settings","debug","DefaultSpinner","SpinnerPortal","createPortal","body","SpinnerComponent","selectedFI","THREE_DS_PROCESSING","useFeature","IGNORE_MISSING_CONTENT_KEYS","shouldIgnoreLoggingMissingContentKeys","ignoreKey","args","i18n","String","lazyLoadChunkWithRetry","fn","retriesLeft","interval","console","reload","dynamicImport","LoaderComponent","LazyComponent","forwardRef","ref","strToBool","CrossCurrencyTransaction","offerProgramId","offerValue","offerCurrencyCode","offerProgramCode","touchpoint","headlineText","HeadlineText","offerText1","OfferText1","offerText2","OfferText2","termsLink","TermsLink","termsLinkText","TermsLinkText","termsText","TermsText","buyItemId","referenceId","isParamEnabled","mayflyKey","capeUrl","capeEndpoint","getCapeReturnMutationVariables","financial_instrument_id","financial_instrument_details","financing_code","apr","term","credit_type","paypal_subsidy","monthly_percentage_rate","total_cost","total_interest","monthly_payment","currency","financialInstrumentId","financialInstrumentDetails","financingCode","creditType","paypalSubsidy","monthlyPercentageRate","totalCost","totalInterest","monthlyPayment","handleShipTo","mayflyData","shouldUpdateShipTo","user_selected_address_id","user_selected_preferred_shipping_address_id","idx","getOperationName","useQuery","errorPolicy","getSingleFeatureQuery","getContingenciesQuery","useContingency"],"mappings":"4FAAA,qHAEO,IAAMA,EAA+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uBADA,MAAwB,GAAxB,GACqBsD,MAAK,SAACI,GAAD,OAAiBA,EAAYrE,KAAOA,YAA9D,QAAqE,KAahE,SAASgzB,EAAWhzB,GACzB,MAAwCw3B,mBAASE,IAAuB,CACtE9+B,UAAW,CAAEoH,QADPvG,KAAR,gBAAiC,GAAjC,GAAgBsH,QAIhB,YAJA,MAA0B,GAA1B,IAKa,CACT6D,SAAS,EACTrL,SAAS,EACTE,KAAM,O","file":"js/main~06837ae4.35228182.js","sourcesContent":["export { IS_STICKY_ENABLED, CHECKOUT_BUTTON_STATES } from '@paypalcorp/c3-util-store';\n\nexport const SHOW_POLICIES_COUNTRIES_LIST = ['US', 'AU'];\n","export const LANDING_PAGE = {\n REVIEW: 'REVIEW',\n CHOICE: 'CHOICE',\n};\n","import {\n fallback,\n redirectToLogout,\n redirectGenericError,\n redirectToRiskyLogin,\n redirectToAuthChallenge,\n redirectToNegativeBalanceRecovery,\n} from '@/lib/redirects';\nimport { isIframe } from '@paypalcorp/c3-util-browser';\nimport { isObject } from '@paypalcorp/c3-util-lang';\nimport { SHARED_CARD_CONTINGENCIES } from '@/components/SharedCard/constants';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\n// This is a list of current contingency Hermione is currently aware of and will be\n// handling corresponding contingency accordingly with its own set of handlers\nexport const HANDLED_CONTINGENCIES = [\n 'NEED_CREDIT_CARD',\n 'EXPIRED_CREDIT_CARD',\n 'NEED_CREDIT_CARD_OR_BANK_ACCOUNT',\n 'SEPA_ACCEPT_CONTINGENCY',\n 'CC_AUTHORIZATION_DECLINED',\n 'ALLOWED_CARD_TYPES_COULD_NOT_BE_RETRIEVED', // handle `GET_SUPPORTED_CARDS_QUERY` contingency\n 'NEED_SHIPPING_ADDRESS', // handle `NEED_DOMESTIC_SHIPPING_ADDRESS_TO_PAY` contingency\n 'NEED_PRIMARY_ADDRESS', // handle `NEED_PRIMARY_ADDRESS` contingency for addressless user during CBT flow\n 'BANK_LOGIN_CREDENTIALS_INVALID', // handles when users provides invalid credentials in OpenBanking\n 'FETCH_BANK_BALANCE_TIME_OUT',\n 'INITIATE_OTP_CONTINGENCY',\n 'PAYER_CANNOT_PAY',\n 'PAYER_ACCOUNT_RESTRICTED',\n 'FI_CONFIRMATION_CONTINGENCY', // handle 3DS (2.0) contingency for addCard use case so no fallback\n 'CC_PROCESSOR_DECLINED',\n 'SELL_CRYPTOCURRENCY_ERROR',\n 'UNRECOVERABLE_ERROR',\n ...SHARED_CARD_CONTINGENCIES, // shared card related contingenciesptest\n];\n\nexport const GLOBAL_CONTINGENCIES_HANDLERS = {\n // Step up auth contingency during the planning step - user is logged in, but risk determines that user may have\n // suspicious activity around payments. To resolve, user must provide secondary authentication, such as completing\n // SMS verification.\n VERIFY_USER_IDENTITY({ errorData = {} }) {\n // step_up_context is a mandatory param from planning response , check before redirecting\n if (errorData.step_up_context) {\n return redirectToAuthChallenge(errorData.step_up_context);\n } else {\n return redirectGenericError();\n }\n },\n // Payer Action Required is a contingency in which Buyer's action is required.\n // It contains {String} cause which tells why the contingency is thrown\n // It contains {Object} resolution, which contains details on how to resolve the contingency\n // Currently its only being thrown for Negative Balance Recovery Contingency & contingencies not mapped in xo-janus\n // Refer: https://github.paypal.com/Checkout/xo-janus/blob/master/lib/payService/transportMapper.js#L29 - {function checkContingency}\n PAYER_ACTION_REQUIRED({ message, errorData = {} }) {\n const { cause, resolution: { name: resolutionName } = {} } = errorData;\n\n /*\n * Added isIframe check because MoneyNodeWeb which handles Negative Balance Recovery\n * return html with `x-frame-opts: sameorigin` which prevents loading the page in Iframe flows.\n * Currently, we fallback to hermes if we receive NBR contingency in Iframe flow.\n * TODO: Remove the isIframe check here & find a solution for consumer apps to work in Checkout's Iframe flow.\n */\n if (\n cause === 'NEED_NEGATIVE_BALANCE_RECOVERY' &&\n resolutionName === 'PAYER_TO_CLEAR_NEGATIVE_BALANCE' &&\n !isIframe()\n ) {\n return redirectToNegativeBalanceRecovery();\n } else {\n // reason: \"PAYER_ACTION_REQUIRED|NEED_NEGATIVE_BALANCE_RECOVERY|PAYER_TO_CLEAR_NEGATIVE_BALANCE\"\n return fallback({\n reason: `${message}|${cause}|${resolutionName}`,\n });\n }\n },\n // Payer Authentication Required throws when an action needs more permissions than the user currently has.\n // This can happen when a One Touch user tries to change something, such as adding an address (merchant override).\n // Solution is to make the user log in\n PAYER_AUTHENTICATION_REQUIRED({ message, errorData = {} } = {}) {\n logger.cal.info(`HANDLE_${message}`, {\n message,\n cause: errorData.cause,\n ...(isObject(errorData.resolution) && {\n resolution: errorData.resolution.name,\n }),\n });\n\n redirectToRiskyLogin({\n reason: message,\n extraParams: {\n lite: 1,\n fromLite: 1,\n invalidateCheckoutSessionPlan: true,\n ulClientKey: 'riskyLoginShippingPassed',\n ulClientRedirect: 'insufficientPermission',\n },\n });\n },\n\n // For Link and Pay transaction, if a user is 'skip logged in',\n // the user cannot perform transactions for any other EC-Token\n // other than which the user was skip logged in for.\n LINK_AND_PAY_TOKENS_MISMATCH({ errorData = {} }) {\n return redirectToLogout('LINK_AND_PAY_TOKENS_MISMATCH', {\n hermes: 1,\n fromLite: 1,\n });\n },\n\n // Payer Invalid for Payment is thrown for Link and Pay experience in\n // under the following scenario:\n // If a User A (logged in/ one touched) requests for Link and Pay\n // transaction for a billingAgreement setup for User B, PAPS throws\n // error PAYER_INVALID_FOR_PAYMENT. So we logout User A.\n // ***\n // If this contingency is thrown for other cases, we might have to handle\n // it using cause/resolution if passed\n PAYER_INVALID_FOR_PAYMENT({ errorData = {} }) {\n return redirectToLogout('PAYER_INVALID_FOR_PAYMENT', {\n hermes: 1,\n fromLite: 1,\n });\n },\n\n TRANSACTION_REFUSED() {\n return redirectGenericError({ code: 'PAYMENT_DENIED', replace: true });\n },\n\n UNRECOVERABLE_ERROR() {\n return redirectGenericError({ code: 'UNRECOVERABLE_ERROR', replace: true });\n },\n};\n","import { ApolloLink, Observable } from 'apollo-link';\n\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { getOperationType } from '@paypalcorp/c3-util-graphql';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\nimport { SPINNER_TYPES } from '@/components/Spinner';\n\n/**\n * @description `apolloSpinner` is a non-terminating link to show / hide spinners for Mutation graphql calls\n *\n * @returns {Observable} | Returns an Observable of an execution result\n */\nexport const spinnerLink = () => {\n return new ApolloLink((operation, forward) => {\n const { operationName, variables } = operation;\n const operationType = getOperationType(operation);\n let spinnerType = SPINNER_TYPES.DEFAULT;\n\n if (operationName === 'AddCreditCard') {\n spinnerType = SPINNER_TYPES.PROCESS_CARD;\n }\n\n if (operationName === 'approveIncentivePayment') {\n spinnerType = SPINNER_TYPES.PROCESS_INCENTIVE;\n }\n\n if (operationName === 'approveMemberPayment' && variables?.cryptocurrencyQuoteId) {\n spinnerType = SPINNER_TYPES.CRYPTO_SELLING;\n }\n\n const triggerToggleSpinner = (visible) => {\n updateFeature('SPINNER', { visible, data: { type: spinnerType } });\n };\n\n if (\n operationType === 'mutation' &&\n operationName !== 'ThreeDsLookUpMutation' &&\n operationName !== 'ThreeDsAuthenticateMutation' &&\n operationName !== 'ResolveThreeDsContingency'\n ) {\n triggerToggleSpinner(true);\n logger.cal.info(`SHOW_SPINNER_${operationName}`);\n }\n\n return new Observable((observer) => {\n const subscription = forward(operation);\n if (subscription) {\n // check if forward returns null or not\n return subscription.subscribe({\n next: (result) => {\n // CryptoQuotesQuery is a polling query with errorPolicy ignore - it should not hide the spinner\n const shouldHideSpinnerForQuery =\n operationType === 'query' && operationName !== 'CryptoQuotesQuery';\n\n if (operationType === 'mutation' || shouldHideSpinnerForQuery) {\n triggerToggleSpinner(false);\n logger.cal.info(`HIDE_SPINNER_${operationName}`);\n }\n\n observer.next(result);\n },\n error: (error) => {\n const statusCode = error && error.statusCode;\n\n if (statusCode === 401) {\n triggerToggleSpinner(true);\n logger.cal.info(`SHOW_SPINNER_401_${operationName}`);\n } else {\n triggerToggleSpinner(false);\n logger.cal.info(`HIDE_SPINNER_NETWORK_ERROR_${statusCode}_${operationName}`);\n }\n observer.error(error);\n },\n complete: observer.complete.bind(observer),\n });\n }\n return () => {\n // clean up\n if (subscription) subscription.unsubscribe();\n };\n });\n });\n};\n","import { ApolloLink, Observable } from 'apollo-link';\nimport { isUndefined } from '@paypalcorp/c3-util-lang';\nimport get from 'dlv';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { TRANSITION_PAYLOAD } from '@paypalcorp/c3-util-logger';\n\n/**\n * It's a stateful link and centralized place to log gql data into cal / fpti\n *\n * It auto logs payload to cal / fpti once all resolvers return non undefined values\n * If some of the fields were not resolved by end of the user session - manually flush them before user redirect via\n *\n * ```\n * import { instrumentationLink } from '@/lib/apolloLinks';\n *\n * instrumentationLink.logPayload();\n * ```\n */\nclass InstrumentationLink extends ApolloLink {\n constructor() {\n super();\n this.logFlushed = false;\n this.payload = {};\n\n this.payloadResolvers = {\n is_gambling: (result) => get(result, 'data.checkoutSession.merchant.isGambling'),\n };\n\n Object.keys(this.payloadResolvers).forEach((key) => {\n this.payload[key] = undefined;\n });\n }\n\n addToPayload(key, value) {\n if (!isUndefined(value)) {\n this.payload[key] = value;\n }\n }\n\n logPayload() {\n // make sure log is fired once to prevent duplicate logs\n if (!this.logFlushed) {\n Object.keys(this.payload).forEach((key) => {\n const value = this.payload[key];\n\n if (typeof value === 'boolean') {\n this.payload[key] = value ? 1 : 0;\n }\n });\n\n logger.fpti(\n 'flow_params',\n TRANSITION_PAYLOAD({\n from: 'flow_params',\n to: 'process_flow_params',\n ...this.payload,\n })\n );\n\n this.logFlushed = true;\n }\n }\n\n logPayloadIfReady() {\n const isReadyToFlush = !Object.keys(this.payload).some((k) => isUndefined(this.payload[k]));\n\n if (!isReadyToFlush) {\n return;\n }\n\n this.logPayload();\n }\n\n resolveAndLog(result, operationName) {\n window.logCPLPhase(operationName, 'query');\n try {\n Object.keys(this.payloadResolvers).forEach((key) => {\n const resolvedValue = this.payloadResolvers[key](result);\n this.addToPayload(key, resolvedValue);\n });\n\n this.logPayloadIfReady();\n } catch (err) {\n logger.cal.info('instrumentation_link_error', { error: err.stack || err.toString() });\n }\n }\n\n request(operation, forward) {\n window.logCPLPhase(operation.operationName, 'query', true);\n return new Observable((observer) => {\n const subscription = forward(operation);\n\n if (subscription) {\n return subscription.subscribe({\n next: (result) => {\n this.resolveAndLog(result, operation.operationName);\n observer.next(result);\n },\n error: (error) => {\n observer.error(error);\n },\n complete: observer.complete.bind(observer),\n });\n }\n return () => {\n // clean up\n if (subscription) subscription.unsubscribe();\n };\n });\n }\n}\n\nexport const instrumentationLink = new InstrumentationLink();\n","import { ApolloLink } from 'apollo-link';\nimport { getAccessToken } from '@paypalcorp/c3-shared-globals';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\n/**\n * Avoid using auth related identifers\n * for client side logging\n * example:\n * - 'AUTH'\n * - 'ACCESS_TOKEN'\n */\nconst LOG_PREFIX = 'AT_CHANGE';\n\n/**\n * Refresh access token being sent for each\n * request with latest value from globals.\n *\n * @param {*} headers\n * @returns\n */\nexport const authLink = (headers) => {\n return new ApolloLink((operation, forward) => {\n const accessToken = getAccessToken();\n operation.setContext((prevContext) => {\n const oldAccessToken = headers['x-paypal-internal-euat'];\n const newAccessToken = params().euat === '1' ? window.location.hash.substr(1) : accessToken;\n logger.cal.info(`${LOG_PREFIX}_${oldAccessToken !== newAccessToken}`);\n headers['x-paypal-internal-euat'] = newAccessToken;\n return {\n headers,\n };\n });\n return forward(operation);\n });\n};\n","import { logger } from '@paypalcorp/c3-util-logger';\nimport { getGlobals, getFallback } from '@paypalcorp/c3-shared-globals';\nimport { HANDLED_CONTINGENCIES } from '@/lib/contingencies';\nimport { fallback } from '@/lib/redirects';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\n\nexport const attemptRedirect = (reason = 'error') => {\n // This is temporary until we can get CORS enabled on Akamai, and ErrorBoundaries\n // are released in Preact: https://github.com/developit/preact/pull/819\n\n const fallbackSettings = getFallback();\n\n try {\n throw Error();\n } catch (e) {\n // if we're running tests, we should always call `fallback()` because\n // sometimes `window.fallbackTriggered` is already `true` when running a test\n if (\n process.env.NODE_ENV === 'test' ||\n (!window.fallbackTriggered && fallbackSettings.redirectOnError)\n ) {\n window.fallbackTriggered = true;\n fallback({ reason });\n }\n }\n};\n\n/**\n * Takes a GraphQL error and formats it for logging\n * @param {object} error | A GraphQL error object\n * @returns {object} A formatted object to use for error logging\n */\nconst parseError = (error) => {\n const { graphQLErrors, networkError } = error || {};\n if (graphQLErrors && graphQLErrors.length) {\n return {\n message: graphQLErrors[0].statusCode === 200 ? `gqlContingency` : `gqlError`,\n statusCode: graphQLErrors[0].statusCode,\n details: graphQLErrors.map(({ message }) => message).toString(),\n };\n }\n if (networkError) {\n return {\n message: `gqlNetworkError`,\n statusCode: networkError.statusCode,\n details: networkError.message,\n };\n }\n if (error instanceof Error) {\n return {\n message: error.message,\n details: error.stack,\n };\n }\n\n return { message: `unknownError` };\n};\n/**\n * Ideally we could use Error Boundaries, but Preact does not currently support them\n * (coming soon -- the PR is merged, waiting for new release). This will log checkout\n * errors and ineligible traffic to separate them from generic JS errors.\n *\n * @param {object} obj | Args object\n * @param {string} obj.message | A formatted message to use for error logging\n * @param {object} obj.error | An error object to use for a new `Error` instance\n * @returns {void} Nothing is returned, but does cause a redirect if enabled\n */\n\nconst CheckoutError = ({ message, error }) => {\n // do not fallback for 401 errors.\n // Currently for approvePaymentMutation we are still falling back because `CheckoutError` is getting executed on each GQL error.\n if (error && error.networkError && error.networkError.statusCode === 401) {\n return;\n }\n\n const checkoutError = new Error(error || message || 'undefined');\n checkoutError.type = 'checkout';\n if (error) {\n const parsedError = parseError(error);\n checkoutError.message = parsedError.message;\n checkoutError.details = parsedError.details;\n }\n\n if (checkoutError.details === 'WPS_INVENTORY_ERROR') {\n const soldOutUrl = error?.graphQLErrors[0]?.data?.errorData?.soldoutUrl || '';\n updateFeature('INVENTORY_SOLD_OUT', {\n visible: true,\n data: {\n soldOutUrl,\n },\n });\n return;\n }\n\n if (HANDLED_CONTINGENCIES.includes(checkoutError.details)) {\n return;\n }\n\n const reason = checkoutError.message;\n const {\n user: { ecToken },\n } = getGlobals();\n\n logger.cal.error(`CHECKOUT_ERROR_${reason}`, {\n ...checkoutError,\n timestamp: Date.now(),\n token: ecToken,\n });\n\n attemptRedirect(reason);\n};\n\nexport default CheckoutError;\n","import { fraudNet } from '@paypalcorp/c3-init-fraudnet';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { getToken } from '@paypalcorp/c3-shared-globals';\nimport { params } from '@paypalcorp/c3-util-browser';\n\nconst APP_NAME = 'CHECKOUTUINODEWEB_MEMBER_LITE';\n\nexport const getClientMetadataID = (defaultID) => {\n const urlParams = params();\n\n if (window.xprops && window.xprops.clientMetadataID) {\n return window.xprops.clientMetadataID;\n } else if (urlParams['client-metadata-id']) {\n return urlParams['client-metadata-id'];\n } else {\n return defaultID;\n }\n};\n\nexport const initFraudNet = ({ token = getToken(), fraudNetEndpoint, deployEnv = {} } = {}) => {\n const fraudNetConfig = {\n userToken: token,\n sourceId: APP_NAME,\n endpoint: fraudNetEndpoint,\n addCrossOrigin: deployEnv.production,\n typingSpeed: {\n /**\n * Allows for FraudNet to track dynamically rendered fields by delegating the event listener\n * to the body instead of attaching it to individual field.\n */\n delegate: true,\n\n /**\n * List of required fields that can be rendered. This list should include\n * all fields that are required for only certain flows, e.g. fields that\n * are only rendered in certain situations. We filter out pre-filled\n * fields so that FraudNet doesn't mistakenly tag them as suspicious due\n * to being programmatically filled.\n */\n fields: [\n // From addCard/updateCard and addShipping interstitials\n { id: 'country', min: 2 },\n { id: 'ccFirstName', min: 5 },\n { id: 'ccLastName', min: 5 },\n { id: 'cardNumber', min: 8 },\n { id: 'billingDropdown', min: 10 },\n ],\n // Should be the same as `sourceId`\n type: APP_NAME,\n },\n };\n\n // Wrapping this in a try/catch because in the past we have seen occasional\n // errors with fraudnet being initialized which was blowing up the app\n try {\n // `fraudNet()` is located in checkoutuinodeweb/shared directory\n fraudNet(fraudNetConfig);\n logger.cal.info('FRAUDNET_INIT', fraudNetConfig);\n } catch (e) {\n logger.cal.info('FRAUDNET_INIT_FAILURE', { message: e && e.message });\n }\n};\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"SpinnerOverlay\":\"SpinnerOverlay_SpinnerOverlay_3KudG\",\"spinnerOverlay\":\"SpinnerOverlay_SpinnerOverlay_3KudG\",\"SpinnerMessage\":\"SpinnerOverlay_SpinnerMessage_1BLVf\",\"spinnerMessage\":\"SpinnerOverlay_SpinnerMessage_1BLVf\",\"SpinnerContent\":\"SpinnerOverlay_SpinnerContent_15n8d\",\"spinnerContent\":\"SpinnerOverlay_SpinnerContent_15n8d\"};","import React from 'react';\n\n// react-universal-component shows a default 'Loading ...' message with query components.\n// use this empty tag to prevent the default behavior\nexport default function EmptyLoader() {\n return ;\n}\n","import React from 'react';\n\nimport { getCountry } from '@paypalcorp/c3-shared-globals';\nimport { isObject, isFunction, nullToUndefined, isUndefined } from '@paypalcorp/c3-util-lang';\nimport EmptyLoader from '@/shared/components/EmptyLoader';\nimport { useGqlNetworkQuery, useFeatureQuery, useContingencyQuery } from './hooks';\nimport { FeatureContainer } from './FeatureContainer';\nimport { lazyComponent } from '@/lib/lazyLoad';\nimport { shouldTriggerInitialCPLEvent, updateHasContingencies } from '@/lib/cplUtils';\n\n// resolve feature's lazy component based on experiment result\nconst resolveWrappedComponentByExperiment = (wrappedComponent, experimentResult) => {\n if (wrappedComponent[experimentResult]) {\n return wrappedComponent[experimentResult];\n } else {\n for (let prop in wrappedComponent) {\n return wrappedComponent[prop];\n }\n }\n};\n\n/**\n * resolve feature's lazy component based on\n *\n * - experiment\n * - countrySpecific\n *\n * Examples:\n *\n * 1. When experiments object is provided\n * ({\n * experiments: {\n * TREATMENT_1: () => import('./Footer'),\n * TREATMENT_2: () => import('./FooterB'),\n * TREATMENT_3: () => import('./FooterC'),\n * }\n * })\n *\n * 2. When countrySpecific object is provided\n * ({\n * countrySpecific: {\n * US: () => import('./Footer'),\n * GB: () => import('./FooterB'),\n * AU: () => import('./FooterC'),\n * }\n * })\n *\n * 3. When countrySpecific object has nested experiments\n * ({\n * countrySpecific: {\n * US: {\n * experiments: {\n * TREATMENT_1: () => import('./Footer'),\n * TREATMENT_2: () => import('./FooterB'),\n * TREATMENT_3: () => import('./FooterC'),\n * },\n * },\n * GB: () => import('./FooterB'),\n * AU: () => import('./FooterC'),\n * }\n * })\n/*/\nconst resolveWrappedComponent = (wrappedComponent, finalData, country) => {\n if (isObject(wrappedComponent)) {\n const { feature: { experiment } = {} } = finalData;\n const experimentResult = experiment && experiment.getResolvedTreatment();\n\n const wrappersByExperiment = wrappedComponent.experiments;\n const wrappersByCountry = wrappedComponent.countrySpecific;\n\n if (wrappersByExperiment) {\n return resolveWrappedComponentByExperiment(wrappersByExperiment, experimentResult);\n } else if (wrappersByCountry) {\n const countrySpecificWrapper = wrappersByCountry[country] || wrappersByCountry['US'];\n\n if (isObject(countrySpecificWrapper)) {\n if (countrySpecificWrapper.experiments) {\n return resolveWrappedComponentByExperiment(\n countrySpecificWrapper.experiments,\n experimentResult\n );\n }\n } else {\n return countrySpecificWrapper;\n }\n }\n }\n return wrappedComponent;\n};\n\nconst getIsGqlQueriesLoading = (queries) => {\n return Object.keys(queries).some((key) => {\n return queries[key].loading;\n });\n};\n\nconst getIsGqlDataResolved = (queries) => {\n return !Object.keys(queries).some((key) => {\n return Object.keys(queries[key].data || {}).length === 0 && isUndefined(queries[key].error);\n });\n};\n\nconst getIsGqlHasError = (queries) => {\n return Object.keys(queries).some((key) => {\n return queries[key].error;\n });\n};\n\nconst mapContingencies = (contingencies = []) => {\n return contingencies.reduce((map, obj) => {\n map[obj.id] = obj;\n map[obj.id].data = obj.data || {};\n return map;\n }, {});\n};\n\nconst mapFeature = (feature = {}) => {\n return {\n ...feature,\n data: feature.data || {},\n };\n};\n\nconst mapFeatures = (features = []) => {\n return features.reduce((map, obj) => {\n map[obj.id] = obj;\n map[obj.id].data = obj.data || {};\n return map;\n }, {});\n};\n\nconst mapQueriesData = (queries) => {\n const result = [];\n\n Object.keys(queries).forEach((key) => {\n if (!queries[key].data) {\n queries[key].data = {};\n }\n queries[key].data = nullToUndefined(queries[key].data);\n result.push(queries[key]);\n });\n\n return result;\n};\n\nconst getShouldLoadFeatureComponent = ({ shouldLoadFeatureComponent, finalData }) => {\n if (!isFunction(shouldLoadFeatureComponent)) {\n return true;\n }\n\n return Boolean(shouldLoadFeatureComponent(finalData));\n};\n\nconst getShouldAutoDisplayComponent = ({\n shouldAutoDisplayComponent,\n finalData,\n shouldLoadFeature,\n}) => {\n const { experiment } = finalData.feature;\n\n // no point of executing shouldAutoDisplayComponent if feature is not eligible or experiment is in control\n if (\n !isFunction(shouldAutoDisplayComponent) ||\n !shouldLoadFeature ||\n (experiment && experiment.isControl())\n ) {\n return false;\n }\n\n return shouldAutoDisplayComponent(finalData);\n};\n\nconst getShouldLoadLoadingComponent = ({\n withoutLoadingState,\n isGqlLoading,\n shouldLoadFeatureComponent,\n LoadingComponent,\n}) => {\n return !withoutLoadingState && isGqlLoading && shouldLoadFeatureComponent && LoadingComponent;\n};\n\nconst getShouldLoadFeatureInstance = ({\n shouldLoadFeatureInstance,\n finalData,\n shouldLoadFeature,\n}) => {\n if (!shouldLoadFeature || !isFunction(shouldLoadFeatureInstance)) {\n return true;\n }\n\n return Boolean(shouldLoadFeatureInstance(finalData));\n};\n\nconst getQueriesByFetchPolicy = ({ queries, fetchPolicy, negation = false }) => {\n return queries.filter((q) =>\n negation ? q.fetchPolicy !== fetchPolicy : q.fetchPolicy === fetchPolicy\n );\n};\n\nconst mapFeaturesQueryResult = (featuresQueryResult) => {\n const features = [];\n\n Object.keys(featuresQueryResult).forEach((key) => {\n if (featuresQueryResult[key].data) {\n features.push(featuresQueryResult[key].data.feature);\n } else {\n features.push({\n id: key,\n });\n }\n });\n\n return features;\n};\n\nconst mapContingenciesQueryResult = ({ contingenciesQueryResult, subscribeToContingencies }) => {\n const { contingencies = [] } = contingenciesQueryResult;\n\n if (subscribeToContingencies) {\n return contingencies.filter(\n (contingency) => subscribeToContingencies.indexOf(contingency.id) >= 0\n );\n }\n\n return contingencies;\n};\n\nconst getFeatureById = ({ id, features }) => {\n return features.find((f) => f.id === id) || {};\n};\n\nconst resolveInterstitialOptions = ({ interstitialOptions, finalData }) => {\n // Use `onBeforeCloseFn` and pass finalData down to it\n if (isFunction(interstitialOptions.onBeforeCloseFn)) {\n const { onBeforeCloseFn } = interstitialOptions;\n interstitialOptions.onBeforeCloseFn = () => onBeforeCloseFn(finalData);\n }\n // Use `showCloseBtnFunc` to determine to show `showCloseBtn`\n if (isFunction(interstitialOptions.showCloseBtnFunc)) {\n interstitialOptions.showCloseBtn = interstitialOptions.showCloseBtnFunc(finalData);\n }\n // Some titles depend on the finalData in order to select which title to use. So we need to pass in finalData\n // to headerTitleFunc in order to be able to get the correct title.\n if (isFunction(interstitialOptions.headerTitleFunc)) {\n interstitialOptions.headerTitle = interstitialOptions.headerTitleFunc(finalData);\n }\n\n // Use `typeFunc` to determine `type` conditionally.\n if (isFunction(interstitialOptions.typeFunc)) {\n interstitialOptions.type = interstitialOptions.typeFunc(finalData);\n }\n\n return interstitialOptions;\n};\n\nconst resolveLazyFeatureComponent = ({\n id,\n WrappedComponent,\n finalData,\n LoadingComponent,\n ErrorComponent,\n country,\n}) => {\n if (!Feature.FeatureComponents[id]) {\n const ResolvedWrappedComponent = resolveWrappedComponent(WrappedComponent, finalData, country);\n\n Feature.FeatureComponents[id] = lazyComponent(ResolvedWrappedComponent, {\n id,\n loading: LoadingComponent,\n error: ErrorComponent || LoadingComponent,\n });\n }\n return Feature.FeatureComponents[id];\n};\n\nconst disableInitialCPLEvent = ({\n interstitial = false,\n autoDisplay = false,\n contingencies = [],\n}) => {\n // Auto displaying interstitial feature when contingencies are available would not allow\n // review page to be rendered first. So in these cases hasContingencies flag should be set.\n if (interstitial && autoDisplay && contingencies.length > 0 && shouldTriggerInitialCPLEvent()) {\n updateHasContingencies(true);\n }\n};\n\n/**\n * Feature component to standardize component writing\n * See: https://github.paypal.com/Checkout-R/checkoutuinodeweb/pull/719\n *\n * @param {Object} config | Feature configuration object that must be passed.\n * @param {String} config.id | feature id\n * @param {Boolean} config.interstitial | if feature has to be rendered as interstitial\n * @param {Object} config.interstitialOptions | interstitial options such as\n * @param {Function} config.interstitialOptions.payload | The payload function for FPTI\n * @param {Boolean} config.interstitialOptions.showCloseBtn | true / false (to show or hide close button)\n * @param {Boolean} config.interstitialOptions.hideHeaderBorder | Boolean to exclude InterstitialHeader (defaults to true)\n * @param {Function} config.interstitialOptions.showCloseBtnFunc | Function to dynamically determine `showCloseBtn` flag or not\n * @param {Function} config.interstitialOptions.onBeforeCloseFn | `onBeforeCloseFn` to be passed to `InterstitialContainerComponent` to trigger any actions before Interstitial is closed\n * @param {String} config.interstitialOptions.type | The type of interstitial (one of `full`, `tall`, `compact`, `modal`)\n * @param {Function} config.interstitialOptions.headerTitleFunc | Function used to get the header title.\n * @param {String} config.interstitialOptions.interstitialStyleOverrides | Classnames with which to override base interstitial styles\n * @param {String} config.interstitialOptions.interstitialWrapperStyleOverrides | Classnames with which to override interstitial wrapper styles\n * @param {String} config.interstitialOptions.interstitialInnerContainerStyleOverrides | Classnames with which to override a interstitials inner container styles\n * @param {String} config.interstitialOptions.overlayClassNames | Classnames with which to override overlay styles\n * @param {Array} config.queries | Array of all graphql queries\n * @param {Array} config.contingencies | Array of contingencies which are going to be injected into the feature component\n * @param {Function} config.LoadingComponent | Loading component\n * @param {Function} config.ErrorComponent | Error component\n * @param {Array} config.subscribeTo | Array of all features (ids) your component needs to subscribe to\n * @param {Object} config.animateOptions | options for showing feature with animations, includes such params:\n * - animateHeight: enable / disable animation\n * - animateContainerClass: class to pass for animation container\n * - animateOpacity: animate opacity or not\n * @param {Boolean} config.shouldKeepLoadingStateOnError | if we need to show loading state forever in case of error\n * @param {Function} config.shouldAutoDisplayComponent | function which needs to return true or false if you want to show feature automatically after hiding it by default\n * @param {Function} config.shouldLoadFeatureComponent | function which needs to return true or false if feature component should be loaded at all\n * @param {Function} config.shouldLoadFeatureInstance | function which needs to return true or false if feature component instance should be loaded or not (e.g when you render feature in 2 places and you want to hide one and show another)\n * @param {Boolean} config.withoutLoadingState | if feature component needs to render immediately and not wait for GQL queries calls to be completed\n */\nexport const Feature = (config) => {\n let {\n id,\n interstitialOptions = {},\n interstitial,\n shouldAutoDisplayComponent,\n shouldLoadFeatureComponent,\n shouldLoadFeatureInstance,\n queries = [],\n LoadingComponent = EmptyLoader,\n ErrorComponent,\n withoutLoadingState,\n subscribeTo = [],\n animateOptions = {},\n shouldKeepLoadingStateOnError,\n contingencies: subscribeToContingencies,\n } = config;\n\n return (WrappedComponent) => {\n Feature.FeatureComponents[id] = null;\n\n const Composed = (props) => {\n // order of hooks below is important (don't modify it without a good reason)\n // basically there are use cases when features are not getting re rendered with latest data\n // or cache-only queries results are resolving with empty data\n\n // first - fire cache-only gql queries\n const cacheOnlyGqlQueries = getQueriesByFetchPolicy({ queries, fetchPolicy: 'cache-only' });\n const cacheOnlyGqlQueryResult = useGqlNetworkQuery({ queries: cacheOnlyGqlQueries });\n\n // second - fire local gql query (queries) to fetch features\n const featuresQueryResult = useFeatureQuery([id, ...subscribeTo]);\n const features = mapFeaturesQueryResult(featuresQueryResult);\n const feature = getFeatureById({ id, features });\n\n // third - fire local gql query to fetch contingencies\n const contingenciesQueryResult = useContingencyQuery(id);\n const contingencies = mapContingenciesQueryResult({\n contingenciesQueryResult,\n subscribeToContingencies,\n });\n\n // fourth - fire network gql queries\n const networkGqlQueries = getQueriesByFetchPolicy({\n queries,\n fetchPolicy: 'cache-only',\n negation: true,\n });\n\n const networkGqlQueryResult = useGqlNetworkQuery({\n queries: networkGqlQueries,\n skip: !feature.enabled,\n });\n\n // no need to do any calculations below if feature is not enabled\n if (!feature.enabled) {\n return null;\n }\n\n const queriesResult = { ...networkGqlQueryResult, ...cacheOnlyGqlQueryResult };\n const isGqlLoading = getIsGqlQueriesLoading(queriesResult);\n const isGqlDataResolved = getIsGqlDataResolved(queriesResult);\n const hasError = getIsGqlHasError(queriesResult);\n const ShouldLoadLoadingComponent = getShouldLoadLoadingComponent({\n withoutLoadingState,\n isGqlLoading,\n shouldLoadFeatureComponent,\n LoadingComponent,\n });\n\n if (ShouldLoadLoadingComponent) {\n return ;\n }\n\n const finalData = {\n allQueryData: mapQueriesData(queriesResult),\n feature: mapFeature(feature),\n features: mapFeatures(features),\n loading: isGqlLoading,\n contingencies: mapContingencies(contingencies),\n customProps: props.customProps,\n };\n const { experiment, visible } = finalData.feature;\n\n const shouldLoadFeature = getShouldLoadFeatureComponent({\n shouldLoadFeatureComponent,\n finalData,\n });\n\n const autoDisplay = getShouldAutoDisplayComponent({\n shouldAutoDisplayComponent,\n finalData,\n shouldLoadFeature,\n });\n\n // disable initial cpl event if conditions satify\n disableInitialCPLEvent({ interstitial, autoDisplay, contingencies });\n\n const shouldLoadInstance = getShouldLoadFeatureInstance({\n shouldLoadFeatureInstance,\n finalData,\n shouldLoadFeature,\n });\n\n const shouldResolveInterstitialOptions =\n !isGqlLoading &&\n interstitial &&\n shouldLoadFeature &&\n visible &&\n !(experiment && experiment.isControl());\n\n if (shouldResolveInterstitialOptions) {\n interstitialOptions = resolveInterstitialOptions({ interstitialOptions, finalData });\n }\n\n const FeatureComponent = resolveLazyFeatureComponent({\n id,\n WrappedComponent,\n finalData,\n LoadingComponent,\n ErrorComponent,\n country: getCountry(),\n });\n\n return (\n \n );\n };\n\n // Wrapper class to pass props which are passed directly to the feature component during render time\n class ComposedFeature extends React.PureComponent {\n render() {\n return ;\n }\n }\n return ComposedFeature;\n };\n};\n\nFeature.FeatureComponents = {};\n\nexport default Feature;\n","import gql from 'graphql-tag';\nimport { isIframe } from '@paypalcorp/c3-util-browser';\nimport { areCookiesDisabled } from '@/lib/cookie';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { isPayLaterFundingInstrument, updateFeature } from '@paypalcorp/c3-util-store';\nimport { getClient, getToken } from '@paypalcorp/c3-shared-globals';\nimport { CHECKOUT_BUTTON_STATES } from '@/components/CheckoutButton/constants';\nimport { returnFromCreditPayInFull } from '@/components/ReturnFromCredit/utils';\n\nconst CLEAR_CHECKOUT_SESSION_CREDIT_FINANCING_OPTION_MUTATION = gql`\n mutation clearCheckoutSessionCreditFinancingOption($token: String!) {\n clearCheckoutSessionCreditFinancingOption(token: $token) {\n creditFinancingOption {\n financingCode\n }\n }\n }\n`;\n\nexport const creditPpcOffersGqlParams = () => {\n return {\n areCookiesDisabled: areCookiesDisabled(),\n isIframe: isIframe(),\n };\n};\n\nexport const filterOutCreditInstruments = (fundingOption) =>\n !isPayLaterFundingInstrument(fundingOption?.fundingInstrument);\n\nexport const clearCreditFinancingOption = () => {\n updateFeature('SPINNER', { visible: true });\n\n return getClient()\n .mutate({\n mutation: CLEAR_CHECKOUT_SESSION_CREDIT_FINANCING_OPTION_MUTATION,\n variables: { token: getToken() },\n context: { skipFallback: true },\n })\n .then(() => logger.cal.info('CLEAR_CREDIT_OPTION_SUCCESS'))\n .catch((error) => logger.cal.error('CLEAR_CREDIT_OPTION_ERROR', error))\n .finally(() => {\n updateFeature('SPINNER', { visible: false });\n\n if (returnFromCreditPayInFull()) {\n return;\n }\n\n // Treat as best-effort - continue to approve even if this fails\n updateFeature('CHECKOUT_BUTTON', {\n data: {\n status: CHECKOUT_BUTTON_STATES.RESOLVED,\n flow: 'CLEAR_CREDIT_OPTION',\n },\n });\n });\n};\n","let cookieEnabled = true;\n\nexport const setCookieEnabled = (value) => {\n cookieEnabled = value;\n};\n\nexport const areCookiesDisabled = () => {\n if (process.env.NODE_ENV === 'test') {\n return !cookieEnabled;\n }\n\n return typeof navigator !== 'undefined' && !navigator.cookieEnabled;\n};\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"Spinner\":\"Spinner_Spinner_1fJo0\",\"spinner\":\"Spinner_Spinner_1fJo0\",\"SpinnerImage\":\"Spinner_SpinnerImage_3lAAj\",\"spinnerImage\":\"Spinner_SpinnerImage_3lAAj\",\"SpinnerLoader\":\"Spinner_SpinnerLoader_1FmJE\",\"spinnerLoader\":\"Spinner_SpinnerLoader_1FmJE\",\"rotation-ltr\":\"Spinner_rotation-ltr_1zwLK\",\"rotationLtr\":\"Spinner_rotation-ltr_1zwLK\",\"rotation-rtl\":\"Spinner_rotation-rtl_-DHPE\",\"rotationRtl\":\"Spinner_rotation-rtl_-DHPE\"};","import { logger } from '@paypalcorp/c3-util-logger';\nimport { getTimeToInteract } from '@paypalcorp/c3-util-browser';\nimport { getGlobals } from '@paypalcorp/c3-shared-globals'\nexport const PAGE = {\n REVIEW: 'review',\n ECONSENT: 'econsent',\n ADD_FI: 'addFi',\n ADD_SHIPPING_ADDRESS: 'addShipping',\n};\n\nconst _store = {\n triggerInitialCPLEvent: true,\n hasContingencies: false,\n};\n\n/**\n * Populate the server side cpl metics as part of client side fpti payload.\n *\n * @param {Object} comp\n */\nconst populateServerSideCplMetrics = (comp) => {\n const keys = ['INITIAL_DATA']; // Can be moved to config/constants if we need to expand list\n const { serverSideCplMetrics } = getGlobals();\n if (serverSideCplMetrics) {\n keys.forEach(key => {\n comp[`SERVER_${key}`.toLowerCase()] = {\n start: serverSideCplMetrics[`${key}_TIME`],\n tt: serverSideCplMetrics[`${key}_TIME_TAKEN`]\n }\n });\n }\n}\n\n/**\n * Populate time spent out of focus as part of cpl.\n * The longer the tab is out-of-focus the slower it becomes.\n *\n * @param {*} comp\n */\nconst populateVisibilityMetrics = (comp) => {\n if (window.visibilityEvents) {\n const hidden = window.visibilityEvents.hidden;\n const visible = window.visibilityEvents.visible || Date.now();\n if (hidden) {\n const timeTaken = visible - hidden;\n comp['visibilitychange'] = {\n start: hidden,\n tt: timeTaken\n }\n }\n }\n}\n\nconst triggerCPLLatencyMetricsFPTI = (page, timeToInteract) => {\n window.logCPLPhase('component_load_time');\n const { comp, query, chunk, ...rest } = window?.cplPhases || {};\n\n populateServerSideCplMetrics(comp);\n populateVisibilityMetrics(comp);\n const cplLatencyMetrics = {\n state_name: 'CPL_LATENCY_METRICS',\n transition_name: `prepare_${page}`,\n page_name: `main:xo:lite:hermione:member:${page}`,\n cpl_comp_metrics: JSON.stringify(window?.cplPhases?.comp || {}),\n cpl_query_metrics: JSON.stringify(window?.cplPhases?.query || {}),\n cpl_chunk_metrics: JSON.stringify(window?.cplPhases?.chunk || {}),\n ...rest,\n total_page_load_time: timeToInteract,\n };\n\n logger.fpti('CPL_LATENCY_METRICS', cplLatencyMetrics);\n};\n\nexport const updateTriggerInitialCPLEvent = (state) => {\n logger.cal.info(`CPL_UPDATE_TRIGGER_INITIAL_CPL_EVENT_TO_${state}`);\n _store.triggerInitialCPLEvent = state;\n};\n\nexport const shouldTriggerInitialCPLEvent = () => {\n return _store.triggerInitialCPLEvent;\n};\n\nexport const updateHasContingencies = (state) => {\n logger.cal.info(`CPL_UPDATE_HAS_CONTINGENCIES_TO_${state}`);\n _store.hasContingencies = state;\n};\n\nexport const hasContingencies = () => {\n return _store.hasContingencies;\n};\n\nexport const triggerInitialCPLEvent = (page = '') => {\n if (shouldTriggerInitialCPLEvent()) {\n /* \n Dont trigger review page event incase of contingencies, since event\n for those scenarios will be triggered from corresponding components\n */\n if (page === PAGE.REVIEW && hasContingencies()) {\n logger.cal.info(`CPL_DISABLE_CALL_BECAUSE_OF_CONTINGENCIES_FROM_${page}_PAGE`);\n } else {\n const timeToInteract = getTimeToInteract();\n logger.cpl.logPerformance({\n action: `${page}_page_loaded`,\n uicomp: `custom-${page}`,\n uitype: 'page',\n page: `main:xo:lite:hermione:member:custom-${page}`,\n timeToInteract,\n });\n logger.cal.info(`CPL_CALL_TRIGGERED_FROM_${page}_PAGE`);\n // Set the flag to false so that CPL call is not triggered again\n updateTriggerInitialCPLEvent(false);\n // Trigger FPTI event to capture the time spent on different phases.\n triggerCPLLatencyMetricsFPTI(page, timeToInteract);\n }\n }\n};\n","import { Loading } from './Loading';\nimport gql from 'graphql-tag';\nimport { getToken } from '@paypalcorp/c3-shared-globals';\nimport Feature from '@/components/Feature';\nimport {\n FundingOptionFragment,\n CreditFinancingOptionFragment,\n} from '@paypalcorp/c3-graphql-fragments';\nimport { getCreditOffer } from './utils';\nimport { LANDING_PAGE } from '@/lib/landingPage';\nimport { creditPpcOffersGqlParams } from '@/lib/credit';\n\nexport const CreditOfferFragment = gql`\n fragment CreditOfferFragment on CreditPPCOffer {\n content\n isSelected\n isApproved\n rank\n referenceId\n touchpoint\n trackingDetails {\n impressionUrl {\n href\n }\n }\n __typename\n }\n`;\n\n// NOTE: any updates on creditPPCOffers or flags make sure you also\n// update addCardMutation & updateCardMutation in `@/components/AddFI/AddCard`\nexport const query = gql`\n ${FundingOptionFragment}\n ${CreditOfferFragment}\n ${CreditFinancingOptionFragment}\n query CreditOfferQuery($areCookiesDisabled: Boolean, $isIframe: Boolean, $token: String!) {\n checkoutSession(token: $token) {\n cart {\n intent\n }\n fundingOptions(returnAllPlans: true, groupSourcesOnType: INCENTIVE) {\n ...FundingOptionFragment\n }\n buyer {\n userId\n }\n creditPPCOffers(areCookiesDisabled: $areCookiesDisabled, isIframe: $isIframe) {\n ...CreditOfferFragment\n }\n creditFinancingOption {\n ...CreditFinancingOptionFragment\n }\n flags {\n showPPCreditOffer\n isEligibleForCreditSecondButton\n hasPPCreditInstallments\n hideCart\n }\n }\n }\n`;\n\nconst shouldLoadFeatureComponent = (props) => {\n const { content = {} } = getCreditOffer('Banner', props) || {};\n\n // ensure required fields are present\n return ['OfferText1', 'CTAText'].every((key) => content[key]);\n};\n\nconst shouldLoadFeatureInstance = (props) => {\n const { features, customProps: { placement = LANDING_PAGE.REVIEW } = {} } = props;\n\n const choiceLandingPage = features.SELECT_FI.data.landingPage || LANDING_PAGE.REVIEW;\n\n // hide CreditOffer on review page if Choice is eligible and is landing page\n if (placement === LANDING_PAGE.REVIEW && choiceLandingPage === LANDING_PAGE.CHOICE) {\n return false;\n }\n\n // hide CreditOffer on choice page if Choice is eligible and review page is a landing page\n if (placement === LANDING_PAGE.CHOICE && choiceLandingPage === LANDING_PAGE.REVIEW) {\n return false;\n }\n\n return true;\n};\n\nconst CreditOffer = Feature({\n id: 'CREDIT_OFFER',\n queries: [\n {\n query: query,\n variables: { token: getToken(), ...creditPpcOffersGqlParams() },\n context: { planningBatch: true },\n },\n ],\n shouldLoadFeatureComponent,\n shouldLoadFeatureInstance,\n LoadingComponent: Loading,\n subscribeTo: ['SELECT_FI'],\n})({\n countrySpecific: { US: () => import('./CreditOfferUS'), GB: () => import('./CreditOfferGB') },\n});\n\nexport default CreditOffer;\n","import gql from 'graphql-tag';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { buildURL } from '@/lib/redirects';\nimport { getClient, getCredit, getToken } from '@paypalcorp/c3-shared-globals';\nimport {\n isCrossCurrencyTransaction,\n getPageContext,\n getCreditIncentiveDetails,\n} from '@/components/ReturnFromCredit/utils';\n\nexport const CREATE_CREDIT_KEY_MUTATION = gql`\n mutation CreateCapeMayflyPayload(\n $token: String!\n $pageContext: String!\n $creditFundingInstrumentId: String!\n $userSelectedAddressId: String!\n $userSelectedPreferredShippingAddressId: String!\n $returnUriBase: String!\n $isCreditSecondButton: Boolean!\n $isCrossCurrencyTransaction: Boolean\n $creditIncentiveDetails: CreditIncentiveDetailsInput\n $cartAmount: String\n $cartCurrency: String\n ) {\n createCapeMayflyPayload(\n token: $token\n pageContext: $pageContext\n creditFundingInstrumentId: $creditFundingInstrumentId\n userSelectedAddressId: $userSelectedAddressId\n userSelectedPreferredShippingAddressId: $userSelectedPreferredShippingAddressId\n returnUriBase: $returnUriBase\n isCreditSecondButton: $isCreditSecondButton\n isCrossCurrencyTransaction: $isCrossCurrencyTransaction\n creditIncentiveDetails: $creditIncentiveDetails\n cartAmount: $cartAmount\n cartCurrency: $cartCurrency\n )\n }\n`;\n\nconst createReturnUri = () => {\n const returnUriBase = `${window?.location?.protocol}//${window?.location?.host}/checkoutweb`;\n\n const newParams = params();\n delete newParams['credit'];\n delete newParams['euat'];\n\n return buildURL(returnUriBase, newParams);\n};\n\nexport const triggerCreateCreditKeyMutation = (\n creditOffer,\n creditFundingInstrumentId,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId\n) => {\n const isCreditSecondButton = getCredit().isCreditSecondButton;\n return getClient()\n .mutate({\n mutation: CREATE_CREDIT_KEY_MUTATION,\n variables: {\n token: getToken(),\n pageContext: getPageContext(),\n creditFundingInstrumentId: creditFundingInstrumentId || '',\n userSelectedAddressId: userSelectedAddressId || '',\n userSelectedPreferredShippingAddressId: userSelectedPreferredShippingAddressId || '',\n returnUriBase: createReturnUri(),\n isCreditSecondButton,\n isCrossCurrencyTransaction: isCrossCurrencyTransaction(creditOffer),\n creditIncentiveDetails: getCreditIncentiveDetails(creditOffer),\n cartAmount: creditOffer?.content?.CartAmount,\n cartCurrency: creditOffer?.content?.CartAmountCurrencyCode,\n },\n })\n .catch((error) => {\n logger.cal.warn(`CREATE_CREDIT_KEY_MUTATION_FAILURE`, {\n ...error,\n });\n });\n};\n","import { logger, REVIEW_PAYLOAD } from '@paypalcorp/c3-util-logger';\nimport { fallback } from '@/lib/redirects';\nimport { getCreditFundingInstrument, isInstallmentCreditType } from '@/lib/utils';\nimport { redirectToCape } from '@/components/ReturnFromCredit/utils';\nimport { getCredit } from '@paypalcorp/c3-shared-globals';\nimport { triggerCreateCreditKeyMutation } from './Mutation';\n\nexport const mapCreditPPCOffer = ({ presentmentType = 'Banner', creditPPCOffers = [] }) =>\n creditPPCOffers\n ?.filter(\n (offer) =>\n offer.content &&\n offer.content.Product === 'PPC' &&\n offer.content.PresentmentType === presentmentType\n )\n ?.reduce(\n (prevOffer, currentOffer) => (prevOffer.rank < currentOffer.rank ? prevOffer : currentOffer),\n {}\n );\n\nexport const showPPCReuseBanner = (creditPPCOffers, fundingOptions) => {\n if (Array.isArray(creditPPCOffers) && Array.isArray(fundingOptions) && fundingOptions.length) {\n const hasPPCReuseOffer = creditPPCOffers.some((offer) => {\n return offer.content && offer.content.OfferCategory === 'REUSE';\n });\n\n if (hasPPCReuseOffer) {\n const action = 'showCreditReuseBanner';\n logger.fpti(\n action,\n REVIEW_PAYLOAD({ action, isCreditSecondButton: getCredit()?.isCreditSecondButton })\n );\n\n const creditFundingInstrument = getCreditFundingInstrument(fundingOptions);\n return (\n !creditFundingInstrument?.allPlans?.some((plan) => plan.isSelected) &&\n !creditFundingInstrument?.fundingInstrument?.isPreferred\n );\n }\n }\n\n return false;\n};\n\nexport const getCreditOffer = (presentmentType, props) => {\n const {\n allQueryData: [\n {\n data: {\n checkoutSession: {\n creditPPCOffers = [],\n fundingOptions = [],\n flags: { showPPCreditOffer } = {},\n } = {},\n },\n },\n ],\n } = props;\n\n if (\n (!showPPCReuseBanner(creditPPCOffers, fundingOptions) && !showPPCreditOffer) ||\n !Array.isArray(creditPPCOffers) ||\n !creditPPCOffers.length\n ) {\n return null;\n }\n\n // filter the array for our offers, then sort and find the item with the lowest/first rank\n const filteredCreditPPCOffers = mapCreditPPCOffer({ presentmentType, creditPPCOffers });\n if (Object.keys(filteredCreditPPCOffers).length > 0) {\n const action = 'showCreditOffer';\n logger.fpti(\n action,\n REVIEW_PAYLOAD({ action, isCreditSecondButton: getCredit()?.isCreditSecondButton })\n );\n return filteredCreditPPCOffers;\n }\n return null;\n};\n\nexport const redirectToHermesCape = ({ action, creditOffer }) => {\n const offerType = creditOffer?.content?.OfferType;\n let reason = action;\n\n if (offerType) {\n reason = isInstallmentCreditType(offerType) ? 'capeCYCO' : 'selectCreditOffer';\n }\n\n logger.cal.info('REDIRECT_TO_HERMES_CAPE', { offerType, reason });\n return fallback({ reason });\n};\n\nexport const redirectToCapeWithCreditKey = ({\n creditOffer,\n creditFundingInstrumentId,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId,\n}) => {\n const action = 'selectCreditOffer';\n logger.cal.info('createCreditKeyMutationPayload', {\n creditFundingInstrumentId,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId,\n });\n return triggerCreateCreditKeyMutation(\n creditOffer,\n creditFundingInstrumentId,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId\n )\n .then((response) => {\n const createCapeMayflyPayload = response?.data?.createCapeMayflyPayload;\n if (createCapeMayflyPayload && createCapeMayflyPayload.length > 0) {\n logger.cal.info('REDIRECT_TO_CAPE', { createCapeMayflyPayload });\n redirectToCape(createCapeMayflyPayload);\n } else {\n throw new Error('Invalid credit key. Falling back to hermes');\n }\n })\n .catch((err) => {\n // Fallback to Hermes for Credit application\n logger.cal.error('REDIRECT_TO_CAPE_ERROR', err);\n return fallback({ reason: action });\n });\n};\n\nexport const creditSecondButtonRedirect = ({\n creditOffer,\n creditFundingInstrumentId,\n creditRedirectExperiment,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId,\n newUser,\n showPPCreditOffer,\n isEligibleForCreditSecondButton,\n}) => {\n const action = 'creditSecondButtonRedirect';\n logger.fpti(\n action,\n REVIEW_PAYLOAD({\n action,\n isCreditSecondButton: getCredit()?.isCreditSecondButton,\n ...creditOffer?.content,\n ...creditRedirectExperiment,\n ppc_ineligible: !(showPPCreditOffer && newUser),\n })\n );\n logger.cal.info('CREDIT_SECOND_BUTTON_REDIRECT_CREDIT_OFFER', creditOffer);\n\n if (isEligibleForCreditSecondButton || newUser) {\n if (newUser) {\n logger.cal.info('CREDIT_SECOND_BUTTON_NEW_USER_REDIRECT');\n }\n\n if (creditRedirectExperiment.fallbackToHermes) {\n // credit second button fallback\n return redirectToHermesCape({ creditOffer });\n } else if (creditRedirectExperiment.redirectToCape) {\n // credit second button redirect to CAPE for ACQ and reuse w/o installments\n return redirectToCapeWithCreditKey({\n creditOffer,\n creditFundingInstrumentId,\n userSelectedAddressId,\n userSelectedPreferredShippingAddressId,\n });\n }\n }\n\n logger.cal.info('CREDIT_SECOND_BUTTON_REDIRECT_FAILED_INELIGIBLE_FOR_CREDIT');\n};\n","import { getAuthState, getClaims } from '@paypalcorp/c3-shared-globals';\nimport { params } from '@paypalcorp/c3-util-browser';\n\n/**\n * Check if current logged in user has a `REMEMBERED` auth state\n * @returns {Boolean}\n */\nexport const getIsRememberedAuthState = () => getAuthState() === 'REMEMBERED';\n\n/**\n * Checking current user is logged in via one touched by ensuring current user:\n * auth_state: `REMEMBERED`\n * auth_claims: `DEVICE_TOKEN`\n *\n * Checking `DEVICE_TOKEN` is needed because partner integration (`PARTNER_ASSERTION`) can also\n * have `REMEMBERED` as the user's authState but this will not be considered as a oneTouch\n * @returns {Boolean}\n */\nexport const getIsUserOneTouchLogin = () => {\n return getIsRememberedAuthState() && getClaims().includes('DEVICE_TOKEN');\n};\n\n/**\n * Checking current user is `SkipFacebookLogin` by ensuring current user:\n * auth_state: `REMEMBERED`\n * auth_claims: `PARTNER_ASSERTION`\n * query param `code` must be present in order to be considered from Facebook\n * @returns {Boolean}\n */\nexport const getIsUserSkipFacebookLogin = () => {\n return (\n getIsRememberedAuthState() &&\n getClaims().includes('PARTNER_ASSERTION') &&\n Boolean(params().code)\n );\n};\n\n/**\n * Checking if current logged user is via user device token remembered login or not by ensuring:\n * auth_state: `REMEMBERED`\n * auth_claims: `USER_DEVICE_TOKEN_IMPLICIT`\n * @returns {Boolean}\n */\nexport const getIsUserDeviceTokenImplicitLogin = () => {\n return getIsRememberedAuthState() && getClaims().includes('USER_DEVICE_TOKEN_IMPLICIT');\n};\n","import React from 'react';\n\nexport default (props) => (\n
\n {props.children}\n
\n);\n","import React from 'react';\nimport { uniqueStr } from '@checkout/react-components';\nimport LoadingContainer from '@/shared/components/LoadingContainer';\nimport styles from './styles.css';\n\nexport const Loading = () => {\n const clipPathId = uniqueStr();\n const gradientId = uniqueStr();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n","import React from 'react';\nimport styles from './styles.css';\n\nconst Spinner = () => (\n
\n
\n
\n
\n);\n\nexport default Spinner;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Spinner from '../Spinner';\nimport cx from 'classnames';\n\nimport styles from './styles.css';\n\nconst SpinnerOverlay = ({ children, extraMessage }) => (\n
\n \n {children && (\n \n {children}\n

\n )}\n {extraMessage && (\n

\n {extraMessage}\n

\n )}\n
\n);\n\nSpinnerOverlay.propTypes = {\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n};\n\nexport default SpinnerOverlay;\n","import gql from 'graphql-tag';\nimport { FundingOptionFragment } from '@paypalcorp/c3-graphql-fragments';\n\nexport const CPA_DISCLAIMER_QUERY = gql`\n ${FundingOptionFragment}\n query CPADisclaimerQuery($token: String!) {\n checkoutSession(token: $token) {\n merchant {\n name\n }\n fundingOptions(returnAllPlans: true, groupSourcesOnType: INCENTIVE) {\n ...FundingOptionFragment\n }\n userAction\n checkoutSessionType\n }\n }\n`;\n","// SharedCard component contingencies\n\nexport const SHARED_CARD_CONTINGENCIES = [\n // following contingency is thrown from FI when user tries to add a card that belongs to other user\n 'SHARED_INSTRUMENT_CONSENT_REQUIRED',\n // following contingency is thrown from FI when consent is given by user to send his details to card owner\n 'ORIGINAL_USER_CHECK_PENDING',\n];\n","import { InMemoryCache, defaultDataIdFromObject } from 'apollo-cache-inmemory';\n\nexport const apolloInMemoryCache = (options = {}) =>\n new InMemoryCache({\n dataIdFromObject: (object) => {\n if (object.__typename) {\n switch (object.__typename) {\n case 'CheckoutSession':\n case 'PaymentContingencies':\n return `${object.__typename}`;\n case 'CheckoutBillingAddress':\n case 'CheckoutShippingAddress':\n return `${object.__typename}.${object.addressId}`;\n }\n }\n return defaultDataIdFromObject(object);\n },\n ...options,\n });\n","import gql from 'graphql-tag';\nimport {\n DeclinedInstrumentFragment,\n FundingOptionFragment,\n PaymentContingenciesFragment,\n} from '@paypalcorp/c3-graphql-fragments';\nimport { CreditOfferFragment } from '@/components/CreditOffer';\n\n// Below replan mutation is needed to reflect the newly added shared card incase it gets successfully added in the background\n// this is the best effort if the card gets added asynchronously\n\nexport const CHECKOUT_SESSION_REPLAN_MUTATION = gql`\n ${FundingOptionFragment}\n ${PaymentContingenciesFragment}\n ${DeclinedInstrumentFragment}\n ${CreditOfferFragment}\n mutation sendReplan(\n $areCookiesDisabled: Boolean\n $experiences: [ThreeDSPaymentExperience]\n $isIframe: Boolean\n $token: String!\n ) {\n triggerReplan(token: $token) {\n fundingOptions(returnAllPlans: true, groupSourcesOnType: INCENTIVE) {\n ...FundingOptionFragment\n }\n declinedInstruments {\n ...DeclinedInstrumentFragment\n }\n creditPPCOffers(areCookiesDisabled: $areCookiesDisabled, isIframe: $isIframe) {\n ...CreditOfferFragment\n }\n flags {\n showPPCreditOffer\n hasPPCreditInstallments\n }\n billingAddresses {\n addressId\n fullAddress\n isSelected\n }\n paymentContingencies {\n ...PaymentContingenciesFragment\n threeDomainSecure(experiences: $experiences) {\n ...ThreeDomainSecureFields\n }\n }\n }\n }\n`;\n","import {\n getDeviceAndNetworkInfo as _getDeviceAndNetworkInfo,\n isIframe as _isIframe,\n isPopup as _isPopup,\n isViewportSmall as _isViewportSmall,\n LocalStorage as BrowserStorage,\n params as _params,\n resetParams as _resetParams,\n} from '@paypalcorp/c3-util-browser';\nimport { getToken } from '@paypalcorp/c3-shared-globals';\nimport get from 'dlv';\nimport getContent from '@/lib/content';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\nconst HERMIONE_APQ_EXPERIMENT_NAME = 'Hermione_APQ';\nconst HERMIONE_APQ_TREATMENT_NAME = 'Trmt_Hermione_APQ';\n\nexport const isViewportSmall = _isViewportSmall;\nexport const getDeviceAndNetworkInfo = _getDeviceAndNetworkInfo;\nexport const isIframe = _isIframe;\nexport const isPopup = _isPopup;\nexport const resetParams = _resetParams;\nexport const params = _params;\n\nexport function isIncontext() {\n return isLegacyIncontext() || isNewIncontext();\n}\n\n// for old incontext integrations - send post message\nexport const postToMerchantForOldIncontext = (msg) => {\n if (!isLegacyIncontext()) {\n return false;\n }\n\n try {\n logger.cal.info('attempting_old_incontext_postmessage');\n logger.cal.flush();\n msg = JSON.stringify(msg);\n // If we are not in IE, attempt to send a postMessage\n if (\n window.opener &&\n (window.navigator.userAgent.match(/edge/i) ||\n (window.opener.postMessage && !window.navigator.userAgent.match(/msie|trident/i)))\n ) {\n logger.cal.flush();\n window.opener.postMessage(msg, '*');\n logger.cal.info('old_incontext_postmessage_success_non_ie_success');\n return true;\n }\n // Otherwise, attempt to send a message through the iframe bridge\n const bridge =\n window.opener &&\n window.opener.frames &&\n window.opener.frames.length &&\n window.opener.frames.PayPalBridge;\n\n if (bridge && bridge.returnToParent) {\n logger.cal.flush();\n bridge.returnToParent(msg);\n logger.cal.info('old_incontext_bridgemessage_iframe_success');\n return true;\n }\n\n logger.cal.info('old_incontext_postmessage_incompatible_user_agent', {\n userAgent: window.navigator && window.navigator.userAgent,\n });\n } catch (err) {\n logger.cal.error('old_incontext_postmessage_error', {\n error: err.stack || err.toString(),\n });\n }\n\n logger.cal.warn('old_incontext_postmessage_failure');\n return false;\n};\n\n// check if it's new incontext integration\nexport const isNewIncontext = () => {\n return window.xprops && (isPopup() || isIframe());\n};\n\n/**\n * Check if it's old incontext integration which includes checking old checkout.js\n * integrations and vzero (Braintree) integration\n * @returns {Boolean}\n */\nexport const isLegacyIncontext = () => {\n if (window.xprops || isVzeroIntegration()) {\n return false;\n }\n\n return (\n (window.name &&\n (window.name.indexOf('PPFrame') === 0 ||\n window.name.indexOf('xcomponent__ppcheckout') === 0) &&\n isPopup()) ||\n params().incontext === '1' ||\n isIframe()\n );\n};\n\n/**\n * Check if it's a vzero (Braintree) integration based off window.name and\n * query params\n * @returns {Boolean}\n */\nexport const isVzeroIntegration = () => {\n return (\n window.name === 'PPFrameRedirect' ||\n params().nolegacy === '1' ||\n // TODO: Switch this to using CheckoutSessionFlags.isVZeroIntegration instead, as it's unclear what this\n // name represents and whether it's used for other reasons\n window.name.indexOf('braintreepaypallanding') === 0\n );\n};\n\n/**\n * Set the destination to the current feature (scoped to the current token)\n * before redirecting the user away from the app.\n *\n * Call isDestination() in your shouldAutoDisplayComponent feature hook\n * (along with any necessary eligibility logic) to automatically make your\n * feature visible when the user returns to the app.\n *\n * @param {String} featureId Feature ID\n */\nexport const setDestination = (featureId) => {\n // Scope to the token so stale values are ignored\n BrowserStorage.set('lastAttemptedDestination', `${getToken()}:${featureId}`);\n};\n\n/**\n * Clear the destination after it's no longer necessary to make the feature visible after returning.\n */\nexport const clearDestination = () => {\n BrowserStorage.remove('lastAttemptedDestination');\n};\n\n/**\n * Determine if the current feature was previously set as the destination.\n * Automatically cleans up stale values. See: setDestination\n *\n * @param {String} featureId Feature ID\n * @returns {Boolean}\n */\nexport const isDestination = (() => {\n let destination = null;\n\n function memoized(featureId) {\n if (destination) {\n if (destination?.token !== getToken()) {\n // Clean up stale values\n logger.cal.info('CLEANUP_STALE_MEMOIZED_DESTINATION');\n destination = null;\n return false;\n }\n\n // Use the memozied value\n return destination?.featureId === featureId;\n }\n\n const storageDestination = BrowserStorage.get('lastAttemptedDestination');\n\n if (!storageDestination) {\n // Short-circuit if key is not present\n return false;\n }\n\n const [token, destFeatureId] = storageDestination.split(':');\n\n if (token !== getToken()) {\n // Clean up stale values\n logger.cal.info('CLEANUP_STALE_STORAGE_DESTINATION');\n clearDestination();\n return false;\n }\n\n if (destFeatureId === featureId) {\n clearDestination();\n destination = { token, featureId: destFeatureId };\n return true;\n }\n\n return false;\n }\n\n memoized.reset = () => {\n destination = null;\n };\n\n return memoized;\n})();\n\n/**\n * Check url protocols against known patterns.\n * Generally, urls can only fall under one of the defined protocols.\n * @param {String} url a url\n * @param {String} urlType the type of url like `returnUrl` or `cancelUrl`\n */\nexport const getProtocolType = (url = '', urlType = 'default') => {\n try {\n const deepLinkRegex = new RegExp('^(?!(undefined|http|https|ftp|mailto|tel|file)).*:', 'g');\n const nonStandardRegex = new RegExp('^s*(ftp|mailto|tel|file):', 'g');\n const standardRegex = new RegExp('^s*(https?|s?):', 'g');\n const relativePathRegex = new RegExp('^(/).*', 'g');\n\n const result = {\n isDeepLink: deepLinkRegex.test(url),\n isNonStandard: nonStandardRegex.test(url),\n isStandard: standardRegex.test(url),\n isRelativePath: relativePathRegex.test(url),\n };\n\n logger.cal.info(`UrlProtocolType-${urlType}`, result);\n\n return result;\n } catch (err) {\n logger.cal.info(`UrlProtocolType-${urlType}-error`, err);\n\n return {};\n }\n};\n\nexport const isInstallmentCreditType = (creditOfferType) => {\n return ['PALA', 'INST', 'EZP'].includes(creditOfferType);\n};\n\nexport const isPaypalCreditFundingInstrument = (selectedFundingOption) => {\n return (\n selectedFundingOption?.fundingInstrument?.name === 'BILL_ME_LATER' &&\n selectedFundingOption?.fundingInstrument?.type === 'PAYPAL_CREDIT'\n );\n};\n\nexport function getCreditFundingInstrument(fundingOptions) {\n return fundingOptions?.find((item) => {\n return (\n item.fundingInstrument.name === 'BILL_ME_LATER' &&\n item.fundingInstrument.type === 'PAYPAL_CREDIT'\n );\n });\n}\n\nexport const isIncentivesPlan = (fundingSources) => {\n const incentives = fundingSources?.filter((source) => source?.fundingInstrument?.type === 'INCENTIVE');\n return incentives?.length > 0;\n}\n\nexport function getGplOffer(creditAsFIOffers) {\n return creditAsFIOffers.filter(\n (offer) => offer.product === 'GPL' && offer.presentmentType === 'Radio'\n );\n}\n\nexport function gplAmountDueTodayDetails(fundingInstrument) {\n const installmentsSchedules = get(\n fundingInstrument,\n 'creditFields.creditOffer.creditPayLater.installmentsSchedule'\n );\n\n if (!installmentsSchedules) {\n return;\n }\n\n let gplAmountDueToday;\n\n const downPayment = installmentsSchedules.find(\n (installmentsSchedule) => installmentsSchedule.paymentType === 'DOWN_PAYMENT'\n );\n if (!downPayment) {\n gplAmountDueToday = get(\n fundingInstrument,\n 'creditFields.creditOffer.creditPayLater.noDownPaymentAmt'\n );\n } else {\n gplAmountDueToday = downPayment.totalPayment;\n }\n\n gplAmountDueToday.dueDate = getContent('gplFIDisplay.dueToday');\n\n return gplAmountDueToday;\n}\n\nexport function getEligibilityForAPQ(experiments) {\n return Boolean(experiments?.[HERMIONE_APQ_EXPERIMENT_NAME]?.treatment_name === HERMIONE_APQ_TREATMENT_NAME);\n}\n","import { logger } from '@paypalcorp/c3-util-logger';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\nimport stringify from 'qs/lib/stringify';\nimport { isFunction } from '@paypalcorp/c3-util-lang';\nimport { SPINNER_TYPES } from '@/components/Spinner';\nimport { RETURN_PAYLOAD, ERROR_PAYLOAD, THREE_DS_PAYLOAD } from '@paypalcorp/c3-util-logger';\nimport {\n setDestination,\n getProtocolType,\n isVzeroIntegration,\n postToMerchantForOldIncontext,\n} from '@/lib/utils';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { instrumentationLink } from '@/lib/apolloLinks';\nimport { getToken, getGlobals, getIsResolveThreeDS } from '@paypalcorp/c3-shared-globals';\n\nconst getIntegrationPayload = () => ({\n sdkMeta: params().sdkMeta,\n xComponent: params().xcomponent,\n});\n\n// If we do an internal redirect from hermesnodeweb to checkoutuinodeweb, we'll keep some URL params that can cause trouble with routing.\nconst BLACKLISTED_REDIRECT_QUERY_PARAMS = [\n 'cmd', // cmd=_express-checkout causes request to be routed to xorouternodeweb instead of hermesnodeweb\n // remove Link and Pay related params (on any fallback / redirect we don't want the experience to load again)\n 'exp_flow',\n 'linkPay',\n 'euat',\n];\n\n// Force to proceed redirect without logs being flush\nconst REDIRECT_TIMEOUT = 1000;\n\n/**\n * Force our logs to be flushed before triggering our cb function\n * By default we'll wait 1000 ms otherwise trigger cb without logs being flushed\n * @param {Object} context\n * @param {Function} context.redirect | Redirect cb fn to be invoked after logs being flushed\n * @param {Object} context.payload | The payload for callback\n * @param {Object} context.options | Options object to determine whehter current cb has been invoked or not\n * @param {String} context.logName | The name of the integration type\n */\nconst flushLogsAndRedirect = ({\n redirect = () => Promise.resolve(),\n payload = {},\n options = {},\n logName = 'FLUSH_LOGS',\n} = {}) => {\n instrumentationLink.logPayload();\n\n const doRedirect = () => {\n if (!options.redirected) {\n options.redirected = true;\n return redirect(payload);\n }\n return Promise.resolve();\n };\n\n // if flush takes too long, proceed with redirect anyways\n setTimeout(() => doRedirect(), REDIRECT_TIMEOUT);\n\n // flush logs before calling our redirect fn\n return logger.cal\n .flush()\n .then(() => doRedirect())\n .catch((err) => {\n logger.cal.info(`${logName}_ERROR`, { error: err.stack || err.toString() });\n return doRedirect();\n });\n};\n\n/**\n * Context containing all the necessary information needed to redirect back to the merchant site. Handles incontext and full page redirects.\n * @typedef {Object} ReturnContext\n * @property {Object} context - Context needed to properly redirect back to merchant site.\n * @property {string} context.returnUrl - URL for return to merchant after success. Query: checkoutSession.cart.returnUrl.href\n * @property {string} context.cancelUrl - URL for return to merchant after cancel. Query: checkoutSession.cart.cancelUrl.href\n * @property {string} context.token - EC token for transaction. Query: checkoutSession.cart.cartId\n * @property {string} context.intent - Intent of transaction. Query: checkoutSession.cart.intent\n * @property {string} [context.userId] - Payer ID of the buyer. Required for onAuthorize - is otherwise optional. Query: checkoutSession.buyer.userId\n * @property {string} [context.billingToken] - BA token, if applicable. Query: checkoutSession.cart.billingToken\n * @property {string} [context.paymentId] - Payment ID of the transaction. Probably only present if created via the payments API? Query: checkoutSession.cart.paymentId\n */\nconst mapCheckoutJsContext = ({\n returnUrl,\n cancelUrl,\n token = getToken(),\n billingToken,\n intent,\n userId,\n paymentId,\n} = {}) => ({\n // See https://github.com/paypal/paypal-checkout/blob/v5/docs/implement-checkout.md for what these values map to\n returnUrl,\n cancelUrl,\n billingToken,\n orderID: token, // From our perspective, orderID and token are the same\n payerID: userId,\n paymentToken: token,\n paymentID: paymentId,\n intent: intent && intent.toLowerCase(), // to match Hermes format\n});\n\n/**\n * Return to the merchant when the user wants to cancel out of the checkout flow\n * @param {ReturnContext} context\n */\nexport const returnCancel = (context) => {\n const { cancelUrl: url, currencyCode, merchantName } = context;\n const errorCode = 'CANCEL_RETURN_MERCHANT_ERROR';\n\n // reconstruct url when user comes from native experience\n let cancelUrl = params().native_xo ? reconstructReturnUrl({ url }) : url;\n\n logger.fpti(\n 'CANCEL_RETURN_TO_MERCHANT',\n RETURN_PAYLOAD({ action: 'cancel', currency_code: currencyCode, cancelUrl })\n );\n\n if (window.xprops && isFunction(window.xprops.onCancel)) {\n if (!isFunction(window.xprops.onCancel)) {\n logger.cal.warn('MERCHANT_ON_CANCEL_INTEGRATION_ERROR', {\n currencyCode,\n merchantName,\n cancelUrl,\n token: getToken(),\n ...getIntegrationPayload(),\n });\n }\n\n const payload = mapCheckoutJsContext(context);\n\n logger.cal.info('INCONTEXT_XPROPS_CANCEL', payload);\n\n // Redirect after logs flush\n return flushLogsAndRedirect({\n redirect: window.xprops.onCancel,\n payload,\n logName: 'INCONTEXT_XPROPS_ON_CANCEL_',\n options: { redirected: false },\n });\n }\n\n // for old checkout.js integration send post message\n if (\n cancelUrl &&\n postToMerchantForOldIncontext({\n operation: 'cancel_to_merchant',\n returnUrl: cancelUrl,\n updateParent: true,\n })\n ) {\n return;\n }\n\n // This value comes directly from the Checkout Session via GraphQL.\n // Shouldn't require any encoding.\n return redirect(cancelUrl)\n .then(() => {\n // if the return URL is a deeplink URL, then we should show\n // the page with a `Return to merchant` button so that the user can click on it to redirect\n if (getProtocolType(cancelUrl, 'cancelUrl').isDeepLink) {\n const reason = 'CANCEL_RETURN_TO_MERCHANT_DEEPLINK';\n\n logger.cal.info(reason, { url: cancelUrl });\n logger.fpti(reason, RETURN_PAYLOAD({ action: 'cancel', cancelUrl }));\n\n return redirectGenericError({ code: reason, returnUrl: cancelUrl, merchantName });\n }\n })\n .catch(() => {\n logger.fpti(errorCode, ERROR_PAYLOAD({ code: errorCode, cancelUrl, merchantName }));\n return redirectGenericError({ code: errorCode, returnUrl: cancelUrl, merchantName });\n });\n};\n\n/**\n * Return to the merchant when the user has approved the payment for checkout\n * @param {ReturnContext} context\n */\nexport const returnAuthorize = (context) => {\n const errorCode = 'RETURN_TO_MERCHANT_TIMEOUT';\n const { returnUrl, currencyCode, merchantName, paymentId } = context || {};\n\n logger.fpti(\n 'SUCCESS_RETURN_TO_MERCHANT',\n RETURN_PAYLOAD({ action: 'backToMerchant', currency_code: currencyCode, returnUrl, paymentId })\n );\n\n const updatedReturnUrl = reconstructReturnUrl({\n ...context,\n url: returnUrl,\n });\n\n // for new checkout.js integration call `onAuthorize` callback\n if (window.xprops) {\n if (!isFunction(window.xprops.onAuthorize)) {\n logger.cal.warn('MERCHANT_ON_AUTHORIZE_INTEGRATION_ERROR', {\n returnUrl,\n currencyCode,\n merchantName,\n vzero: isVzeroIntegration(),\n token: getToken(),\n ...getIntegrationPayload(),\n });\n }\n\n const payload = mapCheckoutJsContext({\n ...context,\n returnUrl: updatedReturnUrl,\n });\n\n if (window.xprops.getConnectURL) {\n logger.cal.info('INCONTEXT_XPROPS_CONNECT_REDIRECT');\n\n return window.xprops\n .getConnectURL({ payerID: payload.payerID })\n .then((connectURL) => {\n return flushLogsAndRedirect({\n logName: 'INCONTEXT_XPROPS_EBAY_CONNECT',\n redirect: () => {\n window.location.assign(connectURL);\n },\n });\n })\n .catch((err) => {\n logger.cal.error('INCONTEXT_XPROPS_CONNECT_ERROR', {\n err: err.stack || err.toString(),\n });\n\n return flushLogsAndRedirect({\n redirect: window.xprops.onAuthorize,\n payload,\n logName: 'INCONTEXT_XPROPS_ON_AUTHORIZE_',\n options: { redirected: false },\n });\n });\n }\n\n logger.cal.info('INCONTEXT_XPROPS_AUTHORIZE', payload);\n\n return flushLogsAndRedirect({\n redirect: window.xprops.onAuthorize,\n payload,\n logName: 'INCONTEXT_XPROPS_ON_AUTHORIZE_',\n options: { redirected: false },\n });\n }\n\n // for old checkout.js integration send post message\n if (\n updatedReturnUrl &&\n postToMerchantForOldIncontext({\n operation: 'return_to_merchant',\n returnUrl: updatedReturnUrl, // proper redirectUrl for vzero & native integrations\n updateParent: true,\n })\n ) {\n return;\n }\n\n return redirect(updatedReturnUrl, {\n spinnerType: SPINNER_TYPES.RETURN_TO_MERCHANT,\n rejectOnTimeout: 15000,\n replace: getIsResolveThreeDS(), // replace only for full-page 3DS case\n })\n .then(() => {\n // if the return URL is a deeplink URL, then we should show\n // the page with a `Return to merchant` button so that the user can click on it to redirect\n if (getProtocolType(updatedReturnUrl, 'returnUrl').isDeepLink) {\n const reason = 'SUCCESS_RETURN_TO_MERCHANT_DEEPLINK';\n\n logger.cal.info(reason, { url: returnUrl });\n logger.fpti(\n reason,\n RETURN_PAYLOAD({\n action: 'backToMerchant',\n payment_id: paymentId,\n return_url: returnUrl,\n updated_return_url: updatedReturnUrl,\n })\n );\n\n return redirectGenericError({ code: reason, returnUrl: updatedReturnUrl, merchantName });\n }\n })\n .catch(() => {\n logger.fpti(\n errorCode,\n ERROR_PAYLOAD({\n code: errorCode,\n merchant_name: merchantName,\n return_url: returnUrl,\n updated_return_url: updatedReturnUrl,\n })\n );\n return redirectGenericError({ code: errorCode, returnUrl: updatedReturnUrl, merchantName });\n });\n};\n\n/**\n * Return to Merchant on ApprovePayment Success\n *\n * @param approveMemberPaymentResultPayload - ApproveMemberPayment Mutation result\n * @param currencyCode - CurrencyCode for FPTI logging\n * @param merchantName - Merchant's brand name\n */\nexport const returnToMerchantAfterApprove = ({\n approveMemberPaymentResultPayload,\n currencyCode,\n merchantName,\n} = {}) => {\n const { buyer: { userId } = {}, cart: { returnUrl = {}, intent, paymentId, billingToken } = {} } =\n approveMemberPaymentResultPayload || {};\n return (\n updateFeature('SPINNER', {\n visible: true,\n data: { type: SPINNER_TYPES.RETURN_TO_MERCHANT },\n }) &&\n returnAuthorize({\n token: getToken(),\n userId,\n intent,\n returnUrl: (returnUrl && returnUrl.href) || '',\n paymentId,\n billingToken,\n currencyCode,\n merchantName,\n })\n );\n};\n\n/**\n * Redirect to the generic error page on checkoutuinodeweb, using the error code and cancelUrl provided\n *\n * @param code - Reason of redirect\n * @param returnUrl - Merchant's return url\n * @param merchantName - Merchant's brand name\n */\nexport const redirectGenericError = ({\n code = 'DEFAULT',\n returnUrl = '',\n merchantName = '',\n replace = false,\n} = {}) => {\n const baseUrl = '/checkoutweb/genericError';\n const queryParams = {\n code: btoa(code),\n cancelLink: returnUrl,\n merchantName: merchantName,\n };\n\n const genericErrorUrl = buildURL(baseUrl, queryParams);\n\n logger.cal.info(`REDIRECT_TO_GENERIC_ERROR_${code}`);\n\n return redirect(genericErrorUrl, { replace });\n};\n\n/**\n * Construct url with params\n *\n * @param {String} url\n * @param {Object} params\n */\nexport const buildURL = (url, params) => {\n const paramKeys = Object.keys(params || {});\n\n if (JSON.stringify(params) === '{}') {\n return url;\n }\n\n if (!paramKeys.length) {\n return url;\n }\n\n BLACKLISTED_REDIRECT_QUERY_PARAMS.forEach((blacklistedKey) => delete params[blacklistedKey]);\n\n if (url.indexOf('?') === -1) {\n url += '?';\n } else {\n url += '&';\n }\n\n url += stringify(params);\n\n return url;\n};\n\nexport function redirectToOpenBanking(encryptedId) {\n logger.cal.info('HERMIONE_REDIRECT_TO_OPEN_BANKING');\n const queryParams = Object.assign({}, params(), { id: encryptedId });\n ['cmd'].forEach((key) => {\n delete queryParams[key];\n });\n const openBankingUrl = buildURL(`/checkoutweb/openBanking/`, queryParams);\n return redirect(openBankingUrl);\n}\n\nexport function redirectToP3Flow(partnerName) {\n logger.cal.info('HERMIONE_REDIRECT_TO_P3_FLOW');\n const currentQueryParam = Object.assign({}, params());\n //'success_card_num','failed_card_num','errorCode','errorStatus' are param from MNW\n // indicating the p3 flow result dont want to set it returnUrl as it might mislead.\n ['cmd', 'success_card_num', 'failed_card_num', 'errorCode', 'errorStatus'].forEach((key) => {\n delete currentQueryParam[key];\n });\n const returnUrl = buildURL(`/checkoutweb/`, currentQueryParam);\n const queryParams = Object.assign({}, params(), {\n partner_name: partnerName,\n returnUri: returnUrl,\n });\n ['cmd'].forEach((key) => {\n delete queryParams[key];\n });\n const p3StartUrl = buildURL(`/checkoutweb/p3start/`, queryParams);\n return redirect(p3StartUrl);\n}\n\n/*\n * Redirect the user to Negative Balance App in Moneynodeweb\n */\nexport function redirectToNegativeBalanceRecovery() {\n const negativeBalanceRecoveryUrl = buildURL(getGlobals().uri.negativeBalanceRecoveryEndpoint);\n\n logger.cal.info('REDIRECT_TO_NEGATIVE_BALANCE_RECOVERY', {\n url: negativeBalanceRecoveryUrl,\n });\n\n return redirect(negativeBalanceRecoveryUrl);\n}\n\n/**\n *\n * @param {String} reason\n * @param {Object} ctx\n */\nexport function redirectToLogin(reason = 'GENERIC_ERROR', ctx) {\n const queryParams = Object.assign({}, params(), { ulClientRedirect: reason }, ctx);\n\n ['ul', 'ulReturn', 'returnToLiteUri'].forEach(function (key) {\n delete queryParams[key];\n });\n\n const ulAsLandingUrl = buildURL(window.location.pathname, queryParams);\n\n logger.cal.info(`REDIRECT_TO_UL_${reason}`, { url: ulAsLandingUrl });\n\n return redirect(ulAsLandingUrl);\n}\n\nexport function redirectToLogout(reason, extraParams = {}) {\n const baseUrl = '/checkoutweb/logout';\n const queryParams = {\n ...params(),\n ...extraParams,\n reason,\n };\n\n const logoutUrl = buildURL(baseUrl, queryParams);\n\n return redirect(logoutUrl);\n}\n\nlet redirectedToAuthChallenge = false;\n\nexport const resetAuthChallengeRedirect = () => {\n redirectedToAuthChallenge = false;\n};\n\n/**\n * Given a stepUpContext, builds the URL to redirect to the auth challenge app.\n * This is if the user needs additional confirmation before being allowed to complete the transaction.\n * @param {string} stepupContext - Code from a step up contingency like `VERIFY_USER_IDENTITY`, to be passed to authchallengenodeweb\n * */\nexport function redirectToAuthChallenge(stepupContext) {\n if (redirectedToAuthChallenge) {\n return;\n }\n\n redirectedToAuthChallenge = true;\n\n const queryParams = {\n ...params(),\n lite: 1,\n invalidateCheckoutSessionPlan: true, // We need to force replan on return to lite\n atoSuccess: 'true',\n };\n\n delete queryParams['returnToLiteUri'];\n\n const path = 'webapps/hermes'; // Relative pathname for redirect. Do not add a leading slash, as it causes some URLs to fail validation.\n const returnUri = buildURL(path, queryParams);\n // having it as backward compatible until all changes rollout, will clean authchallenge part post rollout\n const authEndPoint =\n getGlobals().uri.authNodeWebEndpoint || getGlobals().uri.authchallengeEndpoint;\n const authChallengeUrl = buildURL(authEndPoint, {\n stepupContext,\n returnUri,\n });\n\n logger.cal.info('REDIRECT_TO_AUTHCHALLENGE', { url: authChallengeUrl });\n\n redirect(authChallengeUrl);\n}\n\n/**\n * For all risky login related use case (one touch), we'll need to go via Hermes due to context\n * sharing between `xo-landing-router` and Unified login\n *\n * @param {Object} config | redirectToRiskyLogin config object\n * @param {String} config.reason | Reason for redirecting to risky login\n * @param {String} config.destination | Destination page after coming back from risky login\n * @param {Object} config.extraParams | Additional risky login params\n * @returns {Promise} Redirect to Hermesnodeweb for risky login\n */\nexport function redirectToRiskyLogin({ reason = '', destination = '', extraParams = {} } = {}) {\n return Promise.resolve()\n .then(() => destination && setDestination(destination))\n .then(() => {\n const isLocalhost = window.location.host.includes('localhost');\n const baseUrl = isLocalhost\n ? 'https://www.msmaster.qa.paypal.com/webapps/hermes?ul=landing'\n : '/webapps/hermes?ul=landing';\n const queryParams = {\n ...params(),\n ...extraParams,\n reason,\n };\n\n // hashUrl handler can be removed after ADD_BANK_LINK is removed\n const hashUrl = extraParams.hashUrl;\n const defaultRemoved = ['ul', 'ulReturn', 'reason', 'returnToLiteUri'];\n // `hashUrl` means we will be fallback to Hermes, hence `lite` can't present\n if (hashUrl) {\n defaultRemoved.push(...['lite', 'hashUrl']);\n } else {\n defaultRemoved.push(...['hermes']);\n }\n\n defaultRemoved.forEach((key) => {\n delete queryParams[key];\n });\n\n let hermesUrl = buildURL(baseUrl, queryParams);\n if (hashUrl) {\n hermesUrl += hashUrl;\n }\n\n logger.cal.info(`REDIRECT_TO_HERMES_RISKY_LOGIN_${reason}`, { url: hermesUrl });\n redirect(hermesUrl);\n })\n .catch((e) => logger.info.cal('REDIRECT_TO_RISKY_LOGIN_ERROR', { message: e && e.message }));\n}\n\nconst isUnsafeRedirect = (url) =>\n url?.toLowerCase().replace(/\\s/g, '').indexOf('javascript:') !== -1; // eslint-disable-line no-script-url\n\nconst blacklist = ['password', 'pr_password'];\nconst blacklistRegex = new RegExp(`(${blacklist.join('|')})=([^&]*)`, 'g');\n\nconst sanitizeUrlForLogging = (inputUrl) =>\n inputUrl.replace(blacklistRegex, (match, key, value) => `${key}=**`);\n\n/**\n * Redirect to the provided url.\n * Also triggers spinner and flushes logs\n * If rejectOnTimeout is specified, reject promise after given timeout\n * @param {String} url\n * @param {Object} param1\n */\nexport const redirect = (\n url = '',\n { replace, windowOpen, spinnerType = SPINNER_TYPES.DEFAULT, rejectOnTimeout } = {}\n) => {\n return new Promise((resolve, reject) => {\n if (isUnsafeRedirect(url)) {\n logger.cal.info('HERMIONE_UNSAFE_REDIRECT', { url });\n throw new Error(`HERMIONE_UNSAFE_REDIRECT ${url}`);\n }\n\n logger.cal.info('REDIRECT', { url: sanitizeUrlForLogging(url) });\n\n const redirectBack = () => {\n if (replace) {\n resolve(window.location.replace(url));\n } else if (windowOpen) {\n resolve(window.open(url));\n } else {\n resolve(window.location.assign(url));\n }\n };\n const options = { redirected: false };\n\n if (!windowOpen) {\n updateFeature('SPINNER', { visible: true, data: { type: spinnerType } });\n }\n\n // Redirect after logs flush\n flushLogsAndRedirect({\n redirect: redirectBack,\n payload: undefined,\n logName: 'BACK_TO_MERCHANT_REDIRECT',\n options,\n });\n\n if (rejectOnTimeout) {\n setTimeout(() => {\n options.redirected = true;\n reject();\n }, rejectOnTimeout);\n }\n });\n};\n\n/**\n * trigger fallback with some reason\n */\nexport function fallback({ reason }) {\n const baseUrl = '/checkoutweb/fallback';\n const previousParams = Object.assign({}, params());\n\n BLACKLISTED_REDIRECT_QUERY_PARAMS.forEach(\n (blacklistedKey) => delete previousParams[blacklistedKey]\n );\n const previousQueryString = stringify(previousParams);\n\n const newParams = {\n token: getToken(),\n reason: reason,\n query: previousQueryString,\n };\n\n const fallbackUrl = buildURL(baseUrl, newParams);\n\n return redirect(fallbackUrl, { replace: true });\n}\n\n/**\n * Reconstruct returnUrl for native & partner integrations for incontext integations\n *\n * @param {Object} options | The options object\n * @param {string} options.url - can be either return/cancel url\n * @param {string} options.intent\n * @param {string} options.paymentId\n * @param {Object} options.xparms - xparams object\n * @param {Object} options.urlParams - EC token for transaction. Query: checkoutSession.cart.cartId\n * @param {boolean} options.isVzero - Boolean flag to indicate current integration is vzero\n * @param {string} options.fromNative - Boolean flag to indicate current integration is native\n * @returns {string} Construct the correct url for native & partner integrations for incontext integration\n */\nexport const reconstructReturnUrl = ({\n url = '',\n intent = '',\n userId = '',\n paymentId = '',\n returnUrl = '',\n isVzero = isVzeroIntegration(),\n redirectUri = params().redirect_uri || '',\n fromNative = Boolean(params().native_xo),\n invalidIntegrationType = Boolean(redirectUri) && (isVzero || fromNative),\n} = {}) => {\n const urlParams = {};\n const payload = {\n url,\n vzero: isVzero,\n native: fromNative,\n return_url: returnUrl,\n redirect_uri: redirectUri,\n ...(paymentId && { payment_id: paymentId }),\n };\n\n // NOTE: for v2 order transacitons (incontext), `returnUrl` will be `null` from approveMemberPayment\n // mutation since both `returnUrl` and `cancelUrl` are being handled by window.xprops\n if (!url && !redirectUri && returnUrl) {\n return returnUrl;\n }\n\n // TODO: can be removed after investigation\n if (!url.includes('paymentId') && paymentId) {\n logger.cal.warn('MISSING_PAYMENT_ID_FROM_URL', payload);\n }\n\n // By default `redirect_uri` should ONLY be honored by either\n // native or partner (ex, vzero) integrations\n if (!invalidIntegrationType) {\n logger.cal.info('INVALID_INTEGRATION_TYPE_FOR_RECONSTRUCT_URL', payload);\n return returnUrl;\n }\n\n // TODO: can be removed after investigation\n const { isDeepLink: isNativeRedirectUri } = getProtocolType(redirectUri, 'redirect_uri');\n if (!isNativeRedirectUri) {\n logger.cal.warn('INVALID_REDIRECT_URI', payload);\n }\n\n // TODO: can be removed after investigation\n if (!redirectUri.includes('token')) {\n redirectUri += `?token=${getToken()}`;\n logger.cal.warn('MISSING_TOKEN_FROM_REDIRECT_URI', payload);\n }\n\n // TODO: can be removed after investigation\n if (!redirectUri.includes('PayerID') && userId) {\n redirectUri += `&PayerID=${userId}`;\n logger.cal.warn('MISSING_PAYER_ID_FROM_REDIRECT_URI', {\n ...payload,\n payer_id: userId,\n });\n }\n\n // TODO: can be removed after investigation\n if (!redirectUri.includes('paymentId') && paymentId) {\n // NOTE: double check to ensure `paymentId` is present & not duplicagted\n urlParams.paymentId = paymentId;\n logger.cal.warn('MISSING_PAYMENT_ID_FROM_URL', { payment_id: paymentId });\n }\n\n urlParams.intent = intent && intent.toLowerCase();\n urlParams.opType = 'payment';\n urlParams.return_uri = `${url}${paymentId ? `&paymentId=${paymentId}` : ''}`;\n const finalReturnUrl = buildURL(redirectUri, urlParams);\n\n logger.cal.info('RECONSTRUCT_RETURN_URL', {\n ...payload,\n reconstruct_return_url: finalReturnUrl,\n });\n return finalReturnUrl;\n};\n\n/**\n * Redirect back to checkoutlite on 3DS approve failure\n */\nexport function redirectOnThreeDSFailed({ message = '' }) {\n const { originApp = 'hermione' } = params();\n\n const baseUrl = '/checkoutweb';\n const newParams = Object.assign({}, params(), {\n threeDSFailed: true,\n });\n\n logger.fpti(\n 'errorThreeDSContingency',\n THREE_DS_PAYLOAD({\n action: 'errorThreeDSContingency',\n message,\n originApp,\n })\n );\n\n // For Link and Pay, we'd only get the sticky FI associated with the BA.\n // On 3ds error, we need to list the other FIs and this requires re-planning\n // and hence falling back to hermes\n if (originApp === 'link_and_pay') {\n return fallback({ reason: 'failed3DS' });\n }\n\n const redirectUrl = buildURL(baseUrl, newParams);\n\n redirect(redirectUrl, { replace: true });\n}\n\n/**\n * Redirect to the same page and pass in new/updated params\n *\n * @param {Object} _params - New/Updated parameters object\n * @param {String} returnUrl - New refresh return url with new/updated parameter\n */\nexport const redirectToSameLocationWithNewParam = (newParams = {}) => {\n const baseUrl = window.location.pathname;\n const queryParams = {\n ...params(),\n ...newParams,\n };\n\n const newUrl = buildURL(baseUrl, queryParams);\n\n return redirect(newUrl);\n};\n\n/**\n * Redirect users to Moneynodeweb to add a bank account\n *\n * @NOTE The redirection to moneynodeweb will happen in two steps:\n * 1. redirect users to the `moneynodeweb/addBank/` route. This is a route configured in severus which is responsible of\n * preparing the moneynodeweb url alongside with the cancel and return urls.\n * 2. Once configuring the url is done, users will be redirected to MNW.\n */\nexport function redirectToMNWAddBank() {\n return redirect(buildURL('/checkoutweb/moneynodeweb/addBank/', params()));\n}\n","import { logger } from '@paypalcorp/c3-util-logger';\nimport { getClient, getToken } from '@paypalcorp/c3-shared-globals';\nimport gql from 'graphql-tag';\n\n/*\n * This mutation is used to invalidate the current Planning of the Checkout Session.\n * So that the next time when we query for any planning data, the replanning is triggered.\n * In hermione, the planning is queried with `PAY_WITH` Query.\n */\nexport const INVALIDATE_CHECKOUT_SESSION_PLAN_MUTATION = gql`\n mutation InvalidateCheckoutSessionPlan($token: String!) {\n invalidateCheckoutSessionPlan(token: $token)\n }\n`;\n\nexport default function invalidateCheckoutSessionPlan() {\n const client = getClient();\n const token = getToken();\n return client\n .mutate({\n mutation: INVALIDATE_CHECKOUT_SESSION_PLAN_MUTATION,\n variables: {\n token,\n },\n })\n .catch((error) => {\n logger.cal.info(`INVALIDATE_CHECKOUT_SESSION_PLAN_MUTATION_FAILURE`, { ...error });\n });\n}\n","import { params } from '@paypalcorp/c3-util-browser';\nimport invalidateCheckoutSessionPlan from '@/lib/invalidateCheckoutSessionPlan';\nimport { getIsResolveThreeDS } from '@paypalcorp/c3-shared-globals';\n\n/*\n * Checks if the checkoutSession Plan needs to be invalidated\n * & if needed, it calls the invalidateCheckoutSessionPlan mutation\n */\nconst invalidateCheckoutSessionPlanIfNeeded = () => {\n const shouldInvalidateCheckoutSessionPlan = !!params().invalidateCheckoutSessionPlan;\n\n if (shouldInvalidateCheckoutSessionPlan) {\n return invalidateCheckoutSessionPlan();\n }\n return Promise.resolve();\n};\n\n/*\n * The Idea is to chain multiple promises like\n * const executePreRenderSteps = () => (\n * invalidateCheckoutSessionIfNeeded()\n * .then(doSomethingElse)\n * .then(otherNeededSteps)\n * )\n */\nconst executePreRenderSteps = () => {\n if (getIsResolveThreeDS()) {\n return Promise.resolve();\n }\n return invalidateCheckoutSessionPlanIfNeeded();\n};\n\nexport { executePreRenderSteps };\n","import { params } from '@paypalcorp/c3-util-browser';\nimport { updateFeature, updateFeatures } from '@paypalcorp/c3-util-store';\nimport { CHECKOUT_BUTTON_STATES } from '@/components/CheckoutButton/constants';\nimport { logger, GENERIC_PAYLOAD, STATE_NAME} from '@paypalcorp/c3-util-logger';\nimport { checkCardAdd } from './performReplanAfterPthreeFlow';\nimport getContent from '@/lib/content';\nimport Notification from '@/shared/components/Notification';\nimport React, { useEffect } from 'react';\n\n/**\n * This return step handling is for P3 flow, post completing flow in partner redirect from MNW \n * to checkout with success_card_num, failed_card_num , errorCode so based on the data\n * we handle the flow.\n */\nconst checkP3ReturnStep = () => {\n const { success_card_num, failed_card_num, errorCode = '', errorStatus = '' } = params();\n const successCardNum = parseInt(success_card_num,10);\n const failedCardNum = parseInt(failed_card_num,10);\n\n const logHelper = (status) => {\n logFPTI(errorCode, errorStatus, success_card_num,failed_card_num, status);\n }\n const checkRealTimeCardAddHelper = (eventType) => {\n return checkRealTimeCardAdd(eventType, successCardNum, failedCardNum, errorCode);\n }\n\n if(errorCode === 'PULL_SERVER_REQHANDLER'){\n logger.cal.info('P3_PULL_SERVER_REQHANDLER_ERROR_FLOW');\n logHelper('P3_ERROR');\n return checkRealTimeCardAddHelper('ERROR');\n }\n\n const isSuccessCardExists = successCardNum > 0;\n const isFailedCardExists = failedCardNum > 0;\n\n if (isSuccessCardExists && !isFailedCardExists) {\n logger.cal.info('P3_COMPLETE_SUCCESS_FLOW');\n logHelper('P3_SUCCESS');\n return checkRealTimeCardAddHelper('SUCCESS');\n } else if (isSuccessCardExists && isFailedCardExists) {\n logger.cal.info('P3_PARTIAL_SUCCESS_FLOW');\n logHelper('P3_PARTIAL_SUCCESS');\n return checkRealTimeCardAddHelper('PARTIAL');\n } else if (!isNaN(successCardNum) && !isSuccessCardExists) {\n logger.cal.info('P3_ERROR_FLOW');\n logHelper('P3_ERROR');\n return checkRealTimeCardAddHelper('ERROR');\n }\n};\n\nexport const logFPTI = (errorCode, errorStatus,success_card_num,failed_card_num,status) => {\n \n let intErrorCode, intErrorDesc = '';\n if(status === 'P3_ERROR'){\n intErrorCode = errorStatus;\n intErrorDesc = errorCode\n }\n\n logger.fpti('xo_add_fi_messaging', GENERIC_PAYLOAD({\n int_error_code: intErrorCode,\n int_error_desc: intErrorDesc,\n state_name: STATE_NAME.addCard,\n transition_name: 'prepare_fi_messaging',\n fi_count: 'success_card_count:'+ success_card_num + ',failed_card_count:' + failed_card_num,\n status: status\n })\n );\n};\n\nexport const checkRealTimeCardAdd = (flowStatus, successCardNum, failedCardNum, errorCode) => {\n if (flowStatus === 'ERROR') {\n return updateFeature('LINK_CARD_BY_PTHREE', { data: { pthreeFailureReason: errorCode } });\n }\n return checkCardAdd().then(({ data }) => {\n let message = '';\n if (flowStatus === 'SUCCESS') {\n\n message = successCardNum > 1 ? getContent('addCard.linkCardByPthree.success.ways', { numberOfCards: successCardNum }) \n : getContent('addCard.linkCardByPthree.success.way', { numberOfCards: successCardNum });\n\n } else if (flowStatus === 'PARTIAL') {\n let contentKey = '';\n if(successCardNum > 1 && failedCardNum === 1){\n contentKey = 'addCard.linkCardByPthree.partialSuccess.ways.account';\n } else if(successCardNum > 1 && failedCardNum > 1){\n contentKey = 'addCard.linkCardByPthree.partialSuccess.ways.accounts';\n } else if(successCardNum === 1 && failedCardNum === 1){\n contentKey = 'addCard.linkCardByPthree.partialSuccess.way.account';\n } else if(successCardNum === 1 && failedCardNum > 1){\n contentKey = 'addCard.linkCardByPthree.partialSuccess.way.accounts';\n }\n\n message = getContent(contentKey, { successCardNum,failedCardNum });\n }\n updateFeatures([\n {\n id: 'SPINNER',\n visible: true\n },\n {\n id: 'CHECKOUT_BUTTON',\n data: {\n status: CHECKOUT_BUTTON_STATES.RESOLVED\n },\n },\n {\n id: 'REVIEW_PAGE_ALERT',\n visible: true,\n data: {\n display: true,\n message: message,\n type: 'success',\n },\n }\n ]);\n });\n};\n\nexport { checkP3ReturnStep };","import { getClient, getToken } from '@paypalcorp/c3-shared-globals';\nimport { threeDsExperienceVars } from '@paypalcorp/c3-util-threed-ds';\nimport { isIframe } from '@paypalcorp/c3-util-browser';\nimport { areCookiesDisabled } from '@/lib/cookie';\nimport { CHECKOUT_SESSION_REPLAN_MUTATION } from '@/components/SharedCard/SharedCardWait/Mutation';\n\nexport const checkCardAdd = () => {\n\n const client = getClient();\n const token = getToken();\n return client.mutate({\n mutation: CHECKOUT_SESSION_REPLAN_MUTATION,\n variables: threeDsExperienceVars({\n areCookiesDisabled: areCookiesDisabled(),\n isIframe: isIframe(),\n token,\n })\n });\n\n};\n","import React from 'react';\nimport gql from 'graphql-tag';\nimport { Query } from '@apollo/react-components';\n\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { TRANSACTION_DETAILS } from '@paypalcorp/c3-util-logger';\nimport { getDeviceAndNetworkInfo, isIframe, isPopup } from '@paypalcorp/c3-util-browser';\n\nimport {\n isIncontext,\n isLegacyIncontext,\n isNewIncontext,\n isVzeroIntegration,\n postToMerchantForOldIncontext,\n} from '@/lib/utils';\nimport { isFunction } from '@paypalcorp/c3-util-lang';\nimport { redirectGenericError } from '@/lib/redirects';\nimport { LOG_TRANSITIONS } from '@paypalcorp/c3-util-logger';\nimport get from 'dlv';\nimport { executePreRenderSteps } from '@/lib/preRenderSteps';\nimport { getAccessToken, getGlobals, getToken, updateGlobals } from '@paypalcorp/c3-shared-globals';\nimport { checkFIBalanceStep } from '@/lib/fiBalance';\nimport { checkP3ReturnStep } from '@/lib/linkCardByPthree';\n\nexport const initAppQuery = gql`\n query InitAppQuery($token: String!) {\n checkoutSession(token: $token) {\n cart {\n soldoutUrl\n showSoldoutPage\n cancelUrl {\n href\n }\n amounts {\n total {\n currencyValue\n currencyCode\n currencySymbol\n }\n }\n description\n }\n merchant {\n merchantId\n name\n }\n }\n }\n`;\n\n// To be called before any app logic\nfunction initApp() {\n return Promise.resolve()\n .then(function logIntegration() {\n let formFactor;\n window.logPerformanceNow('TimeToFrameworkEnd'); // The time taken to finish bootstrapping the framework.\n if (isPopup()) {\n formFactor = 'POPUP';\n } else if (isIframe()) {\n formFactor = 'IFRAME';\n } else {\n formFactor = 'FULLPAGE';\n }\n\n const integrationType = isIncontext() ? 'INCONTEXT' : 'FULLPAGE';\n\n logger.cal.info(`integration_type_${integrationType}`, {\n formFactor,\n xprops: Boolean(window.xprops),\n windowName: window.name,\n });\n\n if (isNewIncontext()) {\n logger.cal.info(`new_incontext`);\n } else if (isLegacyIncontext()) {\n logger.cal.info(`old_incontext`);\n }\n })\n .then(function logStart() {\n // This event was originally meant to mark the beginning of\n // client side logs on checkout. We might want updated\n // names for checkoutlite. Keeping logs as CAL for now.\n // Equivalent for :-\n // state_name: 'client_middleware'\n // transition_name: 'process_app_start_design'\n const networkAndDeviceData = getDeviceAndNetworkInfo();\n logger.cal.info('NETWORK_DEVICE_DATA', networkAndDeviceData);\n logger.cal.info('APP_PERFORMANCE_EVENTS', window.appPerformanceEvents);\n })\n .then(function checkFramebust() {\n if (\n isIframe() &&\n !isVzeroIntegration() &&\n !(window.paypal && isFunction(window.paypal.allowIframe) && window.paypal.allowIframe())\n ) {\n logger.cal.info('frame_bust_disallowed_iframe');\n\n try {\n window.top.location = window.location.href;\n } catch (err) {\n logger.cal.error('frame_bust_failed', err);\n redirectGenericError({ code: 'FRAME_BUST_FAILED' });\n }\n\n setTimeout(() => {\n logger.cal.error('frame_bust_did_not_redirect_after_2s');\n redirectGenericError({ code: 'FRAME_BUST_FAILED_REDIRECT' });\n }, 2000);\n }\n })\n .then(function setupAccessToken() {\n if (window.xprops && isFunction(window.xprops.accessToken)) {\n return window.xprops.accessToken().then((newAccessToken) => {\n const globals = getGlobals();\n const { user } = globals;\n\n updateGlobals({\n ...globals,\n user: {\n ...user,\n access_token: newAccessToken,\n },\n });\n logger.cal.info('hermione_using_provided_xprops_access_token', { newAccessToken });\n });\n }\n\n return Promise.resolve();\n })\n .then(function callAccessToken() {\n const accessToken = getAccessToken();\n\n if (window.xprops && isFunction(window.xprops.onAuth)) {\n return accessToken\n ? window.xprops.onAuth({ accessToken })\n : logger.cal.info('hermione_xprops_on_auth_invalid_access_token');\n }\n\n return Promise.resolve();\n })\n .then(executePreRenderSteps)\n .then(checkFIBalanceStep)\n .then(checkP3ReturnStep)\n .catch((err) => {\n logger.cal.error('INCONTEXT_INIT_ERROR', err);\n return;\n });\n}\n\n// Incontext init logic that requires some API data\nfunction initIncontextFromData({ cancelUrl, merchantId, token } = {}) {\n if (window.xprops && isFunction(window.xprops.onInit)) {\n logger.cal.info('INCONTEXT_XPROPS_INIT', {\n token,\n cancelUrl,\n merchantId,\n });\n return window.xprops.onInit({ token, cancelUrl, merchantId });\n }\n\n // TODO: needs to check `secureWindowmsg` from hermesnodeweb\n // https://github.paypal.com/Checkout-R/hermesnodeweb/blob/develop/public/js/lib/miniBrowser.js#L294\n const msg = {\n operation: 'init',\n cancelUrl: cancelUrl,\n landingUrl: window.location && window.location.href,\n };\n\n postToMerchantForOldIncontext(msg);\n\n return Promise.resolve();\n}\n\n// add extra things to pa.js analytics\nfunction attachPaJsFpti({ merchantId, cartTotal } = {}) {\n const { currencyCode, currencyValue } = cartTotal;\n if (window.fpti) {\n window.fpti.mrid = merchantId;\n window.fpti.curr = currencyCode;\n window.fpti.amt = currencyValue;\n }\n}\n\n/**\n * Bootstrap the app. Runs things that only need to be run once, at startup time.\n */\nclass AppBootstrap extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n ready: false,\n };\n }\n\n componentDidMount() {\n initApp().then(() => {\n logger.cal.transition(LOG_TRANSITIONS.BOOTSTRAP);\n this.setState({ ready: true });\n });\n }\n\n render() {\n const token = getToken();\n if (!this.state.ready) {\n return
;\n }\n\n return (\n \n {({ loading, data, error }) => {\n if (!loading && data && !error) {\n const checkoutSession = data.checkoutSession;\n\n const cancelUrl = get(checkoutSession, 'cart.cancelUrl.href');\n const cartTotal = get(checkoutSession, 'cart.amounts.total', {});\n const merchantId = get(checkoutSession, 'merchant.merchantId');\n\n initIncontextFromData({\n token,\n cancelUrl,\n merchantId,\n });\n\n attachPaJsFpti({ merchantId, cartTotal });\n\n logger.fpti('TRANSACTION_DETAILS', TRANSACTION_DETAILS(checkoutSession));\n }\n\n return this.props.children;\n }}\n \n );\n }\n}\n\nexport default AppBootstrap;\n","import React from 'react';\nimport { getClient, getCountry, getToken, getLocale } from '@paypalcorp/c3-shared-globals';\nimport ThreeDS from '@paypalcorp/c3-component-three-ds-two-confirmation';\nimport { AddCard } from '@paypalcorp/c3-add-card';\nimport { RegistryProvider, renderFor } from '@paypalcorp/c3-render-data';\n\nexport const C3Bootstrap = ({ children }) => {\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\nimport { CacheProvider } from '@emotion/core';\nimport createCache from '@emotion/cache';\nimport stylisRTL from 'stylis-plugin-rtl';\nimport { getGlobals, getDirectionality } from '@paypalcorp/c3-shared-globals';\nimport App from './App';\nimport AppBootstrap from './AppBootstrap';\nimport { InterstitialManager } from '@paypalcorp/c3-component-interstitial';\nimport { FormProvider } from '@paypalcorp/c3-form';\nimport { C3Bootstrap } from './C3Bootstrap';\n\nconst { nonce } = getGlobals();\n\nexport const AppIndex = () => {\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n","import { getClient, getToken } from '@paypalcorp/c3-shared-globals';\nimport gql from 'graphql-tag';\nimport {\n FundingOptionFragment,\n PaymentContingenciesFragment,\n} from '@paypalcorp/c3-graphql-fragments';\nimport { threeDsExperienceVars } from '@paypalcorp/c3-util-threed-ds';\n\nexport const CLEAR_REAL_TIME_BALANCE_CONTINGENCY = gql`\n ${FundingOptionFragment}\n ${PaymentContingenciesFragment}\n mutation clearRealTimeBalanceContingency(\n $bankId: String!\n $experiences: [ThreeDSPaymentExperience]\n $token: String!\n $error: String\n ) {\n clearRealTimeBalanceContingency(token: $token, bankId: $bankId, error: $error) {\n fundingOptions(returnAllPlans: true, groupSourcesOnType: INCENTIVE) {\n ...FundingOptionFragment\n }\n paymentContingencies {\n ...PaymentContingenciesFragment\n threeDomainSecure(experiences: $experiences) {\n ...ThreeDomainSecureFields\n }\n }\n }\n }\n`;\n\nexport const checkFIBalance = (bankId, error) => {\n const client = getClient();\n const token = getToken();\n return client.mutate({\n mutation: CLEAR_REAL_TIME_BALANCE_CONTINGENCY,\n variables: threeDsExperienceVars({\n token,\n bankId,\n error,\n }),\n context: { skipFallback: true },\n });\n};\n","import { checkFIBalance } from './checkFIBalance';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { updateFeature } from '@paypalcorp/c3-util-store';\nimport { CHECKOUT_BUTTON_STATES } from '@/components/CheckoutButton/constants';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\n//Checks the current balance of the Bank account when MoneyNodeweb action is return, id holds the Bank id selected by the user.\n//Once the RealTimeBalance contingency is cleared the CHECKOUT_BUTTON_STATES is set to resolved for completing the transaction\nconst checkFIBalanceStep = () => {\n const { action = '', id = '', error = '' } = params();\n if (action === 'return') {\n logger.cal.info('OPEN_BANKING_MNW_RETURN');\n if (error) {\n logger.cal.info('OPEN_BANKING_MNW_RETURNED_ERROR');\n }\n return checkRealTimeBalance(id, error);\n } else if (action === 'cancel') {\n if (error) {\n logger.cal.info('OPEN_BANKING_MNW_USER_CLOSE_MODAL_ERROR');\n return checkRealTimeBalance(id, error);\n }\n logger.cal.info('OPEN_BANKING_MNW_CANCEL');\n return Promise.resolve();\n }\n};\n\nexport const checkRealTimeBalance = (id, error) => {\n return checkFIBalance(id, error).then(({ data }) => {\n updateFeature('SPINNER', { visible: true });\n const { clearRealTimeBalanceContingency: { fundingOptions = [] } = {} } = data || {};\n const hasFI = fundingOptions.find((fi) => {\n return fi.id === id;\n });\n\n if (hasFI && Object.keys(hasFI).length) {\n const status = error ? CHECKOUT_BUTTON_STATES.INITIAL : CHECKOUT_BUTTON_STATES.RESOLVED;\n updateFeature('CHECKOUT_BUTTON', {\n data: {\n status,\n flow: 'OPEN_BANKING',\n },\n });\n } else {\n updateFeature('SPINNER', { visible: false }).then(\n updateFeature('OPEN_BANKING', {\n data: { blackListedFI: id },\n })\n );\n }\n });\n};\n\nexport { checkFIBalanceStep };\n","import { onError } from 'apollo-link-error';\nimport { ApolloClient } from 'apollo-client';\nimport { RetryLink } from 'apollo-link-retry';\nimport { ApolloLink, split } from 'apollo-link';\nimport { createHttpLink } from 'apollo-link-http';\nimport { BatchHttpLink } from 'apollo-link-batch-http';\nimport { createPersistedQueryLink } from 'apollo-link-persisted-queries';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport get from 'dlv';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { ERROR_PAYLOAD } from '@paypalcorp/c3-util-logger';\nimport { redirectToLogin, redirectToRiskyLogin } from '@/lib/redirects';\nimport { getGlobals, getCredit, getIsLinkAndPay, setClient } from '@paypalcorp/c3-shared-globals';\nimport { instrumentationLink, loggerLink, spinnerLink, authLink } from '@/lib/apolloLinks';\nimport { defaultApolloCacheState, resolvers, updateContingency } from '@paypalcorp/c3-util-store';\nimport { GLOBAL_CONTINGENCIES_HANDLERS, HANDLED_CONTINGENCIES } from '@/lib/contingencies';\nimport { getEligibilityForAPQ } from '@/lib/utils';\n\nimport { getClientMetadataID } from './fraudNet';\nimport CheckoutError from './checkoutError';\nimport { apolloInMemoryCache } from './apolloCache';\nimport { initFeatures } from '@/features';\n\nconst createClient = ({\n token,\n queryEndpoint,\n auth,\n enableBatching = true,\n enableRetry = false,\n cache,\n mockLink,\n schemaLink,\n}) => {\n initFeatures();\n const globals = getGlobals();\n const { user, experiments } = globals;\n //Flag to determine if the flow is eligible to use APQ for GQL queries\n const isAPQEligible = getEligibilityForAPQ(experiments);\n logger.cal.info(`HERMIONE_GQL_APQ_ELIGIBILITY : ${isAPQEligible}`, { token });\n const { euat } = params();\n let accessToken = user.auth && user.auth.access_token;\n\n if (euat && euat === '1') {\n accessToken = window.location.hash.substr(1);\n }\n\n const headers = {\n 'x-app-name': 'checkoutuinodeweb_hermione',\n 'x-paypal-internal-euat': accessToken,\n 'paypal-client-metadata-id': getClientMetadataID(token),\n };\n\n const httpLink = new createHttpLink({\n uri: queryEndpoint,\n credentials: 'include',\n headers,\n });\n\n const batchLink = new BatchHttpLink({\n uri: queryEndpoint,\n credentials: 'include',\n headers,\n // batchMax: 10, // number of items to batch (default is 10)\n // batchInterval: 10 // ms interval at which to batch (default is 10)\n });\n\n const planningBatchLink = new BatchHttpLink({\n uri: queryEndpoint,\n credentials: 'include',\n headers,\n });\n\n // splitLink allows forking of which link to use based on some parameter. Here\n // we tell Apollo to use batch queries if `planningBatch: true` is present on\n // context. Other queries get passed to the normal batchLink\n const splitLink = split(\n ({ getContext }) => getContext().planningBatch,\n planningBatchLink,\n batchLink\n );\n\n const errorLink = onError(\n ({ operation, graphQLErrors, networkError, response = {}, forward }) => {\n const { operationName, variables, getContext } = operation;\n const { skipFallback = false } = getContext();\n let desc;\n let code;\n\n if (graphQLErrors && graphQLErrors.length) {\n const errorCodes = new Set(graphQLErrors.map(({ message }) => message));\n desc = graphQLErrors[0].statusCode === 200 ? `gqlContingency` : `gqlServiceError`;\n code = Array.from(errorCodes).join('');\n logger.cal.error(`APOLLO_${operationName}_GQLError_${code}`, {\n token,\n });\n\n // Link and pay does not require to handle any contingencies\n if (HANDLED_CONTINGENCIES.includes(code) && !getIsLinkAndPay()) {\n graphQLErrors.forEach(\n ({ contingency: isContingency, message: contingencyCode, errorData = {} } = {}) => {\n // TODO (Jay): ensure only save data once and execute contingency once\n isContingency &&\n updateContingency(\n contingencyCode,\n errorData.resolution || { data: errorData } // 3DS (2.0) contingency data structure is a little bit different than our current standard contingency\n ).then(() => {\n logger.cal.info(`HANDLE_${contingencyCode}_CONTINGENCY`);\n });\n }\n );\n }\n } else if (networkError) {\n const { statusCode } = networkError;\n // Helps to debug unhelpful mocking / mutation errors by showing how a\n // mutation was called. This should be moved somewhere else, like creating\n // a new \"test link\", or by adding more logging options for testing.\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n console.error(`Error calling ${operationName} with:`, JSON.stringify(variables, null, 2));\n }\n desc = 'gqlNetworkError';\n code = statusCode;\n logger.cal.error(`APOLLO_${operationName}_NetworkError_${statusCode}`, { token });\n } else {\n desc = 'gqlUnknownError';\n code = 'UNKNOWN';\n logger.cal.error(`APOLLO_UNKNOWN_ERROR`, { token });\n }\n\n // Log apollo related error to FPTI\n logger.fpti(\n 'APOLLO_ERROR',\n ERROR_PAYLOAD({\n desc,\n code,\n source: operationName,\n currency_code: get(response.data, 'checkoutSession.cart.amounts.total.currencyCode'),\n })\n );\n\n // 401 is expected for new user\n if (code === 401 && !getCredit().newUser) {\n if (user?.auth?.state === 'PARTIALLY_AUTHENTICATED') {\n redirectToRiskyLogin({\n extraParams: {\n lite: 1,\n fromLite: 1,\n ulClientRedirect: 'insufficientPermission',\n },\n });\n } else {\n redirectToLogin();\n }\n\n return;\n }\n\n // Ensure mutation operations to fallback to Hermes in case of encountering\n // any GraphQL and Network errors\n // On top of the above mutation operations, we also need to ensure global contingency\n // handlings do not trigger any fallbacks (See above `CONTINGENCIES` for the list of global\n // contingency currently Hermione is trying to handle)\n if (GLOBAL_CONTINGENCIES_HANDLERS[code]) {\n logger.cal.info(`APOLLO_${operationName}_CONTINGENCY_GLOBAL_HANDLER`);\n GLOBAL_CONTINGENCIES_HANDLERS[code](graphQLErrors.find((err) => err.message === code));\n return;\n } else if ((HANDLED_CONTINGENCIES.includes(code) && !getIsLinkAndPay()) || skipFallback) {\n logger.cal.info(`APOLLO_${operationName}_SKIP_HERMES_FALLBACK`);\n return;\n }\n\n // Remove when appropriate. See comment for function above\n CheckoutError({\n message: desc,\n error: {\n graphQLErrors,\n networkError,\n },\n });\n }\n );\n\n // RetryLink is only triggered for network errors. Make 4 attempts,\n // otherwise throw an error to trigger the global error handler and\n // fallback to Hermes. If no error is thrown, then the timeout is not\n // handled and UI is broken.\n const retryLink = new RetryLink({\n delay: {\n initial: 1500,\n max: 1500,\n jitter: false, // jitter needs to be set to false in order to retry as a `BATCH`\n },\n attempts: (count, { operationName, getContext }, error) => {\n const { skipRetry = false } = getContext();\n\n if (error && error.statusCode === 401) {\n logger.cal.error(`APOLLO_RETRY_401`, {\n message: error.message,\n });\n return false;\n }\n\n if (error && count < 5 && !skipRetry) {\n logger.cal.error(`APOLLO_RETRY_${operationName}`, {\n message: error.message,\n });\n return true;\n }\n\n logger.cal.error(`APOLLO_RETRY_FAILURE_${operationName}`, {\n message: error.message,\n });\n return false;\n },\n });\n\n // Order is important. Must end with a \"terminating link\", such as httpLink\n // https://www.apollographql.com/docs/link/overview.html#terminating\n const getLinks = () => {\n const apolloLinks = [instrumentationLink, errorLink, spinnerLink()];\n\n if (process.env.NODE_ENV === 'development') {\n apolloLinks.unshift(loggerLink());\n }\n\n if (!schemaLink && !mockLink && enableRetry) {\n apolloLinks.push(retryLink);\n }\n if (schemaLink) {\n apolloLinks.push(schemaLink);\n } else {\n apolloLinks.push(authLink(headers)); // Refresh access token based in global variables\n if (enableBatching) {\n const apqSplitLink = createPersistedQueryLink().concat(splitLink);\n apolloLinks.push(isAPQEligible ? apqSplitLink : splitLink);\n } else {\n const apqHttpLink = createPersistedQueryLink().concat(httpLink);\n apolloLinks.push(isAPQEligible ? apqHttpLink : httpLink);\n }\n }\n return ApolloLink.from(apolloLinks);\n };\n\n logger.cal.info(`AUTH_STATE_${auth.state}`, { token, auth });\n logger.cal.info('APOLLO_CREATE_CLIENT', {\n token,\n uri: queryEndpoint,\n batching: enableBatching,\n retry: enableRetry,\n });\n\n const apolloCache = cache || apolloInMemoryCache();\n\n const apolloClient = new ApolloClient({\n cache: apolloCache,\n link: getLinks(),\n resolvers: resolvers,\n });\n\n apolloCache.writeData({ data: defaultApolloCacheState() });\n\n setClient(apolloClient);\n return apolloClient;\n};\n\nexport default createClient;\n","import { getToken, getCredit } from '@paypalcorp/c3-shared-globals';\nimport { ElmoExperiment } from '@paypalcorp/c3-util-elmo-experiment';\nimport {\n IS_STICKY_ENABLED,\n isEnabledForCountry,\n setFeatures,\n SPINNER_TYPES,\n} from '@paypalcorp/c3-util-store';\n\nexport const initFeatures = () =>\n setFeatures([\n /**\n * NOTE:\n * `NOT_IN_USE` must ALWAYS be first.\n * All new features must be after `NOT_IN_USE`\n */\n {\n id: 'NOT_IN_USE',\n enabled: false,\n experiment: null,\n },\n {\n id: 'PAY_WITH',\n enabled: true,\n visible: true,\n data: {\n continueButtonAction: undefined,\n creditFIOption: undefined,\n forceRadioButton: false,\n preferredFundingOptionId: undefined,\n selectedFundingOptionId: undefined,\n usePayAfterDelivery: false,\n useSplitBalance: false,\n },\n },\n {\n id: 'THREE_DS_FULL_PAGE_RESOLVER', // Currently feature is only for IN due to RuPay fullPage redirect instead of iframe\n enabled: isEnabledForCountry(['IN']),\n visible: true,\n },\n {\n id: 'REWARDS_DISPLAY',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n visible: true,\n data: {\n rewardAmount: undefined,\n rewardCurrency: undefined,\n rewardSelected: undefined,\n },\n },\n {\n id: 'REWARDS_INTERSTITIAL',\n enabled: true,\n visible: false,\n },\n {\n id: 'INSTALLMENTS_DISPLAY',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n visible: true,\n },\n {\n id: 'SELECT_INSTALLMENTS_INTERSTITIAL',\n enabled: true,\n visible: false,\n },\n {\n id: 'ECONSENT',\n enabled: isEnabledForCountry(['US']),\n },\n {\n id: 'ADD_FI',\n enabled: true,\n visible: false,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n data: {\n updateCardNotification: false,\n fi: undefined,\n },\n },\n {\n id: 'ADD_CARD',\n enabled: true,\n visible: true,\n data: {\n address: undefined,\n card: undefined,\n token: getToken(),\n user: undefined,\n },\n },\n {\n id: 'ADD_BANK',\n enabled: true,\n visible: true,\n data: {},\n },\n {\n id: 'ADD_BANK_DISCLAIMER',\n enabled: true,\n visible: true,\n },\n {\n id: 'ADD_CARD_ONLY',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'ADD_BANK_OR_CARD',\n enabled: isEnabledForCountry(['DE']),\n visible: true,\n },\n {\n id: 'CREDIT_CARD_FORM',\n enabled: true,\n visible: true,\n },\n {\n id: 'ADD_FI_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'THREE_DS_CONFIRMATION', // 3DS (1.0) flow\n enabled: true,\n },\n {\n id: 'THREE_DS_TWO_CONFIRMATION', // 3DS (2.0) flow\n enabled: true,\n },\n {\n id: 'ADD_SHIPPING_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'ADD_SHIPPING',\n enabled: true,\n },\n {\n id: 'SELECT_SHIPPING',\n enabled: true,\n visible: false,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'CART',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'CART_DROPDOWN',\n enabled: true,\n },\n {\n id: 'PERSONALIZED_BANNER',\n enabled: true,\n visible: true,\n },\n {\n id: 'FI_ATTRIBUTION',\n enabled: true,\n visible: true,\n },\n {\n id: 'HEADER',\n enabled: true,\n visible: true,\n },\n {\n id: 'MERCHANT_LOGO',\n enabled: true,\n visible: true,\n },\n {\n id: 'DONATION_PAYPAL_CONFIRMED_CHARITY',\n enabled: isEnabledForCountry(['US']),\n visible: true,\n },\n {\n id: 'PAGE_ALERT',\n enabled: true,\n data: {\n display: false, // ? not sure why we have this when it already has `visible`\n message: undefined,\n type: 'info',\n },\n },\n {\n id: 'REVIEW_PAGE_ALERT',\n enabled: true,\n visible: true,\n data: {\n display: false, // ? not sure why we have this when it already has `visible`\n message: undefined,\n type: 'info',\n },\n },\n {\n id: 'SPINNER',\n enabled: true,\n visible: getCredit().isCreditSecondButton,\n data: { type: SPINNER_TYPES.DEFAULT },\n },\n {\n id: 'RETURN_TO_MERCHANT_SPINNER',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'CHECKOUT_BUTTON',\n enabled: true,\n visible: true,\n data: {\n status: 'INITIAL',\n checkoutButtonLabelOverride: undefined,\n validShippingMethod: true,\n inContingencyFlow: false,\n flow: undefined,\n },\n },\n {\n id: 'CHECKOUT_BUTTON_CONTAINER',\n enabled: true,\n visible: true,\n },\n {\n id: 'DECLINE_NOTIFICATION',\n enabled: true,\n visible: true,\n },\n {\n id: 'DECLINE_NOTIFICATION_NEW',\n enabled: true,\n visible: true,\n },\n {\n id: 'OPEN_BANKING_NOTIFICATION',\n enabled: true,\n visible: true,\n },\n {\n id: 'PTHREE_NOTIFICATION',\n enabled: true,\n visible: true,\n },\n {\n id: 'DISCLAIMER',\n enabled: true,\n visible: true,\n data: { showDescriptor: false },\n },\n {\n id: 'DISCLAIMER_AU',\n enabled: isEnabledForCountry(['AU']),\n visible: true,\n },\n {\n id: 'DISCLAIMER_CPA',\n enabled: true,\n visible: true,\n },\n {\n id: 'CIP_DISCLAIMER', // CIP: Customer Identification Program for AU\n enabled: isEnabledForCountry(['AU']),\n visible: true,\n },\n {\n id: 'APAC_DISCLAIMER', // Legal disclaimer for APAC countries\n enabled: isEnabledForCountry([\n 'BN',\n 'BT',\n 'FJ',\n 'FM',\n 'ID',\n 'JP',\n 'KH',\n 'KI',\n 'KR',\n 'LA',\n 'LK',\n 'HK',\n 'MH',\n 'MN',\n 'MV',\n 'MY',\n 'NF',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'PG',\n 'PH',\n 'PN',\n 'PW',\n 'SB',\n 'SG',\n 'TO',\n 'TV',\n 'TH',\n 'VN',\n 'VU',\n 'WS',\n ]),\n visible: true,\n },\n {\n id: 'DISCLAIMER_CPA_ABOVE_CONTINUE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'BILLING_ADDRESS_CONSENT_DISCLAIMER',\n enabled: true,\n visible: true,\n },\n {\n id: 'FOOTER',\n enabled: true,\n visible: true,\n },\n {\n id: 'CREDIT_OFFER',\n enabled: isEnabledForCountry(['US', 'GB']),\n visible: true,\n data: { creditOfferLabel: undefined },\n },\n {\n id: 'CREDIT_OFFER_AS_FI_DE',\n enabled: isEnabledForCountry(['DE']),\n visible: true,\n data: {\n continueButtonText: undefined,\n creditOfferLabel: undefined,\n presentmentType: undefined,\n },\n },\n {\n id: 'CREDIT_OFFER_AS_FI',\n enabled: isEnabledForCountry(['FR', 'MQ', 'GP', 'GF', 'RE', 'GB', 'US']), // MQ, GP, GF, and RE are the territories in FR\n visible: true,\n },\n {\n id: 'CREDIT_CROSS_CURRENCY_INFO',\n enabled: isEnabledForCountry(['FR', 'MQ', 'GP', 'GF', 'RE', 'GB', 'US', 'AU', 'DE']), // MQ, GP, GF, and RE are the territories in FR\n visible: true,\n },\n {\n id: 'REPRESENTATIVE_EXAMPLE',\n enabled: isEnabledForCountry(['DE']),\n },\n {\n id: 'REPRESENTATIVE_EXAMPLE_ICON',\n enabled: isEnabledForCountry(['DE']),\n visible: true,\n },\n {\n id: 'CREDIT_CROSS_CURRENCY_INFO_BANNER',\n enabled: isEnabledForCountry(['GB']),\n visible: true,\n },\n {\n id: 'SHIP_TO',\n enabled: true,\n visible: true,\n data: {\n isChangeShippingLinkClicked: false,\n userSelectedAddressId: undefined,\n toggle: false,\n },\n },\n {\n id: 'DONATION_SHARE_ADDRESS',\n enabled: true,\n visible: true,\n data: {\n shareAddressWithDonatee: false,\n },\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'SHOW_MORE_FUNDING_OPTIONS',\n enabled: !IS_STICKY_ENABLED,\n visible: true,\n },\n\n {\n id: 'SPLIT_BALANCE',\n enabled: true,\n visible: true,\n data: {\n selected: true,\n },\n },\n {\n id: 'SHARED_CARD_CONSENT_PAGE',\n enabled: true,\n },\n {\n id: 'SHARED_CARD_CONSENT_WAIT_PAGE',\n enabled: true,\n },\n {\n id: 'ADD_NORMALIZED_ADDRESS',\n enabled: isEnabledForCountry(['AU', 'BR']),\n data: {\n normalizedAddress: undefined,\n originalAddress: undefined,\n },\n },\n {\n id: 'CURRENCY_CONVERSION',\n enabled: true,\n },\n {\n id: 'CURRENCY_CONVERSION_OPTION',\n enabled: true,\n visible: true,\n },\n {\n id: 'CURRENCY_CONVERSION_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'AUTH_SETTLE_COMPLIANCE_CONTENT',\n enabled: true,\n visible: true, // TODO: turn to `false` to save some bundle size :)\n },\n {\n id: 'CURRENCY_CONVERSION_CONTENT_BR',\n enabled: isEnabledForCountry(['BR']),\n visible: true,\n },\n {\n id: 'CURRENCY_CONVERSION_SHEET',\n enabled: true,\n },\n {\n id: 'CVV_CONFIRMATION',\n enabled: true,\n },\n {\n id: 'DISCLAIMER_IN',\n enabled: isEnabledForCountry(['IN']),\n visible: true, // TODO: turn it `false` to save some bundle size :)\n },\n {\n id: 'CREDIT_EXAMPLE_TEXT',\n enabled: isEnabledForCountry(['GB']),\n visible: true,\n },\n {\n id: 'CREDIT_FI_LABEL',\n enabled: true,\n visible: true,\n },\n {\n id: 'PAY_AFTER_DELIVERY',\n enabled: true,\n visible: true,\n },\n {\n id: 'PAY_AFTER_DELIVERY_FI_SUBTEXT',\n enabled: true,\n visible: true,\n },\n {\n id: 'POLICY_AGREEMENT',\n enabled: isEnabledForCountry(['JP']),\n visible: true,\n },\n {\n id: 'INCENTIVES',\n enabled: true,\n visible: true,\n },\n {\n id: 'GIVE_AT_CHECKOUT',\n enabled: isEnabledForCountry(['US', 'GB', 'CA', 'AU', 'IE', 'DE', 'IT', 'FR']),\n visible: true,\n data: {\n giveAtCheckoutOpted: false,\n giveAtCheckoutNonProfitId: undefined,\n },\n },\n {\n id: 'DOLPHIN_BANNER',\n enabled: true,\n visible: true,\n },\n {\n id: 'DOLPHIN_INTERSTITIAL',\n enabled: true,\n },\n {\n id: 'SELECT_FI',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n data: { landingPage: undefined },\n },\n {\n id: 'SELECT_FI_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'SELECT_FI_ADD_FI_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'SELECT_CREDIT_CARD_TYPE',\n enabled: true,\n visible: true,\n },\n {\n id: 'SELECT_COMBO_CARD_TYPE',\n enabled: isEnabledForCountry(['BR']),\n visible: true,\n data: { treatments: [] },\n },\n {\n id: 'SUPPORTED_FUNDING_SOURCE_ICONS',\n enabled: !isEnabledForCountry(['FR', 'IT', 'ES']),\n visible: true,\n },\n {\n id: 'SUPPORTED_FUNDING_SOURCE_ICONS_BR',\n enabled: isEnabledForCountry(['BR']),\n visible: true,\n },\n {\n id: 'DATE_OF_BIRTH',\n enabled: true,\n visible: true,\n },\n {\n id: 'LINK_AND_PAY',\n enabled: true,\n visible: true,\n data: { selectedFundingOptionId: undefined },\n },\n {\n id: 'LINK_AND_PAY_INCENTIVE',\n enabled: true,\n visible: true,\n },\n {\n id: 'LINK_AND_PAY_DISCLAIMER',\n enabled: true,\n visible: true,\n },\n {\n id: 'CREDIT_APPLY_PORTABLE',\n enabled: true,\n data: {\n isCapOpen: false,\n selectedCRCOfferID: undefined,\n },\n },\n {\n id: 'CREDIT_SINGLE_FI_DISPLAY',\n enabled: true,\n data: { isGPLFi: false },\n },\n {\n id: 'CANCEL_LINK',\n enabled: true,\n visible: true,\n },\n {\n id: 'SEPA_CONFIRMATION',\n enabled: true,\n data: { bankData: undefined },\n },\n {\n id: 'FI_PAYER_DISCLAIMER',\n enabled: true,\n visible: true,\n },\n {\n id: 'OPEN_BANKING',\n enabled: true,\n visible: false,\n data: {\n blackListedFI: undefined,\n hideDeclineNotification: false,\n },\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'BACKUP_FUNDING_DISCLAIMER',\n enabled: true,\n visible: true,\n },\n {\n id: 'BACKUP_FI',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'BILLING_AGREEMENT',\n enabled: true,\n // experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.CONTROL),\n visible: true,\n },\n {\n id: 'BANK_AS_DEBIT',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n data: {\n addBankAsDebit: false,\n p3Enabled: false,\n },\n },\n {\n id: 'BANK_AS_DEBIT_DISALLOWED',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'REMOVE_RETRY_BUTTON',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_INSTALLMENTS',\n enabled: isEnabledForCountry(['US', 'GB', 'DE']),\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_INSTALLMENTS_HIDE_INCENTIVES',\n enabled: isEnabledForCountry(['US', 'GB', 'DE']),\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_SECOND_BUTTON',\n enabled: isEnabledForCountry(['US', 'GB']),\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_MULTIPRODUCT_ORDER',\n enabled: isEnabledForCountry(['US']),\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_EZP_BNPL_RYI',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'BANK_AS_DEBIT_DISALLOWED',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'ADD_FI_CHOICE_LIST',\n enabled: true,\n visible: true,\n },\n {\n id: 'SPLIT_TENDER_GATE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n data: {\n isSplitReady: false,\n userCanSplit: false,\n showSplitContinue: false,\n showSplitExperience: false,\n },\n },\n {\n id: 'PAY_WITH_SPLIT_TENDER',\n enabled: true,\n visible: true,\n },\n {\n id: 'ADD_POTENTIAL_CARD',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'OTP_CONFIRMATION',\n enabled: true,\n data: {\n isNewCard: false,\n fundingInstrumentId: null,\n phone: {\n number: null,\n countryCode: null,\n },\n },\n },\n {\n id: 'SPLIT_TENDER_BACKUP',\n enabled: true,\n visible: false,\n },\n {\n id: 'SPLIT_TENDER_PAY_WITH',\n enabled: true,\n visible: false,\n },\n {\n id: 'REDIRECT_TO_CREDIT',\n enabled: true,\n visible: true,\n data: {\n eConsentTriggerRefresh: false,\n },\n },\n {\n id: 'RETURN_FROM_CREDIT',\n enabled: true,\n visible: true,\n },\n {\n id: 'PAY_LATER',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PPC_REDIRECT',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PAYMENT_OPTIONS',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'TABBED_PAYMENT_OPTIONS',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'UPSTREAM_PRESENTMENT',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'UPSTREAM_TABS',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'PAYLATER_BUTTON_TABS',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'BNPL_STACKED_BUBBLE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'BNPL_TABBED_BUBBLE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'CAP_AUTO_OPEN',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'RESTRICTED_ACCOUNT',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'CBT_DECLINE_NOTIFICATION',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'WPS_DONE_PAGE',\n enabled: true,\n visible: false,\n },\n {\n id: 'SHIP_TAX_INTERSTITIAL',\n enabled: true,\n visible: false,\n },\n {\n id: 'REVIEW_BEFORE_LOGIN',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'TRUSTED_BENEFICIARY_OPT_IN',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'CRYPTO_TERMS',\n enabled: true,\n visible: false,\n data: {\n acknowledged: false,\n fundingInstrumentIdToSelect: '',\n },\n },\n {\n id: 'PAY_LATER_LEARN_MORE',\n enabled: true,\n visible: false,\n data: {\n offer: null,\n },\n },\n {\n id: 'INVENTORY_SOLD_OUT',\n enabled: true,\n visible: false,\n data: {\n soldOutUrl: undefined,\n },\n },\n {\n id: 'REMITTANCE_DISCLOSURE',\n enabled: isEnabledForCountry(['US']),\n visible: true,\n },\n {\n id: 'GPL_CAP_SERVER_MIGRATION',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'LINK_CARD_BY_PTHREE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n data: {\n pthreeFailureReason: undefined,\n },\n },\n {\n id: 'CURRENCY_CONVERSION_FEE_DISCLOSURE',\n enabled: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(ElmoExperiment.TREATMENTS.TREATMENT_1),\n },\n {\n id: 'LANGUAGE_TOGGLE',\n enabled: isEnabledForCountry(['US']),\n },\n {\n id: 'GOLD_PSB_MSB_TITLE',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n {\n id: 'BA_SIMPLIFIED_CONTENT',\n enabled: true,\n visible: true,\n experiment: ElmoExperiment.initWithDefaultTreatment(),\n },\n ]);\n","import Feature from '@/components/Feature';\nimport { CPA_DISCLAIMER_QUERY } from '@/components/Disclaimer/CPADisclaimer/query.gql';\nimport { getToken } from '@paypalcorp/c3-shared-globals';\n\nconst ReturnToMerchantSpinner = Feature({\n id: 'RETURN_TO_MERCHANT_SPINNER',\n queries: [\n { query: CPA_DISCLAIMER_QUERY, variables: { token: getToken() }, fetchPolicy: 'cache-only' },\n ],\n})({\n experiments: {\n TREATMENT_1: () => import('./ReturnToMerchantSpinnerControl'),\n TREATMENT_2: () => import('./ReturnToMerchantSpinnerPreAuthCard'),\n TREATMENT_3: () => import('./ReturnToMerchantSpinnerCompletePayment'),\n },\n});\n\nexport default ReturnToMerchantSpinner;\n","import React from 'react';\n// something with the exports from @/store/index causes Feature to be undefined. Guessing\n// there are multiple methods exporting the same name and jest gives really bad errors.\nimport { updateFeature } from '@paypalcorp/c3-util-store';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport AnimatedContainer from './AnimatedContainer';\nimport { lazyComponent } from '@/lib/lazyLoad';\n\nconst LazyInterstitialContainer = lazyComponent(\n () => import('@paypalcorp/c3-component-interstitial'),\n {\n id: 'INTERSTITIAL',\n loading: () => ,\n }\n);\n\n/**\n * Container which wraps every feature and decides:\n * - how feature will be rendered (animated / interstitial / inline / hidden )\n * - manages auto showing / hiding feature\n * - logs experiment data\n */\nexport class FeatureContainer extends React.Component {\n // helper to call a function when prop's boolean value is changed\n callOnPropChange = (prevProps, prop, f) => {\n const propValue = this.props[prop];\n\n if (!prevProps[prop] && propValue) {\n return f(true);\n } else if (prevProps[prop] && !propValue) {\n return f(false);\n }\n return {};\n };\n\n // check if feature needs to be disabled or enabled dynamically\n setEnablement() {\n const {\n data: {\n feature: { experiment },\n },\n id,\n isGqlDataResolved,\n } = this.props;\n\n // wait until gql data is resolved before turning off the feature to get eligibility being logged\n if (isGqlDataResolved && experiment && experiment.isControl()) {\n logger.cal.info(`FEATURE_${id}_DISABLED_DUE_ELMO_CONTROL`);\n\n return {\n enabled: false,\n };\n }\n return {};\n }\n\n // toggle \"visible\" prop of the feature\n onAutoDisplayChange = (value) => {\n const { id } = this.props;\n\n logger.cal.info(`FEATURE_${id}_AUTO_VISIBILITY_${value}`);\n\n return {\n visible: value,\n };\n };\n\n // do things based on \"shouldLoadFeature\" prop\n onShouldLoadFeatureChange = (value) => {\n const {\n data: {\n feature: { experiment, eligible },\n },\n id,\n isGqlDataResolved,\n } = this.props;\n\n // until gql data is resolved we should not touch things\n if (!isGqlDataResolved) {\n return {};\n }\n\n if (experiment) {\n experiment.logExperiment({\n logger: logger.fpti,\n featureId: id,\n eligibility: value,\n });\n }\n\n if (value !== eligible) {\n return { eligible: value };\n }\n\n return {};\n };\n\n componentDidMount() {\n const { shouldLoadFeature, autoDisplay, id } = this.props;\n const shouldLoadFeaturePayload = this.onShouldLoadFeatureChange(shouldLoadFeature);\n\n let autoDisplayPayload = {};\n\n if (autoDisplay) {\n autoDisplayPayload = this.onAutoDisplayChange(autoDisplay);\n }\n const setEnablementPayload = this.setEnablement();\n\n const payload = {\n ...autoDisplayPayload,\n ...shouldLoadFeaturePayload,\n ...setEnablementPayload,\n };\n\n if (Object.keys(payload).length !== 0) updateFeature(id, payload);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n const { shouldLoadFeature, isGqlDataResolved, id } = this.props;\n\n let shouldLoadFeaturePayload = {};\n\n const autoDisplayPayload = this.callOnPropChange(\n prevProps,\n 'autoDisplay',\n this.onAutoDisplayChange\n );\n\n if (!prevProps.isGqlDataResolved && isGqlDataResolved) {\n shouldLoadFeaturePayload = this.onShouldLoadFeatureChange(shouldLoadFeature);\n } else {\n shouldLoadFeaturePayload = this.callOnPropChange(\n prevProps,\n 'shouldLoadFeature',\n this.onShouldLoadFeatureChange\n );\n }\n const setEnablementPayload = this.setEnablement();\n\n const payload = {\n ...autoDisplayPayload,\n ...shouldLoadFeaturePayload,\n ...setEnablementPayload,\n };\n\n if (Object.keys(payload).length !== 0) {\n updateFeature(id, payload);\n }\n }\n\n renderWrappedComponent() {\n const { data, loading, FeatureComponent, shouldKeepLoadingStateOnError, hasError } = this.props;\n\n return (\n \n );\n }\n\n renderInterstitial() {\n let { id, interstitialOptions = {} } = this.props;\n\n return (\n \n {this.renderWrappedComponent(true)}\n \n );\n }\n\n renderWithAnimateHeight() {\n let {\n id,\n data: { feature },\n shouldLoadFeature = true,\n animateOptions: { animateOpacity, animateContainerClass },\n } = this.props;\n\n return (\n \n {this.renderWrappedComponent()}\n \n );\n }\n\n render() {\n let {\n data: {\n feature: { experiment, visible },\n },\n interstitial,\n animateOptions: { animateHeight },\n shouldLoadFeature = true,\n shouldLoadInstance,\n } = this.props;\n\n // render empty fragment if feature in the control experiment\n if (!shouldLoadInstance || (experiment && experiment.isControl())) {\n return ;\n }\n\n if (interstitial) {\n return shouldLoadFeature && visible && this.renderInterstitial();\n }\n\n if (animateHeight) {\n return this.renderWithAnimateHeight();\n }\n\n return shouldLoadFeature && visible && this.renderWrappedComponent();\n }\n}\n","import React, { useState, useEffect } from 'react';\nimport AnimateHeight from 'react-animate-height';\nimport { isTesting } from '@paypalcorp/c3-shared-globals';\n\nconst AnimatedContainer = ({ visible, children, ...attributes }) => {\n let [shouldRender, setRender] = useState(visible);\n\n useEffect(() => {\n if (visible) {\n setRender(visible);\n }\n }, [visible, setRender]);\n\n return (\n {\n if (!visible) {\n setRender(false);\n }\n }}\n >\n {visible || shouldRender ? children : }\n \n );\n};\n\nexport default AnimatedContainer;\n","import { logger } from '@paypalcorp/c3-util-logger';\nimport { isNewIncontext, isLegacyIncontext, isVzeroIntegration } from '@/lib/utils';\nimport { isIframe, isPopup, isWebView, params } from '@paypalcorp/c3-util-browser';\nimport { getIsUserSkipFacebookLogin } from '@/authStates';\n\n/**\n * Eligibility check for things that cannot be checked on the server-side (ie. window properties)\n * This should not be dependent on any GQL queries, so we can fallback immediately and not worry about\n * having simultaneous requests touching the checkout session.\n *\n * Checks for:\n * 1. legacy in-context integrations\n * 2. iframes\n */\nexport default function windowEligible() {\n let eligibleForHermione = false;\n let reason;\n\n const incontextUnsupportedMessenger =\n window.xprops && window.xprops.experience && window.xprops.experience.messenger;\n\n // Note that this is only part of the check for partner integration - there's some API data in xo-landing-router not being checked here that determines if this is a partner integration or not\n const isPartnerIntegration = isVzeroIntegration();\n // Handling for PPC application return flow is not handled - see https://github.paypal.com/Checkout-R/checkoutuinodeweb/issues/620\n const isCreditApplyReturnFlow = params().success && params().key;\n const isSkipFacebookLoginFlow = getIsUserSkipFacebookLogin();\n\n if (incontextUnsupportedMessenger) {\n reason = 'incontext_unsupported_fb_messenger';\n eligibleForHermione = false;\n } else if (isPartnerIntegration) {\n // Partner integration needs some extra handling - https://github.paypal.com/Checkout-R/checkoutuinodeweb/issues/525\n logger.cal.info('PARTNER_VZERO_INTEGRATION', {\n isIframe: isIframe(),\n isPopup: isPopup(),\n isNewContext: isNewIncontext(),\n isLegacyContext: isLegacyIncontext(),\n nolegacy: params().nolegacy === '1',\n ppFrameRedirect: window.name === 'PPFrameRedirect',\n windowName: window.name,\n btQueryParams: params().bt_int_type,\n });\n\n eligibleForHermione = true;\n reason = `supported_vzero_integration${\n isIframe() ? '_iframe' : isPopup() ? '_popup' : '_fullpage'\n }`;\n } else if (isSkipFacebookLoginFlow) {\n logger.cal.info('SKIP_FACEBOOK_LOGIN', {\n isNewContext: isNewIncontext(),\n isLegacyContext: isLegacyIncontext(),\n webview: isWebView(navigator && navigator.userAgent),\n userAgent: navigator && navigator.userAgent,\n });\n eligibleForHermione = true;\n reason = 'supported_skip_facebook_login';\n } else if (isCreditApplyReturnFlow) {\n reason = 'ppc_apply_flow';\n eligibleForHermione = true;\n } else {\n eligibleForHermione = true;\n reason = 'supported_features';\n }\n\n const eligibility_reason = `xolite_window_${\n eligibleForHermione ? 'eligible' : 'ineligible'\n }_${reason}`;\n logger.cal.info(`${eligibility_reason}`);\n\n return {\n windowEligibility: eligibleForHermione,\n reason,\n };\n}\n","import { hot } from 'react-hot-loader/root';\nimport React from 'react';\nimport { getIsResolveThreeDS, getIsLinkAndPay } from '@paypalcorp/c3-shared-globals';\nimport { lazyComponent } from '@/lib/lazyLoad';\n\nimport './App.global.css';\n\nconst Hermione = lazyComponent(() => import('./experiences/Hermione'), {\n id: 'HERMIONE',\n loading: () => <>,\n});\n\nconst ThreeDSFullPageApp = lazyComponent(() => import('./experiences/ThreeDSFullPage'), {\n id: 'THREE_DS_FLL_PAGE',\n loading: () => <>,\n});\n\nconst LinkPayApp = lazyComponent(() => import('./experiences/LinkPay'), {\n id: 'LINK_PAY_APP',\n loading: () => <>,\n});\n\nconst ResolveApp = () => {\n if (getIsResolveThreeDS()) {\n return ;\n } else if (getIsLinkAndPay()) {\n return ;\n }\n return ;\n};\n\nexport default hot(ResolveApp);\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"loading\":\"Loading_loading_1bzOW\"};","import React from 'react';\n\n/**\n * in prod don't use React's ErrorBoundary, here is why:\n *\n * 1. Stack traces are not optimal, there is no file provided where the error occured\n * which means we can't use source maps to parse stack traces in CAL\n * 2. Error boundaries do not catch all errors (e.g errors in event handlers, in asynchronous code)\n * 3. Since we have already window.onerror functionality (in index.html) to catch any unhandled errors - Errorboundary becomes a second\n * place where some errors can be caught, but not all errors. Basically it becomes confusing when we have 2 places to catch unhandled errors and\n * 2 places where we do fallbacks for such errors.\n * 4. Error boundaries are good to catch errors anywhere in child component tree, log those errors, and display a fallback UI, which we don't so\n * simply because we need to fallback.\n * 5. ErrorBoundaries in prod works differently vs in dev. In prod window.onerror will be skipped, in dev it won't be skipped.\n *\n */\nlet ErrorBoundary = (props) => {\n return props.children;\n};\n\nif (process.env.NODE_ENV === 'development') {\n const { DevErrorBoundary } = require('./DevErrorBoundary');\n\n ErrorBoundary = (props) => {\n return ;\n };\n}\n\nexport default ErrorBoundary;\n","import ErrorBoundary from './ErrorBoundary';\nexport default ErrorBoundary;\n","// PUBLIC_URL is defined in Webpack scope, uses `getPublicUrl` for build contexts\n// eslint-disable-next-line no-undef\n__webpack_public_path__ = window.__webpack_public_path__ || process.env.PUBLIC_URL;\n/* eslint-disable import/first */\nimport 'regenerator-runtime';\n// Using inidividual polyfills as required results in a much smaller bundle\nimport 'whatwg-fetch';\nimport 'core-js/features/promise';\n\n// needed for Apollo Client\nimport 'core-js/features/map';\nimport 'core-js/features/set';\nimport 'core-js/features/weak-map';\n\n// Array polyfills\nimport 'core-js/features/array/find';\nimport 'core-js/features/array/some';\nimport 'core-js/features/array/includes';\n\n// symbol is needed for addCard FR\nimport 'core-js/es/symbol';\n\n// needed for IE 10 and older browsers\nimport 'core-js/features/array/from';\n\n// Object polyfills\nimport 'core-js/features/object/assign';\nimport 'core-js/features/object/values';\nimport 'core-js/features/object/entries';\n\n// String polyfills\nimport 'core-js/features/string/includes';\n/* eslint-enable */\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill\nif (!Element.prototype.matches) {\n Element.prototype.matches =\n Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n}\n\nif (!Element.prototype.closest) {\n Element.prototype.closest = function (s) {\n var el = this;\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n}\n\n// Since IE10 doesn't support neither \"Object.setPrototypeOf\" nor \"__proto__\"\n// we need to monkey patch tslib which is used in Apollo client for extending zen-observable\n// by copying static class methods which are getting missed\nif (!(Object.setPrototypeOf || {}.__proto__)) {\n var tslib = require('tslib');\n var hoistNonReactStatics = require('hoist-non-react-statics');\n var __extends = tslib.__extends;\n tslib.__extends = function (target, source) {\n // Invoke the original method\n __extends.apply(this, [target, source]);\n hoistNonReactStatics(target, source);\n };\n}\n\n// Number.isNaN polyfill (not supported in all IE)\nNumber.isNaN =\n Number.isNaN ||\n function (value) {\n return value !== value;\n };\n","import './preInit';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ApolloProvider } from '@apollo/react-components';\nimport { init as initContent } from 'pp-react-l10n';\nimport ErrorBoundary from '@/components/ErrorBoundary';\nimport { LOG_TRANSITIONS, logger } from '@paypalcorp/c3-util-logger';\nimport { params } from '@paypalcorp/c3-util-browser';\nimport { getGlobals, getIsMockedMode, initGlobals } from '@paypalcorp/c3-shared-globals';\nimport { isIncontext } from '@/lib/utils';\nimport CheckoutError from '@/lib/checkoutError';\nimport windowEligible from '@/lib/windowEligibility';\nimport configureApolloClient from '@/lib/configureApolloClient';\nimport { getClientMetadataID, initFraudNet } from '@/lib/fraudNet';\nimport { AppIndex } from './AppIndex';\n\n__webpack_nonce__ = getGlobals().nonce; // eslint-disable-line\n\nconst MockedMode = React.lazy(() => import('./MockedMode'));\n\nlogger.cal.transition(LOG_TRANSITIONS.INIT);\n\nconst initialData = initGlobals();\nconst { user = {}, uri, content, deployEnv = {} } = initialData;\n// eslint-disable-next-line i18n-scan/no-country-dependency\nconst integrationType = user.ecToken && /^EC-[\\w]+/.test(user.ecToken) ? 'EC' : 'WPS';\n\nif (params().euat === '1') {\n user.auth.access_token = window.location.hash.substr(1);\n}\n\ninitContent({ content });\n\nif (!user.ecToken) {\n CheckoutError({ message: 'ec_token_is_missing' });\n}\n\n// get common FPTI keys\nconst commonKeys = {};\n\n// Initialize CAL and FPTI Logger\nlogger.init(\n {\n token: user.ecToken,\n loggerEndpoint: uri.loggerEndpoint,\n incontext: isIncontext(),\n externalName: 'checkoutuinodeweb',\n internalName: 'HERMIONE',\n experienceName: 'checkoutlite',\n context_type: `${integrationType}-token`,\n common: commonKeys,\n },\n {},\n {\n common: {\n integration_type: integrationType,\n context_type: `${integrationType}-token`,\n 'x-paypal-fpti': {\n context_type: `${integrationType}-token`,\n },\n },\n }\n);\n\n// initialize apollo client\nconst client = configureApolloClient({\n queryEndpoint: uri.queryEndpoint,\n token: user.ecToken,\n auth: user.auth || {},\n enableRetry: true,\n});\n\ninitFraudNet({\n token: getClientMetadataID(user.ecToken),\n fraudNetEndpoint: uri.fraudNetEndpoint,\n deployEnv,\n});\nconst MockedModeLoader = () =>
Loading Use cases viewer...
;\n\nconst render = (Application) => {\n ReactDOM.render(\n \n \n {!getIsMockedMode() ? (\n \n ) : (\n }>\n \n \n )}\n \n ,\n document.getElementById('root')\n );\n};\n\nfunction startApp() {\n const { windowEligibility, reason = 'unknown' } = windowEligible();\n if (!windowEligibility) {\n CheckoutError({ message: `window_ineligible_${reason}` });\n // Don't render the app, as it can potentially cause problems if we start setting up the checkout session here and on Hermes\n return;\n }\n\n if (process.env.NODE_ENV === 'development') {\n // initialize react-axe a11y auditing\n // https://github.com/dequelabs/react-axe\n // it slows UI drastically\n if (params().enableAllyChecks) {\n const axe = require('react-axe');\n setTimeout(() => axe(React, ReactDOM, 1000), 10000);\n }\n }\n\n render(AppIndex);\n}\n\nstartApp();\n","import { settings } from 'emeth';\nsettings.debug = false;\nsettings.warn = () => {};\n","// extracted by extract-css-chunks-webpack-plugin\nmodule.exports = {\"font-family\":\"'PayPalSansBig-Regular', Helvetica Neue, HelveticaNeue, helvetica, arial, sans-serif\",\"fontFamily\":\"'PayPalSansBig-Regular', Helvetica Neue, HelveticaNeue, helvetica, arial, sans-serif\",\"ppui-coachtip-background-color\":\"#2c2e2f\",\"ppuiCoachtipBackgroundColor\":\"#2c2e2f\",\"ppui-coachtip-text-color\":\"#fff\",\"ppuiCoachtipTextColor\":\"#fff\",\"ppui-color-blue-300\":\"#bfdbee\",\"ppuiColorBlue300\":\"#bfdbee\",\"ppui-font-family-500\":\"'PayPalSansBig-Medium'\",\"ppuiFontFamily500\":\"'PayPalSansBig-Medium'\",\"ppui-color-blue-600\":\"#0070ba\",\"ppuiColorBlue600\":\"#0070ba\",\"ppui-color-blue-800\":\"#003087\",\"ppuiColorBlue800\":\"#003087\",\"ppui-font-size-md\":\"0.9375rem\",\"ppuiFontSizeMd\":\"0.9375rem\",\"ppui-font-size-xl-2\":\"1.5rem\",\"ppuiFontSizeXl2\":\"1.5rem\",\"ppui-font-weight-light\":\"300\",\"ppuiFontWeightLight\":\"300\",\"ppui-font-weight-normal\":\"500\",\"ppuiFontWeightNormal\":\"500\",\"ppui-line-height-sm\":\"1.125rem\",\"ppuiLineHeightSm\":\"1.125rem\",\"ppui-spacing-lg\":\"0.75rem\",\"ppuiSpacingLg\":\"0.75rem\",\"ppui-font-weight-bold\":\"700\",\"ppuiFontWeightBold\":\"700\"};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport SpinnerOverlay from '@/shared/components/SpinnerOverlay';\nimport getContent from '@/lib/content';\n\nexport default function DefaultSpinner({ contentKey } = {}) {\n return {getContent(contentKey)};\n}\n\nDefaultSpinner.propTypes = {\n contentKey: PropTypes.string.isRequired,\n};\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useFeature } from '@/components/Feature/hooks';\nimport { SPINNER_TYPES } from './constants';\nimport DefaultSpinner from './DefaultSpinner';\nimport ReturnToMerchantSpinner from './ReturnToMerchantSpinner';\n\nconst SpinnerPortal = (props) => {\n return
{createPortal(props.children, document.body)}
;\n};\n\nconst SpinnerComponent = ({ spinnerType = SPINNER_TYPES.DEFAULT, selectedFI }) => {\n switch (spinnerType) {\n case SPINNER_TYPES.THREE_DS_PROCESSING: {\n return ;\n }\n case SPINNER_TYPES.RETURN_TO_MERCHANT: {\n return ;\n }\n case SPINNER_TYPES.PROCESS_CARD: {\n return ;\n }\n case SPINNER_TYPES.PROCESS_INCENTIVE: {\n return ;\n }\n case SPINNER_TYPES.CRYPTO_SELLING: {\n return ;\n }\n default:\n return ;\n }\n};\n\nexport default ({ selectedFI }) => {\n const { enabled, visible, data } = useFeature('SPINNER');\n\n if (!enabled || !visible) {\n return null;\n }\n\n return (\n \n \n \n );\n};\n\nexport { SPINNER_TYPES };\n","import i18n from 'pp-react-l10n';\n\nimport { getCountry, getLocale } from '@paypalcorp/c3-shared-globals';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\nconst IGNORE_MISSING_CONTENT_KEYS = [/^fsMappings.+$/];\n\nconst shouldIgnoreLoggingMissingContentKeys = (key) =>\n IGNORE_MISSING_CONTENT_KEYS.find((ignoreKey) => ignoreKey.test(key));\n\n/**\n * Wrapper with ability to check for undefined content\n */\nexport default (...args) => {\n const key = args[0];\n const result = i18n.apply(this, args);\n\n if (String(result) === `{${key}}`) {\n if (!shouldIgnoreLoggingMissingContentKeys(key)) {\n logger.cal.info(`CONTENT_MISSING_${key.replace(/ /g, '_')}_${getCountry()}_${getLocale()}`);\n }\n\n return null;\n }\n\n return result;\n};\n","import React, { lazy, Suspense, useEffect } from 'react';\nimport { logger } from '@paypalcorp/c3-util-logger';\n\n/**\n * resolve dynamic chunk with an ability to retry if failed\n */\nexport const lazyLoadChunkWithRetry = ({ fn, retriesLeft = 5, interval = 1500, id }) => {\n return new Promise((resolve, reject) => {\n window.logCPLPhase(id, 'chunk', true);\n fn()\n .then((result) => {\n logger.cal.info(`CHUNK_${id}_LOADED`);\n window.logCPLPhase(id, 'chunk');\n if (result == null) {\n console.warn(`could not load %s`, id);\n }\n resolve(result);\n })\n .catch((error) => {\n setTimeout(() => {\n if (retriesLeft === 1) {\n // reject('maximum retries exceeded');\n reject(error);\n return;\n }\n logger.cal.info(`CHUNK_${id}_RETRY`);\n // Passing on \"reject\" is the important part\n lazyLoadChunkWithRetry({ fn, retriesLeft: retriesLeft - 1, interval, id }).then(\n resolve,\n reject\n );\n }, interval);\n });\n }).catch(() => {\n logger.cal.error(`CHUNK_${id}_FAILED`);\n window.location.reload();\n\n // TODO: discuss this approach to show an alert and reload the page\n // if (window.confirm(getContent('offline.message') || 'You are offline. Press OK to reload')) {\n // window.location.reload();\n // }\n });\n};\n\n/**\n * dynamically lazy load component using React.lazy && React.Suspense\n * with an ability to preload the chunk\n */\nexport const lazyComponent = (\n dynamicImport,\n { id, loading: LoaderComponent, error: ErrorComponent }\n) => {\n const LazyComponent = lazy(() => lazyLoadChunkWithRetry({ fn: dynamicImport, id }));\n const ComponentWithSuspense = React.forwardRef((props, ref) => {\n useEffect(() => {\n dynamicImport().then().catch();\n }, []);\n\n if (props.isLoading) {\n return LoaderComponent ? : null;\n }\n\n if (props.error) {\n return ErrorComponent ? : null;\n }\n\n return (\n : null}>\n \n \n );\n });\n return ComponentWithSuspense;\n};\n","import { logger } from '@paypalcorp/c3-util-logger';\nimport { getCountry, getGlobals, getToken } from '@paypalcorp/c3-shared-globals';\nimport { updateFeature, isParamEnabled } from '@paypalcorp/c3-util-store';\nimport { buildURL, redirect } from '@/lib/redirects';\nimport { isIncontext, params, setDestination } from '@/lib/utils';\nimport { isPopup } from '@paypalcorp/c3-util-browser';\nimport { strToBool } from '@paypalcorp/c3-util-lang';\nimport { creditPpcOffersGqlParams } from '@/lib/credit';\n\nexport function isCrossCurrencyTransaction(creditOffer) {\n return !!(\n creditOffer?.content?.OfferCategory === 'ACQ' &&\n strToBool(creditOffer?.content?.CrossCurrencyTransaction)\n );\n}\n\nexport function getCreditIncentiveDetails(creditOffer) {\n return creditOffer?.content\n ? {\n offerProgramId: creditOffer.content['Incentive-OfferProgramId'],\n offerValue: creditOffer.content['Incentive-OfferValue'],\n offerCurrencyCode: creditOffer.content['Incentive-OfferCurrencyCode'],\n offerProgramCode: creditOffer.content['Incentive-OfferProgramCode'],\n touchpoint: creditOffer.touchpoint,\n headlineText: creditOffer.content.HeadlineText,\n offerText1: creditOffer.content.OfferText1,\n offerText2: creditOffer.content.OfferText2,\n termsLink: creditOffer.content.TermsLink,\n termsLinkText: creditOffer.content.TermsLinkText,\n termsText: creditOffer.content.TermsText,\n buyItemId: creditOffer.referenceId,\n }\n : {};\n}\n\n/**\n * Page context value\n * @returns {String} url\n */\nexport function getPageContext() {\n const pageContext = isIncontext() ? 'In-context' : 'Full-context';\n return isPopup() ? 'Mb-context' : pageContext;\n}\n\nexport const returnFromCreditPayInFull = () => {\n return isParamEnabled('success', ['false']) && !isParamEnabled('isInternalServiceError');\n};\n\n/*\n * Redirect the user to Cape (creditapplyweb)\n */\nexport function redirectToCape(mayflyKey) {\n const capeUrl = buildURL(`${getGlobals().uri.capeEndpoint}${getCountry().toLowerCase()}`, {\n key: mayflyKey,\n });\n\n logger.cal.info('REDIRECT_TO_CAPE', {\n url: capeUrl,\n });\n\n setDestination('RETURN_FROM_CREDIT');\n redirect(capeUrl);\n}\n\nexport const getCapeReturnMutationVariables = ({\n financial_instrument_id,\n financial_instrument_details,\n}) => {\n const {\n financing_code,\n apr,\n term,\n credit_type,\n paypal_subsidy,\n monthly_percentage_rate,\n total_cost,\n total_interest,\n monthly_payment,\n currency,\n } = financial_instrument_details || {};\n\n return {\n token: getToken(),\n financialInstrumentId: financial_instrument_id,\n ...(financial_instrument_details && {\n financialInstrumentDetails: {\n financingCode: financing_code,\n apr,\n term,\n creditType: credit_type,\n paypalSubsidy: paypal_subsidy,\n monthlyPercentageRate: monthly_percentage_rate,\n totalCost: total_cost,\n totalInterest: total_interest,\n monthlyPayment: monthly_payment,\n currency,\n },\n }),\n ...creditPpcOffersGqlParams(),\n };\n};\n\nexport const handleShipTo = (mayflyData) => {\n let shouldUpdateShipTo = false;\n const data = {};\n const userSelectedAddressId = mayflyData?.user_selected_address_id;\n const userSelectedPreferredShippingAddressId =\n mayflyData?.user_selected_preferred_shipping_address_id;\n if (typeof userSelectedAddressId === 'string' && userSelectedAddressId.length > 0) {\n data.userSelectedAddressId = userSelectedAddressId;\n shouldUpdateShipTo = true;\n }\n if (\n typeof userSelectedPreferredShippingAddressId === 'string' &&\n userSelectedPreferredShippingAddressId.length > 0\n ) {\n data.userSelectedPreferredShippingAddressId = userSelectedPreferredShippingAddressId;\n data.toggle = true;\n shouldUpdateShipTo = true;\n }\n if (shouldUpdateShipTo) {\n // see also: onChangeShipping in ShippingOptions\n return updateFeature('SHIP_TO', {\n visible: true,\n data,\n });\n }\n\n return Promise.resolve();\n};\n","import { useQuery } from '@apollo/react-hooks';\nimport { logger } from '@paypalcorp/c3-util-logger';\nimport { getSingleFeatureQuery, getContingenciesQuery } from '@paypalcorp/c3-util-store';\nimport { getOperationName } from '@paypalcorp/c3-util-graphql';\n\n/**\n * Execute feature queries\n * TODO: don't ignore rules of hooks\n * @param {Array} queries queries to execute\n * @param {Boolean} skip if the query should be skipped entirely\n * @returns array of feature data\n */\nexport function useGqlNetworkQuery({ queries, skip = false }) {\n return queries.reduce((map, { query, variables, fetchPolicy, context } = {}, idx) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n map[`${getOperationName(query)}_${idx}`] = useQuery(query, {\n variables,\n fetchPolicy,\n context,\n errorPolicy: 'ignore',\n skip,\n });\n\n return map;\n }, {});\n}\n\n/**\n * Query features from local state\n * TODO: don't ignore rules of hooks\n * @param {Array} features feature IDs\n * @returns array of local feature state\n */\nexport function useFeatureQuery(features) {\n return features.reduce((map, featureId) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n map[`${featureId}`] = useQuery(getSingleFeatureQuery, { variables: { id: featureId } });\n\n return map;\n }, {});\n}\n\nexport function useContingencyQuery(id) {\n const { data = {}, error } = useQuery(getContingenciesQuery, { variables: { id } });\n\n if (error) {\n logger.cal.error('ERROR_EXECUTING_CONTINGENCY_QUERY', { error, query: getContingenciesQuery });\n }\n\n return data;\n}\n\n/**\n * Query for a contingency\n * @param {String} id Contingency ID\n */\nexport function useContingency(id) {\n const { contingencies = [] } = useContingencyQuery(id) || {};\n return contingencies.find((contingency) => contingency.id === id) ?? null;\n}\n\n/**\n * Hook to query for a Feature, which includes\n * - it's ID\n * - if it's enabled\n * - if it's visible\n * - its data\n * - and more!! 😮\n * Initial feature config is defined in `/src/store/features.js`\n * @param {String} id Feature ID\n */\nexport function useFeature(id) {\n const { data: { feature = {} } = {} } = useQuery(getSingleFeatureQuery, {\n variables: { id },\n });\n\n return (\n feature || {\n enabled: false,\n visible: false,\n data: {},\n }\n );\n}\n"],"sourceRoot":""}