@adyen/adyen-web 6.8.0 → 6.10.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 (440) hide show
  1. package/dist/cjs/adyen.css +21 -17
  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 +265 -71
  6. package/dist/es/_virtual/index.js +1 -1
  7. package/dist/es/_virtual/index2.js +2 -0
  8. package/dist/es/_virtual/index2.js.map +1 -0
  9. package/dist/es/adyen.css +21 -17
  10. package/dist/es/adyen.css.map +1 -1
  11. package/dist/es/components/Ach/components/AchInput/AchInput.js +1 -1
  12. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
  13. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  14. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  15. package/dist/es/components/ApplePay/ApplePay.js +1 -1
  16. package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
  17. package/dist/es/components/ApplePay/components/ApplePayButton.js +1 -1
  18. package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
  19. package/dist/es/components/ApplePay/defaultProps.js +1 -1
  20. package/dist/es/components/ApplePay/defaultProps.js.map +1 -1
  21. package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js +2 -0
  22. package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -0
  23. package/dist/es/components/ApplePay/services/ApplePayService.js.map +1 -0
  24. package/dist/es/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js +2 -0
  25. package/dist/es/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js.map +1 -0
  26. package/dist/es/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js +2 -0
  27. package/dist/es/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js.map +1 -0
  28. package/dist/es/components/ApplePay/utils/payment-request.js +2 -0
  29. package/dist/es/components/ApplePay/utils/payment-request.js.map +1 -0
  30. package/dist/es/components/ApplePay/utils/resolve-supported-version.js +2 -0
  31. package/dist/es/components/ApplePay/utils/resolve-supported-version.js.map +1 -0
  32. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  33. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  34. package/dist/es/components/Boleto/Boleto.js.map +1 -1
  35. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  36. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  37. package/dist/es/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js +1 -1
  38. package/dist/es/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
  39. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  40. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  41. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  42. package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
  43. package/dist/es/components/Card/components/CardInput/components/CVCHint.js +1 -1
  44. package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  45. package/dist/es/components/Card/components/CardInput/components/CardFields.js +1 -1
  46. package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  47. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  48. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  49. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  50. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  51. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  52. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  53. package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
  54. package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
  55. package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
  56. package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  57. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js +1 -1
  58. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
  59. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  60. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  61. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  62. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  63. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodName.js +1 -1
  64. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodName.js.map +1 -1
  65. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  66. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  67. package/dist/es/components/Giftcard/Giftcard.js +1 -1
  68. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  69. package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
  70. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  71. package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
  72. package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  73. package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
  74. package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  75. package/dist/es/components/Giftcard/components/GiftcardResult.js +1 -1
  76. package/dist/es/components/Giftcard/components/GiftcardResult.js.map +1 -1
  77. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  78. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  79. package/dist/es/components/MBWay/MBWay.js +1 -1
  80. package/dist/es/components/MBWay/MBWay.js.map +1 -1
  81. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  82. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  83. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  84. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  85. package/dist/es/components/PayPal/components/PaypalButtons.js +1 -1
  86. package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
  87. package/dist/es/components/PayTo/PayTo.js +2 -0
  88. package/dist/es/components/PayTo/PayTo.js.map +1 -0
  89. package/dist/es/components/PayTo/components/BSBInput.js +2 -0
  90. package/dist/es/components/PayTo/components/BSBInput.js.map +1 -0
  91. package/dist/es/components/PayTo/components/IdentifierSelector.js +2 -0
  92. package/dist/es/components/PayTo/components/IdentifierSelector.js.map +1 -0
  93. package/dist/es/components/PayTo/components/MandateSummary.js +2 -0
  94. package/dist/es/components/PayTo/components/MandateSummary.js.map +1 -0
  95. package/dist/es/components/PayTo/components/PayIDInput.js +2 -0
  96. package/dist/es/components/PayTo/components/PayIDInput.js.map +1 -0
  97. package/dist/es/components/PayTo/components/PayToComponent.js +2 -0
  98. package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -0
  99. package/dist/es/components/PayTo/components/PayToInstructions.js +2 -0
  100. package/dist/es/components/PayTo/components/PayToInstructions.js.map +1 -0
  101. package/dist/es/components/PayTo/components/PayToNameFields.js +2 -0
  102. package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -0
  103. package/dist/es/components/PayTo/components/PayToPhone.js +2 -0
  104. package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -0
  105. package/dist/es/components/PayTo/components/validate.js +2 -0
  106. package/dist/es/components/PayTo/components/validate.js.map +1 -0
  107. package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
  108. package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  109. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
  110. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  111. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -1
  112. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +1 -1
  113. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
  114. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +1 -1
  115. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
  116. package/dist/es/components/components-name-map.js +1 -1
  117. package/dist/es/components/components-name-map.js.map +1 -1
  118. package/dist/es/components/index.js +1 -1
  119. package/dist/es/components/internal/Alert/Alert.js +1 -1
  120. package/dist/es/components/internal/Alert/Alert.js.map +1 -1
  121. package/dist/es/components/internal/Await/Await.js +1 -1
  122. package/dist/es/components/internal/Await/Await.js.map +1 -1
  123. package/dist/es/components/internal/Button/Button.js +1 -1
  124. package/dist/es/components/internal/Button/Button.js.map +1 -1
  125. package/dist/es/components/internal/ButtonGroup/ButtonGroup.js +1 -1
  126. package/dist/es/components/internal/ButtonGroup/ButtonGroup.js.map +1 -1
  127. package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js +1 -1
  128. package/dist/es/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
  129. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js +1 -1
  130. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
  131. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  132. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  133. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js +1 -1
  134. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js.map +1 -1
  135. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
  136. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  137. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
  138. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
  139. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  140. package/dist/es/components/internal/ContentSeparator/ContentSeparator.js +1 -1
  141. package/dist/es/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
  142. package/dist/es/components/internal/DetailsTable/DetailsTable.js +2 -0
  143. package/dist/es/components/internal/DetailsTable/DetailsTable.js.map +1 -0
  144. package/dist/es/components/internal/ExpandButton/ExpandButton.js +1 -1
  145. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -1
  146. package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  147. package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  148. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  149. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  150. package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
  151. package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  152. package/dist/es/components/internal/FormFields/InputBase.js +1 -1
  153. package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
  154. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  155. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  156. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  157. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  158. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  159. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  160. package/dist/es/components/internal/FormFields/Select/components/SelectList.js +1 -1
  161. package/dist/es/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  162. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  163. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  164. package/dist/es/components/internal/IFrame/Iframe.js +1 -1
  165. package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
  166. package/dist/es/components/internal/Icon/Icon.js +1 -1
  167. package/dist/es/components/internal/Icon/Icon.js.map +1 -1
  168. package/dist/es/components/internal/Img/Img.js +1 -1
  169. package/dist/es/components/internal/Img/Img.js.map +1 -1
  170. package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js +1 -1
  171. package/dist/es/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
  172. package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js +1 -1
  173. package/dist/es/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
  174. package/dist/es/components/internal/Modal/Modal.js +1 -1
  175. package/dist/es/components/internal/Modal/Modal.js.map +1 -1
  176. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  177. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  178. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  179. package/dist/es/components/internal/PhoneInput/PhoneInputFields.js +2 -0
  180. package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -0
  181. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +2 -0
  182. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -0
  183. package/dist/es/components/internal/PhoneInput/validate.js +1 -1
  184. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js +1 -1
  185. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
  186. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js +1 -1
  187. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  188. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  189. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  190. package/dist/es/components/internal/SendCopyToEmail/SendCopyToEmail.js +1 -1
  191. package/dist/es/components/internal/SendCopyToEmail/SendCopyToEmail.js.map +1 -1
  192. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  193. package/dist/es/components/internal/Voucher/Voucher.js +1 -1
  194. package/dist/es/components/internal/Voucher/Voucher.js.map +1 -1
  195. package/dist/es/components/tx-variants.js +1 -1
  196. package/dist/es/components/tx-variants.js.map +1 -1
  197. package/dist/es/core/ProcessResponse/PaymentMethods/filters.js +1 -1
  198. package/dist/es/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
  199. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  200. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  201. package/dist/es/core/core.js +1 -1
  202. package/dist/es/core/core.js.map +1 -1
  203. package/dist/es/core/utils.js +1 -1
  204. package/dist/es/core/utils.js.map +1 -1
  205. package/dist/es/external/classnames/index.js +2 -2
  206. package/dist/es/external/classnames/index.js.map +1 -1
  207. package/dist/es/index.d.ts +265 -71
  208. package/dist/es/index.js +1 -1
  209. package/dist/es/utils/Validator/ValidationRuleResult.js.map +1 -1
  210. package/dist/es/utils/Validator/Validator.js.map +1 -1
  211. package/dist/es/utils/inIframe.js +2 -0
  212. package/dist/es/utils/inIframe.js.map +1 -0
  213. package/dist/es-legacy/_virtual/index.js +1 -1
  214. package/dist/es-legacy/_virtual/index2.js +2 -0
  215. package/dist/es-legacy/_virtual/index2.js.map +1 -0
  216. package/dist/es-legacy/adyen.css +21 -17
  217. package/dist/es-legacy/adyen.css.map +1 -1
  218. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  219. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  220. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  221. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  222. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  223. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  224. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js +1 -1
  225. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
  226. package/dist/es-legacy/components/ApplePay/defaultProps.js +1 -1
  227. package/dist/es-legacy/components/ApplePay/defaultProps.js.map +1 -1
  228. package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js +2 -0
  229. package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -0
  230. package/dist/es-legacy/components/ApplePay/services/ApplePayService.js.map +1 -0
  231. package/dist/es-legacy/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js +2 -0
  232. package/dist/es-legacy/components/ApplePay/utils/format-applepay-contact-to-adyen-format.js.map +1 -0
  233. package/dist/es-legacy/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js +2 -0
  234. package/dist/es-legacy/components/ApplePay/utils/map-adyen-brands-to-applepay-brands.js.map +1 -0
  235. package/dist/es-legacy/components/ApplePay/utils/payment-request.js +2 -0
  236. package/dist/es-legacy/components/ApplePay/utils/payment-request.js.map +1 -0
  237. package/dist/es-legacy/components/ApplePay/utils/resolve-supported-version.js +2 -0
  238. package/dist/es-legacy/components/ApplePay/utils/resolve-supported-version.js.map +1 -0
  239. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  240. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  241. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  242. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  243. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  244. package/dist/es-legacy/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js +1 -1
  245. package/dist/es-legacy/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.js.map +1 -1
  246. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  247. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  248. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  249. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
  250. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js +1 -1
  251. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  252. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js +1 -1
  253. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  254. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  255. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  256. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  257. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  258. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  259. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  260. package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
  261. package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
  262. package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
  263. package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  264. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js +1 -1
  265. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodIcon.js.map +1 -1
  266. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  267. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  268. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  269. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  270. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodName.js +1 -1
  271. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodName.js.map +1 -1
  272. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  273. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  274. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  275. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  276. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  277. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  278. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
  279. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  280. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
  281. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  282. package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js +1 -1
  283. package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js.map +1 -1
  284. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  285. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  286. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  287. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  288. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  289. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  290. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  291. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  292. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  293. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  294. package/dist/es-legacy/components/PayTo/PayTo.js +2 -0
  295. package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -0
  296. package/dist/es-legacy/components/PayTo/components/BSBInput.js +2 -0
  297. package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -0
  298. package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js +2 -0
  299. package/dist/es-legacy/components/PayTo/components/IdentifierSelector.js.map +1 -0
  300. package/dist/es-legacy/components/PayTo/components/MandateSummary.js +2 -0
  301. package/dist/es-legacy/components/PayTo/components/MandateSummary.js.map +1 -0
  302. package/dist/es-legacy/components/PayTo/components/PayIDInput.js +2 -0
  303. package/dist/es-legacy/components/PayTo/components/PayIDInput.js.map +1 -0
  304. package/dist/es-legacy/components/PayTo/components/PayToComponent.js +2 -0
  305. package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -0
  306. package/dist/es-legacy/components/PayTo/components/PayToInstructions.js +2 -0
  307. package/dist/es-legacy/components/PayTo/components/PayToInstructions.js.map +1 -0
  308. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js +2 -0
  309. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -0
  310. package/dist/es-legacy/components/PayTo/components/PayToPhone.js +2 -0
  311. package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -0
  312. package/dist/es-legacy/components/PayTo/components/validate.js +2 -0
  313. package/dist/es-legacy/components/PayTo/components/validate.js.map +1 -0
  314. package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
  315. package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js.map +1 -1
  316. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
  317. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  318. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -1
  319. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +1 -1
  320. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
  321. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +1 -1
  322. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -1
  323. package/dist/es-legacy/components/components-name-map.js +1 -1
  324. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  325. package/dist/es-legacy/components/index.js +1 -1
  326. package/dist/es-legacy/components/internal/Alert/Alert.js +1 -1
  327. package/dist/es-legacy/components/internal/Alert/Alert.js.map +1 -1
  328. package/dist/es-legacy/components/internal/Await/Await.js +1 -1
  329. package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
  330. package/dist/es-legacy/components/internal/Button/Button.js +1 -1
  331. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  332. package/dist/es-legacy/components/internal/ButtonGroup/ButtonGroup.js +1 -1
  333. package/dist/es-legacy/components/internal/ButtonGroup/ButtonGroup.js.map +1 -1
  334. package/dist/es-legacy/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js +1 -1
  335. package/dist/es-legacy/components/internal/ClickToPay/components/CtPBrand/CtPBrand.js.map +1 -1
  336. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js +1 -1
  337. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.js.map +1 -1
  338. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  339. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  340. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js +1 -1
  341. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPSaveCookiesCheckbox/CtPSaveCookiesCheckbox.js.map +1 -1
  342. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
  343. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  344. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js +1 -1
  345. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPSection.js.map +1 -1
  346. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  347. package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js +1 -1
  348. package/dist/es-legacy/components/internal/ContentSeparator/ContentSeparator.js.map +1 -1
  349. package/dist/es-legacy/components/internal/DetailsTable/DetailsTable.js +2 -0
  350. package/dist/es-legacy/components/internal/DetailsTable/DetailsTable.js.map +1 -0
  351. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +1 -1
  352. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -1
  353. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  354. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  355. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  356. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  357. package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
  358. package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  359. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  360. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  361. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  362. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  363. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  364. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  365. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  366. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  367. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js +1 -1
  368. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  369. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  370. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  371. package/dist/es-legacy/components/internal/IFrame/Iframe.js +1 -1
  372. package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
  373. package/dist/es-legacy/components/internal/Icon/Icon.js +1 -1
  374. package/dist/es-legacy/components/internal/Icon/Icon.js.map +1 -1
  375. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  376. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  377. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js +1 -1
  378. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.js.map +1 -1
  379. package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js +1 -1
  380. package/dist/es-legacy/components/internal/LoadingWrapper/LoadingWrapper.js.map +1 -1
  381. package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
  382. package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
  383. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  384. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  385. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  386. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +2 -0
  387. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -0
  388. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +2 -0
  389. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -0
  390. package/dist/es-legacy/components/internal/PhoneInput/validate.js +1 -1
  391. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js +1 -1
  392. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
  393. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js +1 -1
  394. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  395. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  396. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  397. package/dist/es-legacy/components/internal/SendCopyToEmail/SendCopyToEmail.js +1 -1
  398. package/dist/es-legacy/components/internal/SendCopyToEmail/SendCopyToEmail.js.map +1 -1
  399. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  400. package/dist/es-legacy/components/internal/Voucher/Voucher.js +1 -1
  401. package/dist/es-legacy/components/internal/Voucher/Voucher.js.map +1 -1
  402. package/dist/es-legacy/components/tx-variants.js +1 -1
  403. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  404. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js +1 -1
  405. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
  406. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  407. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  408. package/dist/es-legacy/core/core.js +1 -1
  409. package/dist/es-legacy/core/core.js.map +1 -1
  410. package/dist/es-legacy/core/utils.js +1 -1
  411. package/dist/es-legacy/core/utils.js.map +1 -1
  412. package/dist/es-legacy/external/classnames/index.js +2 -2
  413. package/dist/es-legacy/external/classnames/index.js.map +1 -1
  414. package/dist/es-legacy/index.js +1 -1
  415. package/dist/es-legacy/utils/Validator/ValidationRuleResult.js.map +1 -1
  416. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  417. package/dist/es-legacy/utils/inIframe.js +2 -0
  418. package/dist/es-legacy/utils/inIframe.js.map +1 -0
  419. package/package.json +29 -23
  420. package/styles/adyen.css +21 -17
  421. package/dist/es/components/ApplePay/ApplePayService.js.map +0 -1
  422. package/dist/es/components/ApplePay/config.js +0 -2
  423. package/dist/es/components/ApplePay/config.js.map +0 -1
  424. package/dist/es/components/ApplePay/payment-request.js +0 -2
  425. package/dist/es/components/ApplePay/payment-request.js.map +0 -1
  426. package/dist/es/components/ApplePay/utils.js +0 -2
  427. package/dist/es/components/ApplePay/utils.js.map +0 -1
  428. package/dist/es/components/internal/PhoneInput/PhoneInput.js +0 -2
  429. package/dist/es/components/internal/PhoneInput/PhoneInput.js.map +0 -1
  430. package/dist/es-legacy/components/ApplePay/ApplePayService.js.map +0 -1
  431. package/dist/es-legacy/components/ApplePay/config.js +0 -2
  432. package/dist/es-legacy/components/ApplePay/config.js.map +0 -1
  433. package/dist/es-legacy/components/ApplePay/payment-request.js +0 -2
  434. package/dist/es-legacy/components/ApplePay/payment-request.js.map +0 -1
  435. package/dist/es-legacy/components/ApplePay/utils.js +0 -2
  436. package/dist/es-legacy/components/ApplePay/utils.js.map +0 -1
  437. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +0 -2
  438. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +0 -1
  439. /package/dist/es/components/ApplePay/{ApplePayService.js → services/ApplePayService.js} +0 -0
  440. /package/dist/es-legacy/components/ApplePay/{ApplePayService.js → services/ApplePayService.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as t,useState as o,useCallback as n,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{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as h,getRuleByNameAndMode as b}from"./validate.js";import f from"../../../internal/SecuredFields/binLookup/extensions.js";import y from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as N,extractPropsForSFP as S,extractPropsForCardFields as g,getLayout as A}from"./utils.js";import F from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as C}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as j}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as k,getFocusHandler as x,getAddressHandler as R}from"./handlers.js";import P from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as v}from"../../../internal/Address/validate.js";import w from"../../../../core/Context/useImage.js";import{getArrayDifferences as I}from"../../../../utils/arrayUtils.js";import B from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as V}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";const O=l=>{const O=s(null),q=s(!1),M=w(),D=s(null),_=e=>{D.current=e},L=s({});Object.keys(L.current).length||l.setComponentRef(L.current);const T=s(0),K=s(!1),H=t((()=>new F(l.specifications)),[l.specifications]);L.current.sfp=O;const[U,z]=o("ready"),[W,$]=o({}),[G,J]=o({...l.holderNameRequired&&{holderName:!1}}),[Q,X]=o({...l.hasHolderName&&{holderName:l.data.holderName??""}}),[Y,Z]=o(""),[ee,re]=o(!1),[se,te]=o(c),[oe,ne]=o(m),[ae,ie]=o(null),[le,de]=o([]),[ue,ce]=o(l.storedPaymentMethodId?l.brand:""),me=l.billingAddressMode!==d.none&&l.billingAddressRequired,pe=N(l.billingAddressMode),he=s(pe&&l.data?.billingAddress?.country),[be,fe]=o(!1),[ye,Ne]=o(me?l.data.billingAddress:null),[Se,ge]=o(!1),[Ae,Fe]=o(""),[Ce,je]=o({value:null}),[ke,xe]=o(null),[Re,Pe]=o("card"),{handleChangeFor:ve,triggerValidation:we,data:Ie,valid:Be,errors:Ve,setSchema:Ee,setData:Oe,setValid:qe,setErrors:Me}=y({schema:[],defaultData:l.data,formatters:p,rules:h}),De=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource,_e=l.showInstallmentAmounts??!0,Le="kr"===(ae??l.countryCode),Te=l.configuration.koreanAuthenticationRequired&&Le,Ke=Se&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,He=(e,r)=>{l.onFocus({fieldType:e,event:r})},Ue=(e,r)=>{l.onBlur({fieldType:e,event:r})},ze=n((e=>{Pe(e.brand),l.onBrand(e)}),[]),We=x(Z,He,Ue),$e=()=>A({props:l,showKCP:Te,showBrazilianSSN:Ke,...l.billingAddressRequired&&{countrySpecificSchemas:H.getAddressSchemaForCountry(ye?.country),billingAddressRequiredFields:l.billingAddressRequiredFields}}),Ge=n((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;xe(r)}),[]),Je=R(Oe,qe,Me),Qe=k(K,O,$e()),Xe=t((()=>f(l,{sfp:O},{dualBrandSelectElements:le,setDualBrandSelectElements:de,setSelectedBrandValue:ce,issuingCountryCode:ae,setIssuingCountryCode:ie},T)),[le,ae]);L.current.showValidation=()=>{q.current=!0,er?.(),O.current.showValidation(),we(["holderName","socialSecurityNumber","taxNumber"]),D?.current&&D.current.showValidation()},L.current.processBinLookupResponse=(e,r)=>{Xe.processBinLookup(e,r)},L.current.setStatus=z,a((()=>(L.current.setFocusOn=O.current.setFocusOn,L.current.updateStyles=O.current.updateStyles,L.current.handleUnsupportedCard=O.current.handleUnsupportedCard,()=>{O.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...Ke?["socialSecurityNumber"]:[],...Te?["taxNumber"]:[],...me?["billingAddress"]:[]];Ee(e)}),[l.hasHolderName,Ke,Te]),a((()=>{X({...Q,holderName:Ie.holderName??"",taxNumber:Ie.taxNumber}),Fe(Ie.socialSecurityNumber),me&&Ne({...Ie.billingAddress}),J({...G,holderName:!l.holderNameRequired||Be.holderName,socialSecurityNumber:!!Be.socialSecurityNumber&&Be.socialSecurityNumber,taxNumber:!!Be.taxNumber&&Be.taxNumber,billingAddress:!!Be.billingAddress&&Be.billingAddress});const e=!!Ve.billingAddress&&Object.entries(Ve.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);$({...W,holderName:l.holderNameRequired&&Ve.holderName?Ve.holderName:null,socialSecurityNumber:Ke&&Ve.socialSecurityNumber?Ve.socialSecurityNumber:null,taxNumber:Te&&Ve.taxNumber?Ve.taxNumber:null,billingAddress:me&&e?Ve.billingAddress:null})}),[Ie,Be,Ve]);const{sortedErrorList:Ye,previousSortedErrors:Ze,clearSRPanel:er}=E({errors:W,props:l,isValidating:q,retrieveLayout:$e,specifications:H,billingAddress:ye,sfp:O});if(Ye){const e=I(Ye,Ze,"field");e?.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};l.onValidationErrorAnalytics(r)}))}a((()=>{const e=G.holderName,r=ee,s=!me||G.billingAddress,t=!Te||!!G.taxNumber&&!!G.encryptedPassword,o=!Ke||!!G.socialSecurityNumber,n=r&&e&&s&&t&&o,a=O.current.mapErrorsToValidationRuleResult(),i={...W,...a};l.onChange({data:Q,valid:G,errors:i,isValid:n,billingAddress:ye,selectedBrandValue:ue,storePaymentMethod:be,socialSecurityNumber:Ae,installments:Ce})}),[Q,G,W,ue,be,Ce]);const rr=l.storedPaymentMethodId?C:j;return e(r,null,e(i,{ref:O,...S(l),styles:{...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&&(Oe("holderName",r),qe("holderName",!0),Me("holderName",null))}else l.autoFocus&&T.current>0&&"handleOnFieldValid"===r?.event&&r?.fieldType===u&&e.valid.encryptedCardNumber&&Qe(),X({...Q,...e.data}),$({...W,...e.errors}),J({...G,...e.valid}),re(e.isSfpValid),ne(e.cvcPolicy),ge(e.showSocialSecurityNumber),te(e.expiryDatePolicy)},onBrand:ze,onFocus:We,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?Ge:null,render:({setRootNode:r,setFocusOn:s},t)=>e("div",{ref:r,className:P({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${l.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===U}),role:"form"},e(B,null),e(rr,{...g(l),data:Q,valid:G,errors:W,handleChangeFor:ve,focusedElement:Y,setFocusOn:s,sfpState:t,cvcPolicy:oe,hasInstallments:De,showAmountsInInstallments:_e,handleInstallments:je,brandsIcons:l.brandsIcons,formData:Ie,formErrors:Ve,formValid:Be,expiryDatePolicy:se,dualBrandSelectElements:le,extensions:Xe,selectedBrandValue:ue,showKCP:Te,showBrazilianSSN:Ke,socialSecurityNumber:Ae,handleOnStoreDetails:fe,setAddressRef:_,billingAddress:ye,billingAddressValidationRules:pe&&v(he.current),partialAddressSchema:pe,handleAddress:Je,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:ke,onFieldFocusAnalytics:He,onFieldBlurAnalytics:Ue}))}),l.showPayButton&&l.payButton({status:U,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:M({imageFolder:"components/"})(`${V}lock`)}))};O.defaultProps=l;export{O as default};
1
+ import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as t,useState as o,useCallback as n,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{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as h,getRuleByNameAndMode as b}from"./validate.js";import f from"../../../internal/SecuredFields/binLookup/extensions.js";import y from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as N,extractPropsForSFP as S,extractPropsForCardFields as g,getLayout as A}from"./utils.js";import F from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as C}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as j}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as k,getFocusHandler as R,getAddressHandler as x}from"./handlers.js";import v from"../../../../_virtual/index.js";import{getPartialAddressValidationRules as P}from"../../../internal/Address/validate.js";import w from"../../../../core/Context/useImage.js";import{getArrayDifferences as I}from"../../../../utils/arrayUtils.js";import B from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as V}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";const O=l=>{const O=s(null),q=s(!1),M=w(),D=s(null),_=e=>{D.current=e},L=s({});Object.keys(L.current).length||l.setComponentRef(L.current);const T=s(0),K=s(!1),H=t((()=>new F(l.specifications)),[l.specifications]);L.current.sfp=O;const[U,z]=o("ready"),[W,$]=o({}),[G,J]=o({...l.holderNameRequired&&{holderName:!1}}),[Q,X]=o({...l.hasHolderName&&{holderName:l.data.holderName??""}}),[Y,Z]=o(""),[ee,re]=o(!1),[se,te]=o(c),[oe,ne]=o(m),[ae,ie]=o(null),[le,de]=o([]),[ue,ce]=o(l.storedPaymentMethodId?l.brand:""),me=l.billingAddressMode!==d.none&&l.billingAddressRequired,pe=N(l.billingAddressMode),he=s(pe&&l.data?.billingAddress?.country),[be,fe]=o(!1),[ye,Ne]=o(me?l.data.billingAddress:null),[Se,ge]=o(!1),[Ae,Fe]=o(""),[Ce,je]=o({value:null}),[ke,Re]=o(null),[xe,ve]=o("card"),{handleChangeFor:Pe,triggerValidation:we,data:Ie,valid:Be,errors:Ve,setSchema:Ee,setData:Oe,setValid:qe,setErrors:Me}=y({schema:[],defaultData:l.data,formatters:p,rules:h}),De=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource,_e=l.showInstallmentAmounts??!0,Le="kr"===(ae??l.countryCode),Te=l.configuration.koreanAuthenticationRequired&&Le,Ke=Se&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,He=(e,r)=>{l.onFocus({fieldType:e,event:r})},Ue=(e,r)=>{l.onBlur({fieldType:e,event:r})},ze=n((e=>{ve(e.brand),l.onBrand(e)}),[]),We=R(Z,He,Ue),$e=()=>A({props:l,showKCP:Te,showBrazilianSSN:Ke,...l.billingAddressRequired&&{countrySpecificSchemas:H.getAddressSchemaForCountry(ye?.country),billingAddressRequiredFields:l.billingAddressRequiredFields}}),Ge=n((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;Re(r)}),[]),Je=x(Oe,qe,Me),Qe=k(K,O,$e()),Xe=t((()=>f(l,{sfp:O},{dualBrandSelectElements:le,setDualBrandSelectElements:de,setSelectedBrandValue:ce,issuingCountryCode:ae,setIssuingCountryCode:ie},T)),[le,ae]);L.current.showValidation=()=>{q.current=!0,er?.(),O.current.showValidation(),we(["holderName","socialSecurityNumber","taxNumber"]),D?.current&&D.current.showValidation()},L.current.processBinLookupResponse=(e,r)=>{Xe.processBinLookup(e,r)},L.current.setStatus=z,a((()=>(L.current.setFocusOn=O.current.setFocusOn,L.current.updateStyles=O.current.updateStyles,L.current.handleUnsupportedCard=O.current.handleUnsupportedCard,()=>{O.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...Ke?["socialSecurityNumber"]:[],...Te?["taxNumber"]:[],...me?["billingAddress"]:[]];Ee(e)}),[l.hasHolderName,Ke,Te]),a((()=>{X({...Q,holderName:Ie.holderName??"",taxNumber:Ie.taxNumber}),Fe(Ie.socialSecurityNumber),me&&Ne({...Ie.billingAddress}),J({...G,holderName:!l.holderNameRequired||Be.holderName,socialSecurityNumber:!!Be.socialSecurityNumber&&Be.socialSecurityNumber,taxNumber:!!Be.taxNumber&&Be.taxNumber,billingAddress:!!Be.billingAddress&&Be.billingAddress});const e=!!Ve.billingAddress&&Object.entries(Ve.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);$({...W,holderName:l.holderNameRequired&&Ve.holderName?Ve.holderName:null,socialSecurityNumber:Ke&&Ve.socialSecurityNumber?Ve.socialSecurityNumber:null,taxNumber:Te&&Ve.taxNumber?Ve.taxNumber:null,billingAddress:me&&e?Ve.billingAddress:null})}),[Ie,Be,Ve]);const{sortedErrorList:Ye,previousSortedErrors:Ze,clearSRPanel:er}=E({errors:W,props:l,isValidating:q,retrieveLayout:$e,specifications:H,billingAddress:ye,sfp:O});if(Ye){const e=I(Ye,Ze,"field");e?.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};l.onValidationErrorAnalytics(r)}))}a((()=>{const e=G.holderName,r=ee,s=!me||G.billingAddress,t=!Te||!!G.taxNumber&&!!G.encryptedPassword,o=!Ke||!!G.socialSecurityNumber,n=r&&e&&s&&t&&o,a=O.current.mapErrorsToValidationRuleResult(),i={...W,...a};l.onChange({data:Q,valid:G,errors:i,isValid:n,billingAddress:ye,selectedBrandValue:ue,storePaymentMethod:be,socialSecurityNumber:Ae,installments:Ce})}),[Q,G,W,ue,be,Ce]);const rr=l.storedPaymentMethodId?C:j;return e(r,null,e(i,{ref:O,...S(l),styles:{...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&&(Oe("holderName",r),qe("holderName",!0),Me("holderName",null))}else l.autoFocus&&T.current>0&&"handleOnFieldValid"===r?.event&&r?.fieldType===u&&e.valid.encryptedCardNumber&&Qe(),X({...Q,...e.data}),$({...W,...e.errors}),J({...G,...e.valid}),re(e.isSfpValid),ne(e.cvcPolicy),ge(e.showSocialSecurityNumber),te(e.expiryDatePolicy)},onBrand:ze,onFocus:We,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?Ge:null,render:({setRootNode:r,setFocusOn:s},t)=>e("div",{ref:r,className:v({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${l.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===U}),role:"form"},e(B,null),e(rr,{...g(l),data:Q,valid:G,errors:W,handleChangeFor:Pe,focusedElement:Y,setFocusOn:s,sfpState:t,cvcPolicy:oe,hasInstallments:De,showAmountsInInstallments:_e,handleInstallments:je,brandsIcons:l.brandsIcons,formData:Ie,formErrors:Ve,formValid:Be,expiryDatePolicy:se,dualBrandSelectElements:le,extensions:Xe,selectedBrandValue:ue,showKCP:Te,showBrazilianSSN:Ke,socialSecurityNumber:Ae,handleOnStoreDetails:fe,setAddressRef:_,billingAddress:ye,billingAddressValidationRules:pe&&P(he.current),partialAddressSchema:pe,handleAddress:Je,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:ke,onFieldFocusAnalytics:He,onFieldBlurAnalytics:Ue}))}),l.showPayButton&&l.payButton({status:U,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:M({imageFolder:"components/"})(`${V}lock`)}))};O.defaultProps=l;export{O 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 { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\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 // 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 if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\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 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 <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 {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","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","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","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","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","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"wlDA+BA,MAAMA,EAAaC,IACf,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,EAAQC,GAAaC,EAAS,UAE9BC,EAAQC,GAAaF,EAA8B,CAAA,IACnDG,EAAOC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,EAAM4M,gBACvBC,kBAAmB7M,EAAM6M,kBACzBC,wBAAyB9M,EAAM8M,wBAE/BxI,gBAAiBA,GAEjBgC,sBAAuBA,GACvBM,qBAAsBA,QAKrC5G,EAAM+M,eACH/M,EAAMgN,UAAU,CACZ5L,SACA6L,QAASjN,EAAMkN,0BAA4B,UAAY,YACvDC,KAAM/M,EAAS,CAAEgN,YAAa,eAAxBhN,CAAyC,GAAGiN,WACtD,EAKhBtN,EAAUuN,aAAeA"}
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 { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\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 // 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 if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\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 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 <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 {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","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","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","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","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","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"6kDA+BA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG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AAaxM,EAAMwM,YACnB5H,SAAUA,GACVE,WAAYA,GACZD,UAAWA,GACXzC,iBAAkBA,GAClBQ,wBAAyBA,GACzBmF,WAAYA,GACZjF,mBAAoBA,GAEpBmD,QAASA,GAETG,iBAAkBA,GAClBnC,qBAAsBA,GAEtBwI,qBAAsB5I,GAEtBtD,cAAeA,EACfmD,eAAgBA,GAChBgJ,8BAA+BnJ,IAAwBoJ,EAAiClJ,GAAsBhD,SAC9G8C,qBAAsBA,GACtBoE,cAAeA,GACfiF,gBAAiB5M,EAAM4M,gBACvBC,kBAAmB7M,EAAM6M,kBACzBC,wBAAyB9M,EAAM8M,wBAE/BxI,gBAAiBA,GAEjBgC,sBAAuBA,GACvBM,qBAAsBA,QAKrC5G,EAAM+M,eACH/M,EAAMgN,UAAU,CACZ5L,SACA6L,QAASjN,EAAMkN,0BAA4B,UAAY,YACvDC,KAAM/M,EAAS,CAAEgN,YAAa,eAAxBhN,CAAyC,GAAGiN,WACtD,EAKhBtN,EAAUuN,aAAeA"}
@@ -1,2 +1,2 @@
1
- import{createElement as a}from"../../../../../../external/preact/dist/preact.js";import r from"../../../../../../external/classnames/index.js";import e from"../../../../../internal/Img/Img.js";import{getFullBrandName as n}from"../../utils.js";const t=({brands:t,activeBrand:s})=>{if(!t?.length)return null;return a("span",{className:r("adyen-checkout__card__brands",{"adyen-checkout__card__brands--hidden":"card"!==s})},t.map((({name:r,icon:t})=>a("span",{key:r,className:"adyen-checkout__card__brands__brand-wrapper"},a(e,{src:t,alt:n(r)})))))};export{t as default};
1
+ import{createElement as a}from"../../../../../../external/preact/dist/preact.js";import r from"../../../../../../_virtual/index.js";import e from"../../../../../internal/Img/Img.js";import{getFullBrandName as n}from"../../utils.js";const t=({brands:t,activeBrand:s})=>{if(!t?.length)return null;return a("span",{className:r("adyen-checkout__card__brands",{"adyen-checkout__card__brands--hidden":"card"!==s})},t.map((({name:r,icon:t})=>a("span",{key:r,className:"adyen-checkout__card__brands__brand-wrapper"},a(e,{src:t,alt:n(r)})))))};export{t as default};
2
2
  //# sourceMappingURL=AvailableBrands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvailableBrands.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Img from '../../../../../internal/Img';\nimport './AvailableBrands.scss';\nimport { BrandConfiguration } from '../../../../types';\nimport { getFullBrandName } from '../../utils';\n\ntype AvailableBrands = Array<BrandConfiguration>;\n\ninterface PaymentMethodBrandsProps {\n brands: AvailableBrands;\n activeBrand: string;\n}\n\nconst AvailableBrands = ({ brands, activeBrand }: PaymentMethodBrandsProps) => {\n if (!brands?.length) {\n return null;\n }\n\n const isValidBrand = activeBrand !== 'card';\n return (\n <span\n className={classNames('adyen-checkout__card__brands', {\n 'adyen-checkout__card__brands--hidden': isValidBrand\n })}\n >\n {brands.map(({ name, icon }) => (\n <span key={name} className=\"adyen-checkout__card__brands__brand-wrapper\">\n <Img src={icon} alt={getFullBrandName(name)} />\n </span>\n ))}\n </span>\n );\n};\n\nexport default AvailableBrands;\n"],"names":["AvailableBrands","brands","activeBrand","length","h","span","className","classNames","map","name","icon","key","Img","src","alt","getFullBrandName"],"mappings":"mPAcA,MAAMA,EAAkB,EAAGC,SAAQC,kBAC/B,IAAKD,GAAQE,OACT,OAAO,KAIX,OACIC,EAACC,OAAAA,CACGC,UAAWC,EAAW,+BAAgC,CAClD,uCAJyB,SAAhBL,KAOZD,EAAOO,KAAI,EAAGC,OAAMC,UACjBN,EAACC,OAAAA,CAAKM,IAAKF,EAAMH,UAAU,+CACvBF,EAACQ,EAAAA,CAAIC,IAAKH,EAAMI,IAAKC,EAAiBN"}
1
+ {"version":3,"file":"AvailableBrands.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Img from '../../../../../internal/Img';\nimport './AvailableBrands.scss';\nimport { BrandConfiguration } from '../../../../types';\nimport { getFullBrandName } from '../../utils';\n\ntype AvailableBrands = Array<BrandConfiguration>;\n\ninterface PaymentMethodBrandsProps {\n brands: AvailableBrands;\n activeBrand: string;\n}\n\nconst AvailableBrands = ({ brands, activeBrand }: PaymentMethodBrandsProps) => {\n if (!brands?.length) {\n return null;\n }\n\n const isValidBrand = activeBrand !== 'card';\n return (\n <span\n className={classNames('adyen-checkout__card__brands', {\n 'adyen-checkout__card__brands--hidden': isValidBrand\n })}\n >\n {brands.map(({ name, icon }) => (\n <span key={name} className=\"adyen-checkout__card__brands__brand-wrapper\">\n <Img src={icon} alt={getFullBrandName(name)} />\n </span>\n ))}\n </span>\n );\n};\n\nexport default AvailableBrands;\n"],"names":["AvailableBrands","brands","activeBrand","length","h","span","className","classNames","map","name","icon","key","Img","src","alt","getFullBrandName"],"mappings":"wOAcA,MAAMA,EAAkB,EAAGC,SAAQC,kBAC/B,IAAKD,GAAQE,OACT,OAAO,KAIX,OACIC,EAACC,OAAAA,CACGC,UAAWC,EAAW,+BAAgC,CAClD,uCAJyB,SAAhBL,KAOZD,EAAOO,KAAI,EAAGC,OAAMC,UACjBN,EAACC,OAAAA,CAAKM,IAAKF,EAAMH,UAAU,+CACvBF,EAACQ,EAAAA,CAAIC,IAAKH,EAAMI,IAAKC,EAAiBN"}
@@ -1,2 +1,2 @@
1
- import{createElement as r}from"../../../../../external/preact/dist/preact.js";import{getCardImageUrl as e,getFullBrandName as o}from"../utils.js";import a from"../../../../../core/Context/useImage.js";import{useState as t}from"../../../../../external/preact/hooks/dist/hooks.js";import n from"../../../../../external/classnames/index.js";function c({brand:c,brandsConfiguration:s={}}){const d=a(),i="card"===c?"nocard":c,m=s[c]?.icon??e(i,d),[u,p]=t(!1),_=n({"adyen-checkout-card-input__icon":!0,"adyen-checkout__card__cardNumber__brandIcon":!0,"adyen-checkout-card-input__icon--hidden":!u});return r("img",{className:_,onLoad:()=>{p(!0)},onError:()=>{p(!1)},alt:o(c),src:m})}export{c as default};
1
+ import{createElement as r}from"../../../../../external/preact/dist/preact.js";import{getCardImageUrl as o,getFullBrandName as t}from"../utils.js";import a from"../../../../../core/Context/useImage.js";import{useState as e}from"../../../../../external/preact/hooks/dist/hooks.js";import n from"../../../../../_virtual/index.js";function c({brand:c,brandsConfiguration:i={}}){const s=a(),d="card"===c?"nocard":c,m=i[c]?.icon??o(d,s),[u,p]=e(!1),_=n({"adyen-checkout-card-input__icon":!0,"adyen-checkout__card__cardNumber__brandIcon":!0,"adyen-checkout-card-input__icon--hidden":!u});return r("img",{className:_,onLoad:()=>{p(!0)},onError:()=>{p(!1)},alt:t(c),src:m})}export{c as default};
2
2
  //# sourceMappingURL=BrandIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrandIcon.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/BrandIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../utils';\nimport { BrandIconProps } from './types';\nimport useImage from '../../../../../core/Context/useImage';\nimport { useState } from 'preact/hooks';\nimport classNames from 'classnames';\n\nexport default function BrandIcon({ brand, brandsConfiguration = {} }: BrandIconProps) {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n\n const [hasLoaded, setHasLoaded] = useState(false);\n\n const handleError = () => {\n setHasLoaded(false);\n };\n\n const handleLoad = () => {\n setHasLoaded(true);\n };\n\n const fieldClassnames = classNames({\n 'adyen-checkout-card-input__icon': true,\n 'adyen-checkout__card__cardNumber__brandIcon': true,\n 'adyen-checkout-card-input__icon--hidden': !hasLoaded\n });\n\n return <img className={fieldClassnames} onLoad={handleLoad} onError={handleError} alt={getFullBrandName(brand)} src={imageUrl} />;\n}\n"],"names":["BrandIcon","brand","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","hasLoaded","setHasLoaded","useState","fieldClassnames","classNames","h","img","className","onLoad","onError","alt","getFullBrandName","src"],"mappings":"kVAOe,SAASA,GAAUC,MAAEA,EAAKC,oBAAEA,EAAsB,CAAE,IAC/D,MAAMC,EAAWC,IACXC,EAAsB,SAAVJ,EAAmB,SAAWA,EAC1CK,EAAWJ,EAAoBD,IAAQM,MAAQC,EAAgBH,EAAWF,IAEzEM,EAAWC,GAAgBC,GAAS,GAUrCC,EAAkBC,EAAW,CAC/B,mCAAmC,EACnC,+CAA+C,EAC/C,2CAA4CJ,IAGhD,OAAOK,EAACC,MAAAA,CAAIC,UAAWJ,EAAiBK,OAVrB,KACfP,GAAa,EAAA,EAS2CQ,QAdxC,KAChBR,GAAa,EAAA,EAaiES,IAAKC,EAAiBnB,GAAQoB,IAAKf,GACzH"}
1
+ {"version":3,"file":"BrandIcon.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/BrandIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../utils';\nimport { BrandIconProps } from './types';\nimport useImage from '../../../../../core/Context/useImage';\nimport { useState } from 'preact/hooks';\nimport classNames from 'classnames';\n\nexport default function BrandIcon({ brand, brandsConfiguration = {} }: BrandIconProps) {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n\n const [hasLoaded, setHasLoaded] = useState(false);\n\n const handleError = () => {\n setHasLoaded(false);\n };\n\n const handleLoad = () => {\n setHasLoaded(true);\n };\n\n const fieldClassnames = classNames({\n 'adyen-checkout-card-input__icon': true,\n 'adyen-checkout__card__cardNumber__brandIcon': true,\n 'adyen-checkout-card-input__icon--hidden': !hasLoaded\n });\n\n return <img className={fieldClassnames} onLoad={handleLoad} onError={handleError} alt={getFullBrandName(brand)} src={imageUrl} />;\n}\n"],"names":["BrandIcon","brand","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","hasLoaded","setHasLoaded","useState","fieldClassnames","classNames","h","img","className","onLoad","onError","alt","getFullBrandName","src"],"mappings":"uUAOe,SAASA,GAAUC,MAAEA,EAAKC,oBAAEA,EAAsB,CAAE,IAC/D,MAAMC,EAAWC,IACXC,EAAsB,SAAVJ,EAAmB,SAAWA,EAC1CK,EAAWJ,EAAoBD,IAAQM,MAAQC,EAAgBH,EAAWF,IAEzEM,EAAWC,GAAgBC,GAAS,GAUrCC,EAAkBC,EAAW,CAC/B,mCAAmC,EACnC,+CAA+C,EAC/C,2CAA4CJ,IAGhD,OAAOK,EAACC,MAAAA,CAAIC,UAAWJ,EAAiBK,OAVrB,KACfP,GAAa,EAAA,EAS2CQ,QAdxC,KAChBR,GAAa,EAAA,EAaiES,IAAKC,EAAiBnB,GAAQoB,IAAKf,GACzH"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import o from"./CVCHint.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as i,CVC_POLICY_OPTIONAL as c,ENCRYPTED_SECURITY_CODE as l,CVC_POLICY_REQUIRED as n}from"../../../../internal/SecuredFields/lib/constants.js";import s from"./DataSfSpan.js";import{alternativeLabelContent as d}from"./FieldLabelAlternative.js";function u(u){const{label:_,onFocusField:m=()=>{},error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:b=n,showContextualElement:k,contextualText:v}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":b===i,"adyen-checkout__field__cvc--optional":b===c}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=b!==c?_:j.get("creditCard.securityCode.label.optional");return e(a,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>m(l),className:V,errorMessage:f,isValid:x,dir:"ltr",name:l,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:d,showContextualElement:k,contextualText:v},e(s,{encryptedFieldType:l,className:N}),e(o,{frontCVC:F,fieldLabel:T}))}export{u as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../_virtual/index.js";import o from"./CVCHint.js";import i from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as a,CVC_POLICY_OPTIONAL as c,ENCRYPTED_SECURITY_CODE as l,CVC_POLICY_REQUIRED as n}from"../../../../internal/SecuredFields/lib/constants.js";import d from"./DataSfSpan.js";import{alternativeLabelContent as s}from"./FieldLabelAlternative.js";function u(u){const{label:_,onFocusField:m=()=>{},error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:v=n,showContextualElement:b,contextualText:k}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":v===a,"adyen-checkout__field__cvc--optional":v===c}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=v!==c?_:j.get("creditCard.securityCode.label.optional"),E=`${T} ${k}`;return e(i,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>m(l),className:V,errorMessage:f,isValid:x,dir:"ltr",name:l,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:s,showContextualElement:b,contextualText:k},e(d,{encryptedFieldType:l,className:N}),e(o,{frontCVC:F,fieldLabel:E}))}export{u as default};
2
2
  //# sourceMappingURL=CVC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={fieldLabel} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"2jBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,OAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAExE,OACIC,EAACC,EAAAA,CACGvB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAauB,GACjCrB,UAAWY,EACXU,aAAcvB,EACdK,QAASA,EACTmB,IAAK,MACLC,KAAMH,EACNX,KAAMA,EACNe,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BpB,sBAAuBA,EACvBC,eAAgBA,GAEhBU,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBrB,UAAWgB,IAEpEG,EAACY,EAAAA,CAAQ1B,SAAUA,EAAUY,WAAYA,IAGrD"}
1
+ {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n const imageDescription = `${fieldLabel} ${contextualText}`;\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={imageDescription} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","imageDescription","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"gjBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,OAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAElEC,EAAmB,GAAGF,KAAcR,IAE1C,OACIW,EAACC,EAAAA,CACGxB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAawB,GACjCtB,UAAWY,EACXW,aAAcxB,EACdK,QAASA,EACToB,IAAK,MACLC,KAAMH,EACNZ,KAAMA,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BrB,sBAAuBA,EACvBC,eAAgBA,GAEhBW,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBtB,UAAWgB,IAEpEI,EAACY,EAAAA,CAAQ3B,SAAUA,EAAUY,WAAYE,IAGrD"}
@@ -1,2 +1,2 @@
1
- import{createElement as c}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";function e({frontCVC:e=!1,fieldLabel:_}){const i=t({"adyen-checkout__card__cvc__hint__wrapper":!0,"adyen-checkout__field__cvc--front-hint":!!e,"adyen-checkout__field__cvc--back-hint":!e});return c("span",{className:i},c("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!e,"aria-describedby":"adyen-checkout__cvc__front-hint-img",role:"img"},c("title",{id:"adyen-checkout__cvc__front-hint-img"},_),c("path",{d:"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z",fill:"#E6E9EB"}),c("rect",{x:"4",y:"12",width:"19",height:"2",fill:"#B9C4C9"}),c("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1",fill:"white"}),c("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"4.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})),c("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!!e,"aria-describedby":"adyen-checkout__cvc__back-hint-img",role:"img"},c("title",{id:"adyen-checkout__cvc__back-hint-img"},_),c("path",{d:"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z",fill:"#E6E9EB"}),c("path",{d:"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z",fill:"#E6E9EB"}),c("rect",{y:"4.00012",width:"27",height:"3.00001",fill:"#687282"}),c("path",{d:"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z",fill:"white"}),c("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"9.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})))}export{e as default};
1
+ import{createElement as t}from"../../../../../external/preact/dist/preact.js";import c from"../../../../../_virtual/index.js";function e({frontCVC:e=!1,fieldLabel:_}){const i=c({"adyen-checkout__card__cvc__hint__wrapper":!0,"adyen-checkout__field__cvc--front-hint":!!e,"adyen-checkout__field__cvc--back-hint":!e});return t("span",{className:i},t("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!e,role:"img"},t("title",{id:"adyen-checkout__cvc__front-hint-img"},_),t("path",{d:"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z",fill:"#E6E9EB"}),t("rect",{x:"4",y:"12",width:"19",height:"2",fill:"#B9C4C9"}),t("rect",{x:"4",y:"4",width:"4",height:"4",rx:"1",fill:"white"}),t("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"4.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})),t("svg",{className:"adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back",width:"27",height:"18",viewBox:"0 0 27 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!!e,role:"img"},t("title",{id:"adyen-checkout__cvc__back-hint-img"},_),t("path",{d:"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z",fill:"#E6E9EB"}),t("path",{d:"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z",fill:"#E6E9EB"}),t("rect",{y:"4.00012",width:"27",height:"3.00001",fill:"#687282"}),t("path",{d:"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z",fill:"white"}),t("rect",{className:"adyen-checkout__card__cvc__hint__location",x:"16.5",y:"9.5",width:"7",height:"5",rx:"2.5",stroke:"#C12424"})))}export{e as default};
2
2
  //# sourceMappingURL=CVCHint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CVCHint.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVCHint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport { CVCHintProps } from './types';\n\nexport default function CVCHint({ frontCVC = false, fieldLabel }: CVCHintProps) {\n const hintClassnames = classNames({\n 'adyen-checkout__card__cvc__hint__wrapper': true,\n 'adyen-checkout__field__cvc--front-hint': !!frontCVC,\n 'adyen-checkout__field__cvc--back-hint': !frontCVC\n });\n\n return (\n <span className={hintClassnames}>\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!frontCVC}\n aria-describedby={'adyen-checkout__cvc__front-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__front-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z\"\n fill=\"#E6E9EB\"\n />\n <rect x=\"4\" y=\"12\" width=\"19\" height=\"2\" fill=\"#B9C4C9\" />\n <rect x=\"4\" y=\"4\" width=\"4\" height=\"4\" rx=\"1\" fill=\"white\" />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"4.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!!frontCVC}\n aria-describedby={'adyen-checkout__cvc__back-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__back-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z\"\n fill=\"#E6E9EB\"\n />\n <path\n d=\"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z\"\n fill=\"#E6E9EB\"\n />\n <rect y=\"4.00012\" width=\"27\" height=\"3.00001\" fill=\"#687282\" />\n <path\n d=\"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z\"\n fill=\"white\"\n />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"9.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n </span>\n );\n}\n"],"names":["CVCHint","frontCVC","fieldLabel","hintClassnames","classNames","h","span","className","svg","width","height","viewBox","fill","xmlns","aria-hidden","aria-describedby","role","title","id","path","d","rect","x","y","rx","stroke"],"mappings":"yIAIe,SAASA,GAAQC,SAAEA,GAAW,EAAKC,WAAEA,IAChD,MAAMC,EAAiBC,EAAW,CAC9B,4CAA4C,EAC5C,2CAA4CH,EAC5C,yCAA0CA,IAG9C,OACII,EAACC,OAAAA,CAAKC,UAAWJ,GACbE,EAACG,MAAAA,CACGD,UAAW,yEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,eAAcb,EACdc,mBAAkB,sCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,uCAAwChB,GACnDG,EAACc,OAAAA,CACGC,EAAE,0HACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,KAAKd,MAAM,KAAKC,OAAO,IAAIE,KAAK,YAC9CP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,IAAId,MAAM,IAAIC,OAAO,IAAIc,GAAG,IAAIZ,KAAK,UACnDP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAGxHpB,EAACG,MAAAA,CACGD,UAAW,wEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,gBAAeb,EACfc,mBAAkB,qCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,sCAAuChB,GAClDG,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKE,EAAE,UAAUd,MAAM,KAAKC,OAAO,UAAUE,KAAK,YACnDP,EAACc,OAAAA,CACGC,EAAE,6HACFR,KAAK,UAETP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAIpI"}
1
+ {"version":3,"file":"CVCHint.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVCHint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport { CVCHintProps } from './types';\n\nexport default function CVCHint({ frontCVC = false, fieldLabel }: CVCHintProps) {\n const hintClassnames = classNames({\n 'adyen-checkout__card__cvc__hint__wrapper': true,\n 'adyen-checkout__field__cvc--front-hint': !!frontCVC,\n 'adyen-checkout__field__cvc--back-hint': !frontCVC\n });\n\n return (\n <span className={hintClassnames}>\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!frontCVC}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__front-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z\"\n fill=\"#E6E9EB\"\n />\n <rect x=\"4\" y=\"12\" width=\"19\" height=\"2\" fill=\"#B9C4C9\" />\n <rect x=\"4\" y=\"4\" width=\"4\" height=\"4\" rx=\"1\" fill=\"white\" />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"4.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!!frontCVC}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__back-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z\"\n fill=\"#E6E9EB\"\n />\n <path\n d=\"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z\"\n fill=\"#E6E9EB\"\n />\n <rect y=\"4.00012\" width=\"27\" height=\"3.00001\" fill=\"#687282\" />\n <path\n d=\"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z\"\n fill=\"white\"\n />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"9.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n </span>\n );\n}\n"],"names":["CVCHint","frontCVC","fieldLabel","hintClassnames","classNames","h","span","className","svg","width","height","viewBox","fill","xmlns","aria-hidden","role","title","id","path","d","rect","x","y","rx","stroke"],"mappings":"8HAIe,SAASA,GAAQC,SAAEA,GAAW,EAAKC,WAAEA,IAChD,MAAMC,EAAiBC,EAAW,CAC9B,4CAA4C,EAC5C,2CAA4CH,EAC5C,yCAA0CA,IAG9C,OACII,EAACC,OAAAA,CAAKC,UAAWJ,GACbE,EAACG,MAAAA,CACGD,UAAW,yEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,eAAcb,EACdc,KAAM,OAENV,EAACW,QAAAA,CAAMC,GAAI,uCAAwCf,GACnDG,EAACa,OAAAA,CACGC,EAAE,0HACFP,KAAK,YAETP,EAACe,OAAAA,CAAKC,EAAE,IAAIC,EAAE,KAAKb,MAAM,KAAKC,OAAO,IAAIE,KAAK,YAC9CP,EAACe,OAAAA,CAAKC,EAAE,IAAIC,EAAE,IAAIb,MAAM,IAAIC,OAAO,IAAIa,GAAG,IAAIX,KAAK,UACnDP,EAACe,OAAAA,CAAKb,UAAW,4CAA6Cc,EAAE,OAAOC,EAAE,MAAMb,MAAM,IAAIC,OAAO,IAAIa,GAAG,MAAMC,OAAO,aAGxHnB,EAACG,MAAAA,CACGD,UAAW,wEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,gBAAeb,EACfc,KAAM,OAENV,EAACW,QAAAA,CAAMC,GAAI,sCAAuCf,GAClDG,EAACa,OAAAA,CACGC,EAAE,wMACFP,KAAK,YAETP,EAACa,OAAAA,CACGC,EAAE,wMACFP,KAAK,YAETP,EAACe,OAAAA,CAAKE,EAAE,UAAUb,MAAM,KAAKC,OAAO,UAAUE,KAAK,YACnDP,EAACa,OAAAA,CACGC,EAAE,6HACFP,KAAK,UAETP,EAACe,OAAAA,CAAKb,UAAW,4CAA6Cc,EAAE,OAAOC,EAAE,MAAMb,MAAM,IAAIC,OAAO,IAAIa,GAAG,MAAMC,OAAO,aAIpI"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import a from"./CVC.js";import t from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import n from"../../../../../external/classnames/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as c,DATE_POLICY_HIDDEN as i,ENCRYPTED_EXPIRY_DATE as o,ENCRYPTED_SECURITY_CODE as l,ENCRYPTED_CARD_NUMBER as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function m({brand:m,brandsIcons:p,brandsConfiguration:y,dualBrandingElements:x,dualBrandingChangeHandler:C,dualBrandingSelected:f,errors:_,focusedElement:b,hasCVC:g,cvcPolicy:h,expiryDatePolicy:E,onFocusField:v,showBrandIcon:B,valid:F,showContextualElement:N}){const{i18n:j}=d(),k=(e,r)=>e[r]?j.get(e[r]):null,w=p?.filter((e=>!c?.includes(e.name))),D="amex"===m,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:m,brandsConfiguration:y,error:k(_,s),focused:b===s,isValid:!!F.encryptedCardNumber,label:j.get("creditCard.cardNumber.label"),onFocusField:v,filled:!!_.encryptedCardNumber||!!F.encryptedCardNumber,showBrandIcon:B,dualBrandingElements:x,dualBrandingChangeHandler:C,dualBrandingSelected:f}),e(u,{activeBrand:m,brands:w}),e("div",{className:n("adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":E===i})},e(t,{error:k(_,o),focused:b===o,isValid:!!F.encryptedExpiryMonth&&!!F.encryptedExpiryYear,filled:!!_.encryptedExpiryDate||!!F.encryptedExpiryYear,label:j.get("creditCard.expiryDate.label"),onFocusField:v,className:"adyen-checkout__field--50",expiryDatePolicy:E,showContextualElement:N,contextualText:j.get("creditCard.expiryDate.contextualText")}),g&&e(a,{error:k(_,l),focused:b===l,cvcPolicy:h,isValid:!!F.encryptedSecurityCode,filled:!!_.encryptedSecurityCode||!!F.encryptedSecurityCode,label:j.get("creditCard.securityCode.label"),onFocusField:v,className:"adyen-checkout__field--50",frontCVC:D,showContextualElement:N,contextualText:S})))}export{m 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 n from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as i,DATE_POLICY_HIDDEN as c,ENCRYPTED_EXPIRY_DATE as o,ENCRYPTED_SECURITY_CODE as l,ENCRYPTED_CARD_NUMBER 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=m?.filter((e=>!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(_,s),focused:b===s,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===c})},e(a,{error:k(_,o),focused:b===o,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(_,l),focused:b===l,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};
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":"kjBAgBe,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,EAAOY,GAAaH,EAAKI,IAAIb,EAAOY,IAAc,KAIvDE,EAAgBnB,GAAaoB,QAAOpB,IAAgBqB,GAA8BC,SAAStB,EAAYuB,QACvGC,EAAmB,SAAVzB,EACT0B,EAAoBD,EACpBV,EAAKI,IAAI,kDACTJ,EAAKI,IAAI,kDAEf,OACIQ,EAACC,MAAAA,CAAIC,UAAU,8BACXF,EAACG,EAAAA,CACG9B,MAAOA,EACPE,oBAAqBA,EACrB6B,MAAOd,EAASX,EAAQ0B,GACxBC,QAAS1B,IAAmByB,EAC5BE,UAAWrB,EAAMsB,oBACjBC,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACd0B,SAAU/B,EAAO6B,uBAAyBtB,EAAMsB,oBAChDvB,cAAeA,EACfT,qBAAsBA,EACtBC,0BAA2BA,EAC3BC,qBAAsBA,IAG1BsB,EAACW,EAAAA,CAAgBC,YAAavC,EAAOwC,OAAQpB,IAE7CO,EAACC,MAAAA,CACGC,UAAWY,EAAW,8DAA+D,CACjF,yDAA0D/B,IAAqBgC,KAGnFf,EAACgB,EAAAA,CACGZ,MAAOd,EAASX,EAAQsC,GACxBX,QAAS1B,IAAmBqC,EAC5BV,UAAWrB,EAAMgC,wBAA0BhC,EAAMiC,oBACjDT,SAAU/B,EAAOyC,uBAAyBlC,EAAMiC,oBAChDV,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACdkB,UAAW,4BACXnB,iBAAkBA,EAClBI,sBAAuBA,EACvBkC,eAAgBjC,EAAKI,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
+ {"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,IA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4BACXuB,SAAU3B,EACVX,sBAAuBA,EACvBkC,eAAgBtB,KAMxC"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/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}),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 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}),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};
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 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 && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\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","div","map","element","DualBrandingIcon","key","id","onClick","dataValue","notSelected"],"mappings":"wiBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAExI,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,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,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, dualBrandingChangeHandler, dualBrandingSelected } = props;\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 && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\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","div","map","element","DualBrandingIcon","key","id","onClick","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,EAExI,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,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,EAAQG,QAOzG"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import n from"./DataSfSpan.js";import{DATE_POLICY_HIDDEN as o,DATE_POLICY_OPTIONAL as r,ENCRYPTED_EXPIRY_DATE as l,DATE_POLICY_REQUIRED as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as s}from"./FieldLabelAlternative.js";function _(_){const{label:p,focused:m,filled:u,onFocusField:x,className:f="",error:h="",isValid:y=!1,expiryDatePolicy:k=d,showContextualElement:F,contextualText:j}=_,{i18n:b}=i(),N=c(),g=t(f,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":k===o,"adyen-checkout__field__exp-date--optional":k===r}),C=k!==r?p:`${p} ${b.get("field.title.optional")}`;return e(a,{label:C,classNameModifiers:["expiryDate"],className:g,focused:m,filled:u,onFocusField:()=>x(l),errorMessage:h,isValid:y,dir:"ltr",name:"encryptedExpiryDate",i18n:b,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:s,showContextualElement:F,contextualText:j},e(n,{encryptedFieldType:l,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":h,"adyen-checkout__input--focus":m,"adyen-checkout__input--valid":y})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":h||y})},e("img",{src:N({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:C})))}export{_ as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../_virtual/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import o from"./DataSfSpan.js";import{DATE_POLICY_HIDDEN as n,DATE_POLICY_OPTIONAL as r,ENCRYPTED_EXPIRY_DATE as l,DATE_POLICY_REQUIRED as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as _}from"./FieldLabelAlternative.js";function s(s){const{label:p,focused:u,filled:m,onFocusField:f,className:x="",error:h="",isValid:y=!1,expiryDatePolicy:k=d,showContextualElement:F,contextualText:j}=s,{i18n:b}=i(),N=c(),g=t(x,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":k===n,"adyen-checkout__field__exp-date--optional":k===r}),v=k!==r?p:`${p} ${b.get("field.title.optional")}`,C=`${v} ${j}`;return e(a,{label:v,classNameModifiers:["expiryDate"],className:g,focused:u,filled:m,onFocusField:()=>f(l),errorMessage:h,isValid:y,dir:"ltr",name:"encryptedExpiryDate",i18n:b,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:_,showContextualElement:F,contextualText:j},e(o,{encryptedFieldType:l,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":h,"adyen-checkout__input--focus":u,"adyen-checkout__input--valid":y})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":h||y})},e("img",{src:N({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:C})))}export{s as default};
2
2
  //# sourceMappingURL=ExpirationDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={['expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={fieldLabel}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","h","Field","classNameModifiers","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt"],"mappings":"ulBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,MACdA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAX,GACEY,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWZ,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDG,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBlB,EAAQ,GAAGA,KAASW,EAAKS,IAAI,0BAE5F,OACIC,EAACC,EAAAA,CACGtB,MAAOmB,EACPI,mBAAoB,CAAC,cACrBnB,UAAWW,EACXd,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAaqB,GACjCC,aAAcpB,EACdC,QAASA,EACToB,IAAK,MACLC,KAAM,sBACNhB,KAAMA,EACNiB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BtB,sBAAuBA,EACvBC,eAAgBA,GAEhBW,EAACW,EAAAA,CACGC,mBAAoBT,EACpBpB,UAAWY,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCJ,EAChC,+BAAgCK,MAGxCe,EAACa,OAAAA,CACG9B,UAAWY,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAGrEe,EAACc,MAAAA,CACGC,IAAKvB,EAAS,CAAEwB,YAAa,eAAxBxB,CAAyC,oBAC9CT,UAAU,uCACVkC,IAAKnB,KAKzB"}
1
+ {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n const imageDescription = `${fieldLabel} ${contextualText}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={['expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={imageDescription}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","imageDescription","h","Field","classNameModifiers","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt"],"mappings":"4kBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,MACdA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAX,GACEY,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWZ,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDG,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBlB,EAAQ,GAAGA,KAASW,EAAKS,IAAI,0BAEtFC,EAAmB,GAAGF,KAAcT,IAE1C,OACIY,EAACC,EAAAA,CACGvB,MAAOmB,EACPK,mBAAoB,CAAC,cACrBpB,UAAWW,EACXd,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAasB,GACjCC,aAAcrB,EACdC,QAASA,EACTqB,IAAK,MACLC,KAAM,sBACNjB,KAAMA,EACNkB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BvB,sBAAuBA,EACvBC,eAAgBA,GAEhBY,EAACW,EAAAA,CACGC,mBAAoBT,EACpBrB,UAAWY,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCJ,EAChC,+BAAgCK,MAGxCgB,EAACa,OAAAA,CACG/B,UAAWY,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAGrEgB,EAACc,MAAAA,CACGC,IAAKxB,EAAS,CAAEyB,YAAa,eAAxBzB,CAAyC,oBAC9CT,UAAU,uCACVmC,IAAKlB,KAKzB"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import{useMemo as r}from"../../../../../external/preact/hooks/dist/hooks.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import s from"./DataSfSpan.js";import d from"../../../../internal/FormFields/InputTelephone.js";import{alternativeLabelContent as n}from"./FieldLabelAlternative.js";import{CREDITCARD_TAX_NUMBER_INVALID as l}from"../../../../../core/Errors/constants.js";function i(i){const{i18n:c}=o(),u=r((()=>i.value?.length>6?c.get("creditCard.taxNumber.labelAlt"):c.get("creditCard.taxNumber.label")),[i.value]);return e("div",{className:"adyen-checkout__card__kcp-authentication"},e(a,{label:u,filled:i.filled,classNameModifiers:["kcp-taxNumber"],errorMessage:i.error&&c.get(l),isValid:i.isValid,dir:"ltr",name:"kcpTaxNumberOrDOB",onFocus:e=>i.onFieldFocusAnalytics("taxNumber",e),onBlur:e=>i.onFieldBlurAnalytics("taxNumber",e)},e(d,{name:"kcpTaxNumberOrDOB",className:"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input",maxLength:10,minLength:6,autoComplete:"false",value:i.value,required:!0,onBlur:i.onBlur,onInput:i.onInput,disabled:i.disabled,placeholder:i.placeholder})),e(a,{label:c.get("creditCard.password.label"),focused:"encryptedPassword"===i.focusedElement,filled:i.filled,classNameModifiers:["50","koreanAuthentication-encryptedPassword"],onFocusField:()=>i.onFocusField("encryptedPassword"),errorMessage:i.encryptedPasswordState.errors&&c.get(String(i.encryptedPasswordState.errors)),isValid:i.encryptedPasswordState.valid,dir:"ltr",name:"encryptedPassword",useLabelElement:!1,renderAlternativeToLabel:n},e(s,{encryptedFieldType:"encryptedPassword",className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":i.encryptedPasswordState.errors,"adyen-checkout__input--valid":i.encryptedPasswordState.valid,"adyen-checkout__input--focus":"encryptedPassword"===i.focusedElement})})))}export{i as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import{useMemo as r}from"../../../../../external/preact/hooks/dist/hooks.js";import t from"../../../../../_virtual/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import s from"./DataSfSpan.js";import d from"../../../../internal/FormFields/InputTelephone.js";import{alternativeLabelContent as n}from"./FieldLabelAlternative.js";import{CREDITCARD_TAX_NUMBER_INVALID as l}from"../../../../../core/Errors/constants.js";function i(i){const{i18n:c}=o(),u=r((()=>i.value?.length>6?c.get("creditCard.taxNumber.labelAlt"):c.get("creditCard.taxNumber.label")),[i.value]);return e("div",{className:"adyen-checkout__card__kcp-authentication"},e(a,{label:u,filled:i.filled,classNameModifiers:["kcp-taxNumber"],errorMessage:i.error&&c.get(l),isValid:i.isValid,dir:"ltr",name:"kcpTaxNumberOrDOB",onFocus:e=>i.onFieldFocusAnalytics("taxNumber",e),onBlur:e=>i.onFieldBlurAnalytics("taxNumber",e)},e(d,{name:"kcpTaxNumberOrDOB",className:"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input",maxLength:10,minLength:6,autoComplete:"false",value:i.value,required:!0,onBlur:i.onBlur,onInput:i.onInput,disabled:i.disabled,placeholder:i.placeholder})),e(a,{label:c.get("creditCard.password.label"),focused:"encryptedPassword"===i.focusedElement,filled:i.filled,classNameModifiers:["50","koreanAuthentication-encryptedPassword"],onFocusField:()=>i.onFocusField("encryptedPassword"),errorMessage:i.encryptedPasswordState.errors&&c.get(String(i.encryptedPasswordState.errors)),isValid:i.encryptedPasswordState.valid,dir:"ltr",name:"encryptedPassword",useLabelElement:!1,renderAlternativeToLabel:n},e(s,{encryptedFieldType:"encryptedPassword",className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":i.encryptedPasswordState.errors,"adyen-checkout__input--valid":i.encryptedPasswordState.valid,"adyen-checkout__input--focus":"encryptedPassword"===i.focusedElement})})))}export{i as default};
2
2
  //# sourceMappingURL=KCPAuthentication.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KCPAuthentication.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/KCPAuthentication.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { KCPProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport InputTelephone from '../../../../internal/FormFields/InputTelephone';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\nimport { CREDITCARD_TAX_NUMBER_INVALID } from '../../../../../core/Errors/constants';\n\nexport default function KCPAuthentication(props: KCPProps) {\n const { i18n } = useCoreContext();\n\n const taxNumberLabel = useMemo((): string => {\n if (props.value?.length > 6) return i18n.get('creditCard.taxNumber.labelAlt');\n\n return i18n.get('creditCard.taxNumber.label');\n }, [props.value]);\n\n return (\n <div className=\"adyen-checkout__card__kcp-authentication\">\n <Field\n label={taxNumberLabel}\n filled={props.filled}\n classNameModifiers={['kcp-taxNumber']}\n errorMessage={props.error && i18n.get(CREDITCARD_TAX_NUMBER_INVALID)}\n isValid={props.isValid}\n dir={'ltr'}\n name={'kcpTaxNumberOrDOB'}\n onFocus={e => props.onFieldFocusAnalytics('taxNumber', e)}\n onBlur={e => props.onFieldBlurAnalytics('taxNumber', e)}\n >\n <InputTelephone\n name={'kcpTaxNumberOrDOB'}\n className=\"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input\"\n maxLength={10}\n minLength={6}\n autoComplete={'false'}\n value={props.value}\n required={true}\n onBlur={props.onBlur}\n onInput={props.onInput}\n disabled={props.disabled}\n placeholder={props.placeholder}\n />\n </Field>\n\n <Field\n label={i18n.get('creditCard.password.label')}\n focused={props.focusedElement === 'encryptedPassword'}\n filled={props.filled}\n classNameModifiers={['50', 'koreanAuthentication-encryptedPassword']}\n onFocusField={() => props.onFocusField('encryptedPassword')}\n errorMessage={props.encryptedPasswordState.errors && i18n.get(String(props.encryptedPasswordState.errors))}\n isValid={props.encryptedPasswordState.valid}\n dir={'ltr'}\n name={'encryptedPassword'}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType=\"encryptedPassword\"\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': props.encryptedPasswordState.errors,\n 'adyen-checkout__input--valid': props.encryptedPasswordState.valid,\n 'adyen-checkout__input--focus': props.focusedElement === 'encryptedPassword'\n })}\n />\n </Field>\n </div>\n );\n}\n"],"names":["KCPAuthentication","props","i18n","useCoreContext","taxNumberLabel","useMemo","value","length","get","h","div","className","Field","label","filled","classNameModifiers","errorMessage","error","CREDITCARD_TAX_NUMBER_INVALID","isValid","dir","name","onFocus","e","onFieldFocusAnalytics","onBlur","onFieldBlurAnalytics","InputTelephone","maxLength","minLength","autoComplete","required","onInput","disabled","placeholder","focused","focusedElement","onFocusField","encryptedPasswordState","errors","String","valid","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","classNames"],"mappings":"8lBAWe,SAASA,EAAkBC,GACtC,MAAMC,KAAEA,GAASC,IAEXC,EAAiBC,GAAQ,IACvBJ,EAAMK,OAAOC,OAAS,EAAUL,EAAKM,IAAI,iCAEtCN,EAAKM,IAAI,+BACjB,CAACP,EAAMK,QAEV,OACIG,EAACC,MAAAA,CAAIC,UAAU,4CACXF,EAACG,EAAAA,CACGC,MAAOT,EACPU,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,iBACrBC,aAAcf,EAAMgB,OAASf,EAAKM,IAAIU,GACtCC,QAASlB,EAAMkB,QACfC,IAAK,MACLC,KAAM,oBACNC,QAASC,GAAKtB,EAAMuB,sBAAsB,YAAaD,GACvDE,OAAQF,GAAKtB,EAAMyB,qBAAqB,YAAaH,IAErDd,EAACkB,EAAAA,CACGN,KAAM,oBACNV,UAAU,mEACViB,UAAW,GACXC,UAAW,EACXC,aAAc,QACdxB,MAAOL,EAAMK,MACbyB,UAAU,EACVN,OAAQxB,EAAMwB,OACdO,QAAS/B,EAAM+B,QACfC,SAAUhC,EAAMgC,SAChBC,YAAajC,EAAMiC,eAI3BzB,EAACG,EAAAA,CACGC,MAAOX,EAAKM,IAAI,6BAChB2B,QAAkC,sBAAzBlC,EAAMmC,eACftB,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,KAAM,0CAC3BsB,aAAc,IAAMpC,EAAMoC,aAAa,qBACvCrB,aAAcf,EAAMqC,uBAAuBC,QAAUrC,EAAKM,IAAIgC,OAAOvC,EAAMqC,uBAAuBC,SAClGpB,QAASlB,EAAMqC,uBAAuBG,MACtCrB,IAAK,MACLC,KAAM,oBACNqB,iBAAiB,EACjBC,yBAA0BC,GAE1BnC,EAACoC,EAAAA,CACGC,mBAAmB,oBACnBnC,UAAWoC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgC9C,EAAMqC,uBAAuBC,OAC7D,+BAAgCtC,EAAMqC,uBAAuBG,MAC7D,+BAAyD,sBAAzBxC,EAAMmC,oBAM9D"}
1
+ {"version":3,"file":"KCPAuthentication.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/KCPAuthentication.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { KCPProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport InputTelephone from '../../../../internal/FormFields/InputTelephone';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\nimport { CREDITCARD_TAX_NUMBER_INVALID } from '../../../../../core/Errors/constants';\n\nexport default function KCPAuthentication(props: KCPProps) {\n const { i18n } = useCoreContext();\n\n const taxNumberLabel = useMemo((): string => {\n if (props.value?.length > 6) return i18n.get('creditCard.taxNumber.labelAlt');\n\n return i18n.get('creditCard.taxNumber.label');\n }, [props.value]);\n\n return (\n <div className=\"adyen-checkout__card__kcp-authentication\">\n <Field\n label={taxNumberLabel}\n filled={props.filled}\n classNameModifiers={['kcp-taxNumber']}\n errorMessage={props.error && i18n.get(CREDITCARD_TAX_NUMBER_INVALID)}\n isValid={props.isValid}\n dir={'ltr'}\n name={'kcpTaxNumberOrDOB'}\n onFocus={e => props.onFieldFocusAnalytics('taxNumber', e)}\n onBlur={e => props.onFieldBlurAnalytics('taxNumber', e)}\n >\n <InputTelephone\n name={'kcpTaxNumberOrDOB'}\n className=\"adyen-checkout__card__kcp-taxNumber__input adyen-checkout__input\"\n maxLength={10}\n minLength={6}\n autoComplete={'false'}\n value={props.value}\n required={true}\n onBlur={props.onBlur}\n onInput={props.onInput}\n disabled={props.disabled}\n placeholder={props.placeholder}\n />\n </Field>\n\n <Field\n label={i18n.get('creditCard.password.label')}\n focused={props.focusedElement === 'encryptedPassword'}\n filled={props.filled}\n classNameModifiers={['50', 'koreanAuthentication-encryptedPassword']}\n onFocusField={() => props.onFocusField('encryptedPassword')}\n errorMessage={props.encryptedPasswordState.errors && i18n.get(String(props.encryptedPasswordState.errors))}\n isValid={props.encryptedPasswordState.valid}\n dir={'ltr'}\n name={'encryptedPassword'}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType=\"encryptedPassword\"\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': props.encryptedPasswordState.errors,\n 'adyen-checkout__input--valid': props.encryptedPasswordState.valid,\n 'adyen-checkout__input--focus': props.focusedElement === 'encryptedPassword'\n })}\n />\n </Field>\n </div>\n );\n}\n"],"names":["KCPAuthentication","props","i18n","useCoreContext","taxNumberLabel","useMemo","value","length","get","h","div","className","Field","label","filled","classNameModifiers","errorMessage","error","CREDITCARD_TAX_NUMBER_INVALID","isValid","dir","name","onFocus","e","onFieldFocusAnalytics","onBlur","onFieldBlurAnalytics","InputTelephone","maxLength","minLength","autoComplete","required","onInput","disabled","placeholder","focused","focusedElement","onFocusField","encryptedPasswordState","errors","String","valid","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","classNames"],"mappings":"mlBAWe,SAASA,EAAkBC,GACtC,MAAMC,KAAEA,GAASC,IAEXC,EAAiBC,GAAQ,IACvBJ,EAAMK,OAAOC,OAAS,EAAUL,EAAKM,IAAI,iCAEtCN,EAAKM,IAAI,+BACjB,CAACP,EAAMK,QAEV,OACIG,EAACC,MAAAA,CAAIC,UAAU,4CACXF,EAACG,EAAAA,CACGC,MAAOT,EACPU,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,iBACrBC,aAAcf,EAAMgB,OAASf,EAAKM,IAAIU,GACtCC,QAASlB,EAAMkB,QACfC,IAAK,MACLC,KAAM,oBACNC,QAASC,GAAKtB,EAAMuB,sBAAsB,YAAaD,GACvDE,OAAQF,GAAKtB,EAAMyB,qBAAqB,YAAaH,IAErDd,EAACkB,EAAAA,CACGN,KAAM,oBACNV,UAAU,mEACViB,UAAW,GACXC,UAAW,EACXC,aAAc,QACdxB,MAAOL,EAAMK,MACbyB,UAAU,EACVN,OAAQxB,EAAMwB,OACdO,QAAS/B,EAAM+B,QACfC,SAAUhC,EAAMgC,SAChBC,YAAajC,EAAMiC,eAI3BzB,EAACG,EAAAA,CACGC,MAAOX,EAAKM,IAAI,6BAChB2B,QAAkC,sBAAzBlC,EAAMmC,eACftB,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,KAAM,0CAC3BsB,aAAc,IAAMpC,EAAMoC,aAAa,qBACvCrB,aAAcf,EAAMqC,uBAAuBC,QAAUrC,EAAKM,IAAIgC,OAAOvC,EAAMqC,uBAAuBC,SAClGpB,QAASlB,EAAMqC,uBAAuBG,MACtCrB,IAAK,MACLC,KAAM,oBACNqB,iBAAiB,EACjBC,yBAA0BC,GAE1BnC,EAACoC,EAAAA,CACGC,mBAAmB,oBACnBnC,UAAWoC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgC9C,EAAMqC,uBAAuBC,OAC7D,+BAAgCtC,EAAMqC,uBAAuBG,MAC7D,+BAAyD,sBAAzBxC,EAAMmC,oBAM9D"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useCoreContext as t}from"../../../../core/Context/CoreProvider.js";import o from"../../../../external/classnames/index.js";const n=({id:n,open:a,onDisable:c,onCancel:d})=>{const{i18n:i}=t();return e("div",{id:n,"aria-hidden":!a,className:o({"adyen-checkout__payment-method__disable-confirmation":!0,"adyen-checkout__payment-method__disable-confirmation--open":a})},e("div",{className:"adyen-checkout__payment-method__disable-confirmation__content"},i.get("storedPaymentMethod.disable.confirmation"),e("div",{className:"adyen-checkout__payment-method__disable-confirmation__buttons"},e("button",{type:"button",className:o("adyen-checkout__button","adyen-checkout__payment-method__disable-confirmation__button","adyen-checkout__payment-method__disable-confirmation__button--remove"),disabled:!a,onClick:c},i.get("storedPaymentMethod.disable.confirmButton")),e("button",{type:"button",className:o("adyen-checkout__button","adyen-checkout__payment-method__disable-confirmation__button","adyen-checkout__payment-method__disable-confirmation__button--cancel"),disabled:!a,onClick:d},i.get("storedPaymentMethod.disable.cancelButton")))))};export{n as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useCoreContext as t}from"../../../../core/Context/CoreProvider.js";import o from"../../../../_virtual/index.js";const n=({id:n,open:a,onDisable:d,onCancel:i})=>{const{i18n:c}=t();return e("div",{id:n,"aria-hidden":!a,className:o({"adyen-checkout__payment-method__disable-confirmation":!0,"adyen-checkout__payment-method__disable-confirmation--open":a})},e("div",{className:"adyen-checkout__payment-method__disable-confirmation__content"},c.get("storedPaymentMethod.disable.confirmation"),e("div",{className:"adyen-checkout__payment-method__disable-confirmation__buttons"},e("button",{type:"button",className:o("adyen-checkout__button","adyen-checkout__payment-method__disable-confirmation__button","adyen-checkout__payment-method__disable-confirmation__button--remove"),disabled:!a,onClick:d},c.get("storedPaymentMethod.disable.confirmButton")),e("button",{type:"button",className:o("adyen-checkout__button","adyen-checkout__payment-method__disable-confirmation__button","adyen-checkout__payment-method__disable-confirmation__button--cancel"),disabled:!a,onClick:i},c.get("storedPaymentMethod.disable.cancelButton")))))};export{n as default};
2
2
  //# sourceMappingURL=DisableOneClickConfirmation.js.map