@opexa/portal-components 0.0.899 → 0.0.900
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/client/hooks/useGlobalStore.d.ts +2 -0
- package/dist/client/hooks/useGlobalStore.js +5 -0
- package/dist/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/ForgotPassword/Crazywin/ForgotPassword.module.css +42 -42
- package/dist/components/GameLaunch/GameLaunchTrigger.js +3 -1
- package/dist/components/Jackpots/Jackpots.module.css +288 -288
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/BasicInformation.js +1 -1
- package/dist/components/KYC/IdentityVerification.js +1 -1
- package/dist/components/KYC/KYC.lazy.js +1 -1
- 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.lazy.js +5 -8
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +1 -0
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +12 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/PortalProvider/PortalProvider.d.ts +1 -1
- package/dist/components/PortalProvider/PortalProvider.js +2 -2
- package/dist/components/PortalProvider/Providers.d.ts +3 -2
- package/dist/components/PortalProvider/Providers.js +12 -1
- package/dist/components/Quests/Crazywin/CWDailyCheckInQuest.d.ts +15 -0
- package/dist/components/Quests/Crazywin/CWDailyCheckInQuest.js +116 -0
- package/dist/components/Quests/Crazywin/CWJourneyQuest.d.ts +18 -0
- package/dist/components/Quests/Crazywin/CWJourneyQuest.js +137 -0
- package/dist/components/Quests/Crazywin/CWOnboardingQuest.d.ts +6 -0
- package/dist/components/Quests/Crazywin/CWOnboardingQuest.js +81 -0
- package/dist/components/Quests/Crazywin/CWWageringQuestNext.d.ts +23 -0
- package/dist/components/Quests/Crazywin/CWWageringQuestNext.js +53 -0
- package/dist/components/Quests/Crazywin/components/Countdown.d.ts +7 -0
- package/dist/components/Quests/Crazywin/components/Countdown.js +62 -0
- package/dist/components/Quests/Crazywin/components/DialogCheckin.d.ts +8 -0
- package/dist/components/Quests/Crazywin/components/DialogCheckin.js +12 -0
- package/dist/components/Quests/Crazywin/components/DialogJourney.d.ts +17 -0
- package/dist/components/Quests/Crazywin/components/DialogJourney.js +43 -0
- package/dist/components/Quests/Crazywin/components/DialogOnboarding.d.ts +13 -0
- package/dist/components/Quests/Crazywin/components/DialogOnboarding.js +19 -0
- package/dist/components/Quests/Crazywin/components/DialogWagering.d.ts +9 -0
- package/dist/components/Quests/Crazywin/components/DialogWagering.js +22 -0
- package/dist/components/Quests/Crazywin/components/GameProviders.d.ts +8 -0
- package/dist/components/Quests/Crazywin/components/GameProviders.js +143 -0
- package/dist/components/Quests/Crazywin/components/ObjectiveItem.d.ts +15 -0
- package/dist/components/Quests/Crazywin/components/ObjectiveItem.js +8 -0
- package/dist/components/Quests/Crazywin/components/QuestBadge.d.ts +8 -0
- package/dist/components/Quests/Crazywin/components/QuestBadge.js +21 -0
- package/dist/components/Quests/Crazywin/components/StageItemLocked.d.ts +4 -0
- package/dist/components/Quests/Crazywin/components/StageItemLocked.js +6 -0
- package/dist/components/Quests/Crazywin/components/StageItemUnlocked.d.ts +10 -0
- package/dist/components/Quests/Crazywin/components/StageItemUnlocked.js +26 -0
- package/dist/components/Quests/Crazywin/components/index.d.ts +10 -0
- package/dist/components/Quests/Crazywin/components/index.js +10 -0
- package/dist/components/Quests/JourneyQuest.d.ts +6 -0
- package/dist/components/Quests/JourneyQuest.js +5 -2
- package/dist/components/Quests/Quests.client.d.ts +3 -0
- package/dist/components/Quests/Quests.client.js +30 -7
- package/dist/components/Quests/RemainingTime.d.ts +3 -0
- package/dist/components/Quests/RemainingTime.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/icons/PlusIcon.d.ts +2 -0
- package/dist/icons/PlusIcon.js +4 -0
- package/dist/images/crazywin-game-providers/alize-mobile.webp +0 -0
- package/dist/images/crazywin-game-providers/bigtime-gaming.webp +0 -0
- package/dist/images/crazywin-game-providers/bti.png +0 -0
- package/dist/images/crazywin-game-providers/cq9.webp +0 -0
- package/dist/images/crazywin-game-providers/darwin.webp +0 -0
- package/dist/images/crazywin-game-providers/dg.webp +0 -0
- package/dist/images/crazywin-game-providers/digitain.png +0 -0
- package/dist/images/crazywin-game-providers/drbingo.webp +0 -0
- package/dist/images/crazywin-game-providers/evolution.webp +0 -0
- package/dist/images/crazywin-game-providers/fachai.webp +0 -0
- package/dist/images/crazywin-game-providers/habanero.webp +0 -0
- package/dist/images/crazywin-game-providers/hacksaw.png +0 -0
- package/dist/images/crazywin-game-providers/hollywoodtv.webp +0 -0
- package/dist/images/crazywin-game-providers/jdb.webp +0 -0
- package/dist/images/crazywin-game-providers/jili.webp +0 -0
- package/dist/images/crazywin-game-providers/kingmidas.webp +0 -0
- package/dist/images/crazywin-game-providers/netent.webp +0 -0
- package/dist/images/crazywin-game-providers/no-limit.webp +0 -0
- package/dist/images/crazywin-game-providers/pg.webp +0 -0
- package/dist/images/crazywin-game-providers/playtech.webp +0 -0
- package/dist/images/crazywin-game-providers/pragmaticplay.webp +0 -0
- package/dist/images/crazywin-game-providers/redtiger.webp +0 -0
- package/dist/images/crazywin-game-providers/rtg.webp +0 -0
- package/dist/images/crazywin-game-providers/rubyplay.webp +0 -0
- package/dist/images/crazywin-game-providers/sagaming.webp +0 -0
- package/dist/images/crazywin-game-providers/web/alize.webp +0 -0
- package/dist/images/crazywin-game-providers/web/bigtimegaming.png +0 -0
- package/dist/images/crazywin-game-providers/web/bti.png +0 -0
- package/dist/images/crazywin-game-providers/web/cq9.webp +0 -0
- package/dist/images/crazywin-game-providers/web/darwin.webp +0 -0
- package/dist/images/crazywin-game-providers/web/dg-bingo.png +0 -0
- package/dist/images/crazywin-game-providers/web/digitain.png +0 -0
- package/dist/images/crazywin-game-providers/web/drbingo-bingo.png +0 -0
- package/dist/images/crazywin-game-providers/web/evolution.webp +0 -0
- package/dist/images/crazywin-game-providers/web/fachai.webp +0 -0
- package/dist/images/crazywin-game-providers/web/habanero.webp +0 -0
- package/dist/images/crazywin-game-providers/web/hacksaw.webp +0 -0
- package/dist/images/crazywin-game-providers/web/hollywoodtv.png +0 -0
- package/dist/images/crazywin-game-providers/web/jdb.webp +0 -0
- package/dist/images/crazywin-game-providers/web/jili.webp +0 -0
- package/dist/images/crazywin-game-providers/web/jili_bingo.png +0 -0
- package/dist/images/crazywin-game-providers/web/kingmidas.webp +0 -0
- package/dist/images/crazywin-game-providers/web/netent.webp +0 -0
- package/dist/images/crazywin-game-providers/web/nolimitcity.png +0 -0
- package/dist/images/crazywin-game-providers/web/pg.webp +0 -0
- package/dist/images/crazywin-game-providers/web/playtech.webp +0 -0
- package/dist/images/crazywin-game-providers/web/pragmaticplay.webp +0 -0
- package/dist/images/crazywin-game-providers/web/redtiger.webp +0 -0
- package/dist/images/crazywin-game-providers/web/rtg.webp +0 -0
- package/dist/images/crazywin-game-providers/web/sagaming.png +0 -0
- package/dist/images/crazywin-game-providers/web/yellowbat-bingo.png +0 -0
- package/dist/images/crazywin-game-providers/yellowbat.webp +0 -0
- package/dist/images/phone-icon.svg +10 -10
- package/dist/schemas/forgotPasswordSchema.d.ts +8 -8
- package/dist/services/queries.js +3339 -3339
- package/dist/styles/theme.css +776 -776
- package/dist/types/crazywinTypes.d.ts +30 -0
- package/dist/types/crazywinTypes.js +19 -0
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +198 -198
- package/dist/ui/Menu/menu.recipe.d.ts +11 -11
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/utils/formatter.d.ts +2 -0
- package/dist/utils/formatter.js +9 -0
- package/dist/utils/getProviderData.d.ts +2 -0
- package/dist/utils/getProviderData.js +310 -0
- package/dist/utils/withMarketId.d.ts +1 -0
- package/dist/utils/withMarketId.js +5 -0
- package/package.json +177 -177
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Confirmed.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Failed.js +0 -11
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/Form.js +0 -126
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/GeneratingQrCode.js +0 -10
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDeposit.js +0 -12
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.d.ts +0 -17
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QRPHDepositContext.js +0 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.d.ts +0 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/QrCodeGenerated.js +0 -41
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.d.ts +0 -13
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__next/useQRPHDeposit.js +0 -91
- package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
- package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
- package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
- package/dist/components/Disclaimer/TermsOfUse.js +0 -13
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
- package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
- package/dist/components/FeatureFlag/index.d.ts +0 -1
- package/dist/components/FeatureFlag/index.js +0 -1
- package/dist/components/KYC/AutoOpen.d.ts +0 -1
- package/dist/components/KYC/AutoOpen.js +0 -40
- package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/KYC/CaptureIdDocument.js +0 -219
- package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/KYC/CaptureSelfie.js +0 -285
- package/dist/components/KYC/DisplayImage.d.ts +0 -5
- package/dist/components/KYC/DisplayImage.js +0 -8
- package/dist/components/KYC/FileUpload.d.ts +0 -10
- package/dist/components/KYC/FileUpload.js +0 -72
- package/dist/components/KYC/NoCameraError.d.ts +0 -7
- package/dist/components/KYC/NoCameraError.js +0 -6
- package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/KYC/backup/Header.d.ts +0 -1
- package/dist/components/KYC/backup/Header.js +0 -8
- package/dist/components/KYC/backup/Indicator.d.ts +0 -1
- package/dist/components/KYC/backup/Indicator.js +0 -9
- package/dist/components/KYC/backup/KYC.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.js +0 -14
- package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
- package/dist/components/KYC/backup/KYC.lazy.js +0 -26
- package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
- package/dist/components/KYC/backup/KYCContext.js +0 -2
- package/dist/components/KYC/backup/Step1.d.ts +0 -1
- package/dist/components/KYC/backup/Step1.js +0 -13
- package/dist/components/KYC/backup/Step2.d.ts +0 -1
- package/dist/components/KYC/backup/Step2.js +0 -13
- package/dist/components/KYC/backup/Step3.d.ts +0 -1
- package/dist/components/KYC/backup/Step3.js +0 -13
- package/dist/components/KYC/backup/Step4.d.ts +0 -1
- package/dist/components/KYC/backup/Step4.js +0 -7
- package/dist/components/KYC/backup/useKYC.d.ts +0 -10
- package/dist/components/KYC/backup/useKYC.js +0 -8
- package/dist/components/KYC/loadModels.d.ts +0 -1
- package/dist/components/KYC/loadModels.js +0 -9
- package/dist/components/KYC/utils.d.ts +0 -9
- package/dist/components/KYC/utils.js +0 -79
- package/dist/components/Messages/Message.d.ts +0 -1
- package/dist/components/Messages/Message.js +0 -35
- package/dist/components/Messages/MessageContext.d.ts +0 -6
- package/dist/components/Messages/MessageContext.js +0 -2
- package/dist/components/Messages/MessagePopup.d.ts +0 -1
- package/dist/components/Messages/MessagePopup.js +0 -20
- package/dist/components/Messages/MessageTrigger.d.ts +0 -8
- package/dist/components/Messages/MessageTrigger.js +0 -19
- package/dist/components/Quests/CountdownTimer.d.ts +0 -15
- package/dist/components/Quests/CountdownTimer.js +0 -33
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
- package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
- package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
- package/dist/components/SignUp/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
- package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
- package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
- package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
- package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -310
- package/dist/components/SignUp/SignUpForm.d.ts +0 -1
- package/dist/components/SignUp/SignUpForm.js +0 -284
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
- package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
- package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
- package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
- package/dist/components/shared/IdDocumentField.client.js +0 -204
- package/dist/components/shared/IdDocumentField.d.ts +0 -2
- package/dist/components/shared/IdDocumentField.js +0 -11
- package/dist/components/shared/SelfieField.client.d.ts +0 -20
- package/dist/components/shared/SelfieField.client.js +0 -327
- package/dist/components/shared/SelfieField.d.ts +0 -2
- package/dist/components/shared/SelfieField.js +0 -11
- package/dist/constants/BranchCode.d.ts +0 -4
- package/dist/constants/BranchCode.js +0 -42
- package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
- package/dist/handlers/postTransformIdFrontImage.js +0 -67
- package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
- package/dist/handlers/postTransformSelfieImage.js +0 -71
- package/dist/handlers.d.ts +0 -43
- package/dist/handlers.js +0 -297
- package/dist/icons/BellRingIcon.d.ts +0 -2
- package/dist/icons/BellRingIcon.js +0 -4
- package/dist/utils/dataUrlToBlob.d.ts +0 -1
- package/dist/utils/dataUrlToBlob.js +0 -11
- package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
- package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
- package/dist/utils/getGameName.d.ts +0 -1
- package/dist/utils/getGameName.js +0 -6
- package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
- package/dist/utils/isBetween3amAnd3pm.js +0 -5
- package/dist/utils/resizeImageSize.d.ts +0 -2
- package/dist/utils/resizeImageSize.js +0 -11
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Deposit } from '../../../../types';
|
|
2
|
-
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
|
-
export interface GenerateQRCodeInput {
|
|
4
|
-
amount: string;
|
|
5
|
-
promo?: string | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function useQRPHDeposit(): {
|
|
8
|
-
status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
|
|
9
|
-
deposit: Deposit | null;
|
|
10
|
-
generateQRCode: (input: GenerateQRCodeInput) => Promise<void>;
|
|
11
|
-
regenerateQRCode: () => Promise<void>;
|
|
12
|
-
reset: () => void;
|
|
13
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import invariant from 'tiny-invariant';
|
|
3
|
-
import { useShallow } from 'zustand/shallow';
|
|
4
|
-
import { useCreateQRPHDepositMutation } from '../../../../client/hooks/useCreateQRPHDepositMutation.js';
|
|
5
|
-
import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
|
|
6
|
-
import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
|
|
7
|
-
import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
|
|
8
|
-
export function useQRPHDeposit() {
|
|
9
|
-
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
10
|
-
kycVerificationStatus: ctx.kycVerificationStatus,
|
|
11
|
-
})));
|
|
12
|
-
const inputRef = useRef(null);
|
|
13
|
-
const [deposit, setDeposit] = useState(null);
|
|
14
|
-
const [status, setStatus] = useState('idle');
|
|
15
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
16
|
-
const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
|
|
17
|
-
const mutation = useCreateQRPHDepositMutation({
|
|
18
|
-
onMutate() {
|
|
19
|
-
setStatus('generating-qr-code');
|
|
20
|
-
},
|
|
21
|
-
onSuccess(data) {
|
|
22
|
-
invariant(data.qrCode);
|
|
23
|
-
setStatus('qr-code-generated');
|
|
24
|
-
setDeposit(data);
|
|
25
|
-
},
|
|
26
|
-
onError() {
|
|
27
|
-
setStatus('failed');
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const query = useDepositQuery(deposit?.id, {
|
|
31
|
-
enabled: !!deposit && status === 'qr-code-generated',
|
|
32
|
-
refetchInterval: (ctx) => {
|
|
33
|
-
if (ctx.state.data?.status === 'APPROVED' ||
|
|
34
|
-
ctx.state.data?.status === 'CONFIRMED' ||
|
|
35
|
-
ctx.state.data?.status === 'CANCELLED' ||
|
|
36
|
-
ctx.state.data?.status === 'REJECTED' ||
|
|
37
|
-
ctx.state.data?.status === 'FAILED') {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return 2000;
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (query.data?.status === 'APPROVED' ||
|
|
45
|
-
query.data?.status === 'CONFIRMED') {
|
|
46
|
-
setStatus('confirmed');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (query.data?.status === 'CANCELLED' ||
|
|
50
|
-
query.data?.status === 'REJECTED' ||
|
|
51
|
-
query.data?.status === 'FAILED') {
|
|
52
|
-
setStatus('failed');
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
}, [query.data?.status]);
|
|
56
|
-
const generateQRCode = async (input) => {
|
|
57
|
-
if (verificationStatus === 'PENDING' ||
|
|
58
|
-
verificationStatus === 'UNVERIFIED' ||
|
|
59
|
-
verificationStatus === 'REJECTED' ||
|
|
60
|
-
verificationStatus === 'CREATED') {
|
|
61
|
-
globalStore.kycVerificationStatus.setOpen(true);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
inputRef.current = input;
|
|
65
|
-
mutation.mutate({
|
|
66
|
-
amount: input.amount,
|
|
67
|
-
promo: input.promo ?? undefined,
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
const regenerateQRCode = async () => {
|
|
71
|
-
invariant(inputRef.current);
|
|
72
|
-
mutation.reset();
|
|
73
|
-
await new Promise((resolve) => setTimeout(resolve, 1));
|
|
74
|
-
mutation.mutate({
|
|
75
|
-
amount: inputRef.current.amount,
|
|
76
|
-
promo: inputRef.current.promo ?? undefined,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
const reset = () => {
|
|
80
|
-
setStatus('idle');
|
|
81
|
-
setDeposit(null);
|
|
82
|
-
inputRef.current = null;
|
|
83
|
-
};
|
|
84
|
-
return {
|
|
85
|
-
status,
|
|
86
|
-
deposit,
|
|
87
|
-
generateQRCode,
|
|
88
|
-
regenerateQRCode,
|
|
89
|
-
reset,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ImageProps } from 'next/image';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
export interface ResponsibleGamingProps {
|
|
4
|
-
responsibleGamingContent: string | ReactNode;
|
|
5
|
-
logo: ImageProps['src'];
|
|
6
|
-
open: boolean;
|
|
7
|
-
onCloseAction: () => void;
|
|
8
|
-
responsibleGamingLogo?: ImageProps['src'];
|
|
9
|
-
}
|
|
10
|
-
export declare function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }: ResponsibleGamingProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Image, {} from 'next/image';
|
|
4
|
-
import pagcorLogo from '../../images/pagcor.png';
|
|
5
|
-
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
6
|
-
import { Button } from '../../ui/Button/index.js';
|
|
7
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
8
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
9
|
-
export function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }) {
|
|
10
|
-
return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: "Responsible Gaming" }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: responsibleGamingContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
11
|
-
onCloseAction();
|
|
12
|
-
}, children: "I Agree" }) })] }) })] }) }));
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type ImageProps } from 'next/image';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
export interface TermsOfUseProps {
|
|
4
|
-
logo: ImageProps['src'];
|
|
5
|
-
open: boolean;
|
|
6
|
-
onCloseAction: () => void;
|
|
7
|
-
termsOfUseContent: string | ReactNode;
|
|
8
|
-
siteName: string;
|
|
9
|
-
responsibleGamingLogo?: ImageProps['src'];
|
|
10
|
-
}
|
|
11
|
-
export declare function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }: TermsOfUseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Image, {} from 'next/image';
|
|
4
|
-
import pagcorLogo from '../../images/pagcor.png';
|
|
5
|
-
import responsibleGamingLogo from '../../images/responsible-gaming.png';
|
|
6
|
-
import { Button } from '../../ui/Button/index.js';
|
|
7
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
8
|
-
import { Portal } from '../../ui/Portal/index.js';
|
|
9
|
-
export function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }) {
|
|
10
|
-
return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsxs(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: termsOfUseContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
|
|
11
|
-
onCloseAction();
|
|
12
|
-
}, children: "I Agree" }) })] }) })] }) }));
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function FeatureFlag(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter, useSearchParams } from 'next/navigation';
|
|
4
|
-
import { useEffect } from 'react';
|
|
5
|
-
import { FEATURE_FLAG_KEY, useFeatureFlag, } from '../../client/hooks/useFeatureFlag.js';
|
|
6
|
-
export function FeatureFlag() {
|
|
7
|
-
const { featureFlagEnabled, setFeatureFlagEnabled } = useFeatureFlag();
|
|
8
|
-
const searchParams = useSearchParams();
|
|
9
|
-
const router = useRouter();
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const futureFlagParam = searchParams.get('future');
|
|
12
|
-
if (futureFlagParam !== null) {
|
|
13
|
-
const isEnabled = futureFlagParam === 'true';
|
|
14
|
-
setFeatureFlagEnabled(isEnabled);
|
|
15
|
-
localStorage.setItem(FEATURE_FLAG_KEY, isEnabled.toString());
|
|
16
|
-
}
|
|
17
|
-
}, [searchParams, setFeatureFlagEnabled]);
|
|
18
|
-
function disableFeatureFlag() {
|
|
19
|
-
setFeatureFlagEnabled(false);
|
|
20
|
-
localStorage.removeItem(FEATURE_FLAG_KEY);
|
|
21
|
-
const params = new URLSearchParams(searchParams.toString());
|
|
22
|
-
params.delete('future');
|
|
23
|
-
router.replace(`?${params.toString()}`, { scroll: false });
|
|
24
|
-
}
|
|
25
|
-
if (!featureFlagEnabled) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return (_jsx("div", { className: "fixed bottom-3 flex w-full flex-col items-center justify-center", children: _jsxs("div", { className: "bg-black/70 p-1", children: ["Experimental features are enabled.", ' ', _jsxs("button", { onClick: () => disableFeatureFlag(), className: "cursor-pointer underline", children: [' ', "Disable"] })] }) }));
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './FeatureFlag';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './FeatureFlag.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AutoOpen(): null;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useShallow } from 'zustand/shallow';
|
|
3
|
-
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
4
|
-
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
5
|
-
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
6
|
-
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
7
|
-
import { KYC_PROMPT_LOCALSTORAGE_KEY } from '../../constants/index.js';
|
|
8
|
-
export function AutoOpen() {
|
|
9
|
-
const kycStore = useGlobalStore(useShallow((ctx) => ctx.kyc));
|
|
10
|
-
const { data: session } = useSessionQuery();
|
|
11
|
-
const { data: account } = useAccountQuery();
|
|
12
|
-
const { data: verification } = useMemberVerificationQuery();
|
|
13
|
-
const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
|
|
14
|
-
const isUploadCompleted = verification &&
|
|
15
|
-
verification.idFrontImage !== null &&
|
|
16
|
-
verification.selfieImage !== null;
|
|
17
|
-
const isRejected = Boolean(verification?.status === 'REJECTED');
|
|
18
|
-
const step = !isBasicInfoCompleted
|
|
19
|
-
? 1
|
|
20
|
-
: isRejected
|
|
21
|
-
? 2
|
|
22
|
-
: isUploadCompleted
|
|
23
|
-
? 3
|
|
24
|
-
: 2;
|
|
25
|
-
const shouldOpen = !isBasicInfoCompleted || !isUploadCompleted || isRejected;
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (session?.status == 'authenticated' &&
|
|
28
|
-
shouldOpen &&
|
|
29
|
-
localStorage.getItem(KYC_PROMPT_LOCALSTORAGE_KEY) === null) {
|
|
30
|
-
kycStore.setKycReminder(true);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
}, [kycStore, session?.status, shouldOpen]);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (step) {
|
|
36
|
-
kycStore.setStep(step);
|
|
37
|
-
}
|
|
38
|
-
}, [kycStore, step]);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CaptureIdDocument(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { useUploadImageFileMutation } from '../../client/hooks/useUploadImageFileMutation.js';
|
|
6
|
-
import { ArrowLeftIcon } from '../../icons/ArrowLeftIcon.js';
|
|
7
|
-
import { Camera01Icon } from '../../icons/Camera01Icon.js';
|
|
8
|
-
import { CheckCircleIcon } from '../../icons/CheckCircleIcon.js';
|
|
9
|
-
import { XIcon } from '../../icons/XIcon.js';
|
|
10
|
-
import { Button } from '../../ui/Button/index.js';
|
|
11
|
-
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
|
-
import { useKYCContext } from './KYCContext.js';
|
|
13
|
-
import NoCameraError from './NoCameraError.js';
|
|
14
|
-
import { cameraErrorDescriptions, dataURLtoBlob, resizeFile, showPermissionInstructions, } from './utils.js';
|
|
15
|
-
export function CaptureIdDocument() {
|
|
16
|
-
const kyc = useKYCContext();
|
|
17
|
-
const { mutate, isPending } = useUploadImageFileMutation();
|
|
18
|
-
const [videoStream, setVideoStream] = useState(null);
|
|
19
|
-
const [cameraError, setCameraError] = useState(null);
|
|
20
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
21
|
-
const [selectedImage, setSelectedImage] = useState(null);
|
|
22
|
-
const [captureInProgress, setCaptureInProgress] = useState(false);
|
|
23
|
-
const [proccessImageCanvas, setProccessImageCanvas] = useState(null);
|
|
24
|
-
const videoElement = useRef(null);
|
|
25
|
-
const containerRef = useRef(null);
|
|
26
|
-
function stopCamera() {
|
|
27
|
-
if (videoStream) {
|
|
28
|
-
videoStream.getTracks().forEach((track) => track.stop());
|
|
29
|
-
setVideoStream(null);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
return () => {
|
|
34
|
-
stopCamera();
|
|
35
|
-
};
|
|
36
|
-
}, [videoStream]);
|
|
37
|
-
async function startCamera() {
|
|
38
|
-
try {
|
|
39
|
-
setIsLoading(true);
|
|
40
|
-
setCameraError(null);
|
|
41
|
-
setCaptureInProgress(true);
|
|
42
|
-
console.log('Starting camera...');
|
|
43
|
-
const stream = await navigator.mediaDevices.getUserMedia({
|
|
44
|
-
video: {
|
|
45
|
-
facingMode: 'environment',
|
|
46
|
-
aspectRatio: 16 / 9,
|
|
47
|
-
width: { ideal: 1920, max: 1920 },
|
|
48
|
-
height: { ideal: 1080, max: 1080 },
|
|
49
|
-
frameRate: {
|
|
50
|
-
ideal: 30,
|
|
51
|
-
max: 60,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
audio: false,
|
|
55
|
-
});
|
|
56
|
-
// Set the stream directly to the video element
|
|
57
|
-
if (videoElement.current) {
|
|
58
|
-
videoElement.current.srcObject = stream;
|
|
59
|
-
videoElement.current.onloadedmetadata = () => {
|
|
60
|
-
console.log('Video metadata loaded, starting playback...');
|
|
61
|
-
videoElement.current
|
|
62
|
-
?.play()
|
|
63
|
-
.then(() => {
|
|
64
|
-
setVideoStream(stream);
|
|
65
|
-
setIsLoading(false);
|
|
66
|
-
})
|
|
67
|
-
.catch(() => {
|
|
68
|
-
setCameraError('Failed to start camera stream. Please try again.');
|
|
69
|
-
setIsLoading(false);
|
|
70
|
-
// Stop the stream if playback fails
|
|
71
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
videoElement.current.onerror = (err) => {
|
|
75
|
-
console.error('Video element error:', err);
|
|
76
|
-
setCameraError('Video playback error. Please try again.');
|
|
77
|
-
setIsLoading(false);
|
|
78
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
console.error('Video element not available');
|
|
83
|
-
setCameraError('Camera initialization failed. Please try again.');
|
|
84
|
-
setCaptureInProgress(false);
|
|
85
|
-
setIsLoading(false);
|
|
86
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
setIsLoading(false);
|
|
91
|
-
if (error instanceof DOMException) {
|
|
92
|
-
console.error('Error accessing camera:', error.message);
|
|
93
|
-
setCameraError(error.name);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.error('Unknown error accessing camera:', error);
|
|
97
|
-
setCameraError('An unknown error occurred. Please check permissions and try again.');
|
|
98
|
-
}
|
|
99
|
-
setCaptureInProgress(false);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function captureAndProcessImage() {
|
|
103
|
-
if (!videoElement.current || !videoStream) {
|
|
104
|
-
console.error('Video element or stream not available for capture');
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const canvas = document.createElement('canvas');
|
|
109
|
-
const parentDiv = document.getElementById('parent');
|
|
110
|
-
canvas.width = parentDiv?.clientWidth || videoElement.current.width;
|
|
111
|
-
canvas.height = parentDiv?.clientHeight || videoElement.current.height;
|
|
112
|
-
const ctx = canvas.getContext('2d');
|
|
113
|
-
if (!ctx) {
|
|
114
|
-
console.error('Could not get 2D context for canvas');
|
|
115
|
-
setCameraError('Failed to process image. Please try again.');
|
|
116
|
-
setCaptureInProgress(false);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
ctx.drawImage(videoElement.current, 0, 0, canvas.width, canvas.height);
|
|
120
|
-
const imageSrc = canvas.toDataURL('image/png', 1.0);
|
|
121
|
-
setSelectedImage({ src: imageSrc });
|
|
122
|
-
setCaptureInProgress(false);
|
|
123
|
-
stopCamera();
|
|
124
|
-
const newImg = document.createElement('img');
|
|
125
|
-
newImg.src = imageSrc;
|
|
126
|
-
//@ts-expect-error jscanify is not typed
|
|
127
|
-
const scanner = new jscanify();
|
|
128
|
-
newImg.onload = () => {
|
|
129
|
-
try {
|
|
130
|
-
if (containerRef.current) {
|
|
131
|
-
// containerRef.current.innerHTML = '';
|
|
132
|
-
const paperWidth = parentDiv?.clientWidth || videoElement.current?.videoWidth;
|
|
133
|
-
const paperHeight = parentDiv?.clientHeight || videoElement.current?.videoHeight;
|
|
134
|
-
//@ts-expect-error jscanify is not typed
|
|
135
|
-
const contour = scanner.findPaperContour(cv.imread(newImg));
|
|
136
|
-
const cornerPoints = scanner.getCornerPoints(contour);
|
|
137
|
-
const resultCanvas = scanner.extractPaper(newImg, paperWidth, paperHeight, cornerPoints);
|
|
138
|
-
newImg.className =
|
|
139
|
-
'absolute inset-0 m-auto w-full h-auto md:max-h-[333px] md:max-w-[643px] aspect-video rounded-lg object-contain';
|
|
140
|
-
setProccessImageCanvas(resultCanvas);
|
|
141
|
-
containerRef.current.appendChild(resultCanvas);
|
|
142
|
-
setCaptureInProgress(false);
|
|
143
|
-
setSelectedImage({ src: resultCanvas.toDataURL('image/png') });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
console.error('Error processing image:', error);
|
|
148
|
-
setCameraError('Failed to process image. Please try again.');
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
newImg.onerror = () => {
|
|
152
|
-
console.error('Error loading image');
|
|
153
|
-
setCameraError('NoIdDetectedError');
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
console.error('Error capturing image:', error);
|
|
158
|
-
setCameraError('NoIdDetectedError');
|
|
159
|
-
setCaptureInProgress(false);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
async function uploadPhoto() {
|
|
163
|
-
if (!proccessImageCanvas) {
|
|
164
|
-
console.error('Failed to process the image. Please try again.');
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
const blob = proccessImageCanvas.toDataURL('image/png', 1.0);
|
|
168
|
-
const processedBlob = dataURLtoBlob(blob);
|
|
169
|
-
const img = new File([processedBlob], 'frontImage', { type: 'image/jpeg' });
|
|
170
|
-
const resizedImage = (await resizeFile(img));
|
|
171
|
-
if (resizedImage) {
|
|
172
|
-
await mutate({
|
|
173
|
-
file: resizedImage,
|
|
174
|
-
}, {
|
|
175
|
-
onSuccess: (data) => {
|
|
176
|
-
kyc.setFrontImageId(data);
|
|
177
|
-
kyc.setCapturing(null);
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function retakePhoto() {
|
|
183
|
-
setSelectedImage(null);
|
|
184
|
-
setCaptureInProgress(true);
|
|
185
|
-
setCameraError(null);
|
|
186
|
-
if (containerRef.current) {
|
|
187
|
-
const canvas = containerRef.current.querySelector('canvas');
|
|
188
|
-
if (canvas) {
|
|
189
|
-
canvas.width = canvas.width;
|
|
190
|
-
}
|
|
191
|
-
containerRef.current.innerHTML = '';
|
|
192
|
-
}
|
|
193
|
-
if (videoElement.current) {
|
|
194
|
-
videoElement.current.play();
|
|
195
|
-
}
|
|
196
|
-
startCamera();
|
|
197
|
-
}
|
|
198
|
-
function checkCameraPermission() {
|
|
199
|
-
const constraints = { video: true };
|
|
200
|
-
navigator.mediaDevices
|
|
201
|
-
.getUserMedia(constraints)
|
|
202
|
-
.then(() => {
|
|
203
|
-
setCameraError(null);
|
|
204
|
-
startCamera();
|
|
205
|
-
})
|
|
206
|
-
.catch(() => {
|
|
207
|
-
showPermissionInstructions();
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: "w-full p-4 lg:w-[640px] lg:px-12 lg:py-4xl", children: [_jsxs("button", { type: "button", className: "flex items-center gap-lg lg:absolute lg:right-5 lg:top-5 lg:p-md", onClick: () => {
|
|
211
|
-
stopCamera();
|
|
212
|
-
kyc.setCapturing(null);
|
|
213
|
-
}, children: [_jsx(XIcon, { className: "text-text-senary-300 hidden size-5 lg:block" }), _jsx(ArrowLeftIcon, { className: "text-text-senary-300 size-5 lg:hidden" }), _jsx("span", { className: "text-lg font-semibold lg:hidden", children: "Back" })] }), _jsx(Dialog.Title, { className: "mt-6 text-center text-lg font-semibold lg:mt-0", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "lg:max-w-auto text-text-tertiary-600 mx-auto mt-sm max-w-[19rem] text-center text-sm lg:max-w-full", children: ["Make sure your ID is clearly visible, well-lit, and not blurry.", _jsx("br", { className: "hidden lg:block" }), " Avoid glare or reflections, and ensure all corners are within the frame."] }), _jsx("div", { id: "parent", className: "border-border-disabled mt-6 aspect-video rounded-xl border bg-black lg:mt-8", children: [
|
|
214
|
-
'NotAllowedError',
|
|
215
|
-
'NotReadableError',
|
|
216
|
-
'NotFoundError',
|
|
217
|
-
'NoIdDetectedError',
|
|
218
|
-
].includes(cameraError) ? (_jsx(NoCameraError, { onRetry: checkCameraPermission, title: "Camera Access Required", description: cameraErrorDescriptions[cameraError] })) : captureInProgress ? (_jsxs("div", { className: "relative flex h-fit w-full flex-col items-center justify-center", children: [_jsx("video", { ref: videoElement, autoPlay: true, muted: true, playsInline: true, className: "relative h-[50vh] w-full rounded-lg object-cover md:aspect-video md:max-h-[333px]", width: "100%", height: "100%" }), _jsxs("div", { className: "pointer-events-none absolute inset-0 z-50", children: [_jsx("div", { className: twMerge('absolute inset-0 w-full bg-black/60 backdrop-blur-sm [clip-path:polygon(0%_0%,0%_100%,calc(50%-158px)_100%,calc(50%-158px)_calc(50%-100px),calc(50%+158px)_calc(50%-100px),calc(50%+158px)_calc(50%+100px),calc(50%-158px)_calc(50%+100px),calc(50%-158px)_100%,100%_100%,100%_0%)] md:[clip-path:polygon(0%_0%,0%_100%,calc(50%-225px)_100%,calc(50%-225px)_calc(50%-142px),calc(50%+225px)_calc(50%-142px),calc(50%+225px)_calc(50%+142px),calc(50%-225px)_calc(50%+142px),calc(50%-225px)_100%,100%_100%,100%_0%)]') }), _jsx("div", { className: "absolute inset-0 z-[60] mx-auto flex items-center justify-center", children: _jsx("div", { className: "relative aspect-[1011/638] h-[200px] md:h-[295px] md:w-[450px]", children: _jsx("div", { className: "h-full w-full rounded-lg border-4 border-dashed border-[#B54708]" }) }) })] })] })) : (_jsx("div", { ref: containerRef, className: "relative grid h-full w-full place-items-center rounded-lg object-contain md:max-h-[333px]" })) }), captureInProgress ? (_jsxs(Button, { className: "disabled:bg-bg-disabled disabled:text-text-disabled mx-auto mt-6 px-xl disabled:opacity-100 lg:mt-8 lg:w-fit", onClick: captureAndProcessImage, children: ["Capture Image", _jsx(Camera01Icon, { className: "size-5" })] })) : selectedImage && selectedImage.src ? (_jsxs("div", { className: "mt-4 flex flex-col items-center justify-center gap-2 md:flex-row", children: [_jsxs(Button, { className: "lg:w-fit", type: "button", onClick: retakePhoto, children: ["Retake Photo ", _jsx(Camera01Icon, { className: "ml-1" })] }), _jsxs(Button, { className: "lg:w-fit", type: "button", onClick: uploadPhoto, disabled: isPending, children: ["Use Photo ", _jsx(CheckCircleIcon, { className: "ml-1" })] })] })) : (_jsxs(Button, { className: twMerge('disabled:bg-bg-disabled disabled:text-text-disabled mx-auto mt-6 px-xl disabled:opacity-100 lg:mt-8 lg:w-fit', cameraError && 'hidden'), onClick: startCamera, disabled: isLoading || !!videoStream, children: [isLoading ? 'Starting Camera...' : 'Start Camera', _jsx(Camera01Icon, { className: "size-5" })] }))] }) }));
|
|
219
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CaptureSelfie(): import("react/jsx-runtime").JSX.Element;
|