@opexa/portal-components 0.0.303 → 0.0.304

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.
Files changed (122) hide show
  1. package/dist/client/hooks/useGlobalStore.d.ts +8 -0
  2. package/dist/client/hooks/useGlobalStore.js +21 -0
  3. package/dist/components/Banner/Banner.client.d.ts +12 -0
  4. package/dist/components/Banner/Banner.client.js +49 -0
  5. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +26 -13
  6. package/dist/components/DepositWithdrawal/HasPendingBonuses.d.ts +5 -0
  7. package/dist/components/DepositWithdrawal/HasPendingBonuses.js +22 -0
  8. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +5 -0
  9. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +6 -2
  10. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +5 -0
  11. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +5 -0
  12. package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +5 -0
  13. package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +5 -0
  14. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
  15. package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
  16. package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
  17. package/dist/components/Disclaimer/TermsOfUse.js +13 -0
  18. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  19. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  20. package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
  21. package/dist/components/KYC/CaptureIdDocument.js +219 -0
  22. package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
  23. package/dist/components/KYC/CaptureSelfie.js +285 -0
  24. package/dist/components/KYC/DisplayImage.d.ts +5 -0
  25. package/dist/components/KYC/DisplayImage.js +8 -0
  26. package/dist/components/KYC/FileUpload.d.ts +10 -0
  27. package/dist/components/KYC/FileUpload.js +72 -0
  28. package/dist/components/KYC/NoCameraError.d.ts +7 -0
  29. package/dist/components/KYC/NoCameraError.js +6 -0
  30. package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
  31. package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
  32. package/dist/components/KYC/utils.d.ts +9 -0
  33. package/dist/components/KYC/utils.js +79 -0
  34. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
  35. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
  36. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
  37. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
  38. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
  39. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
  40. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
  41. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
  42. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
  43. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
  44. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
  45. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
  46. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
  47. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
  48. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
  49. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
  50. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
  51. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
  52. package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
  53. package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
  54. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  55. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  56. package/dist/constants/EnvVar.d.ts +1 -1
  57. package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
  58. package/dist/handlers/postTransformIdFrontImage.js +82 -0
  59. package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
  60. package/dist/handlers/postTransformSelfieImage.js +82 -0
  61. package/dist/next.config.js +11 -36
  62. package/dist/services/queries.js +2639 -2639
  63. package/dist/styles/theme.css +706 -706
  64. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  65. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  66. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  67. package/dist/third-parties/FacebookPixel/api.js +1 -0
  68. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  69. package/dist/third-parties/FacebookPixel/index.js +1 -0
  70. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  71. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  72. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  73. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  74. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  75. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  76. package/dist/third-parties/index.d.ts +2 -0
  77. package/dist/third-parties/index.js +2 -0
  78. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  79. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  80. package/dist/ui/Badge/Badge.d.ts +12 -12
  81. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  82. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  83. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  84. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  85. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  86. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  87. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  88. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  89. package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
  90. package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
  91. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  92. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  93. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  94. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  95. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  96. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  97. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  98. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  99. package/dist/ui/Menu/Menu.d.ts +144 -144
  100. package/dist/ui/Menu/menu.recipe.d.ts +8 -8
  101. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  102. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  103. package/dist/ui/Popover/Popover.d.ts +55 -55
  104. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  105. package/dist/ui/Progress/Progress.d.ts +27 -27
  106. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  107. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  108. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  109. package/dist/ui/Select/Select.d.ts +45 -45
  110. package/dist/ui/Select/select.recipe.d.ts +3 -3
  111. package/dist/ui/Table/Table.d.ts +21 -21
  112. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  113. package/dist/ui/Table/table.recipe.d.ts +3 -3
  114. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  115. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  116. package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
  117. package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
  118. package/dist/utils/getGameName.d.ts +1 -0
  119. package/dist/utils/getGameName.js +6 -0
  120. package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
  121. package/dist/utils/isBetween3amAnd3pm.js +5 -0
  122. package/package.json +164 -164
@@ -53,6 +53,13 @@ export interface TermsOfUseStore extends TermsAndConditionsStore {
53
53
  }
54
54
  export interface ResponsibleGamingStore extends TermsAndConditionsStore {
55
55
  }
56
+ export interface HasPendingBonusStore {
57
+ open: boolean;
58
+ setOpen: (open: boolean) => void;
59
+ '~touched': boolean;
60
+ shouldShowWarning: boolean;
61
+ setShouldShowWarning: (shouldShow: boolean) => void;
62
+ }
56
63
  export interface GlobalStore {
57
64
  signUp: PopupStore;
58
65
  signIn: PopupStore;
@@ -73,6 +80,7 @@ export interface GlobalStore {
73
80
  termsAndConditions: TermsAndConditionsStore;
74
81
  termsOfUse: TermsOfUseStore;
75
82
  responsibleGaming: ResponsibleGamingStore;
83
+ pendingBonus: HasPendingBonusStore;
76
84
  }
77
85
  export declare const useGlobalStore: import("zustand").UseBoundStore<import("zustand").StoreApi<GlobalStore>>;
78
86
  export {};
@@ -371,4 +371,25 @@ export const useGlobalStore = create((set) => ({
371
371
  },
372
372
  '~touched': false,
373
373
  },
374
+ pendingBonus: {
375
+ open: false,
376
+ setOpen(open) {
377
+ set((prev) => ({
378
+ pendingBonus: {
379
+ ...prev.pendingBonus,
380
+ open,
381
+ '~touched': true,
382
+ },
383
+ }));
384
+ },
385
+ shouldShowWarning: false,
386
+ setShouldShowWarning: (shouldShowWarning) => set((state) => ({
387
+ pendingBonus: {
388
+ ...state.pendingBonus,
389
+ shouldShowWarning,
390
+ '~touched': true,
391
+ },
392
+ })),
393
+ '~touched': false,
394
+ },
374
395
  }));
@@ -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
+ }
@@ -1,8 +1,9 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { twMerge } from 'tailwind-merge';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useEffect } from 'react';
4
4
  import { z } from 'zod';
5
5
  import { useShallow } from 'zustand/shallow';
6
+ import { useBonusesQuery } from '../../client/hooks/useBonusesQuery.js';
6
7
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
7
8
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
8
9
  import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
@@ -15,24 +16,36 @@ import { Tabs } from '../../ui/Tabs/index.js';
15
16
  import { formatNumber } from '../../utils/formatNumber.js';
16
17
  import { Deposit } from './Deposit/Deposit.js';
17
18
  import { DepositWithdrawalPropsProvider } from './DepositWithdrawalContext.js';
19
+ import HasPendingBonuses from './HasPendingBonuses.js';
18
20
  import { Withdrawal } from './Withdrawal/Withdrawal.js';
19
21
  export function DepositWithdrawal(props) {
20
22
  const globalStore = useGlobalStore(useShallow((ctx) => ({
21
23
  depositWithdrawal: ctx.depositWithdrawal,
24
+ pendingBonus: ctx.pendingBonus,
22
25
  })));
26
+ const bonusesQuery = useBonusesQuery();
27
+ const hasPendingBonus = Boolean(bonusesQuery?.data &&
28
+ bonusesQuery?.data?.length > 0 &&
29
+ bonusesQuery.data?.some((bonus) => +bonus.currentTurnoverRequirementContributionPercentage < 100));
23
30
  const localeInfo = useLocaleInfo();
24
31
  const walletQuery = useWalletQuery({
25
32
  refetchInterval: 5000,
26
33
  });
27
- return (_jsx(DepositWithdrawalPropsProvider, { value: props, children: _jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: globalStore.depositWithdrawal.open, onOpenChange: (details) => {
28
- globalStore.depositWithdrawal.setOpen(details.open);
29
- if (!details.open) {
30
- globalStore.depositWithdrawal.setPromo(null);
31
- }
32
- }, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)]", children: _jsxs(Dialog.Content, { className: twMerge('py-3xl mx-auto h-full w-full overflow-y-auto px-4 lg:min-h-[80vh] lg:w-[480px] lg:rounded-xl', 'scrollbar-thumb:bg-bg-quaternary scrollbar-track:bg-transparent scrollbar:h-2 scrollbar:w-2 scrollbar-thumb:rounded-full'), children: [_jsxs(Dialog.Header, { className: "gap-xl flex items-center", children: [_jsx("div", { className: "border-border-primary shadow-xs text-text-secondary-700 flex size-10 items-center justify-center rounded-md border text-gray-700", children: _jsx(Wallet02Icon, { className: "size-5" }) }), _jsx(Dialog.Title, { className: "grow text-lg font-semibold", children: "Wallet" }), _jsx(Dialog.Context, { children: (api) => (_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, {}) })) })] }), _jsxs(Dialog.Body, { className: "mt-3xl", children: [_jsx("p", { className: "text-text-secondary-700 text-center text-sm", children: "Deposit Balance" }), _jsx("p", { className: "text-center text-3xl font-bold leading-tight tracking-tight", children: formatNumber(walletQuery.data?.balance, {
33
- currency: localeInfo.currency.code,
34
- minDecimalPlaces: 2,
35
- }) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: (details) => {
36
- globalStore.depositWithdrawal.setTab(z.enum(['DEPOSIT', 'WITHDRAWAL']).parse(details.value));
37
- }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }));
34
+ //check if the user has pending/ongoing bonuses
35
+ useEffect(() => {
36
+ if (hasPendingBonus && !globalStore.pendingBonus.shouldShowWarning) {
37
+ globalStore.pendingBonus.setShouldShowWarning(hasPendingBonus);
38
+ }
39
+ }, [hasPendingBonus]);
40
+ return (_jsxs(_Fragment, { children: [_jsx(DepositWithdrawalPropsProvider, { value: props, children: _jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: globalStore.depositWithdrawal.open, onOpenChange: (details) => {
41
+ globalStore.depositWithdrawal.setOpen(details.open);
42
+ if (!details.open) {
43
+ globalStore.depositWithdrawal.setPromo(null);
44
+ }
45
+ }, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)]", children: _jsxs(Dialog.Content, { className: "lg:min-h-auto py-3xl mx-auto min-h-full w-full overflow-y-auto px-4 lg:w-[480px] lg:rounded-xl", children: [_jsxs(Dialog.Header, { className: "gap-xl flex items-center", children: [_jsx("div", { className: "border-border-primary shadow-xs text-text-secondary-700 flex size-10 items-center justify-center rounded-md border text-gray-700", children: _jsx(Wallet02Icon, { className: "size-5" }) }), _jsx(Dialog.Title, { className: "grow text-lg font-semibold", children: "Wallet" }), _jsx(Dialog.Context, { children: (api) => (_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, {}) })) })] }), _jsxs(Dialog.Body, { className: "mt-3xl", children: [_jsx("p", { className: "text-text-secondary-700 text-center text-sm", children: "Deposit Balance" }), _jsx("p", { className: "text-center text-3xl font-bold leading-tight tracking-tight", children: formatNumber(walletQuery.data?.balance, {
46
+ currency: localeInfo.currency.code,
47
+ minDecimalPlaces: 2,
48
+ }) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: (details) => {
49
+ globalStore.depositWithdrawal.setTab(z.enum(['DEPOSIT', 'WITHDRAWAL']).parse(details.value));
50
+ }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }), _jsx(HasPendingBonuses, {})] }));
38
51
  }
@@ -0,0 +1,5 @@
1
+ interface Props {
2
+ className?: string;
3
+ }
4
+ declare function HasPendingBonuses(props: Props): import("react/jsx-runtime").JSX.Element;
5
+ export default HasPendingBonuses;
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { useShallow } from 'zustand/shallow';
5
+ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
+ import { AlertTriangleIcon } from '../../icons/AlertTriangle.js';
7
+ import { XIcon } from '../../icons/XIcon.js';
8
+ import { Button } from '../../ui/Button/index.js';
9
+ import { Dialog } from '../../ui/Dialog/index.js';
10
+ import { Portal } from '../../ui/Portal/index.js';
11
+ function HasPendingBonuses(props) {
12
+ const hasPendingBonusStore = useGlobalStore(useShallow((ctx) => ctx.pendingBonus));
13
+ return (_jsx(Dialog.Root, { open: hasPendingBonusStore.open, onOpenChange: (details) => {
14
+ hasPendingBonusStore.setOpen(details.open);
15
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-tooltip flex items-center justify-center", children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt p-3xl pb-4xl mx-auto h-fit w-[90vw] overflow-y-auto rounded-2xl text-center lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx("div", { className: "mb-xl bg-bg-warning-secondary mx-auto flex w-fit items-center justify-center rounded-full p-3", children: _jsx(AlertTriangleIcon, { className: "size-6 text-[#FEDF89]" }) }), _jsx("h1", { className: "text-text-primary-900 text-lg font-semibold", children: "Confirm Promo Cancellation" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Proceeding will cancel the promo and result in the loss of your active bonus. Do you want to continue?" }), _jsxs(Dialog.Footer, { className: "mt-4xl flex items-center gap-2", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => {
16
+ hasPendingBonusStore.setOpen(false);
17
+ }, children: "No" }), _jsx(Button, { type: "submit", onClick: () => {
18
+ hasPendingBonusStore.setOpen(false);
19
+ hasPendingBonusStore.setShouldShowWarning(false);
20
+ }, children: "Yes" })] })] }) })] }) }));
21
+ }
22
+ export default HasPendingBonuses;
@@ -31,6 +31,7 @@ export function GCashWithdrawal() {
31
31
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
32
32
  const globalStore = useGlobalStore(useShallow((ctx) => ({
33
33
  depositWithdrawal: ctx.depositWithdrawal,
34
+ hasPendingBonus: ctx.pendingBonus,
34
35
  })));
35
36
  const [status, setStatus] = useState('waiting');
36
37
  const localeInfo = useLocaleInfo();
@@ -101,6 +102,10 @@ export function GCashWithdrawal() {
101
102
  }
102
103
  }, [form, minimumAmount]);
103
104
  const handleSubmit = form.handleSubmit(async (data) => {
105
+ if (globalStore.hasPendingBonus.shouldShowWarning) {
106
+ globalStore.hasPendingBonus.setOpen(true);
107
+ return;
108
+ }
104
109
  createWithdrawalMutation.mutate({
105
110
  amount: data.amount,
106
111
  recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
@@ -37,6 +37,7 @@ export function InstapayWithdrawal() {
37
37
  const { enabled } = useFeatureFlag();
38
38
  const globalStore = useGlobalStore(useShallow((ctx) => ({
39
39
  depositWithdrawal: ctx.depositWithdrawal,
40
+ hasPendingBonus: ctx.pendingBonus,
40
41
  })));
41
42
  const [status, setStatus] = useState('waiting');
42
43
  const createWithdrawalMutation = useCreateInstapayWithdrawalMutation({
@@ -59,8 +60,7 @@ export function InstapayWithdrawal() {
59
60
  form.reset();
60
61
  setStatus('success');
61
62
  },
62
- onError(err) {
63
- console.log(err, 'error');
63
+ onError() {
64
64
  setStatus('failed');
65
65
  },
66
66
  });
@@ -137,6 +137,10 @@ export function InstapayWithdrawal() {
137
137
  }
138
138
  }, [form, instapayBankList]);
139
139
  const handleSubmit = form.handleSubmit(async (data) => {
140
+ if (globalStore.hasPendingBonus.shouldShowWarning) {
141
+ globalStore.hasPendingBonus.setOpen(true);
142
+ return;
143
+ }
140
144
  if (enabled) {
141
145
  createWithdrawalNextMutation.mutate({
142
146
  amount: data.amount,
@@ -29,6 +29,7 @@ export function MayaAppWithdrawal() {
29
29
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
30
30
  const globalStore = useGlobalStore(useShallow((ctx) => ({
31
31
  depositWithdrawal: ctx.depositWithdrawal,
32
+ pendingBonus: ctx.pendingBonus,
32
33
  })));
33
34
  const [status, setStatus] = useState('waiting');
34
35
  const createWithdrawalMutation = useCreateMayaAppWithdrawalMutation({
@@ -92,6 +93,10 @@ export function MayaAppWithdrawal() {
92
93
  }
93
94
  }, [form, minimumAmount]);
94
95
  const handleSubmit = form.handleSubmit(async (data) => {
96
+ if (globalStore.pendingBonus.shouldShowWarning) {
97
+ globalStore.pendingBonus.setOpen(true);
98
+ return;
99
+ }
95
100
  createWithdrawalMutation.mutate({
96
101
  amount: data.amount,
97
102
  transactionPassword: data.password,
@@ -31,6 +31,7 @@ export function MayaWithdrawal() {
31
31
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
32
32
  const globalStore = useGlobalStore(useShallow((ctx) => ({
33
33
  depositWithdrawal: ctx.depositWithdrawal,
34
+ hasPendingBonus: ctx.pendingBonus,
34
35
  })));
35
36
  const [status, setStatus] = useState('waiting');
36
37
  const localeInfo = useLocaleInfo();
@@ -101,6 +102,10 @@ export function MayaWithdrawal() {
101
102
  }
102
103
  }, [form, minimumAmount]);
103
104
  const handleSubmit = form.handleSubmit(async (data) => {
105
+ if (globalStore.hasPendingBonus.shouldShowWarning) {
106
+ globalStore.hasPendingBonus.setOpen(true);
107
+ return;
108
+ }
104
109
  createWithdrawalMutation.mutate({
105
110
  amount: data.amount,
106
111
  recipientMobileNumber: mobileNumberParser.format(data.mobileNumber),
@@ -33,6 +33,7 @@ export function PisoPayWithdrawal() {
33
33
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
34
34
  const globalStore = useGlobalStore(useShallow((ctx) => ({
35
35
  depositWithdrawal: ctx.depositWithdrawal,
36
+ pendingBonus: ctx.pendingBonus,
36
37
  })));
37
38
  const [status, setStatus] = useState('waiting');
38
39
  const createWithdrawalMutation = useCreatePisoPayWithdrawalMutation({
@@ -115,6 +116,10 @@ export function PisoPayWithdrawal() {
115
116
  }
116
117
  }, [form]);
117
118
  const handleSubmit = form.handleSubmit(async (data) => {
119
+ if (globalStore.pendingBonus.shouldShowWarning) {
120
+ globalStore.pendingBonus.setOpen(true);
121
+ return;
122
+ }
118
123
  createWithdrawalMutation.mutate({
119
124
  amount: data.amount,
120
125
  transactionPassword: data.password,
@@ -33,6 +33,7 @@ export function VentajaWithdrawal() {
33
33
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
34
34
  const globalStore = useGlobalStore(useShallow((ctx) => ({
35
35
  depositWithdrawal: ctx.depositWithdrawal,
36
+ pendingBonus: ctx.pendingBonus,
36
37
  })));
37
38
  const [status, setStatus] = useState('waiting');
38
39
  const createWithdrawalMutation = useCreateVentajaDisbursementWithdrawalMutation({
@@ -114,6 +115,10 @@ export function VentajaWithdrawal() {
114
115
  }
115
116
  }, [form, instapayBankList]);
116
117
  const handleSubmit = form.handleSubmit(async (data) => {
118
+ if (globalStore.pendingBonus.shouldShowWarning) {
119
+ globalStore.pendingBonus.setOpen(true);
120
+ return;
121
+ }
117
122
  createWithdrawalMutation.mutate({
118
123
  input: {
119
124
  amount: data.amount,
@@ -0,0 +1,10 @@
1
+ import { type ImageProps } from 'next/image';
2
+ import type { ReactNode } from 'react';
3
+ export interface ResponsibleGamingProps {
4
+ responsibleGamingContent: string | ReactNode;
5
+ logo: ImageProps['src'];
6
+ open: boolean;
7
+ onCloseAction: () => void;
8
+ responsibleGamingLogo?: ImageProps['src'];
9
+ }
10
+ export declare function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }: ResponsibleGamingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image, {} from 'next/image';
4
+ import pagcorLogo from '../../images/pagcor.png';
5
+ import responsibleGamingLogo from '../../images/responsible-gaming.png';
6
+ import { Button } from '../../ui/Button/index.js';
7
+ import { Dialog } from '../../ui/Dialog/index.js';
8
+ import { Portal } from '../../ui/Portal/index.js';
9
+ export function ResponsibleGaming({ logo, open, responsibleGamingContent, onCloseAction, ...props }) {
10
+ return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsx(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: "Responsible Gaming" }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: responsibleGamingContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
11
+ onCloseAction();
12
+ }, children: "I Agree" }) })] }) })] }) }));
13
+ }
@@ -0,0 +1,11 @@
1
+ import { type ImageProps } from 'next/image';
2
+ import type { ReactNode } from 'react';
3
+ export interface TermsOfUseProps {
4
+ logo: ImageProps['src'];
5
+ open: boolean;
6
+ onCloseAction: () => void;
7
+ termsOfUseContent: string | ReactNode;
8
+ siteName: string;
9
+ responsibleGamingLogo?: ImageProps['src'];
10
+ }
11
+ export declare function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }: TermsOfUseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image, {} from 'next/image';
4
+ import pagcorLogo from '../../images/pagcor.png';
5
+ import responsibleGamingLogo from '../../images/responsible-gaming.png';
6
+ import { Button } from '../../ui/Button/index.js';
7
+ import { Dialog } from '../../ui/Dialog/index.js';
8
+ import { Portal } from '../../ui/Portal/index.js';
9
+ export function TermsOfUse({ logo, open, onCloseAction, siteName, termsOfUseContent, ...props }) {
10
+ return (_jsx(Dialog.Root, { open: open, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "z-popover" }), _jsx(Dialog.Positioner, { className: "z-popover", children: _jsxs(Dialog.Content, { className: "flex h-full w-full flex-col items-start overflow-y-auto p-3xl lg:mx-auto lg:h-auto lg:w-[400px] lg:rounded-xl", children: [_jsx(Image, { src: logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsxs("div", { className: "w-full grow", children: [_jsxs(Dialog.Title, { className: "text-brand-400 mt-3xl text-center text-lg font-semibold", children: [siteName, " Terms of Use"] }), _jsx(Dialog.Description, { className: "leading-2xl mt-xs text-sm", children: termsOfUseContent }), _jsxs("div", { className: "mt-5 flex items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "", height: 75, width: 88, className: "h-[88px] w-auto shrink-0", draggable: false }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "", height: 62, width: 186, className: "h-[62px] w-auto shrink-0", draggable: false })] })] }), _jsx("div", { className: "w-full", children: _jsx(Button, { type: "button", className: "mt-3", onClick: () => {
11
+ onCloseAction();
12
+ }, children: "I Agree" }) })] }) })] }) }));
13
+ }