@opexa/portal-components 0.0.939 → 0.0.941
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/assets/providers/alize.png +0 -0
- package/dist/assets/providers/bigtime-gaming.png +0 -0
- package/dist/assets/providers/bng.png +0 -0
- package/dist/assets/providers/boongo.png +0 -0
- package/dist/assets/providers/btg.png +0 -0
- package/dist/assets/providers/cq9.png +0 -0
- package/dist/assets/providers/darwin.png +0 -0
- package/dist/assets/providers/digitain.png +0 -0
- package/dist/assets/providers/evolution.png +0 -0
- package/dist/assets/providers/fantasma-games.png +0 -0
- package/dist/assets/providers/fc.png +0 -0
- package/dist/assets/providers/fp.png +0 -0
- package/dist/assets/providers/habanero.png +0 -0
- package/dist/assets/providers/hacksaw.png +0 -0
- package/dist/assets/providers/jdb.png +0 -0
- package/dist/assets/providers/jili.png +0 -0
- package/dist/assets/providers/leap.png +0 -0
- package/dist/assets/providers/live-22-metaverse.png +0 -0
- package/dist/assets/providers/netent.png +0 -0
- package/dist/assets/providers/no-limit.png +0 -0
- package/dist/assets/providers/pg.png +0 -0
- package/dist/assets/providers/pgsoft.png +0 -0
- package/dist/assets/providers/pragmatic-play.png +0 -0
- package/dist/assets/providers/realtime-gaming.png +0 -0
- package/dist/assets/providers/redtiger.png +0 -0
- package/dist/assets/providers/rtg.png +0 -0
- package/dist/assets/providers/sagaming.png +0 -0
- package/dist/client/hooks/useAiOGCashDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useAiOGCashDepositMutation.js +90 -0
- package/dist/client/hooks/useAiOGrabPayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useAiOGrabPayDepositMutation.js +80 -0
- package/dist/client/hooks/useAiOPalawanPayDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useAiOPalawanPayDepositMutation.js +80 -0
- package/dist/client/hooks/useAiOPayMayaDepositMutation.d.ts +4 -0
- package/dist/client/hooks/useAiOPayMayaDepositMutation.js +80 -0
- package/dist/components/DepositWithdrawal/AiOPaymentMethods.d.ts +11 -0
- package/dist/components/DepositWithdrawal/AiOPaymentMethods.js +55 -0
- package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +21 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +99 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +17 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +116 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.d.ts +3 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.js +69 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.js +99 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +25 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.js +17 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.js +116 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.d.ts +3 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.js +69 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.js +85 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.js +11 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.js +11 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.js +126 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.js +12 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.d.ts +17 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.js +41 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.js +91 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.js +173 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.js +171 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +171 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.js +171 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.d.ts +8 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.js +33 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.js +120 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.js +163 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.js +165 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.js +186 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.js +157 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.js +163 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.js +166 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.js +99 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +25 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.js +19 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.js +115 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.js +81 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.js +180 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.js +10 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.js +99 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +25 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.js +2 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.js +17 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.d.ts +1 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.js +116 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.d.ts +3 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.js +69 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +13 -0
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.js +85 -0
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +11 -4
- package/dist/components/DigitainLauncher/Loading.d.ts +1 -0
- package/dist/components/DigitainLauncher/Loading.js +5 -0
- package/dist/components/Disclaimer/DisclaimerV2.js +8 -0
- package/dist/components/Disclaimer/DisclaimerV3.js +7 -0
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
- package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
- package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
- package/dist/components/Disclaimer/TermsOfUse.js +13 -0
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +1 -0
- package/dist/components/FeatureFlag/FeatureFlag.js +29 -0
- package/dist/components/FeatureFlag/index.d.ts +1 -0
- package/dist/components/FeatureFlag/index.js +1 -0
- package/dist/components/ForgotPassword/Crazywin/ForgotPassword.module.css +42 -42
- package/dist/components/Jackpots/Jackpots.module.css +288 -288
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -0
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +40 -0
- package/dist/components/KYC/BasicInformation.d.ts +1 -0
- package/dist/components/KYC/BasicInformation.js +101 -0
- package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/KYC/CaptureIdDocument.js +219 -0
- package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/KYC/CaptureSelfie.js +285 -0
- package/dist/components/KYC/DisplayImage.d.ts +5 -0
- package/dist/components/KYC/DisplayImage.js +8 -0
- package/dist/components/KYC/FileUpload.d.ts +10 -0
- package/dist/components/KYC/FileUpload.js +72 -0
- package/dist/components/KYC/IdentityVerification.d.ts +1 -0
- package/dist/components/KYC/IdentityVerification.js +120 -0
- package/dist/components/KYC/Indicator.d.ts +1 -0
- package/dist/components/KYC/Indicator.js +8 -0
- package/dist/components/KYC/KYC.lazy.d.ts +6 -0
- package/dist/components/KYC/KYC.lazy.js +45 -0
- package/dist/components/KYC/KYCContext.d.ts +6 -0
- package/dist/components/KYC/KYCContext.js +2 -0
- package/dist/components/KYC/KYCDefault/BasicInformation.d.ts +1 -0
- package/dist/components/KYC/KYCDefault/BasicInformation.js +101 -0
- package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
- package/dist/components/KYC/KYCNonPagCor/KYCVerificationStatus.lazy.js +2 -2
- package/dist/components/KYC/KYCVerificationStatus.d.ts +1 -0
- package/dist/components/KYC/KYCVerificationStatus.js +10 -0
- package/dist/components/KYC/KYCVerificationStatus.lazy.d.ts +1 -0
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +39 -0
- package/dist/components/KYC/NoCameraError.d.ts +7 -0
- package/dist/components/KYC/NoCameraError.js +6 -0
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/KYC/PersonalInformation.d.ts +1 -0
- package/dist/components/KYC/PersonalInformation.js +122 -0
- package/dist/components/KYC/backup/Header.d.ts +1 -0
- package/dist/components/KYC/backup/Header.js +8 -0
- package/dist/components/KYC/backup/Indicator.d.ts +1 -0
- package/dist/components/KYC/backup/Indicator.js +9 -0
- package/dist/components/KYC/backup/KYC.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.js +14 -0
- package/dist/components/KYC/backup/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.lazy.js +26 -0
- package/dist/components/KYC/backup/KYCContext.d.ts +6 -0
- package/dist/components/KYC/backup/KYCContext.js +2 -0
- package/dist/components/KYC/backup/Step1.d.ts +1 -0
- package/dist/components/KYC/backup/Step1.js +13 -0
- package/dist/components/KYC/backup/Step2.d.ts +1 -0
- package/dist/components/KYC/backup/Step2.js +13 -0
- package/dist/components/KYC/backup/Step3.d.ts +1 -0
- package/dist/components/KYC/backup/Step3.js +13 -0
- package/dist/components/KYC/backup/Step4.d.ts +1 -0
- package/dist/components/KYC/backup/Step4.js +7 -0
- package/dist/components/KYC/backup/useKYC.d.ts +10 -0
- package/dist/components/KYC/backup/useKYC.js +8 -0
- package/dist/components/KYC/loadModels.d.ts +1 -0
- package/dist/components/KYC/loadModels.js +9 -0
- package/dist/components/KYC/useKYC.d.ts +25 -0
- package/dist/components/KYC/useKYC.js +38 -0
- package/dist/components/KYC/utils.d.ts +9 -0
- package/dist/components/KYC/utils.js +79 -0
- package/dist/components/KYCNotRequired/KYCNotRequired.d.ts +0 -0
- package/dist/components/KYCNotRequired/KYCNotRequired.js +1 -0
- package/dist/components/Messages/Message.d.ts +1 -0
- package/dist/components/Messages/Message.js +35 -0
- package/dist/components/Messages/MessageContext.d.ts +6 -0
- package/dist/components/Messages/MessageContext.js +2 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +20 -0
- package/dist/components/Messages/MessageTrigger.d.ts +8 -0
- package/dist/components/Messages/MessageTrigger.js +19 -0
- package/dist/components/PortalProvider/CXDTokenObserver.d.ts +1 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +30 -0
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.d.ts +1 -0
- package/dist/components/PortalProvider/LinkGoogleAccountObserver.js +29 -0
- package/dist/components/Quests/CountdownTimer.d.ts +15 -0
- package/dist/components/Quests/CountdownTimer.js +33 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +78 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
- package/dist/components/Quests/MultiWageringQuest.d.ts +1 -0
- package/dist/components/Quests/MultiWageringQuest.js +111 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
- package/dist/components/SessionWatcher/SessionWatcher.d.ts +1 -0
- package/dist/components/SessionWatcher/SessionWatcher.js +20 -0
- package/dist/components/SessionWatcher/index.d.ts +1 -0
- package/dist/components/SessionWatcher/index.js +1 -0
- package/dist/components/SignIn/utils.d.ts +8 -0
- package/dist/components/SignIn/utils.js +26 -0
- package/dist/components/SignUp/SignUp.lazy.d.ts +12 -0
- package/dist/components/SignUp/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
- package/dist/components/SignUp/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpForm.js +284 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
- package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
- package/dist/components/SingleSignOn/SingleSignOn.d.ts +1 -1
- package/dist/components/SingleSignOn/SingleSignOn.js +7 -15
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/shared/IdDocumentField.client.d.ts +25 -0
- package/dist/components/shared/IdDocumentField.client.js +204 -0
- package/dist/components/shared/IdDocumentField.d.ts +2 -0
- package/dist/components/shared/IdDocumentField.js +11 -0
- package/dist/components/shared/SelfieField.client.d.ts +20 -0
- package/dist/components/shared/SelfieField.client.js +327 -0
- package/dist/components/shared/SelfieField.d.ts +2 -0
- package/dist/components/shared/SelfieField.js +11 -0
- package/dist/constants/BranchCode.d.ts +4 -0
- package/dist/constants/BranchCode.js +42 -0
- package/dist/constants/Branches.d.ts +2 -0
- package/dist/constants/Branches.js +42 -0
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +67 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +71 -0
- package/dist/handlers.d.ts +43 -0
- package/dist/handlers.js +297 -0
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +4 -0
- package/dist/images/game-providers/ALPHACHINKO.png +0 -0
- package/dist/images/phone-icon.svg +10 -10
- package/dist/images/responsible-gaming-yellow.png +0 -0
- package/dist/services/queries.js +3369 -3369
- package/dist/styles/theme.css +776 -776
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +1 -0
- package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
- package/dist/third-parties/FacebookPixel/index.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
- package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
- package/dist/third-parties/index.d.ts +2 -0
- package/dist/third-parties/index.js +2 -0
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/utils/dataUrlToBlob.d.ts +1 -0
- package/dist/utils/dataUrlToBlob.js +11 -0
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
- package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
- package/dist/utils/getGameName.d.ts +1 -0
- package/dist/utils/getGameName.js +6 -0
- package/dist/utils/getLocaleInfo.d.ts +79 -0
- package/dist/utils/getLocaleInfo.js +175 -0
- package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
- package/dist/utils/isBetween3amAnd3pm.js +5 -0
- package/dist/utils/resizeImageSize.d.ts +2 -0
- package/dist/utils/resizeImageSize.js +11 -0
- package/package.json +179 -179
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { Controller, useForm } from 'react-hook-form';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { useShallow } from 'zustand/shallow';
|
|
8
|
+
import { useCreateMemberVerificationMutation } from '../../client/hooks/useCreateMemberVerificationMutation.js';
|
|
9
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
|
+
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
11
|
+
import { useUpdateMemberVerificationMutation } from '../../client/hooks/useUpdateMemberVerificationMutation.js';
|
|
12
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
15
|
+
import { Field } from '../../ui/Field/index.js';
|
|
16
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
17
|
+
import { getMemberVerificationQueryKey } from '../../utils/queryKeys.js';
|
|
18
|
+
import { IdFrontImageField } from '../shared/IdFrontImageField/index.js';
|
|
19
|
+
import { SelfieImageField } from '../shared/SelfieImageField/index.js';
|
|
20
|
+
import { useKYCContext } from './KYCContext.js';
|
|
21
|
+
const formSchema = z.object({
|
|
22
|
+
selfieImage: z.string().min(1, 'Selfie image is required.'),
|
|
23
|
+
idFrontImage: z.string().min(1, 'Front image of ID is required.'),
|
|
24
|
+
});
|
|
25
|
+
export function IdentityVerification() {
|
|
26
|
+
const kyc = useKYCContext();
|
|
27
|
+
const { mutate: createMemberVerification, isPending: createPending } = useCreateMemberVerificationMutation({
|
|
28
|
+
onSuccess: () => {
|
|
29
|
+
toaster.success({
|
|
30
|
+
title: 'ID Front Image & Selfie Image uploaded successfully',
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
onError: (error) => {
|
|
34
|
+
toaster.error({
|
|
35
|
+
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
36
|
+
description: error.message,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const { mutate: updateMemberVerification, isPending: updatePending } = useUpdateMemberVerificationMutation({
|
|
41
|
+
onSuccess: () => {
|
|
42
|
+
const queryClient = getQueryClient();
|
|
43
|
+
toaster.success({
|
|
44
|
+
title: 'ID Front Image & Selfie Image updated successfully',
|
|
45
|
+
});
|
|
46
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
|
|
47
|
+
if (!prev)
|
|
48
|
+
return prev;
|
|
49
|
+
return {
|
|
50
|
+
...prev,
|
|
51
|
+
status: 'CREATED',
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
onError: (error) => {
|
|
56
|
+
toaster.error({
|
|
57
|
+
title: 'Failed to upload ID Front Image & Selfie Image',
|
|
58
|
+
description: error.message,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const memberVerification = useMemberVerificationQuery();
|
|
63
|
+
const memberId = memberVerification.data?.id;
|
|
64
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
65
|
+
kyc: ctx.kyc,
|
|
66
|
+
})));
|
|
67
|
+
const form = useForm({
|
|
68
|
+
resolver: zodResolver(formSchema),
|
|
69
|
+
defaultValues: {
|
|
70
|
+
idFrontImage: '',
|
|
71
|
+
selfieImage: '',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
function onSubmit(values) {
|
|
75
|
+
if (!memberId) {
|
|
76
|
+
createMemberVerification({
|
|
77
|
+
selfieImage: values.selfieImage,
|
|
78
|
+
idFrontImage: values.idFrontImage,
|
|
79
|
+
address: '',
|
|
80
|
+
nationality: '',
|
|
81
|
+
natureOfWork: '',
|
|
82
|
+
permanentAddress: '',
|
|
83
|
+
placeOfBirth: '',
|
|
84
|
+
sourceOfIncome: '',
|
|
85
|
+
});
|
|
86
|
+
kyc.setStep(3);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
updateMemberVerification({
|
|
90
|
+
id: memberId,
|
|
91
|
+
data: {
|
|
92
|
+
selfieImage: values.selfieImage,
|
|
93
|
+
idFrontImage: values.idFrontImage,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
kyc.setStep(3);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (kyc.selfieImageId)
|
|
101
|
+
form.setValue('selfieImage', kyc.selfieImageId);
|
|
102
|
+
if (kyc.idFrontImageId)
|
|
103
|
+
form.setValue('idFrontImage', kyc.idFrontImageId);
|
|
104
|
+
}, [form, kyc.idFrontImageId, kyc.selfieImageId]);
|
|
105
|
+
return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center text-lg font-semibold", children: "Verify your identity" }), _jsx(Dialog.Description, { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Verify your details to confirm your identity and secure your access." }), _jsxs("div", { className: "border-border-primary bg-bg-primary text-text-placeholder mt-7 rounded-xl border p-lg text-xs leading-tight", children: [_jsx("h3", { className: "font-semibold", children: "Instructions" }), _jsxs("ol", { className: "mt-2 list-inside list-decimal", children: [_jsx("li", { children: "Upload a full photo of your ID." }), _jsx("li", { children: "Please ensure that all details in the uploaded image are legible." }), _jsx("li", { children: "Please ensure that the ID uploaded is within the validity period." })] })] }), _jsxs("form", { className: "mt-xl", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(Controller, { control: form.control, name: "idFrontImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, children: [_jsx(Field.Label, { children: "Front of your ID" }), _jsx(IdFrontImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
|
|
106
|
+
form.setValue('idFrontImage', '');
|
|
107
|
+
form.setError('idFrontImage', {
|
|
108
|
+
type: 'validate',
|
|
109
|
+
message: error.message,
|
|
110
|
+
});
|
|
111
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Controller, { control: form.control, name: "selfieImage", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-3", children: [_jsx(Field.Label, { children: "Selfie holding your ID" }), _jsx(SelfieImageField, { value: o.field.value, onChange: o.field.onChange, onError: (error) => {
|
|
112
|
+
form.setValue('selfieImage', '');
|
|
113
|
+
form.setError('selfieImage', {
|
|
114
|
+
type: 'validate',
|
|
115
|
+
message: error.message,
|
|
116
|
+
});
|
|
117
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", type: "button", onClick: () => {
|
|
118
|
+
globalStore.kyc.setOpen(false);
|
|
119
|
+
}, children: "Skip for now" })] })] }));
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Indicator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { noop } from 'lodash-es';
|
|
3
|
+
import { Progress } from '../../ui/Progress/index.js';
|
|
4
|
+
import { useKYCContext } from './KYCContext.js';
|
|
5
|
+
export function Indicator() {
|
|
6
|
+
const kyc = useKYCContext();
|
|
7
|
+
return (_jsxs("div", { className: "flex items-center justify-center gap-1.5 py-3", children: [_jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step > 1 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step > 2 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step === 3 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ImageProps } from 'next/image';
|
|
2
|
+
import { type KYCReminderProps } from './KYCReminder.lazy';
|
|
3
|
+
export interface KYCProps extends KYCReminderProps {
|
|
4
|
+
logo: ImageProps['src'];
|
|
5
|
+
}
|
|
6
|
+
export declare function KYC(props: KYCProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
8
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
9
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
10
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
11
|
+
import { BasicInformation } from './BasicInformation.js';
|
|
12
|
+
import { IdentityVerification } from './IdentityVerification.js';
|
|
13
|
+
import { Indicator } from './Indicator.js';
|
|
14
|
+
import { KYCContext } from './KYCContext.js';
|
|
15
|
+
import { KYCReminder } from './KYCReminder.lazy.js';
|
|
16
|
+
import { PersonalInformation } from './PersonalInformation.js';
|
|
17
|
+
import { useKYC } from './useKYC.js';
|
|
18
|
+
export function KYC(props) {
|
|
19
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({ kyc: ctx.kyc })));
|
|
20
|
+
const kyc = useKYC();
|
|
21
|
+
const { data: account } = useAccountQuery();
|
|
22
|
+
const { data: verification } = useMemberVerificationQuery();
|
|
23
|
+
const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
|
|
24
|
+
const isUploadCompleted = Boolean(verification?.idFrontImage) && Boolean(verification?.selfieImage);
|
|
25
|
+
const isVerified = Boolean(verification?.status === 'VERIFIED') ||
|
|
26
|
+
Boolean(verification?.status === 'PENDING') ||
|
|
27
|
+
Boolean(verification?.status === 'APPROVED');
|
|
28
|
+
const isRejected = Boolean(verification?.status === 'REJECTED');
|
|
29
|
+
const hasMissingData = !isBasicInfoCompleted || !isUploadCompleted || !isVerified;
|
|
30
|
+
const steps = !isBasicInfoCompleted
|
|
31
|
+
? 1
|
|
32
|
+
: !isUploadCompleted
|
|
33
|
+
? 2
|
|
34
|
+
: isRejected
|
|
35
|
+
? 2
|
|
36
|
+
: 3;
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (steps) {
|
|
39
|
+
kyc.setStep(steps);
|
|
40
|
+
}
|
|
41
|
+
}, [steps, kyc]);
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx(KYCContext, { value: kyc, children: _jsx(Dialog.Root, { open: globalStore.kyc.open && hasMissingData, onOpenChange: (details) => {
|
|
43
|
+
globalStore.kyc.setOpen(details.open);
|
|
44
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "bg-bg-primary-alt lg:min-h-auto mx-auto min-h-full w-full overflow-y-auto lg:w-fit", children: _jsxs("div", { className: "flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit sm:overflow-auto lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(BasicInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function BasicInformation(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import { differenceInYears, format, isSameDay, isValid, parse } from 'date-fns';
|
|
4
|
+
import { isNil, omitBy, size } from 'lodash-es';
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
import { useForm } from 'react-hook-form';
|
|
7
|
+
import invariant from 'tiny-invariant';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { useAccountQuery } from '../../../client/hooks/useAccountQuery.js';
|
|
10
|
+
import { useUpdateAccountMutation } from '../../../client/hooks/useUpdateAccountMutation.js';
|
|
11
|
+
import { toaster } from '../../../client/utils/toaster.js';
|
|
12
|
+
import { Button } from '../../../ui/Button/index.js';
|
|
13
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
14
|
+
import { Field } from '../../../ui/Field/index.js';
|
|
15
|
+
import { useKYCDefaultContext } from './KYCDefaultContext.js';
|
|
16
|
+
const definition = z.object({
|
|
17
|
+
realName: z
|
|
18
|
+
.string()
|
|
19
|
+
.min(3, 'Name must be 3 or more characters')
|
|
20
|
+
.max(50, 'Name must not be more than 50 characters')
|
|
21
|
+
.regex(/^[a-z0-9 ]+$/gi, 'Name must not contain special characters')
|
|
22
|
+
.trim(),
|
|
23
|
+
birthDay: z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1, 'Date of birth is required')
|
|
26
|
+
.superRefine((value, ctx) => {
|
|
27
|
+
const dob = parse(value, 'yyyy-MM-dd', new Date());
|
|
28
|
+
if (!isValid(dob)) {
|
|
29
|
+
return ctx.addIssue({
|
|
30
|
+
code: z.ZodIssueCode.invalid_date,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const now = new Date();
|
|
34
|
+
const age = differenceInYears(now, dob);
|
|
35
|
+
if (age < 21) {
|
|
36
|
+
return ctx.addIssue({
|
|
37
|
+
code: z.ZodIssueCode.custom,
|
|
38
|
+
message: 'You must be at least 21 years old',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
branchCode: z.string().min(4).max(10).optional().or(z.literal('')),
|
|
43
|
+
});
|
|
44
|
+
export function BasicInformation() {
|
|
45
|
+
const kyc = useKYCDefaultContext();
|
|
46
|
+
const form = useForm({
|
|
47
|
+
resolver: zodResolver(definition),
|
|
48
|
+
mode: 'all',
|
|
49
|
+
defaultValues: {
|
|
50
|
+
birthDay: '',
|
|
51
|
+
branchCode: '',
|
|
52
|
+
realName: '',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const accountQuery = useAccountQuery();
|
|
56
|
+
const account = accountQuery.data;
|
|
57
|
+
const stepCompleted = account != null && account.realName != null && account.birthDay != null;
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (stepCompleted)
|
|
60
|
+
kyc.setStep(2);
|
|
61
|
+
}, [stepCompleted, kyc]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (account) {
|
|
64
|
+
form.reset({
|
|
65
|
+
realName: account.realName ?? '',
|
|
66
|
+
birthDay: account.birthDay
|
|
67
|
+
? format(account.birthDay, 'yyyy-MM-dd')
|
|
68
|
+
: '',
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, [account, form]);
|
|
72
|
+
const updateAccountMutation = useUpdateAccountMutation({
|
|
73
|
+
onError(error) {
|
|
74
|
+
toaster.error({
|
|
75
|
+
title: 'Error',
|
|
76
|
+
description: error.message,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
onSuccess() {
|
|
80
|
+
kyc.setStep(2);
|
|
81
|
+
toaster.success({
|
|
82
|
+
title: 'Success',
|
|
83
|
+
description: 'Basic information has been set successfully.',
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center font-semibold text-lg", children: "Basic Information" }), _jsx(Dialog.Description, { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Enter your basic details for identification and communication." }), _jsxs("form", { className: "mt-3", onSubmit: form.handleSubmit((data) => {
|
|
88
|
+
invariant(account);
|
|
89
|
+
const input = omitBy({
|
|
90
|
+
realName: account.realName === data.realName ? undefined : data.realName,
|
|
91
|
+
birthDay: account.birthDay && isSameDay(data.birthDay, account.birthDay)
|
|
92
|
+
? undefined
|
|
93
|
+
: format(data.birthDay, 'yyyy-MM-dd'),
|
|
94
|
+
}, isNil);
|
|
95
|
+
if (size(input) === 0)
|
|
96
|
+
return kyc.setStep(2);
|
|
97
|
+
updateAccountMutation.mutate(input);
|
|
98
|
+
}), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!accountQuery.data?.realName, children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-3", invalid: !!form.formState.errors.branchCode, readOnly: !!accountQuery.data?.birthDay, children: [_jsx(Field.Label, { children: "Date of Birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), _jsx(Button, { type: "submit", className: "mt-8", disabled: accountQuery.isLoading ||
|
|
99
|
+
updateAccountMutation.isPending ||
|
|
100
|
+
stepCompleted, children: "Continue" })] })] }));
|
|
101
|
+
}
|
|
@@ -24,8 +24,8 @@ export function KYCVerificationStatus() {
|
|
|
24
24
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
25
25
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
26
26
|
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", width: 240, height: 0, className: "w-60 object-contain", draggable: false }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', isUnverified && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
27
|
-
`Your account verification is still under review. Please wait
|
|
28
|
-
until it's approved before you can continue playing or
|
|
27
|
+
`Your account verification is still under review. Please wait
|
|
28
|
+
until it's approved before you can continue playing or
|
|
29
29
|
depositing.`, status === 'REJECTED' &&
|
|
30
30
|
'Your account verification was not approved. Please resubmit your verification to regain full access.', isUnverified &&
|
|
31
31
|
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
@@ -24,8 +24,8 @@ export function KYCVerificationStatus() {
|
|
|
24
24
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
25
25
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
26
26
|
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", width: 240, height: 0, className: "w-60 object-contain", draggable: false }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', isUnverified && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
27
|
-
`Your account verification is still under review. Please wait
|
|
28
|
-
until it's approved before you can continue playing or
|
|
27
|
+
`Your account verification is still under review. Please wait
|
|
28
|
+
until it's approved before you can continue playing or
|
|
29
29
|
depositing.`, status === 'REJECTED' &&
|
|
30
30
|
'Your account verification was not approved. Please resubmit your verification to regain full access.', isUnverified &&
|
|
31
31
|
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from 'next/dynamic';
|
|
4
|
+
const Component = dynamic(() => import('./KYCVerificationStatus.lazy.js').then((m) => m.KYCVerificationStatus), {
|
|
5
|
+
ssr: false,
|
|
6
|
+
loading: () => null,
|
|
7
|
+
});
|
|
8
|
+
export function KYCVerificationStatus() {
|
|
9
|
+
return _jsx(Component, {});
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYCVerificationStatus(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useShallow } from 'zustand/shallow';
|
|
5
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
|
+
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
7
|
+
import alertIcon from '../../images/kyc-verification-status/alert-icon.png';
|
|
8
|
+
import bellIcon from '../../images/kyc-verification-status/bell-icon.png';
|
|
9
|
+
import { Button } from '../../ui/Button/index.js';
|
|
10
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
11
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
12
|
+
export function KYCVerificationStatus() {
|
|
13
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
14
|
+
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
15
|
+
kyc: ctx.kyc,
|
|
16
|
+
})));
|
|
17
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
18
|
+
console.log(verificationQuery, 'data');
|
|
19
|
+
const status = verificationQuery?.data?.status ?? 'UNVERIFIED';
|
|
20
|
+
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
21
|
+
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
22
|
+
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
23
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' ||
|
|
24
|
+
status === 'CREATED' ||
|
|
25
|
+
(verificationQuery?.data === null && 'Verification Required')] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
26
|
+
`Your account verification is still under review. Please wait
|
|
27
|
+
until it's approved before you can continue playing or
|
|
28
|
+
depositing.`, status === 'REJECTED' &&
|
|
29
|
+
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' ||
|
|
30
|
+
status === 'CREATED' ||
|
|
31
|
+
(verificationQuery?.data === null &&
|
|
32
|
+
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.')] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
33
|
+
globalStore.kycVerificationStatus.setOpen(false);
|
|
34
|
+
globalStore.kyc.setOpen(true);
|
|
35
|
+
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' ||
|
|
36
|
+
(status === 'CREATED' && 'Verify Now')] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
37
|
+
globalStore.kycVerificationStatus.setOpen(false);
|
|
38
|
+
}, children: "Close" })] }) }) })] }) }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../ui/Button/index.js';
|
|
3
|
+
function NoCameraError({ onRetry, title, description }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2 p-4", children: [_jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-red-500 mb-2", children: title }), _jsx("p", { className: "mb-2 text-sm", children: description })] }), _jsx(Button, { className: "mx-auto px-xl lg:w-fit", onClick: onRetry, size: "sm", children: "Try Again" })] }));
|
|
5
|
+
}
|
|
6
|
+
export default NoCameraError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
function PersonOverlayDesktop({ isFaceCentered, height, width }) {
|
|
3
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "pointer-events-none absolute inset-0 hidden md:block", children: _jsxs("svg", { width: `${width}px`, height: `${height}px`, viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "xMidYMid meet", className: "max-h-full w-full", children: [_jsxs("defs", { children: [_jsx("path", { id: "head-shoulder-path", d: "M 389.605 124.529 C 390.221 129.441 390.638 134.433 390.846 139.492 L 390.932 151.978 C 390.841 155.321 390.658 158.636 390.388 161.919 C 388.294 162.987 388.18 164.214 389 168 L 390.277 171.709 L 395 181 C 395.61 182.222 396.985 183.052 398.459 183.693 L 399.097 183.956 C 401.81 185.016 404.425 186.275 406.923 187.715 L 420.473 198.503 C 424.405 202.729 427.713 207.542 430.252 212.795 L 435.357 229.337 C 435.78 232.162 436 235.055 436 238 V 244.833 V 258.5 H 436 V 272.167 V 285.833 H 436 V 299.5 V 313.167 H 436 V 320 C 436 321.36 435.73 322.651 435.242 323.827 L 429.827 329.242 C 428.651 329.73 427.36 330 426 330 H 418.275 H 402.825 V 330 H 387.375 H 371.925 V 330 H 356.475 H 341.025 V 330 H 325.575 H 310.125 V 330 H 294.675 H 279.225 V 330 H 263.775 H 248.325 V 330 H 232.875 H 217.425 V 330 H 201.975 H 186.525 V 330 H 171.075 H 155.625 V 330 H 140.175 H 124.725 V 330 H 117 C 115.641 330 114.349 329.73 113.173 329.242 L 107.758 323.827 C 107.27 322.651 107 321.36 107 320 V 313.167 V 299.5 H 107 V 285.833 V 272.167 H 107 V 258.5 V 244.833 H 107 V 238 C 107 235.088 107.214 232.227 107.628 229.433 L 112.622 213.056 C 115.107 207.848 118.347 203.067 122.2 198.856 L 135.494 188.055 C 137.641 186.783 139.877 185.647 142.19 184.656 L 143.186 184.241 C 144.876 183.555 146.441 182.623 147.83 181.498 L 153.722 172.52 C 154.177 170.759 154.329 168.902 154.116 167.011 L 153.981 165.769 C 153.85 164.525 153.732 163.276 153.627 162.022 C 151.354 158.847 151.164 155.472 151.069 152.068 L 151.153 139.492 C 151.36 134.462 151.773 129.498 152.383 124.613 L 152.394 124.529 L 154.894 109.723 C 155.95 104.771 157.212 99.9212 158.668 95.1875 L 163.727 81.0498 C 165.649 76.3661 167.77 71.8259 170.076 67.4453 L 177.715 54.5254 C 180.508 50.3027 183.489 46.274 186.641 42.457 L 196.832 31.4316 C 200.471 27.9227 204.28 24.6674 208.24 21.6846 L 220.789 13.4502 C 225.168 10.9758 229.688 8.8149 234.332 6.9912 L 248.66 2.544 C 253.508 1.4258 258.458 0.6639 263.493 0.2832 L 278.506 0.2832 C 283.541 0.6638 288.491 1.4259 293.339 2.544 L 307.667 6.9912 C 312.311 8.8149 316.831 10.9758 321.21 13.4502 L 333.759 21.6846 C 337.719 24.6673 341.528 27.9227 345.167 31.4316 L 355.359 42.458 C 358.511 46.2749 361.491 50.3038 364.284 54.5264 L 371.923 67.4453 C 374.229 71.826 376.35 76.3661 378.272 81.0498 L 383.331 95.1875 C 384.787 99.9212 386.049 104.771 387.105 109.723 L 389.605 124.529 Z" }), _jsxs("mask", { id: "outline-mask", children: [_jsx("rect", { width: "100%", height: "100%", fill: "white" }), _jsx("use", { href: "#head-shoulder-path", fill: "black" })] })] }), _jsx("rect", { width: "100%", height: "100%", fill: !isFaceCentered
|
|
4
|
+
? 'rgba(156, 156, 156, 0.40)'
|
|
5
|
+
: 'rgba(34, 139, 87, 0.75)', mask: "url(#outline-mask)" }), _jsx("use", { href: "#head-shoulder-path", fill: "none", stroke: !isFaceCentered ? '#B54708' : '#34D399', strokeWidth: "3", strokeDasharray: "10 5" })] }) }), _jsx("div", { className: "pointer-events-none absolute inset-0 block md:hidden", children: _jsxs("svg", { className: "block md:hidden", width: "100%", height: "100%", viewBox: "0 0 400 400", preserveAspectRatio: "xMidYMid slice", children: [_jsxs("defs", { children: [_jsx("path", { id: "fill-path", d: "M 300.85 220.1 C 301.15 223.9 302.705 227.284 305.171 230.096 V 230.097 L 311.15 234.9 L 316.351 238.504 C 320.778 242.037 324.741 246.126 328.135 250.665 L 336.459 265.409 C 338.554 270.577 340.015 276.069 340.746 281.79 V 320.036 V 359.74 V 369.667 L 340.28 374.731 C 338.938 377.967 336.351 380.555 333.115 381.896 H 300.872 H 264.633 H 228.396 H 192.158 H 155.921 H 119.682 H 83.4439 H 74.3844 L 69.319 381.896 C 66.0834 380.554 63.4953 377.967 62.1539 374.731 V 339.888 V 320.036 V 300.184 L 62.15 281.9 C 62.459 275.847 63.967 270.273 66.127 265.038 L 74.702 250.13 C 78.005 245.806 81.828 241.899 86.08 238.506 L 86.819 237.925 L 98.284 229.572 L 104.15 223.9 C 105.146 217.607 104.959 215.459 104.343 213.349 L 102.15 210.9 L 98.15 202.9 C 97.985 196.059 96.943 188.701 96.423 181.159 L 96.31 160.744 C 96.641 154.989 97.273 149.337 98.193 143.813 L 98.454 142.294 L 102.789 124.231 C 104.631 118.212 106.825 112.406 109.34 106.849 L 118.126 90.483 C 121.479 85.154 125.161 80.154 129.135 75.528 L 142.322 62.463 C 147.129 58.431 152.22 54.874 157.55 51.845 L 174.504 44.306 C 180.364 42.381 186.424 41.058 192.638 40.394 L 211.201 40.394 C 217.414 41.057 223.474 42.381 229.334 44.306 L 246.288 51.845 C 251.619 54.874 256.709 58.431 261.516 62.463 L 274.703 75.528 C 278.677 80.154 282.359 85.154 285.712 90.483 L 294.499 106.849 C 297.014 112.406 299.208 118.212 301.049 124.231 L 305.385 142.294 V 142.293 C 306.447 148.299 307.168 154.46 307.529 160.744 L 307.403 181.33 C 306.867 188.989 305.792 196.459 304.224 203.681 C 301.374 206.417 300.58 209.572 300.15 212.9 L 300.15 214.9 L 300.85 220.1 Z" }), _jsx("path", { id: "border-path", d: "M 300.85 220.1 C 301.15 223.9 302.705 227.284 305.171 230.096 V 230.097 L 311.15 234.9 L 316.351 238.504 C 320.778 242.037 324.741 246.126 328.135 250.665 L 336.459 265.409 C 338.554 270.577 340.015 276.069 340.746 281.79 V 320.036 V 359.74 V 369.667 L 340.28 374.731 C 338.938 377.967 336.351 380.555 333.115 381.896 H 300.872 H 264.633 H 228.396 H 192.158 H 155.921 H 119.682 H 83.4439 H 74.3844 L 69.319 381.896 C 66.0834 380.554 63.4953 377.967 62.1539 374.731 V 339.888 V 320.036 V 300.184 L 62.15 281.9 C 62.459 275.847 63.967 270.273 66.127 265.038 L 74.702 250.13 C 78.005 245.806 81.828 241.899 86.08 238.506 L 86.819 237.925 L 98.284 229.572 L 104.15 223.9 C 105.146 217.607 104.959 215.459 104.343 213.349 L 102.15 210.9 L 98.15 202.9 C 97.985 196.059 96.943 188.701 96.423 181.159 L 96.31 160.744 C 96.641 154.989 97.273 149.337 98.193 143.813 L 98.454 142.294 L 102.789 124.231 C 104.631 118.212 106.825 112.406 109.34 106.849 L 118.126 90.483 C 121.479 85.154 125.161 80.154 129.135 75.528 L 142.322 62.463 C 147.129 58.431 152.22 54.874 157.55 51.845 L 174.504 44.306 C 180.364 42.381 186.424 41.058 192.638 40.394 L 211.201 40.394 C 217.414 41.057 223.474 42.381 229.334 44.306 L 246.288 51.845 C 251.619 54.874 256.709 58.431 261.516 62.463 L 274.703 75.528 C 278.677 80.154 282.359 85.154 285.712 90.483 L 294.499 106.849 C 297.014 112.406 299.208 118.212 301.049 124.231 L 305.385 142.294 V 142.293 C 306.447 148.299 307.168 154.46 307.529 160.744 L 307.403 181.33 C 306.867 188.989 305.792 196.459 304.224 203.681 C 301.374 206.417 300.58 209.572 300.15 212.9 L 300.15 214.9 L 300.85 220.1 Z" }), _jsx("clipPath", { id: "face-cutout", children: _jsx("use", { href: "#fill-path" }) }), _jsxs("mask", { id: "face-mask", children: [_jsx("rect", { x: "0", y: "0", width: "400", height: "400", fill: "white" }), _jsx("use", { href: "#fill-path", fill: "black" })] })] }), _jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: !isFaceCentered
|
|
6
|
+
? 'rgba(156, 156, 156, 0.40)'
|
|
7
|
+
: 'rgba(34, 139, 87, 0.75)', mask: "url(#face-mask)" }), _jsx("use", { href: "#border-path", fill: "none", stroke: !isFaceCentered ? '#B54708' : '#34D399', strokeWidth: "3", strokeDasharray: "12 8", strokeLinecap: "round", id: "border-element" })] }) })] }));
|
|
8
|
+
}
|
|
9
|
+
export default PersonOverlayDesktop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PersonalInformation(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { useShallow } from 'zustand/shallow';
|
|
6
|
+
import { useApproveMemberVerification } from '../../client/hooks/useApproveMemberVerification.js';
|
|
7
|
+
import { useCreateMemberVerificationMutation } from '../../client/hooks/useCreateMemberVerificationMutation.js';
|
|
8
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
9
|
+
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
10
|
+
import { useUpdateMemberVerificationMutation } from '../../client/hooks/useUpdateMemberVerificationMutation.js';
|
|
11
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
12
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
15
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
16
|
+
import { Field } from '../../ui/Field/index.js';
|
|
17
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
18
|
+
import { getMemberVerificationQueryKey } from '../../utils/queryKeys.js';
|
|
19
|
+
import { useKYCContext } from './KYCContext.js';
|
|
20
|
+
const definition = z.object({
|
|
21
|
+
address: z.string().trim().min(1, 'Current address is required'),
|
|
22
|
+
permanentAddress: z.string().trim().min(1, 'Permanent address is required'),
|
|
23
|
+
sourceOfIncome: z.string().trim().min(1, 'Source of Income is required'),
|
|
24
|
+
natureOfWork: z.string().trim().min(1, 'Nature of Work is required'),
|
|
25
|
+
placeOfBirth: z.string().trim().min(1, 'Place of Birth is required'),
|
|
26
|
+
nationality: z.string().trim().min(1, 'Nationality is required'),
|
|
27
|
+
});
|
|
28
|
+
export function PersonalInformation() {
|
|
29
|
+
const kyc = useKYCContext();
|
|
30
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
31
|
+
kyc: ctx.kyc,
|
|
32
|
+
})));
|
|
33
|
+
const memberVerificationQuery = useMemberVerificationQuery();
|
|
34
|
+
const memberVerificationId = memberVerificationQuery.data?.id;
|
|
35
|
+
const approveMemberVerificationMutation = useApproveMemberVerification();
|
|
36
|
+
const updateMemberVerificationMutation = useUpdateMemberVerificationMutation({
|
|
37
|
+
onError(error) {
|
|
38
|
+
toaster.error({
|
|
39
|
+
description: error.message,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
onSuccess() {
|
|
43
|
+
const queryClient = getQueryClient();
|
|
44
|
+
queryClient.setQueryData(getMemberVerificationQueryKey(), (prev) => {
|
|
45
|
+
if (!prev)
|
|
46
|
+
return prev;
|
|
47
|
+
return {
|
|
48
|
+
...prev,
|
|
49
|
+
status: 'PENDING',
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
kyc.setDone(true);
|
|
53
|
+
globalStore.kyc.setOpen(false);
|
|
54
|
+
toaster.success({
|
|
55
|
+
title: 'Success',
|
|
56
|
+
description: 'Personal information has been set successfully.',
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const createMemberVerificationMutation = useCreateMemberVerificationMutation({
|
|
61
|
+
onError(error) {
|
|
62
|
+
toaster.error({
|
|
63
|
+
description: error.message,
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onSuccess() {
|
|
67
|
+
kyc.setDone(true);
|
|
68
|
+
globalStore.kyc.setOpen(false);
|
|
69
|
+
toaster.success({
|
|
70
|
+
title: 'Success',
|
|
71
|
+
description: 'Personal information has been set successfully.',
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const form = useForm({
|
|
76
|
+
resolver: zodResolver(definition),
|
|
77
|
+
defaultValues: {
|
|
78
|
+
address: '',
|
|
79
|
+
nationality: '',
|
|
80
|
+
natureOfWork: '',
|
|
81
|
+
placeOfBirth: '',
|
|
82
|
+
permanentAddress: '',
|
|
83
|
+
},
|
|
84
|
+
mode: 'all',
|
|
85
|
+
});
|
|
86
|
+
async function onSubmit(values) {
|
|
87
|
+
if (!memberVerificationId) {
|
|
88
|
+
createMemberVerificationMutation.mutate({
|
|
89
|
+
...values,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
await updateMemberVerificationMutation.mutateAsync({
|
|
94
|
+
id: memberVerificationId,
|
|
95
|
+
data: {
|
|
96
|
+
...values,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
//approve status of member to be pending
|
|
100
|
+
await approveMemberVerificationMutation.mutateAsync({
|
|
101
|
+
id: memberVerificationId,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const address = form.watch('address');
|
|
106
|
+
const permanentAddress = form.watch('permanentAddress');
|
|
107
|
+
return (_jsxs("div", { children: [_jsx(Dialog.Title, { className: "text-center text-lg font-semibold", children: "Personal Information" }), _jsx(Dialog.Description, { className: "text-text-secondary-700 mt-xs text-center text-sm", children: "Provide your basic details and work info." }), _jsxs("form", { className: "mt-7", onSubmit: form.handleSubmit(onSubmit), children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.permanentAddress, children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, { placeholder: "Enter your permanent address", ...form.register('permanentAddress') }), _jsx(Field.ErrorText, { children: form.formState.errors.permanentAddress?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.address, children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, { placeholder: "Enter your current address", ...form.register('address') }), _jsx(Field.ErrorText, { children: form.formState.errors.address?.message })] }), _jsxs(Checkbox.Root, { className: "mt-md", checked: address !== '' &&
|
|
108
|
+
permanentAddress !== '' &&
|
|
109
|
+
address === permanentAddress, onCheckedChange: (details) => {
|
|
110
|
+
if (details.checked === true) {
|
|
111
|
+
form.setValue('address', form.getValues('permanentAddress'), {
|
|
112
|
+
shouldDirty: true,
|
|
113
|
+
shouldTouch: true,
|
|
114
|
+
shouldValidate: true,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, disabled: !permanentAddress, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Use permanent address as current address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.sourceOfIncome, children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, { placeholder: "Enter your source of income", ...form.register('sourceOfIncome') }), _jsx(Field.ErrorText, { children: form.formState.errors.sourceOfIncome?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.natureOfWork, children: [_jsx(Field.Label, { children: "Work Description" }), _jsx(Field.Input, { placeholder: "Enter your work description", ...form.register('natureOfWork') }), _jsx(Field.ErrorText, { children: form.formState.errors.natureOfWork?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.placeOfBirth, children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, { placeholder: "Enter your place of birth", ...form.register('placeOfBirth') }), _jsx(Field.ErrorText, { children: form.formState.errors.placeOfBirth?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.nationality, children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, { placeholder: "Enter your nationality", ...form.register('nationality') }), _jsx(Field.ErrorText, { children: form.formState.errors.nationality?.message })] }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: updateMemberVerificationMutation.isPending ||
|
|
118
|
+
createMemberVerificationMutation.isPending, children: "Continue" }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
|
|
119
|
+
globalStore.kyc.setOpen(false);
|
|
120
|
+
}, disabled: updateMemberVerificationMutation.isPending ||
|
|
121
|
+
createMemberVerificationMutation.isPending, children: "Skip for now" })] })] }));
|
|
122
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Header(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
|
|
3
|
+
import { XIcon } from '../../../icons/XIcon.js';
|
|
4
|
+
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
5
|
+
import { IconButton } from '../../../ui/IconButton/index.js';
|
|
6
|
+
export function Header() {
|
|
7
|
+
return (_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "bg-bg-primary-alt relative flex items-center gap-xl px-xl py-md lg:justify-center lg:bg-transparent lg:p-0", children: [_jsx(IconButton, { size: "2xs", variant: "outline", colorScheme: "gray", className: "lg:hidden", onClick: () => api.setOpen(false), children: _jsx(ChevronLeftIcon, {}) }), _jsx(Dialog.Title, { className: "text-lg font-semibold", children: "Personal Verification" }), _jsx("button", { type: "button", className: "text-text-quinary absolute right-0 top-1/2 hidden -translate-y-1/2 lg:block", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "size-6" }) })] })) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Indicator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { noop } from 'lodash-es';
|
|
3
|
+
import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
|
|
4
|
+
import { Progress } from '../../../ui/Progress/index.js';
|
|
5
|
+
import { useKYCContext } from './KYCContext.js';
|
|
6
|
+
export function Indicator() {
|
|
7
|
+
const context = useKYCContext();
|
|
8
|
+
return (_jsxs("div", { className: "mt-xl grid grid-cols-[max-content_auto_auto] items-center px-xl lg:mt-md lg:px-0", children: [_jsxs("button", { className: "text-text-tertiary-600 flex items-center gap-sm text-sm font-semibold", children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "flex justify-center gap-2", children: [_jsx(Progress.Root, { className: "w-[5.625rem] shrink-0", value: context.step >= 2 ? 100 : 50, onValueChange: noop, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-[5.625rem] shrink-0", value: context.step >= 3 ? 50 : 0, onValueChange: noop, children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function KYC(): import("react/jsx-runtime").JSX.Element | undefined;
|