@opexa/portal-components 0.0.630 → 0.0.632
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/useAccountQuery.js +9 -0
- package/dist/client/hooks/useGlobalStore.d.ts +1 -0
- package/dist/client/hooks/useGlobalStore.js +13 -0
- package/dist/client/services/getSingleUseToken.d.ts +3 -0
- package/dist/client/services/getSingleUseToken.js +5 -0
- package/dist/client/services/signIn.js +8 -0
- package/dist/client/utils/biometric.d.ts +40 -0
- package/dist/client/utils/biometric.js +90 -0
- package/dist/components/Account/Account.lazy.js +15 -2
- package/dist/components/Account/AccountTrigger.js +1 -1
- package/dist/components/Banner/Banner.client.d.ts +12 -0
- package/dist/components/Banner/Banner.client.js +49 -0
- 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/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/Jackpots/Jackpots.module.css +184 -184
- 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/KYCReminder.lazy.js +3 -1
- 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/AndroidRoutingHandler.d.ts +1 -0
- package/dist/components/PortalProvider/AndroidRoutingHandler.js +22 -0
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/components/PortalProvider/PortalProvider.js +2 -1
- package/dist/components/PortalProvider/PushNotifications.d.ts +3 -0
- package/dist/components/PortalProvider/PushNotifications.js +55 -0
- package/dist/components/RegisterBiometrics/RegisterBiometrics.d.ts +1 -0
- package/dist/components/RegisterBiometrics/RegisterBiometrics.js +75 -0
- package/dist/components/RegisterBiometrics/index.d.ts +1 -0
- package/dist/components/RegisterBiometrics/index.js +1 -0
- package/dist/components/SignIn/MobileNumberSignIn.js +6 -0
- package/dist/components/SignIn/NameAndPasswordSignIn.js +10 -0
- package/dist/components/SignIn/SignInTrigger.js +69 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/handlers/index.d.ts +1 -1
- package/dist/handlers/index.js +5 -1
- package/dist/handlers/postToken.d.ts +16 -0
- package/dist/handlers/postToken.js +27 -0
- package/dist/services/httpRequest.js +1 -0
- package/dist/services/queries.js +2758 -2758
- package/dist/styles/theme.css +762 -762
- package/dist/types/index.d.ts +8 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +307 -307
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +40 -40
- package/dist/ui/QrCode/qrCode.recipe.d.ts +8 -8
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- 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/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +168 -163
- 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
|
@@ -36,9 +36,18 @@ export const useAccountQuery = (config) => {
|
|
|
36
36
|
res?.verificationStatus === 'VERIFIED' &&
|
|
37
37
|
session.status === 'authenticated' &&
|
|
38
38
|
typeof window !== 'undefined') {
|
|
39
|
+
await getSession();
|
|
39
40
|
globalStore.kycReminder.setOpen(false);
|
|
40
41
|
await refreshSession();
|
|
42
|
+
//check if not verified and locked
|
|
43
|
+
}
|
|
44
|
+
else if (res.status === 'VERIFICATION_LOCKED' &&
|
|
45
|
+
res?.verificationStatus !== 'VERIFIED' &&
|
|
46
|
+
session.status === 'authenticated' &&
|
|
47
|
+
typeof window !== 'undefined') {
|
|
41
48
|
await getSession();
|
|
49
|
+
globalStore.kycReminder.setOpen(true);
|
|
50
|
+
await refreshSession();
|
|
42
51
|
}
|
|
43
52
|
return res;
|
|
44
53
|
},
|
|
@@ -81,6 +81,7 @@ export interface GlobalStore {
|
|
|
81
81
|
kyc: PopupStore;
|
|
82
82
|
kycReminder: PopupStore;
|
|
83
83
|
spotBonus: PopupStore;
|
|
84
|
+
registerBiometrics: PopupStore;
|
|
84
85
|
termsAndConditions: TermsAndConditionsStore;
|
|
85
86
|
termsOfUse: TermsOfUseStore;
|
|
86
87
|
responsibleGaming: ResponsibleGamingStore;
|
|
@@ -273,6 +273,19 @@ export const useGlobalStore = create()(devtools(subscribeWithSelector((set) => (
|
|
|
273
273
|
},
|
|
274
274
|
'~touched': false,
|
|
275
275
|
},
|
|
276
|
+
registerBiometrics: {
|
|
277
|
+
open: false,
|
|
278
|
+
setOpen(open) {
|
|
279
|
+
set((prev) => ({
|
|
280
|
+
registerBiometrics: {
|
|
281
|
+
...prev.registerBiometrics,
|
|
282
|
+
open,
|
|
283
|
+
'~touched': true,
|
|
284
|
+
},
|
|
285
|
+
}));
|
|
286
|
+
},
|
|
287
|
+
'~touched': false,
|
|
288
|
+
},
|
|
276
289
|
forgotPassword: {
|
|
277
290
|
open: false,
|
|
278
291
|
setOpen(open) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Capacitor } from '@capacitor/core';
|
|
1
2
|
import { httpRequest, } from '../../services/httpRequest.js';
|
|
3
|
+
const platform = Capacitor.getPlatform();
|
|
2
4
|
export async function signIn(input, options) {
|
|
3
5
|
const res = await httpRequest.json('/api/sessions', {
|
|
4
6
|
...options,
|
|
@@ -7,6 +9,12 @@ export async function signIn(input, options) {
|
|
|
7
9
|
});
|
|
8
10
|
if (!res.ok) {
|
|
9
11
|
const error = new Error();
|
|
12
|
+
if (platform === 'ios' || platform === 'android') {
|
|
13
|
+
error.name = 'Biometrics Failed';
|
|
14
|
+
error.message =
|
|
15
|
+
'Biometric authentication failed. Please try again or use your mobile number to sign in.';
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
10
18
|
error.name = 'SignInError';
|
|
11
19
|
error.message = 'Failed to sign in';
|
|
12
20
|
throw error;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AvailableResult, BiometricOptions, Credentials, SetCredentialOptions } from 'capacitor-native-biometric';
|
|
2
|
+
export declare const BIOMETRIC_STORAGE_KEY: string;
|
|
3
|
+
export declare enum BiometryType {
|
|
4
|
+
NONE = 0,
|
|
5
|
+
TOUCH_ID = 1,
|
|
6
|
+
FACE_ID = 2,
|
|
7
|
+
FINGERPRINT = 3,
|
|
8
|
+
FACE_AUTHENTICATION = 4,
|
|
9
|
+
IRIS_AUTHENTICATION = 5,
|
|
10
|
+
MULTIPLE = 6
|
|
11
|
+
}
|
|
12
|
+
export declare enum BiometricAuthError {
|
|
13
|
+
UNKNOWN_ERROR = 0,
|
|
14
|
+
BIOMETRICS_UNAVAILABLE = 1,
|
|
15
|
+
USER_LOCKOUT = 2,
|
|
16
|
+
BIOMETRICS_NOT_ENROLLED = 3,
|
|
17
|
+
USER_TEMPORARY_LOCKOUT = 4,
|
|
18
|
+
AUTHENTICATION_FAILED = 10,
|
|
19
|
+
APP_CANCEL = 11,
|
|
20
|
+
INVALID_CONTEXT = 12,
|
|
21
|
+
NOT_INTERACTIVE = 13,
|
|
22
|
+
PASSCODE_NOT_SET = 14,
|
|
23
|
+
SYSTEM_CANCEL = 15,
|
|
24
|
+
USER_CANCEL = 16,
|
|
25
|
+
USER_FALLBACK = 17
|
|
26
|
+
}
|
|
27
|
+
export interface BiometricInfo extends AvailableResult {
|
|
28
|
+
}
|
|
29
|
+
export declare function getBiometricInfo(): Promise<BiometricInfo>;
|
|
30
|
+
export interface PerformBiometricVerificationOptions extends Omit<BiometricOptions, 'useFallback' | 'maxAttempts'> {
|
|
31
|
+
}
|
|
32
|
+
export declare function performBiometricVerification(opts?: PerformBiometricVerificationOptions): Promise<boolean>;
|
|
33
|
+
export interface SaveBiometricCredentialsInput extends Omit<SetCredentialOptions, 'server'> {
|
|
34
|
+
}
|
|
35
|
+
export declare function saveBiometricCredentials(input: SaveBiometricCredentialsInput): Promise<boolean>;
|
|
36
|
+
export declare function deleteBiometricCredentials(): Promise<void>;
|
|
37
|
+
export interface BiometricCredentials extends Credentials {
|
|
38
|
+
}
|
|
39
|
+
export declare function getBiometricCredentials(): Promise<BiometricCredentials | null>;
|
|
40
|
+
export declare function hasSavedBiometry(): boolean;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { addDays, isAfter } from 'date-fns';
|
|
2
|
+
const SERVER = `com.${process.env.NEXT_PUBLIC_PLATFORM_CODE}.app`;
|
|
3
|
+
export const BIOMETRIC_STORAGE_KEY = `${process.env.NEXT_PUBLIC_PLATFORM_CODE}__BiometricEnabled`;
|
|
4
|
+
export var BiometryType;
|
|
5
|
+
(function (BiometryType) {
|
|
6
|
+
BiometryType[BiometryType["NONE"] = 0] = "NONE";
|
|
7
|
+
BiometryType[BiometryType["TOUCH_ID"] = 1] = "TOUCH_ID";
|
|
8
|
+
BiometryType[BiometryType["FACE_ID"] = 2] = "FACE_ID";
|
|
9
|
+
BiometryType[BiometryType["FINGERPRINT"] = 3] = "FINGERPRINT";
|
|
10
|
+
BiometryType[BiometryType["FACE_AUTHENTICATION"] = 4] = "FACE_AUTHENTICATION";
|
|
11
|
+
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
|
|
12
|
+
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
|
|
13
|
+
})(BiometryType || (BiometryType = {}));
|
|
14
|
+
export var BiometricAuthError;
|
|
15
|
+
(function (BiometricAuthError) {
|
|
16
|
+
BiometricAuthError[BiometricAuthError["UNKNOWN_ERROR"] = 0] = "UNKNOWN_ERROR";
|
|
17
|
+
BiometricAuthError[BiometricAuthError["BIOMETRICS_UNAVAILABLE"] = 1] = "BIOMETRICS_UNAVAILABLE";
|
|
18
|
+
BiometricAuthError[BiometricAuthError["USER_LOCKOUT"] = 2] = "USER_LOCKOUT";
|
|
19
|
+
BiometricAuthError[BiometricAuthError["BIOMETRICS_NOT_ENROLLED"] = 3] = "BIOMETRICS_NOT_ENROLLED";
|
|
20
|
+
BiometricAuthError[BiometricAuthError["USER_TEMPORARY_LOCKOUT"] = 4] = "USER_TEMPORARY_LOCKOUT";
|
|
21
|
+
BiometricAuthError[BiometricAuthError["AUTHENTICATION_FAILED"] = 10] = "AUTHENTICATION_FAILED";
|
|
22
|
+
BiometricAuthError[BiometricAuthError["APP_CANCEL"] = 11] = "APP_CANCEL";
|
|
23
|
+
BiometricAuthError[BiometricAuthError["INVALID_CONTEXT"] = 12] = "INVALID_CONTEXT";
|
|
24
|
+
BiometricAuthError[BiometricAuthError["NOT_INTERACTIVE"] = 13] = "NOT_INTERACTIVE";
|
|
25
|
+
BiometricAuthError[BiometricAuthError["PASSCODE_NOT_SET"] = 14] = "PASSCODE_NOT_SET";
|
|
26
|
+
BiometricAuthError[BiometricAuthError["SYSTEM_CANCEL"] = 15] = "SYSTEM_CANCEL";
|
|
27
|
+
BiometricAuthError[BiometricAuthError["USER_CANCEL"] = 16] = "USER_CANCEL";
|
|
28
|
+
BiometricAuthError[BiometricAuthError["USER_FALLBACK"] = 17] = "USER_FALLBACK";
|
|
29
|
+
})(BiometricAuthError || (BiometricAuthError = {}));
|
|
30
|
+
export async function getBiometricInfo() {
|
|
31
|
+
const { NativeBiometric } = await import('capacitor-native-biometric');
|
|
32
|
+
const res = await NativeBiometric.isAvailable({
|
|
33
|
+
useFallback: true,
|
|
34
|
+
});
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
export async function performBiometricVerification(opts) {
|
|
38
|
+
const { NativeBiometric } = await import('capacitor-native-biometric');
|
|
39
|
+
return await NativeBiometric.verifyIdentity({
|
|
40
|
+
useFallback: false,
|
|
41
|
+
maxAttempts: 5,
|
|
42
|
+
...opts,
|
|
43
|
+
})
|
|
44
|
+
.then(() => true)
|
|
45
|
+
.catch(() => false);
|
|
46
|
+
}
|
|
47
|
+
export async function saveBiometricCredentials(input) {
|
|
48
|
+
const { NativeBiometric } = await import('capacitor-native-biometric');
|
|
49
|
+
await deleteBiometricCredentials();
|
|
50
|
+
return await NativeBiometric.setCredentials({
|
|
51
|
+
username: input.username,
|
|
52
|
+
password: input.password,
|
|
53
|
+
server: SERVER,
|
|
54
|
+
})
|
|
55
|
+
.then(() => {
|
|
56
|
+
localStorage.setItem(BIOMETRIC_STORAGE_KEY, addDays(new Date(), 29).toISOString());
|
|
57
|
+
return true;
|
|
58
|
+
})
|
|
59
|
+
.catch(() => false);
|
|
60
|
+
}
|
|
61
|
+
export async function deleteBiometricCredentials() {
|
|
62
|
+
const { NativeBiometric } = await import('capacitor-native-biometric');
|
|
63
|
+
await NativeBiometric.deleteCredentials({
|
|
64
|
+
server: SERVER,
|
|
65
|
+
});
|
|
66
|
+
localStorage.removeItem(BIOMETRIC_STORAGE_KEY);
|
|
67
|
+
}
|
|
68
|
+
export async function getBiometricCredentials() {
|
|
69
|
+
const { NativeBiometric } = await import('capacitor-native-biometric');
|
|
70
|
+
try {
|
|
71
|
+
return await NativeBiometric.getCredentials({
|
|
72
|
+
server: SERVER,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export function hasSavedBiometry() {
|
|
80
|
+
const v = localStorage.getItem(BIOMETRIC_STORAGE_KEY);
|
|
81
|
+
if (v == null)
|
|
82
|
+
return false;
|
|
83
|
+
const exp = new Date(v);
|
|
84
|
+
const now = new Date();
|
|
85
|
+
if (isAfter(exp, now)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
localStorage.removeItem(BIOMETRIC_STORAGE_KEY);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
@@ -14,6 +14,7 @@ import { useMayaAuth } from '../../client/hooks/useMayaAuth.js';
|
|
|
14
14
|
import { useProfileCompletionQuery } from '../../client/hooks/useProfileCompletionQuery.js';
|
|
15
15
|
import { useSignOutMutation } from '../../client/hooks/useSignOutMutation.js';
|
|
16
16
|
import { useUnreadMessagesCountQuery } from '../../client/hooks/useUnreadMessagesCountQuery.js';
|
|
17
|
+
import { BIOMETRIC_STORAGE_KEY } from '../../client/utils/biometric.js';
|
|
17
18
|
import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
|
|
18
19
|
import { Bell01Icon } from '../../icons/Bell01Icon.js';
|
|
19
20
|
import { ChevronRightIcon } from '../../icons/ChevronRightIcon.js';
|
|
@@ -74,7 +75,7 @@ export function Account(props) {
|
|
|
74
75
|
placement: 'bottom',
|
|
75
76
|
strategy: 'fixed',
|
|
76
77
|
}, ids: {
|
|
77
|
-
trigger: 'opexa-
|
|
78
|
+
trigger: 'opexa-powerplay:account-trigger',
|
|
78
79
|
}, children: _jsx(Portal, { children: _jsx(Popover.Positioner, { children: _jsxs(Popover.Content, { className: "relative z-popover w-[23.438rem] ui-closed:animate-fade-out ui-open:animate-fade-in overflow-hidden rounded-xl border border-border-primary bg-bg-primary p-xl", children: [_jsx(Profile, {}), _jsx(Wallet, { classNames: classNames }), _jsx(Links, { router: router, classNames: classNames })] }) }) }) })] }));
|
|
79
80
|
}
|
|
80
81
|
function Profile() {
|
|
@@ -102,7 +103,19 @@ function Links({ router, classNames, }) {
|
|
|
102
103
|
})));
|
|
103
104
|
const signOutMutation = useSignOutMutation({
|
|
104
105
|
onSuccess() {
|
|
105
|
-
|
|
106
|
+
// Clear everything except the 'biometric' entry
|
|
107
|
+
{
|
|
108
|
+
const keep = new Set([BIOMETRIC_STORAGE_KEY]);
|
|
109
|
+
for (let i = 0; i < localStorage.length;) {
|
|
110
|
+
const key = localStorage.key(i);
|
|
111
|
+
if (key && !keep.has(key)) {
|
|
112
|
+
localStorage.removeItem(key);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
i++;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
106
119
|
sessionStorage.clear();
|
|
107
120
|
router.replace('/');
|
|
108
121
|
},
|
|
@@ -22,5 +22,5 @@ export function AccountTrigger({ asChild, children, ...props }) {
|
|
|
22
22
|
return (_jsx(ark.button, { type: "button", "aria-label": "Toggle account menu", "data-open": disclosure.open ? 'open' : 'closed', ...props, onClick: (e) => {
|
|
23
23
|
disclosure.setOpen(!disclosure.open);
|
|
24
24
|
return props.onClick?.(e);
|
|
25
|
-
}, asChild: !children ? true : asChild, children: children ?? (_jsx(IconButton, { id: "opexa-
|
|
25
|
+
}, asChild: !children ? true : asChild, children: children ?? (_jsx(IconButton, { id: "opexa-powerplay:account-trigger", size: "sm", colorScheme: "gray", children: !desktop && disclosure.open ? (_jsx(XIcon, {})) : (_jsx(Image, { src: avatarPlaceholder, alt: "", width: 64, height: 64, className: "size-10" })) })) }));
|
|
26
26
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ImageProps } from 'next/image';
|
|
2
|
+
export interface BannerEntry {
|
|
3
|
+
src: ImageProps['src'];
|
|
4
|
+
redirectUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BannerProps {
|
|
7
|
+
banners: BannerEntry[];
|
|
8
|
+
imageWidth?: number | [mobile: number, desktop: number];
|
|
9
|
+
imageHeight?: number | [mobile: number, desktop: number];
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Banner__client(props: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import emblaCarouselAutoplay from 'embla-carousel-autoplay';
|
|
4
|
+
import useEmblaCarousel, {} from 'embla-carousel-react';
|
|
5
|
+
import isMobile from 'is-mobile';
|
|
6
|
+
import Image from 'next/image';
|
|
7
|
+
import Link from 'next/link';
|
|
8
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
9
|
+
import { twMerge } from 'tailwind-merge';
|
|
10
|
+
import { dataAttr } from '../../utils/dataAttr.js';
|
|
11
|
+
export function Banner__client(props) {
|
|
12
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
13
|
+
loop: true,
|
|
14
|
+
align: 'start',
|
|
15
|
+
}, [
|
|
16
|
+
emblaCarouselAutoplay({
|
|
17
|
+
playOnInit: true,
|
|
18
|
+
delay: 5000,
|
|
19
|
+
}),
|
|
20
|
+
]);
|
|
21
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
function handler(detail) {
|
|
24
|
+
setCurrentIndex(detail?.selectedScrollSnap() ?? 0);
|
|
25
|
+
}
|
|
26
|
+
emblaApi?.on('scroll', handler);
|
|
27
|
+
emblaApi?.on('init', handler);
|
|
28
|
+
return () => {
|
|
29
|
+
emblaApi?.on('init', handler);
|
|
30
|
+
emblaApi?.off('scroll', handler);
|
|
31
|
+
};
|
|
32
|
+
}, [emblaApi]);
|
|
33
|
+
const imageWidth = !props.imageWidth
|
|
34
|
+
? [400, 1200]
|
|
35
|
+
: Array.isArray(props.imageWidth)
|
|
36
|
+
? props.imageWidth
|
|
37
|
+
: [props.imageWidth, props.imageWidth];
|
|
38
|
+
const imageHeight = !props.imageHeight
|
|
39
|
+
? [225, 300]
|
|
40
|
+
: Array.isArray(props.imageHeight)
|
|
41
|
+
? props.imageHeight
|
|
42
|
+
: [props.imageHeight, props.imageHeight];
|
|
43
|
+
return (_jsxs("div", { className: twMerge('relative', props.className), children: [_jsx("div", { ref: emblaRef, className: "overflow-hidden", children: _jsx("div", { className: "flex gap-2", children: props.banners.map((banner, index) => {
|
|
44
|
+
const img = (_jsx(Image, { src: banner.src, alt: "", width: isMobile() ? imageWidth[0] : imageWidth[1], height: isMobile() ? imageHeight[0] : imageHeight[1], className: "block h-auto w-full", priority: index === 0 }));
|
|
45
|
+
return (_jsx(Fragment, { children: !banner.redirectUrl ? (_jsx("div", { className: "w-full shrink-0", children: img })) : (_jsx(Link, { href: banner.redirectUrl, className: "block w-full shrink-0", "aria-label": `Open ${banner.redirectUrl}`, children: img })) }, index));
|
|
46
|
+
}) }) }), _jsx("div", { className: "absolute bottom-lg left-1/2 flex w-fit -translate-x-1/2 gap-2", children: props.banners.map((_, index) => (_jsx("button", { type: "button", className: "ui-active:bg-brand-500 bg-gray-300 size-3 shrink-0 rounded-full border border-white transition-all duration-300 ui-active:w-9", onClick: () => {
|
|
47
|
+
emblaApi?.scrollTo(index);
|
|
48
|
+
}, "aria-label": `Go to slide ${index + 1}`, "data-active": dataAttr(index === currentIndex) }, index))) })] }));
|
|
49
|
+
}
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "form" | "vca";
|
|
4
4
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
@@ -13,7 +13,7 @@ export declare const OnlineBankDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useOnlineBankDepositContext: () => {
|
|
16
|
-
view: "
|
|
16
|
+
view: "form" | "vca";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
|
|
3
3
|
export declare function useOnlineBankDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "form" | "vca";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "form" | "qrCode";
|
|
4
4
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useQRPHDepositContext: () => {
|
|
16
|
-
view: "
|
|
16
|
+
view: "form" | "qrCode";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
3
|
export declare function useQRPHDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "form" | "qrCode";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
export function Loading() {
|
|
4
|
-
return (_jsx("div", { className: "flex h-[calc(100vh-400px)] w-full items-center justify-center px-4", children: _jsxs("div", { className: "flex flex-col items-center space-y-4", children: [_jsx("div", { className: "
|
|
4
|
+
return (_jsx("div", { className: "flex h-[calc(100vh-400px)] w-full items-center justify-center px-4", children: _jsxs("div", { className: "flex flex-col items-center space-y-4", children: [_jsx("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-blue-500 border-t-transparent" }), _jsx("p", { className: "font-medium text-gray-700 text-lg", children: "Loading Sports Book\u2026" })] }) }));
|
|
5
5
|
}
|