@adyen/kyc-components 2.28.0 → 2.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/ad-e09b987a.mjs +13 -0
- package/dist/es/adyen-kyc-components.es.js +1895 -1382
- package/dist/es/ae-8ca1be27.mjs +10 -0
- package/dist/es/af-342e1bf5.mjs +12 -0
- package/dist/es/ag-997e3f88.mjs +35 -0
- package/dist/es/ai-402dc201.mjs +30 -0
- package/dist/es/al-38b31dad.mjs +14 -0
- package/dist/es/am-bc1403ea.mjs +10 -0
- package/dist/es/an-70336f96.mjs +10 -0
- package/dist/es/ao-eedf3279.mjs +41 -0
- package/dist/es/aq-2220e7e0.mjs +8 -0
- package/dist/es/ar-87abe42d.mjs +9 -0
- package/dist/es/arrow-left-3d6cd330.mjs +5 -0
- package/dist/es/arrow-right-994e40f8.mjs +8 -0
- package/dist/es/as-6e35c5ec.mjs +16 -0
- package/dist/es/at-4310d424.mjs +8 -0
- package/dist/es/au-50f94ba8.mjs +17 -0
- package/dist/es/aw-97918c9f.mjs +24 -0
- package/dist/es/ax-567f3585.mjs +10 -0
- package/dist/es/az-85dbb96d.mjs +19 -0
- package/dist/es/ba-8afe4a33.mjs +18 -0
- package/dist/es/bb-c4d79528.mjs +16 -0
- package/dist/es/bd-0f87f359.mjs +9 -0
- package/dist/es/be-63be2126.mjs +10 -0
- package/dist/es/bf-621f8737.mjs +10 -0
- package/dist/es/bg-30061757.mjs +12 -0
- package/dist/es/bh-a858ad79.mjs +8 -0
- package/dist/es/bi-c08e68ba.mjs +18 -0
- package/dist/es/bin-191739de.mjs +8 -0
- package/dist/es/bj-8e17226d.mjs +28 -0
- package/dist/es/bl-b7b32ae6.mjs +26 -0
- package/dist/es/bm-b728ab56.mjs +31 -0
- package/dist/es/bn-c706c05b.mjs +13 -0
- package/dist/es/bo-1fad8399.mjs +10 -0
- package/dist/es/br-11b9980d.mjs +14 -0
- package/dist/es/bs-090f5bd7.mjs +14 -0
- package/dist/es/bt-c56334d3.mjs +9 -0
- package/dist/es/bv-570dcd11.mjs +20 -0
- package/dist/es/bw-5de93ae1.mjs +10 -0
- package/dist/es/by-e2457131.mjs +14 -0
- package/dist/es/bz-30bbd0de.mjs +11 -0
- package/dist/es/ca-39c0e436.mjs +9 -0
- package/dist/es/cc-ddc2a1db.mjs +14 -0
- package/dist/es/cd-eab01270.mjs +14 -0
- package/dist/es/cf-50f7241b.mjs +12 -0
- package/dist/es/cg-e87aa981.mjs +13 -0
- package/dist/es/ch-9637f347.mjs +9 -0
- package/dist/es/check-b5a70376.mjs +5 -0
- package/dist/es/checkmark-fd78da6f.mjs +5 -0
- package/dist/es/checkmark-small-bf41309f.mjs +5 -0
- package/dist/es/chevron-down-df0a3ac6.mjs +8 -0
- package/dist/es/chevron-right-23ff6e47.mjs +8 -0
- package/dist/es/chevron-up-abfe0e90.mjs +8 -0
- package/dist/es/ci-41814a2b.mjs +9 -0
- package/dist/es/ck-60b0d769.mjs +24 -0
- package/dist/es/cl-931fd7da.mjs +10 -0
- package/dist/es/cm-55c02792.mjs +16 -0
- package/dist/es/cn-1526dac5.mjs +9 -0
- package/dist/es/co-c7ada338.mjs +28 -0
- package/dist/es/company-4f71e406.mjs +5 -0
- package/dist/es/contract-5bc99018.mjs +5 -0
- package/dist/es/controlling-person-88da578f.mjs +5 -0
- package/dist/es/cr-bac1e451.mjs +9 -0
- package/dist/es/cross-c2431982.mjs +8 -0
- package/dist/es/cu-af98b602.mjs +10 -0
- package/dist/es/cv-575fe55b.mjs +11 -0
- package/dist/es/cw-6f1c60ce.mjs +15 -0
- package/dist/es/cx-7687e3a9.mjs +16 -0
- package/dist/es/cy-eeff5dbd.mjs +10 -0
- package/dist/es/cz-24eff96c.mjs +9 -0
- package/dist/es/de-8e2b6f6c.mjs +28 -0
- package/dist/es/decision-maker-a2182544.mjs +5 -0
- package/dist/es/dj-e0f41411.mjs +15 -0
- package/dist/es/dk-a5073c43.mjs +8 -0
- package/dist/es/dm-9a3ee195.mjs +18 -0
- package/dist/es/do-5aa635df.mjs +12 -0
- package/dist/es/document-88abec41.mjs +5 -0
- package/dist/es/download-54b1a163.mjs +8 -0
- package/dist/es/dz-7452e74d.mjs +10 -0
- package/dist/es/ec-c68c940e.mjs +13 -0
- package/dist/es/edit-e3629680.mjs +5 -0
- package/dist/es/ee-1dbd9a40.mjs +9 -0
- package/dist/es/eg-40f9b2b5.mjs +10 -0
- package/dist/es/eh-51f4bae2.mjs +11 -0
- package/dist/es/er-61cda111.mjs +14 -0
- package/dist/es/es-78250575.mjs +13 -0
- package/dist/es/et-63dc8d1e.mjs +12 -0
- package/dist/es/fi-e2d1f3df.mjs +16 -0
- package/dist/es/field-error-620e1903.mjs +5 -0
- package/dist/es/fj-02f497c5.mjs +34 -0
- package/dist/es/fk-56af40af.mjs +41 -0
- package/dist/es/fm-0292f2ce.mjs +19 -0
- package/dist/es/fo-5063373c.mjs +14 -0
- package/dist/es/fr-fb20da2b.mjs +19 -0
- package/dist/es/fx-ca4da212.mjs +9 -0
- package/dist/es/ga-31f5afca.mjs +10 -0
- package/dist/es/gb-4ae48840.mjs +14 -0
- package/dist/es/gd-25e40717.mjs +22 -0
- package/dist/es/ge-939c150e.mjs +9 -0
- package/dist/es/gf-b8736c20.mjs +10 -0
- package/dist/es/gg-4c532713.mjs +13 -0
- package/dist/es/gh-7b187c5f.mjs +11 -0
- package/dist/es/gi-e59b72be.mjs +10 -0
- package/dist/es/gl-31e9b8e5.mjs +9 -0
- package/dist/es/gm-975999b2.mjs +11 -0
- package/dist/es/gn-3701984d.mjs +10 -0
- package/dist/es/gp-40fbae20.mjs +10 -0
- package/dist/es/gq-86021eca.mjs +11 -0
- package/dist/es/gr-3b0c7597.mjs +8 -0
- package/dist/es/gs-00bc8674.mjs +130 -0
- package/dist/es/gt-05eb5f87.mjs +11 -0
- package/dist/es/gu-497f9b0b.mjs +45 -0
- package/dist/es/gw-b54f1365.mjs +11 -0
- package/dist/es/gy-e917fca1.mjs +10 -0
- package/dist/es/hk-ddd60484.mjs +9 -0
- package/dist/es/hm-03a2df0b.mjs +18 -0
- package/dist/es/hn-1748eed1.mjs +9 -0
- package/dist/es/hr-6b1bd9c8.mjs +16 -0
- package/dist/es/ht-13a1ab82.mjs +23 -0
- package/dist/es/hu-81872148.mjs +9 -0
- package/dist/es/id-2c9c4235.mjs +8 -0
- package/dist/es/ie-ef96fd76.mjs +19 -0
- package/dist/es/il-20c3ccd4.mjs +20 -0
- package/dist/es/im-eb7a7143.mjs +40 -0
- package/dist/es/in-67c16223.mjs +11 -0
- package/dist/es/info-circle-3d2e7ba8.mjs +9 -0
- package/dist/es/io-9adeb690.mjs +22 -0
- package/dist/es/iq-61ffc408.mjs +11 -0
- package/dist/es/ir-bc3341c2.mjs +13 -0
- package/dist/es/is-7c19d0ff.mjs +10 -0
- package/dist/es/it-fa0dd04c.mjs +19 -0
- package/dist/es/je-a29e157d.mjs +18 -0
- package/dist/es/jm-53f8ddb8.mjs +13 -0
- package/dist/es/jo-89d49ef8.mjs +11 -0
- package/dist/es/jp-f97d7972.mjs +20 -0
- package/dist/es/ke-545eb9cb.mjs +33 -0
- package/dist/es/kg-066a524e.mjs +10 -0
- package/dist/es/kh-39620e7b.mjs +10 -0
- package/dist/es/ki-900be23e.mjs +17 -0
- package/dist/es/km-b4e8c8ba.mjs +12 -0
- package/dist/es/kn-8ec9ee75.mjs +15 -0
- package/dist/es/kp-1cdc64be.mjs +11 -0
- package/dist/es/kr-53eac37f.mjs +23 -0
- package/dist/es/kw-c4347b38.mjs +10 -0
- package/dist/es/ky-a104dc86.mjs +31 -0
- package/dist/es/kz-d64ba71d.mjs +10 -0
- package/dist/es/la-04577eb2.mjs +10 -0
- package/dist/es/lb-c2470dd0.mjs +19 -0
- package/dist/es/lc-58fb8706.mjs +19 -0
- package/dist/es/li-c887f5b7.mjs +9 -0
- package/dist/es/light-bulb-d403fe24.mjs +5 -0
- package/dist/es/lk-d10f8746.mjs +12 -0
- package/dist/es/location-e7c2a8f5.mjs +5 -0
- package/dist/es/lr-8422af8e.mjs +20 -0
- package/dist/es/ls-bdcefbbc.mjs +11 -0
- package/dist/es/lt-07e70fec.mjs +10 -0
- package/dist/es/lu-b7c93ece.mjs +9 -0
- package/dist/es/lv-97900494.mjs +8 -0
- package/dist/es/ly-86ceab07.mjs +29 -0
- package/dist/es/ma-21b21bdf.mjs +15 -0
- package/dist/es/mc-f23b73f0.mjs +12 -0
- package/dist/es/md-82ed1b49.mjs +17 -0
- package/dist/es/me-c45ff596.mjs +17 -0
- package/dist/es/mf-11563bd1.mjs +10 -0
- package/dist/es/mg-f5f0546b.mjs +9 -0
- package/dist/es/mh-06a860ed.mjs +15 -0
- package/dist/es/mk-91356e13.mjs +12 -0
- package/dist/es/ml-c3f2014e.mjs +16 -0
- package/dist/es/mm-d138bd76.mjs +17 -0
- package/dist/es/mn-9c4664d8.mjs +20 -0
- package/dist/es/mo-54bd2fbe.mjs +16 -0
- package/dist/es/more-horiz-0ca4ec23.mjs +5 -0
- package/dist/es/mp-796516e8.mjs +11 -0
- package/dist/es/mq-3511a92a.mjs +10 -0
- package/dist/es/mr-a4b18b6d.mjs +15 -0
- package/dist/es/ms-91e4dcef.mjs +28 -0
- package/dist/es/mt-9b58b6a6.mjs +21 -0
- package/dist/es/mu-2307760c.mjs +17 -0
- package/dist/es/mv-32c9699b.mjs +16 -0
- package/dist/es/mw-2b9505ac.mjs +17 -0
- package/dist/es/mx-98a49b74.mjs +17 -0
- package/dist/es/my-217f9384.mjs +16 -0
- package/dist/es/mz-92e1e39c.mjs +19 -0
- package/dist/es/na-3c30775f.mjs +18 -0
- package/dist/es/nc-c80aff50.mjs +18 -0
- package/dist/es/ne-b38208ab.mjs +11 -0
- package/dist/es/new-document-cfa14b7f.mjs +5 -0
- package/dist/es/nf-780a37dd.mjs +9 -0
- package/dist/es/ng-f5ea4118.mjs +19 -0
- package/dist/es/ni-60b41460.mjs +16 -0
- package/dist/es/nl-975a8624.mjs +11 -0
- package/dist/es/no-952bf512.mjs +19 -0
- package/dist/es/np-5135aa90.mjs +16 -0
- package/dist/es/nr-cecf1f05.mjs +9 -0
- package/dist/es/nu-c1ad2dc9.mjs +28 -0
- package/dist/es/nz-70a6e29f.mjs +21 -0
- package/dist/es/om-e5c99d1e.mjs +20 -0
- package/dist/es/owners-a58a9f25.mjs +5 -0
- package/dist/es/pa-0e401aff.mjs +16 -0
- package/dist/es/payout-575951ec.mjs +5 -0
- package/dist/es/pci-f4b6e5f5.mjs +5 -0
- package/dist/es/pe-823d3b3f.mjs +15 -0
- package/dist/es/pf-5c60fe59.mjs +24 -0
- package/dist/es/pg-71e8aaec.mjs +17 -0
- package/dist/es/ph-52f55ac4.mjs +16 -0
- package/dist/es/pk-372b07db.mjs +15 -0
- package/dist/es/pl-2c472f58.mjs +12 -0
- package/dist/es/plus-25579839.mjs +8 -0
- package/dist/es/pm-2195603b.mjs +38 -0
- package/dist/es/pn-ec73a623.mjs +25 -0
- package/dist/es/pr-8f159ad6.mjs +30 -0
- package/dist/es/ps-34dd64b7.mjs +11 -0
- package/dist/es/pt-b210cd4c.mjs +12 -0
- package/dist/es/pw-a474545d.mjs +15 -0
- package/dist/es/py-e271f15f.mjs +17 -0
- package/dist/es/qa-a7ad70ed.mjs +16 -0
- package/dist/es/re-a1440f32.mjs +10 -0
- package/dist/es/remove-6a123f82.mjs +5 -0
- package/dist/es/review-14953b30.mjs +8 -0
- package/dist/es/ro-8a071708.mjs +16 -0
- package/dist/es/rs-f3ea0f97.mjs +20 -0
- package/dist/es/ru-edd59839.mjs +19 -0
- package/dist/es/rw-df210dff.mjs +24 -0
- package/dist/es/sa-18c28dc4.mjs +9 -0
- package/dist/es/sb-35c0ab8d.mjs +36 -0
- package/dist/es/sc-82eb7101.mjs +22 -0
- package/dist/es/sd-dc5fb244.mjs +16 -0
- package/dist/es/se-0413b6f1.mjs +9 -0
- package/dist/es/search-3edfe795.mjs +5 -0
- package/dist/es/sg-8ff78597.mjs +15 -0
- package/dist/es/sh-7b636341.mjs +36 -0
- package/dist/es/si-2c09bba0.mjs +23 -0
- package/dist/es/signatory-c8417fb2.mjs +10 -0
- package/dist/es/sj-8aff2627.mjs +10 -0
- package/dist/es/sk-8da1fee7.mjs +23 -0
- package/dist/es/sl-92cb9116.mjs +15 -0
- package/dist/es/sm-6fd64a6a.mjs +16 -0
- package/dist/es/sn-57e8c34b.mjs +17 -0
- package/dist/es/so-f2f0ac03.mjs +15 -0
- package/dist/es/sr-7869b748.mjs +16 -0
- package/dist/es/ss-8e9c79ca.mjs +16 -0
- package/dist/es/st-6b3e911c.mjs +17 -0
- package/dist/es/store-9fc075e6.mjs +5 -0
- package/dist/es/sv-922ba5ea.mjs +14 -0
- package/dist/es/sx-c078bfd1.mjs +17 -0
- package/dist/es/sy-995ec1ee.mjs +16 -0
- package/dist/es/sz-da33c6e8.mjs +25 -0
- package/dist/es/tc-1a465526.mjs +27 -0
- package/dist/es/td-a7ff3830.mjs +10 -0
- package/dist/es/tf-c71eed4a.mjs +12 -0
- package/dist/es/tg-613f7f5a.mjs +17 -0
- package/dist/es/th-f517ca34.mjs +15 -0
- package/dist/es/tj-b99ac64f.mjs +16 -0
- package/dist/es/tk-c0dfeac1.mjs +10 -0
- package/dist/es/tl-35cc3595.mjs +17 -0
- package/dist/es/tm-0deecc32.mjs +47 -0
- package/dist/es/tn-190a49a0.mjs +15 -0
- package/dist/es/to-790cac18.mjs +19 -0
- package/dist/es/tr-1db5a437.mjs +16 -0
- package/dist/es/trust-0e40337d.mjs +5 -0
- package/dist/es/tt-85ae901c.mjs +16 -0
- package/dist/es/tv-9f2b4198.mjs +17 -0
- package/dist/es/tw-74aa27b3.mjs +16 -0
- package/dist/es/tz-2a5cf5e6.mjs +17 -0
- package/dist/es/ua-9fedceaa.mjs +9 -0
- package/dist/es/ug-1a8fee80.mjs +20 -0
- package/dist/es/um-d774b142.mjs +30 -0
- package/dist/es/us-20ac3d88.mjs +24 -0
- package/dist/es/uy-c22e1eb1.mjs +10 -0
- package/dist/es/uz-f8be4086.mjs +16 -0
- package/dist/es/va-d1f00296.mjs +12 -0
- package/dist/es/vc-0a06f1c2.mjs +17 -0
- package/dist/es/ve-3bc33c40.mjs +17 -0
- package/dist/es/vg-3ad787bf.mjs +31 -0
- package/dist/es/vi-5a78bf74.mjs +34 -0
- package/dist/es/vn-50e78ae2.mjs +9 -0
- package/dist/es/vu-72d9304c.mjs +37 -0
- package/dist/es/warning-bb000c6b.mjs +5 -0
- package/dist/es/wf-8cdbeff9.mjs +10 -0
- package/dist/es/wrong-652db543.mjs +5 -0
- package/dist/es/ws-745fc88c.mjs +16 -0
- package/dist/es/ye-f4eaca91.mjs +9 -0
- package/dist/es/yt-93635c9a.mjs +33 -0
- package/dist/es/za-42d70d0b.mjs +19 -0
- package/dist/es/zm-571a963f.mjs +24 -0
- package/dist/es/zw-6cf765c3.mjs +22 -0
- package/dist/es/zz-067ccc58.mjs +8 -0
- package/dist/style.css +39 -209
- package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +1 -1
- package/dist/types/components/CompanyBasics/types.d.ts +1 -1
- package/dist/types/components/CompanyOtherDetails/component/CompanyOtherDetailsComponent.d.ts +1 -1
- package/dist/types/components/IdentityNumber/component/IdentityNumberComponent.d.ts +1 -3
- package/dist/types/components/IdentityNumber/fieldConfig.d.ts +12 -0
- package/dist/types/components/IdentityNumber/type.d.ts +6 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/DriversLicense.d.ts +4 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/IdentityAuComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/IdentityHKComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/validate.d.ts +0 -2
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/DriversLicense.d.ts +4 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/IdentityNZComponent.d.ts +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/TypeOfIdentity/index.d.ts +5 -5
- package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +4 -6
- package/dist/types/components/PersonalDetails/types.d.ts +3 -2
- package/dist/types/components/TaskList/types.d.ts +2 -1
- package/dist/types/components/internal/AccordionItem/types.d.ts +2 -1
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BankAccountFormat/BankAccountFormat.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/BankAccountNumber.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BankAccountNumber/index.d.ts +1 -1
- package/dist/types/components/internal/BankAccountNumber/types.d.ts +6 -1
- package/dist/types/components/internal/BankCity/BankCity.d.ts +1 -1
- package/dist/types/components/internal/BankCity/index.d.ts +1 -1
- package/dist/types/components/internal/BankCode/BankCode.d.ts +1 -1
- package/dist/types/components/internal/BankCode/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BankCode/index.d.ts +1 -1
- package/dist/types/components/internal/BankCode/types.d.ts +6 -1
- package/dist/types/components/internal/BankName/BankName.d.ts +1 -1
- package/dist/types/components/internal/BankName/index.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/BranchCode.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/BranchCode/index.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/types.d.ts +6 -1
- package/dist/types/components/internal/Button/types.d.ts +2 -1
- package/dist/types/components/internal/CountryField/Flag.d.ts +7 -0
- package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -2
- package/dist/types/components/internal/Iban/Iban.d.ts +1 -1
- package/dist/types/components/internal/Iban/fieldConfig.d.ts +5 -0
- package/dist/types/components/internal/Iban/ibanValidator.d.ts +1 -4
- package/dist/types/components/internal/Iban/index.d.ts +1 -1
- package/dist/types/components/internal/Iban/types.d.ts +2 -0
- package/dist/types/components/internal/Icon/Icon.d.ts +41 -3
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +35 -2
- package/dist/types/components/internal/Link/types.d.ts +2 -1
- package/dist/types/components/internal/Menu/ActionsMenu.d.ts +2 -1
- package/dist/types/components/internal/Status/types.d.ts +2 -1
- package/dist/types/components/internal/SwiftCode/SwiftCode.d.ts +1 -1
- package/dist/types/components/internal/SwiftCode/fieldConfig.d.ts +3 -0
- package/dist/types/components/internal/SwiftCode/index.d.ts +1 -1
- package/dist/types/components/internal/TaxId/types.d.ts +0 -7
- package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +0 -1
- package/dist/types/core/Context/StateContext/useGlobalData.d.ts +1 -2
- package/dist/types/core/SDKValidation/index.d.ts +1 -1
- package/dist/types/core/Services/agnostic/get-images.d.ts +0 -1
- package/dist/types/core/Services/agnostic/index.d.ts +0 -1
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/useForm/reducer.d.ts +3 -3
- package/dist/types/core/hooks/useForm/types.d.ts +3 -3
- package/dist/types/core/hooks/useForm/useForm.d.ts +2 -2
- package/dist/types/core/hooks/useIsElementVisible.d.ts +2 -1
- package/dist/types/core/models/api/company-search.d.ts +2 -1
- package/dist/types/core/models/api/company-types-value.d.ts +3 -0
- package/dist/types/core/models/api/organization-type.d.ts +5 -0
- package/dist/types/core/models/api/organization.d.ts +3 -0
- package/dist/types/core/models/api/transfer-instrument.d.ts +1 -1
- package/dist/types/core/models/field-configurations.d.ts +1 -0
- package/dist/types/core/models/payout-account.d.ts +1 -1
- package/dist/types/core/models/scenario-fields.d.ts +1 -1
- package/dist/types/core/process-field-configurations.d.ts +1 -1
- package/dist/types/language/config.d.ts +8 -3
- package/dist/types/utils/dynamicImports.d.ts +3 -0
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/dist/types/utils/formUtils.d.ts +1 -0
- package/dist/types/utils/isValueObscured.d.ts +1 -0
- package/dist/types/utils/mapping/companySearch/index.d.ts +1 -1
- package/dist/types/utils/mapping/companySearch/mapOrganizationTypeToCompanyType.d.ts +9 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +1 -1
- package/dist/types/utils/masking/maskHelpers.d.ts +1 -0
- package/dist/types/utils/masking/matchAgainstMask.d.ts +3 -2
- package/dist/types/utils/omitObscuredFieldsIfUnchanged.d.ts +2 -0
- package/dist/types/utils/regex/countryIdNumberPatterns.d.ts +9 -6
- package/dist/types/utils/regex/driversLicenseCardNumberPatterns.d.ts +1 -0
- package/dist/types/utils/regex/proofOfIdentityCardPatterns.d.ts +0 -1
- package/dist/types/utils/validatorUtils.d.ts +7 -22
- package/package.json +3 -2
- package/dist/types/components/IdentityNumber/formats.d.ts +0 -18
- package/dist/types/components/IdentityNumber/validate.d.ts +0 -41
- package/dist/types/components/IdentityNumber/validate.helper.d.ts +0 -3
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/PassportNumber.d.ts +0 -15
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/DriversLicense.d.ts +0 -14
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/PassportNumber.d.ts +0 -9
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/ProofOfIdentityCard.d.ts +0 -10
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/PassportNumber.d.ts +0 -15
- package/dist/types/components/PersonalDetails/component/IdentityComponent/TypeOfIdentity/types.d.ts +0 -9
- package/dist/types/components/PersonalDetails/component/labels.d.ts +0 -4
- package/dist/types/core/Services/agnostic/get-fonts.d.ts +0 -9
- package/dist/types/utils/formatting/stripCountryIdFormat.d.ts +0 -2
- package/dist/types/utils/formatting/stripNonAlphanumeric.d.ts +0 -1
- package/dist/types/utils/isValueMasked.d.ts +0 -1
- package/dist/types/utils/mapping/companySearch/mapKompanyOrganizationTypeToCompanyType.d.ts +0 -2
- package/dist/types/utils/omitMaskedFieldsIfUnchanged.d.ts +0 -2
|
@@ -2,8 +2,8 @@ import { useContext, useState, useCallback, useEffect, useMemo, useReducer, useR
|
|
|
2
2
|
import { createContext, createElement, render } from "preact";
|
|
3
3
|
import { sanitize } from "isomorphic-dompurify";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
+
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1, useCallback as useCallback$1 } from "preact/compat";
|
|
5
6
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
6
|
-
import { useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1, useCallback as useCallback$1 } from "preact/compat";
|
|
7
7
|
import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
|
|
8
8
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
9
9
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
@@ -65,7 +65,7 @@ const contactDetails = "Contact Details";
|
|
|
65
65
|
const uploadDocument = "Upload Document";
|
|
66
66
|
const individualDetails = "Individual details";
|
|
67
67
|
const last4DigitsOfSocialSecurityNumber = "Last 4 digits of Social Security Number (SSN)";
|
|
68
|
-
const
|
|
68
|
+
const socialSecurityNumber = "Social Security Number (SSN)";
|
|
69
69
|
const socialInsuranceNumber = "Social Insurance Number (SIN)";
|
|
70
70
|
const codiceFiscale = "Codice fiscale";
|
|
71
71
|
const personnummer = "Personnummer";
|
|
@@ -74,7 +74,7 @@ const nie = "NIE";
|
|
|
74
74
|
const peselNumber = "PESEL number";
|
|
75
75
|
const detCentralePersonregister = "Det Centrale Personregister (CPR)";
|
|
76
76
|
const codNumericPersonal = "Cod Numeric Personal (CNP)";
|
|
77
|
-
const cadastroDePessoasFisicas = "Cadastro de Pessoas Físicas (
|
|
77
|
+
const cadastroDePessoasFisicas = "Cadastro de Pessoas Físicas (CPF)";
|
|
78
78
|
const invalidFormatExpects = "Invalid format. Expected format: %{format}";
|
|
79
79
|
const invalidFormatForAuPassportNumber = "This isn't a valid Australian passport number. Expected format: 1-2 letters followed by 7 numbers.";
|
|
80
80
|
const invalidFormatForNZPassportNumber = "Expected format should be 8-9 alphanumeric characters. For example: PA094043.";
|
|
@@ -302,6 +302,7 @@ const bankAccountNumber = "Account number";
|
|
|
302
302
|
const iban = "IBAN";
|
|
303
303
|
const swiftCode = "Swift code";
|
|
304
304
|
const bic = "BIC";
|
|
305
|
+
const bicSwift = "BIC / SWIFT";
|
|
305
306
|
const bsbNumber = "BSB Number";
|
|
306
307
|
const branchCode = "Branch code";
|
|
307
308
|
const transitNumber = "Transit number";
|
|
@@ -343,8 +344,7 @@ const confirm = "Confirm";
|
|
|
343
344
|
const goToDecisionMakers = "Go to list of decision-makers";
|
|
344
345
|
const theSubmitWasSuccessful = "The submit was successful";
|
|
345
346
|
const thereWasAnErrorTryAgain = "There was an error, please try again";
|
|
346
|
-
const
|
|
347
|
-
const proofOfIdentityCardNumber = "Identity card number";
|
|
347
|
+
const stateIssuedProofOfIdentityCard = "State-issued proof of identity card";
|
|
348
348
|
const proofOfResidence = "Proof of residency";
|
|
349
349
|
const proofOfNationalId = "Proof of national ID";
|
|
350
350
|
const backToTaskList = "Back to task list";
|
|
@@ -700,13 +700,17 @@ const liRegistrationNumber = "Unternehmensnummer";
|
|
|
700
700
|
const Mehrwertsteuernummer = "Mehrwertsteuernummer (MwST), Numéro de TVA, Numero dell’imposta sul valore aggiunto (IVA), VAT number";
|
|
701
701
|
const enterNDigitsForExample = "Enter %{numDigits} digits. For example, %{example}";
|
|
702
702
|
const enterNCharactersForExample = "Enter %{numChars} characters. For example, %{example}";
|
|
703
|
+
const enterLastNDigitsForExample = "Enter the last %{numDigits} digits. For example, %{example}";
|
|
703
704
|
const enterXToYDigitsForExample = "Enter %{minDigits} to %{maxDigits} digits. For example, %{example}";
|
|
705
|
+
const enterXOrYDigitsForExample = "Enter %{xDigits} or %{yDigits} digits. For example, %{example}";
|
|
704
706
|
const enterXToYCharactersForExample = "Enter %{minChars} to %{maxChars} characters. For example, %{example}";
|
|
707
|
+
const enterXOrYCharactersForExample = "Enter %{xChars} or %{yChars} characters. For example, %{example}";
|
|
705
708
|
const enterXToYCharactersWithAMixForExample = "Enter %{minChars} to %{maxChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
706
709
|
const enterAMaximumOfNDigitsForExample = "Enter a maximum of %{maxDigits} digits. For example, %{example}";
|
|
707
710
|
const enterAMaximumOfNMoreDigitsForExample = "Enter a maximum of %{maxDigits} more digits. For example, %{example}";
|
|
708
711
|
const enterAMaximumOfNCharactersForExample = "Enter a maximum of %{maxChars} characters. For example, %{example}";
|
|
709
712
|
const enterAMaximumOfNCharactersWithAMixForExample = "Enter a maximum of %{maxChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
713
|
+
const enterNCharactersWithAMixForExample = "Enter %{numChars} characters, with a mix of letters and numbers. For example, %{example}";
|
|
710
714
|
const enterNDigitsAndThen1LetterForExample = "Enter %{numDigits} digits and then 1 letter. For example, %{example}";
|
|
711
715
|
const enter1LetterAndThenNDigitsForExample = "Enter 1 letter and then %{numDigits} digits. For example, %{example}";
|
|
712
716
|
const enter1LetterAndThenXToYDigitsForExample = "Enter 1 letter and then %{minDigits} to %{maxDigits} digits. For example, %{example}";
|
|
@@ -1205,6 +1209,7 @@ const introductionScreenAccountDescriptionP2 = "This is the bank account you use
|
|
|
1205
1209
|
const introductionScreenEpilogueTitle = "Why do we need this information?";
|
|
1206
1210
|
const introductionScreenEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
|
|
1207
1211
|
const introductionScreenEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
|
|
1212
|
+
const oib = "OIB";
|
|
1208
1213
|
const defaultTrans = {
|
|
1209
1214
|
close,
|
|
1210
1215
|
individual,
|
|
@@ -1255,7 +1260,7 @@ const defaultTrans = {
|
|
|
1255
1260
|
uploadDocument,
|
|
1256
1261
|
individualDetails,
|
|
1257
1262
|
last4DigitsOfSocialSecurityNumber,
|
|
1258
|
-
|
|
1263
|
+
socialSecurityNumber,
|
|
1259
1264
|
socialInsuranceNumber,
|
|
1260
1265
|
codiceFiscale,
|
|
1261
1266
|
personnummer,
|
|
@@ -1492,6 +1497,7 @@ const defaultTrans = {
|
|
|
1492
1497
|
iban,
|
|
1493
1498
|
swiftCode,
|
|
1494
1499
|
bic,
|
|
1500
|
+
bicSwift,
|
|
1495
1501
|
bsbNumber,
|
|
1496
1502
|
branchCode,
|
|
1497
1503
|
transitNumber,
|
|
@@ -1533,8 +1539,7 @@ const defaultTrans = {
|
|
|
1533
1539
|
goToDecisionMakers,
|
|
1534
1540
|
theSubmitWasSuccessful,
|
|
1535
1541
|
thereWasAnErrorTryAgain,
|
|
1536
|
-
|
|
1537
|
-
proofOfIdentityCardNumber,
|
|
1542
|
+
stateIssuedProofOfIdentityCard,
|
|
1538
1543
|
proofOfResidence,
|
|
1539
1544
|
proofOfNationalId,
|
|
1540
1545
|
backToTaskList,
|
|
@@ -1897,13 +1902,17 @@ const defaultTrans = {
|
|
|
1897
1902
|
Mehrwertsteuernummer,
|
|
1898
1903
|
enterNDigitsForExample,
|
|
1899
1904
|
enterNCharactersForExample,
|
|
1905
|
+
enterLastNDigitsForExample,
|
|
1900
1906
|
enterXToYDigitsForExample,
|
|
1907
|
+
enterXOrYDigitsForExample,
|
|
1901
1908
|
enterXToYCharactersForExample,
|
|
1909
|
+
enterXOrYCharactersForExample,
|
|
1902
1910
|
enterXToYCharactersWithAMixForExample,
|
|
1903
1911
|
enterAMaximumOfNDigitsForExample,
|
|
1904
1912
|
enterAMaximumOfNMoreDigitsForExample,
|
|
1905
1913
|
enterAMaximumOfNCharactersForExample,
|
|
1906
1914
|
enterAMaximumOfNCharactersWithAMixForExample,
|
|
1915
|
+
enterNCharactersWithAMixForExample,
|
|
1907
1916
|
enterNDigitsAndThen1LetterForExample,
|
|
1908
1917
|
enter1LetterAndThenNDigitsForExample,
|
|
1909
1918
|
enter1LetterAndThenXToYDigitsForExample,
|
|
@@ -2402,7 +2411,8 @@ const defaultTrans = {
|
|
|
2402
2411
|
introductionScreenAccountDescriptionP2,
|
|
2403
2412
|
introductionScreenEpilogueTitle,
|
|
2404
2413
|
introductionScreenEpilogueDescriptionP1,
|
|
2405
|
-
introductionScreenEpilogueDescriptionP2
|
|
2414
|
+
introductionScreenEpilogueDescriptionP2,
|
|
2415
|
+
oib
|
|
2406
2416
|
};
|
|
2407
2417
|
const FALLBACK_LOCALE = "en-US";
|
|
2408
2418
|
const defaultTranslation = defaultTrans;
|
|
@@ -2712,6 +2722,7 @@ const formUtilities = (props, i18n) => ({
|
|
|
2712
2722
|
return this.isRequiredField(field, showIfNotInRequiredFields) || this.isOptionalField(field);
|
|
2713
2723
|
},
|
|
2714
2724
|
isReadOnly: (field) => props.readOnly || (props.readOnlyFields ? props.readOnlyFields.includes(field) : false),
|
|
2725
|
+
isObscured: (field) => props.obscuredFields ? props.obscuredFields.includes(field) : false,
|
|
2715
2726
|
getVal: (val) => i18n.get(val),
|
|
2716
2727
|
getErrorMessage: (field, errors, fieldProblems) => {
|
|
2717
2728
|
var _a;
|
|
@@ -2811,10 +2822,6 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
|
|
|
2811
2822
|
};
|
|
2812
2823
|
};
|
|
2813
2824
|
const MAX_LENGTH = 30;
|
|
2814
|
-
const getMaxLengthByFormatRuleset = (formattingRules, field) => {
|
|
2815
|
-
var _a;
|
|
2816
|
-
return ((_a = formattingRules[field]) == null ? void 0 : _a.maxlength) || MAX_LENGTH;
|
|
2817
|
-
};
|
|
2818
2825
|
const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
|
|
2819
2826
|
var _a, _b, _c, _d;
|
|
2820
2827
|
if (ignoreIfFormatterExists && ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter)) {
|
|
@@ -2823,64 +2830,8 @@ const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreI
|
|
|
2823
2830
|
const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
|
|
2824
2831
|
return maxLength || MAX_LENGTH;
|
|
2825
2832
|
};
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
return defaultValidatorsObj;
|
|
2829
|
-
}
|
|
2830
|
-
const mergedValidators = {};
|
|
2831
|
-
Object.entries(defaultValidatorsObj).forEach(([field, validatorsByField]) => {
|
|
2832
|
-
const countryBasedFieldValidators = countryBasedValidators[country2][field];
|
|
2833
|
-
if (!countryBasedFieldValidators) {
|
|
2834
|
-
mergedValidators[field] = validatorsByField;
|
|
2835
|
-
} else {
|
|
2836
|
-
const defaultFieldValidatorsArray = !Array.isArray(validatorsByField) ? [validatorsByField] : [...validatorsByField];
|
|
2837
|
-
const countryFieldValidatorsArray = !Array.isArray(countryBasedFieldValidators) ? [countryBasedFieldValidators] : [...countryBasedFieldValidators];
|
|
2838
|
-
mergedValidators[field] = [...countryFieldValidatorsArray];
|
|
2839
|
-
defaultFieldValidatorsArray.forEach((rule) => {
|
|
2840
|
-
const defaultModesArr = rule.modes;
|
|
2841
|
-
let modeArraysMatch = false;
|
|
2842
|
-
countryFieldValidatorsArray.every((item) => {
|
|
2843
|
-
modeArraysMatch = doArraysMatch(item.modes, defaultModesArr);
|
|
2844
|
-
return !modeArraysMatch;
|
|
2845
|
-
});
|
|
2846
|
-
if (!modeArraysMatch) {
|
|
2847
|
-
mergedValidators[field].unshift(rule);
|
|
2848
|
-
}
|
|
2849
|
-
});
|
|
2850
|
-
}
|
|
2851
|
-
});
|
|
2852
|
-
Object.entries(countryBasedValidators[country2]).forEach(([field, validators]) => {
|
|
2853
|
-
if (!mergedValidators[field]) {
|
|
2854
|
-
mergedValidators[field] = validators;
|
|
2855
|
-
}
|
|
2856
|
-
});
|
|
2857
|
-
return mergedValidators;
|
|
2858
|
-
}
|
|
2859
|
-
function mergeCountryBasedRulesets(defaultRuleset, countryBasedRuleset, country2) {
|
|
2860
|
-
if (!country2 || !countryBasedRuleset[country2]) {
|
|
2861
|
-
return defaultRuleset;
|
|
2862
|
-
}
|
|
2863
|
-
const mergedRuleset = {};
|
|
2864
|
-
Object.entries(defaultRuleset).forEach(([field, ruleset]) => {
|
|
2865
|
-
const countryBasedFieldRuleset = countryBasedRuleset[country2][field];
|
|
2866
|
-
if (!countryBasedFieldRuleset) {
|
|
2867
|
-
mergedRuleset[field] = ruleset;
|
|
2868
|
-
} else {
|
|
2869
|
-
mergedRuleset[field] = {
|
|
2870
|
-
...ruleset,
|
|
2871
|
-
...countryBasedFieldRuleset
|
|
2872
|
-
};
|
|
2873
|
-
}
|
|
2874
|
-
});
|
|
2875
|
-
Object.entries(countryBasedRuleset[country2]).forEach(([field, ruleset]) => {
|
|
2876
|
-
if (!mergedRuleset[field]) {
|
|
2877
|
-
mergedRuleset[field] = ruleset;
|
|
2878
|
-
}
|
|
2879
|
-
});
|
|
2880
|
-
return mergedRuleset;
|
|
2881
|
-
}
|
|
2882
|
-
const isUndefinedOrNull = (input) => !!(input === void 0 || input === null);
|
|
2883
|
-
const isEmpty = (input) => !!(isUndefinedOrNull(input) || typeof input === "object" && Object.keys(input).length === 0 || typeof input === "string" && /^[\s]*$/.test(input));
|
|
2833
|
+
const isUndefinedOrNull = (input) => input === void 0 || input === null;
|
|
2834
|
+
const isEmpty = (input) => isUndefinedOrNull(input) || typeof input === "object" && Object.keys(input).length === 0 || typeof input === "string" && /^\s*$/.test(input);
|
|
2884
2835
|
const isString = (input) => typeof input === "string" || input instanceof String;
|
|
2885
2836
|
const hasText = (input) => isString(input) && !isEmpty(input);
|
|
2886
2837
|
const SPECIAL_CHARS = "?\\-\\+_=!@#$%^&*(){}~<>\\[\\]\\/\\\\";
|
|
@@ -2891,21 +2842,90 @@ const exactLength = (input, length) => {
|
|
|
2891
2842
|
}
|
|
2892
2843
|
return input.length === length;
|
|
2893
2844
|
};
|
|
2894
|
-
const lengthIsBetween = (input, minLength, maxLength) => (input
|
|
2845
|
+
const lengthIsBetween = (input, minLength, maxLength) => Boolean(input && input.length >= minLength && input.length <= maxLength);
|
|
2895
2846
|
const trimValWithOneSpace = (val) => val.trimStart().replace(/\s+/g, " ");
|
|
2896
2847
|
const _button_component = "";
|
|
2897
2848
|
const _link_component = "";
|
|
2898
|
-
const
|
|
2849
|
+
const Icon$1 = "";
|
|
2850
|
+
let suppressed = false;
|
|
2851
|
+
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
2852
|
+
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
2853
|
+
const createLogger = (namespace) => {
|
|
2854
|
+
const methods = {};
|
|
2855
|
+
consoleMethodsPrefixable.forEach((method) => {
|
|
2856
|
+
methods[method] = (arg1, ...args) => {
|
|
2857
|
+
if (!console[method] || suppressed)
|
|
2858
|
+
return;
|
|
2859
|
+
if (!namespace) {
|
|
2860
|
+
console[method](arg1, ...args);
|
|
2861
|
+
} else if (stringSubstitutionRegex.test(arg1)) {
|
|
2862
|
+
console[method](`[${namespace}] ${arg1}`, ...args);
|
|
2863
|
+
} else {
|
|
2864
|
+
console[method](`[${namespace}]`, arg1, ...args);
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
});
|
|
2868
|
+
return methods;
|
|
2869
|
+
};
|
|
2870
|
+
const icons = {
|
|
2871
|
+
"arrow-left": lazy(() => import("./arrow-left-3d6cd330.mjs")),
|
|
2872
|
+
"arrow-right": lazy(() => import("./arrow-right-994e40f8.mjs")),
|
|
2873
|
+
bin: lazy(() => import("./bin-191739de.mjs")),
|
|
2874
|
+
check: lazy(() => import("./check-b5a70376.mjs")),
|
|
2875
|
+
checkmark: lazy(() => import("./checkmark-fd78da6f.mjs")),
|
|
2876
|
+
"checkmark-small": lazy(() => import("./checkmark-small-bf41309f.mjs")),
|
|
2877
|
+
"chevron-down": lazy(() => import("./chevron-down-df0a3ac6.mjs")),
|
|
2878
|
+
"chevron-right": lazy(() => import("./chevron-right-23ff6e47.mjs")),
|
|
2879
|
+
"chevron-up": lazy(() => import("./chevron-up-abfe0e90.mjs")),
|
|
2880
|
+
company: lazy(() => import("./company-4f71e406.mjs")),
|
|
2881
|
+
contract: lazy(() => import("./contract-5bc99018.mjs")),
|
|
2882
|
+
"controlling-person": lazy(() => import("./controlling-person-88da578f.mjs")),
|
|
2883
|
+
cross: lazy(() => import("./cross-c2431982.mjs")),
|
|
2884
|
+
"decision-maker": lazy(() => import("./decision-maker-a2182544.mjs")),
|
|
2885
|
+
document: lazy(() => import("./document-88abec41.mjs")),
|
|
2886
|
+
download: lazy(() => import("./download-54b1a163.mjs")),
|
|
2887
|
+
edit: lazy(() => import("./edit-e3629680.mjs")),
|
|
2888
|
+
"field-error": lazy(() => import("./field-error-620e1903.mjs")),
|
|
2889
|
+
"info-circle": lazy(() => import("./info-circle-3d2e7ba8.mjs")),
|
|
2890
|
+
"light-bulb": lazy(() => import("./light-bulb-d403fe24.mjs")),
|
|
2891
|
+
location: lazy(() => import("./location-e7c2a8f5.mjs")),
|
|
2892
|
+
"more-horiz": lazy(() => import("./more-horiz-0ca4ec23.mjs")),
|
|
2893
|
+
"new-document": lazy(() => import("./new-document-cfa14b7f.mjs")),
|
|
2894
|
+
owners: lazy(() => import("./owners-a58a9f25.mjs")),
|
|
2895
|
+
payout: lazy(() => import("./payout-575951ec.mjs")),
|
|
2896
|
+
pci: lazy(() => import("./pci-f4b6e5f5.mjs")),
|
|
2897
|
+
plus: lazy(() => import("./plus-25579839.mjs")),
|
|
2898
|
+
remove: lazy(() => import("./remove-6a123f82.mjs")),
|
|
2899
|
+
review: lazy(() => import("./review-14953b30.mjs")),
|
|
2900
|
+
search: lazy(() => import("./search-3edfe795.mjs")),
|
|
2901
|
+
signatory: lazy(() => import("./signatory-c8417fb2.mjs")),
|
|
2902
|
+
store: lazy(() => import("./store-9fc075e6.mjs")),
|
|
2903
|
+
trust: lazy(() => import("./trust-0e40337d.mjs")),
|
|
2904
|
+
warning: lazy(() => import("./warning-bb000c6b.mjs")),
|
|
2905
|
+
wrong: lazy(() => import("./wrong-652db543.mjs"))
|
|
2906
|
+
};
|
|
2907
|
+
const logger$t = createLogger("Icon");
|
|
2899
2908
|
const Icon = ({
|
|
2900
|
-
className
|
|
2909
|
+
className,
|
|
2901
2910
|
name,
|
|
2902
2911
|
testId
|
|
2903
|
-
}) =>
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
}
|
|
2912
|
+
}) => {
|
|
2913
|
+
const LazyLoadedIcon = icons[name];
|
|
2914
|
+
if (!LazyLoadedIcon) {
|
|
2915
|
+
logger$t.error(`No such icon: "${name}"`);
|
|
2916
|
+
return null;
|
|
2917
|
+
}
|
|
2918
|
+
return jsx("span", {
|
|
2919
|
+
className: cx("adyen-kyc-icon", `adyen-kyc-icon-${name}`, className),
|
|
2920
|
+
role: "img",
|
|
2921
|
+
"aria-hidden": true,
|
|
2922
|
+
"data-testid": testId,
|
|
2923
|
+
children: jsx(Suspense, {
|
|
2924
|
+
fallback: null,
|
|
2925
|
+
children: jsx(LazyLoadedIcon, {})
|
|
2926
|
+
})
|
|
2927
|
+
});
|
|
2928
|
+
};
|
|
2909
2929
|
const Spinner$1 = "";
|
|
2910
2930
|
const Spinner = ({
|
|
2911
2931
|
inline = false,
|
|
@@ -3099,26 +3119,6 @@ function useFormRouterContext() {
|
|
|
3099
3119
|
}
|
|
3100
3120
|
return context;
|
|
3101
3121
|
}
|
|
3102
|
-
let suppressed = false;
|
|
3103
|
-
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
3104
|
-
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
3105
|
-
const createLogger = (namespace) => {
|
|
3106
|
-
const methods = {};
|
|
3107
|
-
consoleMethodsPrefixable.forEach((method) => {
|
|
3108
|
-
methods[method] = (arg1, ...args) => {
|
|
3109
|
-
if (!console[method] || suppressed)
|
|
3110
|
-
return;
|
|
3111
|
-
if (!namespace) {
|
|
3112
|
-
console[method](arg1, ...args);
|
|
3113
|
-
} else if (stringSubstitutionRegex.test(arg1)) {
|
|
3114
|
-
console[method](`[${namespace}] ${arg1}`, ...args);
|
|
3115
|
-
} else {
|
|
3116
|
-
console[method](`[${namespace}]`, arg1, ...args);
|
|
3117
|
-
}
|
|
3118
|
-
};
|
|
3119
|
-
});
|
|
3120
|
-
return methods;
|
|
3121
|
-
};
|
|
3122
3122
|
const logger$s = createLogger("Link");
|
|
3123
3123
|
const getIconClass = (icon, external) => {
|
|
3124
3124
|
if (external) {
|
|
@@ -3292,7 +3292,7 @@ function getFormProps(props, innerFormId) {
|
|
|
3292
3292
|
readOnlyFields: ((_g = props.readOnlyFields) == null ? void 0 : _g[innerFormId]) ?? [],
|
|
3293
3293
|
requiredFields: ((_h = props.requiredFields) == null ? void 0 : _h[innerFormId]) ?? [],
|
|
3294
3294
|
optionalFields: ((_i = props.optionalFields) == null ? void 0 : _i[innerFormId]) ?? [],
|
|
3295
|
-
|
|
3295
|
+
obscuredFields: ((_j = props.obscuredFields) == null ? void 0 : _j[innerFormId]) ?? [],
|
|
3296
3296
|
verifyFields: ((_k = props.verifyFields) == null ? void 0 : _k[innerFormId]) ?? [],
|
|
3297
3297
|
formVerificationErrors: ((_m = (_l = props.problems) == null ? void 0 : _l.verificationErrors) == null ? void 0 : _m[innerFormId]) ?? {},
|
|
3298
3298
|
fieldValidationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.validationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
|
|
@@ -3319,7 +3319,7 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3319
3319
|
masks: {},
|
|
3320
3320
|
data: {},
|
|
3321
3321
|
requiredFields: [],
|
|
3322
|
-
|
|
3322
|
+
obscuredFields: [],
|
|
3323
3323
|
optionalFields: [],
|
|
3324
3324
|
readOnlyFields: [],
|
|
3325
3325
|
verifyFields: [],
|
|
@@ -3347,8 +3347,8 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3347
3347
|
if ((_j = props.fieldValidationErrors) == null ? void 0 : _j[field]) {
|
|
3348
3348
|
nestedFormProps.fieldValidationErrors[field] = props.fieldValidationErrors[field];
|
|
3349
3349
|
}
|
|
3350
|
-
if ((_k = props.
|
|
3351
|
-
nestedFormProps.
|
|
3350
|
+
if ((_k = props.obscuredFields) == null ? void 0 : _k.includes(field)) {
|
|
3351
|
+
nestedFormProps.obscuredFields.push(field);
|
|
3352
3352
|
}
|
|
3353
3353
|
if ((_l = props.validators) == null ? void 0 : _l[field]) {
|
|
3354
3354
|
if (!(nestedFormProps == null ? void 0 : nestedFormProps.validators)) {
|
|
@@ -3426,7 +3426,7 @@ const processField = ({
|
|
|
3426
3426
|
value = null,
|
|
3427
3427
|
mode,
|
|
3428
3428
|
defaultData,
|
|
3429
|
-
|
|
3429
|
+
obscuredFields,
|
|
3430
3430
|
fieldContext,
|
|
3431
3431
|
formatters,
|
|
3432
3432
|
staticValidate,
|
|
@@ -3435,7 +3435,7 @@ const processField = ({
|
|
|
3435
3435
|
var _a, _b;
|
|
3436
3436
|
const formatterFn = ((_a = formatters == null ? void 0 : formatters[key]) == null ? void 0 : _a.formatter) ? (_b = formatters[key]) == null ? void 0 : _b.formatter : formatters == null ? void 0 : formatters[key];
|
|
3437
3437
|
const formattedValue = formatterFn && typeof formatterFn === "function" ? formatterFn(value, fieldContext) : value;
|
|
3438
|
-
const shouldValidateField = !((
|
|
3438
|
+
const shouldValidateField = !((obscuredFields == null ? void 0 : obscuredFields.includes(key)) && (defaultData == null ? void 0 : defaultData[key]) === value && !!(defaultData == null ? void 0 : defaultData[key]));
|
|
3439
3439
|
if (shouldValidateField && value) {
|
|
3440
3440
|
asyncValidate(key, fieldContext.state, mode);
|
|
3441
3441
|
}
|
|
@@ -3454,7 +3454,7 @@ function init({
|
|
|
3454
3454
|
schema,
|
|
3455
3455
|
defaultData,
|
|
3456
3456
|
fieldProblems,
|
|
3457
|
-
|
|
3457
|
+
obscuredFields,
|
|
3458
3458
|
formatters,
|
|
3459
3459
|
staticValidate,
|
|
3460
3460
|
asyncValidate
|
|
@@ -3466,7 +3466,7 @@ function init({
|
|
|
3466
3466
|
mode: "blur",
|
|
3467
3467
|
formatters,
|
|
3468
3468
|
defaultData,
|
|
3469
|
-
|
|
3469
|
+
obscuredFields,
|
|
3470
3470
|
fieldContext: {
|
|
3471
3471
|
state: {
|
|
3472
3472
|
data: defaultData
|
|
@@ -3522,7 +3522,7 @@ function init({
|
|
|
3522
3522
|
valid: {},
|
|
3523
3523
|
errors: {},
|
|
3524
3524
|
fieldProblems: {},
|
|
3525
|
-
|
|
3525
|
+
obscuredFields
|
|
3526
3526
|
});
|
|
3527
3527
|
return formData;
|
|
3528
3528
|
}
|
|
@@ -3539,7 +3539,7 @@ function reducer({
|
|
|
3539
3539
|
schema,
|
|
3540
3540
|
selectedSchema,
|
|
3541
3541
|
formValue,
|
|
3542
|
-
|
|
3542
|
+
obscuredFields,
|
|
3543
3543
|
fieldProblems,
|
|
3544
3544
|
defaultData
|
|
3545
3545
|
}) => {
|
|
@@ -3602,7 +3602,7 @@ function reducer({
|
|
|
3602
3602
|
schema,
|
|
3603
3603
|
defaultData,
|
|
3604
3604
|
fieldProblems,
|
|
3605
|
-
|
|
3605
|
+
obscuredFields,
|
|
3606
3606
|
staticValidate,
|
|
3607
3607
|
asyncValidate
|
|
3608
3608
|
});
|
|
@@ -3639,7 +3639,7 @@ function reducer({
|
|
|
3639
3639
|
value,
|
|
3640
3640
|
mode,
|
|
3641
3641
|
defaultData,
|
|
3642
|
-
|
|
3642
|
+
obscuredFields,
|
|
3643
3643
|
formatters,
|
|
3644
3644
|
fieldContext: {
|
|
3645
3645
|
state: state2
|
|
@@ -3702,7 +3702,7 @@ function reducer({
|
|
|
3702
3702
|
value: state2.data[cur],
|
|
3703
3703
|
mode: "blur",
|
|
3704
3704
|
defaultData,
|
|
3705
|
-
|
|
3705
|
+
obscuredFields,
|
|
3706
3706
|
formatters,
|
|
3707
3707
|
fieldContext: {
|
|
3708
3708
|
state: state2
|
|
@@ -3834,7 +3834,7 @@ function useForm({
|
|
|
3834
3834
|
rules: rules2,
|
|
3835
3835
|
asyncRules,
|
|
3836
3836
|
fieldProblems,
|
|
3837
|
-
|
|
3837
|
+
obscuredFields,
|
|
3838
3838
|
optionalFields,
|
|
3839
3839
|
formatters,
|
|
3840
3840
|
shouldValidate = false
|
|
@@ -3862,11 +3862,11 @@ function useForm({
|
|
|
3862
3862
|
schema: getSchema,
|
|
3863
3863
|
defaultData,
|
|
3864
3864
|
fieldProblems,
|
|
3865
|
-
|
|
3865
|
+
obscuredFields,
|
|
3866
3866
|
formatters,
|
|
3867
3867
|
staticValidate: triggerStaticValidation,
|
|
3868
3868
|
asyncValidate: triggerAsyncValidation
|
|
3869
|
-
}), [getSchema, defaultData, fieldProblems,
|
|
3869
|
+
}), [getSchema, defaultData, fieldProblems, obscuredFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
|
|
3870
3870
|
const [state2, dispatch] = useReducer(getReducer(), getInitialData(), init);
|
|
3871
3871
|
const isValid = useMemo(() => {
|
|
3872
3872
|
var _a;
|
|
@@ -3916,17 +3916,17 @@ function useForm({
|
|
|
3916
3916
|
value,
|
|
3917
3917
|
mode,
|
|
3918
3918
|
defaultData,
|
|
3919
|
-
|
|
3919
|
+
obscuredFields
|
|
3920
3920
|
});
|
|
3921
|
-
}, [defaultData,
|
|
3921
|
+
}, [defaultData, obscuredFields, getTargetValue]);
|
|
3922
3922
|
const triggerValidation = useCallback((selectedSchema) => {
|
|
3923
3923
|
dispatch({
|
|
3924
3924
|
type: "validateForm",
|
|
3925
3925
|
selectedSchema,
|
|
3926
3926
|
defaultData,
|
|
3927
|
-
|
|
3927
|
+
obscuredFields
|
|
3928
3928
|
});
|
|
3929
|
-
}, [defaultData,
|
|
3929
|
+
}, [defaultData, obscuredFields]);
|
|
3930
3930
|
useEffect(() => {
|
|
3931
3931
|
const newSchema = getRequiredFields(state2.data);
|
|
3932
3932
|
if (!doArraysMatch(state2.schema, newSchema)) {
|
|
@@ -4756,12 +4756,9 @@ const SelectButtonContentSingle = ({
|
|
|
4756
4756
|
}) => {
|
|
4757
4757
|
const activeSingle = active.pop();
|
|
4758
4758
|
return !showList || !filterable ? jsxs(Fragment, {
|
|
4759
|
-
children: [(activeSingle == null ? void 0 : activeSingle.
|
|
4759
|
+
children: [(activeSingle == null ? void 0 : activeSingle.icon) && jsx("span", {
|
|
4760
4760
|
className: "adyen-kyc-dropdown-button__icon",
|
|
4761
|
-
|
|
4762
|
-
children: jsx("use", {
|
|
4763
|
-
href: activeSingle.sprite
|
|
4764
|
-
})
|
|
4761
|
+
children: activeSingle.icon
|
|
4765
4762
|
}), isSearch && jsx(Icon, {
|
|
4766
4763
|
name: "search",
|
|
4767
4764
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
@@ -4883,20 +4880,10 @@ const SelectListItem = ({
|
|
|
4883
4880
|
checked: selected,
|
|
4884
4881
|
name: `adyen-kyc-dropdown-element__checkbox adyen-kyc-dropdown-element__checkbox--${item.id}`
|
|
4885
4882
|
}) : children ? [children] : jsxs(Fragment, {
|
|
4886
|
-
children: [
|
|
4887
|
-
className: "adyen-kyc-dropdown-element__icon",
|
|
4888
|
-
alt: item.name,
|
|
4889
|
-
src: item.icon
|
|
4890
|
-
}) : jsx("svg", {
|
|
4883
|
+
children: [item.icon && jsx("span", {
|
|
4891
4884
|
className: "adyen-kyc-dropdown-element__icon",
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
href: item.sprite
|
|
4895
|
-
})
|
|
4896
|
-
}), !item.description ? jsx("span", {
|
|
4897
|
-
className: "adyen-kyc-dropdown-element__label",
|
|
4898
|
-
children: item.name
|
|
4899
|
-
}) : jsxs(Fragment, {
|
|
4885
|
+
children: item.icon
|
|
4886
|
+
}), item.description ? jsxs(Fragment, {
|
|
4900
4887
|
children: [jsx("span", {
|
|
4901
4888
|
className: "adyen-kyc-dropdown-element__label adl-u-font-weight-semi-bold",
|
|
4902
4889
|
children: item.name
|
|
@@ -4904,6 +4891,9 @@ const SelectListItem = ({
|
|
|
4904
4891
|
className: "adyen-kyc-dropdown-element-description__text",
|
|
4905
4892
|
children: item.description
|
|
4906
4893
|
})]
|
|
4894
|
+
}) : jsx("span", {
|
|
4895
|
+
className: "adyen-kyc-dropdown-element__label",
|
|
4896
|
+
children: item.name
|
|
4907
4897
|
})]
|
|
4908
4898
|
})
|
|
4909
4899
|
});
|
|
@@ -5204,7 +5194,308 @@ const Select = ({
|
|
|
5204
5194
|
})]
|
|
5205
5195
|
});
|
|
5206
5196
|
};
|
|
5207
|
-
const
|
|
5197
|
+
const Flag$1 = "";
|
|
5198
|
+
const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
|
|
5199
|
+
function useIsElementVisible(ref, fallback = true) {
|
|
5200
|
+
const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
|
|
5201
|
+
const observerRef = useRef();
|
|
5202
|
+
useEffect(() => {
|
|
5203
|
+
if (!isIntersectionObserverSupported)
|
|
5204
|
+
return;
|
|
5205
|
+
observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
|
|
5206
|
+
}, []);
|
|
5207
|
+
useEffect(() => {
|
|
5208
|
+
var _a;
|
|
5209
|
+
if (!ref.current)
|
|
5210
|
+
return;
|
|
5211
|
+
(_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
|
|
5212
|
+
return () => {
|
|
5213
|
+
var _a2;
|
|
5214
|
+
(_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
|
|
5215
|
+
};
|
|
5216
|
+
}, [ref]);
|
|
5217
|
+
return isOnScreen;
|
|
5218
|
+
}
|
|
5219
|
+
const logger$p = createLogger("Flag");
|
|
5220
|
+
const flagImports = /* @__PURE__ */ Object.assign({
|
|
5221
|
+
"../../../../assets/flags/ad.svg": () => import("./ad-e09b987a.mjs"),
|
|
5222
|
+
"../../../../assets/flags/ae.svg": () => import("./ae-8ca1be27.mjs"),
|
|
5223
|
+
"../../../../assets/flags/af.svg": () => import("./af-342e1bf5.mjs"),
|
|
5224
|
+
"../../../../assets/flags/ag.svg": () => import("./ag-997e3f88.mjs"),
|
|
5225
|
+
"../../../../assets/flags/ai.svg": () => import("./ai-402dc201.mjs"),
|
|
5226
|
+
"../../../../assets/flags/al.svg": () => import("./al-38b31dad.mjs"),
|
|
5227
|
+
"../../../../assets/flags/am.svg": () => import("./am-bc1403ea.mjs"),
|
|
5228
|
+
"../../../../assets/flags/an.svg": () => import("./an-70336f96.mjs"),
|
|
5229
|
+
"../../../../assets/flags/ao.svg": () => import("./ao-eedf3279.mjs"),
|
|
5230
|
+
"../../../../assets/flags/aq.svg": () => import("./aq-2220e7e0.mjs"),
|
|
5231
|
+
"../../../../assets/flags/ar.svg": () => import("./ar-87abe42d.mjs"),
|
|
5232
|
+
"../../../../assets/flags/as.svg": () => import("./as-6e35c5ec.mjs"),
|
|
5233
|
+
"../../../../assets/flags/at.svg": () => import("./at-4310d424.mjs"),
|
|
5234
|
+
"../../../../assets/flags/au.svg": () => import("./au-50f94ba8.mjs"),
|
|
5235
|
+
"../../../../assets/flags/aw.svg": () => import("./aw-97918c9f.mjs"),
|
|
5236
|
+
"../../../../assets/flags/ax.svg": () => import("./ax-567f3585.mjs"),
|
|
5237
|
+
"../../../../assets/flags/az.svg": () => import("./az-85dbb96d.mjs"),
|
|
5238
|
+
"../../../../assets/flags/ba.svg": () => import("./ba-8afe4a33.mjs"),
|
|
5239
|
+
"../../../../assets/flags/bb.svg": () => import("./bb-c4d79528.mjs"),
|
|
5240
|
+
"../../../../assets/flags/bd.svg": () => import("./bd-0f87f359.mjs"),
|
|
5241
|
+
"../../../../assets/flags/be.svg": () => import("./be-63be2126.mjs"),
|
|
5242
|
+
"../../../../assets/flags/bf.svg": () => import("./bf-621f8737.mjs"),
|
|
5243
|
+
"../../../../assets/flags/bg.svg": () => import("./bg-30061757.mjs"),
|
|
5244
|
+
"../../../../assets/flags/bh.svg": () => import("./bh-a858ad79.mjs"),
|
|
5245
|
+
"../../../../assets/flags/bi.svg": () => import("./bi-c08e68ba.mjs"),
|
|
5246
|
+
"../../../../assets/flags/bj.svg": () => import("./bj-8e17226d.mjs"),
|
|
5247
|
+
"../../../../assets/flags/bl.svg": () => import("./bl-b7b32ae6.mjs"),
|
|
5248
|
+
"../../../../assets/flags/bm.svg": () => import("./bm-b728ab56.mjs"),
|
|
5249
|
+
"../../../../assets/flags/bn.svg": () => import("./bn-c706c05b.mjs"),
|
|
5250
|
+
"../../../../assets/flags/bo.svg": () => import("./bo-1fad8399.mjs"),
|
|
5251
|
+
"../../../../assets/flags/br.svg": () => import("./br-11b9980d.mjs"),
|
|
5252
|
+
"../../../../assets/flags/bs.svg": () => import("./bs-090f5bd7.mjs"),
|
|
5253
|
+
"../../../../assets/flags/bt.svg": () => import("./bt-c56334d3.mjs"),
|
|
5254
|
+
"../../../../assets/flags/bv.svg": () => import("./bv-570dcd11.mjs"),
|
|
5255
|
+
"../../../../assets/flags/bw.svg": () => import("./bw-5de93ae1.mjs"),
|
|
5256
|
+
"../../../../assets/flags/by.svg": () => import("./by-e2457131.mjs"),
|
|
5257
|
+
"../../../../assets/flags/bz.svg": () => import("./bz-30bbd0de.mjs"),
|
|
5258
|
+
"../../../../assets/flags/ca.svg": () => import("./ca-39c0e436.mjs"),
|
|
5259
|
+
"../../../../assets/flags/cc.svg": () => import("./cc-ddc2a1db.mjs"),
|
|
5260
|
+
"../../../../assets/flags/cd.svg": () => import("./cd-eab01270.mjs"),
|
|
5261
|
+
"../../../../assets/flags/cf.svg": () => import("./cf-50f7241b.mjs"),
|
|
5262
|
+
"../../../../assets/flags/cg.svg": () => import("./cg-e87aa981.mjs"),
|
|
5263
|
+
"../../../../assets/flags/ch.svg": () => import("./ch-9637f347.mjs"),
|
|
5264
|
+
"../../../../assets/flags/ci.svg": () => import("./ci-41814a2b.mjs"),
|
|
5265
|
+
"../../../../assets/flags/ck.svg": () => import("./ck-60b0d769.mjs"),
|
|
5266
|
+
"../../../../assets/flags/cl.svg": () => import("./cl-931fd7da.mjs"),
|
|
5267
|
+
"../../../../assets/flags/cm.svg": () => import("./cm-55c02792.mjs"),
|
|
5268
|
+
"../../../../assets/flags/cn.svg": () => import("./cn-1526dac5.mjs"),
|
|
5269
|
+
"../../../../assets/flags/co.svg": () => import("./co-c7ada338.mjs"),
|
|
5270
|
+
"../../../../assets/flags/cr.svg": () => import("./cr-bac1e451.mjs"),
|
|
5271
|
+
"../../../../assets/flags/cu.svg": () => import("./cu-af98b602.mjs"),
|
|
5272
|
+
"../../../../assets/flags/cv.svg": () => import("./cv-575fe55b.mjs"),
|
|
5273
|
+
"../../../../assets/flags/cw.svg": () => import("./cw-6f1c60ce.mjs"),
|
|
5274
|
+
"../../../../assets/flags/cx.svg": () => import("./cx-7687e3a9.mjs"),
|
|
5275
|
+
"../../../../assets/flags/cy.svg": () => import("./cy-eeff5dbd.mjs"),
|
|
5276
|
+
"../../../../assets/flags/cz.svg": () => import("./cz-24eff96c.mjs"),
|
|
5277
|
+
"../../../../assets/flags/de.svg": () => import("./de-8e2b6f6c.mjs"),
|
|
5278
|
+
"../../../../assets/flags/dj.svg": () => import("./dj-e0f41411.mjs"),
|
|
5279
|
+
"../../../../assets/flags/dk.svg": () => import("./dk-a5073c43.mjs"),
|
|
5280
|
+
"../../../../assets/flags/dm.svg": () => import("./dm-9a3ee195.mjs"),
|
|
5281
|
+
"../../../../assets/flags/do.svg": () => import("./do-5aa635df.mjs"),
|
|
5282
|
+
"../../../../assets/flags/dz.svg": () => import("./dz-7452e74d.mjs"),
|
|
5283
|
+
"../../../../assets/flags/ec.svg": () => import("./ec-c68c940e.mjs"),
|
|
5284
|
+
"../../../../assets/flags/ee.svg": () => import("./ee-1dbd9a40.mjs"),
|
|
5285
|
+
"../../../../assets/flags/eg.svg": () => import("./eg-40f9b2b5.mjs"),
|
|
5286
|
+
"../../../../assets/flags/eh.svg": () => import("./eh-51f4bae2.mjs"),
|
|
5287
|
+
"../../../../assets/flags/er.svg": () => import("./er-61cda111.mjs"),
|
|
5288
|
+
"../../../../assets/flags/es.svg": () => import("./es-78250575.mjs"),
|
|
5289
|
+
"../../../../assets/flags/et.svg": () => import("./et-63dc8d1e.mjs"),
|
|
5290
|
+
"../../../../assets/flags/fi.svg": () => import("./fi-e2d1f3df.mjs"),
|
|
5291
|
+
"../../../../assets/flags/fj.svg": () => import("./fj-02f497c5.mjs"),
|
|
5292
|
+
"../../../../assets/flags/fk.svg": () => import("./fk-56af40af.mjs"),
|
|
5293
|
+
"../../../../assets/flags/fm.svg": () => import("./fm-0292f2ce.mjs"),
|
|
5294
|
+
"../../../../assets/flags/fo.svg": () => import("./fo-5063373c.mjs"),
|
|
5295
|
+
"../../../../assets/flags/fr.svg": () => import("./fr-fb20da2b.mjs"),
|
|
5296
|
+
"../../../../assets/flags/fx.svg": () => import("./fx-ca4da212.mjs"),
|
|
5297
|
+
"../../../../assets/flags/ga.svg": () => import("./ga-31f5afca.mjs"),
|
|
5298
|
+
"../../../../assets/flags/gb.svg": () => import("./gb-4ae48840.mjs"),
|
|
5299
|
+
"../../../../assets/flags/gd.svg": () => import("./gd-25e40717.mjs"),
|
|
5300
|
+
"../../../../assets/flags/ge.svg": () => import("./ge-939c150e.mjs"),
|
|
5301
|
+
"../../../../assets/flags/gf.svg": () => import("./gf-b8736c20.mjs"),
|
|
5302
|
+
"../../../../assets/flags/gg.svg": () => import("./gg-4c532713.mjs"),
|
|
5303
|
+
"../../../../assets/flags/gh.svg": () => import("./gh-7b187c5f.mjs"),
|
|
5304
|
+
"../../../../assets/flags/gi.svg": () => import("./gi-e59b72be.mjs"),
|
|
5305
|
+
"../../../../assets/flags/gl.svg": () => import("./gl-31e9b8e5.mjs"),
|
|
5306
|
+
"../../../../assets/flags/gm.svg": () => import("./gm-975999b2.mjs"),
|
|
5307
|
+
"../../../../assets/flags/gn.svg": () => import("./gn-3701984d.mjs"),
|
|
5308
|
+
"../../../../assets/flags/gp.svg": () => import("./gp-40fbae20.mjs"),
|
|
5309
|
+
"../../../../assets/flags/gq.svg": () => import("./gq-86021eca.mjs"),
|
|
5310
|
+
"../../../../assets/flags/gr.svg": () => import("./gr-3b0c7597.mjs"),
|
|
5311
|
+
"../../../../assets/flags/gs.svg": () => import("./gs-00bc8674.mjs"),
|
|
5312
|
+
"../../../../assets/flags/gt.svg": () => import("./gt-05eb5f87.mjs"),
|
|
5313
|
+
"../../../../assets/flags/gu.svg": () => import("./gu-497f9b0b.mjs"),
|
|
5314
|
+
"../../../../assets/flags/gw.svg": () => import("./gw-b54f1365.mjs"),
|
|
5315
|
+
"../../../../assets/flags/gy.svg": () => import("./gy-e917fca1.mjs"),
|
|
5316
|
+
"../../../../assets/flags/hk.svg": () => import("./hk-ddd60484.mjs"),
|
|
5317
|
+
"../../../../assets/flags/hm.svg": () => import("./hm-03a2df0b.mjs"),
|
|
5318
|
+
"../../../../assets/flags/hn.svg": () => import("./hn-1748eed1.mjs"),
|
|
5319
|
+
"../../../../assets/flags/hr.svg": () => import("./hr-6b1bd9c8.mjs"),
|
|
5320
|
+
"../../../../assets/flags/ht.svg": () => import("./ht-13a1ab82.mjs"),
|
|
5321
|
+
"../../../../assets/flags/hu.svg": () => import("./hu-81872148.mjs"),
|
|
5322
|
+
"../../../../assets/flags/id.svg": () => import("./id-2c9c4235.mjs"),
|
|
5323
|
+
"../../../../assets/flags/ie.svg": () => import("./ie-ef96fd76.mjs"),
|
|
5324
|
+
"../../../../assets/flags/il.svg": () => import("./il-20c3ccd4.mjs"),
|
|
5325
|
+
"../../../../assets/flags/im.svg": () => import("./im-eb7a7143.mjs"),
|
|
5326
|
+
"../../../../assets/flags/in.svg": () => import("./in-67c16223.mjs"),
|
|
5327
|
+
"../../../../assets/flags/io.svg": () => import("./io-9adeb690.mjs"),
|
|
5328
|
+
"../../../../assets/flags/iq.svg": () => import("./iq-61ffc408.mjs"),
|
|
5329
|
+
"../../../../assets/flags/ir.svg": () => import("./ir-bc3341c2.mjs"),
|
|
5330
|
+
"../../../../assets/flags/is.svg": () => import("./is-7c19d0ff.mjs"),
|
|
5331
|
+
"../../../../assets/flags/it.svg": () => import("./it-fa0dd04c.mjs"),
|
|
5332
|
+
"../../../../assets/flags/je.svg": () => import("./je-a29e157d.mjs"),
|
|
5333
|
+
"../../../../assets/flags/jm.svg": () => import("./jm-53f8ddb8.mjs"),
|
|
5334
|
+
"../../../../assets/flags/jo.svg": () => import("./jo-89d49ef8.mjs"),
|
|
5335
|
+
"../../../../assets/flags/jp.svg": () => import("./jp-f97d7972.mjs"),
|
|
5336
|
+
"../../../../assets/flags/ke.svg": () => import("./ke-545eb9cb.mjs"),
|
|
5337
|
+
"../../../../assets/flags/kg.svg": () => import("./kg-066a524e.mjs"),
|
|
5338
|
+
"../../../../assets/flags/kh.svg": () => import("./kh-39620e7b.mjs"),
|
|
5339
|
+
"../../../../assets/flags/ki.svg": () => import("./ki-900be23e.mjs"),
|
|
5340
|
+
"../../../../assets/flags/km.svg": () => import("./km-b4e8c8ba.mjs"),
|
|
5341
|
+
"../../../../assets/flags/kn.svg": () => import("./kn-8ec9ee75.mjs"),
|
|
5342
|
+
"../../../../assets/flags/kp.svg": () => import("./kp-1cdc64be.mjs"),
|
|
5343
|
+
"../../../../assets/flags/kr.svg": () => import("./kr-53eac37f.mjs"),
|
|
5344
|
+
"../../../../assets/flags/kw.svg": () => import("./kw-c4347b38.mjs"),
|
|
5345
|
+
"../../../../assets/flags/ky.svg": () => import("./ky-a104dc86.mjs"),
|
|
5346
|
+
"../../../../assets/flags/kz.svg": () => import("./kz-d64ba71d.mjs"),
|
|
5347
|
+
"../../../../assets/flags/la.svg": () => import("./la-04577eb2.mjs"),
|
|
5348
|
+
"../../../../assets/flags/lb.svg": () => import("./lb-c2470dd0.mjs"),
|
|
5349
|
+
"../../../../assets/flags/lc.svg": () => import("./lc-58fb8706.mjs"),
|
|
5350
|
+
"../../../../assets/flags/li.svg": () => import("./li-c887f5b7.mjs"),
|
|
5351
|
+
"../../../../assets/flags/lk.svg": () => import("./lk-d10f8746.mjs"),
|
|
5352
|
+
"../../../../assets/flags/lr.svg": () => import("./lr-8422af8e.mjs"),
|
|
5353
|
+
"../../../../assets/flags/ls.svg": () => import("./ls-bdcefbbc.mjs"),
|
|
5354
|
+
"../../../../assets/flags/lt.svg": () => import("./lt-07e70fec.mjs"),
|
|
5355
|
+
"../../../../assets/flags/lu.svg": () => import("./lu-b7c93ece.mjs"),
|
|
5356
|
+
"../../../../assets/flags/lv.svg": () => import("./lv-97900494.mjs"),
|
|
5357
|
+
"../../../../assets/flags/ly.svg": () => import("./ly-86ceab07.mjs"),
|
|
5358
|
+
"../../../../assets/flags/ma.svg": () => import("./ma-21b21bdf.mjs"),
|
|
5359
|
+
"../../../../assets/flags/mc.svg": () => import("./mc-f23b73f0.mjs"),
|
|
5360
|
+
"../../../../assets/flags/md.svg": () => import("./md-82ed1b49.mjs"),
|
|
5361
|
+
"../../../../assets/flags/me.svg": () => import("./me-c45ff596.mjs"),
|
|
5362
|
+
"../../../../assets/flags/mf.svg": () => import("./mf-11563bd1.mjs"),
|
|
5363
|
+
"../../../../assets/flags/mg.svg": () => import("./mg-f5f0546b.mjs"),
|
|
5364
|
+
"../../../../assets/flags/mh.svg": () => import("./mh-06a860ed.mjs"),
|
|
5365
|
+
"../../../../assets/flags/mk.svg": () => import("./mk-91356e13.mjs"),
|
|
5366
|
+
"../../../../assets/flags/ml.svg": () => import("./ml-c3f2014e.mjs"),
|
|
5367
|
+
"../../../../assets/flags/mm.svg": () => import("./mm-d138bd76.mjs"),
|
|
5368
|
+
"../../../../assets/flags/mn.svg": () => import("./mn-9c4664d8.mjs"),
|
|
5369
|
+
"../../../../assets/flags/mo.svg": () => import("./mo-54bd2fbe.mjs"),
|
|
5370
|
+
"../../../../assets/flags/mp.svg": () => import("./mp-796516e8.mjs"),
|
|
5371
|
+
"../../../../assets/flags/mq.svg": () => import("./mq-3511a92a.mjs"),
|
|
5372
|
+
"../../../../assets/flags/mr.svg": () => import("./mr-a4b18b6d.mjs"),
|
|
5373
|
+
"../../../../assets/flags/ms.svg": () => import("./ms-91e4dcef.mjs"),
|
|
5374
|
+
"../../../../assets/flags/mt.svg": () => import("./mt-9b58b6a6.mjs"),
|
|
5375
|
+
"../../../../assets/flags/mu.svg": () => import("./mu-2307760c.mjs"),
|
|
5376
|
+
"../../../../assets/flags/mv.svg": () => import("./mv-32c9699b.mjs"),
|
|
5377
|
+
"../../../../assets/flags/mw.svg": () => import("./mw-2b9505ac.mjs"),
|
|
5378
|
+
"../../../../assets/flags/mx.svg": () => import("./mx-98a49b74.mjs"),
|
|
5379
|
+
"../../../../assets/flags/my.svg": () => import("./my-217f9384.mjs"),
|
|
5380
|
+
"../../../../assets/flags/mz.svg": () => import("./mz-92e1e39c.mjs"),
|
|
5381
|
+
"../../../../assets/flags/na.svg": () => import("./na-3c30775f.mjs"),
|
|
5382
|
+
"../../../../assets/flags/nc.svg": () => import("./nc-c80aff50.mjs"),
|
|
5383
|
+
"../../../../assets/flags/ne.svg": () => import("./ne-b38208ab.mjs"),
|
|
5384
|
+
"../../../../assets/flags/nf.svg": () => import("./nf-780a37dd.mjs"),
|
|
5385
|
+
"../../../../assets/flags/ng.svg": () => import("./ng-f5ea4118.mjs"),
|
|
5386
|
+
"../../../../assets/flags/ni.svg": () => import("./ni-60b41460.mjs"),
|
|
5387
|
+
"../../../../assets/flags/nl.svg": () => import("./nl-975a8624.mjs"),
|
|
5388
|
+
"../../../../assets/flags/no.svg": () => import("./no-952bf512.mjs"),
|
|
5389
|
+
"../../../../assets/flags/np.svg": () => import("./np-5135aa90.mjs"),
|
|
5390
|
+
"../../../../assets/flags/nr.svg": () => import("./nr-cecf1f05.mjs"),
|
|
5391
|
+
"../../../../assets/flags/nu.svg": () => import("./nu-c1ad2dc9.mjs"),
|
|
5392
|
+
"../../../../assets/flags/nz.svg": () => import("./nz-70a6e29f.mjs"),
|
|
5393
|
+
"../../../../assets/flags/om.svg": () => import("./om-e5c99d1e.mjs"),
|
|
5394
|
+
"../../../../assets/flags/pa.svg": () => import("./pa-0e401aff.mjs"),
|
|
5395
|
+
"../../../../assets/flags/pe.svg": () => import("./pe-823d3b3f.mjs"),
|
|
5396
|
+
"../../../../assets/flags/pf.svg": () => import("./pf-5c60fe59.mjs"),
|
|
5397
|
+
"../../../../assets/flags/pg.svg": () => import("./pg-71e8aaec.mjs"),
|
|
5398
|
+
"../../../../assets/flags/ph.svg": () => import("./ph-52f55ac4.mjs"),
|
|
5399
|
+
"../../../../assets/flags/pk.svg": () => import("./pk-372b07db.mjs"),
|
|
5400
|
+
"../../../../assets/flags/pl.svg": () => import("./pl-2c472f58.mjs"),
|
|
5401
|
+
"../../../../assets/flags/pm.svg": () => import("./pm-2195603b.mjs"),
|
|
5402
|
+
"../../../../assets/flags/pn.svg": () => import("./pn-ec73a623.mjs"),
|
|
5403
|
+
"../../../../assets/flags/pr.svg": () => import("./pr-8f159ad6.mjs"),
|
|
5404
|
+
"../../../../assets/flags/ps.svg": () => import("./ps-34dd64b7.mjs"),
|
|
5405
|
+
"../../../../assets/flags/pt.svg": () => import("./pt-b210cd4c.mjs"),
|
|
5406
|
+
"../../../../assets/flags/pw.svg": () => import("./pw-a474545d.mjs"),
|
|
5407
|
+
"../../../../assets/flags/py.svg": () => import("./py-e271f15f.mjs"),
|
|
5408
|
+
"../../../../assets/flags/qa.svg": () => import("./qa-a7ad70ed.mjs"),
|
|
5409
|
+
"../../../../assets/flags/re.svg": () => import("./re-a1440f32.mjs"),
|
|
5410
|
+
"../../../../assets/flags/ro.svg": () => import("./ro-8a071708.mjs"),
|
|
5411
|
+
"../../../../assets/flags/rs.svg": () => import("./rs-f3ea0f97.mjs"),
|
|
5412
|
+
"../../../../assets/flags/ru.svg": () => import("./ru-edd59839.mjs"),
|
|
5413
|
+
"../../../../assets/flags/rw.svg": () => import("./rw-df210dff.mjs"),
|
|
5414
|
+
"../../../../assets/flags/sa.svg": () => import("./sa-18c28dc4.mjs"),
|
|
5415
|
+
"../../../../assets/flags/sb.svg": () => import("./sb-35c0ab8d.mjs"),
|
|
5416
|
+
"../../../../assets/flags/sc.svg": () => import("./sc-82eb7101.mjs"),
|
|
5417
|
+
"../../../../assets/flags/sd.svg": () => import("./sd-dc5fb244.mjs"),
|
|
5418
|
+
"../../../../assets/flags/se.svg": () => import("./se-0413b6f1.mjs"),
|
|
5419
|
+
"../../../../assets/flags/sg.svg": () => import("./sg-8ff78597.mjs"),
|
|
5420
|
+
"../../../../assets/flags/sh.svg": () => import("./sh-7b636341.mjs"),
|
|
5421
|
+
"../../../../assets/flags/si.svg": () => import("./si-2c09bba0.mjs"),
|
|
5422
|
+
"../../../../assets/flags/sj.svg": () => import("./sj-8aff2627.mjs"),
|
|
5423
|
+
"../../../../assets/flags/sk.svg": () => import("./sk-8da1fee7.mjs"),
|
|
5424
|
+
"../../../../assets/flags/sl.svg": () => import("./sl-92cb9116.mjs"),
|
|
5425
|
+
"../../../../assets/flags/sm.svg": () => import("./sm-6fd64a6a.mjs"),
|
|
5426
|
+
"../../../../assets/flags/sn.svg": () => import("./sn-57e8c34b.mjs"),
|
|
5427
|
+
"../../../../assets/flags/so.svg": () => import("./so-f2f0ac03.mjs"),
|
|
5428
|
+
"../../../../assets/flags/sr.svg": () => import("./sr-7869b748.mjs"),
|
|
5429
|
+
"../../../../assets/flags/ss.svg": () => import("./ss-8e9c79ca.mjs"),
|
|
5430
|
+
"../../../../assets/flags/st.svg": () => import("./st-6b3e911c.mjs"),
|
|
5431
|
+
"../../../../assets/flags/sv.svg": () => import("./sv-922ba5ea.mjs"),
|
|
5432
|
+
"../../../../assets/flags/sx.svg": () => import("./sx-c078bfd1.mjs"),
|
|
5433
|
+
"../../../../assets/flags/sy.svg": () => import("./sy-995ec1ee.mjs"),
|
|
5434
|
+
"../../../../assets/flags/sz.svg": () => import("./sz-da33c6e8.mjs"),
|
|
5435
|
+
"../../../../assets/flags/tc.svg": () => import("./tc-1a465526.mjs"),
|
|
5436
|
+
"../../../../assets/flags/td.svg": () => import("./td-a7ff3830.mjs"),
|
|
5437
|
+
"../../../../assets/flags/tf.svg": () => import("./tf-c71eed4a.mjs"),
|
|
5438
|
+
"../../../../assets/flags/tg.svg": () => import("./tg-613f7f5a.mjs"),
|
|
5439
|
+
"../../../../assets/flags/th.svg": () => import("./th-f517ca34.mjs"),
|
|
5440
|
+
"../../../../assets/flags/tj.svg": () => import("./tj-b99ac64f.mjs"),
|
|
5441
|
+
"../../../../assets/flags/tk.svg": () => import("./tk-c0dfeac1.mjs"),
|
|
5442
|
+
"../../../../assets/flags/tl.svg": () => import("./tl-35cc3595.mjs"),
|
|
5443
|
+
"../../../../assets/flags/tm.svg": () => import("./tm-0deecc32.mjs"),
|
|
5444
|
+
"../../../../assets/flags/tn.svg": () => import("./tn-190a49a0.mjs"),
|
|
5445
|
+
"../../../../assets/flags/to.svg": () => import("./to-790cac18.mjs"),
|
|
5446
|
+
"../../../../assets/flags/tr.svg": () => import("./tr-1db5a437.mjs"),
|
|
5447
|
+
"../../../../assets/flags/tt.svg": () => import("./tt-85ae901c.mjs"),
|
|
5448
|
+
"../../../../assets/flags/tv.svg": () => import("./tv-9f2b4198.mjs"),
|
|
5449
|
+
"../../../../assets/flags/tw.svg": () => import("./tw-74aa27b3.mjs"),
|
|
5450
|
+
"../../../../assets/flags/tz.svg": () => import("./tz-2a5cf5e6.mjs"),
|
|
5451
|
+
"../../../../assets/flags/ua.svg": () => import("./ua-9fedceaa.mjs"),
|
|
5452
|
+
"../../../../assets/flags/ug.svg": () => import("./ug-1a8fee80.mjs"),
|
|
5453
|
+
"../../../../assets/flags/um.svg": () => import("./um-d774b142.mjs"),
|
|
5454
|
+
"../../../../assets/flags/us.svg": () => import("./us-20ac3d88.mjs"),
|
|
5455
|
+
"../../../../assets/flags/uy.svg": () => import("./uy-c22e1eb1.mjs"),
|
|
5456
|
+
"../../../../assets/flags/uz.svg": () => import("./uz-f8be4086.mjs"),
|
|
5457
|
+
"../../../../assets/flags/va.svg": () => import("./va-d1f00296.mjs"),
|
|
5458
|
+
"../../../../assets/flags/vc.svg": () => import("./vc-0a06f1c2.mjs"),
|
|
5459
|
+
"../../../../assets/flags/ve.svg": () => import("./ve-3bc33c40.mjs"),
|
|
5460
|
+
"../../../../assets/flags/vg.svg": () => import("./vg-3ad787bf.mjs"),
|
|
5461
|
+
"../../../../assets/flags/vi.svg": () => import("./vi-5a78bf74.mjs"),
|
|
5462
|
+
"../../../../assets/flags/vn.svg": () => import("./vn-50e78ae2.mjs"),
|
|
5463
|
+
"../../../../assets/flags/vu.svg": () => import("./vu-72d9304c.mjs"),
|
|
5464
|
+
"../../../../assets/flags/wf.svg": () => import("./wf-8cdbeff9.mjs"),
|
|
5465
|
+
"../../../../assets/flags/ws.svg": () => import("./ws-745fc88c.mjs"),
|
|
5466
|
+
"../../../../assets/flags/ye.svg": () => import("./ye-f4eaca91.mjs"),
|
|
5467
|
+
"../../../../assets/flags/yt.svg": () => import("./yt-93635c9a.mjs"),
|
|
5468
|
+
"../../../../assets/flags/za.svg": () => import("./za-42d70d0b.mjs"),
|
|
5469
|
+
"../../../../assets/flags/zm.svg": () => import("./zm-571a963f.mjs"),
|
|
5470
|
+
"../../../../assets/flags/zw.svg": () => import("./zw-6cf765c3.mjs"),
|
|
5471
|
+
"../../../../assets/flags/zz.svg": () => import("./zz-067ccc58.mjs")
|
|
5472
|
+
});
|
|
5473
|
+
const getLazyLoadedSvgComponent = (country2) => {
|
|
5474
|
+
const importForCountry = flagImports[`../../../../assets/flags/${country2.toLowerCase()}.svg`];
|
|
5475
|
+
if (!importForCountry) {
|
|
5476
|
+
logger$p.error(`No flag available for ${country2}`);
|
|
5477
|
+
return void 0;
|
|
5478
|
+
}
|
|
5479
|
+
return lazy(importForCountry);
|
|
5480
|
+
};
|
|
5481
|
+
const Flag = ({
|
|
5482
|
+
country: country2
|
|
5483
|
+
}) => {
|
|
5484
|
+
const containerRef = useRef(null);
|
|
5485
|
+
const isVisible = useIsElementVisible(containerRef);
|
|
5486
|
+
const placeholder = jsx("span", {
|
|
5487
|
+
className: "adyen-kyc-flag__placeholder"
|
|
5488
|
+
});
|
|
5489
|
+
const LazyLoadedSvgComponent = isVisible ? getLazyLoadedSvgComponent(country2) : void 0;
|
|
5490
|
+
return jsx("span", {
|
|
5491
|
+
ref: containerRef,
|
|
5492
|
+
className: "adyen-kyc-flag__container",
|
|
5493
|
+
children: jsx(Suspense, {
|
|
5494
|
+
fallback: placeholder,
|
|
5495
|
+
children: LazyLoadedSvgComponent ? jsx(LazyLoadedSvgComponent, {}) : placeholder
|
|
5496
|
+
})
|
|
5497
|
+
});
|
|
5498
|
+
};
|
|
5208
5499
|
const COUNTRY_FIELD = ["country"];
|
|
5209
5500
|
function CountryField({
|
|
5210
5501
|
data,
|
|
@@ -5220,19 +5511,15 @@ function CountryField({
|
|
|
5220
5511
|
const {
|
|
5221
5512
|
i18n
|
|
5222
5513
|
} = useI18nContext();
|
|
5223
|
-
const {
|
|
5224
|
-
loadFlags: loadFlags2
|
|
5225
|
-
} = useConfigurationApi();
|
|
5226
5514
|
const {
|
|
5227
5515
|
dataset: countriesFromApi
|
|
5228
5516
|
} = useDataset(datasetIdentifier.country);
|
|
5229
|
-
|
|
5230
|
-
loadFlags2().catch(logger$p.error);
|
|
5231
|
-
}, [loadFlags2]);
|
|
5232
|
-
const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
5517
|
+
const countries = useMemo(() => countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
5233
5518
|
...item,
|
|
5234
|
-
|
|
5235
|
-
|
|
5519
|
+
icon: jsx(Flag, {
|
|
5520
|
+
country: item.id
|
|
5521
|
+
})
|
|
5522
|
+
})), [allowedCountries, countriesFromApi]);
|
|
5236
5523
|
return jsx(Field, {
|
|
5237
5524
|
name: "country",
|
|
5238
5525
|
label: (labels2 == null ? void 0 : labels2.country) || i18n.get("country"),
|
|
@@ -5844,6 +6131,10 @@ const displayValueToPureValue = (displayValue, mask) => {
|
|
|
5844
6131
|
const stripPattern = cachedStripPatterns.get(mask) ?? makeStripPattern(mask);
|
|
5845
6132
|
return displayValue.replaceAll(stripPattern, "");
|
|
5846
6133
|
};
|
|
6134
|
+
const isValueObscured = (value) => {
|
|
6135
|
+
var _a;
|
|
6136
|
+
return typeof value === "string" && !!((_a = value.match(/[*]{1,}/)) == null ? void 0 : _a.length);
|
|
6137
|
+
};
|
|
5847
6138
|
const getAvailableInputTokens = (tokens) => {
|
|
5848
6139
|
const availableTokens = [];
|
|
5849
6140
|
for (const token of tokens) {
|
|
@@ -5882,11 +6173,17 @@ const getEagerSuffix = (tokens) => {
|
|
|
5882
6173
|
return suffix;
|
|
5883
6174
|
};
|
|
5884
6175
|
const getPotentialForMoreOptionalInput = (tokens) => tokens.some((token) => token.type === "input" && token.optional);
|
|
5885
|
-
const matchAgainstMask = (pureValue, mask) => {
|
|
6176
|
+
const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
5886
6177
|
let tokensToProcess = [...mask.tokens];
|
|
5887
6178
|
let charsToProcess = pureValue;
|
|
5888
6179
|
let charIndex = 0;
|
|
5889
6180
|
let displayValue = "";
|
|
6181
|
+
if (acceptObscuredValue && isValueObscured(pureValue)) {
|
|
6182
|
+
return {
|
|
6183
|
+
outcome: "obscureCorrect",
|
|
6184
|
+
displayValue: pureValue
|
|
6185
|
+
};
|
|
6186
|
+
}
|
|
5890
6187
|
const shiftChars = (increment) => {
|
|
5891
6188
|
charIndex += increment;
|
|
5892
6189
|
charsToProcess = charsToProcess.slice(increment);
|
|
@@ -5995,7 +6292,8 @@ const MaskedInputText = ({
|
|
|
5995
6292
|
readonly = false,
|
|
5996
6293
|
disabled = false,
|
|
5997
6294
|
formatGuidance,
|
|
5998
|
-
classNameModifiers
|
|
6295
|
+
classNameModifiers,
|
|
6296
|
+
acceptObscuredValue = false
|
|
5999
6297
|
}) => {
|
|
6000
6298
|
const hasExistingData = !isEmpty(value);
|
|
6001
6299
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -6028,8 +6326,8 @@ const MaskedInputText = ({
|
|
|
6028
6326
|
outcome: "partialCorrect",
|
|
6029
6327
|
displayValue: pureValue
|
|
6030
6328
|
};
|
|
6031
|
-
return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask);
|
|
6032
|
-
}, [mask, transformOnType]);
|
|
6329
|
+
return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
|
|
6330
|
+
}, [mask, transformOnType, acceptObscuredValue]);
|
|
6033
6331
|
const displayValueToPure = useCallback((displayValue2) => {
|
|
6034
6332
|
if (!mask)
|
|
6035
6333
|
return displayValue2;
|
|
@@ -6174,6 +6472,11 @@ const alphanumericInputs = (length, optional = false) => makeArrayOfRepeatedObje
|
|
|
6174
6472
|
allow: /[\dA-Za-z]/,
|
|
6175
6473
|
optional
|
|
6176
6474
|
});
|
|
6475
|
+
const customInputs = (length, regex, optional = false) => makeArrayOfRepeatedObjects(length, {
|
|
6476
|
+
type: "input",
|
|
6477
|
+
allow: regex,
|
|
6478
|
+
optional
|
|
6479
|
+
});
|
|
6177
6480
|
const makeMask = (...tokens) => ({
|
|
6178
6481
|
tokens
|
|
6179
6482
|
});
|
|
@@ -6631,49 +6934,49 @@ const businessRegistrationNumberPatterns = {
|
|
|
6631
6934
|
}
|
|
6632
6935
|
};
|
|
6633
6936
|
const CountryIdNumberPatterns = {
|
|
6634
|
-
[CountryCodes.Brazil]:
|
|
6937
|
+
[CountryCodes.Brazil]: /^\d{11}$/,
|
|
6635
6938
|
[CountryCodes.Canada]: /^\d{9}$/,
|
|
6636
|
-
[CountryCodes.
|
|
6939
|
+
[CountryCodes.Croatia]: /^\d{11}$/,
|
|
6940
|
+
[CountryCodes.Denmark]: /^\d{10}$/,
|
|
6637
6941
|
[CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
|
|
6638
6942
|
[CountryCodes.Poland]: /^\d{11}$/,
|
|
6639
6943
|
[CountryCodes.Romania]: /^\d{13}$/,
|
|
6640
|
-
[CountryCodes.Singapore]: /^[
|
|
6641
|
-
[CountryCodes.Spain]: /(^[KL]?\d{7,8}[A-Z]$)|(^[MXYZ]\d{7}[A-Z]$)/,
|
|
6642
|
-
[CountryCodes.Sweden]: /(^\d{6}-\d{4}$)|(^\d{8}-\d{4}$)/,
|
|
6643
|
-
[CountryCodes.UnitedStates]: /^\d{4}$/,
|
|
6644
|
-
US9: /^\d{9}$/
|
|
6645
|
-
};
|
|
6646
|
-
const customPatternsPerIdNumberType = {
|
|
6944
|
+
[CountryCodes.Singapore]: /^[A-Z][0-9]{6}[A-Z]$/,
|
|
6647
6945
|
[CountryCodes.Spain]: {
|
|
6648
|
-
dni: /(^[KL]?\d{
|
|
6649
|
-
nie: /(^[MXYZ]\d{7}[A-Z]$)/
|
|
6946
|
+
dni: /(^[KL]?\d{8}[A-Z]$)/,
|
|
6947
|
+
nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
|
|
6948
|
+
},
|
|
6949
|
+
[CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
|
|
6950
|
+
[CountryCodes.UnitedStates]: {
|
|
6951
|
+
ssn: /^\d{9}$/,
|
|
6952
|
+
ssnLastFour: /^\d{4}$/
|
|
6650
6953
|
}
|
|
6651
6954
|
};
|
|
6652
6955
|
const DriversLicenseCardNumberPatterns = {
|
|
6653
|
-
[CountryCodes.NewZealand]: /^[\d]{3}
|
|
6956
|
+
[CountryCodes.NewZealand]: /^[\d]{3}$/,
|
|
6957
|
+
[CountryCodes.Australia]: /^[A-Z0-9]{6,10}$/
|
|
6654
6958
|
};
|
|
6655
6959
|
const DriversLicenseNumberPatterns = {
|
|
6656
|
-
[CountryCodes.Australia]: /^[A-Za-
|
|
6657
|
-
[CountryCodes.HongKong]: /^[A-
|
|
6658
|
-
[CountryCodes.NewZealand]: /^[A-
|
|
6960
|
+
[CountryCodes.Australia]: /^[A-Za-z0-9]{6,11}$/,
|
|
6961
|
+
[CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
|
|
6962
|
+
[CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
|
|
6659
6963
|
};
|
|
6660
6964
|
const PassportNumberPatterns = {
|
|
6661
6965
|
[CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
|
|
6662
|
-
[CountryCodes.HongKong]: /^
|
|
6663
|
-
[CountryCodes.NewZealand]: /[A-
|
|
6966
|
+
[CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
|
|
6967
|
+
[CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
|
|
6664
6968
|
};
|
|
6665
6969
|
const ProofOfIdentityCardPatterns = {
|
|
6666
|
-
[CountryCodes.Australia]: /^[A-Za-z\d]{6,10}$/,
|
|
6667
6970
|
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
6668
6971
|
};
|
|
6669
6972
|
const validatePatternOnBlur = (pattern) => ({
|
|
6670
6973
|
modes: ["blur"],
|
|
6671
6974
|
validate: (val) => !!val && pattern.test(val)
|
|
6672
6975
|
});
|
|
6673
|
-
const defaultFieldMetadata$
|
|
6976
|
+
const defaultFieldMetadata$8 = {
|
|
6674
6977
|
label: "registrationNumber"
|
|
6675
6978
|
};
|
|
6676
|
-
const defaultFieldConfig$
|
|
6979
|
+
const defaultFieldConfig$8 = {
|
|
6677
6980
|
[CountryCodes.Australia]: {
|
|
6678
6981
|
label: "australianBusinessNumberAcn",
|
|
6679
6982
|
mask: businessRegistrationNumberMasks[CountryCodes.Australia].default,
|
|
@@ -7326,7 +7629,7 @@ const defaultFieldConfig$3 = {
|
|
|
7326
7629
|
const businessRegistrationNumberFields = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
7327
7630
|
function BusinessRegistrationNumber(props) {
|
|
7328
7631
|
var _a;
|
|
7329
|
-
const fieldConfig = props.fieldConfig ?? defaultFieldConfig$
|
|
7632
|
+
const fieldConfig = props.fieldConfig ?? defaultFieldConfig$8;
|
|
7330
7633
|
const {
|
|
7331
7634
|
i18n
|
|
7332
7635
|
} = useI18nContext();
|
|
@@ -7342,7 +7645,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
7342
7645
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
7343
7646
|
companyType: companyType2,
|
|
7344
7647
|
registrationNumberType
|
|
7345
|
-
}, defaultFieldMetadata$
|
|
7648
|
+
}, defaultFieldMetadata$8);
|
|
7346
7649
|
const mergedProps = mergeFieldMetadataIntoProps("registrationNumber", metadata, {
|
|
7347
7650
|
requiredFields: schema
|
|
7348
7651
|
});
|
|
@@ -7570,7 +7873,7 @@ function AccordionItem({
|
|
|
7570
7873
|
subTitle = "",
|
|
7571
7874
|
expandIconPlacement = Placement.Left,
|
|
7572
7875
|
iconPlacement = Placement.Left,
|
|
7573
|
-
icon
|
|
7876
|
+
icon,
|
|
7574
7877
|
onOpen = noop,
|
|
7575
7878
|
onClose = noop
|
|
7576
7879
|
}) {
|
|
@@ -7828,6 +8131,32 @@ const individualIdNumberOptions = {
|
|
|
7828
8131
|
name: "nie"
|
|
7829
8132
|
}]
|
|
7830
8133
|
};
|
|
8134
|
+
const additionallIdNumberOptions = {
|
|
8135
|
+
[CountryCodes.NewZealand]: [{
|
|
8136
|
+
id: "driversLicense",
|
|
8137
|
+
name: "driversLicense"
|
|
8138
|
+
}, {
|
|
8139
|
+
id: "passport",
|
|
8140
|
+
name: "passportNumber"
|
|
8141
|
+
}],
|
|
8142
|
+
[CountryCodes.HongKong]: [{
|
|
8143
|
+
id: "proofOfIdentityCard",
|
|
8144
|
+
name: "stateIssuedProofOfIdentityCard"
|
|
8145
|
+
}, {
|
|
8146
|
+
id: "driversLicense",
|
|
8147
|
+
name: "driversLicense"
|
|
8148
|
+
}, {
|
|
8149
|
+
id: "passport",
|
|
8150
|
+
name: "passportNumber"
|
|
8151
|
+
}],
|
|
8152
|
+
[CountryCodes.Australia]: [{
|
|
8153
|
+
id: "driversLicense",
|
|
8154
|
+
name: "driversLicense"
|
|
8155
|
+
}, {
|
|
8156
|
+
id: "passport",
|
|
8157
|
+
name: "passportNumber"
|
|
8158
|
+
}]
|
|
8159
|
+
};
|
|
7831
8160
|
const taxIdNumberOptions = {
|
|
7832
8161
|
[CountryCodes.Denmark]: [{
|
|
7833
8162
|
id: "momsregistreringsnummerCVR",
|
|
@@ -7855,7 +8184,7 @@ const taxIdNumberOptions = {
|
|
|
7855
8184
|
name: "employerIdentificationNumber"
|
|
7856
8185
|
}, {
|
|
7857
8186
|
id: "ssn",
|
|
7858
|
-
name: "
|
|
8187
|
+
name: "socialSecurityNumber",
|
|
7859
8188
|
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
7860
8189
|
}, {
|
|
7861
8190
|
id: "ssnLastFour",
|
|
@@ -7904,7 +8233,7 @@ function CompanyRegistrationNumberTypeSelector({
|
|
|
7904
8233
|
}
|
|
7905
8234
|
const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
|
|
7906
8235
|
const optionsForCountry = companyRegistrationNumberOptions[country2];
|
|
7907
|
-
const metadataFn = defaultFieldConfig$
|
|
8236
|
+
const metadataFn = defaultFieldConfig$8[country2];
|
|
7908
8237
|
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
7909
8238
|
return void 0;
|
|
7910
8239
|
for (const option of optionsForCountry) {
|
|
@@ -7920,10 +8249,10 @@ const inferCompanyRegistrationNumberType = (registrationNumber2, country2, compa
|
|
|
7920
8249
|
}
|
|
7921
8250
|
}
|
|
7922
8251
|
};
|
|
7923
|
-
const defaultFieldMetadata$
|
|
8252
|
+
const defaultFieldMetadata$7 = {
|
|
7924
8253
|
label: "taxId"
|
|
7925
8254
|
};
|
|
7926
|
-
const defaultFieldConfig$
|
|
8255
|
+
const defaultFieldConfig$7 = {
|
|
7927
8256
|
[CountryCodes.Canada]: {
|
|
7928
8257
|
label: "businessNumber",
|
|
7929
8258
|
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
@@ -8002,7 +8331,7 @@ const defaultFieldConfig$2 = {
|
|
|
8002
8331
|
switch (taxIdNumberType) {
|
|
8003
8332
|
case "ssn":
|
|
8004
8333
|
return {
|
|
8005
|
-
label: "
|
|
8334
|
+
label: "socialSecurityNumber",
|
|
8006
8335
|
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
8007
8336
|
mask: {
|
|
8008
8337
|
mask: makeMask(...numericInputs(9))
|
|
@@ -8052,10 +8381,10 @@ const defaultFieldConfig$2 = {
|
|
|
8052
8381
|
validators: validatePatternOnBlur(/^\d{12}$/)
|
|
8053
8382
|
}
|
|
8054
8383
|
};
|
|
8055
|
-
const defaultFieldMetadata$
|
|
8384
|
+
const defaultFieldMetadata$6 = {
|
|
8056
8385
|
label: "vatNumber"
|
|
8057
8386
|
};
|
|
8058
|
-
const defaultFieldConfig$
|
|
8387
|
+
const defaultFieldConfig$6 = {
|
|
8059
8388
|
[CountryCodes.Austria]: {
|
|
8060
8389
|
label: "UST-ID",
|
|
8061
8390
|
validators: validatePatternOnBlur(/^ATU\d{8}$/),
|
|
@@ -8684,7 +9013,7 @@ const defaultFieldConfig$1 = {
|
|
|
8684
9013
|
};
|
|
8685
9014
|
const inferTaxIdNumberType = (taxId2, country2) => {
|
|
8686
9015
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
8687
|
-
const metadataFn = defaultFieldConfig$
|
|
9016
|
+
const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
|
|
8688
9017
|
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
8689
9018
|
return void 0;
|
|
8690
9019
|
for (const option of optionsForCountry) {
|
|
@@ -8740,11 +9069,11 @@ function TaxId(props) {
|
|
|
8740
9069
|
fieldValidationErrors,
|
|
8741
9070
|
dataStoreId,
|
|
8742
9071
|
taxIdNumberType,
|
|
8743
|
-
fieldConfig = defaultFieldConfig$
|
|
9072
|
+
fieldConfig = defaultFieldConfig$7
|
|
8744
9073
|
} = props;
|
|
8745
9074
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8746
9075
|
taxIdNumberType
|
|
8747
|
-
}, defaultFieldMetadata$
|
|
9076
|
+
}, defaultFieldMetadata$7);
|
|
8748
9077
|
const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
|
|
8749
9078
|
const {
|
|
8750
9079
|
i18n
|
|
@@ -8859,12 +9188,12 @@ function VatNumber(props) {
|
|
|
8859
9188
|
country: country2,
|
|
8860
9189
|
fieldValidationErrors,
|
|
8861
9190
|
dataStoreId,
|
|
8862
|
-
fieldConfig = defaultFieldConfig$
|
|
9191
|
+
fieldConfig = defaultFieldConfig$6,
|
|
8863
9192
|
vatNumberType
|
|
8864
9193
|
} = props;
|
|
8865
9194
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8866
9195
|
vatNumberType
|
|
8867
|
-
}, defaultFieldMetadata$
|
|
9196
|
+
}, defaultFieldMetadata$6);
|
|
8868
9197
|
const mergedProps = mergeFieldMetadataIntoProps("vatNumber", metadata, props);
|
|
8869
9198
|
const {
|
|
8870
9199
|
i18n
|
|
@@ -11272,19 +11601,6 @@ function FieldContainer(props) {
|
|
|
11272
11601
|
}
|
|
11273
11602
|
return renderField(fieldName);
|
|
11274
11603
|
}
|
|
11275
|
-
function useIsElementVisible(element) {
|
|
11276
|
-
const [isIntersecting, setIntersecting] = useState(false);
|
|
11277
|
-
useEffect(() => {
|
|
11278
|
-
if (element) {
|
|
11279
|
-
const observer = new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting));
|
|
11280
|
-
observer.observe(element);
|
|
11281
|
-
return () => {
|
|
11282
|
-
observer.disconnect();
|
|
11283
|
-
};
|
|
11284
|
-
}
|
|
11285
|
-
}, [element]);
|
|
11286
|
-
return isIntersecting;
|
|
11287
|
-
}
|
|
11288
11604
|
const logger$l = createLogger("SearchAddress");
|
|
11289
11605
|
const SearchAddress = ({
|
|
11290
11606
|
data,
|
|
@@ -11305,7 +11621,7 @@ const SearchAddress = ({
|
|
|
11305
11621
|
const [searchText, setSearchText] = useState(null);
|
|
11306
11622
|
const [showSearchList, setShowSearchList] = useState(false);
|
|
11307
11623
|
const searchBoxRef = useRef(null);
|
|
11308
|
-
const isVisible = useIsElementVisible(searchBoxRef
|
|
11624
|
+
const isVisible = useIsElementVisible(searchBoxRef);
|
|
11309
11625
|
const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
|
|
11310
11626
|
useEffect(() => {
|
|
11311
11627
|
setSearchText(kompanyAddress);
|
|
@@ -11860,7 +12176,7 @@ function Address(props) {
|
|
|
11860
12176
|
formatters: addressFormatters,
|
|
11861
12177
|
rules: rules2,
|
|
11862
12178
|
fieldProblems: fieldValidationErrorsProp,
|
|
11863
|
-
|
|
12179
|
+
obscuredFields: []
|
|
11864
12180
|
});
|
|
11865
12181
|
const formUtils = formUtilities({
|
|
11866
12182
|
...props,
|
|
@@ -12013,12 +12329,12 @@ function Address(props) {
|
|
|
12013
12329
|
addressType,
|
|
12014
12330
|
kompanyAddress
|
|
12015
12331
|
}), jsxs("div", {
|
|
12016
|
-
className: "adyen-kyc-search-address--
|
|
12332
|
+
className: "adyen-kyc-search-address--below",
|
|
12017
12333
|
children: [jsxs("span", {
|
|
12018
|
-
className: "adyen-kyc-search-address--location
|
|
12334
|
+
className: "adyen-kyc-search-address--below-location",
|
|
12019
12335
|
children: [jsx(Icon, {
|
|
12020
12336
|
name: "location"
|
|
12021
|
-
}),
|
|
12337
|
+
}), datasetUtils.getCountryName(dataProp.country)]
|
|
12022
12338
|
}), showAddAddressButton && jsx(Button, {
|
|
12023
12339
|
showAsLink: true,
|
|
12024
12340
|
testId: "addAddressManuallyBtn",
|
|
@@ -12104,7 +12420,7 @@ function RegistrationAddressComponent(props) {
|
|
|
12104
12420
|
schema: ["operationalAddressIsSame"],
|
|
12105
12421
|
defaultData: data,
|
|
12106
12422
|
rules: validators || registrationAddressValidationRules,
|
|
12107
|
-
|
|
12423
|
+
obscuredFields: [],
|
|
12108
12424
|
optionalFields
|
|
12109
12425
|
});
|
|
12110
12426
|
const formUtils = formUtilities(props, i18n);
|
|
@@ -12645,7 +12961,7 @@ function isTransferInstrument(account) {
|
|
|
12645
12961
|
return account.bankAccount !== void 0;
|
|
12646
12962
|
}
|
|
12647
12963
|
const isInstantVerifiedAccount = (account) => Boolean(isTransferInstrument(account) ? account.bankAccount.trustedSource : account.trustedSource);
|
|
12648
|
-
const
|
|
12964
|
+
const getObscuredAccountNumber = ({
|
|
12649
12965
|
accountIdentifier,
|
|
12650
12966
|
realLastFour
|
|
12651
12967
|
}) => realLastFour ? `*******${realLastFour}` : accountIdentifier;
|
|
@@ -12813,55 +13129,6 @@ const updateTaxInformation = ({
|
|
|
12813
13129
|
}
|
|
12814
13130
|
return updatedEntity;
|
|
12815
13131
|
};
|
|
12816
|
-
function cleanNonNumbers(value) {
|
|
12817
|
-
return value.replace(/[^0-9]/g, "").trim();
|
|
12818
|
-
}
|
|
12819
|
-
function maskCPF(value) {
|
|
12820
|
-
return value.replace(/\W/gi, "").replace(/(\d{3})(?!$)/g, "$1.").replace(/(.{11}).(\d{1,2})$/g, "$1-$2");
|
|
12821
|
-
}
|
|
12822
|
-
function maskCNPJ(value) {
|
|
12823
|
-
return value.replace(/^(\d{2})(\d{3})(\d{3})?(\d{4})?(\d{1,2})?$/g, (match, g1, g2, g3, g4 = "", g5 = "") => `${g1}.${g2}.${g3}/${g4}${g5.length ? `-${g5}` : ""}`);
|
|
12824
|
-
}
|
|
12825
|
-
function formatBrazilSSN(value) {
|
|
12826
|
-
if (!value || typeof value !== "string")
|
|
12827
|
-
return "";
|
|
12828
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12829
|
-
const formattedValue = cleanValue.length > 11 ? maskCNPJ(cleanValue) : maskCPF(cleanValue);
|
|
12830
|
-
return formattedValue;
|
|
12831
|
-
}
|
|
12832
|
-
function formatDenmarkCPR(value) {
|
|
12833
|
-
if (!value || typeof value !== "string")
|
|
12834
|
-
return "";
|
|
12835
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12836
|
-
return cleanValue.replace(/^(\d{6})(\d{4})/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12837
|
-
}
|
|
12838
|
-
function formatSwedenPersonnummer(value) {
|
|
12839
|
-
if (!value || typeof value !== "string")
|
|
12840
|
-
return "";
|
|
12841
|
-
const cleanValue = cleanNonNumbers(value);
|
|
12842
|
-
if (cleanValue.length > 10) {
|
|
12843
|
-
return cleanValue.replace(/^(\d{8})(\d{4})$/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12844
|
-
}
|
|
12845
|
-
return cleanValue.replace(/^(\d{6})(\d{4})/g, (match, g1, g2) => `${g1}-${g2}`);
|
|
12846
|
-
}
|
|
12847
|
-
const validatePerIdNumberType = (input, idNumberType, fallbackCountryCode = null) => {
|
|
12848
|
-
var _a, _b;
|
|
12849
|
-
const countryCode = fallbackCountryCode || ((input || "").toUpperCase().match(/^[A-Z]{2}/) || [])[0];
|
|
12850
|
-
if (!input || !hasText(input) || input.length < 3) {
|
|
12851
|
-
return false;
|
|
12852
|
-
}
|
|
12853
|
-
if (countryCode in customPatternsPerIdNumberType) {
|
|
12854
|
-
return input ? !!((_b = (_a = customPatternsPerIdNumberType == null ? void 0 : customPatternsPerIdNumberType[countryCode]) == null ? void 0 : _a[idNumberType]) == null ? void 0 : _b.test(input)) : false;
|
|
12855
|
-
}
|
|
12856
|
-
return false;
|
|
12857
|
-
};
|
|
12858
|
-
const formattedCountries = [CountryCodes.Denmark, CountryCodes.Sweden];
|
|
12859
|
-
const stripCountryIdFormat = (value, country2) => {
|
|
12860
|
-
if (value && formattedCountries.includes(country2)) {
|
|
12861
|
-
return cleanNonNumbers(value);
|
|
12862
|
-
}
|
|
12863
|
-
return value;
|
|
12864
|
-
};
|
|
12865
13132
|
const mandatoryApiFields = {
|
|
12866
13133
|
INDIVIDUAL: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry"],
|
|
12867
13134
|
DECISIONMAKER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role", "personalDetails.jobTitle"],
|
|
@@ -12870,7 +13137,7 @@ const mandatoryApiFields = {
|
|
|
12870
13137
|
SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
|
|
12871
13138
|
TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
|
|
12872
13139
|
};
|
|
12873
|
-
const
|
|
13140
|
+
const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
|
|
12874
13141
|
const individualBaseMapping = {
|
|
12875
13142
|
"personalDetails.firstName": "individual.name.firstName",
|
|
12876
13143
|
"personalDetails.lastName": "individual.name.lastName",
|
|
@@ -13168,7 +13435,7 @@ const adjustIdentificationData = (data, apiData) => {
|
|
|
13168
13435
|
} = data;
|
|
13169
13436
|
const identificationData = {
|
|
13170
13437
|
...apiData,
|
|
13171
|
-
number:
|
|
13438
|
+
number: idNumber2,
|
|
13172
13439
|
type: getIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity2] ?? "nationalIdNumber"
|
|
13173
13440
|
};
|
|
13174
13441
|
switch (typeOfIdentity2) {
|
|
@@ -15129,273 +15396,463 @@ const ContactDetailsComp = memo(ContactDetailsComponent, (prevProps, nextProps)
|
|
|
15129
15396
|
ContactDetailsComponent.defaultProps = {
|
|
15130
15397
|
data: {}
|
|
15131
15398
|
};
|
|
15132
|
-
const IdentityNumber
|
|
15133
|
-
const
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15137
|
-
3: 7,
|
|
15138
|
-
4: 9,
|
|
15139
|
-
5: 13,
|
|
15140
|
-
6: 15,
|
|
15141
|
-
7: 17,
|
|
15142
|
-
8: 19,
|
|
15143
|
-
9: 21,
|
|
15144
|
-
A: 1,
|
|
15145
|
-
B: 0,
|
|
15146
|
-
C: 5,
|
|
15147
|
-
D: 7,
|
|
15148
|
-
E: 9,
|
|
15149
|
-
F: 13,
|
|
15150
|
-
G: 15,
|
|
15151
|
-
H: 17,
|
|
15152
|
-
I: 19,
|
|
15153
|
-
J: 21,
|
|
15154
|
-
K: 2,
|
|
15155
|
-
L: 4,
|
|
15156
|
-
M: 18,
|
|
15157
|
-
N: 20,
|
|
15158
|
-
O: 11,
|
|
15159
|
-
P: 3,
|
|
15160
|
-
Q: 6,
|
|
15161
|
-
R: 8,
|
|
15162
|
-
S: 12,
|
|
15163
|
-
T: 14,
|
|
15164
|
-
U: 16,
|
|
15165
|
-
V: 10,
|
|
15166
|
-
W: 22,
|
|
15167
|
-
X: 25,
|
|
15168
|
-
Y: 24,
|
|
15169
|
-
Z: 23
|
|
15170
|
-
};
|
|
15171
|
-
const CHECKCHARACTER_EVEN_VALUE = {
|
|
15172
|
-
0: 0,
|
|
15173
|
-
1: 1,
|
|
15174
|
-
2: 2,
|
|
15175
|
-
3: 3,
|
|
15176
|
-
4: 4,
|
|
15177
|
-
5: 5,
|
|
15178
|
-
6: 6,
|
|
15179
|
-
7: 7,
|
|
15180
|
-
8: 8,
|
|
15181
|
-
9: 9,
|
|
15182
|
-
A: 0,
|
|
15183
|
-
B: 1,
|
|
15184
|
-
C: 2,
|
|
15185
|
-
D: 3,
|
|
15186
|
-
E: 4,
|
|
15187
|
-
F: 5,
|
|
15188
|
-
G: 6,
|
|
15189
|
-
H: 7,
|
|
15190
|
-
I: 8,
|
|
15191
|
-
J: 9,
|
|
15192
|
-
K: 10,
|
|
15193
|
-
L: 11,
|
|
15194
|
-
M: 12,
|
|
15195
|
-
N: 13,
|
|
15196
|
-
O: 14,
|
|
15197
|
-
P: 15,
|
|
15198
|
-
Q: 16,
|
|
15199
|
-
R: 17,
|
|
15200
|
-
S: 18,
|
|
15201
|
-
T: 19,
|
|
15202
|
-
U: 20,
|
|
15203
|
-
V: 21,
|
|
15204
|
-
W: 22,
|
|
15205
|
-
X: 23,
|
|
15206
|
-
Y: 24,
|
|
15207
|
-
Z: 25
|
|
15208
|
-
};
|
|
15209
|
-
function validCheckCharacter(input, calculationInput) {
|
|
15210
|
-
if (!/^[A-Z]$/.test(input)) {
|
|
15211
|
-
return false;
|
|
15212
|
-
}
|
|
15213
|
-
let total = 0;
|
|
15214
|
-
for (let i = 0; i < 15; i += 1) {
|
|
15215
|
-
const set = i % 2 === 1 ? CHECKCHARACTER_EVEN_VALUE : CHECKCHARACTER_ODD_VALUE;
|
|
15216
|
-
const token = calculationInput.substring(i, i + 1);
|
|
15217
|
-
const value = set[token];
|
|
15218
|
-
if (value == null) {
|
|
15219
|
-
return true;
|
|
15220
|
-
}
|
|
15221
|
-
total = (total + value) % 26;
|
|
15222
|
-
}
|
|
15223
|
-
return total >= 0 && total <= 26 && "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(total) === input;
|
|
15224
|
-
}
|
|
15225
|
-
const createErrorMessageObject = (format, idType) => ({
|
|
15226
|
-
key: "validationPleaseEnterAValidIdNumberWithFormat",
|
|
15227
|
-
values: {
|
|
15228
|
-
format,
|
|
15229
|
-
idType
|
|
15230
|
-
}
|
|
15231
|
-
});
|
|
15232
|
-
const countryIdNumberFormatters = {
|
|
15399
|
+
const IdentityNumber = "";
|
|
15400
|
+
const defaultFieldMetadata$5 = {
|
|
15401
|
+
label: "idNumber"
|
|
15402
|
+
};
|
|
15403
|
+
const defaultFieldConfig$5 = {
|
|
15233
15404
|
[CountryCodes.Brazil]: {
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
|
|
15237
|
-
}
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15245
|
-
[CountryCodes.Sweden]: {
|
|
15246
|
-
idNumber: {
|
|
15247
|
-
formatter: formatSwedenPersonnummer,
|
|
15248
|
-
maxlength: 13
|
|
15405
|
+
label: "cadastroDePessoasFisicas",
|
|
15406
|
+
mask: {
|
|
15407
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" . "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2))
|
|
15408
|
+
},
|
|
15409
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Brazil]),
|
|
15410
|
+
guidanceText: {
|
|
15411
|
+
key: "enterNDigitsForExample",
|
|
15412
|
+
values: {
|
|
15413
|
+
numDigits: "11",
|
|
15414
|
+
example: "231.002.999-00"
|
|
15415
|
+
}
|
|
15249
15416
|
}
|
|
15250
15417
|
},
|
|
15251
|
-
[CountryCodes.
|
|
15252
|
-
|
|
15253
|
-
|
|
15418
|
+
[CountryCodes.Canada]: {
|
|
15419
|
+
label: "socialInsuranceNumber",
|
|
15420
|
+
mask: {
|
|
15421
|
+
mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
|
|
15422
|
+
},
|
|
15423
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Canada]),
|
|
15424
|
+
guidanceText: {
|
|
15425
|
+
key: "enterNDigitsForExample",
|
|
15426
|
+
values: {
|
|
15427
|
+
numDigits: "9",
|
|
15428
|
+
example: "046 454 286"
|
|
15429
|
+
}
|
|
15254
15430
|
}
|
|
15255
15431
|
},
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
-
|
|
15432
|
+
[CountryCodes.Croatia]: {
|
|
15433
|
+
label: "oib",
|
|
15434
|
+
mask: {
|
|
15435
|
+
mask: makeMask(...numericInputs(11))
|
|
15436
|
+
},
|
|
15437
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Croatia]),
|
|
15438
|
+
guidanceText: {
|
|
15439
|
+
key: "enterNDigitsForExample",
|
|
15440
|
+
values: {
|
|
15441
|
+
numDigits: "11",
|
|
15442
|
+
example: "94577403194"
|
|
15443
|
+
}
|
|
15259
15444
|
}
|
|
15260
|
-
}
|
|
15261
|
-
};
|
|
15262
|
-
const IdNumberValidationRules = {
|
|
15263
|
-
idNumber: [{
|
|
15264
|
-
validate: (value) => !!value,
|
|
15265
|
-
modes: ["blur"],
|
|
15266
|
-
errorMessage: "fieldIsRequired"
|
|
15267
|
-
}]
|
|
15268
|
-
};
|
|
15269
|
-
const countryIdNumberValidationRules = {
|
|
15270
|
-
[CountryCodes.Brazil]: {
|
|
15271
|
-
idNumber: [{
|
|
15272
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.BR.test(idNumber2) : false,
|
|
15273
|
-
modes: ["blur"],
|
|
15274
|
-
errorMessage: "invalidFormatIdentityNumberBR"
|
|
15275
|
-
}]
|
|
15276
|
-
},
|
|
15277
|
-
[CountryCodes.Canada]: {
|
|
15278
|
-
idNumber: [{
|
|
15279
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.CA.test(idNumber2) : false,
|
|
15280
|
-
modes: ["blur"],
|
|
15281
|
-
errorMessage: "invalidFormatIdentityNumberCA"
|
|
15282
|
-
}]
|
|
15283
15445
|
},
|
|
15284
15446
|
[CountryCodes.Denmark]: {
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15447
|
+
label: "detCentralePersonregister",
|
|
15448
|
+
mask: {
|
|
15449
|
+
mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4))
|
|
15450
|
+
},
|
|
15451
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Denmark]),
|
|
15452
|
+
guidanceText: {
|
|
15453
|
+
key: "enterNDigitsForExample",
|
|
15454
|
+
values: {
|
|
15455
|
+
numDigits: "10",
|
|
15456
|
+
example: "010111-1113"
|
|
15457
|
+
}
|
|
15458
|
+
}
|
|
15290
15459
|
},
|
|
15291
15460
|
[CountryCodes.Italy]: {
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
}
|
|
15461
|
+
label: "codiceFiscale",
|
|
15462
|
+
mask: {
|
|
15463
|
+
mask: makeMask(...alphaInputs(6), ...numericInputs(2), ...customInputs(1, /^[ABCDEHLMPRST]$/), ...numericInputs(2), ...alphaInputs(1), ...numericInputs(3), ...alphaInputs(1)),
|
|
15464
|
+
transformOnType: uppercase
|
|
15465
|
+
},
|
|
15466
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Italy]),
|
|
15467
|
+
guidanceText: {
|
|
15468
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15469
|
+
values: {
|
|
15470
|
+
numChars: "16",
|
|
15471
|
+
example: "YULSQG40E60L271T"
|
|
15472
|
+
}
|
|
15473
|
+
}
|
|
15297
15474
|
},
|
|
15298
15475
|
[CountryCodes.Poland]: {
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
errorMessage: "invalidFormatIdentityNumberPL"
|
|
15303
|
-
}]
|
|
15304
|
-
},
|
|
15305
|
-
[CountryCodes.Romania]: {
|
|
15306
|
-
idNumber: [{
|
|
15307
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.RO.test(idNumber2) : false,
|
|
15308
|
-
modes: ["blur"],
|
|
15309
|
-
errorMessage: "invalidFormatIdentityNumberRO"
|
|
15310
|
-
}]
|
|
15311
|
-
},
|
|
15312
|
-
[CountryCodes.Singapore]: {
|
|
15313
|
-
idNumber: [{
|
|
15314
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.SG.test(idNumber2) : false,
|
|
15315
|
-
modes: ["blur"],
|
|
15316
|
-
errorMessage: "invalidFormatIdentityNumberSG"
|
|
15317
|
-
}]
|
|
15318
|
-
},
|
|
15319
|
-
[CountryCodes.Spain]: {
|
|
15320
|
-
idNumber: [{
|
|
15321
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.ES.test(idNumber2) : false,
|
|
15322
|
-
modes: ["blur"],
|
|
15323
|
-
errorMessage: "invalidFormatIdentityNumberES"
|
|
15324
|
-
}]
|
|
15325
|
-
},
|
|
15326
|
-
[CountryCodes.Sweden]: {
|
|
15327
|
-
idNumber: [{
|
|
15328
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.SE.test(idNumber2) : false,
|
|
15329
|
-
modes: ["blur"],
|
|
15330
|
-
errorMessage: "invalidFormatIdentityNumberSE"
|
|
15331
|
-
}]
|
|
15332
|
-
},
|
|
15333
|
-
[CountryCodes.UnitedStates]: {
|
|
15334
|
-
idNumber: [{
|
|
15335
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.US.test(idNumber2) : false,
|
|
15336
|
-
modes: ["blur"],
|
|
15337
|
-
errorMessage: "invalidFormatIdentityNumberUS"
|
|
15338
|
-
}]
|
|
15339
|
-
},
|
|
15340
|
-
US9: {
|
|
15341
|
-
idNumber: [{
|
|
15342
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.US9.test(idNumber2) : false,
|
|
15343
|
-
modes: ["blur"],
|
|
15344
|
-
errorMessage: "invalidFormatIdentityNumberUS9"
|
|
15345
|
-
}]
|
|
15346
|
-
}
|
|
15347
|
-
};
|
|
15348
|
-
const idNumberCustomValidationRules = {
|
|
15349
|
-
[CountryCodes.Spain]: {
|
|
15350
|
-
dni: {
|
|
15351
|
-
idNumber: [{
|
|
15352
|
-
validate: (idNumber2) => validatePerIdNumberType(idNumber2, "dni", CountryCodes.Spain),
|
|
15353
|
-
modes: ["blur"],
|
|
15354
|
-
errorMessage: createErrorMessageObject("L0000000J", "DNI")
|
|
15355
|
-
}]
|
|
15476
|
+
label: "peselNumber",
|
|
15477
|
+
mask: {
|
|
15478
|
+
mask: makeMask(...numericInputs(11))
|
|
15356
15479
|
},
|
|
15357
|
-
|
|
15358
|
-
|
|
15359
|
-
|
|
15360
|
-
|
|
15361
|
-
|
|
15362
|
-
|
|
15480
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Poland]),
|
|
15481
|
+
guidanceText: {
|
|
15482
|
+
key: "enterNDigitsForExample",
|
|
15483
|
+
values: {
|
|
15484
|
+
numDigits: "11",
|
|
15485
|
+
example: "23012224757"
|
|
15486
|
+
}
|
|
15487
|
+
}
|
|
15488
|
+
},
|
|
15489
|
+
[CountryCodes.PuertoRico]: ({
|
|
15490
|
+
idNumberType
|
|
15491
|
+
}) => {
|
|
15492
|
+
switch (idNumberType) {
|
|
15493
|
+
case "ssn":
|
|
15494
|
+
return {
|
|
15495
|
+
label: "socialSecurityNumber",
|
|
15496
|
+
mask: {
|
|
15497
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4))
|
|
15498
|
+
},
|
|
15499
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
15500
|
+
guidanceText: {
|
|
15501
|
+
key: "enterNDigitsForExample",
|
|
15502
|
+
values: {
|
|
15503
|
+
numDigits: "9",
|
|
15504
|
+
example: "123-12-1234"
|
|
15505
|
+
}
|
|
15506
|
+
}
|
|
15507
|
+
};
|
|
15508
|
+
case "ssnLastFour":
|
|
15509
|
+
default:
|
|
15510
|
+
return {
|
|
15511
|
+
label: "socialSecurityNumber",
|
|
15512
|
+
mask: {
|
|
15513
|
+
mask: makeMask(...nonInputs("***"), ...nonInputs(" - "), ...nonInputs("**"), ...nonInputs(" - "), ...numericInputs(4))
|
|
15514
|
+
},
|
|
15515
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour),
|
|
15516
|
+
guidanceText: {
|
|
15517
|
+
key: "enterLastNDigitsForExample",
|
|
15518
|
+
values: {
|
|
15519
|
+
numDigits: "4",
|
|
15520
|
+
example: "***-**-1234"
|
|
15521
|
+
}
|
|
15522
|
+
}
|
|
15523
|
+
};
|
|
15524
|
+
}
|
|
15525
|
+
},
|
|
15526
|
+
[CountryCodes.Romania]: {
|
|
15527
|
+
label: "codNumericPersonal",
|
|
15528
|
+
mask: {
|
|
15529
|
+
mask: makeMask(...numericInputs(13))
|
|
15530
|
+
},
|
|
15531
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Romania]),
|
|
15532
|
+
guidanceText: {
|
|
15533
|
+
key: "enterNDigitsForExample",
|
|
15534
|
+
values: {
|
|
15535
|
+
numDigits: "13",
|
|
15536
|
+
example: "8001011234567"
|
|
15537
|
+
}
|
|
15538
|
+
}
|
|
15539
|
+
},
|
|
15540
|
+
[CountryCodes.Singapore]: {
|
|
15541
|
+
label: "nric",
|
|
15542
|
+
mask: {
|
|
15543
|
+
mask: makeMask(...alphaInputs(1), ...numericInputs(6), ...alphaInputs(1)),
|
|
15544
|
+
transformOnType: uppercase
|
|
15545
|
+
},
|
|
15546
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Singapore]),
|
|
15547
|
+
guidanceText: {
|
|
15548
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15549
|
+
values: {
|
|
15550
|
+
numChars: "8",
|
|
15551
|
+
example: "T0123456J"
|
|
15552
|
+
}
|
|
15553
|
+
}
|
|
15554
|
+
},
|
|
15555
|
+
[CountryCodes.Spain]: ({
|
|
15556
|
+
idNumberType
|
|
15557
|
+
}) => {
|
|
15558
|
+
switch (idNumberType) {
|
|
15559
|
+
case "dni":
|
|
15560
|
+
return {
|
|
15561
|
+
label: "dni",
|
|
15562
|
+
mask: {
|
|
15563
|
+
mask: makeMask(...customInputs(1, /^[KL]$/, true), ...numericInputs(8), ...alphaInputs(1)),
|
|
15564
|
+
transformOnType: uppercase
|
|
15565
|
+
},
|
|
15566
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].dni),
|
|
15567
|
+
guidanceText: {
|
|
15568
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15569
|
+
values: {
|
|
15570
|
+
minChars: "9",
|
|
15571
|
+
maxChars: "10",
|
|
15572
|
+
example: "12345678A or L12345678A"
|
|
15573
|
+
}
|
|
15574
|
+
}
|
|
15575
|
+
};
|
|
15576
|
+
case "nie":
|
|
15577
|
+
default:
|
|
15578
|
+
return {
|
|
15579
|
+
label: "nie",
|
|
15580
|
+
mask: {
|
|
15581
|
+
mask: makeMask(...customInputs(1, /^[MXYZ]$/), ...numericInputs(7), ...numericInputs(1, true), ...alphaInputs(1)),
|
|
15582
|
+
transformOnType: uppercase
|
|
15583
|
+
},
|
|
15584
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].nie),
|
|
15585
|
+
guidanceText: {
|
|
15586
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15587
|
+
values: {
|
|
15588
|
+
minChars: "9",
|
|
15589
|
+
maxChars: "10",
|
|
15590
|
+
example: "X12345678A or Z6527153N"
|
|
15591
|
+
}
|
|
15592
|
+
}
|
|
15593
|
+
};
|
|
15594
|
+
}
|
|
15595
|
+
},
|
|
15596
|
+
[CountryCodes.Sweden]: {
|
|
15597
|
+
label: "personnummer",
|
|
15598
|
+
mask: {
|
|
15599
|
+
mask: makeMask(...numericInputs(6), ...numericInputs(2, true), ...nonInputs(" - "), ...numericInputs(4))
|
|
15600
|
+
},
|
|
15601
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Sweden]),
|
|
15602
|
+
guidanceText: {
|
|
15603
|
+
key: "enterXOrYDigitsForExample",
|
|
15604
|
+
values: {
|
|
15605
|
+
xDigits: "10",
|
|
15606
|
+
yDigits: "12",
|
|
15607
|
+
example: "640823-3234 or 19640823-3234"
|
|
15608
|
+
}
|
|
15609
|
+
}
|
|
15610
|
+
},
|
|
15611
|
+
[CountryCodes.UnitedStates]: ({
|
|
15612
|
+
idNumberType
|
|
15613
|
+
}) => {
|
|
15614
|
+
switch (idNumberType) {
|
|
15615
|
+
case "ssn":
|
|
15616
|
+
return {
|
|
15617
|
+
label: "socialSecurityNumber",
|
|
15618
|
+
mask: {
|
|
15619
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4))
|
|
15620
|
+
},
|
|
15621
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
15622
|
+
guidanceText: {
|
|
15623
|
+
key: "enterNDigitsForExample",
|
|
15624
|
+
values: {
|
|
15625
|
+
numDigits: "9",
|
|
15626
|
+
example: "123-12-1234"
|
|
15627
|
+
}
|
|
15628
|
+
}
|
|
15629
|
+
};
|
|
15630
|
+
case "ssnLastFour":
|
|
15631
|
+
default:
|
|
15632
|
+
return {
|
|
15633
|
+
label: "socialSecurityNumber",
|
|
15634
|
+
mask: {
|
|
15635
|
+
mask: makeMask(...nonInputs("***"), ...nonInputs(" - "), ...nonInputs("**"), ...nonInputs(" - "), ...numericInputs(4))
|
|
15636
|
+
},
|
|
15637
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour),
|
|
15638
|
+
guidanceText: {
|
|
15639
|
+
key: "enterLastNDigitsForExample",
|
|
15640
|
+
values: {
|
|
15641
|
+
numDigits: "4",
|
|
15642
|
+
example: "***-**-1234"
|
|
15643
|
+
}
|
|
15644
|
+
}
|
|
15645
|
+
};
|
|
15646
|
+
}
|
|
15647
|
+
},
|
|
15648
|
+
[CountryCodes.NewZealand]: ({
|
|
15649
|
+
idNumberType
|
|
15650
|
+
}) => {
|
|
15651
|
+
switch (idNumberType) {
|
|
15652
|
+
case "passport":
|
|
15653
|
+
return {
|
|
15654
|
+
label: "passportNumber",
|
|
15655
|
+
mask: {
|
|
15656
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...numericInputs(1, true)),
|
|
15657
|
+
transformOnType: uppercase
|
|
15658
|
+
},
|
|
15659
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.NewZealand]),
|
|
15660
|
+
guidanceText: {
|
|
15661
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15662
|
+
values: {
|
|
15663
|
+
minChars: "8",
|
|
15664
|
+
maxChars: "9",
|
|
15665
|
+
example: "RA000750"
|
|
15666
|
+
}
|
|
15667
|
+
}
|
|
15668
|
+
};
|
|
15669
|
+
case "driversLicense":
|
|
15670
|
+
default:
|
|
15671
|
+
return {
|
|
15672
|
+
label: "driversLicense",
|
|
15673
|
+
mask: {
|
|
15674
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6)),
|
|
15675
|
+
transformOnType: uppercase
|
|
15676
|
+
},
|
|
15677
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.NewZealand]),
|
|
15678
|
+
guidanceText: {
|
|
15679
|
+
key: "enterNCharactersWithAMixForExample",
|
|
15680
|
+
values: {
|
|
15681
|
+
numChars: "8",
|
|
15682
|
+
example: "KA111112"
|
|
15683
|
+
}
|
|
15684
|
+
}
|
|
15685
|
+
};
|
|
15686
|
+
}
|
|
15687
|
+
},
|
|
15688
|
+
[CountryCodes.HongKong]: ({
|
|
15689
|
+
idNumberType
|
|
15690
|
+
}) => {
|
|
15691
|
+
switch (idNumberType) {
|
|
15692
|
+
case "proofOfIdentityCard":
|
|
15693
|
+
return {
|
|
15694
|
+
label: "hkid",
|
|
15695
|
+
mask: {
|
|
15696
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(6), ...nonInputs("("), ...customInputs(1, /^[0-9A]$/), ...nonInputs(")")),
|
|
15697
|
+
transformOnType: uppercase
|
|
15698
|
+
},
|
|
15699
|
+
validators: validatePatternOnBlur(ProofOfIdentityCardPatterns[CountryCodes.HongKong]),
|
|
15700
|
+
guidanceText: {
|
|
15701
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15702
|
+
values: {
|
|
15703
|
+
minChars: "8",
|
|
15704
|
+
maxChars: "9",
|
|
15705
|
+
example: "Z683365(5) or AB123456(A)"
|
|
15706
|
+
}
|
|
15707
|
+
}
|
|
15708
|
+
};
|
|
15709
|
+
case "passport":
|
|
15710
|
+
return {
|
|
15711
|
+
label: "passportNumber",
|
|
15712
|
+
mask: {
|
|
15713
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(6), ...alphanumericInputs(1), ...alphanumericInputs(1, true)),
|
|
15714
|
+
transformOnType: uppercase
|
|
15715
|
+
},
|
|
15716
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.HongKong]),
|
|
15717
|
+
guidanceText: {
|
|
15718
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15719
|
+
values: {
|
|
15720
|
+
minChars: "8",
|
|
15721
|
+
maxChars: "10",
|
|
15722
|
+
example: "H12345678"
|
|
15723
|
+
}
|
|
15724
|
+
}
|
|
15725
|
+
};
|
|
15726
|
+
case "driversLicense":
|
|
15727
|
+
default:
|
|
15728
|
+
return {
|
|
15729
|
+
label: "driversLicense",
|
|
15730
|
+
mask: {
|
|
15731
|
+
mask: makeMask(...alphanumericInputs(7), spacer, ...alphanumericInputs(1))
|
|
15732
|
+
},
|
|
15733
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.HongKong]),
|
|
15734
|
+
guidanceText: {
|
|
15735
|
+
key: "enterNCharactersForExample",
|
|
15736
|
+
values: {
|
|
15737
|
+
numChars: "8",
|
|
15738
|
+
example: "A123452 0"
|
|
15739
|
+
}
|
|
15740
|
+
}
|
|
15741
|
+
};
|
|
15742
|
+
}
|
|
15743
|
+
},
|
|
15744
|
+
[CountryCodes.Australia]: ({
|
|
15745
|
+
idNumberType
|
|
15746
|
+
}) => {
|
|
15747
|
+
switch (idNumberType) {
|
|
15748
|
+
case "passport":
|
|
15749
|
+
return {
|
|
15750
|
+
label: "passportNumber",
|
|
15751
|
+
mask: {
|
|
15752
|
+
mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(7)),
|
|
15753
|
+
transformOnType: uppercase
|
|
15754
|
+
},
|
|
15755
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.Australia]),
|
|
15756
|
+
guidanceText: {
|
|
15757
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15758
|
+
values: {
|
|
15759
|
+
minChars: "8",
|
|
15760
|
+
maxChars: "9",
|
|
15761
|
+
example: "RA0123456"
|
|
15762
|
+
}
|
|
15763
|
+
}
|
|
15764
|
+
};
|
|
15765
|
+
case "driversLicense":
|
|
15766
|
+
default:
|
|
15767
|
+
return {
|
|
15768
|
+
label: "driversLicense",
|
|
15769
|
+
mask: {
|
|
15770
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
|
|
15771
|
+
transformOnType: uppercase
|
|
15772
|
+
},
|
|
15773
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.Australia]),
|
|
15774
|
+
guidanceText: {
|
|
15775
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15776
|
+
values: {
|
|
15777
|
+
minChars: "6",
|
|
15778
|
+
maxChars: "11",
|
|
15779
|
+
example: "1314159 or GN7073"
|
|
15780
|
+
}
|
|
15781
|
+
}
|
|
15782
|
+
};
|
|
15783
|
+
}
|
|
15784
|
+
}
|
|
15785
|
+
};
|
|
15786
|
+
const licenseCardNumberDefaultMetadata = {
|
|
15787
|
+
label: "licenseCardNumber"
|
|
15788
|
+
};
|
|
15789
|
+
const licenseCardNumberDefaultConfig = {
|
|
15790
|
+
[CountryCodes.NewZealand]: {
|
|
15791
|
+
label: "licenceVersionNumber",
|
|
15792
|
+
mask: {
|
|
15793
|
+
mask: makeMask(...numericInputs(3))
|
|
15794
|
+
},
|
|
15795
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.NewZealand]),
|
|
15796
|
+
guidanceText: {
|
|
15797
|
+
key: "enterNDigitsForExample",
|
|
15798
|
+
values: {
|
|
15799
|
+
numDigits: "3",
|
|
15800
|
+
example: "108"
|
|
15801
|
+
}
|
|
15802
|
+
}
|
|
15803
|
+
},
|
|
15804
|
+
[CountryCodes.Australia]: {
|
|
15805
|
+
label: "licenseCardNumber",
|
|
15806
|
+
mask: {
|
|
15807
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(4, true)),
|
|
15808
|
+
transformOnType: uppercase
|
|
15809
|
+
},
|
|
15810
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.Australia]),
|
|
15811
|
+
guidanceText: {
|
|
15812
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
15813
|
+
values: {
|
|
15814
|
+
minChars: "6",
|
|
15815
|
+
maxChars: "10",
|
|
15816
|
+
example: "FCC3456789 or 1898442"
|
|
15817
|
+
}
|
|
15363
15818
|
}
|
|
15364
15819
|
}
|
|
15365
15820
|
};
|
|
15366
15821
|
const idNumberFields = ["idNumber", "idNumberExempt"];
|
|
15367
|
-
function
|
|
15822
|
+
function IdentityNumberComponent(props) {
|
|
15368
15823
|
const {
|
|
15369
15824
|
i18n
|
|
15370
15825
|
} = useI18nContext();
|
|
15371
15826
|
const {
|
|
15372
|
-
classNames,
|
|
15373
15827
|
country: country2,
|
|
15374
15828
|
data: propData = {},
|
|
15375
|
-
dataPlaceholder,
|
|
15376
15829
|
dataStoreId,
|
|
15377
15830
|
errors: propErrors,
|
|
15378
15831
|
fieldValidationErrors,
|
|
15379
|
-
idNumberType
|
|
15380
|
-
|
|
15381
|
-
requiredFields
|
|
15832
|
+
idNumberType,
|
|
15833
|
+
obscuredFields,
|
|
15834
|
+
requiredFields,
|
|
15835
|
+
fieldConfig: propFieldConfig,
|
|
15836
|
+
shouldValidate: propShouldValidate
|
|
15382
15837
|
} = props;
|
|
15383
15838
|
const stateRef = useRef({
|
|
15384
15839
|
setState: null
|
|
15385
15840
|
});
|
|
15386
|
-
const formUtils = formUtilities(props, i18n);
|
|
15387
15841
|
const [errors, setErrors] = useState(propErrors);
|
|
15388
15842
|
const [data, setData] = useState({
|
|
15389
15843
|
...propData,
|
|
15390
15844
|
idNumberExempt: !!(propData == null ? void 0 : propData.idNumberExempt)
|
|
15391
15845
|
});
|
|
15392
|
-
const
|
|
15393
|
-
const
|
|
15394
|
-
const
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
|
|
15398
|
-
|
|
15846
|
+
const schema = requiredFields ?? idNumberFields;
|
|
15847
|
+
const fieldConfig = propFieldConfig ?? defaultFieldConfig$5;
|
|
15848
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
15849
|
+
idNumberType
|
|
15850
|
+
}, defaultFieldMetadata$5);
|
|
15851
|
+
const mergedProps = mergeFieldMetadataIntoProps("idNumber", metadata, {
|
|
15852
|
+
requiredFields: schema,
|
|
15853
|
+
obscuredFields
|
|
15854
|
+
});
|
|
15855
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
15399
15856
|
const {
|
|
15400
15857
|
handleChangeFor,
|
|
15401
15858
|
data: formData,
|
|
@@ -15406,13 +15863,12 @@ function IdentityNumber(props) {
|
|
|
15406
15863
|
setErrors: setFormErrors,
|
|
15407
15864
|
triggerValidation
|
|
15408
15865
|
} = useForm({
|
|
15409
|
-
...
|
|
15410
|
-
schema
|
|
15411
|
-
formatters: formattingRules,
|
|
15412
|
-
rules: customRules || validationRules,
|
|
15866
|
+
...mergedProps,
|
|
15867
|
+
schema,
|
|
15413
15868
|
defaultData: propData,
|
|
15869
|
+
rules: mergedProps.validators,
|
|
15414
15870
|
fieldProblems: fieldValidationErrors,
|
|
15415
|
-
|
|
15871
|
+
obscuredFields
|
|
15416
15872
|
});
|
|
15417
15873
|
useEffect(() => {
|
|
15418
15874
|
if (propErrors && propErrors.idNumber) {
|
|
@@ -15471,37 +15927,30 @@ function IdentityNumber(props) {
|
|
|
15471
15927
|
}
|
|
15472
15928
|
});
|
|
15473
15929
|
}, [data, valid, errors, fieldProblems, dataStoreId]);
|
|
15474
|
-
const classModifiers = [formUtils.isRequiredField("idNumberExempt") ? "idNumberWithExempt" : "idNumber"];
|
|
15475
|
-
if (classNames)
|
|
15476
|
-
classModifiers.push(...classNames);
|
|
15477
15930
|
return jsx("div", {
|
|
15478
15931
|
className: "adyen-kyc-field__id-number",
|
|
15479
15932
|
children: formUtils.isRequiredField("idNumber") && jsxs(Fragment, {
|
|
15480
|
-
children: [jsx(
|
|
15933
|
+
children: [jsx(MaskedInputText, {
|
|
15481
15934
|
name: "idNumber",
|
|
15482
|
-
label: formUtils.getLabel("idNumber"),
|
|
15483
|
-
|
|
15935
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
15936
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
15937
|
+
classNameModifiers: {
|
|
15938
|
+
field: ["idNumber"],
|
|
15939
|
+
input: ["idNumber"]
|
|
15940
|
+
},
|
|
15484
15941
|
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
15485
|
-
|
|
15942
|
+
shouldValidate: propShouldValidate,
|
|
15486
15943
|
isValid: valid.idNumber,
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
"aria-label": formUtils.getLabel("idNumber", "idNumber"),
|
|
15498
|
-
"aria-invalid": !valid.idNumber,
|
|
15499
|
-
inputMode: "numeric",
|
|
15500
|
-
maxLength: maxLengthForField,
|
|
15501
|
-
...data.idNumberExempt && {
|
|
15502
|
-
disabled: true
|
|
15503
|
-
}
|
|
15504
|
-
})
|
|
15944
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
15945
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
15946
|
+
"aria-invalid": !valid.idNumber,
|
|
15947
|
+
disabled: data.idNumberExempt,
|
|
15948
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
15949
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
15950
|
+
value: data.idNumber ?? "",
|
|
15951
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
15952
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
15953
|
+
...formUtils.getMask("idNumber")
|
|
15505
15954
|
}), jsx(Field, {
|
|
15506
15955
|
classNameModifiers: ["idNumber__checkbox"],
|
|
15507
15956
|
name: "idNumberExempt",
|
|
@@ -15520,7 +15969,6 @@ function IdentityNumber(props) {
|
|
|
15520
15969
|
})
|
|
15521
15970
|
});
|
|
15522
15971
|
}
|
|
15523
|
-
const IdentityNumberComponent = memo(IdentityNumber, (prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors));
|
|
15524
15972
|
const roleMetadata = {
|
|
15525
15973
|
[DecisionMakerType.CONTROLLING_PERSON]: {
|
|
15526
15974
|
name: "controllingPerson",
|
|
@@ -15909,12 +16357,8 @@ const personalDetailsValidationRules = {
|
|
|
15909
16357
|
errorMessage: "fieldIsRequired"
|
|
15910
16358
|
}
|
|
15911
16359
|
};
|
|
15912
|
-
const mapIdentityTypeToItem = (type, label) => ({
|
|
15913
|
-
id: type,
|
|
15914
|
-
name: label
|
|
15915
|
-
});
|
|
15916
16360
|
const TypeOfIdentity = ({
|
|
15917
|
-
|
|
16361
|
+
availableIdentityTypesOptions,
|
|
15918
16362
|
selectedIdentityType,
|
|
15919
16363
|
setSelectedIdentityType,
|
|
15920
16364
|
label,
|
|
@@ -15933,7 +16377,13 @@ const TypeOfIdentity = ({
|
|
|
15933
16377
|
children: (childProps) => jsx(Select, {
|
|
15934
16378
|
...childProps,
|
|
15935
16379
|
isInvalid: false,
|
|
15936
|
-
items:
|
|
16380
|
+
items: availableIdentityTypesOptions.map(({
|
|
16381
|
+
id: id2,
|
|
16382
|
+
name
|
|
16383
|
+
}) => ({
|
|
16384
|
+
id: id2,
|
|
16385
|
+
name: i18n.get(name)
|
|
16386
|
+
})),
|
|
15937
16387
|
placeholder: i18n.get("id"),
|
|
15938
16388
|
selected: selectedIdentityType,
|
|
15939
16389
|
onChange: (event) => setSelectedIdentityType(event.target.value)
|
|
@@ -15945,48 +16395,26 @@ const isTruthyValidator = {
|
|
|
15945
16395
|
modes: ["blur"],
|
|
15946
16396
|
errorMessage: "fieldIsRequired"
|
|
15947
16397
|
};
|
|
16398
|
+
const isNotEmptyValidator = {
|
|
16399
|
+
validate: (value) => !isEmpty(value),
|
|
16400
|
+
modes: ["blur"],
|
|
16401
|
+
errorMessage: "fieldIsRequired"
|
|
16402
|
+
};
|
|
15948
16403
|
const auIdentityValidationRules = {
|
|
15949
16404
|
typeOfIdentity: [isTruthyValidator],
|
|
15950
|
-
idNumber: [{
|
|
15951
|
-
validate: (value, context) => {
|
|
15952
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
15953
|
-
case "passport":
|
|
15954
|
-
return PassportNumberPatterns.AU.test(value ?? "");
|
|
15955
|
-
case "driversLicense":
|
|
15956
|
-
return DriversLicenseNumberPatterns.AU.test(value ?? "");
|
|
15957
|
-
default:
|
|
15958
|
-
return false;
|
|
15959
|
-
}
|
|
15960
|
-
},
|
|
15961
|
-
errorMessage: (_, context) => {
|
|
15962
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
15963
|
-
case "passport":
|
|
15964
|
-
return "invalidFormatForAuPassportNumber";
|
|
15965
|
-
case "driversLicense":
|
|
15966
|
-
return "invalidFormatForAuDriversLicenseNumber";
|
|
15967
|
-
}
|
|
15968
|
-
},
|
|
15969
|
-
modes: ["blur"]
|
|
15970
|
-
}],
|
|
15971
|
-
licenseCardNumber: [{
|
|
15972
|
-
validate: (value) => DriversLicenseNumberPatterns.AU.test(value ?? ""),
|
|
15973
|
-
errorMessage: "invalidFormatForAuDriversLicenseCardNumber",
|
|
15974
|
-
modes: ["blur"]
|
|
15975
|
-
}],
|
|
15976
16405
|
issuerState: [isTruthyValidator]
|
|
15977
16406
|
};
|
|
15978
|
-
const DriversLicense$
|
|
16407
|
+
const DriversLicense$1 = ({
|
|
15979
16408
|
driversLicense: driversLicense2,
|
|
15980
16409
|
onIssuerStateChange,
|
|
15981
16410
|
onLicenseNumberInput,
|
|
15982
16411
|
onLicenseNumberBlur,
|
|
15983
16412
|
onCardNumberInput,
|
|
15984
16413
|
onCardNumberBlur,
|
|
15985
|
-
formUtils
|
|
15986
|
-
getLabel
|
|
15987
|
-
},
|
|
16414
|
+
formUtils,
|
|
15988
16415
|
isValid,
|
|
15989
|
-
errorMessages
|
|
16416
|
+
errorMessages,
|
|
16417
|
+
shouldValidate
|
|
15990
16418
|
}) => {
|
|
15991
16419
|
const {
|
|
15992
16420
|
i18n
|
|
@@ -15997,7 +16425,7 @@ const DriversLicense$2 = ({
|
|
|
15997
16425
|
return jsxs(Fragment, {
|
|
15998
16426
|
children: [jsx(Field, {
|
|
15999
16427
|
name: "issuerState",
|
|
16000
|
-
label: getLabel("issuerState"),
|
|
16428
|
+
label: formUtils.getLabel("issuerState"),
|
|
16001
16429
|
isValid: isValid.issuerState,
|
|
16002
16430
|
errorMessage: errorMessages.issuerState,
|
|
16003
16431
|
children: (childProps) => jsx(Select, {
|
|
@@ -16010,32 +16438,46 @@ const DriversLicense$2 = ({
|
|
|
16010
16438
|
})
|
|
16011
16439
|
}), jsxs("div", {
|
|
16012
16440
|
className: "adyen-kyc-field-wrapper",
|
|
16013
|
-
children: [jsx(
|
|
16014
|
-
name: "
|
|
16015
|
-
label: getLabel("idNumber", "
|
|
16441
|
+
children: [jsx(MaskedInputText, {
|
|
16442
|
+
name: "idNumber",
|
|
16443
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16444
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16445
|
+
classNameModifiers: {
|
|
16446
|
+
field: ["idNumber"],
|
|
16447
|
+
input: ["idNumber"]
|
|
16448
|
+
},
|
|
16449
|
+
errorMessage: formUtils.getErrorMessage("idNumber", null, void 0),
|
|
16450
|
+
shouldValidate,
|
|
16016
16451
|
isValid: isValid.idNumber,
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
}), jsx(
|
|
16452
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16453
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16454
|
+
"aria-invalid": !isValid.idNumber,
|
|
16455
|
+
onBlur: onLicenseNumberBlur,
|
|
16456
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16457
|
+
value: driversLicense2.idNumber ?? "",
|
|
16458
|
+
onInput: onLicenseNumberInput,
|
|
16459
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16460
|
+
...formUtils.getMask("idNumber")
|
|
16461
|
+
}), jsx(MaskedInputText, {
|
|
16027
16462
|
name: "licenseCardNumber",
|
|
16028
|
-
label: getLabel("licenseCardNumber"),
|
|
16463
|
+
label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
|
|
16464
|
+
formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
|
|
16465
|
+
classNameModifiers: {
|
|
16466
|
+
field: ["licenseCardNumber"],
|
|
16467
|
+
input: ["licenseCardNumber"]
|
|
16468
|
+
},
|
|
16469
|
+
errorMessage: formUtils.getErrorMessage("licenseCardNumber", null, void 0),
|
|
16470
|
+
shouldValidate,
|
|
16029
16471
|
isValid: isValid.licenseCardNumber,
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16472
|
+
"aria-required": formUtils.isRequiredField("licenseCardNumber"),
|
|
16473
|
+
"aria-label": formUtils.getLabel("licenseCardNumber"),
|
|
16474
|
+
"aria-invalid": !isValid.licenseCardNumber,
|
|
16475
|
+
onBlur: onCardNumberBlur,
|
|
16476
|
+
readonly: formUtils.isReadOnly("licenseCardNumber"),
|
|
16477
|
+
value: driversLicense2.licenseCardNumber ?? "",
|
|
16478
|
+
onInput: onCardNumberInput,
|
|
16479
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("licenseCardNumber"),
|
|
16480
|
+
...formUtils.getMask("licenseCardNumber")
|
|
16039
16481
|
})]
|
|
16040
16482
|
}), jsx(ContextGuidance, {
|
|
16041
16483
|
page: "Personal details",
|
|
@@ -16053,34 +16495,43 @@ const DriversLicense$2 = ({
|
|
|
16053
16495
|
})]
|
|
16054
16496
|
});
|
|
16055
16497
|
};
|
|
16056
|
-
const
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
value: passportNumber2,
|
|
16074
|
-
onInput,
|
|
16075
|
-
onBlur,
|
|
16076
|
-
placeholder: ""
|
|
16077
|
-
})
|
|
16078
|
-
});
|
|
16079
|
-
function IdentityAuComponent(props) {
|
|
16080
|
-
var _a;
|
|
16081
|
-
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
16082
|
-
props.data.typeOfIdentity = void 0;
|
|
16498
|
+
const licenseCardNumberMetaData$1 = resolveFieldMetadata(licenseCardNumberDefaultConfig[CountryCodes.Australia], {}, licenseCardNumberDefaultMetadata);
|
|
16499
|
+
function IdentityAuComponent({
|
|
16500
|
+
labels: labels2,
|
|
16501
|
+
data: propsData,
|
|
16502
|
+
placeholders,
|
|
16503
|
+
helperText,
|
|
16504
|
+
requiredFields,
|
|
16505
|
+
readOnlyFields,
|
|
16506
|
+
optionalFields,
|
|
16507
|
+
obscuredFields,
|
|
16508
|
+
shouldValidate,
|
|
16509
|
+
fieldValidationErrors,
|
|
16510
|
+
validators
|
|
16511
|
+
}) {
|
|
16512
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16513
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16514
|
+
propsData.typeOfIdentity = void 0;
|
|
16083
16515
|
}
|
|
16516
|
+
const initialFormUtilProps = {
|
|
16517
|
+
validators: {
|
|
16518
|
+
...auIdentityValidationRules,
|
|
16519
|
+
...validators
|
|
16520
|
+
},
|
|
16521
|
+
labels: labels2,
|
|
16522
|
+
obscuredFields,
|
|
16523
|
+
placeholders,
|
|
16524
|
+
helperText,
|
|
16525
|
+
readOnlyFields,
|
|
16526
|
+
optionalFields,
|
|
16527
|
+
requiredFields
|
|
16528
|
+
};
|
|
16529
|
+
const mergedProps = useMemo(() => {
|
|
16530
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.Australia], {
|
|
16531
|
+
idNumberType: identityType
|
|
16532
|
+
}, defaultFieldMetadata$5);
|
|
16533
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, mergeFieldMetadataIntoProps("licenseCardNumber", licenseCardNumberMetaData$1, initialFormUtilProps));
|
|
16534
|
+
}, [identityType]);
|
|
16084
16535
|
const {
|
|
16085
16536
|
handleChangeFor,
|
|
16086
16537
|
triggerValidation,
|
|
@@ -16089,16 +16540,17 @@ function IdentityAuComponent(props) {
|
|
|
16089
16540
|
fieldProblems,
|
|
16090
16541
|
valid
|
|
16091
16542
|
} = useForm({
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16543
|
+
schema: requiredFields ?? [],
|
|
16544
|
+
defaultData: propsData,
|
|
16545
|
+
fieldProblems: fieldValidationErrors,
|
|
16546
|
+
rules: mergedProps.validators,
|
|
16547
|
+
obscuredFields,
|
|
16548
|
+
shouldValidate
|
|
16098
16549
|
});
|
|
16099
16550
|
useEffect(() => {
|
|
16100
|
-
if (data.typeOfIdentity)
|
|
16101
|
-
|
|
16551
|
+
if (data.typeOfIdentity) {
|
|
16552
|
+
setIdentityType(data.typeOfIdentity);
|
|
16553
|
+
}
|
|
16102
16554
|
}, [data.typeOfIdentity]);
|
|
16103
16555
|
const {
|
|
16104
16556
|
sliceData,
|
|
@@ -16116,25 +16568,36 @@ function IdentityAuComponent(props) {
|
|
|
16116
16568
|
const {
|
|
16117
16569
|
i18n
|
|
16118
16570
|
} = useI18nContext();
|
|
16119
|
-
const formUtils = formUtilities(
|
|
16120
|
-
const availableIdentityTypes = ["passport", "driversLicense"];
|
|
16121
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
16571
|
+
const formUtils = useMemo(() => formUtilities(mergedProps, i18n), [mergedProps]);
|
|
16122
16572
|
return jsxs(Fragment, {
|
|
16123
16573
|
children: [jsx(TypeOfIdentity, {
|
|
16124
|
-
|
|
16125
|
-
selectedIdentityType,
|
|
16574
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.AU,
|
|
16575
|
+
selectedIdentityType: identityType,
|
|
16126
16576
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16127
16577
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16128
16578
|
isValid: valid.typeOfIdentity,
|
|
16129
16579
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16130
|
-
}), data.typeOfIdentity === "passport" ? jsx(
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16580
|
+
}), data.typeOfIdentity === "passport" ? jsx(MaskedInputText, {
|
|
16581
|
+
name: "idNumber",
|
|
16582
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16583
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16584
|
+
classNameModifiers: {
|
|
16585
|
+
field: ["idNumber"],
|
|
16586
|
+
input: ["idNumber"]
|
|
16587
|
+
},
|
|
16588
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16589
|
+
shouldValidate,
|
|
16135
16590
|
isValid: valid.idNumber,
|
|
16136
|
-
|
|
16137
|
-
|
|
16591
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16592
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16593
|
+
"aria-invalid": !valid.idNumber,
|
|
16594
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16595
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16596
|
+
value: data.idNumber ?? "",
|
|
16597
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16598
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16599
|
+
...formUtils.getMask("idNumber")
|
|
16600
|
+
}) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense$1, {
|
|
16138
16601
|
driversLicense: data,
|
|
16139
16602
|
onIssuerStateChange: handleChangeFor("issuerState"),
|
|
16140
16603
|
onLicenseNumberInput: handleChangeFor("idNumber", "input"),
|
|
@@ -16151,132 +16614,66 @@ function IdentityAuComponent(props) {
|
|
|
16151
16614
|
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16152
16615
|
licenseCardNumber: formUtils.getErrorMessage("licenseCardNumber", errors, fieldProblems),
|
|
16153
16616
|
issuerState: formUtils.getErrorMessage("issuerState", errors, fieldProblems)
|
|
16154
|
-
}
|
|
16617
|
+
},
|
|
16618
|
+
shouldValidate
|
|
16155
16619
|
}) : void 0]
|
|
16156
16620
|
});
|
|
16157
16621
|
}
|
|
16158
|
-
const isValidatePassportNumber = (value) => PassportNumberPatterns.HK.test(value);
|
|
16159
16622
|
const identityValidationRules = {
|
|
16160
|
-
typeOfIdentity: [isTruthyValidator]
|
|
16161
|
-
idNumber: [{
|
|
16162
|
-
validate: (val, context) => {
|
|
16163
|
-
const value = val ?? "";
|
|
16164
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16165
|
-
case "passport":
|
|
16166
|
-
return isValidatePassportNumber(value);
|
|
16167
|
-
case "driversLicense":
|
|
16168
|
-
return DriversLicenseNumberPatterns.HK.test(value);
|
|
16169
|
-
case "proofOfIdentityCard":
|
|
16170
|
-
return ProofOfIdentityCardPatterns.HK.test(value);
|
|
16171
|
-
default:
|
|
16172
|
-
return false;
|
|
16173
|
-
}
|
|
16174
|
-
},
|
|
16175
|
-
errorMessage: (_, context) => {
|
|
16176
|
-
switch (context == null ? void 0 : context.state.data.typeOfIdentity) {
|
|
16177
|
-
case "passport":
|
|
16178
|
-
return "invalidFormatForHKPassportNumber";
|
|
16179
|
-
case "driversLicense":
|
|
16180
|
-
return "invalidFormatForHKDriversLicenseNumber";
|
|
16181
|
-
case "proofOfIdentityCard":
|
|
16182
|
-
return "invalidFormatForHKIdentityCardNumber";
|
|
16183
|
-
}
|
|
16184
|
-
},
|
|
16185
|
-
modes: ["blur"]
|
|
16186
|
-
}]
|
|
16623
|
+
typeOfIdentity: [isTruthyValidator]
|
|
16187
16624
|
};
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
children: (childProps) => jsx(InputText, {
|
|
16205
|
-
...childProps,
|
|
16206
|
-
name: "licenseNumber",
|
|
16207
|
-
value: driversLicense2.idNumber,
|
|
16208
|
-
onInput: onLicenseNumberInput,
|
|
16209
|
-
onBlur: onLicenseNumberBlur,
|
|
16210
|
-
placeholder: ""
|
|
16211
|
-
})
|
|
16212
|
-
})
|
|
16213
|
-
});
|
|
16214
|
-
};
|
|
16215
|
-
const PassportNumber$1 = ({
|
|
16216
|
-
passportNumber: passportNumber2,
|
|
16217
|
-
onInput,
|
|
16218
|
-
onBlur,
|
|
16219
|
-
errorMessage,
|
|
16220
|
-
isValid,
|
|
16221
|
-
label
|
|
16222
|
-
}) => jsx(Field, {
|
|
16223
|
-
name: "passportNumber",
|
|
16224
|
-
label,
|
|
16225
|
-
errorMessage,
|
|
16226
|
-
isValid,
|
|
16227
|
-
children: (childProps) => jsx(InputText, {
|
|
16228
|
-
...childProps,
|
|
16229
|
-
name: "passportNumber",
|
|
16230
|
-
value: passportNumber2,
|
|
16231
|
-
onInput,
|
|
16232
|
-
onBlur,
|
|
16233
|
-
placeholder: ""
|
|
16234
|
-
})
|
|
16235
|
-
});
|
|
16236
|
-
const ProofOfIdentityCard = ({
|
|
16237
|
-
cardNumber,
|
|
16238
|
-
onInput,
|
|
16239
|
-
onBlur,
|
|
16240
|
-
label,
|
|
16241
|
-
errorMessage,
|
|
16242
|
-
isValid
|
|
16243
|
-
}) => jsx(Field, {
|
|
16244
|
-
name: "cardNumber",
|
|
16245
|
-
label,
|
|
16246
|
-
errorMessage,
|
|
16247
|
-
isValid,
|
|
16248
|
-
children: (childProps) => jsx(InputText, {
|
|
16249
|
-
...childProps,
|
|
16250
|
-
name: "cardNumber",
|
|
16251
|
-
value: cardNumber,
|
|
16252
|
-
onInput,
|
|
16253
|
-
onBlur,
|
|
16254
|
-
placeholder: ""
|
|
16255
|
-
})
|
|
16256
|
-
});
|
|
16257
|
-
function IdentityHKComponent(props) {
|
|
16258
|
-
var _a;
|
|
16259
|
-
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
16260
|
-
props.data.typeOfIdentity = void 0;
|
|
16625
|
+
function IdentityHKComponent({
|
|
16626
|
+
labels: labels2,
|
|
16627
|
+
data: propsData,
|
|
16628
|
+
placeholders,
|
|
16629
|
+
helperText,
|
|
16630
|
+
requiredFields,
|
|
16631
|
+
readOnlyFields,
|
|
16632
|
+
optionalFields,
|
|
16633
|
+
obscuredFields,
|
|
16634
|
+
shouldValidate,
|
|
16635
|
+
fieldValidationErrors,
|
|
16636
|
+
validators
|
|
16637
|
+
}) {
|
|
16638
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16639
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16640
|
+
propsData.typeOfIdentity = void 0;
|
|
16261
16641
|
}
|
|
16642
|
+
const initialFormUtilProps = {
|
|
16643
|
+
validators: {
|
|
16644
|
+
...identityValidationRules,
|
|
16645
|
+
...validators
|
|
16646
|
+
},
|
|
16647
|
+
labels: labels2,
|
|
16648
|
+
obscuredFields,
|
|
16649
|
+
placeholders,
|
|
16650
|
+
helperText,
|
|
16651
|
+
readOnlyFields,
|
|
16652
|
+
optionalFields,
|
|
16653
|
+
requiredFields
|
|
16654
|
+
};
|
|
16655
|
+
const mergedProps = useMemo(() => {
|
|
16656
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.HongKong], {
|
|
16657
|
+
idNumberType: identityType
|
|
16658
|
+
}, defaultFieldMetadata$5);
|
|
16659
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, initialFormUtilProps);
|
|
16660
|
+
}, [identityType]);
|
|
16262
16661
|
const {
|
|
16263
16662
|
handleChangeFor,
|
|
16264
|
-
triggerValidation,
|
|
16265
16663
|
data,
|
|
16266
16664
|
errors,
|
|
16267
16665
|
fieldProblems,
|
|
16268
16666
|
valid
|
|
16269
16667
|
} = useForm({
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16273
|
-
|
|
16274
|
-
|
|
16275
|
-
maskedFields: props.maskedFields
|
|
16668
|
+
schema: requiredFields ?? [],
|
|
16669
|
+
defaultData: propsData,
|
|
16670
|
+
fieldProblems: fieldValidationErrors,
|
|
16671
|
+
rules: mergedProps.validators,
|
|
16672
|
+
obscuredFields
|
|
16276
16673
|
});
|
|
16277
16674
|
useEffect(() => {
|
|
16278
16675
|
if (data.typeOfIdentity) {
|
|
16279
|
-
|
|
16676
|
+
setIdentityType(data.typeOfIdentity);
|
|
16280
16677
|
}
|
|
16281
16678
|
}, [data.typeOfIdentity]);
|
|
16282
16679
|
const {
|
|
@@ -16297,76 +16694,40 @@ function IdentityHKComponent(props) {
|
|
|
16297
16694
|
const {
|
|
16298
16695
|
i18n
|
|
16299
16696
|
} = useI18nContext();
|
|
16300
|
-
const formUtils = formUtilities(
|
|
16301
|
-
const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
|
|
16302
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
16697
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
16303
16698
|
return jsxs(Fragment, {
|
|
16304
16699
|
children: [jsx(TypeOfIdentity, {
|
|
16305
|
-
|
|
16306
|
-
selectedIdentityType,
|
|
16700
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.HK,
|
|
16701
|
+
selectedIdentityType: identityType,
|
|
16307
16702
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16308
16703
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16309
16704
|
isValid: valid.typeOfIdentity,
|
|
16310
16705
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16311
|
-
}),
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16706
|
+
}), jsx(MaskedInputText, {
|
|
16707
|
+
name: "idNumber",
|
|
16708
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16709
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16710
|
+
classNameModifiers: {
|
|
16711
|
+
field: ["idNumber"],
|
|
16712
|
+
input: ["idNumber"]
|
|
16713
|
+
},
|
|
16714
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16715
|
+
shouldValidate,
|
|
16315
16716
|
isValid: valid.idNumber,
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
cardNumber: data.idNumber ?? "",
|
|
16320
|
-
onInput: handleChangeFor("idNumber", "input"),
|
|
16717
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16718
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16719
|
+
"aria-invalid": !valid.idNumber,
|
|
16321
16720
|
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
onLicenseNumberBlur: handleChangeFor("idNumber", "blur"),
|
|
16329
|
-
label: formUtils.getLabel("idNumber", "driverLicense"),
|
|
16330
|
-
isValid: {
|
|
16331
|
-
idNumber: valid.idNumber
|
|
16332
|
-
},
|
|
16333
|
-
errorMessages: {
|
|
16334
|
-
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
|
|
16335
|
-
}
|
|
16336
|
-
}) : void 0]
|
|
16721
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16722
|
+
value: data.idNumber ?? "",
|
|
16723
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16724
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16725
|
+
...formUtils.getMask("idNumber")
|
|
16726
|
+
})]
|
|
16337
16727
|
});
|
|
16338
16728
|
}
|
|
16339
16729
|
const nzIdentityValidationRules = {
|
|
16340
|
-
typeOfIdentity: [isTruthyValidator]
|
|
16341
|
-
idNumber: [{
|
|
16342
|
-
validate: (val, context) => {
|
|
16343
|
-
var _a, _b;
|
|
16344
|
-
const value = val ?? "";
|
|
16345
|
-
switch ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.typeOfIdentity) {
|
|
16346
|
-
case "passport":
|
|
16347
|
-
return PassportNumberPatterns[CountryCodes.NewZealand].test(value);
|
|
16348
|
-
case "driversLicense":
|
|
16349
|
-
return DriversLicenseNumberPatterns[CountryCodes.NewZealand].test(value);
|
|
16350
|
-
default:
|
|
16351
|
-
return false;
|
|
16352
|
-
}
|
|
16353
|
-
},
|
|
16354
|
-
errorMessage: (_, context) => {
|
|
16355
|
-
var _a, _b;
|
|
16356
|
-
switch ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.typeOfIdentity) {
|
|
16357
|
-
case "passport":
|
|
16358
|
-
return "invalidFormatForNZPassportNumber";
|
|
16359
|
-
case "driversLicense":
|
|
16360
|
-
return "invalidFormatForNZDriversLicenseNumber";
|
|
16361
|
-
}
|
|
16362
|
-
},
|
|
16363
|
-
modes: ["blur"]
|
|
16364
|
-
}],
|
|
16365
|
-
licenseCardNumber: [{
|
|
16366
|
-
validate: (value) => DriversLicenseCardNumberPatterns[CountryCodes.NewZealand].test(value ?? ""),
|
|
16367
|
-
errorMessage: "invalidFormatForNZDriversLicenseCardNumber",
|
|
16368
|
-
modes: ["blur"]
|
|
16369
|
-
}]
|
|
16730
|
+
typeOfIdentity: [isTruthyValidator]
|
|
16370
16731
|
};
|
|
16371
16732
|
const DriversLicense = ({
|
|
16372
16733
|
driversLicense: driversLicense2,
|
|
@@ -16374,11 +16735,10 @@ const DriversLicense = ({
|
|
|
16374
16735
|
onLicenseNumberBlur,
|
|
16375
16736
|
onCardNumberInput,
|
|
16376
16737
|
onCardNumberBlur,
|
|
16377
|
-
formUtils
|
|
16378
|
-
getLabel
|
|
16379
|
-
},
|
|
16738
|
+
formUtils,
|
|
16380
16739
|
isValid,
|
|
16381
|
-
errorMessages
|
|
16740
|
+
errorMessages,
|
|
16741
|
+
shouldValidate
|
|
16382
16742
|
}) => {
|
|
16383
16743
|
const {
|
|
16384
16744
|
i18n
|
|
@@ -16386,32 +16746,46 @@ const DriversLicense = ({
|
|
|
16386
16746
|
return jsxs(Fragment, {
|
|
16387
16747
|
children: [jsxs("div", {
|
|
16388
16748
|
className: "adyen-kyc-field-wrapper",
|
|
16389
|
-
children: [jsx(
|
|
16390
|
-
name: "
|
|
16391
|
-
label: getLabel("idNumber", "
|
|
16392
|
-
|
|
16749
|
+
children: [jsx(MaskedInputText, {
|
|
16750
|
+
name: "idNumber",
|
|
16751
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16752
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16753
|
+
classNameModifiers: {
|
|
16754
|
+
field: ["idNumber"],
|
|
16755
|
+
input: ["idNumber"]
|
|
16756
|
+
},
|
|
16393
16757
|
errorMessage: errorMessages.idNumber,
|
|
16394
|
-
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16758
|
+
shouldValidate,
|
|
16759
|
+
isValid: isValid.idNumber,
|
|
16760
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16761
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16762
|
+
"aria-invalid": !isValid.idNumber,
|
|
16763
|
+
onBlur: onLicenseNumberBlur,
|
|
16764
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16765
|
+
value: driversLicense2.idNumber ?? "",
|
|
16766
|
+
onInput: onLicenseNumberInput,
|
|
16767
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16768
|
+
...formUtils.getMask("idNumber")
|
|
16769
|
+
}), jsx(MaskedInputText, {
|
|
16403
16770
|
name: "licenseCardNumber",
|
|
16404
|
-
label: getLabel("
|
|
16405
|
-
|
|
16771
|
+
label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
|
|
16772
|
+
formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
|
|
16773
|
+
classNameModifiers: {
|
|
16774
|
+
field: ["licenseCardNumber"],
|
|
16775
|
+
input: ["licenseCardNumber"]
|
|
16776
|
+
},
|
|
16406
16777
|
errorMessage: errorMessages.licenseCardNumber,
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
|
|
16778
|
+
shouldValidate,
|
|
16779
|
+
isValid: isValid.licenseCardNumber,
|
|
16780
|
+
"aria-required": formUtils.isRequiredField("licenseCardNumber"),
|
|
16781
|
+
"aria-label": formUtils.getLabel("licenseCardNumber"),
|
|
16782
|
+
"aria-invalid": !isValid.licenseCardNumber,
|
|
16783
|
+
onBlur: onCardNumberBlur,
|
|
16784
|
+
readonly: formUtils.isReadOnly("licenseCardNumber"),
|
|
16785
|
+
value: driversLicense2.licenseCardNumber ?? "",
|
|
16786
|
+
onInput: onCardNumberInput,
|
|
16787
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("licenseCardNumber"),
|
|
16788
|
+
...formUtils.getMask("licenseCardNumber")
|
|
16415
16789
|
})]
|
|
16416
16790
|
}), jsx(ContextGuidance, {
|
|
16417
16791
|
page: "Personal details",
|
|
@@ -16429,34 +16803,43 @@ const DriversLicense = ({
|
|
|
16429
16803
|
})]
|
|
16430
16804
|
});
|
|
16431
16805
|
};
|
|
16432
|
-
const
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
|
|
16449
|
-
value: passportNumber2,
|
|
16450
|
-
onInput,
|
|
16451
|
-
onBlur,
|
|
16452
|
-
placeholder: ""
|
|
16453
|
-
})
|
|
16454
|
-
});
|
|
16455
|
-
function IdentityNZComponent(props) {
|
|
16456
|
-
var _a;
|
|
16457
|
-
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
16458
|
-
props.data.typeOfIdentity = void 0;
|
|
16806
|
+
const licenseCardNumberMetaData = resolveFieldMetadata(licenseCardNumberDefaultConfig[CountryCodes.NewZealand], {}, licenseCardNumberDefaultMetadata);
|
|
16807
|
+
function IdentityNZComponent({
|
|
16808
|
+
labels: labels2,
|
|
16809
|
+
data: propsData,
|
|
16810
|
+
placeholders,
|
|
16811
|
+
helperText,
|
|
16812
|
+
requiredFields,
|
|
16813
|
+
readOnlyFields,
|
|
16814
|
+
optionalFields,
|
|
16815
|
+
obscuredFields,
|
|
16816
|
+
shouldValidate,
|
|
16817
|
+
fieldValidationErrors,
|
|
16818
|
+
validators
|
|
16819
|
+
}) {
|
|
16820
|
+
const [identityType, setIdentityType] = useState(propsData == null ? void 0 : propsData.typeOfIdentity);
|
|
16821
|
+
if ((propsData == null ? void 0 : propsData.typeOfIdentity) === "nationalIdNumber") {
|
|
16822
|
+
propsData.typeOfIdentity = void 0;
|
|
16459
16823
|
}
|
|
16824
|
+
const initialFormUtilProps = {
|
|
16825
|
+
validators: {
|
|
16826
|
+
...nzIdentityValidationRules,
|
|
16827
|
+
...validators
|
|
16828
|
+
},
|
|
16829
|
+
labels: labels2,
|
|
16830
|
+
obscuredFields,
|
|
16831
|
+
placeholders,
|
|
16832
|
+
helperText,
|
|
16833
|
+
readOnlyFields,
|
|
16834
|
+
optionalFields,
|
|
16835
|
+
requiredFields
|
|
16836
|
+
};
|
|
16837
|
+
const mergedProps = useMemo(() => {
|
|
16838
|
+
const idNumberMetadata = resolveFieldMetadata(defaultFieldConfig$5[CountryCodes.NewZealand], {
|
|
16839
|
+
idNumberType: identityType
|
|
16840
|
+
}, defaultFieldMetadata$5);
|
|
16841
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, mergeFieldMetadataIntoProps("licenseCardNumber", licenseCardNumberMetaData, initialFormUtilProps));
|
|
16842
|
+
}, [identityType]);
|
|
16460
16843
|
const {
|
|
16461
16844
|
handleChangeFor,
|
|
16462
16845
|
triggerValidation,
|
|
@@ -16465,16 +16848,17 @@ function IdentityNZComponent(props) {
|
|
|
16465
16848
|
fieldProblems,
|
|
16466
16849
|
valid
|
|
16467
16850
|
} = useForm({
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16851
|
+
schema: requiredFields ?? [],
|
|
16852
|
+
defaultData: propsData,
|
|
16853
|
+
fieldProblems: fieldValidationErrors,
|
|
16854
|
+
rules: mergedProps.validators,
|
|
16855
|
+
obscuredFields,
|
|
16856
|
+
shouldValidate
|
|
16474
16857
|
});
|
|
16475
16858
|
useEffect(() => {
|
|
16476
|
-
if (data.typeOfIdentity)
|
|
16477
|
-
|
|
16859
|
+
if (data.typeOfIdentity) {
|
|
16860
|
+
setIdentityType(data.typeOfIdentity);
|
|
16861
|
+
}
|
|
16478
16862
|
}, [data.typeOfIdentity]);
|
|
16479
16863
|
const {
|
|
16480
16864
|
sliceData,
|
|
@@ -16492,28 +16876,39 @@ function IdentityNZComponent(props) {
|
|
|
16492
16876
|
const {
|
|
16493
16877
|
i18n
|
|
16494
16878
|
} = useI18nContext();
|
|
16495
|
-
const formUtils = formUtilities(
|
|
16496
|
-
const availableIdentityTypes = ["passport", "driversLicense"];
|
|
16497
|
-
const selectedIdentityType = data.typeOfIdentity;
|
|
16879
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
16498
16880
|
const today = /* @__PURE__ */ new Date();
|
|
16499
16881
|
const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
|
|
16500
16882
|
return jsxs(Fragment, {
|
|
16501
16883
|
children: [jsx(TypeOfIdentity, {
|
|
16502
|
-
|
|
16503
|
-
selectedIdentityType,
|
|
16884
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.NZ,
|
|
16885
|
+
selectedIdentityType: identityType,
|
|
16504
16886
|
setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
|
|
16505
16887
|
label: formUtils.getLabel("typeOfIdentity"),
|
|
16506
16888
|
isValid: valid.typeOfIdentity,
|
|
16507
16889
|
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
|
|
16508
16890
|
}), data.typeOfIdentity === "passport" ? jsxs("div", {
|
|
16509
16891
|
className: "adyen-kyc-field-wrapper",
|
|
16510
|
-
children: [jsx(
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
|
|
16892
|
+
children: [jsx(MaskedInputText, {
|
|
16893
|
+
name: "idNumber",
|
|
16894
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
16895
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
16896
|
+
classNameModifiers: {
|
|
16897
|
+
field: ["idNumber"],
|
|
16898
|
+
input: ["idNumber"]
|
|
16899
|
+
},
|
|
16900
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16901
|
+
shouldValidate,
|
|
16515
16902
|
isValid: valid.idNumber,
|
|
16516
|
-
|
|
16903
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
16904
|
+
"aria-label": formUtils.getLabel("idNumber"),
|
|
16905
|
+
"aria-invalid": !valid.idNumber,
|
|
16906
|
+
onBlur: handleChangeFor("idNumber", "blur"),
|
|
16907
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
16908
|
+
value: data.idNumber ?? "",
|
|
16909
|
+
onInput: handleChangeFor("idNumber", "input"),
|
|
16910
|
+
acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
|
|
16911
|
+
...formUtils.getMask("idNumber")
|
|
16517
16912
|
}), jsx(Field, {
|
|
16518
16913
|
name: "expiryDate",
|
|
16519
16914
|
label: formUtils.getLabel("passportExpiryDate"),
|
|
@@ -16549,7 +16944,8 @@ function IdentityNZComponent(props) {
|
|
|
16549
16944
|
errorMessages: {
|
|
16550
16945
|
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldProblems),
|
|
16551
16946
|
licenseCardNumber: formUtils.getErrorMessage("licenseCardNumber", errors, fieldProblems)
|
|
16552
|
-
}
|
|
16947
|
+
},
|
|
16948
|
+
shouldValidate
|
|
16553
16949
|
}) : void 0]
|
|
16554
16950
|
});
|
|
16555
16951
|
}
|
|
@@ -16558,41 +16954,14 @@ const ERROR_CODES = {
|
|
|
16558
16954
|
SSN_4_DIGITS_VALIDATION: "1_3062",
|
|
16559
16955
|
PERSONAL_DETAILS_VALIDATION: "1_30"
|
|
16560
16956
|
};
|
|
16561
|
-
const OPTIONS_SSN = {
|
|
16562
|
-
fourDigits: "4DigitSSN",
|
|
16563
|
-
nineDigits: "entireSSN"
|
|
16564
|
-
};
|
|
16565
16957
|
const IdentityUSComponent = forwardRef((props, ref) => {
|
|
16566
16958
|
var _a, _b, _c, _d;
|
|
16567
16959
|
const individualDetailsError = (_a = props.formVerificationErrors) == null ? void 0 : _a[ERROR_CODES.PERSONAL_DETAILS_VALIDATION];
|
|
16568
16960
|
const fourDigitsValidationError = (_b = individualDetailsError == null ? void 0 : individualDetailsError[ERROR_CODES.SSN_4_DIGITS_VALIDATION]) == null ? void 0 : _b.some((error) => error.code === ERROR_CODES.SSN_REMEDIATION);
|
|
16569
|
-
const ssnType = fourDigitsValidationError || ((_d = (_c = props.data) == null ? void 0 : _c.idNumber) == null ? void 0 : _d.length) === 9 ?
|
|
16570
|
-
let USIdentityProps = {
|
|
16571
|
-
...props
|
|
16572
|
-
};
|
|
16573
|
-
if (ssnType === OPTIONS_SSN.nineDigits) {
|
|
16574
|
-
const nineDigitsProps = {
|
|
16575
|
-
labels: {
|
|
16576
|
-
...props.labels,
|
|
16577
|
-
idNumber: "socialSecurityNumber9Digits"
|
|
16578
|
-
},
|
|
16579
|
-
country: "US9",
|
|
16580
|
-
placeholders: {
|
|
16581
|
-
...props.placeholders,
|
|
16582
|
-
idNumber: "SSNFormatUS9Digits"
|
|
16583
|
-
}
|
|
16584
|
-
};
|
|
16585
|
-
USIdentityProps = {
|
|
16586
|
-
...props,
|
|
16587
|
-
...nineDigitsProps
|
|
16588
|
-
};
|
|
16589
|
-
}
|
|
16590
|
-
if (ssnType === OPTIONS_SSN.fourDigits) {
|
|
16591
|
-
USIdentityProps.classNames = ["us4DigitsNumberId"];
|
|
16592
|
-
USIdentityProps.dataPlaceholder = "*** — ** — ";
|
|
16593
|
-
}
|
|
16961
|
+
const ssnType = fourDigitsValidationError || ((_d = (_c = props.data) == null ? void 0 : _c.idNumber) == null ? void 0 : _d.length) === 9 ? "ssn" : "ssnLastFour";
|
|
16594
16962
|
return jsx(IdentityNumberComponent, {
|
|
16595
|
-
...
|
|
16963
|
+
...props,
|
|
16964
|
+
idNumberType: ssnType,
|
|
16596
16965
|
ref
|
|
16597
16966
|
});
|
|
16598
16967
|
});
|
|
@@ -16645,9 +17014,6 @@ function IdentityComponent(props) {
|
|
|
16645
17014
|
dataStoreId
|
|
16646
17015
|
});
|
|
16647
17016
|
}
|
|
16648
|
-
const customFieldlabels = (selected) => ({
|
|
16649
|
-
idNumber: selected
|
|
16650
|
-
});
|
|
16651
17017
|
const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
|
|
16652
17018
|
function PersonalDetailsComponent(props) {
|
|
16653
17019
|
var _a;
|
|
@@ -16745,7 +17111,6 @@ function PersonalDetailsComponent(props) {
|
|
|
16745
17111
|
useEffect(() => {
|
|
16746
17112
|
setIdNumberType(defaultIdNumberType);
|
|
16747
17113
|
}, [props.data.residencyCountry]);
|
|
16748
|
-
const idNumberCustomLabel = customFieldlabels ? customFieldlabels(idNumberType) : {};
|
|
16749
17114
|
useEffect(() => {
|
|
16750
17115
|
stateRef.current.setState({
|
|
16751
17116
|
type: "addToState",
|
|
@@ -16852,8 +17217,7 @@ function PersonalDetailsComponent(props) {
|
|
|
16852
17217
|
personalDetails: props,
|
|
16853
17218
|
country: data.residencyCountry,
|
|
16854
17219
|
errors: externalErrors,
|
|
16855
|
-
idNumberType
|
|
16856
|
-
labels: idNumberCustomLabel
|
|
17220
|
+
idNumberType
|
|
16857
17221
|
}), (data.residencyCountry === "SG" || data.residencyCountry === "HK") && formUtils.isRequiredField("nationality") && jsx(CountryField, {
|
|
16858
17222
|
data: {
|
|
16859
17223
|
country: data.nationality
|
|
@@ -18167,10 +18531,82 @@ function BankAccountFormat(props) {
|
|
|
18167
18531
|
})
|
|
18168
18532
|
});
|
|
18169
18533
|
}
|
|
18170
|
-
const
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18534
|
+
const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
|
|
18535
|
+
if (maxLength) {
|
|
18536
|
+
return {
|
|
18537
|
+
label: "bankAccountNumber",
|
|
18538
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length},${maxLength}}$`)),
|
|
18539
|
+
mask: {
|
|
18540
|
+
mask: makeMask(...numericInputs(length), ...numericInputs(maxLength - length, true))
|
|
18541
|
+
},
|
|
18542
|
+
guidanceText: {
|
|
18543
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
18544
|
+
values: {
|
|
18545
|
+
maxDigits: `${maxLength}`,
|
|
18546
|
+
example
|
|
18547
|
+
}
|
|
18548
|
+
}
|
|
18549
|
+
};
|
|
18550
|
+
}
|
|
18551
|
+
return {
|
|
18552
|
+
label: "bankAccountNumber",
|
|
18553
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
|
|
18554
|
+
mask: {
|
|
18555
|
+
mask: makeMask(...numericInputs(length))
|
|
18556
|
+
},
|
|
18557
|
+
guidanceText: {
|
|
18558
|
+
key: "enterNDigitsForExample",
|
|
18559
|
+
values: {
|
|
18560
|
+
numDigits: `${length}`,
|
|
18561
|
+
example
|
|
18562
|
+
}
|
|
18563
|
+
}
|
|
18564
|
+
};
|
|
18565
|
+
};
|
|
18566
|
+
const defaultFieldMetadata$4 = {
|
|
18567
|
+
label: "bankAccountNumber",
|
|
18568
|
+
validators: isNotEmptyValidator
|
|
18569
|
+
};
|
|
18570
|
+
const defaultFieldConfig$4 = {
|
|
18571
|
+
[CountryCodes.Denmark]: simpleBankAccountNumberMetadata("2621955959", 10),
|
|
18572
|
+
[CountryCodes.Norway]: simpleBankAccountNumberMetadata("1117947", 7),
|
|
18573
|
+
[CountryCodes.UnitedKingdom]: simpleBankAccountNumberMetadata("10000003", 8),
|
|
18574
|
+
[CountryCodes.Australia]: simpleBankAccountNumberMetadata("0001234", 5, 10),
|
|
18575
|
+
[CountryCodes.Brazil]: simpleBankAccountNumberMetadata("0009795493", 4, 12),
|
|
18576
|
+
[CountryCodes.Canada]: simpleBankAccountNumberMetadata("10220001111", 5, 12),
|
|
18577
|
+
[CountryCodes.HongKong]: simpleBankAccountNumberMetadata("123456789001", 6, 18),
|
|
18578
|
+
[CountryCodes.Singapore]: simpleBankAccountNumberMetadata("0052312891876", 4, 19),
|
|
18579
|
+
[CountryCodes.Sweden]: simpleBankAccountNumberMetadata("123456789", 7, 10),
|
|
18580
|
+
[CountryCodes.UnitedStates]: simpleBankAccountNumberMetadata("10220001111", 3, 17),
|
|
18581
|
+
[CountryCodes.Poland]: {
|
|
18582
|
+
label: "bankAccountNumber",
|
|
18583
|
+
validators: validatePatternOnBlur(/^\d{26}$/),
|
|
18584
|
+
mask: {
|
|
18585
|
+
mask: makeMask(...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4))
|
|
18586
|
+
},
|
|
18587
|
+
guidanceText: {
|
|
18588
|
+
key: "enterNDigitsForExample",
|
|
18589
|
+
values: {
|
|
18590
|
+
numDigits: "26",
|
|
18591
|
+
example: "98 1090 2402 7474 4662 2173 1624"
|
|
18592
|
+
}
|
|
18593
|
+
}
|
|
18594
|
+
},
|
|
18595
|
+
[CountryCodes.NewZealand]: {
|
|
18596
|
+
label: "bankAccountNumber",
|
|
18597
|
+
validators: validatePatternOnBlur(/^\d{26}$/),
|
|
18598
|
+
mask: {
|
|
18599
|
+
mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(4), ...nonInputs(" - "), ...numericInputs(7), ...nonInputs(" - "), ...numericInputs(2), ...numericInputs(1, true))
|
|
18600
|
+
},
|
|
18601
|
+
guidanceText: {
|
|
18602
|
+
key: "enterXToYDigitsForExample",
|
|
18603
|
+
values: {
|
|
18604
|
+
minDigits: "15",
|
|
18605
|
+
maxDigits: "16",
|
|
18606
|
+
example: "12-8765-9876543-043"
|
|
18607
|
+
}
|
|
18608
|
+
}
|
|
18609
|
+
}
|
|
18174
18610
|
};
|
|
18175
18611
|
const bankAccountNumberFields = ["bankAccountNumber"];
|
|
18176
18612
|
function BankAccountNumber(props) {
|
|
@@ -18178,69 +18614,56 @@ function BankAccountNumber(props) {
|
|
|
18178
18614
|
i18n
|
|
18179
18615
|
} = useI18nContext();
|
|
18180
18616
|
const {
|
|
18181
|
-
|
|
18182
|
-
|
|
18617
|
+
country: country2,
|
|
18618
|
+
fieldConfig = defaultFieldConfig$4
|
|
18183
18619
|
} = props;
|
|
18184
|
-
const
|
|
18185
|
-
|
|
18186
|
-
});
|
|
18620
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$4);
|
|
18621
|
+
const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
|
|
18187
18622
|
const {
|
|
18188
18623
|
handleChangeFor,
|
|
18189
18624
|
data,
|
|
18190
18625
|
valid,
|
|
18191
18626
|
errors,
|
|
18192
|
-
isValid,
|
|
18193
18627
|
fieldProblems
|
|
18194
18628
|
} = useForm({
|
|
18195
|
-
...
|
|
18629
|
+
...mergedProps,
|
|
18196
18630
|
schema: bankAccountNumberFields,
|
|
18197
|
-
rules: validators,
|
|
18198
|
-
defaultData:
|
|
18199
|
-
fieldProblems:
|
|
18200
|
-
|
|
18201
|
-
bankAccountNumber: {
|
|
18202
|
-
formatter: (v) => v && !isValueMasked(v) ? stripNonAlphanumeric(v) : v
|
|
18203
|
-
}
|
|
18204
|
-
},
|
|
18205
|
-
maskedFields: props.maskedFields
|
|
18631
|
+
rules: mergedProps.validators,
|
|
18632
|
+
defaultData: mergedProps.data,
|
|
18633
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors,
|
|
18634
|
+
obscuredFields: mergedProps.obscuredFields
|
|
18206
18635
|
});
|
|
18636
|
+
const {
|
|
18637
|
+
updateStateSlice
|
|
18638
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankAccountNumber");
|
|
18207
18639
|
useEffect(() => {
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
valid,
|
|
18214
|
-
errors,
|
|
18215
|
-
fieldProblems,
|
|
18216
|
-
caller: "bankAccountNumber",
|
|
18217
|
-
dataStoreId
|
|
18218
|
-
}
|
|
18640
|
+
updateStateSlice({
|
|
18641
|
+
data,
|
|
18642
|
+
valid,
|
|
18643
|
+
errors,
|
|
18644
|
+
fieldProblems
|
|
18219
18645
|
});
|
|
18220
|
-
}, [data, valid, errors
|
|
18221
|
-
const formUtils = formUtilities(
|
|
18222
|
-
return
|
|
18223
|
-
|
|
18224
|
-
|
|
18225
|
-
|
|
18226
|
-
|
|
18227
|
-
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18232
|
-
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18236
|
-
|
|
18237
|
-
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
value: data.bankAccountNumber
|
|
18242
|
-
})
|
|
18243
|
-
})]
|
|
18646
|
+
}, [data, valid, errors]);
|
|
18647
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
18648
|
+
return jsx(MaskedInputText, {
|
|
18649
|
+
name: "bankAccountNumber",
|
|
18650
|
+
label: formUtils.getLabel("bankAccountNumber"),
|
|
18651
|
+
formatGuidance: formUtils.getGuidanceText("bankAccountNumber"),
|
|
18652
|
+
...formUtils.getMask("bankAccountNumber"),
|
|
18653
|
+
isValid: valid.bankAccountNumber,
|
|
18654
|
+
errorMessage: formUtils.getErrorMessage("bankAccountNumber", errors, fieldProblems),
|
|
18655
|
+
"aria-required": true,
|
|
18656
|
+
"aria-invalid": !valid.bankAccountNumber,
|
|
18657
|
+
"aria-label": formUtils.getLabel("bankAccountNumber"),
|
|
18658
|
+
classNameModifiers: {
|
|
18659
|
+
field: ["bankAccountNumber"],
|
|
18660
|
+
input: ["bankAccountNumber"]
|
|
18661
|
+
},
|
|
18662
|
+
onBlur: handleChangeFor("bankAccountNumber", "blur"),
|
|
18663
|
+
onInput: handleChangeFor("bankAccountNumber", "input"),
|
|
18664
|
+
readonly: formUtils.isReadOnly("bankAccountNumber"),
|
|
18665
|
+
value: data.bankAccountNumber ?? "",
|
|
18666
|
+
acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
|
|
18244
18667
|
});
|
|
18245
18668
|
}
|
|
18246
18669
|
const bankCityFields = ["bankCity"];
|
|
@@ -18249,18 +18672,13 @@ function BankCity(props) {
|
|
|
18249
18672
|
i18n
|
|
18250
18673
|
} = useI18nContext();
|
|
18251
18674
|
const {
|
|
18252
|
-
dataStoreId,
|
|
18253
18675
|
validators
|
|
18254
18676
|
} = props;
|
|
18255
|
-
const stateRef = useRef({
|
|
18256
|
-
setState: null
|
|
18257
|
-
});
|
|
18258
18677
|
const {
|
|
18259
18678
|
handleChangeFor,
|
|
18260
18679
|
data,
|
|
18261
18680
|
valid,
|
|
18262
18681
|
errors,
|
|
18263
|
-
isValid,
|
|
18264
18682
|
fieldProblems
|
|
18265
18683
|
} = useForm({
|
|
18266
18684
|
...props,
|
|
@@ -18269,106 +18687,120 @@ function BankCity(props) {
|
|
|
18269
18687
|
defaultData: props.data,
|
|
18270
18688
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
18271
18689
|
});
|
|
18690
|
+
const {
|
|
18691
|
+
updateStateSlice
|
|
18692
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankCity");
|
|
18272
18693
|
useEffect(() => {
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
valid,
|
|
18279
|
-
errors,
|
|
18280
|
-
fieldProblems,
|
|
18281
|
-
caller: "bankCity",
|
|
18282
|
-
dataStoreId
|
|
18283
|
-
}
|
|
18694
|
+
updateStateSlice({
|
|
18695
|
+
data,
|
|
18696
|
+
valid,
|
|
18697
|
+
errors,
|
|
18698
|
+
fieldProblems
|
|
18284
18699
|
});
|
|
18285
|
-
}, [data, valid, errors
|
|
18700
|
+
}, [data, valid, errors]);
|
|
18286
18701
|
const formUtils = formUtilities(props, i18n);
|
|
18287
|
-
return
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18702
|
+
return jsx(Field, {
|
|
18703
|
+
name: "bankCity",
|
|
18704
|
+
label: formUtils.getLabel("bankCity"),
|
|
18705
|
+
classNameModifiers: ["bankCity"],
|
|
18706
|
+
errorMessage: formUtils.getErrorMessage("bankCity", errors, fieldProblems),
|
|
18707
|
+
isValid: valid.bankCity,
|
|
18708
|
+
children: (childProps) => jsx(InputText, {
|
|
18709
|
+
...childProps,
|
|
18291
18710
|
name: "bankCity",
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
readonly: formUtils.isReadOnly("bankCity"),
|
|
18301
|
-
onInput: handleChangeFor("bankCity", "input"),
|
|
18302
|
-
onBlur: handleChangeFor("bankCity", "blur"),
|
|
18303
|
-
"aria-required": true,
|
|
18304
|
-
"aria-label": formUtils.getLabel("bankCity"),
|
|
18305
|
-
"aria-invalid": !valid.bankCity
|
|
18306
|
-
})
|
|
18307
|
-
})]
|
|
18711
|
+
value: data.bankCity,
|
|
18712
|
+
readonly: formUtils.isReadOnly("bankCity"),
|
|
18713
|
+
onInput: handleChangeFor("bankCity", "input"),
|
|
18714
|
+
onBlur: handleChangeFor("bankCity", "blur"),
|
|
18715
|
+
"aria-required": true,
|
|
18716
|
+
"aria-label": formUtils.getLabel("bankCity"),
|
|
18717
|
+
"aria-invalid": !valid.bankCity
|
|
18718
|
+
})
|
|
18308
18719
|
});
|
|
18309
18720
|
}
|
|
18721
|
+
const defaultFieldMetadata$3 = {
|
|
18722
|
+
label: "bankCode",
|
|
18723
|
+
validators: isNotEmptyValidator
|
|
18724
|
+
};
|
|
18725
|
+
const simpleBankCodeMetadata = (length, example, label) => ({
|
|
18726
|
+
label: label ?? "bankCode",
|
|
18727
|
+
validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
|
|
18728
|
+
mask: {
|
|
18729
|
+
mask: makeMask(...numericInputs(length))
|
|
18730
|
+
},
|
|
18731
|
+
guidanceText: {
|
|
18732
|
+
key: "enterNDigitsForExample",
|
|
18733
|
+
values: {
|
|
18734
|
+
numDigits: `${length}`,
|
|
18735
|
+
example
|
|
18736
|
+
}
|
|
18737
|
+
}
|
|
18738
|
+
});
|
|
18739
|
+
const defaultFieldConfig$3 = {
|
|
18740
|
+
[CountryCodes.Brazil]: simpleBankCodeMetadata(3, "123"),
|
|
18741
|
+
[CountryCodes.Canada]: simpleBankCodeMetadata(3, "100", "institutionNumber"),
|
|
18742
|
+
[CountryCodes.Denmark]: simpleBankCodeMetadata(4, "5051"),
|
|
18743
|
+
[CountryCodes.HongKong]: simpleBankCodeMetadata(3, "321", "clearingCode"),
|
|
18744
|
+
[CountryCodes.Norway]: simpleBankCodeMetadata(4, "8601"),
|
|
18745
|
+
// Not yet implemented
|
|
18746
|
+
[CountryCodes.Ecuador]: simpleBankCodeMetadata(4, "1234"),
|
|
18747
|
+
[CountryCodes.Japan]: simpleBankCodeMetadata(4, "1234"),
|
|
18748
|
+
[CountryCodes.Taiwan]: simpleBankCodeMetadata(3, "123")
|
|
18749
|
+
};
|
|
18310
18750
|
const bankCodeFields = ["bankCode"];
|
|
18311
18751
|
function BankCode(props) {
|
|
18312
18752
|
const {
|
|
18313
18753
|
i18n
|
|
18314
18754
|
} = useI18nContext();
|
|
18315
18755
|
const {
|
|
18316
|
-
|
|
18317
|
-
|
|
18756
|
+
country: country2,
|
|
18757
|
+
fieldConfig = defaultFieldConfig$3
|
|
18318
18758
|
} = props;
|
|
18319
|
-
const
|
|
18320
|
-
|
|
18321
|
-
});
|
|
18759
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$3);
|
|
18760
|
+
const mergedProps = mergeFieldMetadataIntoProps("bankCode", metadata, props);
|
|
18322
18761
|
const {
|
|
18323
18762
|
handleChangeFor,
|
|
18324
18763
|
data,
|
|
18325
18764
|
valid,
|
|
18326
18765
|
errors,
|
|
18327
|
-
isValid,
|
|
18328
18766
|
fieldProblems
|
|
18329
18767
|
} = useForm({
|
|
18330
|
-
...
|
|
18768
|
+
...mergedProps,
|
|
18331
18769
|
schema: bankCodeFields,
|
|
18332
|
-
rules: validators,
|
|
18333
|
-
defaultData:
|
|
18334
|
-
fieldProblems:
|
|
18770
|
+
rules: mergedProps.validators,
|
|
18771
|
+
defaultData: mergedProps.data,
|
|
18772
|
+
fieldProblems: mergedProps.fieldValidationErrors
|
|
18335
18773
|
});
|
|
18774
|
+
const {
|
|
18775
|
+
updateStateSlice
|
|
18776
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankCode");
|
|
18336
18777
|
useEffect(() => {
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
valid,
|
|
18343
|
-
errors,
|
|
18344
|
-
fieldProblems,
|
|
18345
|
-
caller: "bankCode",
|
|
18346
|
-
dataStoreId
|
|
18347
|
-
}
|
|
18778
|
+
updateStateSlice({
|
|
18779
|
+
data,
|
|
18780
|
+
valid,
|
|
18781
|
+
errors,
|
|
18782
|
+
fieldProblems
|
|
18348
18783
|
});
|
|
18349
|
-
}, [data, valid, errors
|
|
18350
|
-
const formUtils = formUtilities(
|
|
18351
|
-
return
|
|
18352
|
-
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
"aria-invalid": !valid.bankCode
|
|
18370
|
-
})
|
|
18371
|
-
})]
|
|
18784
|
+
}, [data, valid, errors]);
|
|
18785
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
18786
|
+
return jsx(MaskedInputText, {
|
|
18787
|
+
name: "bankCode",
|
|
18788
|
+
label: formUtils.getLabel("bankCode"),
|
|
18789
|
+
classNameModifiers: {
|
|
18790
|
+
field: ["bankCode"],
|
|
18791
|
+
input: ["bankCode"]
|
|
18792
|
+
},
|
|
18793
|
+
errorMessage: formUtils.getErrorMessage("bankCode", errors, fieldProblems),
|
|
18794
|
+
formatGuidance: formUtils.getGuidanceText("bankCode"),
|
|
18795
|
+
...formUtils.getMask("bankCode"),
|
|
18796
|
+
isValid: valid.bankCode,
|
|
18797
|
+
value: data.bankCode ?? "",
|
|
18798
|
+
readonly: formUtils.isReadOnly("bankCode"),
|
|
18799
|
+
onInput: handleChangeFor("bankCode", "input"),
|
|
18800
|
+
onBlur: handleChangeFor("bankCode", "blur"),
|
|
18801
|
+
"aria-required": true,
|
|
18802
|
+
"aria-label": formUtils.getLabel("bankCode"),
|
|
18803
|
+
"aria-invalid": !valid.bankCode
|
|
18372
18804
|
});
|
|
18373
18805
|
}
|
|
18374
18806
|
const bankNameFields = ["bankName"];
|
|
@@ -18377,18 +18809,13 @@ function BankName(props) {
|
|
|
18377
18809
|
i18n
|
|
18378
18810
|
} = useI18nContext();
|
|
18379
18811
|
const {
|
|
18380
|
-
dataStoreId,
|
|
18381
18812
|
validators
|
|
18382
18813
|
} = props;
|
|
18383
|
-
const stateRef = useRef({
|
|
18384
|
-
setState: null
|
|
18385
|
-
});
|
|
18386
18814
|
const {
|
|
18387
18815
|
handleChangeFor,
|
|
18388
18816
|
data,
|
|
18389
18817
|
valid,
|
|
18390
18818
|
errors,
|
|
18391
|
-
isValid,
|
|
18392
18819
|
fieldProblems
|
|
18393
18820
|
} = useForm({
|
|
18394
18821
|
...props,
|
|
@@ -18397,106 +18824,186 @@ function BankName(props) {
|
|
|
18397
18824
|
defaultData: props.data,
|
|
18398
18825
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
18399
18826
|
});
|
|
18827
|
+
const {
|
|
18828
|
+
updateStateSlice
|
|
18829
|
+
} = useGlobalDataSlice("payoutAccountDetails", "bankName");
|
|
18400
18830
|
useEffect(() => {
|
|
18401
|
-
|
|
18402
|
-
|
|
18403
|
-
|
|
18404
|
-
|
|
18405
|
-
|
|
18406
|
-
valid,
|
|
18407
|
-
errors,
|
|
18408
|
-
fieldProblems,
|
|
18409
|
-
caller: "bankName",
|
|
18410
|
-
dataStoreId
|
|
18411
|
-
}
|
|
18831
|
+
updateStateSlice({
|
|
18832
|
+
data,
|
|
18833
|
+
valid,
|
|
18834
|
+
errors,
|
|
18835
|
+
fieldProblems
|
|
18412
18836
|
});
|
|
18413
|
-
}, [data, valid, errors
|
|
18837
|
+
}, [data, valid, errors]);
|
|
18414
18838
|
const formUtils = formUtilities(props, i18n);
|
|
18415
|
-
return
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
|
|
18839
|
+
return jsx(Field, {
|
|
18840
|
+
name: "bankName",
|
|
18841
|
+
label: formUtils.getLabel("bankName"),
|
|
18842
|
+
classNameModifiers: ["bankName"],
|
|
18843
|
+
errorMessage: formUtils.getErrorMessage("bankName", errors, fieldProblems),
|
|
18844
|
+
isValid: valid.bankName,
|
|
18845
|
+
children: (childProps) => jsx(InputText, {
|
|
18846
|
+
...childProps,
|
|
18419
18847
|
name: "bankName",
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
readonly: formUtils.isReadOnly("bankName"),
|
|
18429
|
-
onInput: handleChangeFor("bankName", "input"),
|
|
18430
|
-
onBlur: handleChangeFor("bankName", "blur"),
|
|
18431
|
-
"aria-required": true,
|
|
18432
|
-
"aria-label": formUtils.getLabel("bankName"),
|
|
18433
|
-
"aria-invalid": !valid.bankName
|
|
18434
|
-
})
|
|
18435
|
-
})]
|
|
18848
|
+
value: data.bankName,
|
|
18849
|
+
readonly: formUtils.isReadOnly("bankName"),
|
|
18850
|
+
onInput: handleChangeFor("bankName", "input"),
|
|
18851
|
+
onBlur: handleChangeFor("bankName", "blur"),
|
|
18852
|
+
"aria-required": true,
|
|
18853
|
+
"aria-label": formUtils.getLabel("bankName"),
|
|
18854
|
+
"aria-invalid": !valid.bankName
|
|
18855
|
+
})
|
|
18436
18856
|
});
|
|
18437
18857
|
}
|
|
18858
|
+
const defaultFieldMetadata$2 = {
|
|
18859
|
+
label: "branchCode",
|
|
18860
|
+
validators: isNotEmptyValidator
|
|
18861
|
+
};
|
|
18862
|
+
const defaultFieldConfig$2 = {
|
|
18863
|
+
[CountryCodes.UnitedKingdom]: {
|
|
18864
|
+
label: "sortCode",
|
|
18865
|
+
validators: validatePatternOnBlur(/^\d{6}$/),
|
|
18866
|
+
mask: {
|
|
18867
|
+
mask: makeMask(...numericInputs(6))
|
|
18868
|
+
},
|
|
18869
|
+
guidanceText: {
|
|
18870
|
+
key: "enterNDigitsForExample",
|
|
18871
|
+
values: {
|
|
18872
|
+
numDigits: "6",
|
|
18873
|
+
example: "401199"
|
|
18874
|
+
}
|
|
18875
|
+
}
|
|
18876
|
+
},
|
|
18877
|
+
[CountryCodes.Australia]: {
|
|
18878
|
+
label: "bsbNumber",
|
|
18879
|
+
validators: validatePatternOnBlur(/^\d{6}$/),
|
|
18880
|
+
mask: {
|
|
18881
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3))
|
|
18882
|
+
},
|
|
18883
|
+
guidanceText: {
|
|
18884
|
+
key: "enterNDigitsForExample",
|
|
18885
|
+
values: {
|
|
18886
|
+
numDigits: "6",
|
|
18887
|
+
example: "033-547"
|
|
18888
|
+
}
|
|
18889
|
+
}
|
|
18890
|
+
},
|
|
18891
|
+
[CountryCodes.Brazil]: {
|
|
18892
|
+
label: "branchCode",
|
|
18893
|
+
validators: validatePatternOnBlur(/^\d{1,5}$/),
|
|
18894
|
+
mask: {
|
|
18895
|
+
mask: makeMask(...numericInputs(1), ...numericInputs(4, true))
|
|
18896
|
+
},
|
|
18897
|
+
guidanceText: {
|
|
18898
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
18899
|
+
values: {
|
|
18900
|
+
maxDigits: "5",
|
|
18901
|
+
example: "36257"
|
|
18902
|
+
}
|
|
18903
|
+
}
|
|
18904
|
+
},
|
|
18905
|
+
[CountryCodes.Canada]: {
|
|
18906
|
+
label: "transitNumber",
|
|
18907
|
+
validators: validatePatternOnBlur(/^\d{5}$/),
|
|
18908
|
+
mask: {
|
|
18909
|
+
mask: makeMask(...numericInputs(5))
|
|
18910
|
+
},
|
|
18911
|
+
guidanceText: {
|
|
18912
|
+
key: "enterNDigitsForExample",
|
|
18913
|
+
values: {
|
|
18914
|
+
numDigits: "5",
|
|
18915
|
+
example: "27601"
|
|
18916
|
+
}
|
|
18917
|
+
}
|
|
18918
|
+
},
|
|
18919
|
+
[CountryCodes.HongKong]: {
|
|
18920
|
+
label: "branchCode",
|
|
18921
|
+
validators: validatePatternOnBlur(/^\d{3}$/),
|
|
18922
|
+
mask: {
|
|
18923
|
+
mask: makeMask(...numericInputs(3))
|
|
18924
|
+
},
|
|
18925
|
+
guidanceText: {
|
|
18926
|
+
key: "enterNDigitsForExample",
|
|
18927
|
+
values: {
|
|
18928
|
+
numDigits: "3",
|
|
18929
|
+
example: "100"
|
|
18930
|
+
}
|
|
18931
|
+
}
|
|
18932
|
+
},
|
|
18933
|
+
[CountryCodes.UnitedStates]: {
|
|
18934
|
+
label: "achRoutingNumber",
|
|
18935
|
+
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
18936
|
+
mask: {
|
|
18937
|
+
mask: makeMask(...numericInputs(9))
|
|
18938
|
+
},
|
|
18939
|
+
guidanceText: {
|
|
18940
|
+
key: "enterNDigitsForExample",
|
|
18941
|
+
values: {
|
|
18942
|
+
numDigits: "9",
|
|
18943
|
+
example: "107005432"
|
|
18944
|
+
}
|
|
18945
|
+
}
|
|
18946
|
+
},
|
|
18947
|
+
// Not yet implemented
|
|
18948
|
+
[CountryCodes.Indonesia]: {
|
|
18949
|
+
label: "clearingCode",
|
|
18950
|
+
validators: isNotEmptyValidator
|
|
18951
|
+
}
|
|
18952
|
+
};
|
|
18438
18953
|
const branchCodeFields = ["branchCode"];
|
|
18439
18954
|
function BranchCode(props) {
|
|
18440
18955
|
const {
|
|
18441
18956
|
i18n
|
|
18442
18957
|
} = useI18nContext();
|
|
18443
18958
|
const {
|
|
18444
|
-
|
|
18445
|
-
|
|
18959
|
+
country: country2,
|
|
18960
|
+
fieldConfig = defaultFieldConfig$2
|
|
18446
18961
|
} = props;
|
|
18447
|
-
const
|
|
18448
|
-
|
|
18449
|
-
});
|
|
18962
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$2);
|
|
18963
|
+
const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
|
|
18450
18964
|
const {
|
|
18451
18965
|
handleChangeFor,
|
|
18452
18966
|
data,
|
|
18453
18967
|
valid,
|
|
18454
18968
|
errors,
|
|
18455
|
-
isValid,
|
|
18456
18969
|
fieldProblems
|
|
18457
18970
|
} = useForm({
|
|
18458
|
-
...
|
|
18971
|
+
...mergedProps,
|
|
18459
18972
|
schema: branchCodeFields,
|
|
18460
|
-
rules: validators,
|
|
18461
|
-
defaultData:
|
|
18462
|
-
fieldProblems:
|
|
18973
|
+
rules: mergedProps.validators,
|
|
18974
|
+
defaultData: mergedProps.data,
|
|
18975
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
|
|
18463
18976
|
});
|
|
18977
|
+
const {
|
|
18978
|
+
updateStateSlice
|
|
18979
|
+
} = useGlobalDataSlice("payoutAccountDetails", "branchCode");
|
|
18464
18980
|
useEffect(() => {
|
|
18465
|
-
|
|
18466
|
-
|
|
18467
|
-
|
|
18468
|
-
|
|
18469
|
-
|
|
18470
|
-
valid,
|
|
18471
|
-
errors,
|
|
18472
|
-
fieldProblems,
|
|
18473
|
-
caller: "branchCode",
|
|
18474
|
-
dataStoreId
|
|
18475
|
-
}
|
|
18981
|
+
updateStateSlice({
|
|
18982
|
+
data,
|
|
18983
|
+
valid,
|
|
18984
|
+
errors,
|
|
18985
|
+
fieldProblems
|
|
18476
18986
|
});
|
|
18477
|
-
}, [data, valid, errors
|
|
18478
|
-
const formUtils = formUtilities(
|
|
18479
|
-
return
|
|
18480
|
-
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
"aria-invalid": !valid.branchCode
|
|
18498
|
-
})
|
|
18499
|
-
})]
|
|
18987
|
+
}, [data, valid, errors]);
|
|
18988
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
18989
|
+
return jsx(MaskedInputText, {
|
|
18990
|
+
name: "branchCode",
|
|
18991
|
+
label: formUtils.getLabel("branchCode"),
|
|
18992
|
+
formatGuidance: formUtils.getGuidanceText("branchCode"),
|
|
18993
|
+
...formUtils.getMask("branchCode"),
|
|
18994
|
+
classNameModifiers: {
|
|
18995
|
+
field: ["branchCode"],
|
|
18996
|
+
input: ["branchCode"]
|
|
18997
|
+
},
|
|
18998
|
+
errorMessage: formUtils.getErrorMessage("branchCode", errors, fieldProblems),
|
|
18999
|
+
isValid: valid.branchCode,
|
|
19000
|
+
value: data.branchCode ?? "",
|
|
19001
|
+
readonly: formUtils.isReadOnly("branchCode"),
|
|
19002
|
+
onInput: handleChangeFor("branchCode", "input"),
|
|
19003
|
+
onBlur: handleChangeFor("branchCode", "blur"),
|
|
19004
|
+
"aria-required": true,
|
|
19005
|
+
"aria-label": formUtils.getLabel("branchCode"),
|
|
19006
|
+
"aria-invalid": !valid.branchCode
|
|
18500
19007
|
});
|
|
18501
19008
|
}
|
|
18502
19009
|
const currencyFields = ["currency"];
|
|
@@ -18566,23 +19073,25 @@ const bbanPatternsByCountry = {
|
|
|
18566
19073
|
GB: /[A-Z]{4}\d{14}/,
|
|
18567
19074
|
VG: /[\dA-Z]{4}\d{16}/
|
|
18568
19075
|
};
|
|
18569
|
-
const
|
|
18570
|
-
|
|
19076
|
+
const customPrefixByCountry = {
|
|
19077
|
+
[CountryCodes.Guernsey]: "GB",
|
|
19078
|
+
[CountryCodes.Jersey]: "GB",
|
|
19079
|
+
[CountryCodes.IsleOfMan]: "GB"
|
|
18571
19080
|
};
|
|
18572
|
-
function ibanValidator(input,
|
|
18573
|
-
var _a;
|
|
19081
|
+
function ibanValidator(input, bankCountry2) {
|
|
18574
19082
|
if (isEmpty(input))
|
|
18575
|
-
return
|
|
19083
|
+
return false;
|
|
18576
19084
|
const ibanInput = input.replace(/ /g, "").toUpperCase();
|
|
18577
19085
|
if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
|
|
18578
|
-
return
|
|
19086
|
+
return false;
|
|
18579
19087
|
}
|
|
18580
19088
|
const countryCode = ibanInput.substring(0, 2);
|
|
18581
|
-
|
|
19089
|
+
const allowedPrefix = customPrefixByCountry[bankCountry2] ?? bankCountry2;
|
|
19090
|
+
if (countryCode !== allowedPrefix) {
|
|
18582
19091
|
return {
|
|
18583
19092
|
key: "yourIbanShouldBeginWith_",
|
|
18584
19093
|
values: {
|
|
18585
|
-
countryCode:
|
|
19094
|
+
countryCode: allowedPrefix
|
|
18586
19095
|
}
|
|
18587
19096
|
};
|
|
18588
19097
|
}
|
|
@@ -18590,7 +19099,7 @@ function ibanValidator(input, bankCountries) {
|
|
|
18590
19099
|
if (bbanPattern) {
|
|
18591
19100
|
const ibanPattern = new RegExp(`^[A-Z]{2}\\d{2}${bbanPattern.source}$`, "");
|
|
18592
19101
|
if (!ibanPattern.test(ibanInput)) {
|
|
18593
|
-
return
|
|
19102
|
+
return false;
|
|
18594
19103
|
}
|
|
18595
19104
|
}
|
|
18596
19105
|
const ibanCheck = ibanInput.substring(4, ibanInput.length) + ibanInput.substring(0, 4);
|
|
@@ -18611,33 +19120,129 @@ function ibanValidator(input, bankCountries) {
|
|
|
18611
19120
|
const cOperator = +`${cRest}${cChar}`;
|
|
18612
19121
|
cRest = cOperator % 97;
|
|
18613
19122
|
}
|
|
18614
|
-
return cRest === 1
|
|
19123
|
+
return cRest === 1;
|
|
18615
19124
|
}
|
|
18616
|
-
const
|
|
18617
|
-
|
|
18618
|
-
|
|
19125
|
+
const validateIbanOnBlurAndInput = (country2) => ({
|
|
19126
|
+
modes: ["blur", "input"],
|
|
19127
|
+
validate: (iban2) => ibanValidator(iban2, country2) === true,
|
|
19128
|
+
errorMessage: (iban2) => {
|
|
19129
|
+
const result = ibanValidator(iban2, country2);
|
|
19130
|
+
return typeof result === "boolean" ? void 0 : result;
|
|
18619
19131
|
}
|
|
19132
|
+
});
|
|
19133
|
+
const ibanMask = (country2, inputLength, includesBankCode) => {
|
|
19134
|
+
const tokens = [];
|
|
19135
|
+
tokens.push(...nonInputs(country2, {
|
|
19136
|
+
includeInValue: true
|
|
19137
|
+
}), ...numericInputs(2), spacer);
|
|
19138
|
+
inputLength -= 2;
|
|
19139
|
+
if (includesBankCode) {
|
|
19140
|
+
tokens.push(...alphaInputs(4), spacer);
|
|
19141
|
+
inputLength -= 4;
|
|
19142
|
+
}
|
|
19143
|
+
const numGroups = Math.floor(inputLength / 4);
|
|
19144
|
+
const remainder = inputLength % 4;
|
|
19145
|
+
for (let i = 0; i < numGroups; i += 1) {
|
|
19146
|
+
tokens.push(...numericInputs(4), spacer);
|
|
19147
|
+
}
|
|
19148
|
+
tokens.push(...numericInputs(remainder));
|
|
19149
|
+
return {
|
|
19150
|
+
mask: {
|
|
19151
|
+
tokens
|
|
19152
|
+
},
|
|
19153
|
+
transformOnType: includesBankCode ? uppercase : void 0
|
|
19154
|
+
};
|
|
18620
19155
|
};
|
|
18621
|
-
const
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
19156
|
+
const ibanGuidance = (type, numDigitsOrChars, example) => type === "digits" ? {
|
|
19157
|
+
key: "enterTheRemainingNDigitsForExample",
|
|
19158
|
+
values: {
|
|
19159
|
+
numDigits: `${numDigitsOrChars}`,
|
|
19160
|
+
example
|
|
19161
|
+
}
|
|
19162
|
+
} : {
|
|
19163
|
+
key: "enterTheRemainingNCharactersForExample",
|
|
19164
|
+
values: {
|
|
19165
|
+
numChars: `${numDigitsOrChars}`,
|
|
19166
|
+
example
|
|
19167
|
+
}
|
|
19168
|
+
};
|
|
19169
|
+
const ibanMetadata = (country2, inputLength, example, includesBankCode) => ({
|
|
19170
|
+
label: "iban",
|
|
19171
|
+
validators: validateIbanOnBlurAndInput(country2),
|
|
19172
|
+
mask: ibanMask(country2, inputLength, includesBankCode),
|
|
19173
|
+
guidanceText: ibanGuidance(includesBankCode ? "characters" : "digits", inputLength, example)
|
|
18628
19174
|
});
|
|
19175
|
+
const gbIbanMetadata = ibanMetadata(CountryCodes.UnitedKingdom, 20, "GB09 BARC 2003 9554 8297 59", true);
|
|
19176
|
+
const defaultFieldMetadata$1 = {
|
|
19177
|
+
label: "iban",
|
|
19178
|
+
validators: isNotEmptyValidator
|
|
19179
|
+
};
|
|
19180
|
+
const defaultFieldConfig$1 = {
|
|
19181
|
+
[CountryCodes.Austria]: ibanMetadata(CountryCodes.Austria, 18, "AT88 5400 0746 7265 9747"),
|
|
19182
|
+
[CountryCodes.Belgium]: ibanMetadata(CountryCodes.Belgium, 14, "BE59 9788 6743 2226"),
|
|
19183
|
+
[CountryCodes.Croatia]: ibanMetadata(CountryCodes.Croatia, 19, "HR51 2484 0083 5929 6973 8"),
|
|
19184
|
+
[CountryCodes.Cyprus]: ibanMetadata(CountryCodes.Cyprus, 26, "CY16 5183 1221 8756 5858 5388 7678"),
|
|
19185
|
+
[CountryCodes.CzechRepublic]: ibanMetadata(CountryCodes.CzechRepublic, 22, "CZ23 5051 3674 5924 5233 3465"),
|
|
19186
|
+
[CountryCodes.Estonia]: ibanMetadata(CountryCodes.Estonia, 18, "EE26 1291 5123 1542 6371"),
|
|
19187
|
+
[CountryCodes.Finland]: ibanMetadata(CountryCodes.Finland, 16, "FI03 9319 8995 3742 51"),
|
|
19188
|
+
[CountryCodes.Germany]: ibanMetadata(CountryCodes.Germany, 20, "DE91 1000 0000 0123 4567 89"),
|
|
19189
|
+
[CountryCodes.Greece]: ibanMetadata(CountryCodes.Greece, 25, "GR57 0107 7142 7681 6687 9575 217"),
|
|
19190
|
+
[CountryCodes.Hungary]: ibanMetadata(CountryCodes.Hungary, 26, "HU68 1070 0024 3428 4128 3192 4812"),
|
|
19191
|
+
[CountryCodes.Italy]: ibanMetadata(CountryCodes.Italy, 25, "IT06 L030 0203 2809 8485 8934 882"),
|
|
19192
|
+
[CountryCodes.Lithuania]: ibanMetadata(CountryCodes.Lithuania, 18, "LT59 9244 6228 2176 2762"),
|
|
19193
|
+
[CountryCodes.Luxembourg]: ibanMetadata(CountryCodes.Luxembourg, 18, "LU71 0106 9242 5365 8562"),
|
|
19194
|
+
[CountryCodes.Monaco]: ibanMetadata(CountryCodes.Monaco, 25, "MC58 1122 2000 0101 2345 6789 030"),
|
|
19195
|
+
[CountryCodes.Portugal]: ibanMetadata(CountryCodes.Portugal, 23, "PT42 0035 0651 8646 9119 5263 5"),
|
|
19196
|
+
[CountryCodes.Slovakia]: ibanMetadata(CountryCodes.Slovakia, 22, "SK25 5173 1333 4916 3219 3521"),
|
|
19197
|
+
[CountryCodes.Spain]: ibanMetadata(CountryCodes.Spain, 22, "ES76 1465 5599 9226 7623 2635"),
|
|
19198
|
+
// These include 4-letter bank codes
|
|
19199
|
+
[CountryCodes.Bulgaria]: ibanMetadata(CountryCodes.Bulgaria, 20, "BG03 BNJE 8736 1280 1193 83", true),
|
|
19200
|
+
[CountryCodes.Gibraltar]: ibanMetadata(CountryCodes.Gibraltar, 21, "GI75 HYKN 0120 0320 7038 453", true),
|
|
19201
|
+
[CountryCodes.Ireland]: ibanMetadata(CountryCodes.Ireland, 20, "IE64 IRCE 9205 0112 3456 78", true),
|
|
19202
|
+
[CountryCodes.Latvia]: ibanMetadata(CountryCodes.Latvia, 19, "LV80 BANK 0000 4351 9500 1", true),
|
|
19203
|
+
[CountryCodes.Malta]: ibanMetadata(CountryCodes.Malta, 29, "MT03 VIXW 2487 8926 8575 8586 8929 858", true),
|
|
19204
|
+
[CountryCodes.Netherlands]: ibanMetadata(CountryCodes.Netherlands, 16, "NL50 ABNA 4452 7591 49", true),
|
|
19205
|
+
[CountryCodes.Romania]: ibanMetadata(CountryCodes.Romania, 22, "RO36 PORL 9596 9966 4965 4284", true),
|
|
19206
|
+
[CountryCodes.UnitedKingdom]: gbIbanMetadata,
|
|
19207
|
+
// IBANs for Guernsey, Jersey, and Isle of Man also use United Kingdom's format (starting with `GB`)
|
|
19208
|
+
[CountryCodes.Guernsey]: gbIbanMetadata,
|
|
19209
|
+
[CountryCodes.Jersey]: gbIbanMetadata,
|
|
19210
|
+
[CountryCodes.IsleOfMan]: gbIbanMetadata,
|
|
19211
|
+
// These are a little bit different
|
|
19212
|
+
[CountryCodes.France]: {
|
|
19213
|
+
label: "iban",
|
|
19214
|
+
validators: validateIbanOnBlurAndInput(CountryCodes.France),
|
|
19215
|
+
mask: {
|
|
19216
|
+
mask: makeMask(...nonInputs("FR", {
|
|
19217
|
+
includeInValue: true
|
|
19218
|
+
}), ...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...alphaInputs(1), ...numericInputs(2)),
|
|
19219
|
+
transformOnType: uppercase
|
|
19220
|
+
},
|
|
19221
|
+
guidanceText: ibanGuidance("characters", 25, "FR64 1009 6000 4035 3425 9742 Y90")
|
|
19222
|
+
},
|
|
19223
|
+
[CountryCodes.Liechtenstein]: {
|
|
19224
|
+
label: "iban",
|
|
19225
|
+
validators: validateIbanOnBlurAndInput(CountryCodes.Liechtenstein),
|
|
19226
|
+
mask: {
|
|
19227
|
+
mask: makeMask(...nonInputs("LT", {
|
|
19228
|
+
includeInValue: true
|
|
19229
|
+
}), ...numericInputs(2), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(4), spacer, ...numericInputs(3), ...alphaInputs(1), spacer, ...alphaInputs(1)),
|
|
19230
|
+
transformOnType: uppercase
|
|
19231
|
+
},
|
|
19232
|
+
guidanceText: ibanGuidance("characters", 19, "LI21 0881 0000 2324 013A A")
|
|
19233
|
+
}
|
|
19234
|
+
};
|
|
19235
|
+
const ibanFields = ["iban"];
|
|
18629
19236
|
function Iban(props) {
|
|
18630
19237
|
const {
|
|
18631
19238
|
i18n
|
|
18632
19239
|
} = useI18nContext();
|
|
18633
19240
|
const {
|
|
18634
|
-
|
|
18635
|
-
|
|
19241
|
+
country: country2,
|
|
19242
|
+
fieldConfig = defaultFieldConfig$1
|
|
18636
19243
|
} = props;
|
|
18637
|
-
const
|
|
18638
|
-
|
|
18639
|
-
});
|
|
18640
|
-
const rules2 = useMemo(() => addCountryValidationForIban([country2]), [country2]);
|
|
19244
|
+
const metadata = resolveFieldMetadata(fieldConfig[country2], {}, defaultFieldMetadata$1);
|
|
19245
|
+
const mergedProps = mergeFieldMetadataIntoProps("iban", metadata, props);
|
|
18641
19246
|
const {
|
|
18642
19247
|
handleChangeFor,
|
|
18643
19248
|
data,
|
|
@@ -18645,115 +19250,111 @@ function Iban(props) {
|
|
|
18645
19250
|
errors,
|
|
18646
19251
|
fieldProblems
|
|
18647
19252
|
} = useForm({
|
|
18648
|
-
...
|
|
19253
|
+
...mergedProps,
|
|
18649
19254
|
schema: ibanFields,
|
|
18650
|
-
rules:
|
|
19255
|
+
rules: mergedProps.validators,
|
|
18651
19256
|
defaultData: props.data,
|
|
18652
|
-
formatters: ibanFormatter,
|
|
18653
19257
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
|
|
18654
|
-
|
|
19258
|
+
obscuredFields: props.obscuredFields
|
|
18655
19259
|
});
|
|
19260
|
+
const {
|
|
19261
|
+
updateStateSlice
|
|
19262
|
+
} = useGlobalDataSlice("payoutAccountDetails", "iban");
|
|
18656
19263
|
useEffect(() => {
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
|
|
18660
|
-
|
|
18661
|
-
|
|
18662
|
-
valid,
|
|
18663
|
-
errors,
|
|
18664
|
-
fieldProblems,
|
|
18665
|
-
caller: "iban",
|
|
18666
|
-
dataStoreId
|
|
18667
|
-
}
|
|
19264
|
+
updateStateSlice({
|
|
19265
|
+
data,
|
|
19266
|
+
valid,
|
|
19267
|
+
errors,
|
|
19268
|
+
fieldProblems
|
|
18668
19269
|
});
|
|
18669
19270
|
}, [data, errors, valid]);
|
|
18670
|
-
const formUtils = formUtilities(
|
|
18671
|
-
return
|
|
18672
|
-
|
|
18673
|
-
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
|
|
18684
|
-
|
|
18685
|
-
|
|
18686
|
-
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
transformInput: (value) => value.toUpperCase()
|
|
18691
|
-
})
|
|
18692
|
-
})]
|
|
19271
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
19272
|
+
return jsx(MaskedInputText, {
|
|
19273
|
+
name: "iban",
|
|
19274
|
+
label: formUtils.getLabel("iban"),
|
|
19275
|
+
formatGuidance: formUtils.getGuidanceText("iban"),
|
|
19276
|
+
...formUtils.getMask("iban"),
|
|
19277
|
+
errorMessage: formUtils.getErrorMessage("iban", errors, fieldProblems),
|
|
19278
|
+
isValid: valid.iban,
|
|
19279
|
+
value: data.iban ?? "",
|
|
19280
|
+
readonly: formUtils.isReadOnly("iban"),
|
|
19281
|
+
classNameModifiers: {
|
|
19282
|
+
field: ["iban"],
|
|
19283
|
+
input: ["iban"]
|
|
19284
|
+
},
|
|
19285
|
+
onInput: handleChangeFor("iban", "blur"),
|
|
19286
|
+
onBlur: handleChangeFor("iban", "blur"),
|
|
19287
|
+
"aria-required": true,
|
|
19288
|
+
"aria-label": formUtils.getLabel("iban"),
|
|
19289
|
+
"aria-invalid": !valid.iban,
|
|
19290
|
+
acceptObscuredValue: formUtils.isObscured("iban")
|
|
18693
19291
|
});
|
|
18694
19292
|
}
|
|
19293
|
+
const swiftCodeFieldMetadata = {
|
|
19294
|
+
label: "bicSwift",
|
|
19295
|
+
validators: validatePatternOnBlur(/^([a-zA-Z0-9]{8}|[a-zA-Z0-9]{11})$/),
|
|
19296
|
+
mask: {
|
|
19297
|
+
mask: makeMask(...alphaInputs(6), ...alphanumericInputs(2), ...alphanumericInputs(3, true)),
|
|
19298
|
+
transformOnType: uppercase
|
|
19299
|
+
},
|
|
19300
|
+
guidanceText: {
|
|
19301
|
+
key: "enterXOrYCharactersForExample",
|
|
19302
|
+
values: {
|
|
19303
|
+
xChars: "8",
|
|
19304
|
+
yChars: "11",
|
|
19305
|
+
example: "BANKDE65287"
|
|
19306
|
+
}
|
|
19307
|
+
}
|
|
19308
|
+
};
|
|
18695
19309
|
const swiftCodeFields = ["swiftCode"];
|
|
18696
19310
|
function SwiftCode(props) {
|
|
18697
19311
|
const {
|
|
18698
19312
|
i18n
|
|
18699
19313
|
} = useI18nContext();
|
|
18700
|
-
const
|
|
18701
|
-
dataStoreId,
|
|
18702
|
-
validators
|
|
18703
|
-
} = props;
|
|
18704
|
-
const stateRef = useRef({
|
|
18705
|
-
setState: null
|
|
18706
|
-
});
|
|
19314
|
+
const mergedProps = mergeFieldMetadataIntoProps("swiftCode", swiftCodeFieldMetadata, props);
|
|
18707
19315
|
const {
|
|
18708
19316
|
handleChangeFor,
|
|
18709
19317
|
data,
|
|
18710
19318
|
valid,
|
|
18711
19319
|
errors,
|
|
18712
|
-
isValid,
|
|
18713
19320
|
fieldProblems
|
|
18714
19321
|
} = useForm({
|
|
18715
|
-
...
|
|
19322
|
+
...mergedProps,
|
|
18716
19323
|
schema: swiftCodeFields,
|
|
18717
|
-
rules: validators,
|
|
18718
|
-
defaultData:
|
|
18719
|
-
fieldProblems:
|
|
19324
|
+
rules: mergedProps.validators,
|
|
19325
|
+
defaultData: mergedProps.data,
|
|
19326
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
|
|
18720
19327
|
});
|
|
19328
|
+
const {
|
|
19329
|
+
updateStateSlice
|
|
19330
|
+
} = useGlobalDataSlice("payoutAccountDetails", "swiftCode");
|
|
18721
19331
|
useEffect(() => {
|
|
18722
|
-
|
|
18723
|
-
|
|
18724
|
-
|
|
18725
|
-
|
|
18726
|
-
|
|
18727
|
-
valid,
|
|
18728
|
-
errors,
|
|
18729
|
-
fieldProblems,
|
|
18730
|
-
caller: "swiftCode",
|
|
18731
|
-
dataStoreId
|
|
18732
|
-
}
|
|
19332
|
+
updateStateSlice({
|
|
19333
|
+
data,
|
|
19334
|
+
valid,
|
|
19335
|
+
errors,
|
|
19336
|
+
fieldProblems
|
|
18733
19337
|
});
|
|
18734
|
-
}, [data, valid, errors
|
|
18735
|
-
const formUtils = formUtilities(
|
|
18736
|
-
return
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
"aria-invalid": !valid.swiftCode
|
|
18755
|
-
})
|
|
18756
|
-
})]
|
|
19338
|
+
}, [data, valid, errors]);
|
|
19339
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
19340
|
+
return jsx(MaskedInputText, {
|
|
19341
|
+
name: "swiftCode",
|
|
19342
|
+
label: formUtils.getLabel("swiftCode"),
|
|
19343
|
+
formatGuidance: formUtils.getGuidanceText("swiftCode"),
|
|
19344
|
+
...formUtils.getMask("swiftCode"),
|
|
19345
|
+
classNameModifiers: {
|
|
19346
|
+
field: ["swiftCode"],
|
|
19347
|
+
input: ["swiftCode"]
|
|
19348
|
+
},
|
|
19349
|
+
errorMessage: formUtils.getErrorMessage("swiftCode", errors, fieldProblems),
|
|
19350
|
+
isValid: valid.swiftCode,
|
|
19351
|
+
value: data.swiftCode ?? "",
|
|
19352
|
+
readonly: formUtils.isReadOnly("swiftCode"),
|
|
19353
|
+
onInput: handleChangeFor("swiftCode", "input"),
|
|
19354
|
+
onBlur: handleChangeFor("swiftCode", "blur"),
|
|
19355
|
+
"aria-required": true,
|
|
19356
|
+
"aria-label": formUtils.getLabel("swiftCode"),
|
|
19357
|
+
"aria-invalid": !valid.swiftCode
|
|
18757
19358
|
});
|
|
18758
19359
|
}
|
|
18759
19360
|
const payoutAccountFields = ["accountHolder", ...ibanFields, ...branchCodeFields, ...swiftCodeFields, ...currencyFields, ...bankAccountNumberFields, ...bankNameFields, ...bankCodeFields];
|
|
@@ -18776,14 +19377,10 @@ function PayoutAccountComponent(props) {
|
|
|
18776
19377
|
legalEntityResponse,
|
|
18777
19378
|
requiredFields = []
|
|
18778
19379
|
} = props;
|
|
18779
|
-
const stateRef = useRef({
|
|
18780
|
-
setState: null
|
|
18781
|
-
});
|
|
18782
19380
|
const {
|
|
18783
19381
|
data,
|
|
18784
19382
|
valid,
|
|
18785
19383
|
errors,
|
|
18786
|
-
isValid,
|
|
18787
19384
|
handleChangeFor,
|
|
18788
19385
|
schema
|
|
18789
19386
|
} = useForm({
|
|
@@ -18797,20 +19394,17 @@ function PayoutAccountComponent(props) {
|
|
|
18797
19394
|
...props,
|
|
18798
19395
|
requiredFields
|
|
18799
19396
|
}, i18n);
|
|
19397
|
+
const {
|
|
19398
|
+
updateStateSlice
|
|
19399
|
+
} = useGlobalDataSlice("payoutAccountDetails");
|
|
18800
19400
|
useEffect(() => {
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
valid,
|
|
18807
|
-
errors,
|
|
18808
|
-
caller: id2,
|
|
18809
|
-
dataStoreId: id2,
|
|
18810
|
-
schema
|
|
18811
|
-
}
|
|
19401
|
+
updateStateSlice({
|
|
19402
|
+
data,
|
|
19403
|
+
valid,
|
|
19404
|
+
errors,
|
|
19405
|
+
schema
|
|
18812
19406
|
});
|
|
18813
|
-
}, [data, valid, errors
|
|
19407
|
+
}, [data, valid, errors]);
|
|
18814
19408
|
const bankAccountNumberProps = getFieldProps(props, bankAccountNumberFields);
|
|
18815
19409
|
const swiftCodeProps = getFieldProps(props, swiftCodeFields);
|
|
18816
19410
|
const ibanProps = getFieldProps(props, ibanFields);
|
|
@@ -18824,10 +19418,7 @@ function PayoutAccountComponent(props) {
|
|
|
18824
19418
|
return jsxs("form", {
|
|
18825
19419
|
className: "adyen-kyc-individual__payout-account",
|
|
18826
19420
|
"aria-describedby": "ariaErrorField",
|
|
18827
|
-
children: [jsx(
|
|
18828
|
-
owner: id2,
|
|
18829
|
-
stateRef
|
|
18830
|
-
}), jsx(FormHeader, {
|
|
19421
|
+
children: [jsx(FormHeader, {
|
|
18831
19422
|
heading: props.heading
|
|
18832
19423
|
}), jsx(ErrorPanel, {
|
|
18833
19424
|
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
@@ -18863,6 +19454,7 @@ function PayoutAccountComponent(props) {
|
|
|
18863
19454
|
handleAccountFormatChange: setAccountFormat
|
|
18864
19455
|
}), formUtils.isRequiredField("bankAccountNumber") && jsx(BankAccountNumber, {
|
|
18865
19456
|
...bankAccountNumberProps,
|
|
19457
|
+
country: country2,
|
|
18866
19458
|
dataStoreId: id2
|
|
18867
19459
|
}), formUtils.isRequiredField("iban") && jsx(Iban, {
|
|
18868
19460
|
...ibanProps,
|
|
@@ -18876,9 +19468,11 @@ function PayoutAccountComponent(props) {
|
|
|
18876
19468
|
dataStoreId: id2
|
|
18877
19469
|
}), formUtils.isRequiredField("bankCode") && jsx(BankCode, {
|
|
18878
19470
|
...bankCodeProps,
|
|
19471
|
+
country: country2,
|
|
18879
19472
|
dataStoreId: id2
|
|
18880
19473
|
}), formUtils.isRequiredField("branchCode") && jsx(BranchCode, {
|
|
18881
19474
|
...branchCodeProps,
|
|
19475
|
+
country: country2,
|
|
18882
19476
|
dataStoreId: id2
|
|
18883
19477
|
}), formUtils.isRequiredField("bankCity") && jsx(BankCity, {
|
|
18884
19478
|
...bankCityProps,
|
|
@@ -21499,28 +22093,18 @@ const payoutFieldsMapping = {
|
|
|
21499
22093
|
// not sure about this field
|
|
21500
22094
|
OWNER_CITY: "accountHolderCity"
|
|
21501
22095
|
};
|
|
21502
|
-
const
|
|
22096
|
+
const obscuredPayoutFields = [payoutFieldsMapping.NUMBER, payoutFieldsMapping.IBAN];
|
|
21503
22097
|
const countryConfig$2 = {
|
|
21504
|
-
[CountryCodes.Australia]: {
|
|
21505
|
-
branchCode: {
|
|
21506
|
-
label: "bsbNumber"
|
|
21507
|
-
}
|
|
21508
|
-
},
|
|
22098
|
+
[CountryCodes.Australia]: {},
|
|
21509
22099
|
[CountryCodes.Brazil]: {
|
|
21510
22100
|
bankCode: {
|
|
21511
22101
|
label: "bankCode"
|
|
21512
|
-
},
|
|
21513
|
-
branchCode: {
|
|
21514
|
-
label: "branchCode"
|
|
21515
22102
|
}
|
|
21516
22103
|
},
|
|
21517
22104
|
[CountryCodes.Canada]: {
|
|
21518
22105
|
bankCode: {
|
|
21519
22106
|
label: "institutionNumber"
|
|
21520
22107
|
},
|
|
21521
|
-
branchCode: {
|
|
21522
|
-
label: "transitNumber"
|
|
21523
|
-
},
|
|
21524
22108
|
bankStatementDocument: {
|
|
21525
22109
|
label: "listitemVoidedChequeBankLetterBankStatementOnline"
|
|
21526
22110
|
}
|
|
@@ -21528,39 +22112,23 @@ const countryConfig$2 = {
|
|
|
21528
22112
|
[CountryCodes.HongKong]: {
|
|
21529
22113
|
bankCode: {
|
|
21530
22114
|
label: "clearingCode"
|
|
21531
|
-
},
|
|
21532
|
-
branchCode: {
|
|
21533
|
-
label: "branchCode"
|
|
21534
|
-
}
|
|
21535
|
-
},
|
|
21536
|
-
[CountryCodes.Indonesia]: {
|
|
21537
|
-
branchCode: {
|
|
21538
|
-
label: "clearingCode"
|
|
21539
22115
|
}
|
|
21540
22116
|
},
|
|
22117
|
+
[CountryCodes.Indonesia]: {},
|
|
21541
22118
|
[CountryCodes.NewZealand]: {
|
|
21542
22119
|
bankCode: {
|
|
21543
22120
|
label: "bankCode"
|
|
21544
|
-
},
|
|
21545
|
-
branchCode: {
|
|
21546
|
-
label: "branchCode"
|
|
21547
22121
|
}
|
|
21548
22122
|
},
|
|
21549
22123
|
[CountryCodes.Singapore]: {
|
|
21550
22124
|
bankCode: {
|
|
21551
22125
|
label: "bankCode"
|
|
21552
22126
|
},
|
|
21553
|
-
branchCode: {
|
|
21554
|
-
label: "branchCode"
|
|
21555
|
-
},
|
|
21556
22127
|
swiftCode: {
|
|
21557
22128
|
label: "bic"
|
|
21558
22129
|
}
|
|
21559
22130
|
},
|
|
21560
22131
|
[CountryCodes.UnitedKingdom]: {
|
|
21561
|
-
branchCode: {
|
|
21562
|
-
label: "sortCode"
|
|
21563
|
-
},
|
|
21564
22132
|
bankCity: {
|
|
21565
22133
|
label: "bankCityTown"
|
|
21566
22134
|
},
|
|
@@ -21568,11 +22136,7 @@ const countryConfig$2 = {
|
|
|
21568
22136
|
label: "listitemVoidedChequeBankLetterBankStatementOnline"
|
|
21569
22137
|
}
|
|
21570
22138
|
},
|
|
21571
|
-
[CountryCodes.UnitedStates]: {
|
|
21572
|
-
branchCode: {
|
|
21573
|
-
label: "achRoutingNumber"
|
|
21574
|
-
}
|
|
21575
|
-
}
|
|
22139
|
+
[CountryCodes.UnitedStates]: {}
|
|
21576
22140
|
};
|
|
21577
22141
|
const parseValidationRule = (validationRule) => {
|
|
21578
22142
|
const [name, start, end] = validationRule.split(":");
|
|
@@ -21818,7 +22382,7 @@ const identityNumber = {
|
|
|
21818
22382
|
idNumber: {
|
|
21819
22383
|
rule: "isDirectorIdNumberRequiredForCountry",
|
|
21820
22384
|
verify: "isVerificationAllowedForCountry",
|
|
21821
|
-
|
|
22385
|
+
obscured: true
|
|
21822
22386
|
},
|
|
21823
22387
|
idNumberExempt: {
|
|
21824
22388
|
rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"]
|
|
@@ -22115,7 +22679,7 @@ function parsePayoutScenarios({
|
|
|
22115
22679
|
rule: bankVerificationAvailable ? "whenUsingManualVerification" : "REQUIRED",
|
|
22116
22680
|
validators: [requiredValidatorRule]
|
|
22117
22681
|
};
|
|
22118
|
-
fieldConfigurations[fieldName].
|
|
22682
|
+
fieldConfigurations[fieldName].obscured = obscuredPayoutFields.includes(fieldName);
|
|
22119
22683
|
}
|
|
22120
22684
|
});
|
|
22121
22685
|
if (bankVerificationAvailable) {
|
|
@@ -22174,7 +22738,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22174
22738
|
const helperText = {};
|
|
22175
22739
|
const masks = {};
|
|
22176
22740
|
const validators = {};
|
|
22177
|
-
const
|
|
22741
|
+
const obscuredFields = {};
|
|
22178
22742
|
if (!scenarioConfiguration) {
|
|
22179
22743
|
return;
|
|
22180
22744
|
}
|
|
@@ -22241,8 +22805,8 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22241
22805
|
[field]: fieldConfigurations.validators
|
|
22242
22806
|
};
|
|
22243
22807
|
}
|
|
22244
|
-
if (fieldConfigurations.
|
|
22245
|
-
|
|
22808
|
+
if (fieldConfigurations.obscured) {
|
|
22809
|
+
obscuredFields[formId] = obscuredFields[formId] ? [...obscuredFields[formId], field] : [field];
|
|
22246
22810
|
}
|
|
22247
22811
|
}
|
|
22248
22812
|
});
|
|
@@ -22255,7 +22819,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
22255
22819
|
verifyFields,
|
|
22256
22820
|
placeholders,
|
|
22257
22821
|
validators,
|
|
22258
|
-
|
|
22822
|
+
obscuredFields,
|
|
22259
22823
|
helperText,
|
|
22260
22824
|
masks
|
|
22261
22825
|
};
|
|
@@ -23786,15 +24350,6 @@ function useCompanySearch({
|
|
|
23786
24350
|
reset
|
|
23787
24351
|
};
|
|
23788
24352
|
}
|
|
23789
|
-
const mapKompanyOrganizationTypeToCompanyType = (organizationType) => {
|
|
23790
|
-
const organizationTypeValue = organizationType == null ? void 0 : organizationType.toLowerCase();
|
|
23791
|
-
switch (organizationTypeValue) {
|
|
23792
|
-
case "business":
|
|
23793
|
-
return CompanyTypesValue.PRIVATE_COMPANY;
|
|
23794
|
-
default:
|
|
23795
|
-
return void 0;
|
|
23796
|
-
}
|
|
23797
|
-
};
|
|
23798
24353
|
const mapCompanyDataResponseToFormSchema = (company2) => ({
|
|
23799
24354
|
companyBasics: {
|
|
23800
24355
|
country: company2.country,
|
|
@@ -23809,9 +24364,10 @@ const mapCompanyDataResponseToFormSchema = (company2) => ({
|
|
|
23809
24364
|
postalCode: company2.zipcode
|
|
23810
24365
|
}
|
|
23811
24366
|
},
|
|
23812
|
-
|
|
23813
|
-
|
|
23814
|
-
|
|
24367
|
+
// TODO: use this when CORE-6950 is completed (BE ticket)
|
|
24368
|
+
// companyStructure: {
|
|
24369
|
+
// entityType: mapOrganizationTypeToCompanyType(company.organizationType),
|
|
24370
|
+
// },
|
|
23815
24371
|
companyOtherDetails: {
|
|
23816
24372
|
registrationNumber: company2.registrationNumber
|
|
23817
24373
|
}
|
|
@@ -24274,15 +24830,15 @@ function TaxInformationField({
|
|
|
24274
24830
|
})]
|
|
24275
24831
|
});
|
|
24276
24832
|
}
|
|
24277
|
-
const defaultFieldMetadata = defaultFieldMetadata$
|
|
24278
|
-
const defaultFieldConfig = entriesOf(defaultFieldConfig$
|
|
24833
|
+
const defaultFieldMetadata = defaultFieldMetadata$7;
|
|
24834
|
+
const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
|
|
24279
24835
|
...fieldConfig,
|
|
24280
24836
|
[country2]: ({
|
|
24281
24837
|
taxIdNumberType
|
|
24282
24838
|
}) => {
|
|
24283
24839
|
const fieldMetadata = resolveFieldMetadata(countryEntry, {
|
|
24284
24840
|
taxIdNumberType
|
|
24285
|
-
}, defaultFieldMetadata$
|
|
24841
|
+
}, defaultFieldMetadata$7);
|
|
24286
24842
|
const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
|
|
24287
24843
|
const mappedValidators = taxIdValidators.map((validator) => ({
|
|
24288
24844
|
...validator,
|
|
@@ -24319,7 +24875,7 @@ function CompanyBasics({
|
|
|
24319
24875
|
formVerificationErrors,
|
|
24320
24876
|
fieldValidationErrors,
|
|
24321
24877
|
requiredFields,
|
|
24322
|
-
|
|
24878
|
+
obscuredFields,
|
|
24323
24879
|
optionalFields,
|
|
24324
24880
|
readOnlyFields,
|
|
24325
24881
|
handleCompanyIndexSearch,
|
|
@@ -24329,7 +24885,7 @@ function CompanyBasics({
|
|
|
24329
24885
|
handleVerifyTin,
|
|
24330
24886
|
country: country2,
|
|
24331
24887
|
isTopLevelEntity,
|
|
24332
|
-
|
|
24888
|
+
kompanyVerifiedData,
|
|
24333
24889
|
setKompanyAddress,
|
|
24334
24890
|
setKompanyVerifiedData
|
|
24335
24891
|
}) {
|
|
@@ -24353,9 +24909,9 @@ function CompanyBasics({
|
|
|
24353
24909
|
requiredFields,
|
|
24354
24910
|
readOnlyFields,
|
|
24355
24911
|
optionalFields,
|
|
24356
|
-
|
|
24912
|
+
obscuredFields,
|
|
24357
24913
|
shouldValidate
|
|
24358
|
-
}), [helperText, labels2,
|
|
24914
|
+
}), [helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, shouldValidate]);
|
|
24359
24915
|
const mergedFieldProps = useMemo$1(() => {
|
|
24360
24916
|
var _a2;
|
|
24361
24917
|
return (_a2 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
@@ -24407,7 +24963,7 @@ function CompanyBasics({
|
|
|
24407
24963
|
defaultData: data,
|
|
24408
24964
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
24409
24965
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
24410
|
-
|
|
24966
|
+
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
24411
24967
|
fieldProblems: fieldValidationErrors,
|
|
24412
24968
|
shouldValidate
|
|
24413
24969
|
});
|
|
@@ -24415,7 +24971,7 @@ function CompanyBasics({
|
|
|
24415
24971
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
24416
24972
|
const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
|
|
24417
24973
|
const currentCountryTaxIdNumber = (_b = (_a = formData.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _b.number;
|
|
24418
|
-
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(
|
|
24974
|
+
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(kompanyVerifiedData) || loading2;
|
|
24419
24975
|
useEffect$1(() => {
|
|
24420
24976
|
updateStateSlice({
|
|
24421
24977
|
schema: formSchema,
|
|
@@ -24507,7 +25063,7 @@ function CompanyBasics({
|
|
|
24507
25063
|
})]
|
|
24508
25064
|
});
|
|
24509
25065
|
}
|
|
24510
|
-
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.
|
|
25066
|
+
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
24511
25067
|
const CompanyOtherDetailsComponent$1 = "";
|
|
24512
25068
|
const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
24513
25069
|
function BusinessRegistrationNumberField({
|
|
@@ -24822,7 +25378,7 @@ function CompanyOtherDetails({
|
|
|
24822
25378
|
formVerificationErrors,
|
|
24823
25379
|
fieldValidationErrors,
|
|
24824
25380
|
requiredFields,
|
|
24825
|
-
|
|
25381
|
+
obscuredFields,
|
|
24826
25382
|
optionalFields,
|
|
24827
25383
|
readOnlyFields,
|
|
24828
25384
|
country: country2,
|
|
@@ -24855,9 +25411,9 @@ function CompanyOtherDetails({
|
|
|
24855
25411
|
requiredFields,
|
|
24856
25412
|
readOnlyFields,
|
|
24857
25413
|
optionalFields,
|
|
24858
|
-
|
|
25414
|
+
obscuredFields,
|
|
24859
25415
|
shouldValidate
|
|
24860
|
-
}), [helperText, labels2,
|
|
25416
|
+
}), [helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, shouldValidate]);
|
|
24861
25417
|
const mergedFieldProps = useMemo$1(() => {
|
|
24862
25418
|
var _a2;
|
|
24863
25419
|
return (_a2 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
@@ -24895,18 +25451,18 @@ function CompanyOtherDetails({
|
|
|
24895
25451
|
}
|
|
24896
25452
|
};
|
|
24897
25453
|
case "registrationNumber":
|
|
24898
|
-
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$
|
|
25454
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$8[country2], {
|
|
24899
25455
|
companyType: companyType2,
|
|
24900
25456
|
registrationNumberType
|
|
24901
|
-
}, defaultFieldMetadata$
|
|
25457
|
+
}, defaultFieldMetadata$8), acc);
|
|
24902
25458
|
case "taxInformation":
|
|
24903
25459
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
24904
25460
|
taxIdNumberType: taxIdentificationNumberType
|
|
24905
25461
|
}, defaultFieldMetadata), acc);
|
|
24906
25462
|
case "vatNumber":
|
|
24907
|
-
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$
|
|
25463
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
|
|
24908
25464
|
vatNumberType: taxIdentificationNumberType
|
|
24909
|
-
}, defaultFieldMetadata$
|
|
25465
|
+
}, defaultFieldMetadata$6), acc);
|
|
24910
25466
|
default:
|
|
24911
25467
|
return acc;
|
|
24912
25468
|
}
|
|
@@ -24925,7 +25481,7 @@ function CompanyOtherDetails({
|
|
|
24925
25481
|
defaultData: data,
|
|
24926
25482
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
24927
25483
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
24928
|
-
|
|
25484
|
+
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
24929
25485
|
fieldProblems: fieldValidationErrors,
|
|
24930
25486
|
shouldValidate
|
|
24931
25487
|
});
|
|
@@ -25074,7 +25630,7 @@ function CompanyOtherDetails({
|
|
|
25074
25630
|
})]
|
|
25075
25631
|
});
|
|
25076
25632
|
}
|
|
25077
|
-
const CompanyOtherDetailsComponent = memo(CompanyOtherDetails, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.requiredFields === nextProps.requiredFields && prevProps.
|
|
25633
|
+
const CompanyOtherDetailsComponent = memo(CompanyOtherDetails, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.readOnly === nextProps.readOnly && prevProps.country === nextProps.country && prevProps.legalCompanyName === nextProps.legalCompanyName && prevProps.companyType === nextProps.companyType && prevProps.kompanyVerifiedData === nextProps.kompanyVerifiedData);
|
|
25078
25634
|
const CompanyStructureComponent$1 = "";
|
|
25079
25635
|
const CompanyStructureValidation = {
|
|
25080
25636
|
entityType: {
|
|
@@ -25586,7 +26142,7 @@ function CompanySearchComponent(props) {
|
|
|
25586
26142
|
handleGetCompanyDataset,
|
|
25587
26143
|
handleRefreshCompanyDataset,
|
|
25588
26144
|
handleVerifyTin,
|
|
25589
|
-
|
|
26145
|
+
kompanyVerifiedData,
|
|
25590
26146
|
setKompanyAddress,
|
|
25591
26147
|
setKompanyVerifiedData
|
|
25592
26148
|
})
|
|
@@ -26717,7 +27273,7 @@ const Remove = ({
|
|
|
26717
27273
|
})
|
|
26718
27274
|
}) : jsx(Button, {
|
|
26719
27275
|
type: "button",
|
|
26720
|
-
icon: !hasLabel ? "bin" :
|
|
27276
|
+
icon: !hasLabel ? "bin" : void 0,
|
|
26721
27277
|
ghost: !hasLabel,
|
|
26722
27278
|
secondary: hasLabel,
|
|
26723
27279
|
negative: hasLabel,
|
|
@@ -27563,13 +28119,13 @@ const PayoutAccountTaskListItem = ({
|
|
|
27563
28119
|
const [isDeletingTransferInstrument, setIsDeletingTransferInstrument] = useState(false);
|
|
27564
28120
|
const isInstantVerificationAccount = isInstantVerifiedAccount(account);
|
|
27565
28121
|
const [isRemoveDisabled, setIsRemoveDisabled] = useState(false);
|
|
27566
|
-
const
|
|
28122
|
+
const obscuredAccountNumber = getObscuredAccountNumber(account);
|
|
27567
28123
|
const status = getTaskStatus(EntityType.BANK_ACCOUNT, capabilityProblems, legalEntityResponse, [account.id], isInstantVerificationAccount);
|
|
27568
28124
|
return jsx(TaskListItem, {
|
|
27569
28125
|
disabled: isInstantVerificationAccount && status === TaskStatus.PROCESSING,
|
|
27570
28126
|
onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
|
|
27571
28127
|
icon: "payout",
|
|
27572
|
-
title:
|
|
28128
|
+
title: obscuredAccountNumber,
|
|
27573
28129
|
tagline: isExperimentEnabled("EnableNewEntryFlow") ? void 0 : i18n.get("payoutDetails"),
|
|
27574
28130
|
status,
|
|
27575
28131
|
problems: (_a = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _a[account.id],
|
|
@@ -27805,7 +28361,7 @@ function TaskListComponent({
|
|
|
27805
28361
|
title: i18n.get("pleaseEnsureTheFollowing"),
|
|
27806
28362
|
children: jsx(TaskListItem, {
|
|
27807
28363
|
onNavigateToTask: handleOnNavigateToTaskReview,
|
|
27808
|
-
icon: "
|
|
28364
|
+
icon: "review",
|
|
27809
28365
|
title: i18n.get("submitReviewOfYourData"),
|
|
27810
28366
|
status: TaskStatus.SUBMIT,
|
|
27811
28367
|
problems: (_m = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _m[legalEntityResponse.id],
|
|
@@ -28139,16 +28695,16 @@ const TrustMembersOverview = ({
|
|
|
28139
28695
|
})
|
|
28140
28696
|
});
|
|
28141
28697
|
};
|
|
28142
|
-
const
|
|
28698
|
+
const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData) => {
|
|
28143
28699
|
if (!dataSubmitted) {
|
|
28144
28700
|
return;
|
|
28145
28701
|
}
|
|
28146
28702
|
const filtered = cloneObject(dataSubmitted);
|
|
28147
|
-
|
|
28148
|
-
const prevValue = getProp(savedData,
|
|
28149
|
-
const newValue = getProp(dataSubmitted,
|
|
28150
|
-
if (prevValue === newValue &&
|
|
28151
|
-
deleteProp(
|
|
28703
|
+
obscuredFields.forEach((obscuredField) => {
|
|
28704
|
+
const prevValue = getProp(savedData, obscuredField);
|
|
28705
|
+
const newValue = getProp(dataSubmitted, obscuredField);
|
|
28706
|
+
if (prevValue === newValue && isValueObscured(newValue)) {
|
|
28707
|
+
deleteProp(obscuredField, filtered);
|
|
28152
28708
|
}
|
|
28153
28709
|
});
|
|
28154
28710
|
return filtered;
|
|
@@ -28401,7 +28957,7 @@ function IndividualDropinComponent({
|
|
|
28401
28957
|
const onSubmit = async () => {
|
|
28402
28958
|
var _a2, _b2;
|
|
28403
28959
|
setLoadingStatus("loading");
|
|
28404
|
-
const dataSubmitted =
|
|
28960
|
+
const dataSubmitted = omitObscuredFieldsIfUnchanged(individualObscuredFields, data, dataFromResponse);
|
|
28405
28961
|
try {
|
|
28406
28962
|
const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
|
|
28407
28963
|
const idDocumentType = (_a2 = idDocumentTypeOptions.find(({
|
|
@@ -28951,7 +29507,7 @@ function PayoutDetailsDropinComponent({
|
|
|
28951
29507
|
if (defaultPayoutCountry === CountryCodes.Sweden && "iban" in payoutAccountDetails) {
|
|
28952
29508
|
payoutAccountDetails.currency = Currency.EUR;
|
|
28953
29509
|
}
|
|
28954
|
-
dataSubmitted.payoutAccountDetails =
|
|
29510
|
+
dataSubmitted.payoutAccountDetails = omitObscuredFieldsIfUnchanged(obscuredPayoutFields, payoutAccountDetails, existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails);
|
|
28955
29511
|
}
|
|
28956
29512
|
const event = {
|
|
28957
29513
|
segmentation: {
|
|
@@ -32414,31 +32970,6 @@ const AuthProvider = ({
|
|
|
32414
32970
|
children
|
|
32415
32971
|
});
|
|
32416
32972
|
};
|
|
32417
|
-
const fontFormats = ["eot", "woff", "woff2", "ttf", "otf"];
|
|
32418
|
-
const formatFullNames = {
|
|
32419
|
-
eot: "embedded-opentype",
|
|
32420
|
-
woff: "woff",
|
|
32421
|
-
woff2: "woff2",
|
|
32422
|
-
ttf: "truetype",
|
|
32423
|
-
otf: "opentype"
|
|
32424
|
-
};
|
|
32425
|
-
const getFontFaceRule = (fontFamily, fontStyle, fontWeight, fontPath, formats) => {
|
|
32426
|
-
const fontSources = formats.map((format) => `url(${fontPath}.${format}) format(${formatFullNames[format]})`);
|
|
32427
|
-
const ruleLines = [`font-family: '${fontFamily}'`, `font-style: ${fontStyle}`, `font-weight: ${fontWeight}`, `src: ${fontSources.join(",")}`];
|
|
32428
|
-
return `@font-face {${ruleLines.join(";")}}`;
|
|
32429
|
-
};
|
|
32430
|
-
const addStyleTagForFont = (fontFamily, fontStyle, fontWeight, fontPath, formats) => {
|
|
32431
|
-
const style = document.createElement("style");
|
|
32432
|
-
style.setAttribute("type", "text/css");
|
|
32433
|
-
style.innerText = getFontFaceRule(fontFamily, fontStyle, fontWeight, fontPath, formats);
|
|
32434
|
-
document.head.insertBefore(style, document.head.firstChild);
|
|
32435
|
-
};
|
|
32436
|
-
const addStyleTagForADLIconFont = (loadingContext) => {
|
|
32437
|
-
const fontPath = `${loadingContext}static/fonts`;
|
|
32438
|
-
const iconFontPath = `${fontPath}/adyen-kyc-icons`;
|
|
32439
|
-
addStyleTagForFont("adyen-kyc-icons", "normal", "normal", iconFontPath, fontFormats);
|
|
32440
|
-
};
|
|
32441
|
-
let isFlagsLoaded = false;
|
|
32442
32973
|
let isDocumentGuidanceLoaded = false;
|
|
32443
32974
|
const getIconContainer = () => {
|
|
32444
32975
|
const container = document.createElement("div");
|
|
@@ -32452,16 +32983,6 @@ const buildSpriteDOMFromResponse = (responseData) => {
|
|
|
32452
32983
|
iconContainer.innerHTML = responseData;
|
|
32453
32984
|
return iconContainer;
|
|
32454
32985
|
};
|
|
32455
|
-
const loadFlags = async (loadingContext) => {
|
|
32456
|
-
if (isFlagsLoaded)
|
|
32457
|
-
return;
|
|
32458
|
-
isFlagsLoaded = true;
|
|
32459
|
-
const responseData = await http({
|
|
32460
|
-
loadingContext,
|
|
32461
|
-
path: "static/images/country-flags.svg"
|
|
32462
|
-
}, null, "text");
|
|
32463
|
-
document.body.insertBefore(buildSpriteDOMFromResponse(responseData), document.body.firstChild);
|
|
32464
|
-
};
|
|
32465
32986
|
const loadDocumentGuidance = async (loadingContext) => {
|
|
32466
32987
|
if (isDocumentGuidanceLoaded)
|
|
32467
32988
|
return;
|
|
@@ -32594,7 +33115,6 @@ const getEmbeddedApi = ({
|
|
|
32594
33115
|
...baseRequestContext,
|
|
32595
33116
|
loadingContext
|
|
32596
33117
|
}, datasetIdentifier2, locale),
|
|
32597
|
-
loadFlags: async () => loadFlags(base),
|
|
32598
33118
|
loadDocumentGuidance: async () => loadDocumentGuidance(base),
|
|
32599
33119
|
getImageUrl: () => `${base}static/images/`,
|
|
32600
33120
|
getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
|
|
@@ -32738,7 +33258,6 @@ const getKycExternalApi = ({
|
|
|
32738
33258
|
loadingContext,
|
|
32739
33259
|
clientKey
|
|
32740
33260
|
}, name, locale),
|
|
32741
|
-
loadFlags: async () => loadFlags(loadingContext),
|
|
32742
33261
|
loadDocumentGuidance: async () => loadDocumentGuidance(loadingContext),
|
|
32743
33262
|
verifyIdNumber: async (request) => verifyIdNumber({
|
|
32744
33263
|
loadingContext,
|
|
@@ -32773,15 +33292,9 @@ const CoreProvider = ({
|
|
|
32773
33292
|
enableNewEntryFlowExperiment = false,
|
|
32774
33293
|
children
|
|
32775
33294
|
}) => {
|
|
32776
|
-
const {
|
|
32777
|
-
loadingContext
|
|
32778
|
-
} = useAuthContext();
|
|
32779
33295
|
const [contextCountry, setContextCountry] = useState(initialContextCountry);
|
|
32780
33296
|
const [accountHolder2, setAccountHolder] = useAccountHolder(enableNewEntryFlowExperiment);
|
|
32781
33297
|
const [accountFormat, setAccountFormat] = useState("local");
|
|
32782
|
-
useEffect(() => {
|
|
32783
|
-
addStyleTagForADLIconFont(loadingContext);
|
|
32784
|
-
}, [loadingContext]);
|
|
32785
33298
|
const allowedCountries = useAllowedCountries();
|
|
32786
33299
|
const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
|
|
32787
33300
|
useEffect(() => {
|