@adyen/adyen-web 6.0.0-alpha.7 → 6.0.0-beta.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 (271) hide show
  1. package/dist/cjs/adyen.css +65 -65
  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 +1767 -1832
  6. package/dist/es/adyen.css +65 -65
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/ANCV.js +1 -1
  9. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  10. package/dist/es/components/ANCV/components/ANCVInput.js.map +1 -1
  11. package/dist/es/components/Ach/Ach.js +1 -1
  12. package/dist/es/components/Ach/Ach.js.map +1 -1
  13. package/dist/es/components/Ach/components/AchInput/AchInput.js +1 -1
  14. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
  15. package/dist/es/components/Ach/components/AchInput/defaultProps.js +1 -1
  16. package/dist/es/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  17. package/dist/es/components/AfterPay/AfterPayB2B.js +1 -1
  18. package/dist/es/components/AfterPay/AfterPayB2B.js.map +1 -1
  19. package/dist/es/components/BacsDD/BacsDD.js +1 -1
  20. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  21. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  22. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  23. package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
  24. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  25. package/dist/es/components/Blik/Blik.js +1 -1
  26. package/dist/es/components/Blik/Blik.js.map +1 -1
  27. package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
  28. package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  29. package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  30. package/dist/es/components/Card/Card.js +1 -1
  31. package/dist/es/components/Card/Card.js.map +1 -1
  32. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  33. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  34. package/dist/es/components/Card/components/CardInput/handlers.js +1 -1
  35. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  36. package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +2 -0
  37. package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -0
  38. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  39. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  40. package/dist/es/components/Doku/Doku.js +1 -1
  41. package/dist/es/components/Doku/Doku.js.map +1 -1
  42. package/dist/es/components/Doku/components/DokuInput/DokuInput.js +1 -1
  43. package/dist/es/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  44. package/dist/es/components/Dropin/Dropin.js +1 -1
  45. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  46. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  47. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  48. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  49. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  50. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  51. package/dist/es/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  52. package/dist/es/components/Dropin/elements/createStoredElements.js.map +1 -1
  53. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  54. package/dist/es/components/Econtext/Econtext.js +1 -1
  55. package/dist/es/components/Econtext/Econtext.js.map +1 -1
  56. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  57. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  58. package/dist/es/components/Giropay/Giropay.js +1 -1
  59. package/dist/es/components/Giropay/Giropay.js.map +1 -1
  60. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  61. package/dist/es/components/Multibanco/Multibanco.js +1 -1
  62. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  63. package/dist/es/components/PersonalDetails/PersonalDetails.js +1 -1
  64. package/dist/es/components/PersonalDetails/PersonalDetails.js.map +1 -1
  65. package/dist/es/components/Redirect/Redirect.js +1 -1
  66. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  67. package/dist/es/components/Sepa/Sepa.js +1 -1
  68. package/dist/es/components/Sepa/Sepa.js.map +1 -1
  69. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  70. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  71. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  72. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  73. package/dist/es/components/Trustly/Trustly.js +1 -1
  74. package/dist/es/components/Trustly/Trustly.js.map +1 -1
  75. package/dist/es/components/WeChat/config.js +1 -1
  76. package/dist/es/components/WeChat/config.js.map +1 -1
  77. package/dist/es/components/components-name-map.js +1 -1
  78. package/dist/es/components/components-name-map.js.map +1 -1
  79. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  80. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  81. package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  82. package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  83. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  84. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  85. package/dist/es/components/index.js +1 -1
  86. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  87. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  88. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  89. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  90. package/dist/es/components/internal/ClickToPay/models/ShopperCard.js +1 -1
  91. package/dist/es/components/internal/ClickToPay/models/ShopperCard.js.map +1 -1
  92. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js +1 -1
  93. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  94. package/dist/es/components/internal/ClickToPay/services/utils.js +1 -1
  95. package/dist/es/components/internal/ClickToPay/services/utils.js.map +1 -1
  96. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  97. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  98. package/dist/es/components/internal/RedirectButton/RedirectButton.js +1 -1
  99. package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  100. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  101. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  102. package/dist/es/components/tx-variants.js +1 -1
  103. package/dist/es/components/tx-variants.js.map +1 -1
  104. package/dist/es/core/AdyenCheckout.js.map +1 -1
  105. package/dist/es/core/Analytics/Analytics.js +1 -1
  106. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  107. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  108. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  109. package/dist/es/core/Analytics/constants.js +1 -1
  110. package/dist/es/core/Analytics/constants.js.map +1 -1
  111. package/dist/es/core/Analytics/utils.js +1 -1
  112. package/dist/es/core/Analytics/utils.js.map +1 -1
  113. package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
  114. package/dist/es/core/ProcessResponse/PaymentAction/PaymentAction.js.map +1 -1
  115. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  116. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  117. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  118. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  119. package/dist/es/core/Services/http.js +1 -1
  120. package/dist/es/core/Services/http.js.map +1 -1
  121. package/dist/es/core/Services/sessions/setup-session.js +1 -1
  122. package/dist/es/core/Services/sessions/setup-session.js.map +1 -1
  123. package/dist/es/core/config.js +1 -1
  124. package/dist/es/core/config.js.map +1 -1
  125. package/dist/es/core/core.js +1 -1
  126. package/dist/es/core/core.js.map +1 -1
  127. package/dist/es/core/core.registry.js +1 -1
  128. package/dist/es/core/core.registry.js.map +1 -1
  129. package/dist/es/external/preact/dist/preact.js +1 -1
  130. package/dist/es/external/preact/dist/preact.js.map +1 -1
  131. package/dist/es/index.d.ts +1767 -1832
  132. package/dist/es/index.js +1 -1
  133. package/dist/es/language/constants.js +1 -1
  134. package/dist/es/language/constants.js.map +1 -1
  135. package/dist/es-legacy/adyen.css +65 -65
  136. package/dist/es-legacy/adyen.css.map +1 -1
  137. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  138. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  139. package/dist/es-legacy/components/ANCV/components/ANCVInput.js.map +1 -1
  140. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  141. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  142. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  143. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  144. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js +1 -1
  145. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  146. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  147. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  148. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  149. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  150. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  151. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  152. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  153. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  154. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  155. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  156. package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
  157. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  158. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  159. package/dist/es-legacy/components/Card/Card.js +1 -1
  160. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  161. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  162. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  163. package/dist/es-legacy/components/Card/components/CardInput/handlers.js +1 -1
  164. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  165. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +2 -0
  166. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -0
  167. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  168. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  169. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  170. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  171. package/dist/es-legacy/components/Doku/components/DokuInput/DokuInput.js +1 -1
  172. package/dist/es-legacy/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  173. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  174. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  175. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  176. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  177. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  178. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  179. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  180. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  181. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  182. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  183. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  184. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  185. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  186. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  187. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  188. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  189. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  190. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  191. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  192. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  193. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  194. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  195. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  196. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  197. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  198. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  199. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  200. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  201. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  202. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  203. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  204. package/dist/es-legacy/components/WeChat/config.js +1 -1
  205. package/dist/es-legacy/components/WeChat/config.js.map +1 -1
  206. package/dist/es-legacy/components/components-name-map.js +1 -1
  207. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  208. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  209. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  210. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  211. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  212. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  213. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  214. package/dist/es-legacy/components/index.js +1 -1
  215. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  216. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  217. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  218. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  219. package/dist/es-legacy/components/internal/ClickToPay/models/ShopperCard.js +1 -1
  220. package/dist/es-legacy/components/internal/ClickToPay/models/ShopperCard.js.map +1 -1
  221. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js +1 -1
  222. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  223. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js +1 -1
  224. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js.map +1 -1
  225. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  226. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  227. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  228. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  229. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  230. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  231. package/dist/es-legacy/components/tx-variants.js +1 -1
  232. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  233. package/dist/es-legacy/core/AdyenCheckout.js.map +1 -1
  234. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  235. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  236. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  237. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  238. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  239. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  240. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  241. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  242. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js.map +1 -1
  243. package/dist/es-legacy/core/ProcessResponse/PaymentAction/PaymentAction.js.map +1 -1
  244. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  245. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  246. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  247. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  248. package/dist/es-legacy/core/Services/http.js +1 -1
  249. package/dist/es-legacy/core/Services/http.js.map +1 -1
  250. package/dist/es-legacy/core/Services/sessions/setup-session.js +1 -1
  251. package/dist/es-legacy/core/Services/sessions/setup-session.js.map +1 -1
  252. package/dist/es-legacy/core/config.js +1 -1
  253. package/dist/es-legacy/core/config.js.map +1 -1
  254. package/dist/es-legacy/core/core.js +1 -1
  255. package/dist/es-legacy/core/core.js.map +1 -1
  256. package/dist/es-legacy/core/core.registry.js +1 -1
  257. package/dist/es-legacy/core/core.registry.js.map +1 -1
  258. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  259. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  260. package/dist/es-legacy/index.js +1 -1
  261. package/dist/es-legacy/language/constants.js +1 -1
  262. package/dist/es-legacy/language/constants.js.map +1 -1
  263. package/package.json +30 -30
  264. package/dist/es/components/Ideal/index.js +0 -2
  265. package/dist/es/components/Ideal/index.js.map +0 -1
  266. package/dist/es/core/Services/analytics/log-event.js +0 -2
  267. package/dist/es/core/Services/analytics/log-event.js.map +0 -1
  268. package/dist/es-legacy/components/Ideal/index.js +0 -2
  269. package/dist/es-legacy/components/Ideal/index.js.map +0 -1
  270. package/dist/es-legacy/core/Services/analytics/log-event.js +0 -2
  271. package/dist/es-legacy/core/Services/analytics/log-event.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDD',\n [TxVariants.sepadirectdebit]: 'Sepa',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n [TxVariants.riverty]: 'Riverty',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.ideal]: 'Ideal',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'Duitnow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","riverty","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","ideal","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","klarna","klarna_account","klarna_paynow","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","upi","upi_qr","upi_collect","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,KAAM,MAClB,CAACV,EAAWW,gBAAiB,SAC7B,CAACX,EAAWY,iBAAkB,OAI9B,CAACZ,EAAWa,QAAS,SACrB,CAACb,EAAWc,UAAW,WACvB,CAACd,EAAWe,kBAAmB,WAC/B,CAACf,EAAWgB,cAAe,cAC3B,CAAChB,EAAWiB,OAAQ,QACpB,CAACjB,EAAWkB,cAAe,cAC3B,CAAClB,EAAWmB,cAAe,cAC3B,CAACnB,EAAWoB,cAAe,cAC3B,CAACpB,EAAWqB,eAAgB,eAC5B,CAACrB,EAAWsB,eAAgB,eAC5B,CAACtB,EAAWuB,SAAU,UACtB,CAACvB,EAAWwB,qBAAsB,qBAClC,CAACxB,EAAWyB,SAAU,UAItB,CAACzB,EAAW0B,WAAY,YACxB,CAAC1B,EAAW2B,UAAW,WACvB,CAAC3B,EAAW4B,SAAU,aACtB,CAAC5B,EAAW6B,YAAa,aACzB,CAAC7B,EAAW8B,WAAY,YACxB,CAAC9B,EAAW+B,QAAS,SACrB,CAAC/B,EAAWgC,eAAgB,YAI5B,CAAChC,EAAWiC,gBAAiB,SAC7B,CAACjC,EAAWkC,qBAAsB,SAClC,CAAClC,EAAWmC,0BAA2B,SACvC,CAACnC,EAAWoC,MAAO,OACnB,CAACpC,EAAWqC,eAAgB,OAC5B,CAACrC,EAAWsC,uBAAwB,OACpC,CAACtC,EAAWuC,gBAAiB,OAC7B,CAACvC,EAAWwC,qBAAsB,OAClC,CAACxC,EAAWyC,kBAAmB,OAC/B,CAACzC,EAAW0C,iBAAkB,OAC9B,CAAC1C,EAAW2C,cAAe,OAC3B,CAAC3C,EAAW4C,iBAAkB,OAC9B,CAAC5C,EAAW6C,aAAc,OAC1B,CAAC7C,EAAW8C,aAAc,OAC1B,CAAC9C,EAAW+C,aAAc,OAC1B,CAAC/C,EAAWgD,aAAc,OAC1B,CAAChD,EAAWiD,MAAO,OACnB,CAACjD,EAAWkD,oBAAqB,SAIjC,CAAClD,EAAWmD,iBAAkB,iBAC9B,CAACnD,EAAWoD,iBAAkB,iBAC9B,CAACpD,EAAWqD,QAAS,SACrB,CAACrD,EAAWsD,KAAM,MAClB,CAACtD,EAAWuD,OAAQ,QACpB,CAACvD,EAAWwD,wBAAyB,mBACrC,CAACxD,EAAWyD,oBAAqB,mBACjC,CAACzD,EAAW0D,oBAAqB,mBACjC,CAAC1D,EAAW2D,kBAAmB,kBAC/B,CAAC3D,EAAW4D,kBAAmB,kBAC/B,CAAC5D,EAAW6D,kBAAmB,kBAC/B,CAAC7D,EAAW8D,kBAAmB,kBAC/B,CAAC9D,EAAW+D,WAAY,YACxB,CAAC/D,EAAWgE,kBAAmB,eAC/B,CAAChE,EAAWiE,YAAa,iBACzB,CAACjE,EAAWkE,WAAY,kBAIxB,CAAClE,EAAWmE,oBAAqB,YACjC,CAACnE,EAAWoE,uBAAwB,YACpC,CAACpE,EAAWqE,2BAA4B,YACxC,CAACrE,EAAWsE,2BAA4B,YAIxC,CAACtE,EAAWuE,cAAe,WAC3B,CAACvE,EAAWwE,iBAAkB,WAC9B,CAACxE,EAAWyE,uBAAwB,WACpC,CAACzE,EAAW0E,iBAAkB,WAI9B,CAAC1E,EAAW2E,SAAU,UACtB,CAAC3E,EAAW4E,YAAa,aACzB,CAAC5E,EAAW6E,UAAW,WACvB,CAAC7E,EAAW8E,OAAQ,QACpB,CAAC9E,EAAW+E,OAAQ,QACpB,CAAC/E,EAAWgF,SAAU,UAItB,CAAChF,EAAWiF,QAAS,SACrB,CAACjF,EAAWkF,gBAAiB,SAC7B,CAAClF,EAAWmF,eAAgB,SAI5B,CAACnF,EAAWoF,aAAc,aAC1B,CAACpF,EAAWqF,gBAAiB,aAC7B,CAACrF,EAAWsF,KAAM,MAClB,CAACtF,EAAWuF,OAAQ,QACpB,CAACvF,EAAWwF,WAAY,SACxB,CAACxF,EAAWyF,aAAc,SAC1B,CAACzF,EAAW0F,WAAY,YACxB,CAAC1F,EAAW2F,QAAS,SACrB,CAAC3F,EAAW4F,SAAU,UAItB,CAAC5F,EAAW6F,MAAO,OACnB,CAAC7F,EAAW8F,OAAQ,QACpB,CAAC9F,EAAW+F,KAAM,MAClB,CAAC/F,EAAWgG,QAAS,MACrB,CAAChG,EAAWiG,aAAc,MAI1B,CAACjG,EAAWkG,UAAW,WACvB,CAAClG,EAAWmG,wBAAyB,gBACrC,CAACnG,EAAWoG,uBAAwB,gBACpC,CAACpG,EAAWqG,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAOxG,EAAkBwG,EAC7B"}
1
+ {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDD',\n [TxVariants.sepadirectdebit]: 'Sepa',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n [TxVariants.riverty]: 'Riverty',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'Duitnow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","bankTransfer_IBAN","donation","personal_details","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","riverty","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","klarna","klarna_account","klarna_paynow","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","upi","upi_qr","upi_collect","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,mBAAoB,eAChC,CAACF,EAAWG,UAAW,WACvB,CAACH,EAAWI,kBAAmB,kBAI/B,CAACJ,EAAWK,MAAO,aACnB,CAACL,EAAWM,MAAO,OACnB,CAACN,EAAWO,QAAS,OACrB,CAACP,EAAWQ,YAAa,OACzB,CAACR,EAAWS,YAAa,aAIzB,CAACT,EAAWU,KAAM,MAClB,CAACV,EAAWW,gBAAiB,SAC7B,CAACX,EAAWY,iBAAkB,OAI9B,CAACZ,EAAWa,QAAS,SACrB,CAACb,EAAWc,UAAW,WACvB,CAACd,EAAWe,kBAAmB,WAC/B,CAACf,EAAWgB,cAAe,cAC3B,CAAChB,EAAWiB,OAAQ,QACpB,CAACjB,EAAWkB,cAAe,cAC3B,CAAClB,EAAWmB,cAAe,cAC3B,CAACnB,EAAWoB,cAAe,cAC3B,CAACpB,EAAWqB,eAAgB,eAC5B,CAACrB,EAAWsB,eAAgB,eAC5B,CAACtB,EAAWuB,SAAU,UACtB,CAACvB,EAAWwB,qBAAsB,qBAClC,CAACxB,EAAWyB,SAAU,UAItB,CAACzB,EAAW0B,WAAY,YACxB,CAAC1B,EAAW2B,UAAW,WACvB,CAAC3B,EAAW4B,SAAU,aACtB,CAAC5B,EAAW6B,YAAa,aACzB,CAAC7B,EAAW8B,WAAY,YACxB,CAAC9B,EAAW+B,QAAS,SACrB,CAAC/B,EAAWgC,eAAgB,YAI5B,CAAChC,EAAWiC,gBAAiB,SAC7B,CAACjC,EAAWkC,qBAAsB,SAClC,CAAClC,EAAWmC,0BAA2B,SACvC,CAACnC,EAAWoC,MAAO,OACnB,CAACpC,EAAWqC,eAAgB,OAC5B,CAACrC,EAAWsC,uBAAwB,OACpC,CAACtC,EAAWuC,gBAAiB,OAC7B,CAACvC,EAAWwC,qBAAsB,OAClC,CAACxC,EAAWyC,kBAAmB,OAC/B,CAACzC,EAAW0C,iBAAkB,OAC9B,CAAC1C,EAAW2C,cAAe,OAC3B,CAAC3C,EAAW4C,iBAAkB,OAC9B,CAAC5C,EAAW6C,aAAc,OAC1B,CAAC7C,EAAW8C,aAAc,OAC1B,CAAC9C,EAAW+C,aAAc,OAC1B,CAAC/C,EAAWgD,aAAc,OAC1B,CAAChD,EAAWiD,MAAO,OACnB,CAACjD,EAAWkD,oBAAqB,SAIjC,CAAClD,EAAWmD,iBAAkB,iBAC9B,CAACnD,EAAWoD,iBAAkB,iBAC9B,CAACpD,EAAWqD,QAAS,SACrB,CAACrD,EAAWsD,KAAM,MAClB,CAACtD,EAAWuD,wBAAyB,mBACrC,CAACvD,EAAWwD,oBAAqB,mBACjC,CAACxD,EAAWyD,oBAAqB,mBACjC,CAACzD,EAAW0D,kBAAmB,kBAC/B,CAAC1D,EAAW2D,kBAAmB,kBAC/B,CAAC3D,EAAW4D,kBAAmB,kBAC/B,CAAC5D,EAAW6D,kBAAmB,kBAC/B,CAAC7D,EAAW8D,WAAY,YACxB,CAAC9D,EAAW+D,kBAAmB,eAC/B,CAAC/D,EAAWgE,YAAa,iBACzB,CAAChE,EAAWiE,WAAY,kBAIxB,CAACjE,EAAWkE,oBAAqB,YACjC,CAAClE,EAAWmE,uBAAwB,YACpC,CAACnE,EAAWoE,2BAA4B,YACxC,CAACpE,EAAWqE,2BAA4B,YAIxC,CAACrE,EAAWsE,cAAe,WAC3B,CAACtE,EAAWuE,iBAAkB,WAC9B,CAACvE,EAAWwE,uBAAwB,WACpC,CAACxE,EAAWyE,iBAAkB,WAI9B,CAACzE,EAAW0E,SAAU,UACtB,CAAC1E,EAAW2E,YAAa,aACzB,CAAC3E,EAAW4E,UAAW,WACvB,CAAC5E,EAAW6E,OAAQ,QACpB,CAAC7E,EAAW8E,OAAQ,QACpB,CAAC9E,EAAW+E,SAAU,UAItB,CAAC/E,EAAWgF,QAAS,SACrB,CAAChF,EAAWiF,gBAAiB,SAC7B,CAACjF,EAAWkF,eAAgB,SAI5B,CAAClF,EAAWmF,aAAc,aAC1B,CAACnF,EAAWoF,gBAAiB,aAC7B,CAACpF,EAAWqF,KAAM,MAClB,CAACrF,EAAWsF,OAAQ,QACpB,CAACtF,EAAWuF,WAAY,SACxB,CAACvF,EAAWwF,aAAc,SAC1B,CAACxF,EAAWyF,WAAY,YACxB,CAACzF,EAAW0F,QAAS,SACrB,CAAC1F,EAAW2F,SAAU,UAItB,CAAC3F,EAAW4F,MAAO,OACnB,CAAC5F,EAAW6F,OAAQ,QACpB,CAAC7F,EAAW8F,MAAO,OACnB,CAAC9F,EAAW+F,KAAM,MAClB,CAAC/F,EAAWgG,QAAS,MACrB,CAAChG,EAAWiG,aAAc,MAI1B,CAACjG,EAAWkG,UAAW,WACvB,CAAClG,EAAWmG,wBAAyB,gBACrC,CAACnG,EAAWoG,uBAAwB,gBACpC,CAACpG,EAAWqG,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAOxG,EAAkBwG,EAC7B"}
@@ -1,2 +1,2 @@
1
- import{createElement as s}from"../../../external/preact/dist/preact.js";import{UIElement as t}from"../../internal/UIElement/UIElement.js";import e from"../../internal/IssuerList/IssuerList.js";import i from"../../../utils/get-issuer-image.js";import{FALLBACK_CONTEXT as r}from"../../../core/config.js";import{CoreProvider as o}from"../../../core/Context/CoreProvider.js";import n from"../../internal/RedirectButton/RedirectButton.js";import p from"../../../core/Errors/SRPanelProvider.js";class a extends t{static defaultProps={showImage:!0,issuers:[],highlightedIssuers:[],loadingContext:r,showPaymentMethodItemImages:!1};constructor(s,t){super(s,t);const e=s=>this.resources.getImage(s);if(this.props.showImage){const s=i({loadingContext:this.props.loadingContext},this.constructor.type,e);this.props.issuers=this.props.issuers.map((t=>({...t,icon:s(t.id)})))}}formatProps(s){const t=s.details&&s.details.length&&(s.details.find((s=>"issuer"===s.key))||{}).items||s.issuers||[];return{...s,issuers:t}}formatData(){return{paymentMethod:{type:this.type,issuer:this.state?.data?.issuer}}}get isValid(){return 0===this.props.issuers.length||!!this.state?.isValid}get brands(){return this.props.showPaymentMethodItemImages?this.props.issuers.map((s=>({icon:s.icon,name:s.id}))):[]}render(){return s(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.issuers.length>0?s(p,{srPanel:this.props.modules.srPanel},s(e,{ref:s=>{this.componentRef=s},items:this.props.issuers,highlightedIds:this.props.highlightedIssuers,...this.props,...this.state,showImage:this.props.showImage,type:this.constructor.type,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton,contextualText:this.props.i18n.get("issuerList.selectField.contextualText"),onSubmitAnalytics:this.submitAnalytics})):this.props.showPayButton&&s(n,{name:this.props.name,...this.props,onSubmit:this.submit,payButton:this.payButton,ref:s=>{this.componentRef=s}}))}}export{a as default};
1
+ import{createElement as s}from"../../../external/preact/dist/preact.js";import{UIElement as t}from"../../internal/UIElement/UIElement.js";import e from"../../internal/IssuerList/IssuerList.js";import i from"../../../utils/get-issuer-image.js";import{FALLBACK_CONTEXT as r}from"../../../core/config.js";import{CoreProvider as o}from"../../../core/Context/CoreProvider.js";import n from"../../internal/RedirectButton/RedirectButton.js";import p from"../../../core/Errors/SRPanelProvider.js";class a extends t{static defaultProps={showImage:!0,issuers:[],highlightedIssuers:[],loadingContext:r,showPaymentMethodItemImages:!1};constructor(s,t){super(s,t);const e=s=>this.resources.getImage(s);if(this.props.showImage){const s=i({loadingContext:this.props.loadingContext},this.constructor.type,e);this.props.issuers=this.props.issuers.map((t=>({...t,icon:s(t.id)})))}}formatProps(s){const t=s.details&&s.details.length&&(s.details.find((s=>"issuer"===s.key))||{}).items||s.issuers||[];return{...s,issuers:t}}formatData(){return{paymentMethod:{type:this.type,issuer:this.state?.data?.issuer}}}get isValid(){return 0===this.props.issuers.length||!!this.state?.isValid}get brands(){return this.props.showPaymentMethodItemImages?this.props.issuers.map((s=>({icon:s.icon,name:s.id}))):[]}render(){return s(o,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.issuers.length>0?s(p,{srPanel:this.props.modules.srPanel},s(e,{ref:s=>{this.componentRef=s},items:this.props.issuers,highlightedIds:this.props.highlightedIssuers,...this.props,...this.state,showImage:this.props.showImage,type:this.constructor.type,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton,contextualText:this.props.i18n.get("issuerList.selectField.contextualText"),onSubmitAnalytics:this.submitAnalytics})):s(n,{showPayButton:this.props.showPayButton,name:this.props.name,...this.props,onSubmit:this.submit,payButton:this.payButton,ref:s=>{this.componentRef=s}}))}}export{a as default};
2
2
  //# sourceMappingURL=IssuerListContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IssuerListContainer.js","sources":["../../../../../src/components/helpers/IssuerListContainer/IssuerListContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport IssuerList from '../../internal/IssuerList';\nimport getIssuerImageUrl from '../../../utils/get-issuer-image';\nimport { FALLBACK_CONTEXT } from '../../../core/config';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport RedirectButton from '../../internal/RedirectButton';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { IssuerListConfiguration, IssuerListData } from './types';\nimport type { ICore } from '../../../core/types';\n\nclass IssuerListContainer extends UIElement<IssuerListConfiguration> {\n protected static defaultProps = {\n showImage: true,\n issuers: [],\n highlightedIssuers: [],\n loadingContext: FALLBACK_CONTEXT,\n showPaymentMethodItemImages: false\n };\n\n constructor(checkout: ICore, props?: IssuerListConfiguration) {\n super(checkout, props);\n\n const getImage = props => this.resources.getImage(props);\n\n if (this.props.showImage) {\n const getIssuerIcon = getIssuerImageUrl({ loadingContext: this.props.loadingContext }, this.constructor['type'], getImage);\n\n this.props.issuers = this.props.issuers.map(item => ({\n ...item,\n icon: getIssuerIcon(item.id)\n }));\n }\n }\n\n formatProps(props) {\n const issuers = (props.details && props.details.length && (props.details.find(d => d.key === 'issuer') || {}).items) || props.issuers || [];\n return { ...props, issuers };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): IssuerListData {\n return {\n paymentMethod: {\n type: this.type,\n issuer: this.state?.data?.issuer\n }\n };\n }\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n if (this.props.issuers.length === 0) {\n return true;\n }\n return !!this.state?.isValid;\n }\n\n /**\n * Returns brands array (similar to card) depending on showPaymentMethodItemImages\n * This is used to show the brands in the PaymentMethodItem\n * Requires brands icons to be loaded in the payment method\n */\n get brands(): { icon: any; name: string }[] {\n if (this.props.showPaymentMethodItemImages) {\n return this.props.issuers.map(brand => {\n const brandIcon = brand.icon;\n return { icon: brandIcon, name: brand.id };\n });\n }\n\n return [];\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.issuers.length > 0 ? (\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <IssuerList\n ref={ref => {\n this.componentRef = ref;\n }}\n items={this.props.issuers}\n highlightedIds={this.props.highlightedIssuers}\n {...this.props}\n {...this.state}\n showImage={this.props.showImage}\n type={this.constructor['type']}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n contextualText={this.props.i18n.get('issuerList.selectField.contextualText')}\n onSubmitAnalytics={this.submitAnalytics}\n />\n </SRPanelProvider>\n ) : (\n this.props.showPayButton && (\n <RedirectButton\n name={this.props.name}\n {...this.props}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n )\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default IssuerListContainer;\n"],"names":["IssuerListContainer","UIElement","static","showImage","issuers","highlightedIssuers","loadingContext","FALLBACK_CONTEXT","showPaymentMethodItemImages","constructor","checkout","props","super","getImage","this","resources","getIssuerIcon","getIssuerImageUrl","map","item","icon","id","formatProps","details","length","find","d","key","items","formatData","paymentMethod","type","issuer","state","data","isValid","brands","brand","name","render","h","CoreProvider","i18n","SRPanelProvider","srPanel","modules","IssuerList","ref","componentRef","highlightedIds","onChange","setState","onSubmit","submit","payButton","contextualText","get","onSubmitAnalytics","submitAnalytics","showPayButton","RedirectButton"],"mappings":"yeAWA,MAAMA,UAA4BC,EAC9BC,oBAAgC,CAC5BC,WAAW,EACXC,QAAS,GACTC,mBAAoB,GACpBC,eAAgBC,EAChBC,6BAA6B,GAGjCC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEhB,MAAME,EAAWF,GAASG,KAAKC,UAAUF,SAASF,GAElD,GAAIG,KAAKH,MAAMR,UAAW,CACtB,MAAMa,EAAgBC,EAAkB,CAAEX,eAAgBQ,KAAKH,MAAML,gBAAkBQ,KAAKL,iBAAqBI,GAEjHC,KAAKH,MAAMP,QAAUU,KAAKH,MAAMP,QAAQc,KAAIC,IAAS,IAC9CA,EACHC,KAAMJ,EAAcG,EAAKE,OAEjC,CACJ,CAEAC,WAAAA,CAAYX,GACR,MAAMP,EAAWO,EAAMY,SAAWZ,EAAMY,QAAQC,SAAWb,EAAMY,QAAQE,MAAKC,GAAe,WAAVA,EAAEC,OAAqB,CAAC,GAAGC,OAAUjB,EAAMP,SAAW,GACzI,MAAO,IAAKO,EAAOP,UACvB,CAKAyB,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMjB,KAAKiB,KACXC,OAAQlB,KAAKmB,OAAOC,MAAMF,QAGtC,CAKA,WAAIG,GACA,OAAkC,IAA9BrB,KAAKH,MAAMP,QAAQoB,UAGdV,KAAKmB,OAAOE,OACzB,CAOA,UAAIC,GACA,OAAItB,KAAKH,MAAMH,4BACJM,KAAKH,MAAMP,QAAQc,KAAImB,IAEnB,CAAEjB,KADSiB,EAAMjB,KACEkB,KAAMD,EAAMhB,OAIvC,EACX,CAEAkB,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAM5B,KAAKH,MAAM+B,KAAMpC,eAAgBQ,KAAKH,MAAML,eAAgBS,UAAWD,KAAKC,WAC3FD,KAAKH,MAAMP,QAAQoB,OAAS,EACzBgB,EAACG,EAAAA,CAAgBC,QAAS9B,KAAKH,MAAMkC,QAAQD,SACzCJ,EAACM,EAAAA,CACGC,IAAKA,IACDjC,KAAKkC,aAAeD,CAAAA,EAExBnB,MAAOd,KAAKH,MAAMP,QAClB6C,eAAgBnC,KAAKH,MAAMN,sBACvBS,KAAKH,SACLG,KAAKmB,MACT9B,UAAWW,KAAKH,MAAMR,UACtB4B,KAAMjB,KAAKL,YAAmB,KAC9ByC,SAAUpC,KAAKqC,SACfC,SAAUtC,KAAKuC,OACfC,UAAWxC,KAAKwC,UAChBC,eAAgBzC,KAAKH,MAAM+B,KAAKc,IAAI,yCACpCC,kBAAmB3C,KAAK4C,mBAIhC5C,KAAKH,MAAMgD,eACPnB,EAACoB,EAAAA,CACGtB,KAAMxB,KAAKH,MAAM2B,QACbxB,KAAKH,MACTyC,SAAUtC,KAAKuC,OACfC,UAAWxC,KAAKwC,UAChBP,IAAKA,IACDjC,KAAKkC,aAAeD,CAAAA,IAOhD"}
1
+ {"version":3,"file":"IssuerListContainer.js","sources":["../../../../../src/components/helpers/IssuerListContainer/IssuerListContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport IssuerList from '../../internal/IssuerList';\nimport getIssuerImageUrl from '../../../utils/get-issuer-image';\nimport { FALLBACK_CONTEXT } from '../../../core/config';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport RedirectButton from '../../internal/RedirectButton';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { IssuerListConfiguration, IssuerListData } from './types';\nimport type { ICore } from '../../../core/types';\n\nclass IssuerListContainer extends UIElement<IssuerListConfiguration> {\n protected static defaultProps = {\n showImage: true,\n issuers: [],\n highlightedIssuers: [],\n loadingContext: FALLBACK_CONTEXT,\n showPaymentMethodItemImages: false\n };\n\n constructor(checkout: ICore, props?: IssuerListConfiguration) {\n super(checkout, props);\n\n const getImage = props => this.resources.getImage(props);\n\n if (this.props.showImage) {\n const getIssuerIcon = getIssuerImageUrl({ loadingContext: this.props.loadingContext }, this.constructor['type'], getImage);\n\n this.props.issuers = this.props.issuers.map(item => ({\n ...item,\n icon: getIssuerIcon(item.id)\n }));\n }\n }\n\n formatProps(props) {\n const issuers = (props.details && props.details.length && (props.details.find(d => d.key === 'issuer') || {}).items) || props.issuers || [];\n return { ...props, issuers };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): IssuerListData {\n return {\n paymentMethod: {\n type: this.type,\n issuer: this.state?.data?.issuer\n }\n };\n }\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n if (this.props.issuers.length === 0) {\n return true;\n }\n return !!this.state?.isValid;\n }\n\n /**\n * Returns brands array (similar to card) depending on showPaymentMethodItemImages\n * This is used to show the brands in the PaymentMethodItem\n * Requires brands icons to be loaded in the payment method\n */\n get brands(): { icon: any; name: string }[] {\n if (this.props.showPaymentMethodItemImages) {\n return this.props.issuers.map(brand => {\n const brandIcon = brand.icon;\n return { icon: brandIcon, name: brand.id };\n });\n }\n\n return [];\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.issuers.length > 0 ? (\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <IssuerList\n ref={ref => {\n this.componentRef = ref;\n }}\n items={this.props.issuers}\n highlightedIds={this.props.highlightedIssuers}\n {...this.props}\n {...this.state}\n showImage={this.props.showImage}\n type={this.constructor['type']}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n contextualText={this.props.i18n.get('issuerList.selectField.contextualText')}\n onSubmitAnalytics={this.submitAnalytics}\n />\n </SRPanelProvider>\n ) : (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.props.name}\n {...this.props}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default IssuerListContainer;\n"],"names":["IssuerListContainer","UIElement","static","showImage","issuers","highlightedIssuers","loadingContext","FALLBACK_CONTEXT","showPaymentMethodItemImages","constructor","checkout","props","super","getImage","this","resources","getIssuerIcon","getIssuerImageUrl","map","item","icon","id","formatProps","details","length","find","d","key","items","formatData","paymentMethod","type","issuer","state","data","isValid","brands","brand","name","render","h","CoreProvider","i18n","SRPanelProvider","srPanel","modules","IssuerList","ref","componentRef","highlightedIds","onChange","setState","onSubmit","submit","payButton","contextualText","get","onSubmitAnalytics","submitAnalytics","RedirectButton","showPayButton"],"mappings":"yeAWA,MAAMA,UAA4BC,EAC9BC,oBAAgC,CAC5BC,WAAW,EACXC,QAAS,GACTC,mBAAoB,GACpBC,eAAgBC,EAChBC,6BAA6B,GAGjCC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEhB,MAAME,EAAWF,GAASG,KAAKC,UAAUF,SAASF,GAElD,GAAIG,KAAKH,MAAMR,UAAW,CACtB,MAAMa,EAAgBC,EAAkB,CAAEX,eAAgBQ,KAAKH,MAAML,gBAAkBQ,KAAKL,iBAAqBI,GAEjHC,KAAKH,MAAMP,QAAUU,KAAKH,MAAMP,QAAQc,KAAIC,IAAS,IAC9CA,EACHC,KAAMJ,EAAcG,EAAKE,OAEjC,CACJ,CAEAC,WAAAA,CAAYX,GACR,MAAMP,EAAWO,EAAMY,SAAWZ,EAAMY,QAAQC,SAAWb,EAAMY,QAAQE,MAAKC,GAAe,WAAVA,EAAEC,OAAqB,CAAC,GAAGC,OAAUjB,EAAMP,SAAW,GACzI,MAAO,IAAKO,EAAOP,UACvB,CAKAyB,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMjB,KAAKiB,KACXC,OAAQlB,KAAKmB,OAAOC,MAAMF,QAGtC,CAKA,WAAIG,GACA,OAAkC,IAA9BrB,KAAKH,MAAMP,QAAQoB,UAGdV,KAAKmB,OAAOE,OACzB,CAOA,UAAIC,GACA,OAAItB,KAAKH,MAAMH,4BACJM,KAAKH,MAAMP,QAAQc,KAAImB,IAEnB,CAAEjB,KADSiB,EAAMjB,KACEkB,KAAMD,EAAMhB,OAIvC,EACX,CAEAkB,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAM5B,KAAKH,MAAM+B,KAAMpC,eAAgBQ,KAAKH,MAAML,eAAgBS,UAAWD,KAAKC,WAC3FD,KAAKH,MAAMP,QAAQoB,OAAS,EACzBgB,EAACG,EAAAA,CAAgBC,QAAS9B,KAAKH,MAAMkC,QAAQD,SACzCJ,EAACM,EAAAA,CACGC,IAAKA,IACDjC,KAAKkC,aAAeD,CAAAA,EAExBnB,MAAOd,KAAKH,MAAMP,QAClB6C,eAAgBnC,KAAKH,MAAMN,sBACvBS,KAAKH,SACLG,KAAKmB,MACT9B,UAAWW,KAAKH,MAAMR,UACtB4B,KAAMjB,KAAKL,YAAmB,KAC9ByC,SAAUpC,KAAKqC,SACfC,SAAUtC,KAAKuC,OACfC,UAAWxC,KAAKwC,UAChBC,eAAgBzC,KAAKH,MAAM+B,KAAKc,IAAI,yCACpCC,kBAAmB3C,KAAK4C,mBAIhClB,EAACmB,EAAAA,CACGC,cAAe9C,KAAKH,MAAMiD,cAC1BtB,KAAMxB,KAAKH,MAAM2B,QACbxB,KAAKH,MACTyC,SAAUtC,KAAKuC,OACfC,UAAWxC,KAAKwC,UAChBP,IAAKA,IACDjC,KAAKkC,aAAeD,CAAAA,IAM5C"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../external/preact/dist/preact.js";import{UIElement as t}from"../../internal/UIElement/UIElement.js";import s from"../../internal/OpenInvoice/OpenInvoice.js";import{CoreProvider as r}from"../../../core/Context/CoreProvider.js";import i from"../../../core/Errors/SRPanelProvider.js";class n extends t{static defaultProps={onChange:()=>{},data:{companyDetails:{},personalDetails:{},billingAddress:{},deliveryAddress:{},bankAccount:{}},visibility:{companyDetails:"hidden",personalDetails:"editable",billingAddress:"editable",deliveryAddress:"editable",bankAccount:"hidden"},showFormInstruction:!0};get isValid(){return!!this.state.isValid}formatProps(e){const t=e.countryCode||e.data?.billingAddress?.countryCode;return{...e,allowedCountries:[t],visibility:{...n.defaultProps.visibility,...e.visibility},data:{...e.data,billingAddress:{...e.data.billingAddress,country:t},deliveryAddress:{...e.data.deliveryAddress,country:t}}}}formatData(){const{data:e={}}=this.state,{companyDetails:t={},personalDetails:s={},billingAddress:r,deliveryAddress:i,bankAccount:n}=e;return{paymentMethod:{type:this.constructor.type},...s,...t,...n&&{bankAccount:{iban:n.ibanNumber,ownerName:n.ownerName,countryCode:n.countryCode}},...r&&{billingAddress:r},...(i||r)&&{deliveryAddress:i||r}}}render(){return e(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},e(i,{srPanel:this.props.modules.srPanel},e(s,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton})))}}export{n as default};
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import{UIElement as t}from"../../internal/UIElement/UIElement.js";import s from"../../internal/OpenInvoice/OpenInvoice.js";import{CoreProvider as i}from"../../../core/Context/CoreProvider.js";import r from"../../../core/Errors/SRPanelProvider.js";class n extends t{static defaultProps={onChange:()=>{},data:{companyDetails:{},personalDetails:{},billingAddress:{},deliveryAddress:{},bankAccount:{}},visibility:{companyDetails:"hidden",personalDetails:"editable",billingAddress:"editable",deliveryAddress:"editable",bankAccount:"hidden"}};get isValid(){return!!this.state.isValid}formatProps(e){const t=e.countryCode||e.data?.billingAddress?.countryCode;return{...e,allowedCountries:[t],visibility:{...n.defaultProps.visibility,...e.visibility},data:{...e.data,billingAddress:{...e.data.billingAddress,country:t},deliveryAddress:{...e.data.deliveryAddress,country:t}}}}formatData(){const{data:e={}}=this.state,{companyDetails:t={},personalDetails:s={},billingAddress:i,deliveryAddress:r,bankAccount:n}=e;return{paymentMethod:{type:this.constructor.type},...s,...t,...n&&{bankAccount:{iban:n.ibanNumber,ownerName:n.ownerName,countryCode:n.countryCode}},...i&&{billingAddress:i},...(r||i)&&{deliveryAddress:r||i}}}render(){return e(i,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},e(r,{srPanel:this.props.modules.srPanel},e(s,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton})))}}export{n as default};
2
2
  //# sourceMappingURL=OpenInvoiceContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenInvoiceContainer.js","sources":["../../../../../src/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport OpenInvoice from '../../internal/OpenInvoice';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { OpenInvoiceConfiguration } from './types';\n\nexport default class OpenInvoiceContainer extends UIElement<OpenInvoiceConfiguration> {\n protected static defaultProps: Partial<OpenInvoiceConfiguration> = {\n onChange: () => {},\n data: { companyDetails: {}, personalDetails: {}, billingAddress: {}, deliveryAddress: {}, bankAccount: {} },\n visibility: {\n companyDetails: 'hidden',\n personalDetails: 'editable',\n billingAddress: 'editable',\n deliveryAddress: 'editable',\n bankAccount: 'hidden'\n },\n showFormInstruction: true\n };\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n return !!this.state.isValid;\n }\n\n /**\n * Formats props on construction time\n */\n formatProps(props) {\n const country = props.countryCode || props.data?.billingAddress?.countryCode;\n\n return {\n ...props,\n allowedCountries: [country],\n visibility: {\n ...OpenInvoiceContainer.defaultProps.visibility,\n ...props.visibility\n },\n data: {\n ...props.data,\n billingAddress: {\n ...props.data.billingAddress,\n country\n },\n deliveryAddress: {\n ...props.data.deliveryAddress,\n country\n }\n }\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const { data = {} } = this.state;\n const { companyDetails = {}, personalDetails = {}, billingAddress, deliveryAddress, bankAccount } = data;\n\n return {\n paymentMethod: {\n type: this.constructor['type']\n },\n ...personalDetails,\n ...companyDetails,\n ...(bankAccount && {\n bankAccount: {\n iban: bankAccount.ibanNumber,\n ownerName: bankAccount.ownerName,\n countryCode: bankAccount.countryCode\n }\n }),\n ...(billingAddress && { billingAddress }),\n ...((deliveryAddress || billingAddress) && { deliveryAddress: deliveryAddress || billingAddress })\n };\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <OpenInvoice\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n"],"names":["OpenInvoiceContainer","UIElement","static","onChange","data","companyDetails","personalDetails","billingAddress","deliveryAddress","bankAccount","visibility","showFormInstruction","isValid","this","state","formatProps","props","country","countryCode","allowedCountries","defaultProps","formatData","paymentMethod","type","constructor","iban","ibanNumber","ownerName","render","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","OpenInvoice","setComponentRef","setState","onSubmit","submit","payButton"],"mappings":"+TAOe,MAAMA,UAA6BC,EAC9CC,oBAAmE,CAC/DC,SAAU,OACVC,KAAM,CAAEC,eAAgB,CAAC,EAAGC,gBAAiB,CAAC,EAAGC,eAAgB,CAAC,EAAGC,gBAAiB,CAAC,EAAGC,YAAa,CAAC,GACxGC,WAAY,CACRL,eAAgB,SAChBC,gBAAiB,WACjBC,eAAgB,WAChBC,gBAAiB,WACjBC,YAAa,UAEjBE,qBAAqB,GAMzB,WAAIC,GACA,QAASC,KAAKC,MAAMF,OACxB,CAKAG,WAAAA,CAAYC,GACR,MAAMC,EAAUD,EAAME,aAAeF,EAAMZ,MAAMG,gBAAgBW,YAEjE,MAAO,IACAF,EACHG,iBAAkB,CAACF,GACnBP,WAAY,IACLV,EAAqBoB,aAAaV,cAClCM,EAAMN,YAEbN,KAAM,IACCY,EAAMZ,KACTG,eAAgB,IACTS,EAAMZ,KAAKG,eACdU,WAEJT,gBAAiB,IACVQ,EAAMZ,KAAKI,gBACdS,YAIhB,CAKAI,UAAAA,GACI,MAAMjB,KAAEA,EAAO,CAAA,GAAOS,KAAKC,OACrBT,eAAEA,EAAiB,CAAE,EAAAC,gBAAEA,EAAkB,CAAA,EAAEC,eAAEA,EAAcC,gBAAEA,EAAeC,YAAEA,GAAgBL,EAEpG,MAAO,CACHkB,cAAe,CACXC,KAAMV,KAAKW,YAAmB,SAE/BlB,KACAD,KACCI,GAAe,CACfA,YAAa,CACTgB,KAAMhB,EAAYiB,WAClBC,UAAWlB,EAAYkB,UACvBT,YAAaT,EAAYS,iBAG7BX,GAAkB,CAAEA,sBACnBC,GAAmBD,IAAmB,CAAEC,gBAAiBA,GAAmBD,GAEzF,CAEAqB,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMlB,KAAKG,MAAMe,KAAMC,eAAgBnB,KAAKG,MAAMgB,eAAgBC,UAAWpB,KAAKoB,WAC5FJ,EAACK,EAAAA,CAAgBC,QAAStB,KAAKG,MAAMoB,QAAQD,SACzCN,EAACQ,EAAAA,CACGC,gBAAiBzB,KAAKyB,mBAClBzB,KAAKG,SACLH,KAAKC,MACTX,SAAUU,KAAK0B,SACfC,SAAU3B,KAAK4B,OACfC,UAAW7B,KAAK6B,aAKpC"}
1
+ {"version":3,"file":"OpenInvoiceContainer.js","sources":["../../../../../src/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport OpenInvoice from '../../internal/OpenInvoice';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { OpenInvoiceConfiguration } from './types';\n\nexport default class OpenInvoiceContainer extends UIElement<OpenInvoiceConfiguration> {\n protected static defaultProps: Partial<OpenInvoiceConfiguration> = {\n onChange: () => {},\n data: { companyDetails: {}, personalDetails: {}, billingAddress: {}, deliveryAddress: {}, bankAccount: {} },\n visibility: {\n companyDetails: 'hidden',\n personalDetails: 'editable',\n billingAddress: 'editable',\n deliveryAddress: 'editable',\n bankAccount: 'hidden'\n }\n };\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n return !!this.state.isValid;\n }\n\n /**\n * Formats props on construction time\n */\n formatProps(props) {\n const country = props.countryCode || props.data?.billingAddress?.countryCode;\n\n return {\n ...props,\n allowedCountries: [country],\n visibility: {\n ...OpenInvoiceContainer.defaultProps.visibility,\n ...props.visibility\n },\n data: {\n ...props.data,\n billingAddress: {\n ...props.data.billingAddress,\n country\n },\n deliveryAddress: {\n ...props.data.deliveryAddress,\n country\n }\n }\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const { data = {} } = this.state;\n const { companyDetails = {}, personalDetails = {}, billingAddress, deliveryAddress, bankAccount } = data;\n\n return {\n paymentMethod: {\n type: this.constructor['type']\n },\n ...personalDetails,\n ...companyDetails,\n ...(bankAccount && {\n bankAccount: {\n iban: bankAccount.ibanNumber,\n ownerName: bankAccount.ownerName,\n countryCode: bankAccount.countryCode\n }\n }),\n ...(billingAddress && { billingAddress }),\n ...((deliveryAddress || billingAddress) && { deliveryAddress: deliveryAddress || billingAddress })\n };\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <OpenInvoice\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n"],"names":["OpenInvoiceContainer","UIElement","static","onChange","data","companyDetails","personalDetails","billingAddress","deliveryAddress","bankAccount","visibility","isValid","this","state","formatProps","props","country","countryCode","allowedCountries","defaultProps","formatData","paymentMethod","type","constructor","iban","ibanNumber","ownerName","render","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","OpenInvoice","setComponentRef","setState","onSubmit","submit","payButton"],"mappings":"+TAOe,MAAMA,UAA6BC,EAC9CC,oBAAmE,CAC/DC,SAAU,OACVC,KAAM,CAAEC,eAAgB,CAAC,EAAGC,gBAAiB,CAAC,EAAGC,eAAgB,CAAC,EAAGC,gBAAiB,CAAC,EAAGC,YAAa,CAAC,GACxGC,WAAY,CACRL,eAAgB,SAChBC,gBAAiB,WACjBC,eAAgB,WAChBC,gBAAiB,WACjBC,YAAa,WAOrB,WAAIE,GACA,QAASC,KAAKC,MAAMF,OACxB,CAKAG,WAAAA,CAAYC,GACR,MAAMC,EAAUD,EAAME,aAAeF,EAAMX,MAAMG,gBAAgBU,YAEjE,MAAO,IACAF,EACHG,iBAAkB,CAACF,GACnBN,WAAY,IACLV,EAAqBmB,aAAaT,cAClCK,EAAML,YAEbN,KAAM,IACCW,EAAMX,KACTG,eAAgB,IACTQ,EAAMX,KAAKG,eACdS,WAEJR,gBAAiB,IACVO,EAAMX,KAAKI,gBACdQ,YAIhB,CAKAI,UAAAA,GACI,MAAMhB,KAAEA,EAAO,CAAA,GAAOQ,KAAKC,OACrBR,eAAEA,EAAiB,CAAE,EAAAC,gBAAEA,EAAkB,CAAA,EAAEC,eAAEA,EAAcC,gBAAEA,EAAeC,YAAEA,GAAgBL,EAEpG,MAAO,CACHiB,cAAe,CACXC,KAAMV,KAAKW,YAAmB,SAE/BjB,KACAD,KACCI,GAAe,CACfA,YAAa,CACTe,KAAMf,EAAYgB,WAClBC,UAAWjB,EAAYiB,UACvBT,YAAaR,EAAYQ,iBAG7BV,GAAkB,CAAEA,sBACnBC,GAAmBD,IAAmB,CAAEC,gBAAiBA,GAAmBD,GAEzF,CAEAoB,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMlB,KAAKG,MAAMe,KAAMC,eAAgBnB,KAAKG,MAAMgB,eAAgBC,UAAWpB,KAAKoB,WAC5FJ,EAACK,EAAAA,CAAgBC,QAAStB,KAAKG,MAAMoB,QAAQD,SACzCN,EAACQ,EAAAA,CACGC,gBAAiBzB,KAAKyB,mBAClBzB,KAAKG,SACLH,KAAKC,MACTV,SAAUS,KAAK0B,SACfC,SAAU3B,KAAK4B,OACfC,UAAW7B,KAAK6B,aAKpC"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../../external/preact/dist/preact.js";import{UIElement as e}from"../../internal/UIElement/UIElement.js";import o from"../../internal/QRLoader/QRLoader.js";import{CoreProvider as r}from"../../../core/Context/CoreProvider.js";import n from"../../internal/RedirectButton/RedirectButton.js";import s from"../../../core/Errors/SRPanelProvider.js";class i extends e{static defaultProps={qrCodeImage:"",amount:null,paymentData:null,onError:()=>{},onComplete:()=>{},onActionHandled:()=>{}};formatData(){return{paymentMethod:{type:this.type,...this.state.data}}}get isValid(){return!0}renderQRCode(){return t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{srPanel:this.props.modules.srPanel},t(o,{ref:t=>{this.componentRef=t},...this.props,type:this.constructor.type,brandLogo:this.props.brandLogo||this.icon,delay:this.props.delay,onComplete:this.onComplete,countdownTime:this.props.countdownTime,instructions:this.props.instructions,onActionHandled:this.props.onActionHandled,brandName:this.displayName,onSubmitAnalytics:this.submitAnalytics})))}render(){return this.props.paymentData?this.renderQRCode():this.props.showPayButton?t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}})):null}}export{i as default};
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import{UIElement as o}from"../../internal/UIElement/UIElement.js";import e from"../../internal/QRLoader/QRLoader.js";import{CoreProvider as r}from"../../../core/Context/CoreProvider.js";import s from"../../internal/RedirectButton/RedirectButton.js";import n from"../../../core/Errors/SRPanelProvider.js";class i extends o{static defaultProps={qrCodeImage:"",amount:null,paymentData:null,onError:()=>{},onComplete:()=>{},onActionHandled:()=>{}};formatData(){return{paymentMethod:{type:this.type,...this.state.data}}}get isValid(){return!0}renderQRCode(){return t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{srPanel:this.props.modules.srPanel},t(e,{ref:t=>{this.componentRef=t},...this.props,type:this.constructor.type,brandLogo:this.props.brandLogo||this.icon,delay:this.props.delay,onComplete:this.onComplete,countdownTime:this.props.countdownTime,instructions:this.props.instructions,onActionHandled:this.props.onActionHandled,brandName:this.displayName,onSubmitAnalytics:this.submitAnalytics})))}render(){return this.props.paymentData?this.renderQRCode():this.props.showPayButton?t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton,ref:t=>{this.componentRef=t}})):null}}export{i as default};
2
2
  //# sourceMappingURL=QRLoaderContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QRLoaderContainer.js","sources":["../../../../../src/components/helpers/QRLoaderContainer/QRLoaderContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport QRLoader from '../../internal/QRLoader';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport RedirectButton from '../../internal/RedirectButton';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { QRLoaderConfiguration } from './types';\n\nclass QRLoaderContainer<T extends QRLoaderConfiguration = QRLoaderConfiguration> extends UIElement<T> {\n // Using the generic here allow to fully extend the QRLoaderContainer (including it's props)\n protected static defaultProps = {\n qrCodeImage: '',\n amount: null,\n paymentData: null,\n onError: () => {},\n onComplete: () => {},\n onActionHandled: () => {}\n };\n\n formatData() {\n return {\n paymentMethod: {\n type: this.type,\n ...this.state.data\n }\n };\n }\n\n get isValid() {\n return true;\n }\n\n // Makes possible to extend the final QR code step\n public renderQRCode() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n type={this.constructor['type']}\n brandLogo={this.props.brandLogo || this.icon}\n delay={this.props.delay}\n onComplete={this.onComplete}\n countdownTime={this.props.countdownTime}\n instructions={this.props.instructions}\n onActionHandled={this.props.onActionHandled}\n brandName={this.displayName}\n onSubmitAnalytics={this.submitAnalytics}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n render() {\n if (this.props.paymentData) {\n return this.renderQRCode();\n }\n\n if (this.props.showPayButton) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <RedirectButton\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n </CoreProvider>\n );\n }\n\n return null;\n }\n}\n\nexport default QRLoaderContainer;\n"],"names":["QRLoaderContainer","UIElement","static","qrCodeImage","amount","paymentData","onError","onComplete","onActionHandled","formatData","paymentMethod","type","this","state","data","isValid","renderQRCode","h","CoreProvider","i18n","props","loadingContext","resources","SRPanelProvider","srPanel","modules","QRLoader","ref","componentRef","constructor","brandLogo","icon","delay","countdownTime","instructions","brandName","displayName","onSubmitAnalytics","submitAnalytics","render","showPayButton","RedirectButton","name","onSubmit","submit","payButton"],"mappings":"wXAQA,MAAMA,UAAmFC,EAErFC,oBAAgC,CAC5BC,YAAa,GACbC,OAAQ,KACRC,YAAa,KACbC,QAAS,OACTC,WAAY,OACZC,gBAAiB,QAGrBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,QACRC,KAAKC,MAAMC,MAG1B,CAEA,WAAIC,GACA,OAAO,CACX,CAGOC,YAAAA,GACH,OACIC,EAACC,EAAAA,CAAaC,KAAMP,KAAKQ,MAAMD,KAAME,eAAgBT,KAAKQ,MAAMC,eAAgBC,UAAWV,KAAKU,WAC5FL,EAACM,EAAAA,CAAgBC,QAASZ,KAAKQ,MAAMK,QAAQD,SACzCP,EAACS,EAAAA,CACGC,IAAKA,IACDf,KAAKgB,aAAeD,CAAAA,KAEpBf,KAAKQ,MACTT,KAAMC,KAAKiB,YAAmB,KAC9BC,UAAWlB,KAAKQ,MAAMU,WAAalB,KAAKmB,KACxCC,MAAOpB,KAAKQ,MAAMY,MAClBzB,WAAYK,KAAKL,WACjB0B,cAAerB,KAAKQ,MAAMa,cAC1BC,aAActB,KAAKQ,MAAMc,aACzB1B,gBAAiBI,KAAKQ,MAAMZ,gBAC5B2B,UAAWvB,KAAKwB,YAChBC,kBAAmBzB,KAAK0B,mBAK5C,CAEAC,MAAAA,GACI,OAAI3B,KAAKQ,MAAMf,YACJO,KAAKI,eAGZJ,KAAKQ,MAAMoB,cAEPvB,EAACC,EAAAA,CAAaC,KAAMP,KAAKQ,MAAMD,KAAME,eAAgBT,KAAKQ,MAAMC,eAAgBC,UAAWV,KAAKU,WAC5FL,EAACwB,EAAAA,CACGC,KAAM9B,KAAKwB,YACXO,SAAU/B,KAAKgC,OACfC,UAAWjC,KAAKiC,UAChBlB,IAAKA,IACDf,KAAKgB,aAAeD,CAAAA,KAOjC,IACX"}
1
+ {"version":3,"file":"QRLoaderContainer.js","sources":["../../../../../src/components/helpers/QRLoaderContainer/QRLoaderContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport QRLoader from '../../internal/QRLoader';\nimport { CoreProvider } from '../../../core/Context/CoreProvider';\nimport RedirectButton from '../../internal/RedirectButton';\nimport SRPanelProvider from '../../../core/Errors/SRPanelProvider';\nimport { QRLoaderConfiguration } from './types';\n\nclass QRLoaderContainer<T extends QRLoaderConfiguration = QRLoaderConfiguration> extends UIElement<T> {\n // Using the generic here allow to fully extend the QRLoaderContainer (including it's props)\n protected static defaultProps = {\n qrCodeImage: '',\n amount: null,\n paymentData: null,\n onError: () => {},\n onComplete: () => {},\n onActionHandled: () => {}\n };\n\n formatData() {\n return {\n paymentMethod: {\n type: this.type,\n ...this.state.data\n }\n };\n }\n\n get isValid() {\n return true;\n }\n\n // Makes possible to extend the final QR code step\n public renderQRCode() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <QRLoader\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n type={this.constructor['type']}\n brandLogo={this.props.brandLogo || this.icon}\n delay={this.props.delay}\n onComplete={this.onComplete}\n countdownTime={this.props.countdownTime}\n instructions={this.props.instructions}\n onActionHandled={this.props.onActionHandled}\n brandName={this.displayName}\n onSubmitAnalytics={this.submitAnalytics}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n render() {\n if (this.props.paymentData) {\n return this.renderQRCode();\n }\n\n if (this.props.showPayButton) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.displayName}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n </CoreProvider>\n );\n }\n\n return null;\n }\n}\n\nexport default QRLoaderContainer;\n"],"names":["QRLoaderContainer","UIElement","static","qrCodeImage","amount","paymentData","onError","onComplete","onActionHandled","formatData","paymentMethod","type","this","state","data","isValid","renderQRCode","h","CoreProvider","i18n","props","loadingContext","resources","SRPanelProvider","srPanel","modules","QRLoader","ref","componentRef","constructor","brandLogo","icon","delay","countdownTime","instructions","brandName","displayName","onSubmitAnalytics","submitAnalytics","render","showPayButton","RedirectButton","name","onSubmit","submit","payButton"],"mappings":"wXAQA,MAAMA,UAAmFC,EAErFC,oBAAgC,CAC5BC,YAAa,GACbC,OAAQ,KACRC,YAAa,KACbC,QAAS,OACTC,WAAY,OACZC,gBAAiB,QAGrBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,QACRC,KAAKC,MAAMC,MAG1B,CAEA,WAAIC,GACA,OAAO,CACX,CAGOC,YAAAA,GACH,OACIC,EAACC,EAAAA,CAAaC,KAAMP,KAAKQ,MAAMD,KAAME,eAAgBT,KAAKQ,MAAMC,eAAgBC,UAAWV,KAAKU,WAC5FL,EAACM,EAAAA,CAAgBC,QAASZ,KAAKQ,MAAMK,QAAQD,SACzCP,EAACS,EAAAA,CACGC,IAAKA,IACDf,KAAKgB,aAAeD,CAAAA,KAEpBf,KAAKQ,MACTT,KAAMC,KAAKiB,YAAmB,KAC9BC,UAAWlB,KAAKQ,MAAMU,WAAalB,KAAKmB,KACxCC,MAAOpB,KAAKQ,MAAMY,MAClBzB,WAAYK,KAAKL,WACjB0B,cAAerB,KAAKQ,MAAMa,cAC1BC,aAActB,KAAKQ,MAAMc,aACzB1B,gBAAiBI,KAAKQ,MAAMZ,gBAC5B2B,UAAWvB,KAAKwB,YAChBC,kBAAmBzB,KAAK0B,mBAK5C,CAEAC,MAAAA,GACI,OAAI3B,KAAKQ,MAAMf,YACJO,KAAKI,eAGZJ,KAAKQ,MAAMoB,cAEPvB,EAACC,EAAAA,CAAaC,KAAMP,KAAKQ,MAAMD,KAAME,eAAgBT,KAAKQ,MAAMC,eAAgBC,UAAWV,KAAKU,WAC5FL,EAACwB,EAAAA,CACGD,cAAe5B,KAAKQ,MAAMoB,cAC1BE,KAAM9B,KAAKwB,YACXO,SAAU/B,KAAKgC,OACfC,UAAWjC,KAAKiC,UAChBlB,IAAKA,IACDf,KAAKgB,aAAeD,CAAAA,KAOjC,IACX"}
@@ -1,2 +1,2 @@
1
- export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{default as Riverty}from"./Riverty/Riverty.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{default as Ideal}from"./Ideal/index.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
1
+ export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{default as Riverty}from"./Riverty/Riverty.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{render as t}from"../../../external/preact/dist/preact.js";import o from"../../../utils/getProp.js";import e from"../../../utils/uuid.js";import r from"../../../core/Errors/AdyenCheckoutError.js";import{ANALYTICS_RENDERED_STR as s}from"../../../core/Analytics/constants.js";class n{_id=`${this.constructor.type}-${e()}`;props;state={};_component;_node=null;core;static defaultProps={};constructor(t,o){const e=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!e)throw new r("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(o)}buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=o(this.props,"modules.risk.data"),e=!!o(this.props,"modules.analytics.getEnabled")?.()?o(this.props,"modules.analytics.getCheckoutAttemptId")?.():"do-not-track",r=this.state.order||this.props.order,s=this.formatData();if(s.paymentMethod&&e&&(s.paymentMethod.checkoutAttemptId=e),"riverty"!==this.props.type&&s.billingAddress){const{firstName:t,lastName:o,...e}=s.billingAddress;s.billingAddress={...e}}return{...t&&{riskData:{clientData:t}},...r&&{order:{orderData:r.orderData,pspReference:r.pspReference}},...s,clientStateDataIndicator:!0}}render(){throw new Error("Payment method cannot be rendered.")}mount(o){const e="string"==typeof o?document.querySelector(o):o;if(!e)throw new Error("Component could not mount. Root node was not found.");const r=!this._node;return this._node&&this.unmount(),this._node=e,this._component=this.render(),t(this._component,e),r&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:e&&e.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:s})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}}export{n as default};
1
+ import{render as t}from"../../../external/preact/dist/preact.js";import o from"../../../utils/getProp.js";import e from"../../../utils/uuid.js";import r from"../../../core/Errors/AdyenCheckoutError.js";import{ANALYTICS_RENDERED_STR as s}from"../../../core/Analytics/constants.js";class n{_id=`${this.constructor.type}-${e()}`;core;props;state={};_component;_node=null;static defaultProps={};constructor(t,o){const e=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!e)throw new r("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(o)}buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}setUpAnalytics(t){return null}submitAnalytics(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=o(this.props,"modules.risk.data"),e=!!o(this.props,"modules.analytics.getEnabled")?.()?o(this.props,"modules.analytics.getCheckoutAttemptId")?.():"do-not-track",r=this.state.order||this.props.order,s=this.formatData();if(s.paymentMethod&&e&&(s.paymentMethod.checkoutAttemptId=e),"riverty"!==this.props.type&&s.billingAddress){const{firstName:t,lastName:o,...e}=s.billingAddress;s.billingAddress={...e}}return{...t&&{riskData:{clientData:t}},...r&&{order:{orderData:r.orderData,pspReference:r.pspReference}},...s,clientStateDataIndicator:!0}}render(){throw new Error("Payment method cannot be rendered.")}mount(o){const e="string"==typeof o?document.querySelector(o):o;if(!e)throw new Error("Component could not mount. Root node was not found.");const r=!this._node;return this._node&&this.unmount(),this._node=e,this._component=this.render(),t(this._component,e),r&&this.props.modules&&this.props.modules.analytics&&this.setUpAnalytics({containerWidth:e&&e.offsetWidth,component:this.props.isDropin?"dropin":this.constructor.analyticsType??this.constructor.type,flavor:this.props.isDropin?"dropin":"components"}).then((()=>{this.props.isDropin||this.submitAnalytics({type:s})})),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}}export{n as default};
2
2
  //# sourceMappingURL=BaseElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport { ANALYTICS_RENDERED_STR } from '../../../core/Analytics/constants';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nclass BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n protected readonly core: ICore;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n *\n * TODO: Replace 'any' by type PaymentMethodData<T> - this change requires updating all payment methods,\n * properly adding the type of the formatData function\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const useAnalytics = !!getProp(this.props, 'modules.analytics.getEnabled')?.();\n const checkoutAttemptId = useAnalytics ? getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() : 'do-not-track';\n const order = this.state.order || this.props.order;\n\n const componentData = this.formatData();\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n // Workaround, to be fixed properly\n // Remove the firstName & lastName in the billingAddress for non Riverty components\n // @ts-ignore type exists\n if (this.props.type !== 'riverty' && componentData.billingAddress) {\n const { firstName, lastName, ...rest } = componentData.billingAddress;\n componentData.billingAddress = { ...rest };\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && (node as HTMLElement).offsetWidth,\n component: !this.props.isDropin ? this.constructor['analyticsType'] ?? this.constructor['type'] : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","_id","this","constructor","uuid","props","state","_component","_node","core","static","checkout","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","buildElementProps","componentProps","formatProps","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","setState","newState","data","clientData","getProp","checkoutAttemptId","order","componentData","paymentMethod","type","billingAddress","firstName","lastName","rest","riskData","orderData","pspReference","clientStateDataIndicator","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","unmount","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","ANALYTICS_RENDERED_STR","update","remove"],"mappings":"wRAsBA,MAAMA,EACcC,IAAM,GAAGC,KAAKC,YAAmB,QAAIC,MAE9CC,MACAC,MAAa,CAAA,EACbC,WAEGC,MAAqB,KACZC,KAEnBC,oBAAgC,CAAA,EAEhCP,WAAAA,CAAYQ,EAAiBN,GACzB,MAAMO,EAnBd,SAA8BD,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASE,YAAkE,mBAA9BF,EAASG,iBAEtF,CAe+BC,CAAqBJ,GAE5C,IAAKC,EACD,MAAM,IAAII,EACN,uBACA,uCAAuCd,KAAKC,YAAmB,6DAIvED,KAAKO,KAAOE,EACZT,KAAKe,kBAAkBZ,EAC3B,CAEUY,iBAAAA,CAAkBC,GACxBhB,KAAKG,MAAQH,KAAKiB,YAAY,IAAKjB,KAAKC,YAA2B,gBAAKe,GAC5E,CAMUC,WAAAA,CAAYd,GAClB,OAAOA,CACX,CASA,UAAAe,GACI,MAAO,EACX,CAGUC,cAAAA,CAAeC,GACrB,OAAO,IACX,CAGUC,eAAAA,CAAgBC,GACtB,OAAO,IACX,CAEUC,QAAAA,CAASC,GACfxB,KAAKI,MAAQ,IAAKJ,KAAKI,SAAUoB,EACrC,CAMA,QAAWC,GACP,MAAMC,EAAaC,EAAQ3B,KAAKG,MAAO,qBAEjCyB,IADiBD,EAAQ3B,KAAKG,MAAO,+BAApBwB,KACkBA,EAAQ3B,KAAKG,MAAO,yCAApBwB,KAAoE,eACvGE,EAAQ7B,KAAKI,MAAMyB,OAAS7B,KAAKG,MAAM0B,MAEvCC,EAAgB9B,KAAKkB,aAQ3B,GAPIY,EAAcC,eAAiBH,IAC/BE,EAAcC,cAAcH,kBAAoBA,GAM5B,YAApB5B,KAAKG,MAAM6B,MAAsBF,EAAcG,eAAgB,CAC/D,MAAMC,UAAEA,EAASC,SAAEA,KAAaC,GAASN,EAAcG,eACvDH,EAAcG,eAAiB,IAAKG,EACxC,CAEA,MAAO,IACCV,GAAc,CAAEW,SAAU,CAAEX,kBAC5BG,GAAS,CAAEA,MAAO,CAAES,UAAWT,EAAMS,UAAWC,aAAcV,EAAMU,kBACrET,EACHU,0BAA0B,EAElC,CAEOC,MAAAA,GAEH,MAAM,IAAIC,MAAM,qCACpB,CAOOC,KAAAA,CAAMC,GACT,MAAMC,EAA0B,iBAAZD,EAAuBE,SAASC,cAA2BH,GAAWA,EAE1F,IAAKC,EACD,MAAM,IAAIH,MAAM,uDAGpB,MAAMM,GAAkBhD,KAAKM,MA8B7B,OA5BIN,KAAKM,OACLN,KAAKiD,UAGTjD,KAAKM,MAAQuC,EAEb7C,KAAKK,WAAaL,KAAKyC,SAEvBA,EAAOzC,KAAKK,WAAYwC,GAGpBG,GACIhD,KAAKG,MAAM+C,SAAWlD,KAAKG,MAAM+C,QAAQC,WACzCnD,KAAKmB,eAAe,CAChBiC,eAAgBP,GAAQA,EAAsBQ,YAC9CC,UAAYtD,KAAKG,MAAMoD,SAA2E,SAAhEvD,KAAKC,2BAAgCD,KAAKC,iBAC5EuD,OAASxD,KAAKG,MAAMoD,SAA0B,SAAf,eAChCE,MAAK,KAICzD,KAAKG,MAAMoD,UACZvD,KAAKqB,gBAAgB,CAAEW,KAAM0B,GACjC,IAKL1D,IACX,CAQO2D,MAAAA,CAAOxD,GAIV,OAHAH,KAAKG,MAAQH,KAAKiB,YAAY,IAAKjB,KAAKG,SAAUA,IAClDH,KAAKI,MAAQ,GAENJ,KAAKiD,UAAUN,MAAM3C,KAAKM,MACrC,CAKA,OAAA2C,GAKI,OAJIjD,KAAKM,OACLmC,EAAO,KAAMzC,KAAKM,OAGfN,IACX,CAMA,MAAA4D,GACI5D,KAAKiD,UAEDjD,KAAKO,MACLP,KAAKO,KAAKqD,OAAO5D,KAEzB"}
1
+ {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { ANALYTICS_RENDERED_STR } from '../../../core/Analytics/constants';\n\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: SendAnalyticsObject) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const useAnalytics = !!getProp(this.props, 'modules.analytics.getEnabled')?.();\n const checkoutAttemptId = useAnalytics ? getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() : 'do-not-track';\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n // Workaround, to be fixed properly\n // Remove the firstName & lastName in the billingAddress for non Riverty components\n // @ts-ignore type exists\n if (this.props.type !== 'riverty' && componentData.billingAddress) {\n const { firstName, lastName, ...rest } = componentData.billingAddress;\n componentData.billingAddress = { ...rest };\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n const setupAnalytics = !this._node;\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n this._component = this.render();\n\n render(this._component, node);\n\n // Set up analytics (once, since this._node is currently undefined) now that we have mounted and rendered\n if (setupAnalytics) {\n if (this.props.modules && this.props.modules.analytics) {\n this.setUpAnalytics({\n containerWidth: node && (node as HTMLElement).offsetWidth,\n component: !this.props.isDropin ? this.constructor['analyticsType'] ?? this.constructor['type'] : 'dropin',\n flavor: !this.props.isDropin ? 'components' : 'dropin'\n }).then(() => {\n // Once the initial analytics set up call has been made...\n // ...create an analytics event declaring that the component has been rendered\n // (The dropin will do this itself from DropinComponent once the PM list has rendered)\n if (!this.props.isDropin) {\n this.submitAnalytics({ type: ANALYTICS_RENDERED_STR });\n }\n });\n }\n }\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","_id","this","constructor","uuid","core","props","state","_component","_node","static","checkout","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","buildElementProps","componentProps","formatProps","formatData","setUpAnalytics","setUpAnalyticsObj","submitAnalytics","analyticsObj","setState","newState","data","clientData","getProp","checkoutAttemptId","order","componentData","paymentMethod","type","billingAddress","firstName","lastName","rest","riskData","orderData","pspReference","clientStateDataIndicator","render","Error","mount","domNode","node","document","querySelector","setupAnalytics","unmount","modules","analytics","containerWidth","offsetWidth","component","isDropin","flavor","then","ANALYTICS_RENDERED_STR","update","remove"],"mappings":"wRAsBA,MAAeA,EACKC,IAAM,GAAGC,KAAKC,YAAmB,QAAIC,MACrCC,KAETC,MACAC,MAAa,CAAA,EACbC,WAEGC,MAAqB,KAE/BC,oBAAgC,CAAA,EAEhCP,WAAAA,CAAYQ,EAAiBL,GACzB,MAAMM,EAnBd,SAA8BD,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASE,YAAkE,mBAA9BF,EAASG,iBAEtF,CAe+BC,CAAqBJ,GAE5C,IAAKC,EACD,MAAM,IAAII,EACN,uBACA,uCAAuCd,KAAKC,YAAmB,6DAIvED,KAAKG,KAAOM,EACZT,KAAKe,kBAAkBX,EAC3B,CAEUW,iBAAAA,CAAkBC,GACxBhB,KAAKI,MAAQJ,KAAKiB,YAAY,IAAKjB,KAAKC,YAA2B,gBAAKe,GAC5E,CAMUC,WAAAA,CAAYb,GAClB,OAAOA,CACX,CAMA,UAAAc,GACI,MAAO,EACX,CAGUC,cAAAA,CAAeC,GACrB,OAAO,IACX,CAGUC,eAAAA,CAAgBC,GACtB,OAAO,IACX,CAEUC,QAAAA,CAASC,GACfxB,KAAKK,MAAQ,IAAKL,KAAKK,SAAUmB,EACrC,CAMA,QAAWC,GACP,MAAMC,EAAaC,EAAQ3B,KAAKI,MAAO,qBAEjCwB,IADiBD,EAAQ3B,KAAKI,MAAO,+BAApBuB,KACkBA,EAAQ3B,KAAKI,MAAO,yCAApBuB,KAAoE,eACvGE,EAAQ7B,KAAKK,MAAMwB,OAAS7B,KAAKI,MAAMyB,MACvCC,EAAgB9B,KAAKkB,aAS3B,GAPIY,EAAcC,eAAiBH,IAC/BE,EAAcC,cAAcH,kBAAoBA,GAM5B,YAApB5B,KAAKI,MAAM4B,MAAsBF,EAAcG,eAAgB,CAC/D,MAAMC,UAAEA,EAASC,SAAEA,KAAaC,GAASN,EAAcG,eACvDH,EAAcG,eAAiB,IAAKG,EACxC,CAEA,MAAO,IACCV,GAAc,CAAEW,SAAU,CAAEX,kBAC5BG,GAAS,CAAEA,MAAO,CAAES,UAAWT,EAAMS,UAAWC,aAAcV,EAAMU,kBACrET,EACHU,0BAA0B,EAElC,CAEOC,MAAAA,GAEH,MAAM,IAAIC,MAAM,qCACpB,CAOOC,KAAAA,CAAMC,GACT,MAAMC,EAA0B,iBAAZD,EAAuBE,SAASC,cAA2BH,GAAWA,EAE1F,IAAKC,EACD,MAAM,IAAIH,MAAM,uDAGpB,MAAMM,GAAkBhD,KAAKO,MA8B7B,OA5BIP,KAAKO,OACLP,KAAKiD,UAGTjD,KAAKO,MAAQsC,EAEb7C,KAAKM,WAAaN,KAAKyC,SAEvBA,EAAOzC,KAAKM,WAAYuC,GAGpBG,GACIhD,KAAKI,MAAM8C,SAAWlD,KAAKI,MAAM8C,QAAQC,WACzCnD,KAAKmB,eAAe,CAChBiC,eAAgBP,GAAQA,EAAsBQ,YAC9CC,UAAYtD,KAAKI,MAAMmD,SAA2E,SAAhEvD,KAAKC,2BAAgCD,KAAKC,iBAC5EuD,OAASxD,KAAKI,MAAMmD,SAA0B,SAAf,eAChCE,MAAK,KAICzD,KAAKI,MAAMmD,UACZvD,KAAKqB,gBAAgB,CAAEW,KAAM0B,GACjC,IAKL1D,IACX,CAQO2D,MAAAA,CAAOvD,GAIV,OAHAJ,KAAKI,MAAQJ,KAAKiB,YAAY,IAAKjB,KAAKI,SAAUA,IAClDJ,KAAKK,MAAQ,GAENL,KAAKiD,UAAUN,MAAM3C,KAAKO,MACrC,CAKA,OAAA0C,GAKI,OAJIjD,KAAKO,OACLkC,EAAO,KAAMzC,KAAKO,OAGfP,IACX,CAMA,MAAA4D,GACI5D,KAAKiD,UAEDjD,KAAKG,MACLH,KAAKG,KAAKyD,OAAO5D,KAEzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"CtPCards.js","sources":["../../../../../../../src/components/internal/ClickToPay/components/CtPCards/CtPCards.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../context/useClickToPayContext';\nimport CtPSingleCard from './CtPSingleCard/CtPSingleCard';\nimport PayButton from '../../../PayButton';\nimport { amountLabel } from '../../../PayButton/utils';\nimport CtPCardsList from './CtPCardsList';\nimport ShopperCard from '../../models/ShopperCard';\nimport SrciError from '../../services/sdks/SrciError';\nimport CtPSection from '../CtPSection';\nimport { CTP_IFRAME_NAME } from '../../services/utils';\nimport Iframe from '../../../../internal/IFrame';\nimport useImage from '../../../../../core/Context/useImage';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport isMobile from '../../../../../utils/isMobile';\nimport Language from '../../../../../language';\nimport { PaymentAmount } from '../../../../../types/global-types';\nimport './CtPCards.scss';\nimport AdyenCheckoutError from '../../../../../core/Errors/AdyenCheckoutError';\nimport { PREFIX } from '../../../Icon/constants';\n\n\ntype CtPCardsProps = {\n onDisplayCardComponent?(): void;\n};\n\nfunction getErrorLabel(errorCode: string, i18n: Language): string {\n if (!errorCode) return null;\n\n const errorLabel = i18n.get(`ctp.errors.${errorCode}`);\n if (errorLabel.includes('ctp.errors')) return i18n.get(`ctp.errors.UNKNOWN_ERROR`);\n return errorLabel;\n}\n\nfunction getPayButtonLabel(i18n: Language, amount: PaymentAmount, checkoutCard?: ShopperCard): string | null {\n if (!checkoutCard) return i18n.get('payButton');\n if (!isMobile())\n return i18n.get('payButton.with', {\n values: { value: amountLabel(i18n, amount), maskedData: `•••• ${checkoutCard?.panLastFour}` }\n });\n return null;\n}\n\nconst CtPCards = ({ onDisplayCardComponent }: CtPCardsProps) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { amount, cards, checkout, isCtpPrimaryPaymentMethod, status, onSubmit, onSetStatus, onError } = useClickToPayContext();\n const [checkoutCard, setCheckoutCard] = useState<ShopperCard | undefined>(cards.find(card => !card.isExpired) || cards[0]);\n const [errorCode, setErrorCode] = useState<string>(null);\n const isEveryCardExpired = cards.every(card => card.isExpired);\n const [isShopperCheckingOutWithCtp, setIsShopperCheckingOutWithCtp] = useState<boolean>(false);\n\n useEffect(() => {\n if (cards.length === 0 || isEveryCardExpired) {\n onDisplayCardComponent?.();\n }\n }, [onDisplayCardComponent, isEveryCardExpired, cards]);\n\n const doCheckout = useCallback(async () => {\n if (!checkoutCard) return;\n\n try {\n setIsShopperCheckingOutWithCtp(true);\n setErrorCode(null);\n onSetStatus('loading');\n const payload = await checkout(checkoutCard);\n onSubmit(payload);\n } catch (error: unknown) {\n if (error instanceof SrciError) {\n setErrorCode(error?.reason);\n console.warn(`CtP - Checkout: Reason: ${error?.reason} / Source: ${error?.source} / Scheme: ${error?.scheme}`);\n }\n setIsShopperCheckingOutWithCtp(false);\n\n if (error instanceof AdyenCheckoutError) onError(error);\n else onError(new AdyenCheckoutError('ERROR', 'Error during ClickToPay checkout', { cause: error }));\n }\n }, [checkout, checkoutCard]);\n\n const handleOnChangeCard = useCallback((card: ShopperCard) => {\n setCheckoutCard(card);\n }, []);\n\n /**\n * If shopper submits the payment using the default Card component while CtP is rendered, the status here will be updated\n * and that can potentially display an iframe.\n *\n * Therefore, we use the flag 'isShopperCheckingOutWithCtp' to flag that the iframe should be displayed only in case the\n * Shopper is checking out with Click to Pay.\n */\n const displayNetworkDcf = isShopperCheckingOutWithCtp && status === 'loading' && checkoutCard?.isDcfPopupEmbedded;\n const displayCardCheckoutView = status !== 'loading' || !displayNetworkDcf;\n\n return (\n <Fragment>\n <Iframe name={CTP_IFRAME_NAME} height=\"380\" width=\"100%\" classNameModifiers={[displayNetworkDcf ? '' : 'hidden']} />\n\n {displayCardCheckoutView && (\n <Fragment>\n <CtPSection.Title>{i18n.get('ctp.cards.title')}</CtPSection.Title>\n <CtPSection.Text>{i18n.get('ctp.cards.subtitle')}</CtPSection.Text>\n\n {cards.length === 0 && <div className=\"adyen-checkout-ctp__empty-cards\">{i18n.get('ctp.emptyProfile.message')}</div>}\n {cards.length === 1 && <CtPSingleCard card={cards[0]} errorMessage={getErrorLabel(errorCode, i18n)} />}\n {cards.length > 1 && (\n <CtPCardsList\n cardSelected={checkoutCard}\n cards={cards}\n onChangeCard={handleOnChangeCard}\n errorMessage={getErrorLabel(errorCode, i18n)}\n />\n )}\n\n <PayButton\n disabled={isEveryCardExpired}\n amount={amount}\n label={getPayButtonLabel(i18n, amount, checkoutCard)}\n status={status}\n variant={isCtpPrimaryPaymentMethod ? 'primary' : 'secondary'}\n icon={\n cards.length !== 0 &&\n getImage({ imageFolder: 'components/' })(isCtpPrimaryPaymentMethod ? `${PREFIX}lock` : `${PREFIX}lock_black`)\n }\n onClick={doCheckout}\n />\n </Fragment>\n )}\n </Fragment>\n );\n};\n\nexport default CtPCards;\n"],"names":["getErrorLabel","errorCode","i18n","errorLabel","get","includes","getPayButtonLabel","amount","checkoutCard","isMobile","values","value","amountLabel","maskedData","panLastFour","CtPCards","onDisplayCardComponent","useCoreContext","getImage","useImage","cards","checkout","isCtpPrimaryPaymentMethod","status","onSubmit","onSetStatus","onError","useClickToPayContext","setCheckoutCard","useState","find","card","isExpired","setErrorCode","isEveryCardExpired","every","isShopperCheckingOutWithCtp","setIsShopperCheckingOutWithCtp","useEffect","length","doCheckout","useCallback","async","payload","error","SrciError","reason","console","warn","source","scheme","AdyenCheckoutError","cause","handleOnChangeCard","displayNetworkDcf","isDcfPopupEmbedded","displayCardCheckoutView","h","Fragment","Iframe","name","CTP_IFRAME_NAME","height","width","classNameModifiers","CtPSection","Title","Text","div","className","CtPSingleCard","errorMessage","CtPCardsList","cardSelected","onChangeCard","PayButton","disabled","label","variant","icon","imageFolder","PREFIX","onClick"],"mappings":"46BA0BA,SAASA,EAAcC,EAAmBC,GACtC,IAAKD,EAAW,OAAO,KAEvB,MAAME,EAAaD,EAAKE,IAAI,cAAcH,KAC1C,OAAIE,EAAWE,SAAS,cAAsBH,EAAKE,IAAI,4BAChDD,CACX,CAEA,SAASG,EAAkBJ,EAAgBK,EAAuBC,GAC9D,OAAKA,EACAC,IAIE,KAHIP,EAAKE,IAAI,iBAAkB,CAC9BM,OAAQ,CAAEC,MAAOC,EAAYV,EAAMK,GAASM,WAAY,QAAQL,GAAcM,iBAH5DZ,EAAKE,IAAI,YAMvC,CAEA,MAAMW,EAAW,EAAGC,6BAChB,MAAMd,KAAEA,GAASe,IACXC,EAAWC,KACXZ,OAAEA,EAAMa,MAAEA,EAAKC,SAAEA,EAAQC,0BAAEA,EAAyBC,OAAEA,EAAMC,SAAEA,EAAQC,YAAEA,EAAWC,QAAEA,GAAYC,KAChGnB,EAAcoB,GAAmBC,EAAkCT,EAAMU,MAAKC,IAASA,EAAKC,aAAcZ,EAAM,KAChHnB,EAAWgC,GAAgBJ,EAAiB,MAC7CK,EAAqBd,EAAMe,OAAMJ,GAAQA,EAAKC,aAC7CI,EAA6BC,GAAkCR,GAAkB,GAExFS,GAAU,MACe,IAAjBlB,EAAMmB,QAAgBL,IACtBlB,KACJ,GACD,CAACA,EAAwBkB,EAAoBd,IAEhD,MAAMoB,EAAaC,GAAYC,UAC3B,GAAKlC,EAEL,IACI6B,GAA+B,GAC/BJ,EAAa,MACbR,EAAY,WACZ,MAAMkB,QAAgBtB,EAASb,GAC/BgB,EAASmB,EACb,CAAE,MAAOC,GACDA,aAAiBC,IACjBZ,EAAaW,GAAOE,QACpBC,QAAQC,KAAK,2BAA2BJ,GAAOE,oBAAoBF,GAAOK,oBAAoBL,GAAOM,WAEzGb,GAA+B,GAEUX,EAArCkB,aAAiBO,EAA4BP,EACpC,IAAIO,EAAmB,QAAS,mCAAoC,CAAEC,MAAOR,IAC9F,IACD,CAACvB,EAAUb,IAER6C,EAAqBZ,GAAaV,IACpCH,EAAgBG,EAAAA,GACjB,IASGuB,EAAoBlB,GAA0C,YAAXb,GAAwBf,GAAc+C,mBACzFC,EAAqC,YAAXjC,IAAyB+B,EAEzD,OACIG,EAACC,OACGD,EAACE,EAAAA,CAAOC,KAAMC,EAAiBC,OAAO,MAAMC,MAAM,OAAOC,mBAAoB,CAACV,EAAoB,GAAK,YAEtGE,GACGC,EAACC,OACGD,EAACQ,EAAWC,MAAOhE,KAAAA,EAAKE,IAAI,oBAC5BqD,EAACQ,EAAWE,KAAI,KAAEjE,EAAKE,IAAI,uBAET,IAAjBgB,EAAMmB,QAAgBkB,EAACW,MAAAA,CAAIC,UAAU,mCAAmCnE,EAAKE,IAAI,6BAChE,IAAjBgB,EAAMmB,QAAgBkB,EAACa,EAAAA,CAAcvC,KAAMX,EAAM,GAAImD,aAAcvE,EAAcC,EAAWC,KAC5FkB,EAAMmB,OAAS,GACZkB,EAACe,EAAAA,CACGC,aAAcjE,EACdY,MAAOA,EACPsD,aAAcrB,EACdkB,aAAcvE,EAAcC,EAAWC,KAI/CuD,EAACkB,EAAAA,CACGC,SAAU1C,EACV3B,OAAQA,EACRsE,MAAOvE,EAAkBJ,EAAMK,EAAQC,GACvCe,OAAQA,EACRuD,QAASxD,EAA4B,UAAY,YACjDyD,KACqB,IAAjB3D,EAAMmB,QACNrB,EAAS,CAAE8D,YAAa,eAAxB9D,CAAyCI,EAA4B,GAAG2D,QAAe,GAAGA,eAE9FC,QAAS1C"}
1
+ {"version":3,"file":"CtPCards.js","sources":["../../../../../../../src/components/internal/ClickToPay/components/CtPCards/CtPCards.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../context/useClickToPayContext';\nimport CtPSingleCard from './CtPSingleCard/CtPSingleCard';\nimport PayButton from '../../../PayButton';\nimport { amountLabel } from '../../../PayButton/utils';\nimport CtPCardsList from './CtPCardsList';\nimport ShopperCard from '../../models/ShopperCard';\nimport SrciError from '../../services/sdks/SrciError';\nimport CtPSection from '../CtPSection';\nimport { CTP_IFRAME_NAME } from '../../services/utils';\nimport Iframe from '../../../../internal/IFrame';\nimport useImage from '../../../../../core/Context/useImage';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport isMobile from '../../../../../utils/isMobile';\nimport Language from '../../../../../language';\nimport { PaymentAmount } from '../../../../../types/global-types';\nimport './CtPCards.scss';\nimport AdyenCheckoutError from '../../../../../core/Errors/AdyenCheckoutError';\nimport { PREFIX } from '../../../Icon/constants';\n\ntype CtPCardsProps = {\n onDisplayCardComponent?(): void;\n};\n\nfunction getErrorLabel(errorCode: string, i18n: Language): string {\n if (!errorCode) return null;\n\n const errorLabel = i18n.get(`ctp.errors.${errorCode}`);\n if (errorLabel.includes('ctp.errors')) return i18n.get(`ctp.errors.UNKNOWN_ERROR`);\n return errorLabel;\n}\n\nfunction getPayButtonLabel(i18n: Language, amount: PaymentAmount, checkoutCard?: ShopperCard): string | null {\n if (!checkoutCard) return i18n.get('payButton');\n if (!isMobile())\n return i18n.get('payButton.with', {\n values: { value: amountLabel(i18n, amount), maskedData: `•••• ${checkoutCard?.panLastFour}` }\n });\n return null;\n}\n\nconst CtPCards = ({ onDisplayCardComponent }: CtPCardsProps) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { amount, cards, checkout, isCtpPrimaryPaymentMethod, status, onSubmit, onSetStatus, onError } = useClickToPayContext();\n const [checkoutCard, setCheckoutCard] = useState<ShopperCard | undefined>(cards.find(card => !card.isExpired) || cards[0]);\n const [errorCode, setErrorCode] = useState<string>(null);\n const isEveryCardExpired = cards.every(card => card.isExpired);\n const [isShopperCheckingOutWithCtp, setIsShopperCheckingOutWithCtp] = useState<boolean>(false);\n\n useEffect(() => {\n if (cards.length === 0 || isEveryCardExpired) {\n onDisplayCardComponent?.();\n }\n }, [onDisplayCardComponent, isEveryCardExpired, cards]);\n\n const doCheckout = useCallback(async () => {\n if (!checkoutCard) return;\n\n try {\n setIsShopperCheckingOutWithCtp(true);\n setErrorCode(null);\n onSetStatus('loading');\n const payload = await checkout(checkoutCard);\n onSubmit(payload);\n } catch (error: unknown) {\n if (error instanceof SrciError) {\n setErrorCode(error?.reason);\n console.warn(`CtP - Checkout: Reason: ${error?.reason} / Source: ${error?.source} / Scheme: ${error?.scheme}`);\n }\n setIsShopperCheckingOutWithCtp(false);\n\n if (error instanceof AdyenCheckoutError) onError(error);\n else onError(new AdyenCheckoutError('ERROR', 'Error during ClickToPay checkout', { cause: error }));\n }\n }, [checkout, checkoutCard]);\n\n const handleOnChangeCard = useCallback((card: ShopperCard) => {\n setCheckoutCard(card);\n }, []);\n\n /**\n * If shopper submits the payment using the default Card component while CtP is rendered, the status here will be updated\n * and that can potentially display an iframe.\n *\n * Therefore, we use the flag 'isShopperCheckingOutWithCtp' to flag that the iframe should be displayed only in case the\n * Shopper is checking out with Click to Pay.\n */\n const displayNetworkDcf = isShopperCheckingOutWithCtp && status === 'loading' && checkoutCard?.isDcfPopupEmbedded;\n const displayCardCheckoutView = status !== 'loading' || !displayNetworkDcf;\n\n return (\n <Fragment>\n <Iframe name={CTP_IFRAME_NAME} height=\"380\" width=\"100%\" classNameModifiers={[displayNetworkDcf ? '' : 'hidden']} />\n\n {displayCardCheckoutView && (\n <Fragment>\n <CtPSection.Title>{i18n.get('ctp.cards.title')}</CtPSection.Title>\n <CtPSection.Text>{i18n.get('ctp.cards.subtitle')}</CtPSection.Text>\n\n {cards.length === 0 && <div className=\"adyen-checkout-ctp__empty-cards\">{i18n.get('ctp.emptyProfile.message')}</div>}\n {cards.length === 1 && <CtPSingleCard card={cards[0]} errorMessage={getErrorLabel(errorCode, i18n)} />}\n {cards.length > 1 && (\n <CtPCardsList\n cardSelected={checkoutCard}\n cards={cards}\n onChangeCard={handleOnChangeCard}\n errorMessage={getErrorLabel(errorCode, i18n)}\n />\n )}\n\n <PayButton\n disabled={isEveryCardExpired}\n amount={amount}\n label={getPayButtonLabel(i18n, amount, checkoutCard)}\n status={status}\n variant={isCtpPrimaryPaymentMethod ? 'primary' : 'secondary'}\n icon={\n cards.length !== 0 &&\n getImage({ imageFolder: 'components/' })(isCtpPrimaryPaymentMethod ? `${PREFIX}lock` : `${PREFIX}lock_black`)\n }\n onClick={doCheckout}\n />\n </Fragment>\n )}\n </Fragment>\n );\n};\n\nexport default CtPCards;\n"],"names":["getErrorLabel","errorCode","i18n","errorLabel","get","includes","getPayButtonLabel","amount","checkoutCard","isMobile","values","value","amountLabel","maskedData","panLastFour","CtPCards","onDisplayCardComponent","useCoreContext","getImage","useImage","cards","checkout","isCtpPrimaryPaymentMethod","status","onSubmit","onSetStatus","onError","useClickToPayContext","setCheckoutCard","useState","find","card","isExpired","setErrorCode","isEveryCardExpired","every","isShopperCheckingOutWithCtp","setIsShopperCheckingOutWithCtp","useEffect","length","doCheckout","useCallback","async","payload","error","SrciError","reason","console","warn","source","scheme","AdyenCheckoutError","cause","handleOnChangeCard","displayNetworkDcf","isDcfPopupEmbedded","displayCardCheckoutView","h","Fragment","Iframe","name","CTP_IFRAME_NAME","height","width","classNameModifiers","CtPSection","Title","Text","div","className","CtPSingleCard","errorMessage","CtPCardsList","cardSelected","onChangeCard","PayButton","disabled","label","variant","icon","imageFolder","PREFIX","onClick"],"mappings":"46BAyBA,SAASA,EAAcC,EAAmBC,GACtC,IAAKD,EAAW,OAAO,KAEvB,MAAME,EAAaD,EAAKE,IAAI,cAAcH,KAC1C,OAAIE,EAAWE,SAAS,cAAsBH,EAAKE,IAAI,4BAChDD,CACX,CAEA,SAASG,EAAkBJ,EAAgBK,EAAuBC,GAC9D,OAAKA,EACAC,IAIE,KAHIP,EAAKE,IAAI,iBAAkB,CAC9BM,OAAQ,CAAEC,MAAOC,EAAYV,EAAMK,GAASM,WAAY,QAAQL,GAAcM,iBAH5DZ,EAAKE,IAAI,YAMvC,CAEA,MAAMW,EAAW,EAAGC,6BAChB,MAAMd,KAAEA,GAASe,IACXC,EAAWC,KACXZ,OAAEA,EAAMa,MAAEA,EAAKC,SAAEA,EAAQC,0BAAEA,EAAyBC,OAAEA,EAAMC,SAAEA,EAAQC,YAAEA,EAAWC,QAAEA,GAAYC,KAChGnB,EAAcoB,GAAmBC,EAAkCT,EAAMU,MAAKC,IAASA,EAAKC,aAAcZ,EAAM,KAChHnB,EAAWgC,GAAgBJ,EAAiB,MAC7CK,EAAqBd,EAAMe,OAAMJ,GAAQA,EAAKC,aAC7CI,EAA6BC,GAAkCR,GAAkB,GAExFS,GAAU,MACe,IAAjBlB,EAAMmB,QAAgBL,IACtBlB,KACJ,GACD,CAACA,EAAwBkB,EAAoBd,IAEhD,MAAMoB,EAAaC,GAAYC,UAC3B,GAAKlC,EAEL,IACI6B,GAA+B,GAC/BJ,EAAa,MACbR,EAAY,WACZ,MAAMkB,QAAgBtB,EAASb,GAC/BgB,EAASmB,EACb,CAAE,MAAOC,GACDA,aAAiBC,IACjBZ,EAAaW,GAAOE,QACpBC,QAAQC,KAAK,2BAA2BJ,GAAOE,oBAAoBF,GAAOK,oBAAoBL,GAAOM,WAEzGb,GAA+B,GAEUX,EAArCkB,aAAiBO,EAA4BP,EACpC,IAAIO,EAAmB,QAAS,mCAAoC,CAAEC,MAAOR,IAC9F,IACD,CAACvB,EAAUb,IAER6C,EAAqBZ,GAAaV,IACpCH,EAAgBG,EAAAA,GACjB,IASGuB,EAAoBlB,GAA0C,YAAXb,GAAwBf,GAAc+C,mBACzFC,EAAqC,YAAXjC,IAAyB+B,EAEzD,OACIG,EAACC,OACGD,EAACE,EAAAA,CAAOC,KAAMC,EAAiBC,OAAO,MAAMC,MAAM,OAAOC,mBAAoB,CAACV,EAAoB,GAAK,YAEtGE,GACGC,EAACC,OACGD,EAACQ,EAAWC,MAAOhE,KAAAA,EAAKE,IAAI,oBAC5BqD,EAACQ,EAAWE,KAAI,KAAEjE,EAAKE,IAAI,uBAET,IAAjBgB,EAAMmB,QAAgBkB,EAACW,MAAAA,CAAIC,UAAU,mCAAmCnE,EAAKE,IAAI,6BAChE,IAAjBgB,EAAMmB,QAAgBkB,EAACa,EAAAA,CAAcvC,KAAMX,EAAM,GAAImD,aAAcvE,EAAcC,EAAWC,KAC5FkB,EAAMmB,OAAS,GACZkB,EAACe,EAAAA,CACGC,aAAcjE,EACdY,MAAOA,EACPsD,aAAcrB,EACdkB,aAAcvE,EAAcC,EAAWC,KAI/CuD,EAACkB,EAAAA,CACGC,SAAU1C,EACV3B,OAAQA,EACRsE,MAAOvE,EAAkBJ,EAAMK,EAAQC,GACvCe,OAAQA,EACRuD,QAASxD,EAA4B,UAAY,YACjDyD,KACqB,IAAjB3D,EAAMmB,QACNrB,EAAS,CAAE8D,YAAa,eAAxB9D,CAAyCI,EAA4B,GAAG2D,QAAe,GAAGA,eAE9FC,QAAS1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CtPResendOtpLink.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport classnames from 'classnames';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport Icon from '../../../../Icon';\nimport { isSrciError } from '../../../services/utils';\nimport { PREFIX } from '../../../../Icon/constants';\n\n\nconst CONFIRMATION_SHOWING_TIME = 2000;\n\ninterface CtPResendOtpLinkProps {\n onError(errorCode: string): void;\n onResendCode(): void;\n disabled: boolean;\n}\n\nconst CtPResendOtpLink = ({ onError, onResendCode, disabled }: CtPResendOtpLinkProps): h.JSX.Element => {\n const [counter, setCounter] = useState<number>(null);\n const [showConfirmation, setShowConfirmation] = useState<boolean>(false);\n const { i18n } = useCoreContext();\n const { startIdentityValidation } = useClickToPayContext();\n\n useEffect(() => {\n let timeout = null;\n if (counter > 0) {\n timeout = setTimeout(() => setCounter(counter - 1), 1000);\n }\n return () => clearTimeout(timeout);\n }, [counter]);\n\n useEffect(() => {\n let timeout = null;\n\n if (showConfirmation) {\n timeout = setTimeout(() => {\n setShowConfirmation(false);\n setCounter(60);\n }, CONFIRMATION_SHOWING_TIME);\n }\n return () => clearTimeout(timeout);\n }, [showConfirmation]);\n\n const handleResendCodeClick = useCallback(\n async event => {\n event.preventDefault();\n\n try {\n onResendCode();\n setShowConfirmation(true);\n await startIdentityValidation();\n } catch (error: unknown) {\n setCounter(0);\n setShowConfirmation(false);\n\n if (!isSrciError(error)) {\n console.error(error);\n return;\n }\n\n onError(error.reason);\n }\n },\n [startIdentityValidation, onError, onResendCode]\n );\n\n if (showConfirmation) {\n return (\n <div className=\"adyen-checkout-ctp__otp-resend-code--confirmation\">\n {i18n.get('ctp.otp.codeResent')}\n <Icon type={`${PREFIX}checkmark`} height={14} width={14} />\n </div>\n );\n }\n\n if (counter > 0) {\n return (\n <div className=\"adyen-checkout-ctp__otp-resend-code--disabled\">\n {i18n.get('ctp.otp.resendCode')} -{' '}\n <span className=\"adyen-checkout-ctp__otp-resend-code-counter\"> {counter > 0 && `${counter}s`} </span>\n </div>\n );\n }\n\n return (\n <div\n role=\"link\"\n tabIndex={0}\n className={classnames('adyen-checkout-ctp__otp-resend-code', { 'adyen-checkout-ctp__otp-resend-code--disabled': disabled })}\n onClick={handleResendCodeClick}\n >\n {i18n.get('ctp.otp.resendCode')}\n </div>\n );\n};\n\nexport default CtPResendOtpLink;\n"],"names":["CtPResendOtpLink","onError","onResendCode","disabled","counter","setCounter","useState","showConfirmation","setShowConfirmation","i18n","useCoreContext","startIdentityValidation","useClickToPayContext","useEffect","timeout","setTimeout","clearTimeout","handleResendCodeClick","useCallback","async","event","preventDefault","error","isSrciError","console","reason","h","div","className","get","Icon","type","PREFIX","height","width","span","role","tabIndex","classnames","onClick"],"mappings":"giBAUA,MAQMA,EAAmB,EAAGC,UAASC,eAAcC,eAC/C,MAAOC,EAASC,GAAcC,EAAiB,OACxCC,EAAkBC,GAAuBF,GAAkB,IAC5DG,KAAEA,GAASC,KACXC,wBAAEA,GAA4BC,IAEpCC,GAAU,KACN,IAAIC,EAAU,KAId,OAHIV,EAAU,IACVU,EAAUC,YAAW,IAAMV,EAAWD,EAAU,IAAI,MAEjD,IAAMY,aAAaF,EAAAA,GAC3B,CAACV,IAEJS,GAAU,KACN,IAAIC,EAAU,KAQd,OANIP,IACAO,EAAUC,YAAW,KACjBP,GAAoB,GACpBH,EAAW,GAAA,GA5BO,MA+BnB,IAAMW,aAAaF,EAAAA,GAC3B,CAACP,IAEJ,MAAMU,EAAwBC,GAC1BC,MAAMC,IACFA,EAAMC,iBAEN,IACInB,IACAM,GAAoB,SACdG,GACV,CAAE,MAAOW,GAIL,GAHAjB,EAAW,GACXG,GAAoB,IAEfe,EAAYD,GAEb,YADAE,QAAQF,MAAMA,GAIlBrB,EAAQqB,EAAMG,OAClB,IAEJ,CAACd,EAAyBV,EAASC,IAGvC,OAAIK,EAEImB,EAACC,MAAAA,CAAIC,UAAU,qDACVnB,EAAKoB,IAAI,sBACVH,EAACI,EAAAA,CAAKC,KAAM,GAAGC,aAAmBC,OAAQ,GAAIC,MAAO,MAK7D9B,EAAU,EAENsB,EAACC,MAAAA,CAAIC,UAAU,iDACVnB,EAAKoB,IAAI,sBAAsB,KAAG,IACnCH,EAACS,OAAAA,CAAKP,UAAU,+CAA8C,IAAExB,EAAU,GAAK,GAAGA,KAAW,MAMrGsB,EAACC,MAAAA,CACGS,KAAK,OACLC,SAAU,EACVT,UAAWU,EAAW,sCAAuC,CAAE,gDAAiDnC,IAChHoC,QAAStB,GAERR,EAAKoB,IAAI,sBAAA"}
1
+ {"version":3,"file":"CtPResendOtpLink.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport classnames from 'classnames';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport Icon from '../../../../Icon';\nimport { isSrciError } from '../../../services/utils';\nimport { PREFIX } from '../../../../Icon/constants';\n\nconst CONFIRMATION_SHOWING_TIME = 2000;\n\ninterface CtPResendOtpLinkProps {\n onError(errorCode: string): void;\n onResendCode(): void;\n disabled: boolean;\n}\n\nconst CtPResendOtpLink = ({ onError, onResendCode, disabled }: CtPResendOtpLinkProps): h.JSX.Element => {\n const [counter, setCounter] = useState<number>(null);\n const [showConfirmation, setShowConfirmation] = useState<boolean>(false);\n const { i18n } = useCoreContext();\n const { startIdentityValidation } = useClickToPayContext();\n\n useEffect(() => {\n let timeout = null;\n if (counter > 0) {\n timeout = setTimeout(() => setCounter(counter - 1), 1000);\n }\n return () => clearTimeout(timeout);\n }, [counter]);\n\n useEffect(() => {\n let timeout = null;\n\n if (showConfirmation) {\n timeout = setTimeout(() => {\n setShowConfirmation(false);\n setCounter(60);\n }, CONFIRMATION_SHOWING_TIME);\n }\n return () => clearTimeout(timeout);\n }, [showConfirmation]);\n\n const handleResendCodeClick = useCallback(\n async event => {\n event.preventDefault();\n\n try {\n onResendCode();\n setShowConfirmation(true);\n await startIdentityValidation();\n } catch (error: unknown) {\n setCounter(0);\n setShowConfirmation(false);\n\n if (!isSrciError(error)) {\n console.error(error);\n return;\n }\n\n onError(error.reason);\n }\n },\n [startIdentityValidation, onError, onResendCode]\n );\n\n if (showConfirmation) {\n return (\n <div className=\"adyen-checkout-ctp__otp-resend-code--confirmation\">\n {i18n.get('ctp.otp.codeResent')}\n <Icon type={`${PREFIX}checkmark`} height={14} width={14} />\n </div>\n );\n }\n\n if (counter > 0) {\n return (\n <div className=\"adyen-checkout-ctp__otp-resend-code--disabled\">\n {i18n.get('ctp.otp.resendCode')} -{' '}\n <span className=\"adyen-checkout-ctp__otp-resend-code-counter\"> {counter > 0 && `${counter}s`} </span>\n </div>\n );\n }\n\n return (\n <div\n role=\"link\"\n tabIndex={0}\n className={classnames('adyen-checkout-ctp__otp-resend-code', { 'adyen-checkout-ctp__otp-resend-code--disabled': disabled })}\n onClick={handleResendCodeClick}\n >\n {i18n.get('ctp.otp.resendCode')}\n </div>\n );\n};\n\nexport default CtPResendOtpLink;\n"],"names":["CtPResendOtpLink","onError","onResendCode","disabled","counter","setCounter","useState","showConfirmation","setShowConfirmation","i18n","useCoreContext","startIdentityValidation","useClickToPayContext","useEffect","timeout","setTimeout","clearTimeout","handleResendCodeClick","useCallback","async","event","preventDefault","error","isSrciError","console","reason","h","div","className","get","Icon","type","PREFIX","height","width","span","role","tabIndex","classnames","onClick"],"mappings":"giBASA,MAQMA,EAAmB,EAAGC,UAASC,eAAcC,eAC/C,MAAOC,EAASC,GAAcC,EAAiB,OACxCC,EAAkBC,GAAuBF,GAAkB,IAC5DG,KAAEA,GAASC,KACXC,wBAAEA,GAA4BC,IAEpCC,GAAU,KACN,IAAIC,EAAU,KAId,OAHIV,EAAU,IACVU,EAAUC,YAAW,IAAMV,EAAWD,EAAU,IAAI,MAEjD,IAAMY,aAAaF,EAAAA,GAC3B,CAACV,IAEJS,GAAU,KACN,IAAIC,EAAU,KAQd,OANIP,IACAO,EAAUC,YAAW,KACjBP,GAAoB,GACpBH,EAAW,GAAA,GA5BO,MA+BnB,IAAMW,aAAaF,EAAAA,GAC3B,CAACP,IAEJ,MAAMU,EAAwBC,GAC1BC,MAAMC,IACFA,EAAMC,iBAEN,IACInB,IACAM,GAAoB,SACdG,GACV,CAAE,MAAOW,GAIL,GAHAjB,EAAW,GACXG,GAAoB,IAEfe,EAAYD,GAEb,YADAE,QAAQF,MAAMA,GAIlBrB,EAAQqB,EAAMG,OAClB,IAEJ,CAACd,EAAyBV,EAASC,IAGvC,OAAIK,EAEImB,EAACC,MAAAA,CAAIC,UAAU,qDACVnB,EAAKoB,IAAI,sBACVH,EAACI,EAAAA,CAAKC,KAAM,GAAGC,aAAmBC,OAAQ,GAAIC,MAAO,MAK7D9B,EAAU,EAENsB,EAACC,MAAAA,CAAIC,UAAU,iDACVnB,EAAKoB,IAAI,sBAAsB,KAAG,IACnCH,EAACS,OAAAA,CAAKP,UAAU,+CAA8C,IAAExB,EAAU,GAAK,GAAGA,KAAW,MAMrGsB,EAACC,MAAAA,CACGS,KAAK,OACLC,SAAU,EACVT,UAAWU,EAAW,sCAAuC,CAAE,gDAAiDnC,IAChHoC,QAAStB,GAERR,EAAKoB,IAAI,sBAAA"}
@@ -1,2 +1,2 @@
1
- import{SchemeNames as t}from"../services/sdks/utils.js";class a{dateOfCardLastUsed;panLastFour;srcDigitalCardId;scheme;artUri;srcCorrelationId;tokenId;isExpired;panExpirationMonth;panExpirationYear;descriptorName;status=null;constructor(t,a,i){this.dateOfCardLastUsed=t.dateOfCardLastUsed,this.panLastFour=t.panLastFour,this.srcDigitalCardId=t.srcDigitalCardId,this.descriptorName=t.digitalCardData.descriptorName,this.tokenId=t.tokenId,this.scheme=a,this.artUri=t.digitalCardData.artUri,this.srcCorrelationId=i,this.panExpirationMonth=t.panExpirationMonth,this.panExpirationYear=t.panExpirationYear,this.status=t.digitalCardData.status,this.isExpired=this.confirmCardIsExpired()}get title(){return"visa"===this.scheme?t[this.scheme]:this.descriptorName||t[this.scheme]}get isDcfPopupEmbedded(){return"mc"===this.scheme}confirmCardIsExpired(){if("ACTIVE"!==this.status)return!0;if(!this.panExpirationYear&&!this.panExpirationMonth)return!1;const[t,a]=[(new Date).getMonth()+1,(new Date).getFullYear()];return!(Number(this.panExpirationYear)>a)&&!(Number(this.panExpirationYear)===a&&Number(this.panExpirationMonth)>=t)}}export{a as default};
1
+ import{SchemeNames as t}from"../services/sdks/utils.js";class a{dateOfCardLastUsed;dateOfCardCreated;panLastFour;srcDigitalCardId;scheme;artUri;srcCorrelationId;tokenId;isExpired;panExpirationMonth;panExpirationYear;descriptorName;status=null;constructor(t,a,r){this.dateOfCardLastUsed=t.dateOfCardLastUsed,this.dateOfCardCreated=t.dateOfCardCreated,this.panLastFour=t.panLastFour,this.srcDigitalCardId=t.srcDigitalCardId,this.descriptorName=t.digitalCardData.descriptorName,this.tokenId=t.tokenId,this.scheme=a,this.artUri=t.digitalCardData.artUri,this.srcCorrelationId=r,this.panExpirationMonth=t.panExpirationMonth,this.panExpirationYear=t.panExpirationYear,this.status=t.digitalCardData.status,this.isExpired=this.confirmCardIsExpired()}get title(){return"visa"===this.scheme?t[this.scheme]:this.descriptorName||t[this.scheme]}get isDcfPopupEmbedded(){return"mc"===this.scheme}confirmCardIsExpired(){if("ACTIVE"!==this.status)return!0;if(!this.panExpirationYear&&!this.panExpirationMonth)return!1;const[t,a]=[(new Date).getMonth()+1,(new Date).getFullYear()];return!(Number(this.panExpirationYear)>a)&&!(Number(this.panExpirationYear)===a&&Number(this.panExpirationMonth)>=t)}}export{a as default};
2
2
  //# sourceMappingURL=ShopperCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShopperCard.js","sources":["../../../../../../src/components/internal/ClickToPay/models/ShopperCard.ts"],"sourcesContent":["import { DigitalCardStatus, SrcCard } from '../services/sdks/types';\nimport { SchemeNames } from '../services/sdks/utils';\nimport { ClickToPayScheme } from '../types';\n\nclass ShopperCard {\n public dateOfCardLastUsed: string;\n public panLastFour: string;\n public srcDigitalCardId: string;\n public scheme: ClickToPayScheme;\n public artUri: string;\n public srcCorrelationId: string;\n public tokenId?: string;\n public isExpired: boolean;\n\n private readonly panExpirationMonth: string;\n private readonly panExpirationYear: string;\n private readonly descriptorName?: string;\n private readonly status?: DigitalCardStatus = null;\n\n constructor(maskedCard: SrcCard, scheme: ClickToPayScheme, srcCorrelationId: string) {\n this.dateOfCardLastUsed = maskedCard.dateOfCardLastUsed;\n this.panLastFour = maskedCard.panLastFour;\n this.srcDigitalCardId = maskedCard.srcDigitalCardId;\n this.descriptorName = maskedCard.digitalCardData.descriptorName;\n this.tokenId = maskedCard.tokenId;\n this.scheme = scheme;\n this.artUri = maskedCard.digitalCardData.artUri;\n this.srcCorrelationId = srcCorrelationId;\n this.panExpirationMonth = maskedCard.panExpirationMonth;\n this.panExpirationYear = maskedCard.panExpirationYear;\n this.status = maskedCard.digitalCardData.status;\n\n this.isExpired = this.confirmCardIsExpired();\n }\n\n get title() {\n return this.scheme === 'visa' ? SchemeNames[this.scheme] : this.descriptorName || SchemeNames[this.scheme];\n }\n\n get isDcfPopupEmbedded(): boolean {\n return this.scheme === 'mc';\n }\n\n private confirmCardIsExpired(): boolean {\n if (this.status !== 'ACTIVE') return true;\n if (!this.panExpirationYear && !this.panExpirationMonth) return false;\n\n const [currentMonth, currentYear] = [new Date().getMonth() + 1, new Date().getFullYear()];\n if (Number(this.panExpirationYear) > currentYear) return false;\n if (Number(this.panExpirationYear) === currentYear && Number(this.panExpirationMonth) >= currentMonth) return false;\n\n return true;\n }\n}\n\nexport default ShopperCard;\n"],"names":["ShopperCard","dateOfCardLastUsed","panLastFour","srcDigitalCardId","scheme","artUri","srcCorrelationId","tokenId","isExpired","panExpirationMonth","panExpirationYear","descriptorName","status","constructor","maskedCard","this","digitalCardData","confirmCardIsExpired","title","SchemeNames","isDcfPopupEmbedded","currentMonth","currentYear","Date","getMonth","getFullYear","Number"],"mappings":"wDAIA,MAAMA,EACKC,mBACAC,YACAC,iBACAC,OACAC,OACAC,iBACAC,QACAC,UAEUC,mBACAC,kBACAC,eACAC,OAA6B,KAE9CC,WAAAA,CAAYC,EAAqBV,EAA0BE,GACvDS,KAAKd,mBAAqBa,EAAWb,mBACrCc,KAAKb,YAAcY,EAAWZ,YAC9Ba,KAAKZ,iBAAmBW,EAAWX,iBACnCY,KAAKJ,eAAiBG,EAAWE,gBAAgBL,eACjDI,KAAKR,QAAUO,EAAWP,QAC1BQ,KAAKX,OAASA,EACdW,KAAKV,OAASS,EAAWE,gBAAgBX,OACzCU,KAAKT,iBAAmBA,EACxBS,KAAKN,mBAAqBK,EAAWL,mBACrCM,KAAKL,kBAAoBI,EAAWJ,kBACpCK,KAAKH,OAASE,EAAWE,gBAAgBJ,OAEzCG,KAAKP,UAAYO,KAAKE,sBAC1B,CAEA,SAAIC,GACA,MAAuB,SAAhBH,KAAKX,OAAoBe,EAAYJ,KAAKX,QAAUW,KAAKJ,gBAAkBQ,EAAYJ,KAAKX,OACvG,CAEA,sBAAIgB,GACA,MAAuB,OAAhBL,KAAKX,MAChB,CAEQa,oBAAAA,GACJ,GAAoB,WAAhBF,KAAKH,OAAqB,OAAO,EACrC,IAAKG,KAAKL,oBAAsBK,KAAKN,mBAAoB,OAAO,EAEhE,MAAOY,EAAcC,GAAe,EAAC,IAAIC,MAAOC,WAAa,GAAG,IAAID,MAAOE,eAC3E,QAAIC,OAAOX,KAAKL,mBAAqBY,MACjCI,OAAOX,KAAKL,qBAAuBY,GAAeI,OAAOX,KAAKN,qBAAuBY,EAG7F"}
1
+ {"version":3,"file":"ShopperCard.js","sources":["../../../../../../src/components/internal/ClickToPay/models/ShopperCard.ts"],"sourcesContent":["import { DigitalCardStatus, SrcCard } from '../services/sdks/types';\nimport { SchemeNames } from '../services/sdks/utils';\nimport { ClickToPayScheme } from '../types';\n\nclass ShopperCard {\n public dateOfCardLastUsed?: string;\n public dateOfCardCreated: string;\n public panLastFour: string;\n public srcDigitalCardId: string;\n public scheme: ClickToPayScheme;\n public artUri: string;\n public srcCorrelationId: string;\n public tokenId?: string;\n public isExpired: boolean;\n\n private readonly panExpirationMonth: string;\n private readonly panExpirationYear: string;\n private readonly descriptorName?: string;\n private readonly status?: DigitalCardStatus = null;\n\n constructor(maskedCard: SrcCard, scheme: ClickToPayScheme, srcCorrelationId: string) {\n this.dateOfCardLastUsed = maskedCard.dateOfCardLastUsed;\n this.dateOfCardCreated = maskedCard.dateOfCardCreated;\n this.panLastFour = maskedCard.panLastFour;\n this.srcDigitalCardId = maskedCard.srcDigitalCardId;\n this.descriptorName = maskedCard.digitalCardData.descriptorName;\n this.tokenId = maskedCard.tokenId;\n this.scheme = scheme;\n this.artUri = maskedCard.digitalCardData.artUri;\n this.srcCorrelationId = srcCorrelationId;\n this.panExpirationMonth = maskedCard.panExpirationMonth;\n this.panExpirationYear = maskedCard.panExpirationYear;\n this.status = maskedCard.digitalCardData.status;\n\n this.isExpired = this.confirmCardIsExpired();\n }\n\n get title() {\n return this.scheme === 'visa' ? SchemeNames[this.scheme] : this.descriptorName || SchemeNames[this.scheme];\n }\n\n get isDcfPopupEmbedded(): boolean {\n return this.scheme === 'mc';\n }\n\n private confirmCardIsExpired(): boolean {\n if (this.status !== 'ACTIVE') return true;\n if (!this.panExpirationYear && !this.panExpirationMonth) return false;\n\n const [currentMonth, currentYear] = [new Date().getMonth() + 1, new Date().getFullYear()];\n if (Number(this.panExpirationYear) > currentYear) return false;\n if (Number(this.panExpirationYear) === currentYear && Number(this.panExpirationMonth) >= currentMonth) return false;\n\n return true;\n }\n}\n\nexport default ShopperCard;\n"],"names":["ShopperCard","dateOfCardLastUsed","dateOfCardCreated","panLastFour","srcDigitalCardId","scheme","artUri","srcCorrelationId","tokenId","isExpired","panExpirationMonth","panExpirationYear","descriptorName","status","constructor","maskedCard","this","digitalCardData","confirmCardIsExpired","title","SchemeNames","isDcfPopupEmbedded","currentMonth","currentYear","Date","getMonth","getFullYear","Number"],"mappings":"wDAIA,MAAMA,EACKC,mBACAC,kBACAC,YACAC,iBACAC,OACAC,OACAC,iBACAC,QACAC,UAEUC,mBACAC,kBACAC,eACAC,OAA6B,KAE9CC,WAAAA,CAAYC,EAAqBV,EAA0BE,GACvDS,KAAKf,mBAAqBc,EAAWd,mBACrCe,KAAKd,kBAAoBa,EAAWb,kBACpCc,KAAKb,YAAcY,EAAWZ,YAC9Ba,KAAKZ,iBAAmBW,EAAWX,iBACnCY,KAAKJ,eAAiBG,EAAWE,gBAAgBL,eACjDI,KAAKR,QAAUO,EAAWP,QAC1BQ,KAAKX,OAASA,EACdW,KAAKV,OAASS,EAAWE,gBAAgBX,OACzCU,KAAKT,iBAAmBA,EACxBS,KAAKN,mBAAqBK,EAAWL,mBACrCM,KAAKL,kBAAoBI,EAAWJ,kBACpCK,KAAKH,OAASE,EAAWE,gBAAgBJ,OAEzCG,KAAKP,UAAYO,KAAKE,sBAC1B,CAEA,SAAIC,GACA,MAAuB,SAAhBH,KAAKX,OAAoBe,EAAYJ,KAAKX,QAAUW,KAAKJ,gBAAkBQ,EAAYJ,KAAKX,OACvG,CAEA,sBAAIgB,GACA,MAAuB,OAAhBL,KAAKX,MAChB,CAEQa,oBAAAA,GACJ,GAAoB,WAAhBF,KAAKH,OAAqB,OAAO,EACrC,IAAKG,KAAKL,oBAAsBK,KAAKN,mBAAoB,OAAO,EAEhE,MAAOY,EAAcC,GAAe,EAAC,IAAIC,MAAOC,WAAa,GAAG,IAAID,MAAOE,eAC3E,QAAIC,OAAOX,KAAKL,mBAAqBY,MACjCI,OAAOX,KAAKL,qBAAuBY,GAAeI,OAAOX,KAAKN,qBAAuBY,EAG7F"}
@@ -1,2 +1,2 @@
1
- class e extends Error{reason;message;source;scheme;constructor(e,s,r){super();const o="error"in e?e?.error?.message:e?.message,t="error"in e?e?.error?.reason:e?.reason;this.message=o,this.reason=t,this.source=s,this.scheme=r}toString(){return`Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`}}export{e as default};
1
+ class e extends Error{reason;message;source;scheme;errorFromCardSchemeSdk;constructor(e,r,s){super();const o="error"in e?e?.error?.message:e?.message,t="error"in e?e?.error?.reason:e?.reason;this.message=o,this.reason=t,this.source=r,this.scheme=s,this.errorFromCardSchemeSdk=e}toString(){return`Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`}}export{e as default};
2
2
  //# sourceMappingURL=SrciError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SrciError.js","sources":["../../../../../../../src/components/internal/ClickToPay/services/sdks/SrciError.ts"],"sourcesContent":["import { ClickToPayScheme } from '../../types';\n\nexport type MastercardError = {\n message: string;\n reason: string;\n};\n\nexport type VisaError = {\n error: {\n message: string;\n reason: string;\n };\n};\n\nclass SrciError extends Error {\n public reason: string;\n public message: string;\n public source: string;\n public scheme: ClickToPayScheme;\n\n constructor(schemeError: VisaError | MastercardError, source: string, scheme: ClickToPayScheme) {\n super();\n\n const message = 'error' in schemeError ? schemeError?.error?.message : schemeError?.message;\n const reason = 'error' in schemeError ? schemeError?.error?.reason : schemeError?.reason;\n\n this.message = message;\n this.reason = reason;\n this.source = source;\n this.scheme = scheme;\n }\n\n toString() {\n return `Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`;\n }\n}\n\nexport default SrciError;\n"],"names":["SrciError","Error","reason","message","source","scheme","constructor","schemeError","super","error","this","toString"],"mappings":"AAcA,MAAMA,UAAkBC,MACbC,OACAC,QACAC,OACAC,OAEPC,WAAAA,CAAYC,EAA0CH,EAAgBC,GAClEG,QAEA,MAAML,EAAU,UAAWI,EAAcA,GAAaE,OAAON,QAAUI,GAAaJ,QAC9ED,EAAS,UAAWK,EAAcA,GAAaE,OAAOP,OAASK,GAAaL,OAElFQ,KAAKP,QAAUA,EACfO,KAAKR,OAASA,EACdQ,KAAKN,OAASA,EACdM,KAAKL,OAASA,CAClB,CAEAM,QAAAA,GACI,MAAO,WAAWD,KAAKR,oBAAoBQ,KAAKN,oBAAoBM,KAAKL,qBAAqBK,KAAKP,SACvG"}
1
+ {"version":3,"file":"SrciError.js","sources":["../../../../../../../src/components/internal/ClickToPay/services/sdks/SrciError.ts"],"sourcesContent":["import { ClickToPayScheme } from '../../types';\n\nexport type MastercardError = {\n message: string;\n reason: string;\n};\n\nexport type VisaError = {\n error: {\n message: string;\n reason: string;\n };\n};\n\nclass SrciError extends Error {\n public reason: string;\n public message: string;\n public source: string;\n public scheme: ClickToPayScheme;\n public errorFromCardSchemeSdk: unknown;\n\n constructor(schemeError: VisaError | MastercardError, source: string, scheme: ClickToPayScheme) {\n super();\n\n const message = 'error' in schemeError ? schemeError?.error?.message : schemeError?.message;\n const reason = 'error' in schemeError ? schemeError?.error?.reason : schemeError?.reason;\n\n this.message = message;\n this.reason = reason;\n this.source = source;\n this.scheme = scheme;\n this.errorFromCardSchemeSdk = schemeError;\n }\n\n toString() {\n return `Reason: ${this.reason} / Source: ${this.source} / Scheme: ${this.scheme} / Message: ${this.message}`;\n }\n}\n\nexport default SrciError;\n"],"names":["SrciError","Error","reason","message","source","scheme","errorFromCardSchemeSdk","constructor","schemeError","super","error","this","toString"],"mappings":"AAcA,MAAMA,UAAkBC,MACbC,OACAC,QACAC,OACAC,OACAC,uBAEPC,WAAAA,CAAYC,EAA0CJ,EAAgBC,GAClEI,QAEA,MAAMN,EAAU,UAAWK,EAAcA,GAAaE,OAAOP,QAAUK,GAAaL,QAC9ED,EAAS,UAAWM,EAAcA,GAAaE,OAAOR,OAASM,GAAaN,OAElFS,KAAKR,QAAUA,EACfQ,KAAKT,OAASA,EACdS,KAAKP,OAASA,EACdO,KAAKN,OAASA,EACdM,KAAKL,uBAAyBE,CAClC,CAEAI,QAAAA,GACI,MAAO,WAAWD,KAAKT,oBAAoBS,KAAKP,oBAAoBO,KAAKN,qBAAqBM,KAAKR,SACvG"}
@@ -1,2 +1,2 @@
1
- import e from"../models/ShopperCard.js";const r="ctpIframe";function s(e,r,s){const{scheme:a,tokenId:t,srcDigitalCardId:o,srcCorrelationId:c}=e;return"visa"===a?t?{srcScheme:a,srcCorrelationId:c,srcTokenReference:s.toLowerCase().includes("live")?t:"987654321"}:{srcScheme:a,srcCheckoutPayload:r.checkoutResponse,srcCorrelationId:c}:{srcScheme:a,srcDigitalCardId:o,srcCorrelationId:c}}function a(r,s){const{profiles:a,srcCorrelationId:t}=s,o=a.reduce(((r,a)=>[...r,...a.maskedCards.map((r=>new e(r,s.scheme,t)))]),[]);return[...r,...o]}function t(e,r){return new Date(r.dateOfCardLastUsed).getTime()-new Date(e.dateOfCardLastUsed).getTime()}function o(e,r){return r.isExpired?e.expiredCards.push(r):e.availableCards.push(r),e}function c(e){const{availableCards:r,expiredCards:s}=e.reduce(a,[]).reduce(o,{availableCards:[],expiredCards:[]});return[...r.sort(t),...s.sort(t)]}function n(e){return!!e.reason}export{r as CTP_IFRAME_NAME,s as createCheckoutPayloadBasedOnScheme,c as createShopperCardsList,n as isSrciError};
1
+ import e from"../models/ShopperCard.js";const r="ctpIframe";function s(e,r,s){const{scheme:a,tokenId:d,srcDigitalCardId:t,srcCorrelationId:n}=e;return"visa"===a?d?{srcScheme:a,srcCorrelationId:n,srcTokenReference:s.toLowerCase().includes("live")?d:"987654321"}:{srcScheme:a,srcCheckoutPayload:r.checkoutResponse,srcCorrelationId:n}:{srcScheme:a,srcDigitalCardId:t,srcCorrelationId:n}}function a(r,s){const{profiles:a,srcCorrelationId:d}=s,t=a.reduce(((r,a)=>[...r,...a.maskedCards.map((r=>new e(r,s.scheme,d)))]),[]);return[...r,...t]}function d(e,r){return new Date(r.dateOfCardLastUsed).getTime()-new Date(e.dateOfCardLastUsed).getTime()}function t(e,r){return new Date(r.dateOfCardCreated).getTime()-new Date(e.dateOfCardCreated).getTime()}function n(e,r){return r.isExpired?e.expiredCards.push(r):e.availableCards.push(r),e}function o(e,r){return r.dateOfCardLastUsed?e.usedCards.push(r):e.unusedCards.push(r),e}function c(e){const r=e.reduce(a,[]),{availableCards:s,expiredCards:c}=r.reduce(n,{availableCards:[],expiredCards:[]}),{unusedCards:u,usedCards:i}=s.reduce(o,{unusedCards:[],usedCards:[]});return[...i.sort(d),...u.sort(t),...c.sort(d)]}function u(e){return!!e.reason}export{r as CTP_IFRAME_NAME,s as createCheckoutPayloadBasedOnScheme,c as createShopperCardsList,u as isSrciError};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/components/internal/ClickToPay/services/utils.ts"],"sourcesContent":["import { CardTypes, ClickToPayCheckoutPayload, SrcProfileWithScheme } from './types';\nimport { SrciCheckoutResponse } from './sdks/types';\nimport ShopperCard from '../models/ShopperCard';\nimport SrciError from './sdks/SrciError';\n\nexport const CTP_IFRAME_NAME = 'ctpIframe';\n\n/**\n * Creates the payload for the /payments call\n */\nfunction createCheckoutPayloadBasedOnScheme(\n card: ShopperCard,\n srciCheckoutResponse: SrciCheckoutResponse,\n environment: string\n): ClickToPayCheckoutPayload {\n const { scheme, tokenId, srcDigitalCardId, srcCorrelationId } = card;\n\n switch (scheme) {\n case 'visa':\n /**\n * For test environment, we are using hardcoded tokenId\n */\n return tokenId\n ? {\n srcScheme: scheme,\n srcCorrelationId,\n srcTokenReference: environment.toLowerCase().includes('live') ? tokenId : '987654321'\n }\n : { srcScheme: scheme, srcCheckoutPayload: srciCheckoutResponse.checkoutResponse, srcCorrelationId };\n case 'mc':\n default:\n return { srcScheme: scheme, srcDigitalCardId, srcCorrelationId };\n }\n}\n\nfunction createShopperMaskedCardsData(memo: ShopperCard[], srcProfile: SrcProfileWithScheme): ShopperCard[] {\n const { profiles, srcCorrelationId } = srcProfile;\n\n const cards: ShopperCard[] = profiles.reduce((memo: ShopperCard[], profile) => {\n const profileCards: ShopperCard[] = profile.maskedCards.map(maskedCard => new ShopperCard(maskedCard, srcProfile.scheme, srcCorrelationId));\n return [...memo, ...profileCards];\n }, []);\n\n return [...memo, ...cards];\n}\n\nfunction sortCardByLastTimeUsed(card1: ShopperCard, card2: ShopperCard) {\n return new Date(card2.dateOfCardLastUsed).getTime() - new Date(card1.dateOfCardLastUsed).getTime();\n}\n\nfunction splitAvailableAndExpiredCards(memo: CardTypes, card: ShopperCard): CardTypes {\n if (card.isExpired) memo.expiredCards.push(card);\n else memo.availableCards.push(card);\n return memo;\n}\n\n/**\n * Creates the Shopper card list. The available cards are placed before the expired cards\n */\nfunction createShopperCardsList(srcProfiles: SrcProfileWithScheme[]): ShopperCard[] {\n const { availableCards, expiredCards } = srcProfiles\n .reduce(createShopperMaskedCardsData, [])\n .reduce(splitAvailableAndExpiredCards, { availableCards: [], expiredCards: [] });\n\n return [...availableCards.sort(sortCardByLastTimeUsed), ...expiredCards.sort(sortCardByLastTimeUsed)];\n}\n\nfunction isSrciError(error: unknown): error is SrciError {\n if ((error as SrciError).reason) return true;\n return false;\n}\n\nexport { createShopperCardsList, createCheckoutPayloadBasedOnScheme, isSrciError };\n"],"names":["CTP_IFRAME_NAME","createCheckoutPayloadBasedOnScheme","card","srciCheckoutResponse","environment","scheme","tokenId","srcDigitalCardId","srcCorrelationId","srcScheme","srcTokenReference","toLowerCase","includes","srcCheckoutPayload","checkoutResponse","createShopperMaskedCardsData","memo","srcProfile","profiles","cards","reduce","profile","maskedCards","map","maskedCard","ShopperCard","sortCardByLastTimeUsed","card1","card2","Date","dateOfCardLastUsed","getTime","splitAvailableAndExpiredCards","isExpired","expiredCards","push","availableCards","createShopperCardsList","srcProfiles","sort","isSrciError","error","reason"],"mappings":"wCAKO,MAAMA,EAAkB,YAK/B,SAASC,EACLC,EACAC,EACAC,GAEA,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,iBAAEA,EAAgBC,iBAAEA,GAAqBN,EAEhE,MACS,SADDG,EAKOC,EACD,CACIG,UAAWJ,EACXG,mBACAE,kBAAmBN,EAAYO,cAAcC,SAAS,QAAUN,EAAU,aAE9E,CAAEG,UAAWJ,EAAQQ,mBAAoBV,EAAqBW,iBAAkBN,oBAG/E,CAAEC,UAAWJ,EAAQE,mBAAkBC,mBAE1D,CAEA,SAASO,EAA6BC,EAAqBC,GACvD,MAAMC,SAAEA,EAAQV,iBAAEA,GAAqBS,EAEjCE,EAAuBD,EAASE,QAAO,CAACJ,EAAqBK,IAExD,IAAIL,KADyBK,EAAQC,YAAYC,KAAIC,GAAc,IAAIC,EAAYD,EAAYP,EAAWZ,OAAQG,OAE1H,IAEH,MAAO,IAAIQ,KAASG,EACxB,CAEA,SAASO,EAAuBC,EAAoBC,GAChD,OAAO,IAAIC,KAAKD,EAAME,oBAAoBC,UAAY,IAAIF,KAAKF,EAAMG,oBAAoBC,SAC7F,CAEA,SAASC,EAA8BhB,EAAiBd,GAGpD,OAFIA,EAAK+B,UAAWjB,EAAKkB,aAAaC,KAAKjC,GACtCc,EAAKoB,eAAeD,KAAKjC,GACvBc,CACX,CAKA,SAASqB,EAAuBC,GAC5B,MAAMF,eAAEA,EAAcF,aAAEA,GAAiBI,EACpClB,OAAOL,EAA8B,IACrCK,OAAOY,EAA+B,CAAEI,eAAgB,GAAIF,aAAc,KAE/E,MAAO,IAAIE,EAAeG,KAAKb,MAA4BQ,EAAaK,KAAKb,GACjF,CAEA,SAASc,EAAYC,GACjB,QAAIA,EAAqBC,MAE7B"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/components/internal/ClickToPay/services/utils.ts"],"sourcesContent":["import { CardTypes, ClickToPayCheckoutPayload, SrcProfileWithScheme } from './types';\nimport { SrciCheckoutResponse } from './sdks/types';\nimport ShopperCard from '../models/ShopperCard';\nimport SrciError from './sdks/SrciError';\n\nexport const CTP_IFRAME_NAME = 'ctpIframe';\n\n/**\n * Creates the payload for the /payments call\n */\nfunction createCheckoutPayloadBasedOnScheme(\n card: ShopperCard,\n srciCheckoutResponse: SrciCheckoutResponse,\n environment: string\n): ClickToPayCheckoutPayload {\n const { scheme, tokenId, srcDigitalCardId, srcCorrelationId } = card;\n\n switch (scheme) {\n case 'visa':\n /**\n * For test environment, we are using hardcoded tokenId\n */\n return tokenId\n ? {\n srcScheme: scheme,\n srcCorrelationId,\n srcTokenReference: environment.toLowerCase().includes('live') ? tokenId : '987654321'\n }\n : { srcScheme: scheme, srcCheckoutPayload: srciCheckoutResponse.checkoutResponse, srcCorrelationId };\n case 'mc':\n default:\n return { srcScheme: scheme, srcDigitalCardId, srcCorrelationId };\n }\n}\n\nfunction createShopperMaskedCardsData(memo: ShopperCard[], srcProfile: SrcProfileWithScheme): ShopperCard[] {\n const { profiles, srcCorrelationId } = srcProfile;\n\n const cards: ShopperCard[] = profiles.reduce((memo: ShopperCard[], profile) => {\n const profileCards: ShopperCard[] = profile.maskedCards.map(maskedCard => new ShopperCard(maskedCard, srcProfile.scheme, srcCorrelationId));\n return [...memo, ...profileCards];\n }, []);\n\n return [...memo, ...cards];\n}\n\nfunction sortCardByLastTimeUsed(card1: ShopperCard, card2: ShopperCard) {\n return new Date(card2.dateOfCardLastUsed).getTime() - new Date(card1.dateOfCardLastUsed).getTime();\n}\n\nfunction sortCardByLastTimeCreated(card1: ShopperCard, card2: ShopperCard) {\n return new Date(card2.dateOfCardCreated).getTime() - new Date(card1.dateOfCardCreated).getTime();\n}\n\nfunction splitAvailableAndExpiredCards(memo: CardTypes, card: ShopperCard): CardTypes {\n if (card.isExpired) memo.expiredCards.push(card);\n else memo.availableCards.push(card);\n return memo;\n}\n\nfunction splitUnusedAndUsedCards(memo: { unusedCards: ShopperCard[]; usedCards: ShopperCard[] }, card: ShopperCard) {\n if (card.dateOfCardLastUsed) memo.usedCards.push(card);\n else memo.unusedCards.push(card);\n return memo;\n}\n\n/**\n * Creates the Shopper card list. The available cards are placed before the expired cards\n */\nfunction createShopperCardsList(srcProfiles: SrcProfileWithScheme[]): ShopperCard[] {\n const cards: ShopperCard[] = srcProfiles.reduce(createShopperMaskedCardsData, []);\n const { availableCards, expiredCards } = cards.reduce(splitAvailableAndExpiredCards, { availableCards: [], expiredCards: [] });\n const { unusedCards, usedCards } = availableCards.reduce(splitUnusedAndUsedCards, { unusedCards: [], usedCards: [] });\n\n return [...usedCards.sort(sortCardByLastTimeUsed), ...unusedCards.sort(sortCardByLastTimeCreated), ...expiredCards.sort(sortCardByLastTimeUsed)];\n}\n\nfunction isSrciError(error: unknown): error is SrciError {\n if ((error as SrciError).reason) return true;\n return false;\n}\n\nexport { createShopperCardsList, createCheckoutPayloadBasedOnScheme, isSrciError };\n"],"names":["CTP_IFRAME_NAME","createCheckoutPayloadBasedOnScheme","card","srciCheckoutResponse","environment","scheme","tokenId","srcDigitalCardId","srcCorrelationId","srcScheme","srcTokenReference","toLowerCase","includes","srcCheckoutPayload","checkoutResponse","createShopperMaskedCardsData","memo","srcProfile","profiles","cards","reduce","profile","maskedCards","map","maskedCard","ShopperCard","sortCardByLastTimeUsed","card1","card2","Date","dateOfCardLastUsed","getTime","sortCardByLastTimeCreated","dateOfCardCreated","splitAvailableAndExpiredCards","isExpired","expiredCards","push","availableCards","splitUnusedAndUsedCards","usedCards","unusedCards","createShopperCardsList","srcProfiles","sort","isSrciError","error","reason"],"mappings":"wCAKO,MAAMA,EAAkB,YAK/B,SAASC,EACLC,EACAC,EACAC,GAEA,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,iBAAEA,EAAgBC,iBAAEA,GAAqBN,EAEhE,MACS,SADDG,EAKOC,EACD,CACIG,UAAWJ,EACXG,mBACAE,kBAAmBN,EAAYO,cAAcC,SAAS,QAAUN,EAAU,aAE9E,CAAEG,UAAWJ,EAAQQ,mBAAoBV,EAAqBW,iBAAkBN,oBAG/E,CAAEC,UAAWJ,EAAQE,mBAAkBC,mBAE1D,CAEA,SAASO,EAA6BC,EAAqBC,GACvD,MAAMC,SAAEA,EAAQV,iBAAEA,GAAqBS,EAEjCE,EAAuBD,EAASE,QAAO,CAACJ,EAAqBK,IAExD,IAAIL,KADyBK,EAAQC,YAAYC,KAAIC,GAAc,IAAIC,EAAYD,EAAYP,EAAWZ,OAAQG,OAE1H,IAEH,MAAO,IAAIQ,KAASG,EACxB,CAEA,SAASO,EAAuBC,EAAoBC,GAChD,OAAO,IAAIC,KAAKD,EAAME,oBAAoBC,UAAY,IAAIF,KAAKF,EAAMG,oBAAoBC,SAC7F,CAEA,SAASC,EAA0BL,EAAoBC,GACnD,OAAO,IAAIC,KAAKD,EAAMK,mBAAmBF,UAAY,IAAIF,KAAKF,EAAMM,mBAAmBF,SAC3F,CAEA,SAASG,EAA8BlB,EAAiBd,GAGpD,OAFIA,EAAKiC,UAAWnB,EAAKoB,aAAaC,KAAKnC,GACtCc,EAAKsB,eAAeD,KAAKnC,GACvBc,CACX,CAEA,SAASuB,EAAwBvB,EAAgEd,GAG7F,OAFIA,EAAK4B,mBAAoBd,EAAKwB,UAAUH,KAAKnC,GAC5Cc,EAAKyB,YAAYJ,KAAKnC,GACpBc,CACX,CAKA,SAAS0B,EAAuBC,GAC5B,MAAMxB,EAAuBwB,EAAYvB,OAAOL,EAA8B,KACxEuB,eAAEA,EAAcF,aAAEA,GAAiBjB,EAAMC,OAAOc,EAA+B,CAAEI,eAAgB,GAAIF,aAAc,MACnHK,YAAEA,EAAWD,UAAEA,GAAcF,EAAelB,OAAOmB,EAAyB,CAAEE,YAAa,GAAID,UAAW,KAEhH,MAAO,IAAIA,EAAUI,KAAKlB,MAA4Be,EAAYG,KAAKZ,MAA+BI,EAAaQ,KAAKlB,GAC5H,CAEA,SAASmB,EAAYC,GACjB,QAAIA,EAAqBC,MAE7B"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as s,useState as r,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as i}from"../../../core/Context/CoreProvider.js";import n from"../CompanyDetails/CompanyDetails.js";import t from"../PersonalDetails/PersonalDetails.js";import a from"../Address/Address.js";import l from"../FormFields/Checkbox/Checkbox.js";import d from"../FormFields/ConsentCheckbox/ConsentCheckbox.js";import{getInitialActiveFieldsets as c,fieldsetsSchema as m,getActiveFieldsData as p}from"./utils.js";import b from"../IbanInput/IbanInput.js";import u from"../FormFields/Field/Field.js";import y from"../FormInstruction/FormInstruction.js";import C from"./useSRPanelForOpenInvoiceErrors.js";const h={isValid:!1,errorMessage:"consent.checkbox.invalid",error:"consent.checkbox.invalid"};function f(f){const{countryCode:A,visibility:v}=f,{i18n:k}=i(),g=s({});Object.keys(g.current).length||f.setComponentRef?.(g.current);const D=s(!1),x=c(v,f.data),[F,j]=r(x),{current:w}=s(m.reduce(((e,s)=>(e[s]=e=>{w[s].current=e},e)),{})),R=!!f.consentCheckboxLabel,I=!R&&Object.keys(F).every((e=>!F[e])),E="editable"===v.deliveryAddress&&"hidden"!==v.billingAddress,[S,q]=r({...f.data,...R&&{consentCheckbox:!1}}),[P,V]=r({}),[M,N]=r({}),[O,L]=r("ready");g.current.showValidation=()=>{D.current=!0,m.forEach((e=>{w[e].current&&w[e].current.showValidation()})),V({...R&&{consentCheckbox:S.consentCheckbox?null:h}})},g.current.setStatus=L,C({errors:P,data:S,props:f,isValidating:D}),o((()=>{const e=Object.keys(F).every((e=>!F[e]||!!M[e])),s=!R||!!M.consentCheckbox,r=e&&s,o=p(F,S);f.onChange({data:o,errors:P,valid:M,isValid:r})}),[S,F]);const B=e=>s=>{q((r=>({...r,[e]:s.data}))),N((r=>({...r,[e]:s.isValid}))),V((r=>({...r,[e]:s.errors})))};return e("div",{className:"adyen-checkout__open-invoice"},f.showFormInstruction&&e(y,null),F.companyDetails&&e(n,{data:f.data.companyDetails,label:"companyDetails",onChange:B("companyDetails"),setComponentRef:w.companyDetails,visibility:v.companyDetails}),F.personalDetails&&e(t,{data:f.data.personalDetails,requiredFields:f.personalDetailsRequiredFields,label:"personalDetails",onChange:B("personalDetails"),setComponentRef:w.personalDetails,visibility:v.personalDetails}),F.bankAccount&&e(b,{holderName:!0,label:"bankAccount",data:S.bankAccount,onChange:B("bankAccount"),ref:w.bankAccount}),F.billingAddress&&e(a,{allowedCountries:f?.billingAddressSpecification?.allowedCountries??f.allowedCountries,countryCode:A,requiredFields:f.billingAddressRequiredFields,specifications:f.billingAddressSpecification,data:S.billingAddress,label:"billingAddress",onChange:B("billingAddress"),setComponentRef:w.billingAddress,visibility:v.billingAddress}),E&&e(u,{classNameModifiers:["separateDeliveryAddress","consentCheckbox"],name:"separateDeliveryAddress",useLabelElement:!1,showErrorElement:!1},e(l,{label:k.get("separateDeliveryAddress"),checked:F.deliveryAddress,classNameModifiers:["separateDeliveryAddress"],name:"separateDeliveryAddress",onChange:()=>{j((e=>({...e,deliveryAddress:!F.deliveryAddress})))}})),F.deliveryAddress&&e(a,{allowedCountries:f?.deliveryAddressSpecification?.allowedCountries??f.allowedCountries,countryCode:A,requiredFields:f.deliveryAddressRequiredFields,specifications:f.deliveryAddressSpecification,data:S.deliveryAddress,label:"deliveryAddress",onChange:B("deliveryAddress"),setComponentRef:w.deliveryAddress,visibility:v.deliveryAddress}),R&&e(d,{data:S,errorMessage:!!P.consentCheckbox,label:f.consentCheckboxLabel,onChange:e=>{const{checked:s}=e.target;q((e=>({...e,consentCheckbox:s}))),N((e=>({...e,consentCheckbox:s}))),V((e=>({...e,consentCheckbox:s?null:h})))},i18n:k}),f.showPayButton&&f.payButton({status:O,classNameModifiers:[...I?["standalone"]:[]],label:k.get("confirmPurchase")}))}export{f as default};
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as s,useState as r,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as i}from"../../../core/Context/CoreProvider.js";import n from"../CompanyDetails/CompanyDetails.js";import t from"../PersonalDetails/PersonalDetails.js";import a from"../Address/Address.js";import l from"../FormFields/Checkbox/Checkbox.js";import d from"../FormFields/ConsentCheckbox/ConsentCheckbox.js";import{getInitialActiveFieldsets as c,fieldsetsSchema as m,getActiveFieldsData as p}from"./utils.js";import b from"../IbanInput/IbanInput.js";import u from"../FormFields/Field/Field.js";import y from"../FormInstruction/FormInstruction.js";import C from"./useSRPanelForOpenInvoiceErrors.js";const h={isValid:!1,errorMessage:"consent.checkbox.invalid",error:"consent.checkbox.invalid"};function f(f){const{countryCode:A,visibility:v}=f,{i18n:k}=i(),g=s({});Object.keys(g.current).length||f.setComponentRef?.(g.current);const D=s(!1),x=c(v,f.data),[F,j]=r(x),{current:w}=s(m.reduce(((e,s)=>(e[s]=e=>{w[s].current=e},e)),{})),R=!!f.consentCheckboxLabel,E=!R&&Object.keys(F).every((e=>!F[e])),I="editable"===v.deliveryAddress&&"hidden"!==v.billingAddress,[S,q]=r({...f.data,...R&&{consentCheckbox:!1}}),[P,V]=r({}),[M,N]=r({}),[O,L]=r("ready");g.current.showValidation=()=>{D.current=!0,m.forEach((e=>{w[e].current&&w[e].current.showValidation()})),V({...R&&{consentCheckbox:S.consentCheckbox?null:h}})},g.current.setStatus=L,C({errors:P,data:S,props:f,isValidating:D}),o((()=>{const e=Object.keys(F).every((e=>!F[e]||!!M[e])),s=!R||!!M.consentCheckbox,r=e&&s,o=p(F,S);f.onChange({data:o,errors:P,valid:M,isValid:r})}),[S,F]);const B=e=>s=>{q((r=>({...r,[e]:s.data}))),N((r=>({...r,[e]:s.isValid}))),V((r=>({...r,[e]:s.errors})))};return e("div",{className:"adyen-checkout__open-invoice"},e(y,null),F.companyDetails&&e(n,{data:f.data.companyDetails,label:"companyDetails",onChange:B("companyDetails"),setComponentRef:w.companyDetails,visibility:v.companyDetails}),F.personalDetails&&e(t,{data:f.data.personalDetails,requiredFields:f.personalDetailsRequiredFields,label:"personalDetails",onChange:B("personalDetails"),setComponentRef:w.personalDetails,visibility:v.personalDetails}),F.bankAccount&&e(b,{holderName:!0,label:"ach.bankAccount",data:S.bankAccount,onChange:B("bankAccount"),ref:w.bankAccount}),F.billingAddress&&e(a,{allowedCountries:f?.billingAddressSpecification?.allowedCountries??f.allowedCountries,countryCode:A,requiredFields:f.billingAddressRequiredFields,specifications:f.billingAddressSpecification,data:S.billingAddress,label:"billingAddress",onChange:B("billingAddress"),setComponentRef:w.billingAddress,visibility:v.billingAddress}),I&&e(u,{classNameModifiers:["separateDeliveryAddress","consentCheckbox"],name:"separateDeliveryAddress",useLabelElement:!1,showErrorElement:!1},e(l,{label:k.get("separateDeliveryAddress"),checked:F.deliveryAddress,classNameModifiers:["separateDeliveryAddress"],name:"separateDeliveryAddress",onChange:()=>{j((e=>({...e,deliveryAddress:!F.deliveryAddress})))}})),F.deliveryAddress&&e(a,{allowedCountries:f?.deliveryAddressSpecification?.allowedCountries??f.allowedCountries,countryCode:A,requiredFields:f.deliveryAddressRequiredFields,specifications:f.deliveryAddressSpecification,data:S.deliveryAddress,label:"deliveryAddress",onChange:B("deliveryAddress"),setComponentRef:w.deliveryAddress,visibility:v.deliveryAddress}),R&&e(d,{data:S,errorMessage:!!P.consentCheckbox,label:f.consentCheckboxLabel,onChange:e=>{const{checked:s}=e.target;q((e=>({...e,consentCheckbox:s}))),N((e=>({...e,consentCheckbox:s}))),V((e=>({...e,consentCheckbox:s?null:h})))},i18n:k}),f.showPayButton&&f.payButton({status:O,classNameModifiers:[...E?["standalone"]:[]],label:k.get("confirmPurchase")}))}export{f as default};
2
2
  //# sourceMappingURL=OpenInvoice.js.map