@opexa/portal-components 0.0.93 → 0.0.95

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 (75) hide show
  1. package/dist/client/hooks/index.d.ts +2 -0
  2. package/dist/client/hooks/index.js +2 -0
  3. package/dist/client/hooks/useBonusesCountQuery.d.ts +2 -0
  4. package/dist/client/hooks/useBonusesCountQuery.js +27 -0
  5. package/dist/client/hooks/useCashbackBonusesCountQuery.d.ts +2 -0
  6. package/dist/client/hooks/useCashbackBonusesCountQuery.js +26 -0
  7. package/dist/client/hooks/useClaimCashbackBonusMutation.js +4 -1
  8. package/dist/components/Account/Account.js +13 -4
  9. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  10. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  11. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  12. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  13. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +3 -2
  14. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +3 -1
  15. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +13 -2
  16. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +10 -2
  17. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +7 -1
  18. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +2 -2
  19. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +7 -1
  20. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +2 -2
  21. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +19 -2
  22. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +26 -2
  23. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.d.ts +17 -2
  24. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +17 -6
  25. package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +19 -2
  26. package/dist/components/Tournaments/TournamentsList/TournamentsList.js +36 -2
  27. package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.d.ts +19 -1
  28. package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +18 -6
  29. package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.d.ts +19 -1
  30. package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +16 -4
  31. package/dist/server/utils/index.d.ts +2 -0
  32. package/dist/server/utils/index.js +2 -0
  33. package/dist/server/utils/prefetchBonusesCountQuery.d.ts +1 -0
  34. package/dist/server/utils/prefetchBonusesCountQuery.js +19 -0
  35. package/dist/server/utils/prefetchCashbackBonusesCountQuery.d.ts +1 -0
  36. package/dist/server/utils/prefetchCashbackBonusesCountQuery.js +19 -0
  37. package/dist/services/queries.d.ts +2 -0
  38. package/dist/services/queries.js +14 -0
  39. package/dist/services/wallet.service.d.ts +13 -1
  40. package/dist/services/wallet.service.js +10 -2
  41. package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
  42. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
  43. package/dist/ui/Badge/Badge.d.ts +12 -12
  44. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  45. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  46. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  47. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  48. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  49. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  50. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  51. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  52. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  53. package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
  54. package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
  55. package/dist/ui/Dialog/Dialog.d.ts +88 -88
  56. package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
  57. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  58. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  59. package/dist/ui/Field/Field.d.ts +21 -21
  60. package/dist/ui/Field/field.recipe.d.ts +3 -3
  61. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  62. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  63. package/dist/ui/Popover/Popover.d.ts +121 -121
  64. package/dist/ui/Popover/popover.recipe.d.ts +11 -11
  65. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  66. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  67. package/dist/ui/Select/Select.d.ts +45 -45
  68. package/dist/ui/Select/select.recipe.d.ts +3 -3
  69. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  70. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  71. package/dist/utils/isStyleEntries.d.ts +1 -1
  72. package/dist/utils/isStyleEntries.js +1 -1
  73. package/dist/utils/queryKeys.d.ts +2 -0
  74. package/dist/utils/queryKeys.js +4 -0
  75. package/package.json +1 -1
@@ -1,12 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isString } from 'lodash-es';
3
4
  import Image from 'next/image';
4
5
  import { useTournamentsQuery } from '../../../client/hooks/index.js';
5
6
  import closeChest from '../../../images/close-chest.png';
7
+ import { isStyleEntries } from '../../../utils/index.js';
6
8
  import { TournamentsListItemContext, TournamentsListPropsContext, } from './TournamentsListContext.js';
7
9
  import { TournamentsListItemDesktop } from './TournamentsListItemDesktop.js';
8
10
  import { TournamentsListItemMobile } from './TournamentsListItemMobile.js';
9
- export function TournamentsList(props) {
11
+ export function TournamentsList({ style, className, ...props }) {
10
12
  const tournamentsQuery = useTournamentsQuery({
11
13
  first: 100,
12
14
  filter: {
@@ -16,5 +18,37 @@ export function TournamentsList(props) {
16
18
  },
17
19
  });
18
20
  const tournaments = tournamentsQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
19
- return (_jsx(TournamentsListPropsContext, { value: props, children: _jsxs("div", { className: props.className, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemDesktop, {}) }, tournament.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemMobile, {}) }, tournament.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
21
+ const styles = isStyleEntries(style, [
22
+ 'root',
23
+ 'itemRoot',
24
+ 'itemBadgeRoot',
25
+ 'itemBadgeLabel',
26
+ 'itemBadgeIcon',
27
+ ])
28
+ ? style
29
+ : { root: style };
30
+ const classNames = isString(className)
31
+ ? { root: className }
32
+ : (className ?? {});
33
+ return (_jsx(TournamentsListPropsContext, { value: props, children: _jsxs("div", { style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 text-lg font-semibold lg:mb-4.5", children: props.heading ?? 'Tournaments' }), tournaments.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemDesktop, { style: {
34
+ root: styles.itemRoot,
35
+ badgeIcon: styles.itemBadgeIcon,
36
+ badgeRoot: styles.itemBadgeRoot,
37
+ badgeLabel: styles.itemBadgeLabel,
38
+ }, className: {
39
+ root: classNames.itemRoot,
40
+ badgeRoot: classNames.itemBadgeRoot,
41
+ badgeLabel: classNames.itemBadgeLabel,
42
+ badgeIcon: classNames.itemBadgeIcon,
43
+ } }) }, tournament.id))) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: tournaments.map((tournament) => (_jsx(TournamentsListItemContext, { value: tournament, children: _jsx(TournamentsListItemMobile, { style: {
44
+ root: styles.itemRoot,
45
+ badgeIcon: styles.itemBadgeIcon,
46
+ badgeRoot: styles.itemBadgeRoot,
47
+ badgeLabel: styles.itemBadgeLabel,
48
+ }, className: {
49
+ root: classNames.itemRoot,
50
+ badgeRoot: classNames.itemBadgeRoot,
51
+ badgeLabel: classNames.itemBadgeLabel,
52
+ badgeIcon: classNames.itemBadgeIcon,
53
+ } }) }, tournament.id))) })] })) : (_jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", quality: 100, className: "h-29.5 w-29.5 lg:h-25 lg:w-25 size-full mix-blend-luminosity" }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Tournaments' }), _jsxs("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: ["No ", props.heading?.toLocaleLowerCase() ?? 'tournaments', " are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
20
54
  }
@@ -1 +1,19 @@
1
- export declare function TournamentsListItemDesktop(): import("react/jsx-runtime").JSX.Element;
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ badgeRoot?: string;
5
+ badgeLabel?: string;
6
+ badgeIcon?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ badgeRoot?: CSSProperties;
11
+ badgeLabel?: CSSProperties;
12
+ badgeIcon?: CSSProperties;
13
+ }
14
+ interface TournamentsListItemDesktopProps {
15
+ style?: CSSProperties | StyleEntries;
16
+ className?: string | ClassNameEntries;
17
+ }
18
+ export declare function TournamentsListItemDesktop({ style, className, }: TournamentsListItemDesktopProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -1,21 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { isString } from 'lodash-es';
2
3
  import Image from 'next/image';
3
- import React from 'react';
4
+ import React, {} from 'react';
4
5
  import { twMerge } from 'tailwind-merge';
5
6
  import { Award01Icon, StarIcon, Trophy01Icon, User01Icon, } from '../../../icons/index.js';
6
7
  import firstPlace from '../../../images/first-place.png';
7
8
  import trophyTwo from '../../../images/trophy-two.png';
8
9
  import trophy from '../../../images/trophy.png';
9
- import { formatNumber, mask } from '../../../utils/index.js';
10
- import styles from './TournamentItem.module.css';
10
+ import { formatNumber, isStyleEntries, mask } from '../../../utils/index.js';
11
+ import css from './TournamentItem.module.css';
11
12
  import { useTournamentsListItemContext } from './TournamentsListContext.js';
12
13
  import { TournamentsListItemGameProviders } from './TournamentsListItemGameProviders.js';
13
14
  import { TournamentsListItemRules } from './TournamentsListItemRules.js';
14
15
  import { useTournamentsListItemData } from './useTournamentListItemData.js';
15
- export function TournamentsListItemDesktop() {
16
+ export function TournamentsListItemDesktop({ style, className, }) {
16
17
  const tournament = useTournamentsListItemContext();
17
18
  const { prizeAmountsByRank, timeParts, tournamentReward, filteredGameProviders, localeInfo, } = useTournamentsListItemData();
18
- return (_jsxs("div", { className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border'), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-6 lg:p-5'), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
+ const styles = isStyleEntries(style, [
20
+ 'root',
21
+ 'badgeRoot',
22
+ 'badgeLabel',
23
+ 'badgeIcon',
24
+ ])
25
+ ? style
26
+ : { root: style };
27
+ const classNames = isString(className)
28
+ ? { root: className }
29
+ : (className ?? {});
30
+ return (_jsxs("div", { style: styles.root, className: twMerge('bg-bg-tertiary border-border-primary rounded-2xl border', classNames.root), children: [_jsxs("div", { className: twMerge('relative flex shrink-0 p-3 text-center lg:gap-6 lg:p-5'), children: [_jsx("div", { className: "z-1 relative flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('text-utility-brand-500 size-3.5', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-1 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
31
  currency: localeInfo.currency.code,
20
32
  minDecimalPlaces: 2,
21
33
  maxDecimalPlaces: 2,
@@ -25,7 +37,7 @@ export function TournamentsListItemDesktop() {
25
37
  maxDecimalPlaces: 2,
26
38
  }) })] })] }) })) : (_jsxs("div", { className: "bg-bg-primary relative mt-4 hidden w-full gap-4 rounded-lg p-4 lg:flex", children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[66px] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-sm border px-2 py-0.5 text-xs font-medium", children: [_jsx(Trophy01Icon, { className: "text-utility-brand-600 size-3.5" }), "Top Payout"] }), _jsx("div", { className: "font-semibold", children: "No winners yet" }), _jsx("div", { className: "text-text-secondary-700 text-xs", children: "You could be the first to win the tournament!" })] })] }))] }) }) }) }), _jsxs("div", { className: "z-1 hidden flex-1 space-y-4 lg:block", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { width: 24, height: 24, src: trophyTwo, quality: 100, alt: "leaderboardIcon", className: "size-full w-6" }), _jsx("div", { className: "text-text-primary-900 text-lg font-semibold", children: tournament.currentLeaderboard.edges.length
27
39
  ? 'Leaderboard'
28
- : 'Starting soon!' })] }), _jsx(TournamentsListItemRules, {})] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', styles['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
40
+ : 'Starting soon!' })] }), _jsx(TournamentsListItemRules, {})] }), _jsx("div", { className: twMerge('max-h-[272px] overflow-y-scroll', css['scrollArea']), children: _jsx("div", { className: "border-gray-200 overflow-hidden rounded-xl", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-bg-secondary text-text-tertiary-600 h-8 text-xs font-medium", children: [_jsx("th", { className: "w-[52px]", children: "#" }), _jsx("th", { children: "Player" }), _jsx("th", { children: "Multiplier" }), _jsx("th", { children: "Prize" })] }) }), _jsx("tbody", { children: tournament.currentLeaderboard.edges.length ? (_jsx(_Fragment, { children: tournament.currentLeaderboard.edges.map((tournament, i) => (_jsxs("tr", { className: "bg-bg-primary text-text-secondary-700 text-sm", children: [_jsx("td", { className: "border-border-secondary h-12 w-[52px] border-t-2", children: i + 1 < 6 ? (_jsxs("div", { className: "relative", children: [_jsx(StarIcon, { className: twMerge('mx-auto size-6.5', starTierStyles[i].starColor) }), _jsx("span", { className: twMerge('absolute inset-0 mt-0.5 flex items-center justify-center text-2xs font-bold', starTierStyles[i].numberColor), children: i + 1 })] })) : (i + 1) }), _jsx("td", { className: "border-border-secondary h-12 border-t-2", children: mask(tournament.node.username) }), _jsxs("td", { className: "border-border-secondary h-12 border-t-2", children: [tournament.node.multiplier, "x"] }), i + 1 <= prizeAmountsByRank.length ? (_jsx("td", { className: "border-border-secondary text-brand-400 h-12 border-t-2", children: formatNumber(prizeAmountsByRank[i], {
29
41
  currency: localeInfo.currency.code,
30
42
  minDecimalPlaces: 2,
31
43
  maxDecimalPlaces: 2,
@@ -1 +1,19 @@
1
- export declare function TournamentsListItemMobile(): import("react/jsx-runtime").JSX.Element;
1
+ import { type CSSProperties } from 'react';
2
+ interface ClassNameEntries {
3
+ root?: string;
4
+ badgeRoot?: string;
5
+ badgeLabel?: string;
6
+ badgeIcon?: string;
7
+ }
8
+ interface StyleEntries {
9
+ root?: CSSProperties;
10
+ badgeRoot?: CSSProperties;
11
+ badgeLabel?: CSSProperties;
12
+ badgeIcon?: CSSProperties;
13
+ }
14
+ interface TournamentsListItemMobileProps {
15
+ style?: CSSProperties | StyleEntries;
16
+ className?: string | ClassNameEntries;
17
+ }
18
+ export declare function TournamentsListItemMobile({ style, className, }: TournamentsListItemMobileProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -1,21 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { isString } from 'lodash-es';
2
3
  import Image from 'next/image';
3
- import React, { useState } from 'react';
4
+ import { Fragment, useState } from 'react';
4
5
  import { twMerge } from 'tailwind-merge';
5
6
  import { ArrowNarrowDownIcon, ArrowNarrowUpIcon, Award01Icon, StarIcon, Trophy01Icon, User01Icon, } from '../../../icons/index.js';
6
7
  import firstPlace from '../../../images/first-place.png';
7
8
  import trophy from '../../../images/trophy.png';
8
9
  import { Button } from '../../../ui/index.js';
9
- import { formatNumber, mask } from '../../../utils/index.js';
10
+ import { formatNumber, isStyleEntries, mask } from '../../../utils/index.js';
10
11
  import { useTournamentsListItemContext } from './TournamentsListContext.js';
11
12
  import { TournamentsListItemGameProviders } from './TournamentsListItemGameProviders.js';
12
13
  import { TournamentsListItemRules } from './TournamentsListItemRules.js';
13
14
  import { useTournamentsListItemData } from './useTournamentListItemData.js';
14
- export function TournamentsListItemMobile() {
15
+ export function TournamentsListItemMobile({ style, className, }) {
15
16
  const tournament = useTournamentsListItemContext();
16
17
  const [isDetailsVisible, setIsDetailsVisible] = useState(false);
17
18
  const { prizeAmountsByRank, timeParts, tournamentReward, filteredGameProviders, localeInfo, } = useTournamentsListItemData();
18
- return (_jsxs("div", { className: "bg-bg-primary border-border-primary rounded-2xl border", children: [_jsx("div", { className: twMerge('bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: _jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { className: "border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", children: [_jsx(Award01Icon, { className: "text-utility-brand-500 size-3.5" }), "Multiplier"] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
+ const styles = isStyleEntries(style, [
20
+ 'root',
21
+ 'badgeRoot',
22
+ 'badgeLabel',
23
+ 'badgeIcon',
24
+ ])
25
+ ? style
26
+ : { root: style };
27
+ const classNames = isString(className)
28
+ ? { root: className }
29
+ : (className ?? {});
30
+ return (_jsxs("div", { style: styles.root, className: twMerge('bg-bg-primary border-border-primary rounded-2xl border', classNames.root), children: [_jsx("div", { className: twMerge('bg-bg-tertiary relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: _jsxs("div", { className: "z-1 relative flex flex-1 flex-col", children: [_jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsx("div", { className: "flex w-full flex-col", children: _jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('border-utility-brand-200 bg-utility-brand-50 text-utility-brand-700 flex h-fit w-fit items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('text-utility-brand-500 size-3.5', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(Fragment, { children: [_jsxs("div", { className: twMerge('bg-bg-primary text-text-primary-900 flex h-fit w-8 flex-col items-center rounded-[4px] pb-1.5'), children: [_jsx("span", { className: "text-base font-medium", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-[8px]", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-[6px] px-[6px]", children: [_jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" }), _jsx("div", { className: "bg-bg-primary h-1 w-1 rounded-full" })] }))] }, part.label))) })] }), _jsx("div", { className: "text-text-primary-900 mt-2.5 text-left text-lg font-medium lg:mt-5 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "bg-bg-primary text-brand-400 mt-1.5 w-fit rounded-md px-2 py-1 text-2xl font-bold lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
19
31
  currency: localeInfo.currency.code,
20
32
  minDecimalPlaces: 2,
21
33
  maxDecimalPlaces: 2,
@@ -3,8 +3,10 @@ export * from './prefetchAvailablePromosQuery';
3
3
  export * from './prefetchAvailableQuestsCountQuery';
4
4
  export * from './prefetchAvailableQuestsQuery';
5
5
  export * from './prefetchBetRecordsQuery';
6
+ export * from './prefetchBonusesCountQuery';
6
7
  export * from './prefetchBonusesQuery';
7
8
  export * from './prefetchBonusQuery';
9
+ export * from './prefetchCashbackBonusesCountQuery';
8
10
  export * from './prefetchCashbackBonusesQuery';
9
11
  export * from './prefetchCashbackBonusQuery';
10
12
  export * from './prefetchCashbackQuery';
@@ -3,8 +3,10 @@ export * from './prefetchAvailablePromosQuery.js';
3
3
  export * from './prefetchAvailableQuestsCountQuery.js';
4
4
  export * from './prefetchAvailableQuestsQuery.js';
5
5
  export * from './prefetchBetRecordsQuery.js';
6
+ export * from './prefetchBonusesCountQuery.js';
6
7
  export * from './prefetchBonusesQuery.js';
7
8
  export * from './prefetchBonusQuery.js';
9
+ export * from './prefetchCashbackBonusesCountQuery.js';
8
10
  export * from './prefetchCashbackBonusesQuery.js';
9
11
  export * from './prefetchCashbackBonusQuery.js';
10
12
  export * from './prefetchCashbackQuery.js';
@@ -0,0 +1 @@
1
+ export declare const prefetchBonusesCountQuery: () => Promise<void>;
@@ -0,0 +1,19 @@
1
+ import { getBonusesCount } from '../../services/index.js';
2
+ import { getBonusesCountQueryKey, getQueryClient } from '../../utils/index.js';
3
+ import { getSession } from '../services/getSession.js';
4
+ export const prefetchBonusesCountQuery = async () => {
5
+ const session = await getSession();
6
+ if (session.status === 'unauthenticated')
7
+ return;
8
+ await getQueryClient().prefetchQuery({
9
+ queryKey: getBonusesCountQueryKey(),
10
+ queryFn: async ({ signal }) => {
11
+ return await getBonusesCount({
12
+ signal,
13
+ headers: {
14
+ Authorization: `Bearer ${session.token}`,
15
+ },
16
+ });
17
+ },
18
+ });
19
+ };
@@ -0,0 +1 @@
1
+ export declare const prefetchCashbackBonusesCountQuery: () => Promise<void>;
@@ -0,0 +1,19 @@
1
+ import { getCashbackBonusesCount } from '../../services/index.js';
2
+ import { getCashbackBonusesCountQueryKey, getQueryClient } from '../../utils/index.js';
3
+ import { getSession } from '../services/index.js';
4
+ export const prefetchCashbackBonusesCountQuery = async () => {
5
+ const session = await getSession();
6
+ if (session.status === 'unauthenticated')
7
+ return;
8
+ await getQueryClient().prefetchQuery({
9
+ queryKey: getCashbackBonusesCountQueryKey(),
10
+ queryFn: async ({ signal }) => {
11
+ return await getCashbackBonusesCount({
12
+ signal,
13
+ headers: {
14
+ Authorization: `Bearer ${session.token}`,
15
+ },
16
+ });
17
+ },
18
+ });
19
+ };
@@ -49,10 +49,12 @@ export declare const CASHBACKS = "\n \n \n fragment FileFragment on File {\n
49
49
  export declare const CASHBACK = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Cashback($id: ObjectId!) {\n node(id: $id) {\n ... on Cashback {\n ...CashbackFragment\n }\n }\n }\n";
50
50
  export declare const BONUS_FRAGMENT = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n";
51
51
  export declare const BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonuses {\n bonuses {\n ...BonusFragment\n }\n }\n";
52
+ export declare const BONUSES_IDS = "\n query BonusesIds {\n bonuses {\n id\n }\n }\n";
52
53
  export declare const BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query Bonus($id: ObjectId!) {\n node(id: $id) {\n ... on Bonus {\n ...BonusFragment\n }\n }\n }\n";
53
54
  export declare const CURRENT_BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment PromoFragment on Promo {\n id\n type\n name\n banner {\n ...FileFragment\n }\n status\n description\n maximumBonusAmount\n minimumBonusAmount\n maximumDepositAmount\n minimumDepositAmount\n activationStartDateTime\n turnoverRequirementContributionPercentagePerGameProvider\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment BonusFragment on Bonus {\n id\n promo {\n ...PromoFragment\n }\n deposit {\n type\n amount\n netAmount\n fee\n status\n reference\n dateTimeCreated\n dateTimeLastUpdated\n }\n amount\n balance\n turnoverRequirement\n currentTurnoverRequirementContribution\n currentTurnoverRequirementContributionPercentage\n turnoverRequirementContributionPercentagePerGameProvider\n enabledGameProviders\n expiration\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CurrentBonus {\n currentBonus: bonus {\n ...BonusFragment\n }\n }\n";
54
55
  export declare const CASHBACK_BONUS_FRAGMENT = "\n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n";
55
56
  export declare const CASHBACK_BONUSES = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CashbackBonuses {\n cashbackBonuses {\n ...CashbackBonusFragment\n }\n }\n";
57
+ export declare const CASHBACK_BONUSES_IDS = "\n query CashbackBonusesIds {\n cashbackBonuses {\n id\n }\n }\n";
56
58
  export declare const CASHBACK_BONUS = "\n \n \n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n fragment CashbackFragment on Cashback {\n id\n name\n banner {\n ...FileFragment\n }\n minimumCashback\n maximumMonthlyCashback\n status\n description\n activationStartDateTime\n activationEndDateTime\n turnoverContributionPercentagePerGameProvider\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n fragment CashbackBonusFragment on CashbackBonus {\n id\n balance\n total\n cashback {\n ...CashbackFragment\n }\n dateTimeCreated\n dateTimeLastUpdated\n }\n\n\n query CashbackBonus($id: ObjectId!) {\n node(id: $id) {\n ... on CashbackBonus {\n ...CashbackBonusFragment\n }\n }\n }\n";
57
59
  export declare const CLAIM_CASHBACK_BONUS = "\n mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {\n claimCashbackBonus(input: $input) {\n ... on CashbackBonusDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
58
60
  export declare const MEMBER = "\n query Member {\n member {\n dateTimeLastActive\n }\n }\n";
@@ -1217,6 +1217,13 @@ export const BONUSES = /* GraphQL */ `
1217
1217
  }
1218
1218
  }
1219
1219
  `;
1220
+ export const BONUSES_IDS = /* GraphQL */ `
1221
+ query BonusesIds {
1222
+ bonuses {
1223
+ id
1224
+ }
1225
+ }
1226
+ `;
1220
1227
  export const BONUS = /* GraphQL */ `
1221
1228
  ${BONUS_FRAGMENT}
1222
1229
 
@@ -1260,6 +1267,13 @@ export const CASHBACK_BONUSES = /* GraphQL */ `
1260
1267
  }
1261
1268
  }
1262
1269
  `;
1270
+ export const CASHBACK_BONUSES_IDS = /* GraphQL */ `
1271
+ query CashbackBonusesIds {
1272
+ cashbackBonuses {
1273
+ id
1274
+ }
1275
+ }
1276
+ `;
1263
1277
  export const CASHBACK_BONUS = /* GraphQL */ `
1264
1278
  ${CASHBACK_BONUS_FRAGMENT}
1265
1279
 
@@ -34,9 +34,15 @@ export interface AvailablePromosQueryVariables {
34
34
  }
35
35
  export declare const getAvailablePromos: (input: AvailablePromosInput, options?: GraphQLRequestOptions) => Promise<Promo[]>;
36
36
  export interface CashbackBonusesQuery {
37
- cashbackBonuses: CashbackBonus[];
37
+ cashbackBonuses?: CashbackBonus[] | null;
38
38
  }
39
39
  export declare const getCashbackBonuses: (options?: GraphQLRequestOptions) => Promise<CashbackBonus[]>;
40
+ export interface CashbackBonusesIdsQuery {
41
+ cashbackBonuses?: {
42
+ id: string;
43
+ }[] | null;
44
+ }
45
+ export declare const getCashbackBonusesCount: (options?: GraphQLRequestOptions) => Promise<number>;
40
46
  export type ClaimCashbackBonusError = {
41
47
  name: 'CashbackBonusDoesNotExistError';
42
48
  message: string;
@@ -404,6 +410,12 @@ export interface BonusesQuery {
404
410
  bonuses?: Bonus[] | null;
405
411
  }
406
412
  export declare const getBonuses: (options?: GraphQLRequestOptions) => Promise<Bonus[]>;
413
+ export interface BonusesIdsQuery {
414
+ bonuses?: {
415
+ id: string;
416
+ }[] | null;
417
+ }
418
+ export declare const getBonusesCount: (options?: GraphQLRequestOptions) => Promise<number>;
407
419
  export type ClaimSpotBonusError = {
408
420
  name: 'InvalidPromoCodeError';
409
421
  message: string;
@@ -1,7 +1,7 @@
1
1
  import { cache } from 'react';
2
2
  import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
3
  import { graphqlRequest } from './graphqlRequest.js';
4
- import { AVAILABLE_PROMOS, BONUS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUSES, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CURRENT_BONUS, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
4
+ import { AVAILABLE_PROMOS, BONUS, BONUSES, BONUSES_IDS, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUSES, CASHBACK_BONUSES_IDS, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CURRENT_BONUS, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
5
5
  import { sha256 } from './sha256.js';
6
6
  export const getPromos = cache(async (options) => {
7
7
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, options);
@@ -25,7 +25,11 @@ export const getAvailablePromos = cache(async (input, options) => {
25
25
  });
26
26
  export const getCashbackBonuses = cache(async (options) => {
27
27
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUSES, undefined, options);
28
- return res.cashbackBonuses;
28
+ return res.cashbackBonuses ?? [];
29
+ });
30
+ export const getCashbackBonusesCount = cache(async (options) => {
31
+ const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUSES_IDS, undefined, options);
32
+ return res.cashbackBonuses?.length ?? 0;
29
33
  });
30
34
  export const claimCashbackBonus = async (id, options) => {
31
35
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CLAIM_CASHBACK_BONUS, { input: { id } }, options);
@@ -301,6 +305,10 @@ export const getBonuses = cache(async (options) => {
301
305
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES, undefined, options);
302
306
  return res.bonuses ?? [];
303
307
  });
308
+ export const getBonusesCount = cache(async (options) => {
309
+ const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES_IDS, undefined, options);
310
+ return res.bonuses?.length ?? 0;
311
+ });
304
312
  export const claimSpotBonus = async (code, options) => {
305
313
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CLAIM_SPOT_BONUS, { code }, options);
306
314
  if (res.claimSpotBonus) {