@opexa/portal-components 0.0.308 → 0.0.310
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/useCamera.js +2 -2
- package/dist/client/hooks/useControllableState.js +1 -1
- package/dist/client/hooks/useInfiniteQueryHelper.js +2 -3
- package/dist/client/hooks/useMarkGameAsFavoriteMutation.js +1 -2
- package/dist/client/hooks/useMobileNumberParser.js +1 -1
- package/dist/components/Account/Account.lazy.js +5 -5
- package/dist/components/Account/account.recipe.js +4 -4
- package/dist/components/AccountInfo/AccountInfo.js +6 -6
- package/dist/components/AccountSecurity/AccountSecurity.js +6 -6
- package/dist/components/AccountVerification/AccountVerification.js +7 -7
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/BetRecords/BetRecords.client.js +5 -5
- package/dist/components/Bonus/Bonus.client.js +2 -2
- package/dist/components/Bonuses/Bonuses.client.js +10 -10
- package/dist/components/Bonuses/BonusesTrigger.js +1 -1
- package/dist/components/Bonuses/ClaimSpotBonus.lazy.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +2 -2
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/AvailablePromos.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/Deposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositAlert.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositDetails.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -2
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +2 -2
- package/dist/components/DepositWithdrawal/HasPendingBonuses.js +1 -1
- package/dist/components/DepositWithdrawal/PaymentMethods.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +3 -3
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +2 -4
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +3 -3
- package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/TransactionPasswordNotSet.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +2 -2
- package/dist/components/DepositWithdrawal/Withdrawal/Withdrawal.js +4 -4
- package/dist/components/DigitainLauncher/Fallback.js +1 -1
- package/dist/components/DigitainLauncher/Loading.js +1 -1
- package/dist/components/DigitainLauncher/utils.js +1 -2
- package/dist/components/Disclaimer/DisclaimerV1.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +3 -3
- package/dist/components/FavoriteGames/FavoriteGames.client.js +4 -4
- package/dist/components/ForgotPassword/ForgotPassword.lazy.js +1 -1
- package/dist/components/ForgotPassword/ForgotPasswordForm.js +5 -5
- package/dist/components/GCashFailed/GCashFailed.js +1 -1
- package/dist/components/GCashSuccess/GCashSuccess.js +1 -1
- package/dist/components/GameLaunch/GameLaunch.lazy.js +4 -4
- package/dist/components/GameLaunch/GameLaunchTrigger.js +2 -4
- package/dist/components/GameProviders/GameProvidersCarousel.js +1 -1
- package/dist/components/GameProviders/GameProvidersList.js +1 -1
- package/dist/components/Games/Game.js +3 -3
- package/dist/components/Games/GamesCarousel.client.js +2 -4
- package/dist/components/Games/GamesList.client.js +2 -2
- package/dist/components/GamesSearch/GamesSearch.js +4 -6
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +53 -51
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +14 -12
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +1 -1
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +13 -11
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +1 -1
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +15 -15
- 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/KYCReminder.lazy.js +1 -1
- package/dist/components/KYC/PersonalInformation.js +1 -1
- package/dist/components/Marquee/Marquee.js +1 -1
- package/dist/components/Messages/Messages.lazy.js +5 -5
- package/dist/components/Messages/MessagesPopup.js +3 -3
- package/dist/components/Messages/MessagesTrigger.js +1 -1
- package/dist/components/News/News.js +1 -1
- package/dist/components/NewsFeed/News.d.ts +2 -2
- package/dist/components/NewsFeed/News.js +1 -1
- package/dist/components/NewsFeed/NewsFeedCarousel.js +2 -2
- package/dist/components/NewsFeed/NewsFeedList.js +1 -1
- package/dist/components/PortalProvider/Snackbar.js +2 -2
- package/dist/components/Promo/Promo.client.js +2 -2
- package/dist/components/Promos/Cashback.js +1 -1
- package/dist/components/Promos/CustomPromo.d.ts +2 -2
- package/dist/components/Promos/CustomPromo.js +1 -1
- package/dist/components/Promos/Promo.js +1 -1
- package/dist/components/Promos/PromosCarousel.js +2 -2
- package/dist/components/Promos/PromosGrid.js +2 -2
- package/dist/components/Quests/DailyCheckInQuest.js +3 -3
- package/dist/components/Quests/JourneyQuest.js +5 -5
- package/dist/components/Quests/OnboardingQuest.js +2 -2
- package/dist/components/Quests/Quests.client.js +4 -4
- package/dist/components/Quests/WageringQuest.js +2 -2
- package/dist/components/ResponsibleGaming/ResponsibleGaming.lazy.js +1 -1
- package/dist/components/Search/Search.lazy.js +7 -9
- package/dist/components/SignIn/MobileNumberSignIn.js +5 -5
- package/dist/components/SignIn/NameAndPasswordSignIn.js +2 -2
- package/dist/components/SignIn/SignIn.lazy.d.ts +1 -1
- package/dist/components/SignIn/SignIn.lazy.js +1 -2
- package/dist/components/SignIn/SignInForm.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUpDefault.lazy.js +1 -1
- package/dist/components/SignUp/SignUpDefault/SignUpDefaultForm.js +7 -7
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.client.js +7 -7
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.client.js +6 -6
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +0 -1
- package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.js +1 -1
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +8 -8
- package/dist/components/TermsAndConditions/TermsAndConditions.lazy.js +1 -1
- package/dist/components/TermsOfUse/TermsOfUse.lazy.js +1 -1
- package/dist/components/TopWins/TopWins.client.js +3 -3
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +1 -1
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +10 -8
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +2 -2
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +9 -7
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +1 -1
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +8 -6
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +1 -1
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +1 -1
- package/dist/components/TransactionRecords/DepositRecordsTable.js +2 -2
- package/dist/components/TransactionRecords/TableFilters.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecords.suspense.js +1 -1
- package/dist/components/TransactionRecords/TransactionRecordsTable.js +2 -2
- package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +2 -2
- package/dist/components/shared/Empty.js +1 -1
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +7 -7
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.js +1 -1
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +6 -6
- package/dist/components/shared/SelfieImageField/SelfieImageField.js +1 -1
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +0 -1
- package/dist/constants/EnvVar.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +1 -1
- package/dist/services/graphqlRequest.js +0 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/AlertDialog/alertDialog.recipe.js +6 -6
- package/dist/ui/Avatar/avatar.recipe.js +3 -3
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Badge/badge.recipe.js +7 -7
- package/dist/ui/Button/button.recipe.d.ts +2 -2
- package/dist/ui/Button/button.recipe.js +3 -3
- 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/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.js +2 -2
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Collapsible/collapsible.recipe.js +2 -2
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/Combobox.js +0 -1
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Combobox/combobox.recipe.js +6 -6
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/datePicker.recipe.js +7 -7
- package/dist/ui/Dialog/Dialog.d.ts +154 -154
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Dialog/dialog.recipe.js +4 -4
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +5 -5
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Field/field.recipe.js +3 -3
- package/dist/ui/IconButton/iconButton.recipe.d.ts +2 -2
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/NumberInput/numberInput.recipe.js +5 -5
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/passwordInput.recipe.js +3 -3
- package/dist/ui/PinInput/pinInput.recipe.js +3 -3
- package/dist/ui/Popover/Popover.d.ts +121 -121
- package/dist/ui/Popover/popover.recipe.d.ts +11 -11
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Presence/Presence.js +1 -1
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Progress/progress.recipe.js +2 -2
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +4 -4
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/Select.js +0 -1
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.js +7 -7
- 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/Table/table.recipe.js +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +4 -4
- package/dist/ui/Tooltip/tooltip.recipe.js +1 -1
- package/dist/utils/getLocaleInfo.js +7 -7
- package/dist/utils/getQueryClient.js +1 -1
- package/dist/utils/parseDecimal.js +1 -1
- package/dist/utils/validateFile.d.ts +1 -1
- package/package.json +157 -162
|
@@ -55,9 +55,7 @@ export function Search(props) {
|
|
|
55
55
|
}, {
|
|
56
56
|
enabled: search.length >= 2,
|
|
57
57
|
});
|
|
58
|
-
const games = gamesQuery.data?.pages
|
|
59
|
-
.map((page) => page.edges.map((edge) => edge.node))
|
|
60
|
-
.flat() ?? [];
|
|
58
|
+
const games = gamesQuery.data?.pages.flatMap((page) => page.edges.map((edge) => edge.node)) ?? [];
|
|
61
59
|
const empty = games.length <= 0 && gameProviders.length <= 0;
|
|
62
60
|
const viewGamesUrl = (data) => {
|
|
63
61
|
return props.viewGamesUrl
|
|
@@ -73,18 +71,18 @@ export function Search(props) {
|
|
|
73
71
|
return (_jsx(Dialog.Root, { open: globalStore.search.open, onOpenChange: (details) => {
|
|
74
72
|
globalStore.search.setOpen(details.open);
|
|
75
73
|
setSearch('');
|
|
76
|
-
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "
|
|
74
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary pt-xl lg:mt-[132px] lg:min-h-auto lg:max-w-[1136px] lg:bg-unset lg:px-2 lg:pt-0", children: [_jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "flex items-center justify-between px-4 lg:hidden", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 40, className: "h-8 w-auto" }), _jsx(IconButton, { size: "sm", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, { className: "size-6 text-text-quinary" }) })] })) }), _jsx("div", { className: "flex justify-end", children: _jsx(Dialog.Context, { children: (api) => (_jsx("button", { type: "button", onClick: () => api.setOpen(false), className: "hidden size-9 items-center justify-center rounded-md bg-white/20 lg:flex", children: _jsx(XIcon, { className: "size-5 text-white" }) })) }) }), _jsx("div", { className: "mt-2xl px-4 lg:mt-xl lg:px-0", children: _jsxs("div", { className: "relative", children: [_jsx(SearchLgIcon, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5 text-text-quinary" }), _jsx(DebouncedInput, { ref: inputRef, value: search, placeholder: props.placeholder ?? 'Search', onChange: setSearch }), _jsx(Presence, { present: search.length > 0, asChild: true, lazyMount: true, children: _jsx("button", { type: "button", className: "-translate-y-1/2 absolute top-1/2 right-3.5 cursor-pointer font-semibold text-text-secondary-700", onClick: () => {
|
|
77
75
|
setSearch('');
|
|
78
76
|
inputRef.current?.focus();
|
|
79
|
-
}, children: "Clear" }) })] }) }), _jsx("div", { className: "
|
|
77
|
+
}, children: "Clear" }) })] }) }), _jsx("div", { className: "mt-2xl p-xl pb-3xl lg:mt-2 lg:max-h-[41rem] lg:overflow-y-auto lg:rounded-xl lg:border lg:border-border-primary lg:bg-bg-primary", children: search.length <= 0 ? (_jsx(Alert, { message: "Search for your favorite game or provider." })) : search.length === 1 ? (_jsx(Alert, { message: "Search requires at least 2 characters." })) : (_jsxs(_Fragment, { children: [empty && _jsx(Alert, { message: "No results found" }), !empty && (_jsxs(_Fragment, { children: [gameProviders.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Providers" }), _jsx("div", { className: "mt-3.5 mb-3xl grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), "aria-label": `View ${provider.name} games`, className: twMerge('flex h-14 w-full items-center rounded-md bg-brand-800', classNames.providerThumbnailRoot), onClick: () => {
|
|
80
78
|
globalStore.search.setOpen(false);
|
|
81
79
|
}, children: _jsx(Image, { src: props.gameProviderImages?.[provider.id] ??
|
|
82
|
-
provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "text-lg
|
|
80
|
+
provider.logo, alt: "", width: 100, height: 50, className: twMerge('mx-auto h-auto w-full', classNames.providerThumbnailImage) }) }, provider.id))) })] })), games.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "font-semibold text-lg", children: "Games" }), _jsx("div", { className: "mt-3.5 grid grid-cols-3 gap-1.5 lg:grid-cols-9 lg:gap-3.5", children: games.map((game) => (_jsxs(GameLaunchTrigger, { game: game, className: twMerge('block w-full shadow-sm', classNames.gameThumbnailRoot), onClick: () => {
|
|
83
81
|
globalStore.search.setOpen(false);
|
|
84
82
|
}, children: [_jsx(Image, { src: getGameImageUrl({
|
|
85
83
|
reference: game.reference,
|
|
86
84
|
provider: game.provider,
|
|
87
|
-
}), alt: "", width: 200, height: 200, loading: "lazy", unoptimized: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: twMerge('
|
|
85
|
+
}), alt: "", width: 200, height: 200, loading: "lazy", unoptimized: true, className: "aspect-square w-full rounded-t-md object-cover" }), _jsx("span", { className: twMerge('block w-full truncate rounded-b-md bg-bg-tertiary px-2 py-2.5 text-center font-semibold text-text-primary-brand text-xs', classNames.gameThumbnailTitle), children: game.name })] }, game.id))) })] })), _jsx(Presence, { present: gamesQuery.hasNextPage, children: _jsx(Button, { variant: "outline", className: "mx-auto mt-12 w-fit", onClick: () => gamesQuery.fetchNextPage(), children: "Load More" }) })] }))] })) })] }) })] }) }));
|
|
88
86
|
}
|
|
89
87
|
function DebouncedInput(props) {
|
|
90
88
|
const [value, setValue] = useControllableState({
|
|
@@ -100,8 +98,8 @@ function DebouncedInput(props) {
|
|
|
100
98
|
return (_jsx(Field.Input, { ref: props.ref, type: "search", value: internalValue, onChange: (e) => {
|
|
101
99
|
setInternalValue(e.target.value);
|
|
102
100
|
setValueDebounced(e.target.value);
|
|
103
|
-
}, className: "pl-10
|
|
101
|
+
}, className: "pr-16 pl-10", placeholder: props.placeholder, autoComplete: "off" }));
|
|
104
102
|
}
|
|
105
103
|
function Alert({ message }) {
|
|
106
|
-
return (_jsxs("div", { className: "py-lg", role: "alert", "aria-live": "polite", children: [_jsx("div", { className: "
|
|
104
|
+
return (_jsxs("div", { className: "py-lg", role: "alert", "aria-live": "polite", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-lg border border-border-primary bg-bg-secondary shadow-xs", children: _jsx(SearchLgIcon, { className: "size-6 text-text-secondary-700" }) }), _jsx("p", { className: "mt-4 text-center text-text-secondary-700", children: message })] }));
|
|
107
105
|
}
|
|
@@ -120,7 +120,7 @@ export function MobileNumberSignIn() {
|
|
|
120
120
|
recipient: mobileNumberParser.format(data.mobileNumber),
|
|
121
121
|
strict: true,
|
|
122
122
|
});
|
|
123
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "
|
|
123
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
|
|
124
124
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
125
125
|
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Log In" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
126
126
|
if (details.checked === 'indeterminate')
|
|
@@ -148,10 +148,10 @@ export function MobileNumberSignIn() {
|
|
|
148
148
|
globalStore.responsibleGaming.setNext('SIGN_IN');
|
|
149
149
|
globalStore.signIn.setOpen(false);
|
|
150
150
|
}
|
|
151
|
-
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "
|
|
151
|
+
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] })), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
|
|
152
152
|
globalStore.signIn.setOpen(false);
|
|
153
153
|
globalStore.signUp.setOpen(true);
|
|
154
|
-
}, children: "Sign up" })] })] })), context.step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
154
|
+
}, children: "Sign up" })] })] })), context.step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
155
155
|
const { mobileNumber } = step1Form.getValues();
|
|
156
156
|
signInMutation.mutate({
|
|
157
157
|
type: 'MOBILE_NUMBER',
|
|
@@ -163,7 +163,7 @@ export function MobileNumberSignIn() {
|
|
|
163
163
|
o.field.onBlur();
|
|
164
164
|
}, otp: true, onValueComplete: () => {
|
|
165
165
|
form2Ref.current?.requestSubmit();
|
|
166
|
-
}, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "
|
|
166
|
+
}, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "font-semibold text-button-secondary-fg", disabled: cooldown.cooling, onClick: async () => {
|
|
167
167
|
await sendVerificationCodeMutation.mutateAsync({
|
|
168
168
|
channel: 'SMS',
|
|
169
169
|
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
@@ -171,7 +171,7 @@ export function MobileNumberSignIn() {
|
|
|
171
171
|
cooldown.start();
|
|
172
172
|
}, children: cooldown.cooling
|
|
173
173
|
? `Resend in ${cooldown.countdown}s`
|
|
174
|
-
: 'Resend' })] }), _jsxs("button", { type: "button", className: "
|
|
174
|
+
: 'Resend' })] }), _jsxs("button", { type: "button", className: "mx-auto mt-3xl flex w-fit items-center gap-1 font-semibold text-sm text-text-tertiary-600", onClick: () => {
|
|
175
175
|
context.setStep(1);
|
|
176
176
|
step2Form.reset();
|
|
177
177
|
cooldown.stop();
|
|
@@ -132,7 +132,7 @@ export function NameAndPasswordSignIn() {
|
|
|
132
132
|
signInMutation.reset();
|
|
133
133
|
form.setValue('secretAnswer', '');
|
|
134
134
|
},
|
|
135
|
-
}) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "text-button-tertiary-fg text-sm
|
|
135
|
+
}) }), _jsx(Field.ErrorText, { children: form.formState.errors.name?.message })] }), _jsx(Field.Root, { disabled: !!signInMutation.data, invalid: !!form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs("div", { children: [_jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx("div", { className: "mt-2 flex justify-end", children: _jsx("button", { type: "button", tabIndex: -1, className: "font-semibold text-button-tertiary-fg text-sm", onClick: () => {
|
|
136
136
|
globalStore.forgotPassword.setOpen(true);
|
|
137
137
|
dialog.setOpen(false);
|
|
138
138
|
}, children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
@@ -161,7 +161,7 @@ export function NameAndPasswordSignIn() {
|
|
|
161
161
|
globalStore.responsibleGaming.setNext('SIGN_IN');
|
|
162
162
|
globalStore.signIn.setOpen(false);
|
|
163
163
|
}
|
|
164
|
-
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "
|
|
164
|
+
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), signInProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] })), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Don't have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
|
|
165
165
|
dialog.setOpen(false);
|
|
166
166
|
globalStore.signUp.setOpen(true);
|
|
167
167
|
}, children: "Sign up" })] })] }));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Image, {} from 'next/image';
|
|
4
|
-
import {} from 'react';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
6
5
|
import { useShallow } from 'zustand/shallow';
|
|
7
6
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
@@ -16,5 +15,5 @@ export function SignIn(props) {
|
|
|
16
15
|
const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
|
|
17
16
|
return (_jsx(SignInPropsProvider, { value: props, children: _jsx(SignInProvider, { value: signIn, children: _jsx(Dialog.Root, { open: signInStore.open, onOpenChange: (details) => {
|
|
18
17
|
signInStore.setOpen(details.open);
|
|
19
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('
|
|
18
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-7.5 w-auto", draggable: false }), _jsx(SignInForm, {})] }) })] }) }) }) }));
|
|
20
19
|
}
|
|
@@ -6,5 +6,5 @@ import { useSignInContext } from './SignInContext.js';
|
|
|
6
6
|
import { SignInMethod } from './SignInMethod.js';
|
|
7
7
|
export function SignInForm() {
|
|
8
8
|
const context = useSignInContext();
|
|
9
|
-
return (_jsxs(_Fragment, { children: [context.step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
9
|
+
return (_jsxs(_Fragment, { children: [context.step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Log in to your account" }), _jsx("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Welcome back! Please enter your details." })] })), _jsx(SignInMethod, {}), context.type === 'MOBILE_NUMBER' && _jsx(MobileNumberSignIn, {}), context.type === 'NAME_AND_PASSWORD' && _jsx(NameAndPasswordSignIn, {})] }));
|
|
10
10
|
}
|
|
@@ -14,5 +14,5 @@ export function SignUpDefault(props) {
|
|
|
14
14
|
const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
|
|
15
15
|
return (_jsx(SignUpDefaultPropsProvider, { value: props, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
|
|
16
16
|
signUpStore.setOpen(details.open);
|
|
17
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('
|
|
17
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('mx-auto h-full w-full items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:h-fit lg:w-[400px] lg:rounded-xl', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpDefaultForm, {}) })] }) })] }) }) }));
|
|
18
18
|
}
|
|
@@ -149,7 +149,7 @@ export function SignUpDefaultForm() {
|
|
|
149
149
|
const form2Ref = useRef(null);
|
|
150
150
|
const birthDay = step1Form.watch('birthDay');
|
|
151
151
|
const branchCode = step1Form.watch('branchCode', '');
|
|
152
|
-
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
152
|
+
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Create an account" }), _jsx("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
153
153
|
try {
|
|
154
154
|
await sendVerificationCodeMutation.mutateAsync({
|
|
155
155
|
channel: 'SMS',
|
|
@@ -165,7 +165,7 @@ export function SignUpDefaultForm() {
|
|
|
165
165
|
: 'Failed to send verification code',
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "
|
|
168
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
|
|
169
169
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
170
170
|
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.realName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Real Name" }), _jsx(Field.Input, { placeholder: "Enter your real name", ...step1Form.register('realName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
|
|
171
171
|
if (!value)
|
|
@@ -188,7 +188,7 @@ export function SignUpDefaultForm() {
|
|
|
188
188
|
placement: 'bottom',
|
|
189
189
|
}, lazyMount: true, unmountOnExit: true, children: [_jsxs(Select.Label, { className: "flex items-center gap-1", children: ["Branch", _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: {
|
|
190
190
|
placement: 'top',
|
|
191
|
-
}, children: [_jsx(Tooltip.Trigger, { children: _jsx(HelpCircleIcon, { className: "text-text-nav-item-button-icon
|
|
191
|
+
}, children: [_jsx(Tooltip.Trigger, { children: _jsx(HelpCircleIcon, { className: "size-4 text-text-nav-item-button-icon" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) }), "Choose branch closest to your residence."] }) })] })] }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: branchCollection.items.map((item) => {
|
|
192
192
|
const label = branchCollection.stringifyItem(item) ?? '';
|
|
193
193
|
return (_jsx(Select.Item, { item: item, "aria-disabled": item.disabled, className: twMerge(item.disabled && 'text-border-disabled'), children: _jsx("div", { title: label, className: "line-clamp-1", children: label }) }, item.code));
|
|
194
194
|
}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.branchCode?.message })] })), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
@@ -217,10 +217,10 @@ export function SignUpDefaultForm() {
|
|
|
217
217
|
globalStore.responsibleGaming.setNext('SIGN_UP');
|
|
218
218
|
globalStore.signUp.setOpen(false);
|
|
219
219
|
}
|
|
220
|
-
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), signUpProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "
|
|
220
|
+
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), signUpProps.showPublicPlayProhibition && (_jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] })), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
|
|
221
221
|
globalStore.signUp.setOpen(false);
|
|
222
222
|
globalStore.signIn.setOpen(true);
|
|
223
|
-
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
223
|
+
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
224
224
|
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
225
225
|
const { mobileNumber } = step1Form.getValues();
|
|
226
226
|
try {
|
|
@@ -291,7 +291,7 @@ export function SignUpDefaultForm() {
|
|
|
291
291
|
o.field.onChange(details.value);
|
|
292
292
|
}, onValueComplete: () => {
|
|
293
293
|
form2Ref.current?.requestSubmit();
|
|
294
|
-
}, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "
|
|
294
|
+
}, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "font-semibold text-button-secondary-fg disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
|
|
295
295
|
await sendVerificationCodeMutation.mutateAsync({
|
|
296
296
|
channel: 'SMS',
|
|
297
297
|
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
@@ -299,7 +299,7 @@ export function SignUpDefaultForm() {
|
|
|
299
299
|
cooldown.start();
|
|
300
300
|
}, children: cooldown.cooling
|
|
301
301
|
? `Resend in ${cooldown.countdown}s`
|
|
302
|
-
: 'Resend' })] }), _jsxs("button", { type: "button", className: "
|
|
302
|
+
: 'Resend' })] }), _jsxs("button", { type: "button", className: "mx-auto mt-3xl flex w-fit items-center gap-1 font-semibold text-sm text-text-tertiary-600", onClick: () => {
|
|
303
303
|
setStep(1);
|
|
304
304
|
step2Form.reset();
|
|
305
305
|
cooldown.stop();
|
|
@@ -25,7 +25,7 @@ export function IdFrontImageField__client(props) {
|
|
|
25
25
|
'defaultValue',
|
|
26
26
|
])(props);
|
|
27
27
|
const context = useIdFrontImageField(useIdFrontImageFieldProps);
|
|
28
|
-
return (_jsxs(IdFrontImageFieldProvider, { value: context, children: [_jsxs("div", { ref: localProps.ref, id: localProps.id, style: localProps.style, className: twMerge('
|
|
28
|
+
return (_jsxs(IdFrontImageFieldProvider, { value: context, children: [_jsxs("div", { ref: localProps.ref, id: localProps.id, style: localProps.style, className: twMerge('group relative aspect-[352/180] w-full shrink-0 rounded-xl border border-border-primary bg-bg-primary p-xl', localProps.className), onDragOver: (e) => e.preventDefault(), onDragEnter: (e) => e.preventDefault(), onDragLeave: (e) => e.preventDefault(), onDrop: (e) => {
|
|
29
29
|
e.preventDefault();
|
|
30
30
|
const file = e.dataTransfer.files?.[0];
|
|
31
31
|
if (!file)
|
|
@@ -42,17 +42,17 @@ export function IdFrontImageField__client(props) {
|
|
|
42
42
|
if (error)
|
|
43
43
|
return localProps.onError?.(error);
|
|
44
44
|
context.setValue(file);
|
|
45
|
-
}, disabled: context.field?.disabled || localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.value && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "
|
|
45
|
+
}, disabled: context.field?.disabled || localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.value && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "mx-auto flex size-8 items-center justify-center rounded-sm border border-border-primary shadow-xs", children: _jsx(UploadCloud02Icon, { className: "size-4 text-text-placeholder-subtle" }) }), _jsxs("h2", { className: "mt-lg text-text-tertiary-600", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
|
|
46
46
|
context.inputRef.current?.click();
|
|
47
47
|
}, disabled: context.field?.disabled ||
|
|
48
48
|
context.field?.readOnly ||
|
|
49
49
|
localProps.disabled ||
|
|
50
|
-
localProps.readOnly, className: "text-button-secondary-fg
|
|
50
|
+
localProps.readOnly, className: "font-semibold text-button-secondary-fg disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
|
|
51
51
|
context.disclosure.setOpen(true);
|
|
52
52
|
}, disabled: context.field?.disabled ||
|
|
53
53
|
context.field?.readOnly ||
|
|
54
54
|
localProps.disabled ||
|
|
55
|
-
localProps.readOnly, children: "Take a photo" })] })), context.valueAsUrl && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.valueAsUrl, alt: "", width: 600, height: 378.08, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "
|
|
55
|
+
localProps.readOnly, children: "Take a photo" })] })), context.valueAsUrl && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.valueAsUrl, alt: "", width: 600, height: 378.08, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "absolute top-2 right-2 rounded-full bg-white/10 p-1 backdrop-blur-xs", onClick: () => {
|
|
56
56
|
context.setValue(null);
|
|
57
57
|
}, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
|
|
58
58
|
}
|
|
@@ -65,9 +65,9 @@ function Camera() {
|
|
|
65
65
|
const context = useIdFrontImageFieldContext();
|
|
66
66
|
return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
|
|
67
67
|
context.disclosure.setOpen(details.open);
|
|
68
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "
|
|
68
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Picture of Your Front ID" }), _jsxs(Dialog.Description, { className: "mt-md text-center text-text-tertiary-600 text-xs lg:text-base", 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\u00A0the\u00A0frame."] }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "size-10 text-center text-text-placeholder-subtle lg:size-12" }), _jsx("h2", { className: "mt-3 font-semibold text-sm lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "mt-0.5 text-center text-text-tertiary-600 text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
|
|
69
69
|
context.camera.reopen();
|
|
70
|
-
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "
|
|
70
|
+
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "size-8 text-text-placeholder" }) })), context.camera.data && (_jsx("div", { className: "aspect-[4/3] w-full overflow-hidden rounded-md border border-border-disabled bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 378.08, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "mx-auto w-full px-xl py-lg disabled:bg-bg-disabled disabled:text-text-disabled lg:w-[10rem]", onClick: () => {
|
|
71
71
|
context.camera.snap();
|
|
72
72
|
}, disabled: context.camera.snapping ||
|
|
73
73
|
context.camera.loading ||
|
|
@@ -96,5 +96,5 @@ function Video() {
|
|
|
96
96
|
const y = (rootRect.height - guideRect.height) / 2;
|
|
97
97
|
return (_jsxs("div", { ref: rootRef, className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
98
98
|
? 'block'
|
|
99
|
-
: 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("div", { className: "pointer-events-none absolute
|
|
99
|
+
: 'hidden'), children: [_jsx("video", { ...context.camera.videoProps }), _jsx("div", { className: "pointer-events-none absolute top-0 right-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { ref: context.guideRef, className: "-translate-x-1/2 -translate-y-1/2 pointer-events-none absolute top-1/2 left-1/2 z-10 aspect-[85.6/53.98] w-[calc(100%-1rem)] max-w-[24.688rem] border-4 border-utility-warning-700 border-dashed transition-all duration-200" })] }));
|
|
100
100
|
}
|
|
@@ -4,7 +4,7 @@ import dynamic from 'next/dynamic';
|
|
|
4
4
|
import { Spinner02Icon } from '../../../../icons/Spinner02Icon.js';
|
|
5
5
|
const Component = dynamic(() => import('./IdFrontImageField.client.js').then((mod) => mod.IdFrontImageField__client), {
|
|
6
6
|
ssr: false,
|
|
7
|
-
loading: () => (_jsx("div", { className: "
|
|
7
|
+
loading: () => (_jsx("div", { className: "flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border border-border-primary bg-bg-primary", children: _jsx(Spinner02Icon, { className: "size-8 text-text-quinary" }) })),
|
|
8
8
|
});
|
|
9
9
|
export function IdFrontImageField(props) {
|
|
10
10
|
return _jsx(Component, { ...props });
|
|
@@ -42,17 +42,17 @@ export function SelfieImageField__client(props) {
|
|
|
42
42
|
if (error)
|
|
43
43
|
return localProps.onError?.(error);
|
|
44
44
|
context.setValue(file);
|
|
45
|
-
}, disabled: context.field?.disabled || localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.value && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "
|
|
45
|
+
}, disabled: context.field?.disabled || localProps.disabled, readOnly: context.field?.readOnly || localProps.readOnly, required: context.field?.required || localProps.required, className: "sr-only" }), !context.value && (_jsxs("div", { className: "flex size-full flex-col justify-center", children: [_jsx("div", { className: "mx-auto flex size-8 items-center justify-center rounded-sm border border-border-primary shadow-xs", children: _jsx(UploadCloud02Icon, { className: "size-4 text-text-placeholder-subtle" }) }), _jsxs("h2", { className: "mt-lg text-text-tertiary-600", children: [_jsxs("span", { className: "block text-center text-sm", children: [_jsx("button", { type: "button", onClick: () => {
|
|
46
46
|
context.inputRef.current?.click();
|
|
47
47
|
}, disabled: context.field?.disabled ||
|
|
48
48
|
context.field?.readOnly ||
|
|
49
49
|
localProps.disabled ||
|
|
50
|
-
localProps.readOnly, className: "text-button-secondary-fg
|
|
50
|
+
localProps.readOnly, className: "font-semibold text-button-secondary-fg disabled:opacity-60", children: "Click to upload" }), ' ', "or drag and drop"] }), _jsx("span", { className: "mt-xs block text-center text-xs", children: "PNG, JPG or JPEG (max. 10mb)" }), _jsx("span", { className: "m-txs block text-center text-xs", children: "or" })] }), _jsx(Button, { size: "sm", variant: "outline", className: "mx-auto mt-md w-auto", onClick: () => {
|
|
51
51
|
context.disclosure.setOpen(true);
|
|
52
52
|
}, disabled: context.field?.disabled ||
|
|
53
53
|
context.field?.readOnly ||
|
|
54
54
|
localProps.disabled ||
|
|
55
|
-
localProps.readOnly, children: "Take a photo" })] })), context.valueAsUrl && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.valueAsUrl, alt: "", width: 600, height: 600, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "
|
|
55
|
+
localProps.readOnly, children: "Take a photo" })] })), context.valueAsUrl && (_jsxs("div", { className: "relative", children: [_jsx(Image, { src: context.valueAsUrl, alt: "", width: 600, height: 600, unoptimized: true, className: "h-auto w-full rounded-md" }), _jsx("button", { type: "button", className: "absolute top-2 right-2 rounded-full bg-white/10 p-1 backdrop-blur-xs", onClick: () => {
|
|
56
56
|
context.setValue(null);
|
|
57
57
|
}, children: _jsx(XIcon, { className: "size-5" }) })] }))] }), _jsx(Camera, {})] }));
|
|
58
58
|
}
|
|
@@ -65,9 +65,9 @@ function Camera() {
|
|
|
65
65
|
const context = useSelfieImageFieldContext();
|
|
66
66
|
return (_jsx(Dialog.Root, { open: context.disclosure.open, onOpenChange: (details) => {
|
|
67
67
|
context.disclosure.setOpen(details.open);
|
|
68
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "
|
|
68
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: context.camera.close, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center overflow-y-auto py-4", children: _jsxs(Dialog.Content, { className: "mx-auto w-[calc(100dvw-1rem)] max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary-alt px-4 py-5 lg:w-[747px] lg:max-w-[747px] lg:px-3xl lg:py-4xl", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Dialog.Title, { className: "text-center font-semibold lg:text-xl", children: "Take a Selfie Holding Your ID" }), _jsx(Dialog.Description, { className: "mt-md text-center text-text-tertiary-600 text-xs lg:text-base", children: "Make sure your face and ID are clearly visible, with no glare\u00A0or\u00A0blur." }), _jsxs("div", { className: "relative mt-5 lg:mt-10 lg:px-3xl", children: [_jsx(Video, {}), context.camera.error && (_jsxs("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: [_jsx(CameraOffIcon, { className: "size-10 text-center text-text-placeholder-subtle lg:size-12" }), _jsx("h2", { className: "mt-3 font-semibold text-sm lg:mt-4 lg:text-base", children: context.camera.error.name }), _jsx("p", { className: "mt-0.5 text-center text-text-tertiary-600 text-xs lg:mt-1 lg:text-sm", children: context.camera.error.message }), _jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", fullWidth: false, className: "mt-4 lg:mt-5", onClick: () => {
|
|
69
69
|
context.camera.reopen();
|
|
70
|
-
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "
|
|
70
|
+
}, children: "Try again" })] })), context.camera.loading && (_jsx("div", { className: "flex aspect-[4/3] flex-col items-center justify-center rounded-md border border-border-disabled bg-black px-4 lg:aspect-video", children: _jsx(Spinner02Icon, { className: "size-8 text-text-placeholder" }) })), context.camera.data && (_jsx("div", { className: "aspect-[4/3] w-full overflow-hidden rounded-md border border-border-disabled bg-black lg:aspect-video", children: _jsx(Image, { src: context.camera.data.url, alt: "", width: 600, height: 600, unoptimized: true, className: "mx-auto mt-2 block h-[calc(100%-1rem)] w-auto" }) }))] }), !context.camera.data && (_jsx("div", { className: "mt-5 lg:mt-10", children: _jsxs(Button, { className: "mx-auto w-full px-xl py-lg disabled:bg-bg-disabled disabled:text-text-disabled lg:w-[10rem]", onClick: () => {
|
|
71
71
|
context.camera.snap();
|
|
72
72
|
}, disabled: context.camera.loading ||
|
|
73
73
|
context.camera.snapping ||
|
|
@@ -107,7 +107,7 @@ function Video() {
|
|
|
107
107
|
const y = (rootRect.height - guideRect.height) / 2;
|
|
108
108
|
return (_jsxs("div", { ref: rootRef, className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
109
109
|
? 'block'
|
|
110
|
-
: 'hidden'), children: [_jsx("div", { className: "pointer-events-none absolute
|
|
110
|
+
: 'hidden'), children: [_jsx("div", { className: "pointer-events-none absolute top-0 right-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 left-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("video", { ...context.camera.videoProps }), _jsx("div", { ref: context.guideRef, className: twMerge('-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 z-20 aspect-square border-4 border-utility-warning-700 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
|
|
111
111
|
width: `calc(${pxToRem(guideWidth)}rem - 2rem)`,
|
|
112
112
|
} })] }));
|
|
113
113
|
}
|
|
@@ -4,7 +4,7 @@ import dynamic from 'next/dynamic';
|
|
|
4
4
|
import { Spinner02Icon } from '../../../../icons/Spinner02Icon.js';
|
|
5
5
|
const Component = dynamic(() => import('./SelfieImageField.client.js').then((mod) => mod.SelfieImageField__client), {
|
|
6
6
|
ssr: false,
|
|
7
|
-
loading: () => (_jsx("div", { className: "
|
|
7
|
+
loading: () => (_jsx("div", { className: "flex aspect-[352/180] w-full shrink-0 items-center justify-center rounded-xl border border-border-primary bg-bg-primary", children: _jsx(Spinner02Icon, { className: "size-8 text-text-quinary" }) })),
|
|
8
8
|
});
|
|
9
9
|
export function SelfieImageField(props) {
|
|
10
10
|
return _jsx(Component, { ...props });
|
|
@@ -109,7 +109,6 @@ export function useSelfieImageField(props) {
|
|
|
109
109
|
}
|
|
110
110
|
let __image_face_detector__;
|
|
111
111
|
let __video_face_detector__;
|
|
112
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
113
112
|
let __vision__;
|
|
114
113
|
async function getImageFaceDetector() {
|
|
115
114
|
if (!__image_face_detector__) {
|
|
@@ -14,5 +14,5 @@ export function SignUpKYC(props) {
|
|
|
14
14
|
const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
|
|
15
15
|
return (_jsx(SignUpKYCPropsProvider, { value: props, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
|
|
16
16
|
signUpStore.setOpen(details.open);
|
|
17
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: twMerge('
|
|
17
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: twMerge('z-banner mx-auto flex size-full flex-col items-start overflow-y-auto bg-bg-primary-alt p-3xl pb-4xl lg:max-h-[80vh] lg:w-fit lg:rounded-xl', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent', props.className), children: _jsxs("div", { className: "size-full lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[7.5rem]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpKYCForm, {}) })] }) }) })] }) }) }));
|
|
18
18
|
}
|
|
@@ -80,7 +80,7 @@ export function SignUpKYCForm() {
|
|
|
80
80
|
.refine((file) => !file || file.size > 0, {
|
|
81
81
|
message: 'File is required.',
|
|
82
82
|
})
|
|
83
|
-
.refine((file) => file
|
|
83
|
+
.refine((file) => file?.type.startsWith('image/'), {
|
|
84
84
|
message: 'File must be an image.',
|
|
85
85
|
});
|
|
86
86
|
const Step1Definition = z.object({
|
|
@@ -224,7 +224,7 @@ export function SignUpKYCForm() {
|
|
|
224
224
|
const memberVerification = useMemberVerificationQuery();
|
|
225
225
|
const memberId = memberVerification.data?.id;
|
|
226
226
|
const { mutate: uploadImageFile } = useUploadImageFileMutation();
|
|
227
|
-
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
227
|
+
return (_jsxs(_Fragment, { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Create an account" }), _jsx("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: "Register instantly and start playing!" }), _jsxs("form", { className: "mt-3xl", autoComplete: "off", onSubmit: step1Form.handleSubmit(async (data) => {
|
|
228
228
|
try {
|
|
229
229
|
await sendVerificationCodeMutation.mutateAsync({
|
|
230
230
|
channel: 'SMS',
|
|
@@ -240,7 +240,7 @@ export function SignUpKYCForm() {
|
|
|
240
240
|
: 'Failed to send verification code',
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Account Username" }), _jsx(Field.Input, { placeholder: "Enter Username", ...step1Form.register('name') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.name?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...step1Form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.password?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "mt-xl", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "
|
|
243
|
+
}), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.name, className: "mt-xl", children: [_jsx(Field.Label, { children: "Account Username" }), _jsx(Field.Input, { placeholder: "Enter Username", ...step1Form.register('name') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.name?.message })] }), _jsx(Field.Root, { invalid: !!step1Form.formState.errors.password, className: "mt-xl", children: _jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter your password", ...step1Form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.password?.message })] }) }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "mt-xl", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: [_jsx(localeInfo.country.flag, { className: "size-5" }), _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode })] }), _jsx(Field.Input, { style: {
|
|
244
244
|
paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
|
|
245
245
|
}, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.firstName, className: "mt-xl", children: [_jsx(Field.Label, { children: "First Name" }), _jsx(Field.Input, { placeholder: "Enter your First Name", ...step1Form.register('firstName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.firstName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.middleName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Middle Name" }), _jsx(Field.Input, { placeholder: "Enter your Middle Name", ...step1Form.register('middleName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.middleName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.lastName, className: "mt-xl", children: [_jsx(Field.Label, { children: "Last Name" }), _jsx(Field.Input, { placeholder: "Enter your Last Name", ...step1Form.register('lastName') }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.lastName?.message })] }), _jsxs(Field.Root, { invalid: !!step1Form.formState.errors.birthDay, className: "mt-xl", children: [_jsx(DateOfBirthField, { value: birthDay, onChange: (value) => {
|
|
246
246
|
if (!value)
|
|
@@ -276,7 +276,7 @@ export function SignUpKYCForm() {
|
|
|
276
276
|
type: 'validate',
|
|
277
277
|
message: error.message,
|
|
278
278
|
});
|
|
279
|
-
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "
|
|
279
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsxs("div", { className: "mt-3xl text-center text-sm", children: ["Prohibition to play in open and public places", _jsxs("div", { className: "mx-auto mt-5 flex h-13 w-fit items-center justify-center gap-3xl rounded-[60px] bg-[#1D0201] px-5 py-2", children: [_jsx("div", { className: "flex size-5xl items-center justify-center overflow-hidden rounded-full bg-white", children: _jsx(Image, { src: pagcorLogo, alt: "", draggable: false, height: 62, width: 186, className: "h-9.5 w-auto object-contain" }) }), _jsx(Image, { src: responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-10 w-auto", draggable: false })] })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
|
|
280
280
|
if (details.checked === 'indeterminate')
|
|
281
281
|
return;
|
|
282
282
|
o.field.onChange(details.checked);
|
|
@@ -302,10 +302,10 @@ export function SignUpKYCForm() {
|
|
|
302
302
|
globalStore.responsibleGaming.setNext('SIGN_UP');
|
|
303
303
|
globalStore.signUp.setOpen(false);
|
|
304
304
|
}
|
|
305
|
-
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "
|
|
305
|
+
}, children: "Responsible Gaming" }), ' ', "guidelines."] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-xs pb-8 text-sm", children: [_jsx("span", { className: "text-text-tertiary-600", children: "Already have an account?" }), _jsx("button", { type: "submit", className: "font-semibold text-button-tertiary-fg", onClick: () => {
|
|
306
306
|
dialog.setOpen(false);
|
|
307
307
|
globalStore.signIn.setOpen(true);
|
|
308
|
-
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center text-lg
|
|
308
|
+
}, children: "Log In" })] })] })), step === 2 && (_jsxs(_Fragment, { children: [_jsx("h2", { className: "mt-xl text-center font-semibold text-lg", children: "Check your Phone" }), _jsxs("p", { className: "mt-xs text-center text-sm text-text-secondary-700", children: ["We\u2019ve sent a verification code to your mobile number", ' ', _jsx("span", { className: "font-semibold", children: mobileNumberParser.format(step1Form.getValues('mobileNumber')) }), ' ', "via text"] }), _jsxs("form", { ref: form2Ref, className: "mt-5", onSubmit: step2Form.handleSubmit(async ({ verificationCode }) => {
|
|
309
309
|
const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
310
310
|
const { mobileNumber } = step1Form.getValues();
|
|
311
311
|
try {
|
|
@@ -437,7 +437,7 @@ export function SignUpKYCForm() {
|
|
|
437
437
|
o.field.onChange(details.value);
|
|
438
438
|
}, onValueComplete: () => {
|
|
439
439
|
form2Ref.current?.requestSubmit();
|
|
440
|
-
}, children: [_jsxs(PinInput.Control, { className: "
|
|
440
|
+
}, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "font-medium text-2xl text-text-placeholder-subtle", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "font-semibold text-button-secondary-fg disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
|
|
441
441
|
await sendVerificationCodeMutation.mutateAsync({
|
|
442
442
|
channel: 'SMS',
|
|
443
443
|
recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
|
|
@@ -445,7 +445,7 @@ export function SignUpKYCForm() {
|
|
|
445
445
|
cooldown.start();
|
|
446
446
|
}, children: cooldown.cooling
|
|
447
447
|
? `Resend in ${cooldown.countdown}s`
|
|
448
|
-
: 'Resend' })] }), _jsxs("button", { type: "button", className: "
|
|
448
|
+
: 'Resend' })] }), _jsxs("button", { type: "button", className: "mx-auto mt-3xl flex w-fit items-center gap-1 font-semibold text-sm text-text-tertiary-600", onClick: () => {
|
|
449
449
|
setStep(1);
|
|
450
450
|
step2Form.reset();
|
|
451
451
|
cooldown.stop();
|
|
@@ -30,7 +30,7 @@ export function TermsAndConditions({ logo, siteName, content, ...props }) {
|
|
|
30
30
|
globalStore.disclaimer.setOpen(true);
|
|
31
31
|
}
|
|
32
32
|
globalStore.termsAndConditions.setNext(null);
|
|
33
|
-
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: twMerge('
|
|
33
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: twMerge('flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:max-h-[80vh] lg:w-[400px]', 'scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent'), 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: "mt-3xl text-center font-semibold text-brand-400 text-lg", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "mt-xs text-sm leading-2xl", children: content }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[5.5rem] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[3.875rem] w-auto shrink-0", draggable: false })] })] }), _jsx(Dialog.Context, { children: (api) => (_jsx(Button, { type: "button", className: "mt-3 py-2.5", onClick: () => {
|
|
34
34
|
api.setOpen(false);
|
|
35
35
|
}, children: "I Agree" })) })] }) })] }) }));
|
|
36
36
|
}
|