@adyen/adyen-web 6.15.0 → 6.16.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.
Files changed (84) hide show
  1. package/dist/cjs/adyen.css +5 -3
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +1 -0
  6. package/dist/es/adyen.css +5 -3
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  9. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  10. package/dist/es/components/Card/components/CardInput/components/CardFields.js +1 -1
  11. package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  12. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  13. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  14. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  15. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  16. package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  18. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  19. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  20. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  21. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  22. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  23. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  24. package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
  25. package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  26. package/dist/es/components/internal/ExpandButton/ExpandButton.js +1 -1
  27. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -1
  28. package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  29. package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js +2 -0
  30. package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -0
  31. package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js +2 -0
  32. package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -0
  33. package/dist/es/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js +1 -1
  34. package/dist/es/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js.map +1 -1
  35. package/dist/es/components/internal/SecuredFields/binLookup/extensions.js +1 -1
  36. package/dist/es/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
  37. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  38. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  39. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  40. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  41. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  42. package/dist/es/core/core.js +1 -1
  43. package/dist/es/index.d.ts +1 -0
  44. package/dist/es/utils/clipboard.js.map +1 -1
  45. package/dist/es-legacy/adyen.css +5 -3
  46. package/dist/es-legacy/adyen.css.map +1 -1
  47. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  48. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  49. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js +1 -1
  50. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  51. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  52. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  53. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  54. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  55. package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js +1 -1
  56. package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
  57. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  58. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  59. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  60. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  61. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  62. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  63. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
  64. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  65. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +1 -1
  66. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -1
  67. package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  68. package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js +2 -0
  69. package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -0
  70. package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js +2 -0
  71. package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -0
  72. package/dist/es-legacy/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js +1 -1
  73. package/dist/es-legacy/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js.map +1 -1
  74. package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js +1 -1
  75. package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
  76. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  77. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  78. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  79. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  80. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  81. package/dist/es-legacy/core/core.js +1 -1
  82. package/dist/es-legacy/utils/clipboard.js.map +1 -1
  83. package/package.json +1 -1
  84. package/styles/adyen.css +5 -3
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as t,useMemo as o,useState as n,useCallback as s,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import i from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import l from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{DATE_POLICY_REQUIRED as u,CVC_POLICY_REQUIRED as c,ENCRYPTED_CARD_NUMBER as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputValidationRules as p,cardInputFormatters as f,getRuleByNameAndMode as b}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import h from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as S,extractPropsForSFP as g,getLayout as N,extractPropsForCardFields as A}from"./utils.js";import j from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as v}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as F}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as O,getFocusHandler as C,getAddressHandler as P}from"./handlers.js";import w from"../../../../_virtual/index.js";import{getPartialAddressValidationRules as k}from"../../../internal/Address/validate.js";import E from"../../../../core/Context/useImage.js";import{getArrayDifferences as R}from"../../../../utils/arrayUtils.js";import x from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as I}from"../../../internal/Icon/constants.js";import B from"./useSRPanelForCardInputErrors.js";import V from"../Fastlane/FastlaneSignup.js";import{ANALYTICS_VALIDATION_ERROR_STR as D}from"../../../../core/Analytics/constants.js";import{fieldTypeToSnakeCase as q}from"../../../internal/SecuredFields/utils.js";import{getErrorMessageFromCode as M}from"../../../../core/Errors/utils.js";import{SF_ErrorCodes as _}from"../../../../core/Errors/constants.js";import{AnalyticsInfoEvent as L}from"../../../../core/Analytics/AnalyticsInfoEvent.js";function T(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function K(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){T(e,r,t[r])}))}return e}function H(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const U=l=>{var T,U;const z=t(null),W=t(!1),$=E(),G=t(null),J=e=>{G.current=e},Q=t({});Object.keys(Q.current).length||l.setComponentRef(Q.current);const X=t(0),Y=t(!1),Z=o((()=>new j(l.specifications)),[l.specifications]);Q.current.sfp=z;const[ee,re]=n("ready"),[te,oe]=n({}),[ne,se]=n(K({},l.holderNameRequired&&{holderName:!1}));var ae;const[ie,le]=n(K({},l.hasHolderName&&{holderName:null!==(ae=l.data.holderName)&&void 0!==ae?ae:""})),[de,ue]=n(""),[ce,me]=n(!1),[pe,fe]=n(u),[be,ye]=n(c),[he,Se]=n(null),[ge,Ne]=n([]),[Ae,je]=n(l.storedPaymentMethodId?l.brand:""),ve=l.billingAddressMode!==d.none&&l.billingAddressRequired,Fe=S(l.billingAddressMode),Oe=t(Fe&&(null===(U=l.data)||void 0===U||null===(T=U.billingAddress)||void 0===T?void 0:T.country)),[Ce,Pe]=n(!1),[we,ke]=n(ve?l.data.billingAddress:null),[Ee,Re]=n(!1),[xe,Ie]=n(""),[Be,Ve]=n({value:null}),[De,qe]=n(null),[Me,_e]=n("card"),[Le,Te]=n(!1),{handleChangeFor:Ke,triggerValidation:He,data:Ue,valid:ze,errors:We,setSchema:$e,setData:Ge,setValid:Je,setErrors:Qe}=h({schema:[],defaultData:l.data,formatters:f,rules:p}),Xe=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource;var Ye;const Ze=null===(Ye=l.showInstallmentAmounts)||void 0===Ye||Ye,er="kr"===(null!=he?he:l.countryCode),rr=l.configuration.koreanAuthenticationRequired&&er,tr=Ee&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,or=(e,r)=>{l.onFocus({fieldType:e,event:r})},nr=(e,r)=>{l.onBlur({fieldType:e,event:r})},sr=s((e=>{_e(e.brand),l.onBrand(e)}),[]),ar=C(ue,or,nr),ir=()=>N(K({props:l,showKCP:rr,showBrazilianSSN:tr},l.billingAddressRequired&&{countrySpecificSchemas:Z.getAddressSchemaForCountry(null==we?void 0:we.country),billingAddressRequiredFields:l.billingAddressRequiredFields})),lr=s((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;qe(r)}),[]),dr=P(Ge,Je,Qe),ur=O(Y,z,ir()),cr=s((e=>{mr(e)}),[Le,Te]),mr=e=>{e.status&&("loading"==e.status?Te(!1):Te(!0))},pr=o((()=>y(l,{sfp:z},{dualBrandSelectElements:ge,setDualBrandSelectElements:Ne,setSelectedBrandValue:je,issuingCountryCode:he,setIssuingCountryCode:Se},X)),[ge,he]);Q.current.showValidation=()=>{W.current=!0,null==yr||yr(),z.current.showValidation(),He(["holderName","socialSecurityNumber","taxNumber"]),(null==G?void 0:G.current)&&G.current.showValidation()},Q.current.processBinLookupResponse=(e,r)=>{pr.processBinLookup(e,r)},Q.current.setStatus=re,a((()=>(Q.current.setFocusOn=z.current.setFocusOn,Q.current.updateStyles=z.current.updateStyles,Q.current.handleUnsupportedCard=z.current.handleUnsupportedCard,()=>{z.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...tr?["socialSecurityNumber"]:[],...rr?["taxNumber"]:[],...ve?["billingAddress"]:[]];$e(e)}),[l.hasHolderName,tr,rr]),a((()=>{var e;le(H(K({},ie),{holderName:null!==(e=Ue.holderName)&&void 0!==e?e:"",taxNumber:Ue.taxNumber})),Ie(Ue.socialSecurityNumber),ve&&ke(K({},Ue.billingAddress)),se(H(K({},ne),{holderName:!l.holderNameRequired||ze.holderName,socialSecurityNumber:!!ze.socialSecurityNumber&&ze.socialSecurityNumber,taxNumber:!!ze.taxNumber&&ze.taxNumber,billingAddress:!!ze.billingAddress&&ze.billingAddress}));const r=!!We.billingAddress&&Object.entries(We.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);oe(H(K({},te),{holderName:l.holderNameRequired&&We.holderName?We.holderName:null,socialSecurityNumber:tr&&We.socialSecurityNumber?We.socialSecurityNumber:null,taxNumber:rr&&We.taxNumber?We.taxNumber:null,billingAddress:ve&&r?We.billingAddress:null}))}),[Ue,ze,We]);const{sortedErrorList:fr,previousSortedErrors:br,clearSRPanel:yr}=B({errors:te,props:l,isValidating:W,retrieveLayout:ir,specifications:Z,billingAddress:we,sfp:z});a((()=>{if(fr){const e=R(fr,br,"field");null==e||e.forEach((e=>{const r=new L({type:D,target:q(e.field),validationErrorCode:e.errorCode,validationErrorMessage:M(e.errorCode,_)});l.onSubmitAnalytics(r)}))}}),[fr]),a((()=>{const e=ne.holderName,r=ce,t=!ve||ne.billingAddress,o=!rr||!!ne.taxNumber&&!!ne.encryptedPassword,n=!tr||!!ne.socialSecurityNumber,s=r&&e&&t&&o&&n,a=z.current.mapErrorsToValidationRuleResult(),i=K({},te,a);l.onChange({data:ie,valid:ne,errors:i,isValid:s,billingAddress:we,selectedBrandValue:Ae,storePaymentMethod:Ce,socialSecurityNumber:xe,installments:Be})}),[ie,ne,te,Ae,Ce,Be]);const hr=l.storedPaymentMethodId?v:F;return e(r,null,e(i,H(K({ref:z},g(l)),{styles:K({},l.styles),koreanAuthenticationRequired:l.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!l.configuration.koreanAuthenticationRequired||"kr"!==l.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!l.hasHolderName)return;const r=b("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Ge("holderName",r),Je("holderName",!0),Qe("holderName",null))}else l.autoFocus&&X.current>0&&"handleOnFieldValid"===(null==r?void 0:r.event)&&(null==r?void 0:r.fieldType)===m&&e.valid.encryptedCardNumber&&ur(),le(K({},ie,e.data)),oe(K({},te,e.errors)),se(K({},ne,e.valid)),me(e.isSfpValid),ye(e.cvcPolicy),Re(e.showSocialSecurityNumber),fe(e.expiryDatePolicy)},onBrand:sr,onFocus:ar,onStateUpdate:cr,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?lr:null,render:({setRootNode:r,setFocusOn:t},o)=>{var n;return e("div",{ref:r,className:w({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${null!==(n=l.fundingSource)&&void 0!==n?n:"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===ee}),role:"form"},Le&&e(x,null),e(hr,H(K({},A(l)),{data:ie,valid:ne,errors:te,handleChangeFor:Ke,focusedElement:de,setFocusOn:t,sfpState:o,cvcPolicy:be,hasInstallments:Xe,showAmountsInInstallments:Ze,handleInstallments:Ve,brandsIcons:l.brandsIcons,formData:Ue,formErrors:We,formValid:ze,expiryDatePolicy:pe,dualBrandSelectElements:ge,extensions:pr,selectedBrandValue:Ae,showKCP:rr,showBrazilianSSN:tr,socialSecurityNumber:xe,handleOnStoreDetails:Pe,setAddressRef:J,billingAddress:we,billingAddressValidationRules:Fe&&k(Oe.current),partialAddressSchema:Fe,handleAddress:dr,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:De,onFieldFocusAnalytics:or,onFieldBlurAnalytics:nr})))}})),l.fastlaneConfiguration&&e(V,H(K({},l.fastlaneConfiguration),{currentDetectedBrand:Me,onChange:l.onChange,onSubmitAnalytics:l.onSubmitAnalytics})),Le&&l.showPayButton&&l.payButton({status:ee,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:$({imageFolder:"components/"})(`${I}lock`)}))};U.defaultProps=l;export{U as default};
1
+ import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as t,useMemo as o,useState as n,useCallback as s,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import i from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import l from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{DATE_POLICY_REQUIRED as u,CVC_POLICY_REQUIRED as c,ENCRYPTED_CARD_NUMBER as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputValidationRules as p,cardInputFormatters as f,getRuleByNameAndMode as b}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import h from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as g,extractPropsForSFP as S,getLayout as N,extractPropsForCardFields as A}from"./utils.js";import j from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as v}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as F}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as O,getFocusHandler as C,getAddressHandler as w}from"./handlers.js";import P from"../../../../_virtual/index.js";import{getPartialAddressValidationRules as k}from"../../../internal/Address/validate.js";import E from"../../../../core/Context/useImage.js";import{getArrayDifferences as R}from"../../../../utils/arrayUtils.js";import x from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as B}from"../../../internal/Icon/constants.js";import I from"./useSRPanelForCardInputErrors.js";import V from"../Fastlane/FastlaneSignup.js";import{ANALYTICS_VALIDATION_ERROR_STR as D,ANALYTICS_DISPLAYED_STR as q,ANALYTICS_SELECTED_STR as M}from"../../../../core/Analytics/constants.js";import{fieldTypeToSnakeCase as _}from"../../../internal/SecuredFields/utils.js";import{getErrorMessageFromCode as L}from"../../../../core/Errors/utils.js";import{SF_ErrorCodes as T}from"../../../../core/Errors/constants.js";import{usePrevious as K}from"../../../../utils/hookUtils.js";import{AnalyticsInfoEvent as U}from"../../../../core/Analytics/AnalyticsInfoEvent.js";function H(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function z(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){H(e,r,t[r])}))}return e}function W(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const $="dual_brand_button",G=l=>{var H,G;const J=t(null),Q=t(!1),X=E(),Y=t(null),Z=e=>{Y.current=e},ee=t({});Object.keys(ee.current).length||l.setComponentRef(ee.current);const re=t(0),te=t(!1),oe=o((()=>new j(l.specifications)),[l.specifications]);ee.current.sfp=J;const[ne,se]=n("ready"),[ae,ie]=n({}),[le,de]=n(z({},l.holderNameRequired&&{holderName:!1}));var ue;const[ce,me]=n(z({},l.hasHolderName&&{holderName:null!==(ue=l.data.holderName)&&void 0!==ue?ue:""})),[pe,fe]=n(""),[be,ye]=n(!1),[he,ge]=n(u),[Se,Ne]=n(c),[Ae,je]=n(null),[ve,Fe]=n([]),[Oe,Ce]=n(l.storedPaymentMethodId?l.brand:""),we=l.billingAddressMode!==d.none&&l.billingAddressRequired,Pe=g(l.billingAddressMode),ke=t(Pe&&(null===(G=l.data)||void 0===G||null===(H=G.billingAddress)||void 0===H?void 0:H.country)),[Ee,Re]=n(!1),[xe,Be]=n(we?l.data.billingAddress:null),[Ie,Ve]=n(!1),[De,qe]=n(""),[Me,_e]=n({value:null}),[Le,Te]=n(null),[Ke,Ue]=n("card"),[He,ze]=n(!1),{handleChangeFor:We,triggerValidation:$e,data:Ge,valid:Je,errors:Qe,setSchema:Xe,setData:Ye,setValid:Ze,setErrors:er}=h({schema:[],defaultData:l.data,formatters:f,rules:p}),rr=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource;var tr;const or=null===(tr=l.showInstallmentAmounts)||void 0===tr||tr,nr="kr"===(null!=Ae?Ae:l.countryCode),sr=l.configuration.koreanAuthenticationRequired&&nr,ar=Ie&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,ir=(e,r)=>{l.onFocus({fieldType:e,event:r})},lr=(e,r)=>{l.onBlur({fieldType:e,event:r})},dr=s((e=>{Ue(e.brand),l.onBrand(e)}),[]),ur=C(fe,ir,lr),cr=()=>N(z({props:l,showKCP:sr,showBrazilianSSN:ar},l.billingAddressRequired&&{countrySpecificSchemas:oe.getAddressSchemaForCountry(null==xe?void 0:xe.country),billingAddressRequiredFields:l.billingAddressRequiredFields})),mr=s((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;Te(r)}),[]),pr=w(Ye,Ze,er),fr=O(te,J,cr()),br=s((e=>{yr(e)}),[He,ze]),yr=e=>{e.status&&("loading"==e.status?ze(!1):ze(!0))},hr=o((()=>y(l,{sfp:J},{dualBrandSelectElements:ve,setDualBrandSelectElements:Fe,setSelectedBrandValue:Ce,issuingCountryCode:Ae,setIssuingCountryCode:je},re)),[ve,Ae]);ee.current.showValidation=()=>{Q.current=!0,null==Nr||Nr(),J.current.showValidation(),$e(["holderName","socialSecurityNumber","taxNumber"]),(null==Y?void 0:Y.current)&&Y.current.showValidation()},ee.current.processBinLookupResponse=(e,r)=>{hr.processBinLookup(e,r)},ee.current.setStatus=se,a((()=>(ee.current.setFocusOn=J.current.setFocusOn,ee.current.updateStyles=J.current.updateStyles,ee.current.handleUnsupportedCard=J.current.handleUnsupportedCard,()=>{J.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...ar?["socialSecurityNumber"]:[],...sr?["taxNumber"]:[],...we?["billingAddress"]:[]];Xe(e)}),[l.hasHolderName,ar,sr]),a((()=>{var e;me(W(z({},ce),{holderName:null!==(e=Ge.holderName)&&void 0!==e?e:"",taxNumber:Ge.taxNumber})),qe(Ge.socialSecurityNumber),we&&Be(z({},Ge.billingAddress)),de(W(z({},le),{holderName:!l.holderNameRequired||Je.holderName,socialSecurityNumber:!!Je.socialSecurityNumber&&Je.socialSecurityNumber,taxNumber:!!Je.taxNumber&&Je.taxNumber,billingAddress:!!Je.billingAddress&&Je.billingAddress}));const r=!!Qe.billingAddress&&Object.entries(Qe.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);ie(W(z({},ae),{holderName:l.holderNameRequired&&Qe.holderName?Qe.holderName:null,socialSecurityNumber:ar&&Qe.socialSecurityNumber?Qe.socialSecurityNumber:null,taxNumber:sr&&Qe.taxNumber?Qe.taxNumber:null,billingAddress:we&&r?Qe.billingAddress:null}))}),[Ge,Je,Qe]);const{sortedErrorList:gr,previousSortedErrors:Sr,clearSRPanel:Nr}=I({errors:ae,props:l,isValidating:Q,retrieveLayout:cr,specifications:oe,billingAddress:xe,sfp:J});a((()=>{if(gr){const e=R(gr,Sr,"field");null==e||e.forEach((e=>{const r=new U({type:D,target:_(e.field),validationErrorCode:e.errorCode,validationErrorMessage:L(e.errorCode,T)});l.onSubmitAnalytics(r)}))}}),[gr]),a((()=>{const e=le.holderName,r=be,t=!we||le.billingAddress,o=!sr||!!le.taxNumber&&!!le.encryptedPassword,n=!ar||!!le.socialSecurityNumber,s=r&&e&&t&&o&&n,a=J.current.mapErrorsToValidationRuleResult(),i=z({},ae,a);l.onChange({data:ce,valid:le,errors:i,isValid:s,billingAddress:xe,selectedBrandValue:Oe,storePaymentMethod:Ee,socialSecurityNumber:De,installments:Me})}),[ce,le,ae,Oe,Ee,Me]),a((()=>{if(ve.length>0&&ve){const e=ve.map((e=>e.id)),r=e[0],t=e.toString(),o=new U({type:q,target:$,brand:r,configData:{dualBrands:t}});l.onSubmitAnalytics(o)}}),[ve]);const Ar=K(Oe);a((()=>{if((null==Ar?void 0:Ar.length)&&(null==Oe?void 0:Oe.length)){const e=new U({type:M,target:$,brand:Oe});l.onSubmitAnalytics(e)}}),[Oe]);const jr=l.storedPaymentMethodId?v:F;return e(r,null,e(i,W(z({ref:J},S(l)),{styles:z({},l.styles),koreanAuthenticationRequired:l.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!l.configuration.koreanAuthenticationRequired||"kr"!==l.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!l.hasHolderName)return;const r=b("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Ye("holderName",r),Ze("holderName",!0),er("holderName",null))}else l.autoFocus&&re.current>0&&"handleOnFieldValid"===(null==r?void 0:r.event)&&(null==r?void 0:r.fieldType)===m&&e.valid.encryptedCardNumber&&fr(),me(z({},ce,e.data)),ie(z({},ae,e.errors)),de(z({},le,e.valid)),ye(e.isSfpValid),Ne(e.cvcPolicy),Ve(e.showSocialSecurityNumber),ge(e.expiryDatePolicy)},onBrand:dr,onFocus:ur,onStateUpdate:br,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?mr:null,render:({setRootNode:r,setFocusOn:t},o)=>{var n;return e("div",{ref:r,className:P({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${null!==(n=l.fundingSource)&&void 0!==n?n:"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===ne}),role:"form"},He&&e(x,null),e(jr,W(z({},A(l)),{data:ce,valid:le,errors:ae,handleChangeFor:We,focusedElement:pe,setFocusOn:t,sfpState:o,cvcPolicy:Se,hasInstallments:rr,showAmountsInInstallments:or,handleInstallments:_e,brandsIcons:l.brandsIcons,formData:Ge,formErrors:Qe,formValid:Je,expiryDatePolicy:he,dualBrandSelectElements:ve,extensions:hr,selectedBrandValue:Oe,showKCP:sr,showBrazilianSSN:ar,socialSecurityNumber:De,handleOnStoreDetails:Re,setAddressRef:Z,billingAddress:xe,billingAddressValidationRules:Pe&&k(ke.current),partialAddressSchema:Pe,handleAddress:pr,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:Le,onFieldFocusAnalytics:ir,onFieldBlurAnalytics:lr})))}})),l.fastlaneConfiguration&&e(V,W(z({},l.fastlaneConfiguration),{currentDetectedBrand:Ke,onChange:l.onChange,onSubmitAnalytics:l.onSubmitAnalytics})),He&&l.showPayButton&&l.payButton({status:ne,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:X({imageFolder:"components/"})(`${B}lock`)}))};G.defaultProps=l;export{G as default};
2
2
  //# sourceMappingURL=CardInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CardBrandData, CardFocusData } from '../../../internal/SecuredFields/lib/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\nimport FastlaneSignup from '../Fastlane/FastlaneSignup';\nimport { ANALYTICS_VALIDATION_ERROR_STR } from '../../../../core/Analytics/constants';\nimport { fieldTypeToSnakeCase } from '../../../internal/SecuredFields/utils';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { AnalyticsInfoEvent } from '../../../../core/Analytics/AnalyticsInfoEvent';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * This stores the brand as detected by the internal regEx.\n * It eventually gets overwritten by the brand as detected by the /binLookup, but will revert back to the regEx detection\n * if the PAN length drops below the /binLookup digit threshold.\n * Default value, 'card', indicates no brand detected\n */\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\n\n /**\n * Used tho show and hide the pay button and instructions text\n * Should mimic the same logic as CardInput loading wrapper\n */\n const [showCardUIElements, setShowCardUIElements] = useState(false);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n const onBrand = useCallback((obj: CardBrandData) => {\n setInternallyDetectedBrand(obj.brand);\n props.onBrand(obj);\n }, []);\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n /**\n * Listen to the full SecureFieldsProvider state and handle actions\n * Used right now to mimic the loading status changes, this can only be done this way\n * Trying to do it via onConfiguSuccess or onChange has side effects\n */\n const handleSFPStateUpdate = useCallback(\n sfpState => {\n mimicLoadingStatusChange(sfpState);\n },\n [showCardUIElements, setShowCardUIElements]\n );\n\n /**\n * This function implements the same logic that LoadingProvider uses to show and hide elements\n * We want to mimic this behavior so we can hide and show the pay button or the instructions text\n * Deciding to do it this way since we garante there's no DOM changes to merchants\n * We can break this in the next major version (v7)\n */\n const mimicLoadingStatusChange = sfpState => {\n if (!sfpState.status) return;\n if (sfpState.status == 'loading') {\n setShowCardUIElements(false);\n } else {\n setShowCardUIElements(true);\n }\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n useEffect(() => {\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n\n newErrors?.forEach(errorItem => {\n const event = new AnalyticsInfoEvent({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(errorItem.field),\n validationErrorCode: errorItem.errorCode,\n validationErrorMessage: getErrorMessageFromCode(errorItem.errorCode, SF_ErrorCodes)\n });\n props.onSubmitAnalytics(event);\n });\n }\n }, [currentErrorsSortedByLayout]);\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={onBrand}\n onFocus={handleFocus}\n onStateUpdate={handleSFPStateUpdate}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n {showCardUIElements && <FormInstruction />}\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n\n {props.fastlaneConfiguration && (\n <FastlaneSignup\n {...props.fastlaneConfiguration}\n currentDetectedBrand={internallyDetectedBrand}\n onChange={props.onChange}\n onSubmitAnalytics={props.onSubmitAnalytics}\n />\n )}\n\n {showCardUIElements &&\n props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","_object_spread","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","internallyDetectedBrand","setInternallyDetectedBrand","showCardUIElements","setShowCardUIElements","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","onBrand","useCallback","obj","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","handleSFPStateUpdate","sfpState","mimicLoadingStatusChange","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","_object_spread_props","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","AnalyticsInfoEvent","type","ANALYTICS_VALIDATION_ERROR_STR","target","fieldTypeToSnakeCase","field","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onSubmitAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onStateUpdate","disableIOSArrowKeys","render","setRootNode","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","fastlaneConfiguration","FastlaneSignup","currentDetectedBrand","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"wzFAoCA,MAAMA,EAAaC,QAkDsDA,EAAAA,EAjDrE,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,IAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,EAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,GAAQC,IAAaC,EAAS,UAE9BC,GAAQC,IAAaF,EAA8B,CAAA,IACnDG,GAAOC,IAAYJ,EAA8BK,EAChD3B,CAAAA,EAAAA,EAAM4B,oBAAsB,CAAEC,YAAY,KAGL7B,IAAAA,GAD7C,MAAO8B,GAAMC,IAAWT,EAA6BK,EAC7C3B,CAAAA,EAAAA,EAAMgC,eAAiB,CAAEH,WAAiC,QAArB7B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
1
+ {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CardBrandData, CardFocusData } from '../../../internal/SecuredFields/lib/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\nimport FastlaneSignup from '../Fastlane/FastlaneSignup';\nimport { ANALYTICS_VALIDATION_ERROR_STR, ANALYTICS_DISPLAYED_STR, ANALYTICS_SELECTED_STR } from '../../../../core/Analytics/constants';\nimport { fieldTypeToSnakeCase } from '../../../internal/SecuredFields/utils';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { usePrevious } from '../../../../utils/hookUtils';\nimport { AnalyticsInfoEvent } from '../../../../core/Analytics/AnalyticsInfoEvent';\n\nconst DUAL_BRAND_BUTTON = 'dual_brand_button';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * This stores the brand as detected by the internal regEx.\n * It eventually gets overwritten by the brand as detected by the /binLookup, but will revert back to the regEx detection\n * if the PAN length drops below the /binLookup digit threshold.\n * Default value, 'card', indicates no brand detected\n */\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\n\n /**\n * Used tho show and hide the pay button and instructions text\n * Should mimic the same logic as CardInput loading wrapper\n */\n const [showCardUIElements, setShowCardUIElements] = useState(false);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n const onBrand = useCallback((obj: CardBrandData) => {\n setInternallyDetectedBrand(obj.brand);\n props.onBrand(obj);\n }, []);\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n /**\n * Listen to the full SecureFieldsProvider state and handle actions\n * Used right now to mimic the loading status changes, this can only be done this way\n * Trying to do it via onConfiguSuccess or onChange has side effects\n */\n const handleSFPStateUpdate = useCallback(\n sfpState => {\n mimicLoadingStatusChange(sfpState);\n },\n [showCardUIElements, setShowCardUIElements]\n );\n\n /**\n * This function implements the same logic that LoadingProvider uses to show and hide elements\n * We want to mimic this behavior so we can hide and show the pay button or the instructions text\n * Deciding to do it this way since we garante there's no DOM changes to merchants\n * We can break this in the next major version (v7)\n */\n const mimicLoadingStatusChange = sfpState => {\n if (!sfpState.status) return;\n if (sfpState.status == 'loading') {\n setShowCardUIElements(false);\n } else {\n setShowCardUIElements(true);\n }\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n useEffect(() => {\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n\n newErrors?.forEach(errorItem => {\n const event = new AnalyticsInfoEvent({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(errorItem.field),\n validationErrorCode: errorItem.errorCode,\n validationErrorMessage: getErrorMessageFromCode(errorItem.errorCode, SF_ErrorCodes)\n });\n props.onSubmitAnalytics(event);\n });\n }\n }, [currentErrorsSortedByLayout]);\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * \"Update\" handler related to dual brand buttons being initially displayed\n */\n useEffect(() => {\n if (dualBrandSelectElements.length > 0 && dualBrandSelectElements) {\n const dualBrandsArr = dualBrandSelectElements.map(item => item.id);\n const brand = dualBrandsArr[0]; // initially selected brand\n const dualBrands = dualBrandsArr.toString();\n\n const event = new AnalyticsInfoEvent({\n type: ANALYTICS_DISPLAYED_STR,\n target: DUAL_BRAND_BUTTON,\n brand,\n configData: { dualBrands }\n });\n\n props.onSubmitAnalytics(event);\n }\n }, [dualBrandSelectElements]);\n\n const previousSelectedBrandValue = usePrevious(selectedBrandValue);\n\n /**\n * \"Update\" handler related to a dual brand button being selected\n */\n useEffect(() => {\n if (previousSelectedBrandValue?.length && selectedBrandValue?.length) {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_SELECTED_STR, target: DUAL_BRAND_BUTTON, brand: selectedBrandValue });\n\n props.onSubmitAnalytics(event);\n }\n }, [selectedBrandValue]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={onBrand}\n onFocus={handleFocus}\n onStateUpdate={handleSFPStateUpdate}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n {showCardUIElements && <FormInstruction />}\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n\n {props.fastlaneConfiguration && (\n <FastlaneSignup\n {...props.fastlaneConfiguration}\n currentDetectedBrand={internallyDetectedBrand}\n onChange={props.onChange}\n onSubmitAnalytics={props.onSubmitAnalytics}\n />\n )}\n\n {showCardUIElements &&\n props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["DUAL_BRAND_BUTTON","CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","_object_spread","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","internallyDetectedBrand","setInternallyDetectedBrand","showCardUIElements","setShowCardUIElements","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","onBrand","useCallback","obj","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","handleSFPStateUpdate","sfpState","mimicLoadingStatusChange","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","_object_spread_props","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","AnalyticsInfoEvent","type","ANALYTICS_VALIDATION_ERROR_STR","target","fieldTypeToSnakeCase","field","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onSubmitAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","dualBrandsArr","map","item","id","dualBrands","toString","ANALYTICS_DISPLAYED_STR","configData","previousSelectedBrandValue","usePrevious","ANALYTICS_SELECTED_STR","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onStateUpdate","disableIOSArrowKeys","render","setRootNode","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","fastlaneConfiguration","FastlaneSignup","currentDetectedBrand","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"86FAqCA,MAAMA,EAAoB,oBAEpBC,EAAaC,QAkDsDA,EAAAA,EAjDrE,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,GAAeR,EAAqB,IAErCS,OAAOC,KAAKF,GAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,GAAaD,SAGvC,MAAMM,GAAkBb,EAAO,GACzBc,GAAgBd,GAAO,GAEvBe,GAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,GAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,GAAQC,IAAaC,EAAS,UAE9BC,GAAQC,IAAaF,EAA8B,CAAA,IACnDG,GAAOC,IAAYJ,EAA8BK,EAChD3B,CAAAA,EAAAA,EAAM4B,oBAAsB,CAAEC,YAAY,KAGL7B,IAAAA,GAD7C,MAAO8B,GAAMC,IAAWT,EAA6BK,EAC7C3B,CAAAA,EAAAA,EAAMgC,eAAiB,CAAEH,WAAiC,QAArB7B,GAAAA,EAAM8B,KAAKD,sBAAX7B,GAAAA,GAAyB,OAG/DiC,GAAgBC,IAAqBZ,EAAS,KAC9Ca,GAAYC,IAAiBd,GAAS,IACtCe,GAAkBC,IAAu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EAAMsO,kBACzBC,wBAAyBvO,EAAMuO,wBAE/BhK,gBAAiBA,GAEjBkC,sBAAuBA,GACvBM,qBAAsBA,WAMrC/G,EAAMwO,uBACHjC,EAACkC,EAAAA,EAAAA,EAAAA,CAAAA,EACOzO,EAAMwO,uBAAqB,CAC/BE,qBAAsBjK,GACtB+G,SAAUxL,EAAMwL,SAChBX,kBAAmB7K,EAAM6K,qBAIhClG,IACG3E,EAAM2O,eACN3O,EAAM4O,UAAU,CACZxN,UACAyN,QAAS7O,EAAM8O,0BAA4B,UAAY,YACvDC,KAAM3O,EAAS,CAAE4O,YAAa,eAAxB5O,CAAyC,GAAG6O,WACtD,EAKhBlP,EAAUmP,aAAeA"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import n from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as i,ENCRYPTED_CARD_NUMBER as c,DATE_POLICY_HIDDEN as o,ENCRYPTED_EXPIRY_DATE as l,ENCRYPTED_SECURITY_CODE as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function p({brand:p,brandsIcons:m,brandsConfiguration:y,dualBrandingElements:C,dualBrandingChangeHandler:x,dualBrandingSelected:f,errors:_,focusedElement:b,hasCVC:g,cvcPolicy:h,expiryDatePolicy:v,onFocusField:E,showBrandIcon:B,valid:F,showContextualElement:N}){const{i18n:j}=d(),k=(e,r)=>e[r]?j.get(e[r]):null,w=null==m?void 0:m.filter((e=>!(null==i?void 0:i.includes(e.name)))),D="amex"===p,S=D?j.get("creditCard.securityCode.contextualText.4digits"):j.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form"},e(r,{brand:p,brandsConfiguration:y,error:k(_,c),focused:b===c,isValid:!!F.encryptedCardNumber,label:j.get("creditCard.cardNumber.label"),onFocusField:E,filled:!!_.encryptedCardNumber||!!F.encryptedCardNumber,showBrandIcon:B,dualBrandingElements:C,dualBrandingChangeHandler:x,dualBrandingSelected:f}),e(u,{activeBrand:p,brands:w}),e("div",{className:n("adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":v===o})},e(a,{error:k(_,l),focused:b===l,isValid:!!F.encryptedExpiryMonth&&!!F.encryptedExpiryYear,filled:!!_.encryptedExpiryDate||!!F.encryptedExpiryYear,label:j.get("creditCard.expiryDate.label"),onFocusField:E,className:"adyen-checkout__field--50",expiryDatePolicy:v,showContextualElement:N,contextualText:j.get("creditCard.expiryDate.contextualText")}),g&&e(t,{error:k(_,s),focused:b===s,cvcPolicy:h,isValid:!!F.encryptedSecurityCode,filled:!!_.encryptedSecurityCode||!!F.encryptedSecurityCode,label:j.get("creditCard.securityCode.label"),onFocusField:E,className:"adyen-checkout__field--50",frontCVC:D,showContextualElement:N,contextualText:S})))}export{p as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import o from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as i,ENCRYPTED_CARD_NUMBER as c,DATE_POLICY_HIDDEN as n,ENCRYPTED_EXPIRY_DATE as l,ENCRYPTED_SECURITY_CODE as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function p({brand:p,brandsIcons:m,brandsConfiguration:y,dualBrandingElements:x,errors:C,focusedElement:f,hasCVC:_,cvcPolicy:b,expiryDatePolicy:h,onFocusField:v,showBrandIcon:g,valid:E,showContextualElement:F}){const{i18n:N}=d(),j=(e,r)=>e[r]?N.get(e[r]):null,B=null==m?void 0:m.filter((e=>!(null==i?void 0:i.includes(e.name)))),k="amex"===p,w=k?N.get("creditCard.securityCode.contextualText.4digits"):N.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form"},e(r,{brand:p,brandsConfiguration:y,error:j(C,c),focused:f===c,isValid:!!E.encryptedCardNumber,label:N.get("creditCard.cardNumber.label"),onFocusField:v,filled:!!C.encryptedCardNumber||!!E.encryptedCardNumber,showBrandIcon:g,dualBrandingElements:x}),e(u,{activeBrand:p,brands:B}),e("div",{className:o("adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":h===n})},e(a,{error:j(C,l),focused:f===l,isValid:!!E.encryptedExpiryMonth&&!!E.encryptedExpiryYear,filled:!!C.encryptedExpiryDate||!!E.encryptedExpiryYear,label:N.get("creditCard.expiryDate.label"),onFocusField:v,className:"adyen-checkout__field--50",expiryDatePolicy:h,showContextualElement:F,contextualText:N.get("creditCard.expiryDate.contextualText")}),_&&e(t,{error:j(C,s),focused:f===s,cvcPolicy:b,isValid:!!E.encryptedSecurityCode,filled:!!C.encryptedSecurityCode||!!E.encryptedSecurityCode,label:N.get("creditCard.securityCode.label"),onFocusField:v,className:"adyen-checkout__field--50",frontCVC:k,showContextualElement:F,contextualText:w})))}export{p as default};
2
2
  //# sourceMappingURL=CardFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n dualBrandingChangeHandler,\n dualBrandingSelected,\n errors,\n focusedElement,\n hasCVC,\n cvcPolicy,\n expiryDatePolicy,\n onFocusField,\n showBrandIcon,\n valid,\n showContextualElement\n}: CardFieldsProps) {\n const { i18n } = useCoreContext();\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n // A set of brands filtered to exclude those that can never appear in the UI\n const allowedBrands = brandsIcons?.filter(brandsIcons => !BRAND_ICON_UI_EXCLUSION_LIST?.includes(brandsIcons.name));\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n return (\n <div className=\"adyen-checkout__card__form\">\n <CardNumber\n brand={brand}\n brandsConfiguration={brandsConfiguration}\n error={getError(errors, ENCRYPTED_CARD_NUMBER)}\n focused={focusedElement === ENCRYPTED_CARD_NUMBER}\n isValid={!!valid.encryptedCardNumber}\n label={i18n.get('creditCard.cardNumber.label')}\n onFocusField={onFocusField}\n filled={!!errors.encryptedCardNumber || !!valid.encryptedCardNumber}\n showBrandIcon={showBrandIcon}\n dualBrandingElements={dualBrandingElements}\n dualBrandingChangeHandler={dualBrandingChangeHandler}\n dualBrandingSelected={dualBrandingSelected}\n />\n\n <AvailableBrands activeBrand={brand} brands={allowedBrands} />\n\n <div\n className={classNames('adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper', {\n 'adyen-checkout__card__exp-cvc__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN\n })}\n >\n <ExpirationDate\n error={getError(errors, ENCRYPTED_EXPIRY_DATE)}\n focused={focusedElement === ENCRYPTED_EXPIRY_DATE}\n isValid={!!valid.encryptedExpiryMonth && !!valid.encryptedExpiryYear}\n filled={!!errors.encryptedExpiryDate || !!valid.encryptedExpiryYear}\n label={i18n.get('creditCard.expiryDate.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n expiryDatePolicy={expiryDatePolicy}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('creditCard.expiryDate.contextualText')}\n />\n\n {hasCVC && (\n <CVC\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === ENCRYPTED_SECURITY_CODE}\n cvcPolicy={cvcPolicy}\n isValid={!!valid.encryptedSecurityCode}\n filled={!!errors.encryptedSecurityCode || !!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CardFields","brand","brandsIcons","brandsConfiguration","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","errors","focusedElement","hasCVC","cvcPolicy","expiryDatePolicy","onFocusField","showBrandIcon","valid","showContextualElement","i18n","useCoreContext","getError","fieldType","get","allowedBrands","filter","BRAND_ICON_UI_EXCLUSION_LIST","includes","name","isAmex","cvcContextualText","h","div","className","CardNumber","error","ENCRYPTED_CARD_NUMBER","focused","isValid","encryptedCardNumber","label","filled","AvailableBrands","activeBrand","brands","classNames","DATE_POLICY_HIDDEN","ExpirationDate","ENCRYPTED_EXPIRY_DATE","encryptedExpiryMonth","encryptedExpiryYear","encryptedExpiryDate","contextualText","CVC","ENCRYPTED_SECURITY_CODE","encryptedSecurityCode","frontCVC"],"mappings":"uiBAgBe,SAASA,GAAWC,MAC/BA,EAAKC,YACLA,EAAWC,oBACXA,EAAmBC,qBACnBA,EAAoBC,0BACpBA,EAAyBC,qBACzBA,EAAoBC,OACpBA,EAAMC,eACNA,EAAcC,OACdA,EAAMC,UACNA,EAASC,iBACTA,EAAgBC,aAChBA,EAAYC,cACZA,EAAaC,MACbA,EAAKC,sBACLA,IAEA,MAAMC,KAAEA,GAASC,IAEXC,EAAW,CAACX,EAAQY,IACfZ,EAA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EACvBkC,eAAgBtB,KAMxC"}
1
+ {"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n errors,\n focusedElement,\n hasCVC,\n cvcPolicy,\n expiryDatePolicy,\n onFocusField,\n showBrandIcon,\n valid,\n showContextualElement\n}: CardFieldsProps) {\n const { i18n } = useCoreContext();\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n // A set of brands filtered to exclude those that can never appear in the UI\n const allowedBrands = brandsIcons?.filter(brandsIcons => !BRAND_ICON_UI_EXCLUSION_LIST?.includes(brandsIcons.name));\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n return (\n <div className=\"adyen-checkout__card__form\">\n <CardNumber\n brand={brand}\n brandsConfiguration={brandsConfiguration}\n error={getError(errors, ENCRYPTED_CARD_NUMBER)}\n focused={focusedElement === ENCRYPTED_CARD_NUMBER}\n isValid={!!valid.encryptedCardNumber}\n label={i18n.get('creditCard.cardNumber.label')}\n onFocusField={onFocusField}\n filled={!!errors.encryptedCardNumber || !!valid.encryptedCardNumber}\n showBrandIcon={showBrandIcon}\n dualBrandingElements={dualBrandingElements}\n />\n\n <AvailableBrands activeBrand={brand} brands={allowedBrands} />\n\n <div\n className={classNames('adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper', {\n 'adyen-checkout__card__exp-cvc__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN\n })}\n >\n <ExpirationDate\n error={getError(errors, ENCRYPTED_EXPIRY_DATE)}\n focused={focusedElement === ENCRYPTED_EXPIRY_DATE}\n isValid={!!valid.encryptedExpiryMonth && !!valid.encryptedExpiryYear}\n filled={!!errors.encryptedExpiryDate || !!valid.encryptedExpiryYear}\n label={i18n.get('creditCard.expiryDate.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n expiryDatePolicy={expiryDatePolicy}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('creditCard.expiryDate.contextualText')}\n />\n\n {hasCVC && (\n <CVC\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === ENCRYPTED_SECURITY_CODE}\n cvcPolicy={cvcPolicy}\n isValid={!!valid.encryptedSecurityCode}\n filled={!!errors.encryptedSecurityCode || !!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CardFields","brand","brandsIcons","brandsConfiguration","dualBrandingElements","errors","focusedElement","hasCVC","cvcPolicy","expiryDatePolicy","onFocusField","showBrandIcon","valid","showContextualElement","i18n","useCoreContext","getError","fieldType","get","allowedBrands","filter","BRAND_ICON_UI_EXCLUSION_LIST","includes","name","isAmex","cvcContextualText","h","div","className","CardNumber","error","ENCRYPTED_CARD_NUMBER","focused","isValid","encryptedCardNumber","label","filled","AvailableBrands","activeBrand","brands","classNames","DATE_POLICY_HIDDEN","ExpirationDate","ENCRYPTED_EXPIRY_DATE","encryptedExpiryMonth","encryptedExpiryYear","encryptedExpiryDate","contextualText","CVC","ENC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AAKI,IAAI,0CAG5BX,GACGmB,EAACsB,EAAAA,CACGlB,MAAOd,EAASX,EAAQ4C,GACxBjB,QAAS1B,IAAmB2C,EAC5BzC,UAAWA,EACXyB,UAAWrB,EAAMsC,sBACjBd,SAAU/B,EAAO6C,yBAA2BtC,EAAMsC,sBAClDf,MAAOrB,EAAKI,IAAI,iCAChBR,aAAcA,EACdkB,UAAW,4BACXuB,SAAU3B,EACVX,sBAAuBA,EACvBkC,eAAgBtB,KAMxC"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import a from"./CardFields.js";import l from"./KCPAuthentication.js";import s from"../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js";import n from"../../../../internal/StoreDetails/StoreDetails.js";import o from"../../../../internal/Address/Address.js";import i from"./CardHolderName.js";import d from"./Installments/Installments.js";import t from"../../../../internal/DisclaimerMessage/DisclaimerMessage.js";const u=({data:u,valid:c,errors:m,handleChangeFor:p,sfpState:h,setFocusOn:b,cvcPolicy:y,focusedElement:N,hasInstallments:S,handleInstallments:A,showAmountsInInstallments:F,brandsIcons:g,formData:f,formErrors:C,formValid:B,expiryDatePolicy:x,dualBrandSelectElements:v,extensions:w,selectedBrandValue:D,showKCP:I,showBrazilianSSN:j,socialSecurityNumber:E,handleOnStoreDetails:P,billingAddress:O,handleAddress:k,setAddressRef:R,partialAddressSchema:V,onAddressLookup:q,onAddressSelected:M,addressSearchDebounceMs:H,amount:L,billingAddressRequired:T,billingAddressRequiredFields:_,billingAddressAllowedCountries:z,billingAddressValidationRules:K=null,brandsConfiguration:W,showStoreDetailsCheckbox:$,hasCVC:G,hasHolderName:J,holderNameRequired:Q,installmentOptions:U,placeholders:X,positionHolderNameOnTop:Y,showBrandIcon:Z,showContextualElement:ee,iOSFocusedField:re,disclaimerMessage:ae,onFieldFocusAnalytics:le,onFieldBlurAnalytics:se})=>{const ne=e(i,{required:Q,placeholder:X.holderName,value:f.holderName,error:!!C.holderName&&Q,isValid:!!B.holderName,onBlur:p("holderName","blur"),onInput:p("holderName","input"),disabled:re&&"holderName"!==re,onFieldFocusAnalytics:le,onFieldBlurAnalytics:se});return e(r,{status:h.status},J&&Y&&ne,e(a,{showBrandIcon:Z,showContextualElement:ee,brand:h.brand,brandsIcons:g,brandsConfiguration:W,focusedElement:N,onFocusField:b,hasCVC:G,cvcPolicy:y,expiryDatePolicy:x,errors:h.errors,valid:h.valid,dualBrandingElements:v.length>0&&v,dualBrandingChangeHandler:w.handleDualBrandSelection,dualBrandingSelected:D}),J&&!Y&&ne,I&&e(l,{onFocusField:b,focusedElement:N,encryptedPasswordState:{data:h.encryptedPassword,valid:!!h.valid&&h.valid.encryptedPassword,errors:!!h.errors&&h.errors.encryptedPassword},value:u.taxNumber,error:!!m.taxNumber,isValid:!!c.taxNumber,onBlur:p("taxNumber","blur"),onInput:p("taxNumber","input"),disabled:re&&"kcpTaxNumberOrDOB"!==re,placeholder:X.taxNumber,onFieldFocusAnalytics:le,onFieldBlurAnalytics:se}),j&&e("div",{className:"adyen-checkout__card__socialSecurityNumber"},e(s,{onBlur:p("socialSecurityNumber","blur"),onInput:p("socialSecurityNumber","input"),error:null==m?void 0:m.socialSecurityNumber,valid:null==c?void 0:c.socialSecurityNumber,data:E,required:!0,disabled:re&&"socialSecurityNumber"!==re,onFieldFocusAnalytics:le,onFieldBlurAnalytics:se})),$&&e(n,{onChange:P}),S&&e(d,{amount:L,brand:h.brand,installmentOptions:U,onChange:A,type:F?"amount":"months"}),T&&e(o,{label:"billingAddress",data:O,onChange:k,allowedCountries:z,requiredFields:_,setComponentRef:R,validationRules:K,specifications:V,iOSFocusedField:re,onAddressLookup:q,showContextualElement:ee,onAddressSelected:M,addressSearchDebounceMs:H,onFieldFocusAnalytics:le,onFieldBlurAnalytics:se}),ae&&e(t,{message:ae.message.replace("%{linkText}",`%#${ae.linkText}%#`),urls:[ae.link]}))};export{u as CardFieldsWrapper};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import s from"./CardFields.js";import a from"./KCPAuthentication.js";import l from"../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js";import o from"../../../../internal/StoreDetails/StoreDetails.js";import i from"../../../../internal/Address/Address.js";import n from"./CardHolderName.js";import t from"./Installments/Installments.js";import d from"../../../../internal/DisclaimerMessage/DisclaimerMessage.js";import u from"../../../../internal/FormFields/RadioGroupExtended/RadioGroupExtended.js";import{mapDualBrandButtons as c}from"../utils.js";import m from"../../../../internal/FormFields/Fieldset/Fieldset.js";import{useCoreContext as p}from"../../../../../core/Context/CoreProvider.js";const h=({data:h,valid:b,errors:F,handleChangeFor:y,sfpState:N,setFocusOn:S,cvcPolicy:f,focusedElement:A,hasInstallments:C,handleInstallments:g,showAmountsInInstallments:x,brandsIcons:B,formData:w,formErrors:v,formValid:j,expiryDatePolicy:D,dualBrandSelectElements:I,extensions:E,selectedBrandValue:P,showKCP:k,showBrazilianSSN:O,socialSecurityNumber:R,handleOnStoreDetails:q,billingAddress:V,handleAddress:M,setAddressRef:T,partialAddressSchema:L,onAddressLookup:_,onAddressSelected:z,addressSearchDebounceMs:H,amount:G,billingAddressRequired:K,billingAddressRequiredFields:W,billingAddressAllowedCountries:$,billingAddressValidationRules:J=null,brandsConfiguration:Q,showStoreDetailsCheckbox:U,hasCVC:X,hasHolderName:Y,holderNameRequired:Z,installmentOptions:ee,placeholders:re,positionHolderNameOnTop:se,showBrandIcon:ae,showContextualElement:le,iOSFocusedField:oe,disclaimerMessage:ie,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te})=>{const{i18n:de}=p(),ue=e(n,{required:Z,placeholder:re.holderName,value:w.holderName,error:!!v.holderName&&Z,isValid:!!j.holderName,onBlur:y("holderName","blur"),onInput:y("holderName","input"),disabled:oe&&"holderName"!==oe,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te});return e(r,{status:N.status},Y&&se&&ue,e(s,{showBrandIcon:ae,showContextualElement:le,brand:N.brand,brandsIcons:B,brandsConfiguration:Q,focusedElement:A,onFocusField:S,hasCVC:X,cvcPolicy:f,expiryDatePolicy:D,errors:N.errors,valid:N.valid,dualBrandingElements:I.length>0&&I}),Y&&!se&&ue,I.length>0&&I&&e(m,{classNameModifiers:["dual-brand-switcher"],label:de.get("creditCard.dualBrand.title")},e("p",{className:"adyen-checkout-form-instruction"},de.get("creditCard.dualBrand.description")),e(u,{name:"dualBrandSwitcher",value:P,items:c(I,Q),onChange:E.handleDualBrandSelection,required:!0,showSelectedTick:!0})),k&&e(a,{onFocusField:S,focusedElement:A,encryptedPasswordState:{data:N.encryptedPassword,valid:!!N.valid&&N.valid.encryptedPassword,errors:!!N.errors&&N.errors.encryptedPassword},value:h.taxNumber,error:!!F.taxNumber,isValid:!!b.taxNumber,onBlur:y("taxNumber","blur"),onInput:y("taxNumber","input"),disabled:oe&&"kcpTaxNumberOrDOB"!==oe,placeholder:re.taxNumber,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te}),O&&e("div",{className:"adyen-checkout__card__socialSecurityNumber"},e(l,{onBlur:y("socialSecurityNumber","blur"),onInput:y("socialSecurityNumber","input"),error:null==F?void 0:F.socialSecurityNumber,valid:null==b?void 0:b.socialSecurityNumber,data:R,required:!0,disabled:oe&&"socialSecurityNumber"!==oe,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te})),U&&e(o,{onChange:q}),C&&e(t,{amount:G,brand:N.brand,installmentOptions:ee,onChange:g,type:x?"amount":"months"}),K&&e(i,{label:"billingAddress",data:V,onChange:M,allowedCountries:$,requiredFields:W,setComponentRef:T,validationRules:J,specifications:L,iOSFocusedField:oe,onAddressLookup:_,showContextualElement:le,onAddressSelected:z,addressSearchDebounceMs:H,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te}),ie&&e(d,{message:ie.message.replace("%{linkText}",`%#${ie.linkText}%#`),urls:[ie.link]}))};export{h as CardFieldsWrapper};
2
2
  //# sourceMappingURL=CardFieldsWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n dualBrandingChangeHandler={extensions.handleDualBrandSelection}\n dualBrandingSelected={selectedBrandValue}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","dualBrandingChangeHandler","handleDualBrandSelection","dualBrandingSelected","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","className","SocialSecurityNumberBrazil","StoreDetails","onChange","Installments","type","Address","label","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"ykBAWaA,MAAAA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC,oBACAC,0BAEAC,SACAC,yBACAC,+BACAC,iCACAC,gCAAgC,KAChCC,sBACAC,2BACAC,SACAC,gBACAC,qBACAC,qBACAC,eACAC,0BAEAC,gBACAC,yBAEAC,mBACAC,qBAEAC,yBACAC,4BAEA,MAAMC,GACFC,EAACC,EAAAA,CACGC,SAAUb,EACVc,YAAaZ,EAAaa,WAC1BC,MAAO3C,EAAS0C,WAChBE,QAAS3C,EAAWyC,YAAcf,EAClCkB,UAAW3C,EAAUwC,WACrBI,OAAQvD,EAAgB,aAAc,QACtCwD,QAASxD,EAAgB,aAAc,SACvCyD,SAAUf,IAAuC,eAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,KAI9B,OACIE,EAACW,EAAAA,CAAeC,OAAQ1D,EAAS0D,QAC5BxB,GAAiBI,GAA2BO,GAE7CC,EAACa,E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W,WAIpDqB,GACGmB,EAACgC,EAAAA,CACGC,MAAM,iBACNnF,KAAMuB,EACNwD,SAAUvD,EACV4D,iBAAkBnD,EAClBoD,eAAgBrD,EAChBsD,gBAAiB7D,EACjB8D,gBAAiBrD,EACjBsD,eAAgB9D,EAChBmB,gBAAiBA,GACjBlB,gBAAiBA,EACjBiB,sBAAuBA,GACvBhB,kBAAmBA,EACnBC,wBAAyBA,EACzBkB,sBAAuBA,GACvBC,qBAAsBA,KAI7BF,IACGI,EAACuC,EAAAA,CACGC,QAAS5C,GAAkB4C,QAAQC,QAAQ,cAAe,KAAK7C,GAAkB8C,cACjFC,KAAM,CAAC/C,GAAkBgD"}
1
+ {"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\nimport RadioGroupExtended from '../../../../internal/FormFields/RadioGroupExtended';\nimport { mapDualBrandButtons } from '../utils';\nimport Fieldset from '../../../../internal/FormFields/Fieldset';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const { i18n } = useCoreContext();\n\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {dualBrandSelectElements.length > 0 && dualBrandSelectElements && (\n <Fieldset classNameModifiers={['dual-brand-switcher']} label={i18n.get('creditCard.dualBrand.title')}>\n <p className={'adyen-checkout-form-instruction'}>{i18n.get('creditCard.dualBrand.description')}</p>\n <RadioGroupExtended\n name={'dualBrandSwitcher'}\n value={selectedBrandValue} // Set which button is in a selected (checked) state\n items={mapDualBrandButtons(dualBrandSelectElements, brandsConfiguration)}\n onChange={extensions.handleDualBrandSelection}\n required={true}\n showSelectedTick={true}\n />\n </Fieldset>\n )}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","i18n","useCoreContext","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","Fieldset","classNameModifiers","label","get","p","className","RadioGroupExtended","name","items","mapDualBrandButtons","onChange","handleDualBrandSelection","showSelectedTick","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","SocialSecurityNumberBrazil","StoreDetails","Installments","type","Address","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"o2BAeaA,MAAAA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC,oBACAC,0BAEAC,SACAC,yBACAC,+BACAC,iCACAC,gCAAgC,KAChCC,sBACAC,2BACAC,SACAC,gBACAC,qBACAC,sBACAC,gBACAC,2BAEAC,iBACAC,yBAEAC,mBACAC,qBAEAC,yBACAC,4BAEA,MAAMC,KAAEA,IAASC,IAEXC,GACFC,EAACC,EAAAA,CACGC,SAAUf,EACVgB,YAAad,GAAae,WAC1BC,MAAO7C,EAAS4C,WAChBE,QAAS7C,EAAW2C,YAAcjB,EAClCoB,UAAW7C,EAAU0C,WACrBI,OAAQzD,EAAgB,aAAc,QACtC0D,QAAS1D,EAAgB,aAAc,SACvC2D,SAAUjB,IAAuC,eAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,KAI9B,OACII,EAACW,EAAAA,CAAeC,OAAQ5D,EAAS4D,QAC5B1B,GAAiBI,IAA2BS,GAE7CC,EAACa,EAAAA,CACGtB,cAAeA,GACfC,sBAAuBA,GACvBsB,MAAO9D,EAAS8D,MAChBvD,YAAaA,EACbwB,oBAAqBA,EACrB5B,eAAgBA,EAChB4D,aAAc9D,EACdgC,OAAQA,EACR/B,UAAWA,EACXS,iBAAkBA,EAClBb,OAAQE,EAASF,OACjBD,MAAOG,EAASH,MAChBmE,qBAAsBpD,EAAwBqD,OAAS,GAAKrD,IAG/DsB,IAAkBI,IAA2BS,GAE7CnC,EAAwBqD,OAAS,GAAKrD,GACnCoC,EAACkB,EAAAA,CAASC,mBAAoB,CAAC,uBAAw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,EAClB6D,eAAgB9D,EAChB+D,gBAAiBtE,EACjBuE,gBAAiB9D,EACjB+D,eAAgBvE,EAChBmB,gBAAiBA,GACjBlB,gBAAiBA,EACjBiB,sBAAuBA,GACvBhB,kBAAmBA,EACnBC,wBAAyBA,EACzBkB,sBAAuBA,GACvBC,qBAAsBA,KAI7BF,IACGM,EAAC8C,EAAAA,CACGC,QAASrD,GAAkBqD,QAAQC,QAAQ,cAAe,KAAKtD,GAAkBuD,cACjFC,KAAM,CAACxD,GAAkByD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../_virtual/index.js";import a from"./BrandIcon.js";import r from"./DualBrandingIcon/DualBrandingIcon.js";import d from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import i from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./FieldLabelAlternative.js";function l(l){const{i18n:s}=o(),{error:u="",isValid:_=!1,onFocusField:m=()=>{},dualBrandingElements:f,dualBrandingChangeHandler:p,dualBrandingSelected:b}=l;return e(d,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>m(t),errorMessage:u,isValid:_,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(i,{encryptedFieldType:t,className:n({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":_,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(a,{brandsConfiguration:l.brandsConfiguration,brand:l.brand,onClick:()=>{m(t)}}),f&&!u&&e("div",{className:n(["adyen-checkout__card__dual-branding__buttons",{"adyen-checkout__card__dual-branding__buttons--active":_}])},f.map((n=>e(r,{key:n.id,brand:n.id,brandsConfiguration:l.brandsConfiguration,onClick:p,dataValue:n.id,notSelected:""!==b&&b!==n.id})))))}export{l as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../../_virtual/index.js";import n from"./BrandIcon.js";import a from"./DualBrandingIcon/DualBrandingIcon.js";import o from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import d from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./FieldLabelAlternative.js";function l(l){const{i18n:s}=i(),{error:u="",isValid:m=!1,onFocusField:_=()=>{},dualBrandingElements:f}=l,p=()=>{_(t)};return e(o,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>_(t),errorMessage:u,isValid:m,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(d,{encryptedFieldType:t,className:r({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":m,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(n,{brandsConfiguration:l.brandsConfiguration,brand:l.brand,onClick:p}),f&&!u&&e("div",{className:r(["adyen-checkout__card__dual-branding__icons"])},f.map((r=>e(a,{key:r.id,brand:r.id,brandsConfiguration:l.brandsConfiguration,dataValue:r.id,onClick:p})))))}export{l as default};
2
2
  //# sourceMappingURL=CardNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements, dualBrandingChangeHandler, dualBrandingSelected } = props;\n\n const handleIconClick = () => {\n onFocusField(ENCRYPTED_CARD_NUMBER);\n };\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && (\n <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} onClick={handleIconClick} />\n )}\n\n {dualBrandingElements && !error && (\n <div\n className={classNames([\n 'adyen-checkout__card__dual-branding__buttons',\n { 'adyen-checkout__card__dual-branding__buttons--active': isValid }\n ])}\n >\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n onClick={dualBrandingChangeHandler}\n dataValue={element.id}\n notSelected={dualBrandingSelected !== '' && dualBrandingSelected !== element.id}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","h","Field","label","focused","filled","classNameModifiers","ENCRYPTED_CARD_NUMBER","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","onClick","div","map","element","DualBrandingIcon","key","id","dataValue","notSelected"],"mappings":"6hBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAMxI,OACIS,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaU,GACjCC,aAAcb,EACdC,QAASA,EACTa,IAAK,MACLC,KAAMH,EACNI,eAAe,EACflB,KAAMA,EACNmB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bd,EAACe,EAAAA,CACGC,mBAAoBV,EACpBW,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCxB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM4B,kBAIlE5B,EAAM4B,gBAAkBtB,GACrBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,MAAOC,QAnCnE,KACpB3B,EAAaU,EAAAA,IAqCRT,IAAyBH,GACtBM,EAACwB,MAAAA,CACGP,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB4B,KAAIC,GACtB1B,EAAC2B,EAAAA,CACGC,IAAKF,EAAQG,GACbP,MAAOI,EAAQG,GACfR,oBAAqB9B,EAAM8B,oBAC3BE,QAASzB,EACTgC,UAAWJ,EAAQG,GACnBE,YAAsC,KAAzBhC,GAA+BA,IAAyB2B,EAAQG,QAOzG"}
1
+ {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements } = props;\n\n const handleIconClick = () => {\n onFocusField(ENCRYPTED_CARD_NUMBER);\n };\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && (\n <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} onClick={handleIconClick} />\n )}\n\n {dualBrandingElements && !error && (\n <div className={classNames(['adyen-checkout__card__dual-branding__icons'])}>\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n dataValue={element.id}\n onClick={handleIconClick}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","handleIconClick","ENCRYPTED_CARD_NUMBER","h","Field","label","focused","filled","classNameModifiers","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","onClick","div","map","element","DualBrandingIcon","key","id","dataValue"],"mappings":"6hBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,GAAyBN,EAEjFO,EAAkB,KACpBF,EAAaG,EAAAA,EAGjB,OACIC,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaG,GACjCO,aAAcZ,EACdC,QAASA,EACTY,IAAK,MACLC,KAAMT,EACNU,eAAe,EACfjB,KAAMA,EACNkB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bb,EAACc,EAAAA,CACGC,mBAAoBhB,EACpBiB,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCvB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM2B,kBAIlE3B,EAAM2B,gBAAkBrB,GACrBG,EAACmB,EAAAA,CAAUC,oBAAqB7B,EAAM6B,oBAAqBC,MAAO9B,EAAM8B,MAAOC,QAASxB,IAG3FD,IAAyBH,GACtBM,EAACuB,MAAAA,CAAIP,UAAWC,EAAW,CAAC,gDACvBpB,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbP,MAAOI,EAAQG,GACfR,oBAAqB7B,EAAM6B,oBAC3BS,UAAWJ,EAAQG,GACnBN,QAASxB,OAOrC"}
@@ -1,2 +1,2 @@
1
- import{createElement as a}from"../../../../../../external/preact/dist/preact.js";import{getCardImageUrl as e,getFullBrandName as r}from"../../utils.js";import t from"../../../../../../core/Context/useImage.js";const o=({brand:o,onClick:c,dataValue:n,notSelected:d,brandsConfiguration:s={}})=>{var l;const i=t(),u="card"===o?"nocard":o;var _;const m=null!==(_=null===(l=s[o])||void 0===l?void 0:l.icon)&&void 0!==_?_:e(u,i);return a("img",{className:`adyen-checkout-card-input__icon ${d?"adyen-checkout__card__cardNumber__brandIcon--not-selected":""} adyen-checkout__card__cardNumber__brandIcon`,onError:a=>{a.target.style.cssText="display: none"},alt:r(o),src:m,onClick:c,"data-value":n})};export{o as default};
1
+ import{createElement as a}from"../../../../../../external/preact/dist/preact.js";import{getCardImageUrl as r,getFullBrandName as t}from"../../utils.js";import o from"../../../../../../core/Context/useImage.js";const e=({brand:e,onClick:n,dataValue:c,brandsConfiguration:s={}})=>{var d;const i=o(),l="card"===e?"nocard":e;var u;const m=null!==(u=null===(d=s[e])||void 0===d?void 0:d.icon)&&void 0!==u?u:r(l,i);return a("img",{className:"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon",onError:a=>{a.target.style.cssText="display: none"},alt:t(e),src:m,onClick:n,"data-value":c})};export{e as default};
2
2
  //# sourceMappingURL=DualBrandingIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DualBrandingIcon.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../../utils';\nimport { DualBrandingIconProps } from '../types';\nimport './DualBrandingIcon.scss';\nimport useImage from '../../../../../../core/Context/useImage';\n\nconst DualBrandingIcon = ({ brand, onClick, dataValue, notSelected, brandsConfiguration = {} }: DualBrandingIconProps) => {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n const handleError = e => {\n e.target.style.cssText = 'display: none';\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions\n <img\n className={`adyen-checkout-card-input__icon ${\n notSelected ? 'adyen-checkout__card__cardNumber__brandIcon--not-selected' : ''\n } adyen-checkout__card__cardNumber__brandIcon`}\n onError={handleError}\n alt={getFullBrandName(brand)}\n src={imageUrl}\n onClick={onClick}\n data-value={dataValue}\n />\n );\n};\n\nexport default DualBrandingIcon;\n"],"names":["DualBrandingIcon","brand","onClick","dataValue","notSelected","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","h","img","className","onError","e","target","style","cssText","alt","getFullBrandName","src","data-value"],"mappings":"kNAMA,MAAMA,EAAmB,EAAGC,QAAOC,UAASC,YAAWC,cAAaC,sBAAsB,CAAA,MAGrEA,IAAAA,EAFjB,MAAMC,EAAWC,IACXC,EAAsB,SAAVP,EAAmB,SAAWA,EAC/BI,IAAAA,EAAjB,MAAMI,EAA2C,QAAhCJ,EAAAA,QAAAA,EAAAA,EAAoBJ,UAApBI,IAAAA,OAAAA,EAAAA,EAA4BK,YAA5BL,IAAAA,EAAAA,EAAoCM,EAAgBH,EAAWF,GAKhF,OAEIM,EAACC,MAAAA,CACGC,UAAW,mCACPV,EAAc,4DAA8D,iDAEhFW,QAVYC,IAChBA,EAAEC,OAAOC,MAAMC,QAAU,eAAA,EAUrBC,IAAKC,EAAiBpB,GACtBqB,IAAKb,EACLP,QAASA,EACTqB,aAAYpB"}
1
+ {"version":3,"file":"DualBrandingIcon.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../../utils';\nimport { DualBrandingIconProps } from '../types';\nimport './DualBrandingIcon.scss';\nimport useImage from '../../../../../../core/Context/useImage';\n\nconst DualBrandingIcon = ({ brand, onClick, dataValue, brandsConfiguration = {} }: DualBrandingIconProps) => {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n const handleError = e => {\n e.target.style.cssText = 'display: none';\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions\n <img\n className={`adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon`}\n onError={handleError}\n alt={getFullBrandName(brand)}\n src={imageUrl}\n onClick={onClick}\n data-value={dataValue}\n />\n );\n};\n\nexport default DualBrandingIcon;\n"],"names":["DualBrandingIcon","brand","onClick","dataValue","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","h","img","className","onError","e","target","style","cssText","alt","getFullBrandName","src","data-value"],"mappings":"kNAMA,MAAMA,EAAmB,EAAGC,QAAOC,UAASC,YAAWC,sBAAsB,CAAA,MAGxDA,IAAAA,EAFjB,MAAMC,EAAWC,IACXC,EAAsB,SAAVN,EAAmB,SAAWA,EAC/BG,IAAAA,EAAjB,MAAMI,EAA2C,QAAhCJ,EAAAA,QAAAA,EAAAA,EAAoBH,UAApBG,IAAAA,OAAAA,EAAAA,EAA4BK,YAA5BL,IAAAA,EAAAA,EAAoCM,EAAgBH,EAAWF,GAKhF,OAEIM,EAACC,MAAAA,CACGC,UAAW,8EACXC,QARYC,IAChBA,EAAEC,OAAOC,MAAMC,QAAU,eAAA,EAQrBC,IAAKC,EAAiBnB,GACtBoB,IAAKb,EACLN,QAASA,EACToB,aAAYnB"}
@@ -1,2 +1,2 @@
1
- import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as s,KCP_CARD as a,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{DEFAULT_CARD_GROUP_TYPES as c,BRAND_READABLE_NAME_MAP as p}from"../../../internal/SecuredFields/lib/constants.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";import{DEFAULT_CHALLENGE_WINDOW_SIZE as g}from"../../../ThreeDS2/constants.js";import h from"./defaultProps.js";import{isConfigurationValid as y}from"../Fastlane/utils/validate-configuration.js";import{notFalsy as b}from"../../../../utils/commonUtils.js";function O(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function f(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(o){O(e,o,n[o])}))}return e}function C(e,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):function(e){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o}(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})),e}const S=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),A=e=>"revolving"===(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,v=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:p=null,billingAddressRequiredFields:m=null})=>{let g=s;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(g=e.positionHolderNameOnTop?o:n),u&&(g=a,h&&(g=e.positionHolderNameOnTop?i:r)),c&&(g=d,h&&(g=e.positionHolderNameOnTop?t:l)),p){const i=p.flat(2).filter((e=>"number"!=typeof e));let r=i;m&&(r=i.filter((e=>m.includes(e)))),g=s.concat(r),h&&(g=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return g},w=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},R=e=>({amount:e.amount,billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),F=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),E=o=>o==e.partial?u:null;function x(e){return![m.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,m.ERROR_MSG_CARD_TOO_OLD,m.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,m.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function N(e){var o;return null!==(o=p[e])&&void 0!==o?o:e}const P=e=>{var o,n,i,r,t,l,s,a;const{autoFocus:d,billingAddressAllowedCountries:u,billingAddressMode:p,billingAddressRequired:m,billingAddressRequiredFields:O,brands:S=c,brandsConfiguration:A,challengeWindowSize:v=g,configuration:w,countryCode:R,data:F,disclaimerMessage:E,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,fastlaneConfiguration:j,forceCompat:B,hasHolderName:k,hideCVC:T,holderNameRequired:M,installmentOptions:V,keypadFix:_,legacyInputMode:q,maskSecurityCode:I,minimumExpiryDate:H,name:L,placeholders:K,positionHolderNameOnTop:U,showBrandIcon:G,showInstallmentAmounts:W,showPayButton:z=!1,styles:J,onAllValid:Y,onBinLookup:X,onBinValue:$,onBlur:Q,onBrand:Z,onConfigSuccess:ee,onEnterKeyPressed:oe,onFieldValid:ne,onFocus:ie,onLoad:re}=e,te=JSON.stringify(h.data),le=null===(n=e.modules)||void 0===n||null===(o=n.srPanel)||void 0===o?void 0:o.enabled,se=null===(r=e.modules)||void 0===r||null===(i=r.srPanel)||void 0===i?void 0:i.moveFocus,ae=null===(l=e.modules)||void 0===l||null===(t=l.risk)||void 0===t?void 0:t.enabled,de=y(j),ue=e.onAddressLookup?"lookup":p;let ce="none";!0===(null==w?void 0:w.koreanAuthenticationRequired)&&(ce="kr"===(null==R?void 0:R.toLowerCase())?"atStart":"auto");return f(C(f({autoFocus:d},(null==u?void 0:u.length)>0&&{billingAddressAllowedCountries:u.toString().substring(0,128)}),{billingAddressMode:ue,billingAddressRequired:m,billingAddressRequiredFields:null==O||null===(s=O.toString())||void 0===s?void 0:s.substring(0,128),brands:null==S||null===(a=S.toString())||void 0===a?void 0:a.substring(0,128),challengeWindowSize:v,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,forceCompat:B,hasBrandsConfiguration:b(A),hasData:F&&JSON.stringify(e.data)!==te,hasDisclaimerMessage:!!E,hasHolderName:k,hasInstallmentOptions:b(V),hasPlaceholders:b(K),hasStylesConfigured:b(J),hideCVC:T,holderNameRequired:M,keypadFix:_,legacyInputMode:q,maskSecurityCode:I,minimumExpiryDate:!!H,name:L,positionHolderNameOnTop:U,riskEnabled:ae,showBrandIcon:G,showInstallmentAmounts:!!W,showKCPType:ce,showPayButton:z,socialSecurityNumberMode:null==w?void 0:w.socialSecurityNumberMode,srPanelEnabled:le,srPanelMoveFocus:se,hasOnAllValid:Y!==h.onAllValid,hasOnBinValue:$!==h.onBinValue,hasOnBlur:Q!==h.onBlur,hasOnBrand:Z!==h.onBrand,hasOnConfigSuccess:ee!==h.onConfigSuccess,hasOnFieldValid:ne!==h.onFieldValid,hasOnFocus:ie!==h.onFocus,hasOnLoad:re!==h.onLoad,hasOnBinLookup:!!X,hasOnEnterKeyPressed:!!oe}),de&&{hasFastlaneConfigured:!0,isFastlaneConsentDefaultOn:j.defaultToggleState})};export{R as extractPropsForCardFields,F as extractPropsForSFP,P as getCardConfigData,S as getCardImageUrl,N as getFullBrandName,v as getLayout,E as handlePartialAddressMode,A as hasValidInstallmentsObject,x as lookupBlurBasedErrors,w as mapFieldKey};
1
+ import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as s,KCP_CARD as a,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{DEFAULT_CARD_GROUP_TYPES as c,BRAND_READABLE_NAME_MAP as m}from"../../../internal/SecuredFields/lib/constants.js";import p from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as g}from"../../../../core/Errors/constants.js";import{DEFAULT_CHALLENGE_WINDOW_SIZE as h}from"../../../ThreeDS2/constants.js";import y from"./defaultProps.js";import{isConfigurationValid as b}from"../Fastlane/utils/validate-configuration.js";import{notFalsy as O}from"../../../../utils/commonUtils.js";function f(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function C(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(o){f(e,o,n[o])}))}return e}function S(e,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):function(e){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o}(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})),e}const v=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),A=e=>"revolving"===(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,R=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let g=s;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(g=e.positionHolderNameOnTop?o:n),u&&(g=a,h&&(g=e.positionHolderNameOnTop?i:r)),c&&(g=d,h&&(g=e.positionHolderNameOnTop?t:l)),m){const i=m.flat(2).filter((e=>"number"!=typeof e));let r=i;p&&(r=i.filter((e=>p.includes(e)))),g=s.concat(r),h&&(g=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return g},w=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},F=e=>({amount:e.amount,billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),E=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),x=o=>o==e.partial?u:null;function N(e){return![g.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,g.ERROR_MSG_CARD_TOO_OLD,g.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,g.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function P(e){var o;return null!==(o=m[e])&&void 0!==o?o:e}const D=e=>{var o,n,i,r,t,l,s,a;const{autoFocus:d,billingAddressAllowedCountries:u,billingAddressMode:m,billingAddressRequired:p,billingAddressRequiredFields:g,brands:f=c,brandsConfiguration:v,challengeWindowSize:A=h,configuration:R,countryCode:w,data:F,disclaimerMessage:E,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,fastlaneConfiguration:j,forceCompat:B,hasHolderName:k,hideCVC:T,holderNameRequired:M,installmentOptions:V,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:H,name:L,placeholders:K,positionHolderNameOnTop:U,showBrandIcon:G,showInstallmentAmounts:W,showPayButton:z=!1,styles:J,onAllValid:Y,onBinLookup:X,onBinValue:$,onBlur:Q,onBrand:Z,onConfigSuccess:ee,onEnterKeyPressed:oe,onFieldValid:ne,onFocus:ie,onLoad:re}=e,te=JSON.stringify(y.data),le=null===(n=e.modules)||void 0===n||null===(o=n.srPanel)||void 0===o?void 0:o.enabled,se=null===(r=e.modules)||void 0===r||null===(i=r.srPanel)||void 0===i?void 0:i.moveFocus,ae=null===(l=e.modules)||void 0===l||null===(t=l.risk)||void 0===t?void 0:t.enabled,de=b(j),ue=e.onAddressLookup?"lookup":m;let ce="none";!0===(null==R?void 0:R.koreanAuthenticationRequired)&&(ce="kr"===(null==w?void 0:w.toLowerCase())?"atStart":"auto");return C(S(C({autoFocus:d},(null==u?void 0:u.length)>0&&{billingAddressAllowedCountries:u.toString().substring(0,128)}),{billingAddressMode:ue,billingAddressRequired:p,billingAddressRequiredFields:null==g||null===(s=g.toString())||void 0===s?void 0:s.substring(0,128),brands:null==f||null===(a=f.toString())||void 0===a?void 0:a.substring(0,128),challengeWindowSize:A,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,forceCompat:B,hasBrandsConfiguration:O(v),hasData:F&&JSON.stringify(e.data)!==te,hasDisclaimerMessage:!!E,hasHolderName:k,hasInstallmentOptions:O(V),hasPlaceholders:O(K),hasStylesConfigured:O(J),hideCVC:T,holderNameRequired:M,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:!!H,name:L,positionHolderNameOnTop:U,riskEnabled:ae,showBrandIcon:G,showInstallmentAmounts:!!W,showKCPType:ce,showPayButton:z,socialSecurityNumberMode:null==R?void 0:R.socialSecurityNumberMode,srPanelEnabled:le,srPanelMoveFocus:se,hasOnAllValid:Y!==y.onAllValid,hasOnBinValue:$!==y.onBinValue,hasOnBlur:Q!==y.onBlur,hasOnBrand:Z!==y.onBrand,hasOnConfigSuccess:ee!==y.onConfigSuccess,hasOnFieldValid:ne!==y.onFieldValid,hasOnFocus:ie!==y.onFocus,hasOnLoad:re!==y.onLoad,hasOnBinLookup:!!X,hasOnEnterKeyPressed:!!oe}),de&&{hasFastlaneConfigured:!0,isFastlaneConsentDefaultOn:j.defaultToggleState})},j=(e,o)=>e.map((e=>{var n;const i=e.id,r=p(),t="card"===i?"nocard":i;var l;const s=null!==(l=null===(n=o[i])||void 0===n?void 0:n.icon)&&void 0!==l?l:v(t,r);return{id:e.id,name:e.brandObject.localeBrand||e.brandObject.brand,imageURL:s,altName:P(i)}}));export{F as extractPropsForCardFields,E as extractPropsForSFP,D as getCardConfigData,v as getCardImageUrl,P as getFullBrandName,R as getLayout,x as handlePartialAddressMode,A as hasValidInstallmentsObject,N as lookupBlurBasedErrors,j as mapDualBrandButtons,w as mapFieldKey};
2
2
  //# sourceMappingURL=utils.js.map