@adyen/adyen-web 6.31.0 → 6.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +265 -224
- package/dist/es/components/ANCV/ANCV.js.map +1 -1
- package/dist/es/components/ANCV/components/ANCVInput.js.map +1 -1
- package/dist/es/components/Ach/Ach.js.map +1 -1
- package/dist/es/components/Ach/components/AccountTypeSelector.js.map +1 -1
- package/dist/es/components/Ach/components/AchComponent.js.map +1 -1
- package/dist/es/components/Address/Address.js.map +1 -1
- package/dist/es/components/Affirm/Affirm.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es/components/AfterPay/AfterPayB2B.js.map +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es/components/AmazonPay/components/ChangePaymentDetailsButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es/components/ApplePay/utils/payment-request.js +1 -1
- package/dist/es/components/Atome/Atome.js.map +1 -1
- package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
- package/dist/es/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es/components/Blik/Blik.js.map +1 -1
- package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
- package/dist/es/components/Boleto/Boleto.js.map +1 -1
- package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
- package/dist/es/components/Card/Bancontact.js.map +1 -1
- package/dist/es/components/Card/Card.js +1 -1
- package/dist/es/components/Card/Card.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardHolderName.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/DataSfSpan.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/handlers.js +1 -1
- package/dist/es/components/Card/components/CardInput/handlers.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es/components/Card/components/ClickToPayHolder.js.map +1 -1
- package/dist/es/components/Card/components/ClickToPayWrapper.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/InfoModal.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/USOnlyPhoneInput.js.map +1 -1
- package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es/components/ClickToPay/ClickToPay.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es/components/Doku/Doku.js.map +1 -1
- package/dist/es/components/Doku/components/DokuVoucherResult/DokuVoucherResult.js.map +1 -1
- package/dist/es/components/Donation/Donation.js.map +1 -1
- package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
- package/dist/es/components/Donation/components/CampaignInfo.js.map +1 -1
- package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es/components/Donation/components/Roundup.js.map +1 -1
- package/dist/es/components/Dotpay/index.js.map +1 -1
- package/dist/es/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es/components/Dropin/Dropin.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinSuccessState.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodBrands/PaymentMethodBrands.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodDetails.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es/components/DuitNow/DuitNow.js.map +1 -1
- package/dist/es/components/EPS/index.js.map +1 -1
- package/dist/es/components/Econtext/Econtext.js.map +1 -1
- package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es/components/FacilyPay/FacilyPay6x.js.map +1 -1
- package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardFields.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es/components/Giftcard/components/useSRPanelForGiftcardErrors.js +1 -1
- package/dist/es/components/Giftcard/components/useSRPanelForGiftcardErrors.js.map +1 -1
- package/dist/es/components/Giropay/Giropay.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es/components/GooglePay/requests.js +1 -1
- package/dist/es/components/GooglePay/requests.js.map +1 -1
- package/dist/es/components/GooglePay/utils.js +1 -1
- package/dist/es/components/GooglePay/utils.js.map +1 -1
- package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
- package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
- package/dist/es/components/MBWay/MBWay.js.map +1 -1
- package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingMY.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingTH.js.map +1 -1
- package/dist/es/components/MolPayEBanking/MolPayEBankingVN.js.map +1 -1
- package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es/components/Multibanco/components/MultibancoVoucherResult/MultibancoVoucherResult.js.map +1 -1
- package/dist/es/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es/components/OnlineBankingFI/OnlineBankingFI.js.map +1 -1
- package/dist/es/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
- package/dist/es/components/PayByBank/PayByBank.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es/components/PayMe/PayMe.js.map +1 -1
- package/dist/es/components/PayNow/PayNow.js.map +1 -1
- package/dist/es/components/PayPal/Paypal.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es/components/PayPalFastlane/components/FaslaneCardBrandIcon.js.map +1 -1
- package/dist/es/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
- package/dist/es/components/PayTo/PayTo.js.map +1 -1
- package/dist/es/components/PayTo/components/BSBInput.js.map +1 -1
- package/dist/es/components/PayTo/components/IdentifierSelector.js.map +1 -1
- package/dist/es/components/PayTo/components/MandateSummary.js.map +1 -1
- package/dist/es/components/PayTo/components/PayIDInput.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -1
- package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -1
- package/dist/es/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es/components/Pix/Pix.js.map +1 -1
- package/dist/es/components/Pix/components/PixInput/PixInput.js.map +1 -1
- package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
- package/dist/es/components/PromptPay/PromptPay.js.map +1 -1
- package/dist/es/components/RatePay/RatePay.js.map +1 -1
- package/dist/es/components/RatePay/RatePayDirectDebit.js.map +1 -1
- package/dist/es/components/Redirect/Redirect.js.map +1 -1
- package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
- package/dist/es/components/Riverty/Riverty.js.map +1 -1
- package/dist/es/components/Sepa/Sepa.js.map +1 -1
- package/dist/es/components/Swish/Swish.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es/components/Trustly/Trustly.js.map +1 -1
- package/dist/es/components/Twint/Twint.js.map +1 -1
- package/dist/es/components/UPI/UPI.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
- package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es/components/UPI/components/UPIMandate/UPIMandate.js.map +1 -1
- package/dist/es/components/Vipps/Vipps.js.map +1 -1
- package/dist/es/components/WalletIN/index.js.map +1 -1
- package/dist/es/components/WeChat/WeChat.js.map +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
- package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
- package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es/components/internal/Await/Await.js.map +1 -1
- package/dist/es/components/internal/Await/components/AwaitFinalState.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/Brand/Brand.js.map +1 -1
- package/dist/es/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
- package/dist/es/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
- package/dist/es/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es/components/internal/Countdown/index.js.map +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputEmail.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputText.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es/components/internal/Img/Img.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
- package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es/components/internal/Link/Link.js.map +1 -1
- package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es/components/internal/PayButton/PayButton.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRCountdown.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRFinalState.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRImage.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRIntructions.js.map +1 -1
- package/dist/es/components/internal/QRLoader/components/QRProgressbar.js.map +1 -1
- package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SFPUtils.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/createIframe.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/createIframe.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/utils.js +1 -1
- package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -1
- package/dist/es/components/internal/Spinner/Spinner.js.map +1 -1
- package/dist/es/components/internal/StoreDetails/StoreDetails.js.map +1 -1
- package/dist/es/components/internal/Timeline/Timeline.js.map +1 -1
- package/dist/es/components/internal/Timeline/TimelineWrapper.js.map +1 -1
- package/dist/es/components/internal/Toggle/Toggle.js.map +1 -1
- package/dist/es/components/internal/Tooltip/SingletonTooltipProvider.js.map +1 -1
- package/dist/es/components/internal/Tooltip/Tooltip.js.map +1 -1
- package/dist/es/components/internal/Tooltip/TooltipController.js.map +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/core/Analytics/Analytics.js +1 -1
- package/dist/es/core/Analytics/Analytics.js.map +1 -1
- package/dist/es/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es/core/Context/AmountProvider.js.map +1 -1
- package/dist/es/core/Context/CoreProvider.js.map +1 -1
- package/dist/es/core/Environment/Environment.js +1 -1
- package/dist/es/core/Environment/Environment.js.map +1 -1
- package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es/core/Errors/SRMessages.js.map +1 -1
- package/dist/es/core/Errors/SRPanel.js.map +1 -1
- package/dist/es/core/Errors/SRPanelProvider.js.map +1 -1
- package/dist/es/core/Errors/utils.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
- package/dist/es/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js.map +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/external/preact/compat/dist/compat.js +1 -1
- package/dist/es/external/preact/compat/dist/compat.js.map +1 -1
- package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es/index.d.ts +265 -224
- package/dist/es/index.js +1 -1
- package/dist/es/utils/getOrigin.js +1 -1
- package/dist/es/utils/setFocus.js +1 -1
- package/dist/es/utils/setFocus.js.map +1 -1
- package/dist/es/utils/windowScrollTo.js +2 -0
- package/dist/es/utils/windowScrollTo.js.map +1 -0
- package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
- package/dist/es-legacy/components/ANCV/components/ANCVInput.js.map +1 -1
- package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AccountTypeSelector.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AchComponent.js.map +1 -1
- package/dist/es-legacy/components/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/ChangePaymentDetailsButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/utils/payment-request.js +1 -1
- package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
- package/dist/es-legacy/components/BcmcMobile/BcmcMobile.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
- package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
- package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
- package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
- package/dist/es-legacy/components/Card/Card.js +1 -1
- package/dist/es-legacy/components/Card/Card.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardHolderName.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/DataSfSpan.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/handlers.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/handlers.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es-legacy/components/Card/components/ClickToPayHolder.js.map +1 -1
- package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/InfoModal.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/USOnlyPhoneInput.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
- package/dist/es-legacy/components/Doku/components/DokuVoucherResult/DokuVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/CampaignInfo.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -1
- package/dist/es-legacy/components/Dotpay/index.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinSuccessState.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/OrderPaymentMethods.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodBrands/PaymentMethodBrands.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodDetails.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es-legacy/components/DuitNow/DuitNow.js.map +1 -1
- package/dist/es-legacy/components/EPS/index.js.map +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
- package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/useSRPanelForGiftcardErrors.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/useSRPanelForGiftcardErrors.js.map +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/requests.js +1 -1
- package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/utils.js +1 -1
- package/dist/es-legacy/components/GooglePay/utils.js.map +1 -1
- package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingMY.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingTH.js.map +1 -1
- package/dist/es-legacy/components/MolPayEBanking/MolPayEBankingVN.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/components/MultibancoVoucherResult/MultibancoVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingFI/OnlineBankingFI.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -1
- package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es-legacy/components/PayMe/PayMe.js.map +1 -1
- package/dist/es-legacy/components/PayNow/PayNow.js.map +1 -1
- package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/components/FaslaneCardBrandIcon.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
- package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/MandateSummary.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayIDInput.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -1
- package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
- package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js.map +1 -1
- package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
- package/dist/es-legacy/components/PromptPay/PromptPay.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
- package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
- package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
- package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
- package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
- package/dist/es-legacy/components/Swish/Swish.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
- package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
- package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/UPIMandate/UPIMandate.js.map +1 -1
- package/dist/es-legacy/components/Vipps/Vipps.js.map +1 -1
- package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
- package/dist/es-legacy/components/WeChat/WeChat.js.map +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es-legacy/components/internal/Alert/Alert.js.map +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
- package/dist/es-legacy/components/internal/Await/components/AwaitFinalState.js.map +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es-legacy/components/internal/Brand/Brand.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyButton.js.map +1 -1
- package/dist/es-legacy/components/internal/Button/CopyIconButton.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/ClickToPayComponent.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
- package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
- package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es-legacy/components/internal/Icon/Icon.js.map +1 -1
- package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es-legacy/components/internal/Link/Link.js.map +1 -1
- package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
- package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRCountdown.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRFinalState.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRImage.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRIntructions.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/components/QRProgressbar.js.map +1 -1
- package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SFPUtils.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/createIframe.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/createIframe.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -1
- package/dist/es-legacy/components/internal/Spinner/Spinner.js.map +1 -1
- package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/Timeline/Timeline.js.map +1 -1
- package/dist/es-legacy/components/internal/Timeline/TimelineWrapper.js.map +1 -1
- package/dist/es-legacy/components/internal/Toggle/Toggle.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/SingletonTooltipProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/Tooltip.js.map +1 -1
- package/dist/es-legacy/components/internal/Tooltip/TooltipController.js.map +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsErrorEvent.js +1 -1
- package/dist/es-legacy/core/Analytics/events/AnalyticsErrorEvent.js.map +1 -1
- package/dist/es-legacy/core/Context/AmountProvider.js.map +1 -1
- package/dist/es-legacy/core/Context/CoreProvider.js.map +1 -1
- package/dist/es-legacy/core/Environment/Environment.js +1 -1
- package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
- package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRMessages.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
- package/dist/es-legacy/core/Errors/SRPanelProvider.js.map +1 -1
- package/dist/es-legacy/core/Errors/utils.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
- package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/core/core.js +1 -1
- package/dist/es-legacy/core/core.js.map +1 -1
- package/dist/es-legacy/external/preact/compat/dist/compat.js +1 -1
- package/dist/es-legacy/external/preact/compat/dist/compat.js.map +1 -1
- package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es-legacy/index.js +1 -1
- package/dist/es-legacy/utils/getOrigin.js +1 -1
- package/dist/es-legacy/utils/setFocus.js +1 -1
- package/dist/es-legacy/utils/setFocus.js.map +1 -1
- package/dist/es-legacy/utils/windowScrollTo.js +2 -0
- package/dist/es-legacy/utils/windowScrollTo.js.map +1 -0
- package/package.json +18 -19
- package/dist/es/utils/getProp.js +0 -2
- package/dist/es/utils/getProp.js.map +0 -1
- package/dist/es-legacy/utils/getProp.js +0 -2
- package/dist/es-legacy/utils/getProp.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuredFieldsProvider.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProvider.ts"],"sourcesContent":["import { Component } from 'preact';\nimport { getErrorObject, getFields, getErrorReducer, validFieldsReducer } from './SFPUtils';\nimport initCSF from '../lib/CSF';\nimport handlers from './SecuredFieldsProviderHandlers';\nimport defaultProps from './defaultProps';\nimport { SFPProps, SFPState, SingleBrandResetObject } from './types';\nimport {\n StylesObject,\n CardErrorData,\n CardFocusData,\n CardBrandData,\n CardAllValidData,\n CardFieldValidData,\n CardAutoCompleteData,\n CardConfigSuccessData,\n CardLoadData,\n SFKeyPressObj\n} from '../lib/types';\nimport { CSFReturnObject, CSFSetupObject } from '../lib/CSF/types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, DEDICATED_CARD_COMPONENTS, ENCRYPTED_CARD_NUMBER, ENCRYPTED_PWD_FIELD } from '../lib/constants';\nimport { BinLookupResponse } from '../../../Card/types';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\nimport { SFStateErrorObj } from '../../../Card/components/CardInput/types';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { TxVariants } from '../../../tx-variants';\n\n/**\n * SecuredFieldsProvider:\n * Initialises & handles the client-side part of SecuredFields\n */\nclass SecuredFieldsProvider extends Component<SFPProps, SFPState> {\n private csfLoadFailTimeout: number;\n private csfLoadFailTimeoutMS: number;\n private csfConfigFailTimeout: number;\n private csfConfigFailTimeoutMS: number;\n private numCharsInField: object;\n private rootNode;\n private numDateFields: number;\n private csf: CSFReturnObject;\n private handleOnLoad: (obj: CardLoadData) => void;\n private handleOnConfigSuccess: (obj: CardConfigSuccessData) => void;\n private handleOnFieldValid: (obj: CardFieldValidData) => void;\n private handleOnAllValid: (obj: CardAllValidData) => void;\n private handleOnBrand: (obj: CardBrandData) => void;\n private handleFocus: (obj: CardFocusData) => void;\n private handleOnError: (obj: CardErrorData, hasUnsupportedCard?: boolean) => void;\n private handleOnAutoComplete: (obj: CardAutoCompleteData) => void;\n private handleOnNoDataRequired: () => void;\n private handleOnTouchstartIOS: (obj) => void;\n private handleKeyPressed: (obj: SFKeyPressObj) => void;\n public state: SFPState;\n public props;\n private issuingCountryCode;\n\n constructor(props: SFPProps) {\n super(props);\n\n const stateObj: SFPState = {\n status: 'loading',\n brand: props.type,\n errors: {},\n valid: {},\n data: {},\n cvcPolicy: CVC_POLICY_REQUIRED,\n expiryDatePolicy: DATE_POLICY_REQUIRED,\n isSfpValid: false,\n hasKoreanFields: props.hasKoreanFields\n };\n this.state = stateObj;\n\n this.csfLoadFailTimeout = null;\n this.csfLoadFailTimeoutMS = 30000;\n\n this.csfConfigFailTimeout = null;\n this.csfConfigFailTimeoutMS = 15000;\n\n this.numCharsInField = {};\n\n // Handlers\n this.handleOnLoad = handlers.handleOnLoad.bind(this);\n this.handleOnConfigSuccess = handlers.handleOnConfigSuccess.bind(this);\n this.handleOnFieldValid = handlers.handleOnFieldValid.bind(this);\n this.handleOnAllValid = handlers.handleOnAllValid.bind(this);\n this.handleOnBrand = handlers.handleOnBrand.bind(this);\n this.handleFocus = handlers.handleFocus.bind(this);\n this.handleOnError = handlers.handleOnError.bind(this);\n this.handleOnNoDataRequired = handlers.handleOnNoDataRequired.bind(this);\n this.handleOnAutoComplete = handlers.handleOnAutoComplete.bind(this);\n this.handleOnTouchstartIOS = handlers.handleOnTouchstartIOS.bind(this); // Only called when iOS detected\n this.handleKeyPressed = handlers.handleKeyPressed.bind(this);\n\n this.processBinLookupResponse = this.processBinLookupResponse.bind(this);\n\n // Bindings for functions exposed to users of this component: SecuredFields & CardInput\n this.setFocusOn = this.setFocusOn.bind(this);\n this.updateStyles = this.updateStyles.bind(this);\n this.handleUnsupportedCard = this.handleUnsupportedCard.bind(this);\n this.showValidation = this.showValidation.bind(this);\n this.destroy = this.destroy.bind(this);\n }\n\n public static defaultProps = defaultProps;\n\n public componentDidMount(): void {\n // When SFP instantiated through SecuredFieldsInput c.f. CardInput\n if (this.props.rootNode) {\n this.setRootNode(this.props.rootNode);\n }\n\n // Find encryptedFields and map them to the values we use to store valid states\n const fields = getFields(this.rootNode);\n const valid = fields.reduce(validFieldsReducer, {});\n\n this.setState({ valid });\n\n // Populate numCharsInField object\n fields.forEach(field => {\n this.numCharsInField[field] = 0;\n });\n\n // Store how many dateFields we are dealing with visually\n this.numDateFields = fields.filter(f => f.match(/Expiry/)).length;\n\n if (fields.length) {\n this.destroy();\n this.initializeCSF(this.rootNode);\n } else {\n if (this.props.componentType === TxVariants.customCard) {\n console.debug(\n 'You are trying to create a CustomCard component but the element into which you are trying to mount the CustomCard component does not contain any elements with a \"data-cse\" attribute e.g. <div data-cse=\"encryptedCardNumber\"></div>'\n );\n }\n this.handleOnNoDataRequired();\n }\n }\n\n public componentDidUpdate() {\n this.checkForKCPFields();\n // Pass all the state data up - Used right now for loading status\n this.props.onStateUpdate?.(this.state);\n }\n\n public componentWillUnmount(): void {\n this.csf = null;\n clearTimeout(this.csfLoadFailTimeout);\n clearTimeout(this.csfConfigFailTimeout);\n }\n\n private initializeCSF(root: HTMLElement): void {\n let loadingContext = this.props.loadingContext;\n\n // For loading securedFields from local server during development\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n loadingContext = process.env.__SF_ENV__;\n }\n\n const csfSetupObj: CSFSetupObject = {\n rootNode: root,\n type: this.props.type,\n componentType: this.props.componentType,\n clientKey: this.props.clientKey,\n cardGroupTypes: this.props.brands,\n autoFocus: this.props.autoFocus,\n trimTrailingSeparator: this.props.trimTrailingSeparator,\n loadingContext,\n keypadFix: this.props.keypadFix,\n showWarnings: this.props.showWarnings,\n iframeUIConfig: {\n sfStyles: this.props.styles\n },\n i18n: this.props.i18n,\n onSubmitAnalytics: this.props.onSubmitAnalytics,\n callbacks: {\n onLoad: this.handleOnLoad,\n onConfigSuccess: this.handleOnConfigSuccess,\n onFieldValid: this.handleOnFieldValid,\n onAllValid: this.handleOnAllValid,\n onBrand: this.handleOnBrand,\n onError: this.handleOnError,\n onFocus: this.handleFocus,\n onBinValue: this.props.onBinValue,\n onAutoComplete: this.handleOnAutoComplete,\n onAdditionalSFConfig: this.props.onAdditionalSFConfig,\n onAdditionalSFRemoved: this.props.onAdditionalSFRemoved,\n onTouchstartIOS: this.handleOnTouchstartIOS,\n onKeyPressed: this.handleKeyPressed\n },\n isKCP: this.state.hasKoreanFields,\n legacyInputMode: this.props.legacyInputMode,\n minimumExpiryDate: this.props.minimumExpiryDate,\n implementationType: this.props.implementationType || 'components', // to distinguish between 'regular' and 'custom' card component\n forceCompat: this.props.forceCompat,\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n shouldDisableIOSArrowKeys: !!this.props.disableIOSArrowKeys, // convert whether function has been defined into a boolean\n placeholders: this.props.placeholders ?? {},\n showContextualElement: this.props.showContextualElement\n };\n\n this.csf = initCSF(csfSetupObj);\n\n /**\n * Expect to at least have had the handleOnLoad callback called within this time\n * - if this hasn't happened then something has happened to interrupt the loading of the securedFields\n * So we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n // @ts-ignore - timout 'type' is a number\n this.csfLoadFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfLoadFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured field iframes have failed to load'));\n }\n }, this.csfLoadFailTimeoutMS);\n }\n\n private checkForKCPFields() {\n let needsKoreanFields = false;\n if (this.props.koreanAuthenticationRequired) {\n needsKoreanFields = this.issuingCountryCode ? this.issuingCountryCode === 'kr' : this.props.countryCode === 'kr';\n }\n\n // Was korean, now isn't - hide password field\n if (this.state.hasKoreanFields && !needsKoreanFields) {\n // Clear any stored data\n const setRemovedFieldState = prevState => ({\n data: { ...prevState.data, [ENCRYPTED_PWD_FIELD]: undefined },\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n errors: { ...prevState.errors, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: false\n });\n\n this.setState(setRemovedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.removeSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(false);\n }\n\n // Wasn't korean, now is - show password field\n if (!this.state.hasKoreanFields && needsKoreanFields) {\n const setAddedFieldState = prevState => ({\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: true,\n isSfpValid: false\n });\n\n this.setState(setAddedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.addSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(true);\n }\n }\n\n public getChildContext(): object {\n return { i18n: this.props.i18n };\n }\n\n public handleUnsupportedCard(errObj: CardErrorData): boolean {\n const hasUnsupportedCard = !!errObj.error;\n\n // Store the brand(s) we detected and which we don't support\n if (hasUnsupportedCard) {\n this.setState({ detectedUnsupportedBrands: errObj.detectedBrands });\n }\n\n errObj.rootNode = this.rootNode; // Needed for CustomCard\n this.handleOnError(errObj, hasUnsupportedCard);\n // Inform CSF that the number field has an unsupportedCard error (or that it has been cleared)\n if (this.csf) {\n this.csf.hasUnsupportedCard(ENCRYPTED_CARD_NUMBER, errObj.error);\n }\n return hasUnsupportedCard;\n }\n\n public setFocusOn(frame: string): void {\n if (this.csf) this.csf.setFocusOnFrame(frame);\n }\n\n public updateStyles(stylesObj: StylesObject): void {\n if (this.csf) this.csf.updateStyles(stylesObj);\n }\n\n public sfIsOptionalOrHidden(fieldType: string): boolean {\n return this.csf.sfIsOptionalOrHidden(fieldType);\n }\n\n public destroy(): void {\n if (this.csf) this.csf.destroy();\n }\n\n public showValidation(): void {\n const { numDateFields, state }: SecuredFieldsProvider = this;\n\n Object.keys(state.valid)\n .reduce(getErrorReducer(numDateFields, state), [])\n .forEach(field => {\n // For each detected error pass an error object to the handler (calls error callback & sets state)\n const errorObj: CardErrorData = getErrorObject(field, this.rootNode, state);\n this.handleOnError(errorObj, !!state.detectedUnsupportedBrands);\n // Inform the secured-fields instance of which fields have been found to have errors\n if (this.csf && this.csf.isValidated) {\n this.csf.isValidated(field, errorObj.error);\n }\n });\n }\n\n /**\n * Map SF errors to ValidationRuleResult-like objects, for CardInput component\n */\n public mapErrorsToValidationRuleResult(): SFStateErrorObj {\n const fieldNames: string[] = Object.keys(this.state.errors);\n\n const sfStateErrorsObj = fieldNames.reduce((acc, fieldName) => {\n const errorCode = this.state.errors[fieldName];\n if (errorCode) {\n acc[fieldName] = {\n isValid: false,\n errorMessage: getErrorMessageFromCode(errorCode, SF_ErrorCodes), // this is the human-readable, untranslated, explanation of the error that will exist on the error object in card.state.errors\n // For v5 the object found in state.errors should also contain the additional properties that used to be sent to the onError callback\n // namely: translation, errorCode, a ref to rootNode &, in the case of failed binLookup, an array of the detectedBrands\n errorI18n: this.props.i18n.get(errorCode),\n error: errorCode,\n rootNode: this.rootNode,\n ...(this.state.detectedUnsupportedBrands && { detectedBrands: this.state.detectedUnsupportedBrands })\n };\n } else {\n acc[fieldName] = null;\n }\n return acc;\n }, {});\n return sfStateErrorsObj;\n }\n\n public processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void {\n // If we were dealing with an unsupported card & now we have a valid /binLookup response (or a response triggering a reset of the UI),\n // - reset state to clear the error & the stored unsupportedBrands and, in the case of a valid /binLookup response, inform CSF (via handleUnsupportedCard)\n // (Scenario: from an unsupportedCard state the shopper has pasted another number long enough to trigger a /binLookup)\n if (this.state.detectedUnsupportedBrands) {\n this.setState(prevState => ({\n errors: { ...prevState.errors, [ENCRYPTED_CARD_NUMBER]: false },\n detectedUnsupportedBrands: null\n }));\n\n // If we have some sort of binLookupResponse object then this isn't the reset caused by digits dropping below a threshold\n // - so call handleUnsupportedCard to clear the error\n if (this.csf && binLookupResponse) {\n const errObj: CardErrorData = {\n type: 'card',\n fieldType: 'encryptedCardNumber',\n error: ''\n };\n this.handleUnsupportedCard(errObj);\n }\n }\n\n this.issuingCountryCode = binLookupResponse?.issuingCountryCode?.toLowerCase();\n\n const hasBrandedResetObj = resetObject?.brand;\n\n /**\n * Are we dealing with a \"dedicated\" card scenario i.e a card component created as: checkout.create('bcmc') but which can accept multiple brands\n * - in which case we will need to reset brand and pass on the resetObj to CSF\n */\n const mustResetDedicatedBrand = hasBrandedResetObj && DEDICATED_CARD_COMPONENTS.includes(resetObject.brand);\n\n if (mustResetDedicatedBrand) {\n // resetObject.brand will be the value of the brand whose logo we want to reshow in the UI\n this.setState(resetObject, () => {\n this.props.onChange(this.state);\n });\n }\n\n /**\n * Scenarios:\n *\n * - RESET (binLookupResponse === null): The number of digits in number field has dropped below threshold for BIN lookup\n * - RESULT (binLookupResponse.supportedBrands.length === 1): binLookup has found a result so inform CSF\n *\n * In the RESET scenario, for \"dedicated\" card components we also need to pass on the resetObject since this contains information about\n * the brand that CSF needs to reset to, internally.\n */\n if (this.csf) this.csf.brandsFromBinLookup(binLookupResponse, mustResetDedicatedBrand ? resetObject : null);\n }\n\n private setRootNode = (input: HTMLElement): void => {\n this.rootNode = input;\n };\n\n public render(props, state) {\n return props.render({ setRootNode: this.setRootNode, setFocusOn: this.setFocusOn }, state);\n }\n}\n\nexport default SecuredFieldsProvider;\n"],"names":["SecuredFieldsProvider","Component","componentDidMount","this","props","rootNode","setRootNode","fields","getFields","valid","reduce","validFieldsReducer","setState","forEach","field","numCharsInField","numDateFields","filter","f","match","length","destroy","initializeCSF","componentType","TxVariants","customCard","console","debug","handleOnNoDataRequired","componentDidUpdate","checkForKCPFields","onStateUpdate","state","componentWillUnmount","csf","clearTimeout","csfLoadFailTimeout","csfConfigFailTimeout","root","loadingContext","csfSetupObj","type","clientKey","cardGroupTypes","brands","autoFocus","trimTrailingSeparator","keypadFix","showWarnings","iframeUIConfig","sfStyles","styles","i18n","onSubmitAnalytics","callbacks","onLoad","handleOnLoad","onConfigSuccess","handleOnConfigSuccess","onFieldValid","handleOnFieldValid","onAllValid","handleOnAllValid","onBrand","handleOnBrand","onError","handleOnError","onFocus","handleFocus","onBinValue","onAutoComplete","handleOnAutoComplete","onAdditionalSFConfig","onAdditionalSFRemoved","onTouchstartIOS","handleOnTouchstartIOS","onKeyPressed","handleKeyPressed","isKCP","hasKoreanFields","legacyInputMode","minimumExpiryDate","implementationType","forceCompat","maskSecurityCode","exposeExpiryDate","shouldDisableIOSArrowKeys","disableIOSArrowKeys","placeholders","showContextualElement","initCSF","setTimeout","status","AdyenCheckoutError","csfLoadFailTimeoutMS","needsKoreanFields","koreanAuthenticationRequired","issuingCountryCode","countryCode","setRemovedFieldState","prevState","data","ENCRYPTED_PWD_FIELD","undefined","errors","onChange","removeSecuredField","setKCPStatus","setAddedFieldState","isSfpValid","addSecuredField","getChildContext","handleUnsupportedCard","errObj","hasUnsupportedCard","error","detectedUnsupportedBrands","detectedBrands","ENCRYPTED_CARD_NUMBER","setFocusOn","frame","setFocusOnFrame","updateStyles","stylesObj","sfIsOptionalOrHidden","fieldType","showValidation","Object","keys","getErrorReducer","errorObj","getErrorObject","isValidated","mapErrorsToValidationRuleResult","acc","fieldName","errorCode","isValid","errorMessage","getErrorMessageFromCode","SF_ErrorCodes","errorI18n","get","processBinLookupResponse","binLookupResponse","resetObject","toLowerCase","hasBrandedResetObj","brand","mustResetDedicatedBrand","DEDICATED_CARD_COMPONENTS","includes","brandsFromBinLookup","render","constructor","super","_define_property","csfConfigFailTimeoutMS","input","stateObj","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","handlers","bind","defaultProps"],"mappings":"20BA+BA,MAAMA,UAA8BC,EAyEzBC,iBAAAA,GAECC,KAAKC,MAAMC,UACXF,KAAKG,YAAYH,KAAKC,MAAMC,UAIhC,MAAME,EAASC,EAAUL,KAAKE,UACxBI,EAAQF,EAAOG,OAAOC,EAAoB,CAAA,GAEhDR,KAAKS,SAAS,CAAEH,UAGhBF,EAAOM,QAAQC,IACXX,KAAKY,gBAAgBD,GAAS,IAIlCX,KAAKa,cAAgBT,EAAOU,OAAOC,GAAKA,EAAEC,MAAM,WAAWC,OAEvDb,EAAOa,QACPjB,KAAKkB,UACLlB,KAAKmB,cAAcnB,KAAKE,YAEpBF,KAAKC,MAAMmB,gBAAkBC,EAAWC,YACxCC,QAAQC,MACJ,yOAGRxB,KAAKyB,yBAEb,CAEOC,kBAAAA,GACH1B,KAAK2B,oBAEL3B,KAAKC,MAAM2B,gBAAgB5B,KAAK6B,MACpC,CAEOC,oBAAAA,GACH9B,KAAK+B,IAAM,KACXC,aAAahC,KAAKiC,oBAClBD,aAAahC,KAAKkC,qBACtB,CAEQf,aAAAA,CAAcgB,GAClB,IAAIC,EAAiBpC,KAAKC,MAAMmC,eAOhC,MAAMC,EAA8B,CAChCnC,SAAUiC,EACVG,KAAMtC,KAAKC,MAAMqC,KACjBlB,cAAepB,KAAKC,MAAMmB,cAC1BmB,UAAWvC,KAAKC,MAAMsC,UACtBC,eAAgBxC,KAAKC,MAAMwC,OAC3BC,UAAW1C,KAAKC,MAAM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ider.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProvider.ts"],"sourcesContent":["import { Component } from 'preact';\nimport { getErrorObject, getFields, getErrorReducer, validFieldsReducer } from './SFPUtils';\nimport initCSF from '../lib/CSF';\nimport handlers from './SecuredFieldsProviderHandlers';\nimport defaultProps from './defaultProps';\nimport { SFPProps, SFPState, SingleBrandResetObject } from './types';\nimport {\n StylesObject,\n CardErrorData,\n CardFocusData,\n CardBrandData,\n CardAllValidData,\n CardFieldValidData,\n CardAutoCompleteData,\n CardConfigSuccessData,\n CardLoadData,\n SFKeyPressObj\n} from '../lib/types';\nimport { CSFReturnObject, CSFSetupObject } from '../lib/CSF/types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, DEDICATED_CARD_COMPONENTS, ENCRYPTED_CARD_NUMBER, ENCRYPTED_PWD_FIELD } from '../lib/constants';\nimport { BinLookupResponse } from '../../../Card/types';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\nimport { SFStateErrorObj } from '../../../Card/components/CardInput/types';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { TxVariants } from '../../../tx-variants';\n\n/**\n * SecuredFieldsProvider:\n * Initialises & handles the client-side part of SecuredFields\n */\nclass SecuredFieldsProvider extends Component<SFPProps, SFPState> {\n private csfLoadFailTimeout: number;\n private csfLoadFailTimeoutMS: number;\n private csfConfigFailTimeout: number;\n private csfConfigFailTimeoutMS: number;\n private numCharsInField: object;\n private rootNode;\n private numDateFields: number;\n private csf: CSFReturnObject;\n private handleOnLoad: (obj: CardLoadData) => void;\n private handleOnConfigSuccess: (obj: CardConfigSuccessData) => void;\n private handleOnFieldValid: (obj: CardFieldValidData) => void;\n private handleOnAllValid: (obj: CardAllValidData) => void;\n private handleOnBrand: (obj: CardBrandData) => void;\n private handleFocus: (obj: CardFocusData) => void;\n private handleOnError: (obj: CardErrorData, hasUnsupportedCard?: boolean) => void;\n private handleOnAutoComplete: (obj: CardAutoCompleteData) => void;\n private handleOnNoDataRequired: () => void;\n private handleOnTouchstartIOS: (obj) => void;\n private handleKeyPressed: (obj: SFKeyPressObj) => void;\n public state: SFPState;\n public props;\n private issuingCountryCode;\n\n constructor(props: SFPProps) {\n super(props);\n\n const stateObj: SFPState = {\n status: 'loading',\n brand: props.type,\n errors: {},\n valid: {},\n data: {},\n cvcPolicy: CVC_POLICY_REQUIRED,\n expiryDatePolicy: DATE_POLICY_REQUIRED,\n isSfpValid: false,\n hasKoreanFields: props.hasKoreanFields\n };\n this.state = stateObj;\n\n this.csfLoadFailTimeout = null;\n this.csfLoadFailTimeoutMS = 30000;\n\n this.csfConfigFailTimeout = null;\n this.csfConfigFailTimeoutMS = 15000;\n\n this.numCharsInField = {};\n\n // Handlers\n this.handleOnLoad = handlers.handleOnLoad.bind(this);\n this.handleOnConfigSuccess = handlers.handleOnConfigSuccess.bind(this);\n this.handleOnFieldValid = handlers.handleOnFieldValid.bind(this);\n this.handleOnAllValid = handlers.handleOnAllValid.bind(this);\n this.handleOnBrand = handlers.handleOnBrand.bind(this);\n this.handleFocus = handlers.handleFocus.bind(this);\n this.handleOnError = handlers.handleOnError.bind(this);\n this.handleOnNoDataRequired = handlers.handleOnNoDataRequired.bind(this);\n this.handleOnAutoComplete = handlers.handleOnAutoComplete.bind(this);\n this.handleOnTouchstartIOS = handlers.handleOnTouchstartIOS.bind(this); // Only called when iOS detected\n this.handleKeyPressed = handlers.handleKeyPressed.bind(this);\n\n this.processBinLookupResponse = this.processBinLookupResponse.bind(this);\n\n // Bindings for functions exposed to users of this component: SecuredFields & CardInput\n this.setFocusOn = this.setFocusOn.bind(this);\n this.updateStyles = this.updateStyles.bind(this);\n this.handleUnsupportedCard = this.handleUnsupportedCard.bind(this);\n this.showValidation = this.showValidation.bind(this);\n this.destroy = this.destroy.bind(this);\n }\n\n public static readonly defaultProps = defaultProps;\n\n public componentDidMount(): void {\n // When SFP instantiated through SecuredFieldsInput c.f. CardInput\n if (this.props.rootNode) {\n this.setRootNode(this.props.rootNode);\n }\n\n // Find encryptedFields and map them to the values we use to store valid states\n const fields = getFields(this.rootNode);\n const valid = fields.reduce(validFieldsReducer, {});\n\n this.setState({ valid });\n\n // Populate numCharsInField object\n fields.forEach(field => {\n this.numCharsInField[field] = 0;\n });\n\n // Store how many dateFields we are dealing with visually\n this.numDateFields = fields.filter(f => f.match(/Expiry/)).length;\n\n if (fields.length) {\n this.destroy();\n this.initializeCSF(this.rootNode);\n } else {\n if (this.props.componentType === TxVariants.customCard) {\n console.debug(\n 'You are trying to create a CustomCard component but the element into which you are trying to mount the CustomCard component does not contain any elements with a \"data-cse\" attribute e.g. <div data-cse=\"encryptedCardNumber\"></div>'\n );\n }\n this.handleOnNoDataRequired();\n }\n }\n\n public componentDidUpdate() {\n this.checkForKCPFields();\n // Pass all the state data up - Used right now for loading status\n this.props.onStateUpdate?.(this.state);\n }\n\n public componentWillUnmount(): void {\n this.csf = null;\n clearTimeout(this.csfLoadFailTimeout);\n clearTimeout(this.csfConfigFailTimeout);\n }\n\n private initializeCSF(root: HTMLElement): void {\n let loadingContext = this.props.loadingContext;\n\n // For loading securedFields from local server during development\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n loadingContext = process.env.__SF_ENV__;\n }\n\n const csfSetupObj: CSFSetupObject = {\n rootNode: root,\n type: this.props.type,\n componentType: this.props.componentType,\n clientKey: this.props.clientKey,\n cardGroupTypes: this.props.brands,\n autoFocus: this.props.autoFocus,\n trimTrailingSeparator: this.props.trimTrailingSeparator,\n loadingContext,\n keypadFix: this.props.keypadFix,\n showWarnings: this.props.showWarnings,\n iframeUIConfig: {\n sfStyles: this.props.styles\n },\n i18n: this.props.i18n,\n onSubmitAnalytics: this.props.onSubmitAnalytics,\n callbacks: {\n onLoad: this.handleOnLoad,\n onConfigSuccess: this.handleOnConfigSuccess,\n onFieldValid: this.handleOnFieldValid,\n onAllValid: this.handleOnAllValid,\n onBrand: this.handleOnBrand,\n onError: this.handleOnError,\n onFocus: this.handleFocus,\n onBinValue: this.props.onBinValue,\n onAutoComplete: this.handleOnAutoComplete,\n onAdditionalSFConfig: this.props.onAdditionalSFConfig,\n onAdditionalSFRemoved: this.props.onAdditionalSFRemoved,\n onTouchstartIOS: this.handleOnTouchstartIOS,\n onKeyPressed: this.handleKeyPressed\n },\n isKCP: this.state.hasKoreanFields,\n legacyInputMode: this.props.legacyInputMode,\n minimumExpiryDate: this.props.minimumExpiryDate,\n implementationType: this.props.implementationType || 'components', // to distinguish between 'regular' and 'custom' card component\n forceCompat: this.props.forceCompat,\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n shouldDisableIOSArrowKeys: !!this.props.disableIOSArrowKeys, // convert whether function has been defined into a boolean\n placeholders: this.props.placeholders ?? {},\n showContextualElement: this.props.showContextualElement\n };\n\n this.csf = initCSF(csfSetupObj);\n\n /**\n * Expect to at least have had the handleOnLoad callback called within this time\n * - if this hasn't happened then something has happened to interrupt the loading of the securedFields\n * So we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n // @ts-ignore - timout 'type' is a number\n this.csfLoadFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfLoadFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured field iframes have failed to load'));\n }\n }, this.csfLoadFailTimeoutMS);\n }\n\n private checkForKCPFields() {\n let needsKoreanFields = false;\n if (this.props.koreanAuthenticationRequired) {\n needsKoreanFields = this.issuingCountryCode ? this.issuingCountryCode === 'kr' : this.props.countryCode === 'kr';\n }\n\n // Was korean, now isn't - hide password field\n if (this.state.hasKoreanFields && !needsKoreanFields) {\n // Clear any stored data\n const setRemovedFieldState = prevState => ({\n data: { ...prevState.data, [ENCRYPTED_PWD_FIELD]: undefined },\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n errors: { ...prevState.errors, [ENCRYPTED_PWD_FIELD]: null },\n hasKoreanFields: false\n });\n\n this.setState(setRemovedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.removeSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(false);\n }\n\n // Wasn't korean, now is - show password field\n if (!this.state.hasKoreanFields && needsKoreanFields) {\n const setAddedFieldState = prevState => ({\n valid: { ...prevState.valid, [ENCRYPTED_PWD_FIELD]: false },\n hasKoreanFields: true,\n isSfpValid: false\n });\n\n this.setState(setAddedFieldState, () => {\n this.props.onChange(this.state);\n });\n\n this.csf.addSecuredField(ENCRYPTED_PWD_FIELD);\n this.csf.setKCPStatus(true);\n }\n }\n\n public getChildContext(): object {\n return { i18n: this.props.i18n };\n }\n\n public handleUnsupportedCard(errObj: CardErrorData): boolean {\n const hasUnsupportedCard = !!errObj.error;\n\n // Store the brand(s) we detected and which we don't support\n if (hasUnsupportedCard) {\n this.setState({ detectedUnsupportedBrands: errObj.detectedBrands });\n }\n\n errObj.rootNode = this.rootNode; // Needed for CustomCard\n this.handleOnError(errObj, hasUnsupportedCard);\n // Inform CSF that the number field has an unsupportedCard error (or that it has been cleared)\n if (this.csf) {\n this.csf.hasUnsupportedCard(ENCRYPTED_CARD_NUMBER, errObj.error);\n }\n return hasUnsupportedCard;\n }\n\n public setFocusOn(frame: string): void {\n if (this.csf) this.csf.setFocusOnFrame(frame);\n }\n\n public updateStyles(stylesObj: StylesObject): void {\n if (this.csf) this.csf.updateStyles(stylesObj);\n }\n\n public sfIsOptionalOrHidden(fieldType: string): boolean {\n return this.csf.sfIsOptionalOrHidden(fieldType);\n }\n\n public destroy(): void {\n if (this.csf) this.csf.destroy();\n }\n\n public getRootNode(): HTMLElement {\n return this.rootNode;\n }\n\n public showValidation(): void {\n const { numDateFields, state }: SecuredFieldsProvider = this;\n\n Object.keys(state.valid)\n .reduce(getErrorReducer(numDateFields, state), [])\n .forEach(field => {\n // For each detected error pass an error object to the handler (calls error callback & sets state)\n const errorObj: CardErrorData = getErrorObject(field, this.rootNode, state);\n this.handleOnError(errorObj, !!state.detectedUnsupportedBrands);\n // Inform the secured-fields instance of which fields have been found to have errors\n if (this.csf && this.csf.isValidated) {\n this.csf.isValidated(field, errorObj.error);\n }\n });\n }\n\n /**\n * Map SF errors to ValidationRuleResult-like objects, for CardInput component\n */\n public mapErrorsToValidationRuleResult(): SFStateErrorObj {\n const fieldNames: string[] = Object.keys(this.state.errors);\n\n const sfStateErrorsObj = fieldNames.reduce((acc, fieldName) => {\n const errorCode = this.state.errors[fieldName];\n if (errorCode) {\n acc[fieldName] = {\n isValid: false,\n errorMessage: getErrorMessageFromCode(errorCode, SF_ErrorCodes), // this is the human-readable, untranslated, explanation of the error that will exist on the error object in card.state.errors\n // For v5 the object found in state.errors should also contain the additional properties that used to be sent to the onError callback\n // namely: translation, errorCode, a ref to rootNode &, in the case of failed binLookup, an array of the detectedBrands\n errorI18n: this.props.i18n.get(errorCode),\n error: errorCode,\n rootNode: this.rootNode,\n ...(this.state.detectedUnsupportedBrands && { detectedBrands: this.state.detectedUnsupportedBrands })\n };\n } else {\n acc[fieldName] = null;\n }\n return acc;\n }, {});\n return sfStateErrorsObj;\n }\n\n public processBinLookupResponse(binLookupResponse: BinLookupResponse, resetObject: SingleBrandResetObject): void {\n // If we were dealing with an unsupported card & now we have a valid /binLookup response (or a response triggering a reset of the UI),\n // - reset state to clear the error & the stored unsupportedBrands and, in the case of a valid /binLookup response, inform CSF (via handleUnsupportedCard)\n // (Scenario: from an unsupportedCard state the shopper has pasted another number long enough to trigger a /binLookup)\n if (this.state.detectedUnsupportedBrands) {\n this.setState(prevState => ({\n errors: { ...prevState.errors, [ENCRYPTED_CARD_NUMBER]: null },\n detectedUnsupportedBrands: null\n }));\n\n // If we have some sort of binLookupResponse object then this isn't the reset caused by digits dropping below a threshold\n // - so call handleUnsupportedCard to clear the error\n if (this.csf && binLookupResponse) {\n const errObj: CardErrorData = {\n type: 'card',\n fieldType: 'encryptedCardNumber',\n error: ''\n };\n this.handleUnsupportedCard(errObj);\n }\n }\n\n this.issuingCountryCode = binLookupResponse?.issuingCountryCode?.toLowerCase();\n\n const hasBrandedResetObj = resetObject?.brand;\n\n /**\n * Are we dealing with a \"dedicated\" card scenario i.e a card component created as: checkout.create('bcmc') but which can accept multiple brands\n * - in which case we will need to reset brand and pass on the resetObj to CSF\n */\n const mustResetDedicatedBrand = hasBrandedResetObj && DEDICATED_CARD_COMPONENTS.includes(resetObject.brand);\n\n if (mustResetDedicatedBrand) {\n // resetObject.brand will be the value of the brand whose logo we want to reshow in the UI\n this.setState(resetObject, () => {\n this.props.onChange(this.state);\n });\n }\n\n /**\n * Scenarios:\n *\n * - RESET (binLookupResponse === null): The number of digits in number field has dropped below threshold for BIN lookup\n * - RESULT (binLookupResponse.supportedBrands.length === 1): binLookup has found a result so inform CSF\n *\n * In the RESET scenario, for \"dedicated\" card components we also need to pass on the resetObject since this contains information about\n * the brand that CSF needs to reset to, internally.\n */\n if (this.csf) this.csf.brandsFromBinLookup(binLookupResponse, mustResetDedicatedBrand ? resetObject : null);\n }\n\n private setRootNode = (input: HTMLElement): void => {\n this.rootNode = input;\n };\n\n public render(props, state) {\n return props.render({ setRootNode: this.setRootNode, setFocusOn: this.setFocusOn }, state);\n }\n}\n\nexport default SecuredFieldsProvider;\n"],"names":["SecuredFieldsProvider","Component","componentDidMount","this","props","rootNode","setRootNode","fields","getFields","valid","reduce","validFieldsReducer","setState","forEach","field","numCharsInField","numDateFields","filter","f","match","length","destroy","initializeCSF","componentType","TxVariants","customCard","console","debug","handleOnNoDataRequired","componentDidUpdate","checkForKCPFields","onStateUpdate","state","componentWillUnmount","csf","clearTimeout","csfLoadFailTimeout","csfConfigFailTimeout","root","loadingContext","csfSetupObj","type","clientKey","cardGroupTypes","brands","autoFocus","trimTrailingSeparator","keypadFix","showWarnings","iframeUIConfig","sfStyles","styles","i18n","onSubmitAnalytics","callbacks","onLoad","handleOnLoad","onConfigSuccess","handleOnConfigSuccess","onFieldValid","handleOnFieldValid","onAllValid","handleOnAllValid","onBrand","handleOnBrand","onError","handleOnError","onFocus","handleFocus","onBinValue","onAutoComplete","handleOnAutoComplete","onAdditionalSFConfig","onAdditionalSFRemoved","onTouchstartIOS","handleOnTouchstartIOS","onKeyPressed","handleKeyPressed","isKCP","hasKoreanFields","legacyInputMode","minimumExpiryDate","implementationType","forceCompat","maskSecurityCode","exposeExpiryDate","shouldDisableIOSArrowKeys","disableIOSArrowKeys","placeholders","showContextualElement","initCSF","setTimeout","status","AdyenCheckoutError","csfLoadFailTimeoutMS","needsKoreanFields","koreanAuthenticationRequired","issuingCountryCode","countryCode","setRemovedFieldState","prevState","data","ENCRYPTED_PWD_FIELD","undefined","errors","onChange","removeSecuredField","setKCPStatus","setAddedFieldState","isSfpValid","addSecuredField","getChildContext","handleUnsupportedCard","errObj","hasUnsupportedCard","error","detectedUnsupportedBrands","detectedBrands","ENCRYPTED_CARD_NUMBER","setFocusOn","frame","setFocusOnFrame","updateStyles","stylesObj","sfIsOptionalOrHidden","fieldType","getRootNode","showValidation","Object","keys","getErrorReducer","errorObj","getErrorObject","isValidated","mapErrorsToValidationRuleResult","acc","fieldName","errorCode","isValid","errorMessage","getErrorMessageFromCode","SF_ErrorCodes","errorI18n","get","processBinLookupResponse","binLookupResponse","resetObject","toLowerCase","hasBrandedResetObj","brand","mustResetDedicatedBrand","DEDICATED_CARD_COMPONENTS","includes","brandsFromBinLookup","render","constructor","super","_define_property","csfConfigFailTimeoutMS","input","stateObj","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","handlers","bind","defaultProps"],"mappings":"20BA+BA,MAAMA,UAA8BC,EAyEzBC,iBAAAA,GAECC,KAAKC,MAAMC,UACXF,KAAKG,YAAYH,KAAKC,MAAMC,UAIhC,MAAME,EAASC,EAAUL,KAAKE,UACxBI,EAAQF,EAAOG,OAAOC,EAAoB,CAAA,GAEhDR,KAAKS,SAAS,CAAEH,U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sG,KAAKnK,MACjDA,KAAKiE,YAAciG,EAASjG,YAAYkG,KAAKnK,MAC7CA,KAAK+D,cAAgBmG,EAASnG,cAAcoG,KAAKnK,MACjDA,KAAKyB,uBAAyByI,EAASzI,uBAAuB0I,KAAKnK,MACnEA,KAAKoE,qBAAuB8F,EAAS9F,qBAAqB+F,KAAKnK,MAC/DA,KAAKwE,sBAAwB0F,EAAS1F,sBAAsB2F,KAAKnK,MACjEA,KAAK0E,iBAAmBwF,EAASxF,iBAAiByF,KAAKnK,MAEvDA,KAAK6I,yBAA2B7I,KAAK6I,yBAAyBsB,KAAKnK,MAGnEA,KAAKoH,WAAapH,KAAKoH,WAAW+C,KAAKnK,MACvCA,KAAKuH,aAAevH,KAAKuH,aAAa4C,KAAKnK,MAC3CA,KAAK6G,sBAAwB7G,KAAK6G,sBAAsBsD,KAAKnK,MAC7DA,KAAK4H,eAAiB5H,KAAK4H,eAAeuC,KAAKnK,MAC/CA,KAAKkB,QAAUlB,KAAKkB,QAAQiJ,KAAKnK,KACrC,EAEA0J,EAvEE7J,EAuEqBuK,eAAeA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getCardImageUrl as e}from"../utils.js";import{ENCRYPTED_CARD_NUMBER as t,ENCRYPTED_SECURITY_CODE as s,ENCRYPTED_EXPIRY_DATE as i,ENCRYPTED_EXPIRY_MONTH as n,ENCRYPTED_EXPIRY_YEAR as r,DATE_POLICY_REQUIRED as o,CVC_POLICY_REQUIRED as a,OPTIONAL as l,HIDDEN as d}from"../lib/constants.js";import{existy as h}from"../../../../utils/commonUtils.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";function p(e,t,s,i){return(t!==l&&t!==d||0!==s[e])&&i[e]}var c={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)}),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})}),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==t)&&(this.setState(t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]
|
|
1
|
+
import{getCardImageUrl as e}from"../utils.js";import{ENCRYPTED_CARD_NUMBER as t,ENCRYPTED_SECURITY_CODE as s,ENCRYPTED_EXPIRY_DATE as i,ENCRYPTED_EXPIRY_MONTH as n,ENCRYPTED_EXPIRY_YEAR as r,DATE_POLICY_REQUIRED as o,CVC_POLICY_REQUIRED as a,OPTIONAL as l,HIDDEN as d}from"../lib/constants.js";import{existy as h}from"../../../../utils/commonUtils.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";function p(e,t,s,i){return(t!==l&&t!==d||0!==s[e])&&i[e]}var c={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)}),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})}),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==t)&&(this.setState(t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]??null}}),()=>{this.props.onChange(this.state,{event:"handleOnFieldValid",fieldType:e.fieldType}),this.props.onFieldValid(e)}),!0)},handleOnLoad:function(e){clearTimeout(this.csfLoadFailTimeout),this.csfLoadFailTimeout=null,this.props.onLoad(e),this.csfConfigFailTimeout=setTimeout(()=>{"ready"!==this.state.status&&(this.setState({status:"csfConfigFailure"}),this.props.onError(new u("ERROR","secured fields have failed to configure")))},this.csfConfigFailTimeoutMS)},handleOnConfigSuccess:function(e){clearTimeout(this.csfConfigFailTimeout),this.csfConfigFailTimeout=null,this.setState({status:"ready"},()=>{this.props.onConfigSuccess(e)})},handleOnBrand:function(t){this.setState(e=>{const l=p(s,t.cvcPolicy,this.numCharsInField,e.errors),d=1===this.numDateFields?p(i,t.expiryDatePolicy,this.numCharsInField,e.errors):null,u=2===this.numDateFields?p(n,t.expiryDatePolicy,this.numCharsInField,e.errors):null,c=2===this.numDateFields?p(r,t.expiryDatePolicy,this.numCharsInField,e.errors):null;return{brand:t.brand,cvcPolicy:t.cvcPolicy??a,showSocialSecurityNumber:t.showSocialSecurityNumber,errors:{...e.errors,...h(l)&&{[s]:l},...h(d)&&{[i]:d},...h(u)&&{[n]:u},...h(c)&&{[r]:c}},expiryDatePolicy:t.expiryDatePolicy??o}},()=>{this.props.onChange(this.state,{event:"handleOnBrand"});const s=this.props.brandsConfiguration[t.brand]?.icon??e(t.brand,this.props.resources);this.props.onBrand({...t,brandImageUrl:s})})},handleOnError:function(e,s=null){const i=e.error;return this.setState(n=>({errors:{...n.errors,[e.fieldType]:i||null},...s&&{data:{...n.data,[t]:void 0}},...s&&{valid:{...n.valid,[t]:!1}},...s&&{isSfpValid:!1}}),()=>{this.props.onChange(this.state,{event:"handleOnError",fieldType:e.fieldType})}),!0},handleOnNoDataRequired:function(){this.setState({status:"ready"},()=>this.props.onChange({isSfpValid:!0}))},handleOnTouchstartIOS:function(e){this.props.disableIOSArrowKeys?.(e)},handleKeyPressed:function(e){if("enterKeyPressed"===e.action){const e=new KeyboardEvent("keypress",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter"});this.props.handleKeyPress?.(e)}}};export{c as default};
|
|
2
2
|
//# sourceMappingURL=SecuredFieldsProviderHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuredFieldsProviderHandlers.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.ts"],"sourcesContent":["import { getCardImageUrl } from '../utils';\nimport {\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_CARD_NUMBER,\n CVC_POLICY_REQUIRED,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE,\n OPTIONAL,\n HIDDEN,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR\n} from '../lib/constants';\nimport {\n CardErrorData,\n CardFocusData,\n CardBrandData,\n CardAllValidData,\n CardFieldValidData,\n CardAutoCompleteData,\n CardConfigSuccessData,\n CardLoadData,\n SFKeyPressObj\n} from '../lib/types';\nimport { existy } from '../../../../utils/commonUtils';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\n\n/**\n * Emits the onLoad event\n * Here we can assume all securedFields iframes have fired their 'load' event\n */\nfunction handleOnLoad(cbObj: CardLoadData): void {\n // Clear 'loading' timeout\n clearTimeout(this.csfLoadFailTimeout);\n this.csfLoadFailTimeout = null;\n\n // Propagate onLoad event\n this.props.onLoad(cbObj);\n\n /**\n * Having seen that the securedFields iframes have loaded some kind of content (we don't know what, yet)\n * - setTimeout since we expect to get a successful configuration message \"within a reasonable time\"\n *\n * Now we catch clientKey & environment mismatch in core.ts - this timeout being called indicates that the securedFields have not all configured\n * - so we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n this.csfConfigFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfConfigFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured fields have failed to configure'));\n }\n }, this.csfConfigFailTimeoutMS);\n}\n\n/**\n * Emits the onConfigSuccess (ready) event\n * Here we can assume CSF is loaded, configured and ready to be used\n */\nfunction handleOnConfigSuccess(cbObj: CardConfigSuccessData): void {\n // Clear 'config' timeout\n clearTimeout(this.csfConfigFailTimeout);\n this.csfConfigFailTimeout = null;\n\n this.setState({ status: 'ready' }, () => {\n // Propagate onConfigSuccess event\n this.props.onConfigSuccess(cbObj);\n });\n}\n\n/**\n * Emits the onAllValid event\n */\nfunction handleOnAllValid(status: CardAllValidData): boolean {\n // Form cannot be valid whilst there is an unsupported card\n if (this.state.detectedUnsupportedBrands) {\n return false;\n }\n\n this.setState({ isSfpValid: status.allValid }, () => {\n // New - fixes maestro-with-error-on-optional-cvc-field bug\n this.props.onChange(this.state, { event: 'handleOnAllValid' });\n // Propagate onAllValid event\n this.props.onAllValid(status);\n });\n\n return true;\n}\n\n/**\n * Saves a field value from CSF in the CardInput state\n * Emits the onFieldValid event\n */\nfunction handleOnFieldValid(fieldObj: CardFieldValidData): boolean {\n // A card number field cannot be valid whilst there is an unsupported card\n if (this.state.detectedUnsupportedBrands && fieldObj.fieldType === ENCRYPTED_CARD_NUMBER) {\n return false;\n }\n\n const setValidFieldState = prevState => ({\n data: { ...prevState.data, [fieldObj.encryptedFieldName]: fieldObj.blob },\n valid: { ...prevState.valid, [fieldObj.encryptedFieldName]: fieldObj.valid },\n /**\n * For a field that has just received valid:true (field has just been completed & encrypted) - mark the error state for this field as false\n * For a field that has just received valid:false (field was encrypted, now is not)\n * - field is either in a state of being incomplete but without errors (digit deleted) - so mark the error state for this field as false\n * or has switched from valid/encrypted state to being in error (digit edited to one that puts the field in error) - so keep any error that\n * might just have been set\n */\n errors: { ...prevState.errors, [fieldObj.fieldType]: prevState.errors[fieldObj.fieldType] ?? false }\n });\n\n this.setState(setValidFieldState, () => {\n this.props.onChange(this.state, { event: 'handleOnFieldValid', fieldType: fieldObj.fieldType });\n\n // Propagate onFieldValid event\n this.props.onFieldValid(fieldObj);\n });\n\n return true;\n}\n\nfunction fieldIsInError(fieldType: string, policy: string, numCharsObj: object, errorsObj) {\n return (policy === OPTIONAL || policy === HIDDEN) && numCharsObj[fieldType] === 0 ? false : errorsObj[fieldType];\n}\n\n/**\n * Saves the card brand in state\n * Emits the onBrand event\n */\nfunction handleOnBrand(cardInfo: CardBrandData): void {\n this.setState(\n prevState => {\n /**\n * If we change brand to one where the cvc or date field(s) are not required & are empty - then these fields cannot be in error\n * (scenario: have validated empty form, then choose brand w. optional/hidden cvc or date)...\n * ...else propagate the existing error.\n */\n const cvcFieldInError = fieldIsInError(ENCRYPTED_SECURITY_CODE, cardInfo.cvcPolicy, this.numCharsInField, prevState.errors);\n\n const dateFieldInError =\n this.numDateFields === 1\n ? fieldIsInError(ENCRYPTED_EXPIRY_DATE, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n\n // For custom card comp\n const monthFieldInError =\n this.numDateFields === 2\n ? fieldIsInError(ENCRYPTED_EXPIRY_MONTH, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n\n const yearFieldInError =\n this.numDateFields === 2\n ? fieldIsInError(ENCRYPTED_EXPIRY_YEAR, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n // --\n /** end */\n\n return {\n brand: cardInfo.brand,\n cvcPolicy: cardInfo.cvcPolicy ?? CVC_POLICY_REQUIRED,\n showSocialSecurityNumber: cardInfo.showSocialSecurityNumber,\n errors: {\n ...prevState.errors,\n ...(existy(cvcFieldInError) && { [ENCRYPTED_SECURITY_CODE]: cvcFieldInError }),\n ...(existy(dateFieldInError) && { [ENCRYPTED_EXPIRY_DATE]: dateFieldInError }),\n ...(existy(monthFieldInError) && { [ENCRYPTED_EXPIRY_MONTH]: monthFieldInError }),\n ...(existy(yearFieldInError) && { [ENCRYPTED_EXPIRY_YEAR]: yearFieldInError })\n },\n expiryDatePolicy: cardInfo.expiryDatePolicy ?? DATE_POLICY_REQUIRED\n };\n },\n () => {\n this.props.onChange(this.state, { event: 'handleOnBrand' });\n\n // Enhance data object with the url for the brand image, first checking if the merchant has configured their own one for this brand\n const brandImageUrl = this.props.brandsConfiguration[cardInfo.brand]?.icon ?? getCardImageUrl(cardInfo.brand, this.props.resources);\n this.props.onBrand({ ...cardInfo, brandImageUrl });\n }\n );\n}\n\n/**\n * Handles validation errors\n */\nfunction handleOnError(cbObj: CardErrorData, hasUnsupportedCard: boolean = null): boolean {\n const errorCode = cbObj.error;\n\n this.setState(\n prevState => ({\n errors: { ...prevState.errors, [cbObj.fieldType]: errorCode || false },\n // If dealing with an unsupported card ensure these card number related fields are reset re. pasting a full, unsupported card straight in\n ...(hasUnsupportedCard && { data: { ...prevState.data, [ENCRYPTED_CARD_NUMBER]: undefined } }),\n ...(hasUnsupportedCard && { valid: { ...prevState.valid, [ENCRYPTED_CARD_NUMBER]: false } }),\n ...(hasUnsupportedCard && { isSfpValid: false })\n }),\n () => {\n this.props.onChange(this.state, { event: 'handleOnError', fieldType: cbObj.fieldType });\n }\n );\n\n return true;\n}\n\nfunction handleFocus(cbObj: CardFocusData): void {\n this.numCharsInField[cbObj.fieldType] = cbObj.numChars;\n\n this.props.onFocus(cbObj);\n}\n\nfunction handleOnTouchstartIOS(cbObj): void {\n // disableIOSArrowKeys is either null or a function (in which case we should call it)\n this.props.disableIOSArrowKeys?.(cbObj);\n}\n\n// Only called for holder name (from CSF>partials>processAutoComplete)\nfunction handleOnAutoComplete(cbObj: CardAutoCompleteData): void {\n this.setState({ autoCompleteName: cbObj.value }, () => {\n this.props.onChange(this.state, { event: 'handleOnAutoComplete', fieldType: cbObj.fieldType });\n this.setState({ autoCompleteName: null }); // Nullify ref after sending it (lets shopper edit holder name)\n });\n this.props.onAutoComplete(cbObj);\n}\n\nfunction handleKeyPressed(obj: SFKeyPressObj): void {\n if (obj.action === 'enterKeyPressed') {\n const kb = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Enter',\n code: 'Enter'\n });\n this.props.handleKeyPress?.(kb);\n }\n}\n\n/**\n * Handles cases where no secured fields are necessary (one click payments without CVC)\n * Automatically resolves with a valid state\n */\nfunction handleOnNoDataRequired(): void {\n this.setState({ status: 'ready' }, () => this.props.onChange({ isSfpValid: true }));\n}\n\nexport default {\n handleFocus,\n handleOnAllValid,\n handleOnAutoComplete,\n handleOnFieldValid,\n handleOnLoad,\n handleOnConfigSuccess,\n handleOnBrand,\n handleOnError,\n handleOnNoDataRequired,\n handleOnTouchstartIOS,\n handleKeyPressed\n};\n"],"names":["fieldIsInError","fieldType","policy","numCharsObj","errorsObj","OPTIONAL","HIDDEN","handlers","handleFocus","cbObj","this","numCharsInField","numChars","props","onFocus","handleOnAllValid","status","state","detectedUnsupportedBrands","setState","isSfpValid","allValid","onChange","event","onAllValid","handleOnAutoComplete","autoCompleteName","value","onAutoComplete","handleOnFieldValid","fieldObj","ENCRYPTED_CARD_NUMBER","prevState","data","encryptedFieldName","blob","valid","errors","onFieldValid","handleOnLoad","clearTimeout","csfLoadFailTimeout","onLoad","csfConfigFailTimeout","setTimeout","onError","AdyenCheckoutError","csfConfigFailTimeoutMS","handleOnConfigSuccess","onConfigSuccess","handleOnBrand","cardInfo","cvcFieldInError","ENCRYPTED_SECURITY_CODE","cvcPolicy","dateFieldInError","numDateFields","ENCRYPTED_EXPIRY_DATE","expiryDatePolicy","monthFieldInError","ENCRYPTED_EXPIRY_MONTH","yearFieldInError","ENCRYPTED_EXPIRY_YEAR","brand","CVC_POLICY_REQUIRED","showSocialSecurityNumber","existy","DATE_POLICY_REQUIRED","brandImageUrl","brandsConfiguration","icon","getCardImageUrl","resources","onBrand","handleOnError","hasUnsupportedCard","errorCode","error","undefined","handleOnNoDataRequired","handleOnTouchstartIOS","disableIOSArrowKeys","handleKeyPressed","obj","action","kb","KeyboardEvent","bubbles","cancelable","key","code","handleKeyPress"],"mappings":"6ZA0HA,SAASA,EAAeC,EAAmBC,EAAgBC,EAAqBC,GAC5E,OAAQF,IAAWG,GAAYH,IAAWI,GAAsC,IAA3BH,EAAYF,KAA2BG,EAAUH,EAC1G,CAwHA,IAAA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,mBAG9C,EAwEIM,cAnEJ,SAAuBjE,EAAsBkE,EAA8B,MACvE,MAAMC,EAAYnE,EAAMoE,MAexB,OAbAnE,KAAKS,SACDa,KACIK,OAAQ,IAAKL,EAAUK,OAAQ,CAAC5B,EAAMR,WAAY2E,IAAa,MAE3DD,GAAsB,CAAE1C,KAAM,IAAKD,EAAUC,KAAMF,CAACA,QAAwB+C,OAC5EH,GAAsB,CAAEvC,MAAO,IAAKJ,EAAUI,MAAOL,CAACA,IAAwB,OAC9E4C,GAAsB,CAAEvD,YAAY,KAE5C,KACIV,KAAKG,MAAMS,SAASZ,KAAKO,MAAO,CAAEM,MAAO,gBAAiBtB,UAAWQ,EAAMR,eAI5E,CACX,EAmDI8E,uBAbJ,WACIrE,KAAKS,SAAS,CAAEH,OAAQ,SAAW,IAAMN,KAAKG,MAAMS,SAAS,CAAEF,YAAY,IAC/E,EAYI4D,sBA5CJ,SAA+BvE,GAE3BC,KAAKG,MAAMoE,sBAAsBxE,EACrC,EA0CIyE,iBA/BJ,SAA0BC,GACtB,GAAmB,oBAAfA,EAAIC,OAA8B,CAClC,MAAMC,EAAK,IAAIC,cAAc,WAAY,CACrCC,SAAS,EACTC,YAAY,EACZC,IAAK,QACLC,KAAM,UAEVhF,KAAKG,MAAM8E,iBAAiBN,EAChC,CACJ"}
|
|
1
|
+
{"version":3,"file":"SecuredFieldsProviderHandlers.js","sources":["../../../../../../src/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.ts"],"sourcesContent":["import { getCardImageUrl } from '../utils';\nimport {\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_CARD_NUMBER,\n CVC_POLICY_REQUIRED,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE,\n OPTIONAL,\n HIDDEN,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR\n} from '../lib/constants';\nimport {\n CardErrorData,\n CardFocusData,\n CardBrandData,\n CardAllValidData,\n CardFieldValidData,\n CardAutoCompleteData,\n CardConfigSuccessData,\n CardLoadData,\n SFKeyPressObj\n} from '../lib/types';\nimport { existy } from '../../../../utils/commonUtils';\nimport AdyenCheckoutError from '../../../../core/Errors/AdyenCheckoutError';\n\n/**\n * Emits the onLoad event\n * Here we can assume all securedFields iframes have fired their 'load' event\n */\nfunction handleOnLoad(cbObj: CardLoadData): void {\n // Clear 'loading' timeout\n clearTimeout(this.csfLoadFailTimeout);\n this.csfLoadFailTimeout = null;\n\n // Propagate onLoad event\n this.props.onLoad(cbObj);\n\n /**\n * Having seen that the securedFields iframes have loaded some kind of content (we don't know what, yet)\n * - setTimeout since we expect to get a successful configuration message \"within a reasonable time\"\n *\n * Now we catch clientKey & environment mismatch in core.ts - this timeout being called indicates that the securedFields have not all configured\n * - so we need to clear the loading spinner to see if the securedFields are reporting anything\n */\n this.csfConfigFailTimeout = setTimeout(() => {\n if (this.state.status !== 'ready') {\n // Hide the spinner\n this.setState({ status: 'csfConfigFailure' });\n // Report the error\n this.props.onError(new AdyenCheckoutError('ERROR', 'secured fields have failed to configure'));\n }\n }, this.csfConfigFailTimeoutMS);\n}\n\n/**\n * Emits the onConfigSuccess (ready) event\n * Here we can assume CSF is loaded, configured and ready to be used\n */\nfunction handleOnConfigSuccess(cbObj: CardConfigSuccessData): void {\n // Clear 'config' timeout\n clearTimeout(this.csfConfigFailTimeout);\n this.csfConfigFailTimeout = null;\n\n this.setState({ status: 'ready' }, () => {\n // Propagate onConfigSuccess event\n this.props.onConfigSuccess(cbObj);\n });\n}\n\n/**\n * Emits the onAllValid event\n */\nfunction handleOnAllValid(status: CardAllValidData): boolean {\n // Form cannot be valid whilst there is an unsupported card\n if (this.state.detectedUnsupportedBrands) {\n return false;\n }\n\n this.setState({ isSfpValid: status.allValid }, () => {\n // New - fixes maestro-with-error-on-optional-cvc-field bug\n this.props.onChange(this.state, { event: 'handleOnAllValid' });\n // Propagate onAllValid event\n this.props.onAllValid(status);\n });\n\n return true;\n}\n\n/**\n * Saves a field value from CSF in the CardInput state\n * Emits the onFieldValid event\n */\nfunction handleOnFieldValid(fieldObj: CardFieldValidData): boolean {\n // A card number field cannot be valid whilst there is an unsupported card\n if (this.state.detectedUnsupportedBrands && fieldObj.fieldType === ENCRYPTED_CARD_NUMBER) {\n return false;\n }\n\n const setValidFieldState = prevState => ({\n data: { ...prevState.data, [fieldObj.encryptedFieldName]: fieldObj.blob },\n valid: { ...prevState.valid, [fieldObj.encryptedFieldName]: fieldObj.valid },\n /**\n * For a field that has just received valid:true (field has just been completed & encrypted) - mark the error state for this field as false\n * For a field that has just received valid:false (field was encrypted, now is not)\n * - field is either in a state of being incomplete but without errors (digit deleted) - so mark the error state for this field as false\n * or has switched from valid/encrypted state to being in error (digit edited to one that puts the field in error) - so keep any error that\n * might just have been set\n */\n errors: { ...prevState.errors, [fieldObj.fieldType]: prevState.errors[fieldObj.fieldType] ?? null }\n });\n\n this.setState(setValidFieldState, () => {\n this.props.onChange(this.state, { event: 'handleOnFieldValid', fieldType: fieldObj.fieldType });\n\n // Propagate onFieldValid event\n this.props.onFieldValid(fieldObj);\n });\n\n return true;\n}\n\nfunction fieldIsInError(fieldType: string, policy: string, numCharsObj: object, errorsObj) {\n return (policy === OPTIONAL || policy === HIDDEN) && numCharsObj[fieldType] === 0 ? false : errorsObj[fieldType];\n}\n\n/**\n * Saves the card brand in state\n * Emits the onBrand event\n */\nfunction handleOnBrand(cardInfo: CardBrandData): void {\n this.setState(\n prevState => {\n /**\n * If we change brand to one where the cvc or date field(s) are not required & are empty - then these fields cannot be in error\n * (scenario: have validated empty form, then choose brand w. optional/hidden cvc or date)...\n * ...else propagate the existing error.\n */\n const cvcFieldInError = fieldIsInError(ENCRYPTED_SECURITY_CODE, cardInfo.cvcPolicy, this.numCharsInField, prevState.errors);\n\n const dateFieldInError =\n this.numDateFields === 1\n ? fieldIsInError(ENCRYPTED_EXPIRY_DATE, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n\n // For custom card comp\n const monthFieldInError =\n this.numDateFields === 2\n ? fieldIsInError(ENCRYPTED_EXPIRY_MONTH, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n\n const yearFieldInError =\n this.numDateFields === 2\n ? fieldIsInError(ENCRYPTED_EXPIRY_YEAR, cardInfo.expiryDatePolicy, this.numCharsInField, prevState.errors)\n : null;\n // --\n /** end */\n\n return {\n brand: cardInfo.brand,\n cvcPolicy: cardInfo.cvcPolicy ?? CVC_POLICY_REQUIRED,\n showSocialSecurityNumber: cardInfo.showSocialSecurityNumber,\n errors: {\n ...prevState.errors,\n ...(existy(cvcFieldInError) && { [ENCRYPTED_SECURITY_CODE]: cvcFieldInError }),\n ...(existy(dateFieldInError) && { [ENCRYPTED_EXPIRY_DATE]: dateFieldInError }),\n ...(existy(monthFieldInError) && { [ENCRYPTED_EXPIRY_MONTH]: monthFieldInError }),\n ...(existy(yearFieldInError) && { [ENCRYPTED_EXPIRY_YEAR]: yearFieldInError })\n },\n expiryDatePolicy: cardInfo.expiryDatePolicy ?? DATE_POLICY_REQUIRED\n };\n },\n () => {\n this.props.onChange(this.state, { event: 'handleOnBrand' });\n\n // Enhance data object with the url for the brand image, first checking if the merchant has configured their own one for this brand\n const brandImageUrl = this.props.brandsConfiguration[cardInfo.brand]?.icon ?? getCardImageUrl(cardInfo.brand, this.props.resources);\n this.props.onBrand({ ...cardInfo, brandImageUrl });\n }\n );\n}\n\n/**\n * Handles validation errors\n */\nfunction handleOnError(cbObj: CardErrorData, hasUnsupportedCard: boolean = null): boolean {\n const errorCode = cbObj.error;\n\n this.setState(\n prevState => ({\n errors: { ...prevState.errors, [cbObj.fieldType]: errorCode || null },\n // If dealing with an unsupported card ensure these card number related fields are reset re. pasting a full, unsupported card straight in\n ...(hasUnsupportedCard && { data: { ...prevState.data, [ENCRYPTED_CARD_NUMBER]: undefined } }),\n ...(hasUnsupportedCard && { valid: { ...prevState.valid, [ENCRYPTED_CARD_NUMBER]: false } }),\n ...(hasUnsupportedCard && { isSfpValid: false })\n }),\n () => {\n this.props.onChange(this.state, { event: 'handleOnError', fieldType: cbObj.fieldType });\n }\n );\n\n return true;\n}\n\nfunction handleFocus(cbObj: CardFocusData): void {\n this.numCharsInField[cbObj.fieldType] = cbObj.numChars;\n\n this.props.onFocus(cbObj);\n}\n\nfunction handleOnTouchstartIOS(cbObj): void {\n // disableIOSArrowKeys is either null or a function (in which case we should call it)\n this.props.disableIOSArrowKeys?.(cbObj);\n}\n\n// Only called for holder name (from CSF>partials>processAutoComplete)\nfunction handleOnAutoComplete(cbObj: CardAutoCompleteData): void {\n this.setState({ autoCompleteName: cbObj.value }, () => {\n this.props.onChange(this.state, { event: 'handleOnAutoComplete', fieldType: cbObj.fieldType });\n this.setState({ autoCompleteName: null }); // Nullify ref after sending it (lets shopper edit holder name)\n });\n this.props.onAutoComplete(cbObj);\n}\n\nfunction handleKeyPressed(obj: SFKeyPressObj): void {\n if (obj.action === 'enterKeyPressed') {\n const kb = new KeyboardEvent('keypress', {\n bubbles: true,\n cancelable: true,\n key: 'Enter',\n code: 'Enter'\n });\n this.props.handleKeyPress?.(kb);\n }\n}\n\n/**\n * Handles cases where no secured fields are necessary (one click payments without CVC)\n * Automatically resolves with a valid state\n */\nfunction handleOnNoDataRequired(): void {\n this.setState({ status: 'ready' }, () => this.props.onChange({ isSfpValid: true }));\n}\n\nexport default {\n handleFocus,\n handleOnAllValid,\n handleOnAutoComplete,\n handleOnFieldValid,\n handleOnLoad,\n handleOnConfigSuccess,\n handleOnBrand,\n handleOnError,\n handleOnNoDataRequired,\n handleOnTouchstartIOS,\n handleKeyPressed\n};\n"],"names":["fieldIsInError","fieldType","policy","numCharsObj","errorsObj","OPTIONAL","HIDDEN","handlers","handleFocus","cbObj","this","numCharsInField","numChars","props","onFocus","handleOnAllValid","status","state","detectedUnsupportedBrands","setState","isSfpValid","allValid","onChange","event","onAllValid","handleOnAutoComplete","autoCompleteName","value","onAutoComplete","handleOnFieldValid","fieldObj","ENCRYPTED_CARD_NUMBER","prevState","data","encryptedFieldName","blob","valid","errors","onFieldValid","handleOnLoad","clearTimeout","csfLoadFailTimeout","onLoad","csfConfigFailTimeout","setTimeout","onError","AdyenCheckoutError","csfConfigFailTimeoutMS","handleOnConfigSuccess","onConfigSuccess","handleOnBrand","cardInfo","cvcFieldInError","ENCRYPTED_SECURITY_CODE","cvcPolicy","dateFieldInError","numDateFields","ENCRYPTED_EXPIRY_DATE","expiryDatePolicy","monthFieldInError","ENCRYPTED_EXPIRY_MONTH","yearFieldInError","ENCRYPTED_EXPIRY_YEAR","brand","CVC_POLICY_REQUIRED","showSocialSecurityNumber","existy","DATE_POLICY_REQUIRED","brandImageUrl","brandsConfiguration","icon","getCardImageUrl","resources","onBrand","handleOnError","hasUnsupportedCard","errorCode","error","undefined","handleOnNoDataRequired","handleOnTouchstartIOS","disableIOSArrowKeys","handleKeyPressed","obj","action","kb","KeyboardEvent","bubbles","cancelable","key","code","handleKeyPress"],"mappings":"6ZA0HA,SAASA,EAAeC,EAAmBC,EAAgBC,EAAqBC,GAC5E,OAAQF,IAAWG,GAAYH,IAAWI,GAAsC,IAA3BH,EAAYF,KAA2BG,EAAUH,EAC1G,CAwHA,IAAAM,EAAe,CACXC,YAzCJ,SAAqBC,GACjBC,KAAKC,gBAAgBF,EAAMR,WAAaQ,EAAMG,SAE9CF,KAAKG,MAAMC,QAAQL,EACvB,EAsCIM,iBA7KJ,SAA0BC,GAEtB,OAAIN,KAAKO,MAAMC,4BAIfR,KAAKS,SAAS,CAAEC,WAAYJ,EAAOK,UAAY,KAE3CX,KAAKG,MAAMS,SAASZ,KAAKO,MAAO,CAAEM,MAAO,qBAEzCb,KAAKG,MAAMW,WAAWR,MAGnB,EACX,EAgKIS,qBA/BJ,SAA8BhB,GAC1BC,KAAKS,SAAS,CAAEO,iBAAkBjB,EAAMkB,OAAS,KAC7CjB,KAAKG,MAAMS,SAASZ,KAAKO,MAAO,CAAEM,MAAO,uBAAwBtB,UAAWQ,EAAMR,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OAAQ,SAAW,IAAMN,KAAKG,MAAMS,SAAS,CAAEF,YAAY,IAC/E,EAYI4D,sBA5CJ,SAA+BvE,GAE3BC,KAAKG,MAAMoE,sBAAsBxE,EACrC,EA0CIyE,iBA/BJ,SAA0BC,GACtB,GAAmB,oBAAfA,EAAIC,OAA8B,CAClC,MAAMC,EAAK,IAAIC,cAAc,WAAY,CACrCC,SAAS,EACTC,YAAY,EACZC,IAAK,QACLC,KAAM,UAEVhF,KAAKG,MAAM8E,iBAAiBN,EAChC,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{select as e,getAttribute as t}from"../../utilities/dom.js";import{DATA_ENCRYPTED_FIELD_ATTR as i,
|
|
1
|
+
import{select as e,getAttribute as t}from"../../utilities/dom.js";import{DATA_ENCRYPTED_FIELD_ATTR as i,CVC_POLICY_REQUIRED as s,DATE_POLICY_REQUIRED as o,ENCRYPTED_EXPIRY_YEAR as n,SF_CONFIG_TIMEOUT as r,DATA_UID as a,DATA_INFO as d}from"../../constants.js";import{existy as l}from"../../../../../../utils/commonUtils.js";import c from"../utils/cardType.js";import h from"../../securedField/SecuredField.js";import p from"../../../../../../core/Errors/AdyenCheckoutError.js";import{isSecuredField as u}from"../../../utils.js";function f(){this.encryptedAttrName=i;const n=e(this.props.rootNode,`[${this.encryptedAttrName}]`).filter(e=>{const i=t(e,this.encryptedAttrName),s=u(i);return s||console.warn(`WARNING: '${i}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),s}),r=s,a=o;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(n,r,a),n.length):(this.createNonCardSecuredFields(n),n.length)}async function m(e){for(let t=0;t<e.length;t++){const i=e[t];await this.setupSecuredField(i).catch(e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)})}}async function y(e,t,i){let n=this.state.type;if("card"===n&&1===this.config.cardGroupTypes.length&&(n=this.config.cardGroupTypes[0],this.state.type=n),this.isSingleBrandedCard="card"!==n,this.isSingleBrandedCard){const e=c.getCardByBrand(n);l(e)?(t=e.cvcPolicy||s,i=e.expiryDatePolicy||o,this.securityCode=e.securityCode):this.state.type="unrecognised-single-brand"}for(let s=0;s<e.length;s++){const o=e[s];window._b$dl&&console.log("\nAbout to set up securedField:",o),await this.setupSecuredField(o,t,i).catch(e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)}),window._b$dl&&console.log("Finished setting up securedField:",o)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const e={type:this.state.type,rootNode:this.props.rootNode,brand:n,cvcPolicy:t,expiryDatePolicy:i,cvcText:this.securityCode};setTimeout(()=>{this.callbacks.onBrand(e)},0)}}function g(e,i,s){return new Promise((o,l)=>{const c=t(e,this.encryptedAttrName);c===n&&(this.state.hasSeparateDateFields=!0);const u={fieldType:c,extraFieldData:t(e,d),uid:t(e,a),cvcPolicy:i,holderEl:e,expiryDatePolicy:s,txVariant:this.state.type,cardGroupTypes:this.config.cardGroupTypes,iframeUIConfig:this.config.iframeUIConfig,sfLogAtStart:this.config.sfLogAtStart,trimTrailingSeparator:this.config.trimTrailingSeparator,isCreditCardType:this.config.isCreditCardType,iframeSrc:this.config.iframeSrc,loadingContext:this.config.loadingContext,showWarnings:this.config.showWarnings,legacyInputMode:this.config.legacyInputMode,minimumExpiryDate:this.config.minimumExpiryDate,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,disableIOSArrowKeys:this.props.shouldDisableIOSArrowKeys,implementationType:this.props.implementationType,showContextualElement:this.props.showContextualElement,placeholders:this.props.placeholders,submitAnalytics:this.props.onSubmitAnalytics,componentType:this.props.componentType},f=new h(u,this.props.i18n).onIframeLoaded(()=>{if(this.state.iframeCount+=1,window._b$dl&&console.log("### createSecuredFields::onIframeLoaded:: this.state.iframeCount=",this.state.iframeCount),this.state.iframeCount>this.state.numIframes)throw this.destroySecuredFields(),new p("ERROR",`One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(f.loadToConfigTimeout=setTimeout(()=>{l({type:u.fieldType,failReason:"sf took too long to config"})},r),this.state.iframeCount===this.state.originalNumIframes){const e={iframesLoaded:!0};this.callbacks.onLoad(e)}}).onConfig(e=>{this.handleIframeConfigFeedback(e),clearTimeout(f.loadToConfigTimeout),f.loadToConfigTimeout=null,o(e)}).onFocus(e=>{this.handleFocus(e)}).onBinValue(e=>{this.handleBinValue(e)}).onTouchstart(e=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||e.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:e.fieldType}),(e.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:e.fieldType,fieldClick:!0})}).onShiftTab(e=>{this.handleSFShiftTab(e.fieldType)}).onEncryption(e=>{this.handleEncryption(e)}).onValidation(e=>{this.handleValidation(e)}).onAutoComplete(e=>{this.processAutoComplete(e)}).onKeyPressed(e=>{const{numKey:t,...i}=e;this.callbacks.onKeyPressed(i)});this.state.securedFields[c]=f})}export{y as createCardSecuredFields,m as createNonCardSecuredFields,f as createSecuredFields,g as setupSecuredField};
|
|
2
2
|
//# sourceMappingURL=createSecuredFields.js.map
|
package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSecuredFields.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.ts"],"sourcesContent":["import { select, getAttribute } from '../../utilities/dom';\nimport {\n ENCRYPTED_EXPIRY_YEAR,\n DATE_POLICY_REQUIRED,\n CVC_POLICY_REQUIRED,\n DATA_ENCRYPTED_FIELD_ATTR,\n DATA_INFO,\n DATA_UID,\n SF_CONFIG_TIMEOUT,\n ALL_SECURED_FIELDS,\n ENCRYPTED_EXPIRY_MONTH\n} from '../../constants';\nimport { existy } from '../../../../../../utils/commonUtils';\nimport cardType from '../utils/cardType';\nimport { SecuredFieldSetupObject } from '../../types';\nimport SecuredField from '../../securedField/SecuredField';\nimport { CardObject, CardBrandData, SFFeedbackObj, CardLoadData, CVCPolicyType, DatePolicyType } from '../../types';\nimport AdyenCheckoutError from '../../../../../../core/Errors/AdyenCheckoutError';\nimport type { SFKeyPressObj } from '../../types';\n\n/**\n * Bound to the instance of CSF\n * Handles specific functionality related to configuring & creating SecuredFields\n */\nexport function createSecuredFields(): number {\n this.encryptedAttrName = DATA_ENCRYPTED_FIELD_ATTR;\n\n // Detect DOM elements that qualify as securedField holders & filter them for valid types\n const securedFields: HTMLElement[] = select(this.props.rootNode, `[${this.encryptedAttrName}]`).filter(field => {\n const fieldType: string = getAttribute(field, this.encryptedAttrName);\n\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n // TODO send analytics about separate date fields\n }\n\n const isValidType = ALL_SECURED_FIELDS.includes(fieldType);\n if (!isValidType) {\n console.warn(\n `WARNING: '${fieldType}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`\n );\n }\n return isValidType;\n });\n\n /**\n * cvcPolicy - 'required' | 'optional' | 'hidden'\n * - Always 'required' for GiftCards\n * - Usually 'required' for single branded Credit Cards but with exceptions e.g. maestro ('optional'), bcmc ('hidden').\n * - Always 'required' for generic Credit Cards at start up - in this case, subsequent, supporting information about whether cvc stops being required\n * comes from the SF in the brand information (as the shopper inputs the cc number)\n */\n const cvcPolicy: CVCPolicyType = CVC_POLICY_REQUIRED;\n\n /** Usually 'required' for single branded Credit Cards but with exceptions e.g. ticket ('hidden', *technically* a meal voucher) */\n const expiryDatePolicy: DatePolicyType = DATE_POLICY_REQUIRED;\n\n // CHECK IF THIS SECURED FIELD IS NOT OF A CREDIT CARD TYPE\n if (!this.config.isCreditCardType) {\n this.createNonCardSecuredFields(securedFields);\n return securedFields.length;\n }\n\n // CONTINUE AS CREDIT-CARD TYPE...\n this.isSingleBrandedCard = false;\n\n this.securityCode = '';\n\n this.createCardSecuredFields(securedFields, cvcPolicy, expiryDatePolicy);\n\n // Return the number of iframes we're going to create\n return securedFields.length;\n}\n\n/**\n * i.e. giftcard and ach fields\n *\n * Create a new SecuredField for each detected holding element\n */\nexport async function createNonCardSecuredFields(securedFields: HTMLElement[]): Promise<any> {\n for (let i = 0; i < securedFields.length; i++) {\n const securedField = securedFields[i];\n await this.setupSecuredField(securedField).catch(e => {\n if (window._b$dl) console.log('Secured fields setup failure. e=', e);\n });\n }\n}\n\nexport async function createCardSecuredFields(\n securedFields: HTMLElement[],\n cvcPolicy: CVCPolicyType,\n expiryDatePolicy: DatePolicyType\n): Promise<any> {\n // Declared card type from the initialisation of CSF\n let type: string = this.state.type;\n\n // Maybe it's a single branded card defined by setting type: 'card' & a single item in cardGroupTypes\n // In which case update the type var both locally AND in State\n if (type === 'card' && this.config.cardGroupTypes.length === 1) {\n type = this.config.cardGroupTypes[0];\n this.state.type = type;\n }\n\n // So, is it a single branded card?\n this.isSingleBrandedCard = type !== 'card';\n\n // If single branded card field...\n if (this.isSingleBrandedCard) {\n // Check that type exists\n const card: CardObject = cardType.getCardByBrand(type);\n\n // It's possible we don't recognise the card type -\n // scenario: frontend initially recognises card as e.g. Visa - but then backend tokenises it as a sub-brand which we currently don't recognise\n if (!existy(card)) {\n this.state.type = 'unrecognised-single-brand'; // Will let CVC field accept 4 digits in the input\n } else {\n // Assess whether cvc field is required based on the card type & whether the cvc field should even be visible\n cvcPolicy = card.cvcPolicy || CVC_POLICY_REQUIRED;\n expiryDatePolicy = card.expiryDatePolicy || DATE_POLICY_REQUIRED;\n\n this.securityCode = card.securityCode;\n }\n }\n\n /**\n * Create a new SecuredField for each detected holding element\n *\n * - we do this in sequence, waiting until one has configured before creating the next.\n * We do it this way to avoid the 'bug' whereby if something interrupts the loading of an iframe the listener we have for its load event\n * never fires; which means the iframe never configures.\n * (NB - you can recreate this 'bug' by creating the securedFields in a synchronous loop:\n * securedFields.forEach(this.setupSecuredField.bind(this));\n * and putting a breakpoint on the line where we declare the setupSecuredField function)\n *\n * Also note we tried the Array.map/Promise.all way of asynchronously looping through an array - but it didn't fix the issue,\n * - so we fall back to a good old for-loop\n */\n for (let i = 0; i < securedFields.length; i++) {\n const securedField = securedFields[i];\n if (window._b$dl) console.log('\\nAbout to set up securedField:', securedField);\n await this.setupSecuredField(securedField, cvcPolicy, expiryDatePolicy).catch(e => {\n if (window._b$dl) console.log('Secured fields setup failure. e=', e);\n });\n if (window._b$dl) console.log('Finished setting up securedField:', securedField);\n }\n if (window._b$dl) console.log('Finished setting up all securedFields');\n\n /**\n * Now the securedFields have all been created and configured...\n *\n * For a single branded card we call to onBrand callback once.\n * This allows the UI to set the correct logo if they haven't already,\n * and we also pass the cvcPolicy & expiryDatePolicy so the UI can hide the iframe holders if necessary\n */\n if (this.isSingleBrandedCard) {\n const callbackObj: CardBrandData = {\n type: this.state.type,\n rootNode: this.props.rootNode,\n brand: type,\n cvcPolicy,\n expiryDatePolicy,\n cvcText: this.securityCode\n };\n\n // Allow a tick for the securedField to finish rendering\n setTimeout(() => {\n this.callbacks.onBrand(callbackObj);\n }, 0);\n }\n}\n\n// Run for each detected holder of a securedField...\nexport function setupSecuredField(pItem: HTMLElement, cvcPolicy?: CVCPolicyType, expiryDatePolicy?: DatePolicyType): Promise<any> {\n return new Promise((resolve, reject) => {\n /**\n * possible values:\n * encryptedCardNumber\n * encryptedExpiryDate\n * encryptedExpiryMonth\n * encryptedExpiryYear\n * encryptedSecurityCode\n * encryptedPassword\n * encryptedPin???\n * encryptedBankAccountNumber\n * encryptedBankLocationId\n * encryptedIBAN\n */\n const fieldType: string = getAttribute(pItem, this.encryptedAttrName);\n\n if (fieldType === ENCRYPTED_EXPIRY_YEAR) {\n this.state.hasSeparateDateFields = true;\n }\n\n const extraFieldData: string = getAttribute(pItem, DATA_INFO);\n const uid = getAttribute(pItem, DATA_UID);\n\n // CREATE SecuredField passing config object\n const sfInitObj: SecuredFieldSetupObject = {\n fieldType,\n extraFieldData,\n uid,\n cvcPolicy,\n holderEl: pItem,\n expiryDatePolicy,\n txVariant: this.state.type,\n // from this.config (calculated)\n cardGroupTypes: this.config.cardGroupTypes,\n iframeUIConfig: this.config.iframeUIConfig,\n sfLogAtStart: this.config.sfLogAtStart,\n trimTrailingSeparator: this.config.trimTrailingSeparator,\n isCreditCardType: this.config.isCreditCardType,\n iframeSrc: this.config.iframeSrc,\n loadingContext: this.config.loadingContext,\n showWarnings: this.config.showWarnings,\n legacyInputMode: this.config.legacyInputMode,\n minimumExpiryDate: this.config.minimumExpiryDate,\n // from this.props (passed straight thru)\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n disableIOSArrowKeys: this.props.shouldDisableIOSArrowKeys,\n implementationType: this.props.implementationType,\n showContextualElement: this.props.showContextualElement,\n placeholders: this.props.placeholders,\n submitAnalytics: this.props.onSubmitAnalytics,\n componentType: this.props.componentType\n };\n\n const sf: SecuredField = new SecuredField(sfInitObj, this.props.i18n)\n .onIframeLoaded((): void => {\n // Count\n this.state.iframeCount += 1;\n\n if (window._b$dl) console.log('### createSecuredFields::onIframeLoaded:: this.state.iframeCount=', this.state.iframeCount);\n\n // One of our existing securedFields has just loaded new content!\n if (this.state.iframeCount > this.state.numIframes) {\n this.destroySecuredFields();\n // TODO send analytics about this error\n throw new AdyenCheckoutError(\n 'ERROR',\n `One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`\n );\n }\n\n /** Create timeout within which time we expect the securedField to configure */\n // @ts-ignore - timeout 'type' *is* a number\n sf.loadToConfigTimeout = setTimeout(() => {\n reject({ type: sfInitObj.fieldType, failReason: 'sf took too long to config' });\n }, SF_CONFIG_TIMEOUT);\n\n // If all iframes are loaded - call onLoad callback\n if (this.state.iframeCount === this.state.originalNumIframes) {\n const callbackObj: CardLoadData = { iframesLoaded: true };\n this.callbacks.onLoad(callbackObj);\n }\n })\n .onConfig((pFeedbackObj: SFFeedbackObj): void => {\n this.handleIframeConfigFeedback(pFeedbackObj);\n\n // Clear timeout since the securedField has configured\n clearTimeout(sf.loadToConfigTimeout);\n sf.loadToConfigTimeout = null;\n\n resolve(pFeedbackObj);\n })\n .onFocus((pFeedbackObj: SFFeedbackObj): void => {\n this.handleFocus(pFeedbackObj);\n })\n .onBinValue((pFeedbackObj: SFFeedbackObj): void => {\n this.handleBinValue(pFeedbackObj);\n })\n .onTouchstart((pFeedbackObj: SFFeedbackObj): void => {\n // re. Disabling arrow keys in iOS - need to disable all other fields in the form\n if (this.props.shouldDisableIOSArrowKeys) {\n /**\n * re. this.hasGenuineTouchEvents...\n * There seems to be an issue with Responsive Design mode in Safari that means it allows setting focus on cross-origin iframes,\n * without enabling the touch events that allow the \"disableIOSArrowKeys\" workaround to fully function.\n * This results in a click on an securedFields *label* leading to, for example, the holderName field being disabled, but w/o access\n * to the touch events that would let it re-enable itself.\n *\n * So we prevent the \"disableIOSArrowKeys\" workaround unless we genuinely have touch events available.\n */\n if (this.hasGenuineTouchEvents || pFeedbackObj.hasGenuineTouchEvents) {\n this.callbacks.onTouchstartIOS({ fieldType: pFeedbackObj.fieldType });\n }\n }\n\n // Only perform this step if we genuinely have touch events available\n if (pFeedbackObj.hasGenuineTouchEvents || this.hasGenuineTouchEvents) {\n // iOS ONLY - RE. iOS BUGS AROUND BLUR AND FOCUS EVENTS\n // - pass information about which field has just been clicked (gained focus) to the other iframes\n this.postMessageToAllIframes({ fieldType: pFeedbackObj.fieldType, fieldClick: true });\n }\n })\n .onShiftTab((pFeedbackObj: SFFeedbackObj): void => {\n // Only happens for Firefox & IE <= 11\n this.handleSFShiftTab(pFeedbackObj.fieldType);\n })\n .onEncryption((pFeedbackObj: SFFeedbackObj): void => {\n this.handleEncryption(pFeedbackObj);\n })\n .onValidation((pFeedbackObj: SFFeedbackObj): void => {\n this.handleValidation(pFeedbackObj);\n })\n .onAutoComplete((pFeedbackObj: SFFeedbackObj): void => {\n this.processAutoComplete(pFeedbackObj);\n })\n .onKeyPressed((pFeedbackObj: SFFeedbackObj): void => {\n const { numKey, ...rest } = pFeedbackObj;\n this.callbacks.onKeyPressed(rest as SFKeyPressObj);\n });\n\n // Store reference to securedField in this.state (under fieldType)\n this.state.securedFields[fieldType] = sf;\n });\n}\n"],"names":["createSecuredFields","this","encryptedAttrName","DATA_ENCRYPTED_FIELD_ATTR","securedFields","select","props","rootNode","filter","field","fieldType","getAttribute","isValidType","ALL_SECURED_FIELDS","includes","console","warn","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","config","isCreditCardType","isSingleBrandedCard","securityCode","createCardSecuredFields","length","createNonCardSecuredFields","async","i","securedField","setupSecuredField","catch","e","window","_b$dl","log","type","state","cardGroupTypes","card","cardType","getCardByBrand","existy","callbackObj","brand","cvcText","setTimeout","callbacks","onBrand","pItem","Promise","resolve","reject","ENCRYPTED_EXPIRY_YEAR","hasSeparateDateFields","sfInitObj","extraFieldData","DATA_INFO","uid","DATA_UID","holderEl","txVariant","iframeUIConfig","sfLogAtStart","trimTrailingSeparator","iframeSrc","loadingContext","showWarnings","legacyInputMode","minimumExpiryDate","maskSecurityCode","exposeExpiryDate","disableIOSArrowKeys","shouldDisableIOSArrowKeys","implementationType","showContextualElement","placeholders","submitAnalytics","onSubmitAnalytics","componentType","sf","SecuredField","i18n","onIframeLoaded","iframeCount","numIframes","destroySecuredFields","AdyenCheckoutError","loadToConfigTimeout","failReason","SF_CONFIG_TIMEOUT","originalNumIframes","iframesLoaded","onLoad","onConfig","pFeedbackObj","handleIframeConfigFeedback","clearTimeout","onFocus","handleFocus","onBinValue","handleBinValue","onTouchstart","hasGenuineTouchEvents","onTouchstartIOS","postMessageToAllIframes","fieldClick","onShiftTab","handleSFShiftTab","onEncryption","handleEncryption","onValidation","handleValidation","onAutoComplete","processAutoComplete","onKeyPressed","numKey","rest"],"mappings":"of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C,WAAYZ,IAET/F,KAAK4G,iBAAiBb,EAAatF,aAEtCoG,aAAcd,IACX/F,KAAK8G,iBAAiBf,KAEzBgB,aAAchB,IACX/F,KAAKgH,iBAAiBjB,KAEzBkB,eAAgBlB,IACb/F,KAAKkH,oBAAoBnB,KAE5BoB,aAAcpB,IACX,MAAMqB,OAAEA,KAAWC,GAAStB,EAC5B/F,KAAK+C,UAAUoE,aAAaE,KAIpCrH,KAAKqC,MAAMlC,cAAcM,GAAauE,GAE9C"}
|
|
1
|
+
{"version":3,"file":"createSecuredFields.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.ts"],"sourcesContent":["import { select, getAttribute } from '../../utilities/dom';\nimport {\n ENCRYPTED_EXPIRY_YEAR,\n DATE_POLICY_REQUIRED,\n CVC_POLICY_REQUIRED,\n DATA_ENCRYPTED_FIELD_ATTR,\n DATA_INFO,\n DATA_UID,\n SF_CONFIG_TIMEOUT,\n ENCRYPTED_EXPIRY_MONTH\n} from '../../constants';\nimport { existy } from '../../../../../../utils/commonUtils';\nimport cardType from '../utils/cardType';\nimport { SecuredFieldSetupObject } from '../../types';\nimport SecuredField from '../../securedField/SecuredField';\nimport { CardObject, CardBrandData, SFFeedbackObj, CardLoadData, CVCPolicyType, DatePolicyType } from '../../types';\nimport AdyenCheckoutError from '../../../../../../core/Errors/AdyenCheckoutError';\nimport type { SFKeyPressObj } from '../../types';\nimport { isSecuredField } from '../../../utils';\n\n/**\n * Bound to the instance of CSF\n * Handles specific functionality related to configuring & creating SecuredFields\n */\nexport function createSecuredFields(): number {\n this.encryptedAttrName = DATA_ENCRYPTED_FIELD_ATTR;\n\n // Detect DOM elements that qualify as securedField holders & filter them for valid types\n const securedFields: HTMLElement[] = select(this.props.rootNode, `[${this.encryptedAttrName}]`).filter(field => {\n const fieldType: string = getAttribute(field, this.encryptedAttrName);\n\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n // TODO send analytics about separate date fields\n }\n\n const isValidType = isSecuredField(fieldType);\n if (!isValidType) {\n console.warn(\n `WARNING: '${fieldType}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`\n );\n }\n return isValidType;\n });\n\n /**\n * cvcPolicy - 'required' | 'optional' | 'hidden'\n * - Always 'required' for GiftCards\n * - Usually 'required' for single branded Credit Cards but with exceptions e.g. maestro ('optional'), bcmc ('hidden').\n * - Always 'required' for generic Credit Cards at start up - in this case, subsequent, supporting information about whether cvc stops being required\n * comes from the SF in the brand information (as the shopper inputs the cc number)\n */\n const cvcPolicy: CVCPolicyType = CVC_POLICY_REQUIRED;\n\n /** Usually 'required' for single branded Credit Cards but with exceptions e.g. ticket ('hidden', *technically* a meal voucher) */\n const expiryDatePolicy: DatePolicyType = DATE_POLICY_REQUIRED;\n\n // CHECK IF THIS SECURED FIELD IS NOT OF A CREDIT CARD TYPE\n if (!this.config.isCreditCardType) {\n this.createNonCardSecuredFields(securedFields);\n return securedFields.length;\n }\n\n // CONTINUE AS CREDIT-CARD TYPE...\n this.isSingleBrandedCard = false;\n\n this.securityCode = '';\n\n this.createCardSecuredFields(securedFields, cvcPolicy, expiryDatePolicy);\n\n // Return the number of iframes we're going to create\n return securedFields.length;\n}\n\n/**\n * i.e. giftcard and ach fields\n *\n * Create a new SecuredField for each detected holding element\n */\nexport async function createNonCardSecuredFields(securedFields: HTMLElement[]): Promise<any> {\n for (let i = 0; i < securedFields.length; i++) {\n const securedField = securedFields[i];\n await this.setupSecuredField(securedField).catch(e => {\n if (window._b$dl) console.log('Secured fields setup failure. e=', e);\n });\n }\n}\n\nexport async function createCardSecuredFields(\n securedFields: HTMLElement[],\n cvcPolicy: CVCPolicyType,\n expiryDatePolicy: DatePolicyType\n): Promise<any> {\n // Declared card type from the initialisation of CSF\n let type: string = this.state.type;\n\n // Maybe it's a single branded card defined by setting type: 'card' & a single item in cardGroupTypes\n // In which case update the type var both locally AND in State\n if (type === 'card' && this.config.cardGroupTypes.length === 1) {\n type = this.config.cardGroupTypes[0];\n this.state.type = type;\n }\n\n // So, is it a single branded card?\n this.isSingleBrandedCard = type !== 'card';\n\n // If single branded card field...\n if (this.isSingleBrandedCard) {\n // Check that type exists\n const card: CardObject = cardType.getCardByBrand(type);\n\n // It's possible we don't recognise the card type -\n // scenario: frontend initially recognises card as e.g. Visa - but then backend tokenises it as a sub-brand which we currently don't recognise\n if (!existy(card)) {\n this.state.type = 'unrecognised-single-brand'; // Will let CVC field accept 4 digits in the input\n } else {\n // Assess whether cvc field is required based on the card type & whether the cvc field should even be visible\n cvcPolicy = card.cvcPolicy || CVC_POLICY_REQUIRED;\n expiryDatePolicy = card.expiryDatePolicy || DATE_POLICY_REQUIRED;\n\n this.securityCode = card.securityCode;\n }\n }\n\n /**\n * Create a new SecuredField for each detected holding element\n *\n * - we do this in sequence, waiting until one has configured before creating the next.\n * We do it this way to avoid the 'bug' whereby if something interrupts the loading of an iframe the listener we have for its load event\n * never fires; which means the iframe never configures.\n * (NB - you can recreate this 'bug' by creating the securedFields in a synchronous loop:\n * securedFields.forEach(this.setupSecuredField.bind(this));\n * and putting a breakpoint on the line where we declare the setupSecuredField function)\n *\n * Also note we tried the Array.map/Promise.all way of asynchronously looping through an array - but it didn't fix the issue,\n * - so we fall back to a good old for-loop\n */\n for (let i = 0; i < securedFields.length; i++) {\n const securedField = securedFields[i];\n if (window._b$dl) console.log('\\nAbout to set up securedField:', securedField);\n await this.setupSecuredField(securedField, cvcPolicy, expiryDatePolicy).catch(e => {\n if (window._b$dl) console.log('Secured fields setup failure. e=', e);\n });\n if (window._b$dl) console.log('Finished setting up securedField:', securedField);\n }\n if (window._b$dl) console.log('Finished setting up all securedFields');\n\n /**\n * Now the securedFields have all been created and configured...\n *\n * For a single branded card we call to onBrand callback once.\n * This allows the UI to set the correct logo if they haven't already,\n * and we also pass the cvcPolicy & expiryDatePolicy so the UI can hide the iframe holders if necessary\n */\n if (this.isSingleBrandedCard) {\n const callbackObj: CardBrandData = {\n type: this.state.type,\n rootNode: this.props.rootNode,\n brand: type,\n cvcPolicy,\n expiryDatePolicy,\n cvcText: this.securityCode\n };\n\n // Allow a tick for the securedField to finish rendering\n setTimeout(() => {\n this.callbacks.onBrand(callbackObj);\n }, 0);\n }\n}\n\n// Run for each detected holder of a securedField...\nexport function setupSecuredField(pItem: HTMLElement, cvcPolicy?: CVCPolicyType, expiryDatePolicy?: DatePolicyType): Promise<any> {\n return new Promise((resolve, reject) => {\n /**\n * possible values:\n * encryptedCardNumber\n * encryptedExpiryDate\n * encryptedExpiryMonth\n * encryptedExpiryYear\n * encryptedSecurityCode\n * encryptedPassword\n */\n const fieldType: string = getAttribute(pItem, this.encryptedAttrName);\n\n if (fieldType === ENCRYPTED_EXPIRY_YEAR) {\n this.state.hasSeparateDateFields = true;\n }\n\n const extraFieldData: string = getAttribute(pItem, DATA_INFO);\n const uid = getAttribute(pItem, DATA_UID);\n\n // CREATE SecuredField passing config object\n const sfInitObj: SecuredFieldSetupObject = {\n fieldType,\n extraFieldData,\n uid,\n cvcPolicy,\n holderEl: pItem,\n expiryDatePolicy,\n txVariant: this.state.type,\n // from this.config (calculated)\n cardGroupTypes: this.config.cardGroupTypes,\n iframeUIConfig: this.config.iframeUIConfig,\n sfLogAtStart: this.config.sfLogAtStart,\n trimTrailingSeparator: this.config.trimTrailingSeparator,\n isCreditCardType: this.config.isCreditCardType,\n iframeSrc: this.config.iframeSrc,\n loadingContext: this.config.loadingContext,\n showWarnings: this.config.showWarnings,\n legacyInputMode: this.config.legacyInputMode,\n minimumExpiryDate: this.config.minimumExpiryDate,\n // from this.props (passed straight thru)\n maskSecurityCode: this.props.maskSecurityCode,\n exposeExpiryDate: this.props.exposeExpiryDate,\n disableIOSArrowKeys: this.props.shouldDisableIOSArrowKeys,\n implementationType: this.props.implementationType,\n showContextualElement: this.props.showContextualElement,\n placeholders: this.props.placeholders,\n submitAnalytics: this.props.onSubmitAnalytics,\n componentType: this.props.componentType\n };\n\n const sf: SecuredField = new SecuredField(sfInitObj, this.props.i18n)\n .onIframeLoaded((): void => {\n // Count\n this.state.iframeCount += 1;\n\n if (window._b$dl) console.log('### createSecuredFields::onIframeLoaded:: this.state.iframeCount=', this.state.iframeCount);\n\n // One of our existing securedFields has just loaded new content!\n if (this.state.iframeCount > this.state.numIframes) {\n this.destroySecuredFields();\n // TODO send analytics about this error\n throw new AdyenCheckoutError(\n 'ERROR',\n `One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`\n );\n }\n\n /** Create timeout within which time we expect the securedField to configure */\n // @ts-ignore - timeout 'type' *is* a number\n sf.loadToConfigTimeout = setTimeout(() => {\n reject({ type: sfInitObj.fieldType, failReason: 'sf took too long to config' });\n }, SF_CONFIG_TIMEOUT);\n\n // If all iframes are loaded - call onLoad callback\n if (this.state.iframeCount === this.state.originalNumIframes) {\n const callbackObj: CardLoadData = { iframesLoaded: true };\n this.callbacks.onLoad(callbackObj);\n }\n })\n .onConfig((pFeedbackObj: SFFeedbackObj): void => {\n this.handleIframeConfigFeedback(pFeedbackObj);\n\n // Clear timeout since the securedField has configured\n clearTimeout(sf.loadToConfigTimeout);\n sf.loadToConfigTimeout = null;\n\n resolve(pFeedbackObj);\n })\n .onFocus((pFeedbackObj: SFFeedbackObj): void => {\n this.handleFocus(pFeedbackObj);\n })\n .onBinValue((pFeedbackObj: SFFeedbackObj): void => {\n this.handleBinValue(pFeedbackObj);\n })\n .onTouchstart((pFeedbackObj: SFFeedbackObj): void => {\n // re. Disabling arrow keys in iOS - need to disable all other fields in the form\n if (this.props.shouldDisableIOSArrowKeys) {\n /**\n * re. this.hasGenuineTouchEvents...\n * There seems to be an issue with Responsive Design mode in Safari that means it allows setting focus on cross-origin iframes,\n * without enabling the touch events that allow the \"disableIOSArrowKeys\" workaround to fully function.\n * This results in a click on an securedFields *label* leading to, for example, the holderName field being disabled, but w/o access\n * to the touch events that would let it re-enable itself.\n *\n * So we prevent the \"disableIOSArrowKeys\" workaround unless we genuinely have touch events available.\n */\n if (this.hasGenuineTouchEvents || pFeedbackObj.hasGenuineTouchEvents) {\n this.callbacks.onTouchstartIOS({ fieldType: pFeedbackObj.fieldType });\n }\n }\n\n // Only perform this step if we genuinely have touch events available\n if (pFeedbackObj.hasGenuineTouchEvents || this.hasGenuineTouchEvents) {\n // iOS ONLY - RE. iOS BUGS AROUND BLUR AND FOCUS EVENTS\n // - pass information about which field has just been clicked (gained focus) to the other iframes\n this.postMessageToAllIframes({ fieldType: pFeedbackObj.fieldType, fieldClick: true });\n }\n })\n .onShiftTab((pFeedbackObj: SFFeedbackObj): void => {\n // Only happens for Firefox & IE <= 11\n this.handleSFShiftTab(pFeedbackObj.fieldType);\n })\n .onEncryption((pFeedbackObj: SFFeedbackObj): void => {\n this.handleEncryption(pFeedbackObj);\n })\n .onValidation((pFeedbackObj: SFFeedbackObj): void => {\n this.handleValidation(pFeedbackObj);\n })\n .onAutoComplete((pFeedbackObj: SFFeedbackObj): void => {\n this.processAutoComplete(pFeedbackObj);\n })\n .onKeyPressed((pFeedbackObj: SFFeedbackObj): void => {\n const { numKey, ...rest } = pFeedbackObj;\n this.callbacks.onKeyPressed(rest as SFKeyPressObj);\n });\n\n // Store reference to securedField in this.state (under fieldType)\n this.state.securedFields[fieldType] = sf;\n });\n}\n"],"names":["createSecuredFields","this","encryptedAttrName","DATA_ENCRYPTED_FIELD_ATTR","securedFields","select","props","rootNode","filter","field","fieldType","getAttribute","isValidType","isSecuredField","console","warn","cvcPolicy","CVC_POLICY_REQUIRED","expiryDatePolicy","DATE_POLICY_REQUIRED","config","isCreditCardType","isSingleBrandedCard","securityCode","createCardSecuredFields","length","createNonCardSecuredFields","async","i","securedField","setupSecuredField","catch","e","window","_b$dl","log","type","state","cardGroupTypes","card","cardType","getCardByBrand","existy","callbackObj","brand","cvcText","setTimeout","callbacks","onBrand","pItem","Promise","resolve","reject","ENCRYPTED_EXPIRY_YEAR","hasSeparateDateFields","sfInitObj","extraFieldData","DATA_INFO","uid","DATA_UID","holderEl","txVariant","iframeUIConfig","sfLogAtStart","trimTrailingSeparator","iframeSrc","loadingContext","showWarnings","legacyInputMode","minimumExpiryDate","maskSecurityCode","exposeExpiryDate","disableIOSArrowKeys","shouldDisableIOSArrowKeys","implementationType","showContextualElement","placeholders","submitAnalytics","onSubmitAnalytics","componentType","sf","SecuredField","i18n","onIframeLoaded","iframeCount","numIframes","destroySecuredFields","AdyenCheckoutError","loadToConfigTimeout","failReason","SF_CONFIG_TIMEOUT","originalNumIframes","iframesLoaded","onLoad","onConfig","pFeedbackObj","handleIframeConfigFeedback","clearTimeout","onFocus","handleFocus","onBinValue","handleBinValue","onTouchstart","hasGenuineTouchEvents","onTouchstartIOS","postMessageToAllIframes","fieldClick","onShiftTab","handleSFShiftTab","onEncryption","handleEncryption","onValidation","handleValidation","onAutoComplete","processAutoComplete","onKeyPressed","numKey","rest"],"mappings":"+gBAwBO,SAASA,IACZC,KAAKC,kBAAoBC,EAGzB,MAAMC,EAA+BC,EAAOJ,KAAKK,MAAMC,SAAU,IAAIN,KAAKC,sBAAsBM,OAAOC,IACnG,MAAMC,EAAoBC,EAAaF,EAAOR,KAAKC,mBAM7CU,EAAcC,EAAeH,GAMnC,OALKE,GACDE,QAAQC,KACJ,aAAaL,mCAA2CT,KAAKC,sFAG9DU,IAULI,EAA2BC,EAG3BC,EAAmCC,EAGzC,OAAKlB,KAAKmB,OAAOC,kBAMjBpB,KAAKqB,qBAAsB,EAE3BrB,KAAKsB,aAAe,GAEpBtB,KAAKuB,wBAAwBpB,EAAeY,EAAWE,GAGhDd,EAAcqB,SAZjBxB,KAAKyB,2BAA2BtB,GACzBA,EAAcqB,OAY7B,CAOOE,eAAeD,EAA2BtB,GAC7C,IAAK,IAAIwB,EAAI,EAAGA,EAAIxB,EAAcqB,OAAQG,IAAK,CAC3C,MAAMC,EAAezB,EAAcwB,SAC7B3B,KAAK6B,kBAAkBD,GAAcE,MAAMC,IACzCC,OAAOC,OAAOpB,QAAQ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oC,MAAM+C,cAAgBnF,KAAKoC,MAAMsD,mBAAoB,CAC1D,MAAMhD,EAA4B,CAAEiD,eAAe,GACnD3F,KAAK8C,UAAU8C,OAAOlD,EAC1B,IAEHmD,SAAUC,IACP9F,KAAK+F,2BAA2BD,GAGhCE,aAAajB,EAAGQ,qBAChBR,EAAGQ,oBAAsB,KAEzBrC,EAAQ4C,KAEXG,QAASH,IACN9F,KAAKkG,YAAYJ,KAEpBK,WAAYL,IACT9F,KAAKoG,eAAeN,KAEvBO,aAAcP,IAEP9F,KAAKK,MAAMmE,4BAUPxE,KAAKsG,uBAAyBR,EAAaQ,wBAC3CtG,KAAK8C,UAAUyD,gBAAgB,CAAE9F,UAAWqF,EAAarF,aAK7DqF,EAAaQ,uBAAyBtG,KAAKsG,wBAG3CtG,KAAKwG,wBAAwB,CAAE/F,UAAWqF,EAAarF,UAAWgG,YAAY,MAGrFC,WAAYZ,IAET9F,KAAK2G,iBAAiBb,EAAarF,aAEtCmG,aAAcd,IACX9F,KAAK6G,iBAAiBf,KAEzBgB,aAAchB,IACX9F,KAAK+G,iBAAiBjB,KAEzBkB,eAAgBlB,IACb9F,KAAKiH,oBAAoBnB,KAE5BoB,aAAcpB,IACX,MAAMqB,OAAEA,KAAWC,GAAStB,EAC5B9F,KAAK8C,UAAUoE,aAAaE,KAIpCpH,KAAKoC,MAAMjC,cAAcM,GAAasE,GAE9C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let n="undefined"!=typeof navigator&&function(){const
|
|
1
|
+
let e="undefined"!=typeof navigator&&/(android)/i.test(navigator.userAgent),n="undefined"!=typeof navigator&&function(){const e=navigator.userAgent,n=e.indexOf("MSIE ");if(n>0)return parseInt(e.substring(n+5,e.indexOf(".",n)),10);if(e.indexOf("Trident/")>0){const n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}const t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}();var t={__IS_ANDROID:e,__IS_IE:n,__IS_IOS:"undefined"!=typeof navigator&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:"undefined"!=typeof navigator&&/(firefox)/i.test(navigator.userAgent),__IS_SAFARI:"undefined"!=typeof navigator&&/(safari)/i.test(navigator.userAgent)&&!/(chrome)/i.test(navigator.userAgent)};export{t as default};
|
|
2
2
|
//# sourceMappingURL=userAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/userAgent.ts"],"sourcesContent":["function isIE() {\n const ua = navigator.userAgent;\n\n const msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n const trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n const rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n const edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n// NOTE: change from const to let for the purposes of testing (the values get set in some tests)\n/* eslint-disable */\nlet __IS_ANDROID = typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent);\nlet __IS_IE = typeof navigator !== 'undefined' && isIE();\nlet __IS_IOS = typeof navigator !== 'undefined' && /iphone|ipod|ipad/i.test(navigator.userAgent);\nlet __IS_FIREFOX = typeof navigator !== 'undefined' && /(firefox)/i.test(navigator.userAgent);\nlet __IS_SAFARI = typeof navigator !== 'undefined' && /(safari)/i.test(navigator.userAgent) && !/(chrome)/i.test(navigator.userAgent);\n/* eslint-enable */\n\nexport default {\n __IS_ANDROID,\n __IS_IE,\n __IS_IOS,\n __IS_FIREFOX,\n __IS_SAFARI\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"userAgent.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/userAgent.ts"],"sourcesContent":["function isIE() {\n const ua = navigator.userAgent;\n\n const msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n const trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n const rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n const edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n// NOTE: change from const to let for the purposes of testing (the values get set in some tests)\n/* eslint-disable */\nlet __IS_ANDROID = typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent);\nlet __IS_IE = typeof navigator !== 'undefined' && isIE();\nlet __IS_IOS = typeof navigator !== 'undefined' && /iphone|ipod|ipad/i.test(navigator.userAgent);\nlet __IS_FIREFOX = typeof navigator !== 'undefined' && /(firefox)/i.test(navigator.userAgent);\nlet __IS_SAFARI = typeof navigator !== 'undefined' && /(safari)/i.test(navigator.userAgent) && !/(chrome)/i.test(navigator.userAgent);\n/* eslint-enable */\n\nexport default {\n __IS_ANDROID,\n __IS_IE,\n __IS_IOS,\n __IS_FIREFOX,\n __IS_SAFARI\n};\n"],"names":["__IS_ANDROID","navigator","test","userAgent","__IS_IE","ua","msie","indexOf","parseInt","substring","rv","edge","isIE","__IS_IOS","__IS_FIREFOX","__IS_SAFARI"],"mappings":"AA4BA,IAAIA,EAAoC,oBAAdC,WAA6B,aAAaC,KAAKD,UAAUE,WAC/EC,EAA+B,oBAAdH,WA7BrB,WACI,MAAMI,EAAKJ,UAAUE,UAEfG,EAAOD,EAAGE,QAAQ,SACxB,GAAID,EAAO,EAEP,OAAOE,SAASH,EAAGI,UAAUH,EAAO,EAAGD,EAAGE,QAAQ,IAAKD,IAAQ,IAInE,GADgBD,EAAGE,QAAQ,YACb,EAAG,CAEb,MAAMG,EAAKL,EAAGE,QAAQ,OACtB,OAAOC,SAASH,EAAGI,UAAUC,EAAK,EAAGL,EAAGE,QAAQ,IAAKG,IAAM,GAC/D,CAEA,MAAMC,EAAON,EAAGE,QAAQ,SACxB,OAAII,EAAO,GAEAH,SAASH,EAAGI,UAAUE,EAAO,EAAGN,EAAGE,QAAQ,IAAKI,IAAQ,GAKvE,CAKkDC,GAMlD,IAAAP,EAAe,CACXL,eACAI,UACAS,SARgC,oBAAdZ,WAA6B,oBAAoBC,KAAKD,UAAUE,WASlFW,aARoC,oBAAdb,WAA6B,aAAaC,KAAKD,UAAUE,WAS/EY,YARmC,oBAAdd,WAA6B,YAAYC,KAAKD,UAAUE,aAAe,YAAYD,KAAKD,UAAUE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",i="encryptedExpiryMonth",d="encryptedExpiryYear",t="encryptedSecurityCode",a="encryptedPassword",s="encryptedSecurityCode3digits",n="encryptedSecurityCode4digits",o="giftcard",y="6.
|
|
1
|
+
const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",i="encryptedExpiryMonth",d="encryptedExpiryYear",t="encryptedSecurityCode",a="encryptedPassword",s="encryptedSecurityCode3digits",n="encryptedSecurityCode4digits",o="giftcard",y="6.1.0",p=["amex","mc","visa"],u=[o],C=[r,c,i,d,t,a],m=C,x=["bcmc"],b="required",D="optional",g="hidden",h=b,l=D,v=g,E=b,M=D,S=g,f="data-cse",j="data-info",B="data-uid",w=["accel","pulse","star","nyce"],A={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},N={[r]:"cardNumber",[c]:"expiryDate",[t]:"securityCode",[i]:"expiryMonth",[d]:"expiryYear",[a]:"password",[s]:"securityCodeThreeDigits",[n]:"securityCodeFourDigits"},P=6e3;export{m as ALL_SECURED_FIELDS,w as BRAND_ICON_UI_EXCLUSION_LIST,A as BRAND_READABLE_NAME_MAP,C as CREDIT_CARD_SF_FIELDS,v as CVC_POLICY_HIDDEN,l as CVC_POLICY_OPTIONAL,h as CVC_POLICY_REQUIRED,f as DATA_ENCRYPTED_FIELD_ATTR,j as DATA_INFO,B as DATA_UID,S as DATE_POLICY_HIDDEN,M as DATE_POLICY_OPTIONAL,E as DATE_POLICY_REQUIRED,x as DEDICATED_CARD_COMPONENTS,p as DEFAULT_CARD_GROUP_TYPES,e as ENCRYPTED,r as ENCRYPTED_CARD_NUMBER,c as ENCRYPTED_EXPIRY_DATE,i as ENCRYPTED_EXPIRY_MONTH,d as ENCRYPTED_EXPIRY_YEAR,a as ENCRYPTED_PWD_FIELD,t as ENCRYPTED_SECURITY_CODE,s as ENCRYPTED_SECURITY_CODE_3_DIGITS,n as ENCRYPTED_SECURITY_CODE_4_DIGITS,o as GIFT_CARD,g as HIDDEN,u as NON_CREDIT_CARD_TYPE_SECURED_FIELDS,D as OPTIONAL,b as REQUIRED,P as SF_CONFIG_TIMEOUT,N as SF_FIELDS_MAP,y as SF_VERSION};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '6.
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '6.1.0';\n\nexport const DEFAULT_CARD_GROUP_TYPES = ['amex', 'mc', 'visa'];\n\nexport const NON_CREDIT_CARD_TYPE_SECURED_FIELDS = [GIFT_CARD]; // Maybe, sometime in the future will include 'sepa' & 'sepadirectdebit'\n\n// Credit card (CardInput) related securedFields (based on the data-cse attribute)\nexport const CREDIT_CARD_SF_FIELDS = [\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_PWD_FIELD\n] as const;\n\n/** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard) */\nexport const ALL_SECURED_FIELDS = CREDIT_CARD_SF_FIELDS;\n\n// Card components created as: checkout.create({BRAND}) e.g. checkout.create('bcmc')\n// - which are dedicated to a single, core, brand e.g. 'bcmc' BUT which can in effect handle multiple brands e.g. \"bcmc\", \"maestro\", \"visa\"\nexport const DEDICATED_CARD_COMPONENTS = ['bcmc'];\n\nexport const REQUIRED = 'required';\nexport const OPTIONAL = 'optional';\nexport const HIDDEN = 'hidden';\n\nexport const CVC_POLICY_REQUIRED: CVCPolicyType = REQUIRED;\nexport const CVC_POLICY_OPTIONAL: CVCPolicyType = OPTIONAL;\nexport const CVC_POLICY_HIDDEN: CVCPolicyType = HIDDEN;\n\nexport const DATE_POLICY_REQUIRED: DatePolicyType = REQUIRED;\nexport const DATE_POLICY_OPTIONAL: DatePolicyType = OPTIONAL;\nexport const DATE_POLICY_HIDDEN: DatePolicyType = HIDDEN;\n\nexport const DATA_ENCRYPTED_FIELD_ATTR = 'data-cse';\nexport const DATA_INFO = 'data-info';\nexport const DATA_UID = 'data-uid';\n\nexport const BRAND_ICON_UI_EXCLUSION_LIST = ['accel', 'pulse', 'star', 'nyce'];\n\nexport const BRAND_READABLE_NAME_MAP = {\n visa: 'VISA',\n mc: 'MasterCard',\n amex: 'American Express',\n discover: 'Discover',\n cup: 'China Union Pay',\n jcb: 'JCB',\n diners: 'Diners Club',\n maestro: 'Maestro',\n bcmc: 'Bancontact card',\n bijcard: 'de Bijenkorf Card'\n};\n\nexport const SF_FIELDS_MAP = {\n [ENCRYPTED_CARD_NUMBER]: 'cardNumber', // ph\n [ENCRYPTED_EXPIRY_DATE]: 'expiryDate', // ph\n [ENCRYPTED_SECURITY_CODE]: 'securityCode',\n [ENCRYPTED_EXPIRY_MONTH]: 'expiryMonth', // ph\n [ENCRYPTED_EXPIRY_YEAR]: 'expiryYear', // ph\n //\n [ENCRYPTED_PWD_FIELD]: 'password',\n //\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: 'securityCodeThreeDigits', // ph\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: 'securityCodeFourDigits' // ph\n};\n\n/** time within which we expect to receive a \"configured\" message from a securedField iframe, once it has registered as having loaded */\nexport const SF_CONFIG_TIMEOUT = 6000;\n"],"names":["ENCRYPTED","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_SECURITY_CODE_3_DIGITS","ENCRYPTED_SECURITY_CODE_4_DIGITS","GIFT_CARD","SF_VERSION","DEFAULT_CARD_GROUP_TYPES","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","CREDIT_CARD_SF_FIELDS","ALL_SECURED_FIELDS","DEDICATED_CARD_COMPONENTS","REQUIRED","OPTIONAL","HIDDEN","CVC_POLICY_REQUIRED","CVC_POLICY_OPTIONAL","CVC_POLICY_HIDDEN","DATE_POLICY_REQUIRED","DATE_POLICY_OPTIONAL","DATE_POLICY_HIDDEN","DATA_ENCRYPTED_FIELD_ATTR","DATA_INFO","DATA_UID","BRAND_ICON_UI_EXCLUSION_LIST","BRAND_READABLE_NAME_MAP","visa","mc","amex","discover","cup","jcb","diners","maestro","bcmc","bijcard","SF_FIELDS_MAP","SF_CONFIG_TIMEOUT"],"mappings":"AAEO,MAAMA,EAAY,YAEZC,EAAwB,sBACxBC,EAAwB,sBACxBC,EAAyB,uBACzBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAsB,oBAGtBC,EAAmC,+BACnCC,EAAmC,+BAEnCC,EAAY,WAEZC,EAAa,QAEbC,EAA2B,CAAC,OAAQ,KAAM,QAE1CC,EAAsC,CAACH,GAGvCI,EAAwB,CACjCZ,EACAC,EACAC,EACAC,EACAC,EACAC,GAISQ,EAAqBD,EAIrBE,EAA4B,CAAC,QAE7BC,EAAW,WACXC,EAAW,WACXC,EAAS,SAETC,EAAqCH,EACrCI,EAAqCH,EACrCI,EAAmCH,EAEnCI,EAAuCN,EACvCO,EAAuCN,EACvCO,EAAqCN,EAErCO,EAA4B,WAC5BC,EAAY,YACZC,EAAW,WAEXC,EAA+B,CAAC,QAAS,QAAS,OAAQ,QAE1DC,EAA0B,CACnCC,KAAM,OACNC,GAAI,aACJC,KAAM,mBACNC,SAAU,WACVC,IAAK,kBACLC,IAAK,MACLC,OAAQ,cACRC,QAAS,UACTC,KAAM,kBACNC,QAAS,qBAGAC,EAAgB,CACzBvC,CAACA,GAAwB,aACzBC,CAACA,GAAwB,aACzBG,CAACA,GAA0B,eAC3BF,CAACA,GAAyB,cAC1BC,CAACA,GAAwB,aAEzBE,CAACA,GAAsB,WAEvBC,CAACA,GAAmC,0BACpCC,CAACA,GAAmC,0BAI3BiC,EAAoB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{log as e,warn as i}from"../utilities/logger.js";import t from"./utils/createIframe.js";import{selectOne as s,removeAllChildren as r}from"../utilities/dom.js";import{on as n,off as o}from"../../../../../utils/listenerUtils.js";import a from"../CSF/utils/iframes/postMessageToIframe.js";import{originCheckPassed as l,isWebpackPostMsg as h,isChromeVoxPostMsg as f}from"../CSF/utils/iframes/postMessageValidation.js";import{ENCRYPTED_EXPIRY_DATE as c,ENCRYPTED_EXPIRY_MONTH as d,ENCRYPTED_EXPIRY_YEAR as m,DATE_POLICY_OPTIONAL as u,DATE_POLICY_HIDDEN as p,ENCRYPTED_SECURITY_CODE as
|
|
1
|
+
import{log as e,warn as i}from"../utilities/logger.js";import t from"./utils/createIframe.js";import{selectOne as s,removeAllChildren as r}from"../utilities/dom.js";import{on as n,off as o}from"../../../../../utils/listenerUtils.js";import a from"../CSF/utils/iframes/postMessageToIframe.js";import{originCheckPassed as l,isWebpackPostMsg as h,isChromeVoxPostMsg as f}from"../CSF/utils/iframes/postMessageValidation.js";import{ENCRYPTED_EXPIRY_DATE as c,ENCRYPTED_EXPIRY_MONTH as d,ENCRYPTED_EXPIRY_YEAR as m,DATE_POLICY_OPTIONAL as u,DATE_POLICY_HIDDEN as p,ENCRYPTED_SECURITY_CODE as y,CVC_POLICY_OPTIONAL as g,CVC_POLICY_HIDDEN as C}from"../constants.js";import{generateRandomNumber as b}from"../utilities/commonUtils.js";import E from"./AbstractSecuredField.js";import{reject as T}from"../../../../../utils/commonUtils.js";import{processAriaConfig as L}from"./utils/processAriaConfig.js";import{processPlaceholders as w}from"./utils/processPlaceholders.js";import{hasOwnProperty as k}from"../../../../../utils/hasOwnProperty.js";import{AnalyticsErrorEvent as F,ErrorEventType as _,ErrorEventCode as P}from"../../../../../core/Analytics/events/AnalyticsErrorEvent.js";class O extends E{init(e,i,r,o){const a=L(this.sfConfig.txVariant,this.sfConfig.fieldType,e,o);this.sfConfig.iframeUIConfig.ariaConfig=a,this.sfConfig.iframeUIConfig.placeholders=w(this.sfConfig.txVariant,this.sfConfig.fieldType,r);const l={src:i,title:a[this.sfConfig.fieldType].iframeTitle,policy:"origin"},h=t(l);this.holderEl.appendChild(h);const f=s(this.holderEl,".js-iframe");if(f){if(!f.contentWindow){console.error("ERROR: Trying to initialise a securedField iframe, but the iframe.contentWindow is undefined. Are you sure the element into which the Card component is being mounted already exists in the DOM *before* the Card component is mounted?");const e=new F({component:this.componentType,code:P.SECURED_FIELDS_IFRAME_CONTENT_WINDOW_NOT_FOUND,errorType:_.implementation,message:`Trying to initialise an iframe for ${this.sfConfig.fieldType}, but the iframe.contentWindow is undefined`});this.submitAnalytics?.(e)}this.iframeContentWindow=f.contentWindow,this.iframeOnLoadListener=this.iframeOnLoadListenerFn,n(f,"load",this.iframeOnLoadListener,!1)}return this.iframeRef=f,this}iframeOnLoadListenerFn(){this.postMessageListener=this.postMessageListenerFn,n(window,"message",this.postMessageListener,!1);const e={...this.sfConfig,numKey:this.numKey};window._b$dl&&console.log("### SecuredField:::: onIframeLoaded:: created configObj=",e),a(e,this.iframeContentWindow,this.loadingContext),this.onIframeLoadedCallback()}postMessageListenerFn(t){if(!l(t,this.loadingContext,this.sfConfig.showWarnings))return;let s;try{s=JSON.parse(t.data)}catch(i){return h(t)?void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - WEBPACK")):f(t)?void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - CHROMEVOX")):void(this.sfConfig.showWarnings&&e("### SecuredField::postMessageListenerFn:: PARSE FAIL - UNKNOWN REASON: event.data=",t.data))}if(k(s,"action")&&k(s,"numKey"))if(this.numKey===s.numKey)switch(s.action){case"encryption":this.isValid=!0,this.onEncryptionCallback(s);break;case"config":window._b$dl&&console.log("### SecuredField::postMessageListenerFn:: configured - calling onConfigCallback",s.fieldType),this.onConfigCallback(s);break;case"focus":this.onFocusCallback(s);break;case"binValue":this.onBinValueCallback(s);break;case"touch":this.onTouchstartCallback(s);break;case"shifttab":this.onShiftTabCallback(s);break;case"autoComplete":this.onAutoCompleteCallback(s);break;case"enterKeyPressed":this.onKeyPressedCallback(s);break;case"encryptionError":{const e=new F({component:this.componentType,code:s.code,errorType:_.internal,message:`${s.error}. Field= ${this.sfConfig.fieldType}`});this.submitAnalytics?.(e);break}default:this.isValid=!1,this.onValidationCallback(s)}else this.sfConfig.showWarnings&&i("WARNING SecuredField :: postMessage listener for iframe :: data mismatch! (Probably a message from an unrelated securedField)");else this.sfConfig.showWarnings&&i("WARNING SecuredField :: postMessage listener for iframe :: data mismatch!")}destroy(){o(window,"message",this.postMessageListener,!1),o(this.iframeRef,"load",this.iframeOnLoadListener,!1),this.iframeContentWindow=null,r(this.holderEl)}isOptionalOrHidden(){if(this.sfConfig.fieldType===c||this.sfConfig.fieldType===d||this.sfConfig.fieldType===m)switch(this.expiryDatePolicy){case p:return!0;case u:return!this.hasError;default:return!1}if(this.sfConfig.fieldType===y)switch(this.cvcPolicy){case C:return!0;case g:return!this.hasError;default:return!1}return!1}onIframeLoaded(e){return this.onIframeLoadedCallback=e,this}onEncryption(e){return this.onEncryptionCallback=e,this}onValidation(e){return this.onValidationCallback=e,this}onConfig(e){return this.onConfigCallback=e,this}onFocus(e){return this.onFocusCallback=e,this}onBinValue(e){return this.onBinValueCallback=e,this}onTouchstart(e){return this.onTouchstartCallback=e,this}onShiftTab(e){return this.onShiftTabCallback=e,this}onAutoComplete(e){return this.onAutoCompleteCallback=e,this}onKeyPressed(e){return this.onKeyPressedCallback=e,this}get errorType(){return this._errorType}set errorType(e){this._errorType=e}get hasError(){return this._hasError}set hasError(e){this._hasError=e}get isValid(){if(this.sfConfig.fieldType===y)switch(this.cvcPolicy){case C:return!0;case g:return!this.hasError;default:return this._isValid}if(this.sfConfig.fieldType===c||this.sfConfig.fieldType===d||this.sfConfig.fieldType===m)switch(this.expiryDatePolicy){case p:return!0;case u:return!this.hasError;default:return this._isValid}return this._isValid}set isValid(e){this._isValid=e}get cvcPolicy(){return this._cvcPolicy}set cvcPolicy(e){this.sfConfig.fieldType===y&&e!==this.cvcPolicy&&(this._cvcPolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get expiryDatePolicy(){return this._expiryDatePolicy}set expiryDatePolicy(e){this.sfConfig.fieldType!==c&&this.sfConfig.fieldType!==d&&this.sfConfig.fieldType!==m||e!==this.expiryDatePolicy&&(this._expiryDatePolicy=e,this.hasError&&"isValidated"===this.errorType&&(this.hasError=!1))}get iframeContentWindow(){return this._iframeContentWindow}set iframeContentWindow(e){this._iframeContentWindow=e}get isEncrypted(){return this._isEncrypted}set isEncrypted(e){this._isEncrypted=e}get numKey(){return this._numKey}set numKey(e){this._numKey=e}get iframeOnLoadListener(){return this._iframeOnLoadListener}set iframeOnLoadListener(e){this._iframeOnLoadListener=e.bind(this)}get postMessageListener(){return this._postMessageListener}set postMessageListener(e){this._postMessageListener=e.bind(this)}constructor(e,i){super();const t=T(["loadingContext","holderEl","iframeSrc","showContextualElement","placeholders"]).from(e);this.sfConfig={...t,iframeUIConfig:{...t.iframeUIConfig}};const{iframeSrc:s,placeholders:r,showContextualElement:n}=e;return this.loadingContext=e.loadingContext,this.holderEl=e.holderEl,this.submitAnalytics=e.submitAnalytics,this.componentType=e.componentType,this.isValid=!1,this.iframeContentWindow=null,this.numKey=b(),this.isEncrypted=!1,this.hasError=!1,this.errorType="",this.cvcPolicy=e.cvcPolicy,this.expiryDatePolicy=e.expiryDatePolicy,this.init(i,s,r,n)}}export{O as default};
|
|
2
2
|
//# sourceMappingURL=SecuredField.js.map
|