@opexa/portal-components 0.0.727 → 0.0.729

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 (65) hide show
  1. package/dist/client/hooks/useJackpotsNextQuery.d.ts +3 -0
  2. package/dist/client/hooks/useJackpotsNextQuery.js +22 -0
  3. package/dist/components/Jackpots/Jackpots.js +13 -0
  4. package/dist/components/Jackpots/Jackpots.module.css +35 -0
  5. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +16 -0
  6. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +7 -0
  7. package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageDesktop.d.ts +33 -0
  8. package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageDesktop.js +107 -0
  9. package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageMobile.d.ts +55 -0
  10. package/dist/components/Jackpots/JackpotsListNext/JackpotMultiStageMobile.js +136 -0
  11. package/dist/components/Jackpots/JackpotsListNext/JackpotsList.d.ts +106 -0
  12. package/dist/components/Jackpots/JackpotsListNext/JackpotsList.js +51 -0
  13. package/dist/components/Jackpots/JackpotsListNext/JackpotsListContext.d.ts +12 -0
  14. package/dist/components/Jackpots/JackpotsListNext/JackpotsListContext.js +3 -0
  15. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemDesktop.d.ts +43 -0
  16. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemDesktop.js +117 -0
  17. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemGameProviders.d.ts +5 -0
  18. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemGameProviders.js +54 -0
  19. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemMobile.d.ts +43 -0
  20. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemMobile.js +147 -0
  21. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemRules.d.ts +8 -0
  22. package/dist/components/Jackpots/JackpotsListNext/JackpotsListItemRules.js +15 -0
  23. package/dist/components/Jackpots/JackpotsListNext/useJackpotsListItemData.d.ts +20 -0
  24. package/dist/components/Jackpots/JackpotsListNext/useJackpotsListItemData.js +88 -0
  25. package/dist/components/KYC/KYCDefault/IdentityVerification.js +1 -1
  26. package/dist/components/KYC/KYCDefault/PersonalInformation.js +1 -1
  27. package/dist/icons/Flag05Icon.d.ts +2 -0
  28. package/dist/icons/Flag05Icon.js +4 -0
  29. package/dist/server/utils/prefetchJackpotsNextQuery.d.ts +2 -0
  30. package/dist/server/utils/prefetchJackpotsNextQuery.js +16 -0
  31. package/dist/services/queries.d.ts +2 -1
  32. package/dist/services/queries.js +60 -0
  33. package/dist/services/report.d.ts +21 -1
  34. package/dist/services/report.js +13 -1
  35. package/dist/types/index.d.ts +33 -0
  36. package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
  37. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
  38. package/dist/ui/Badge/Badge.d.ts +12 -12
  39. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  40. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  41. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  42. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  43. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  44. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  45. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  46. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  47. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  48. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  49. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  50. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  51. package/dist/ui/Menu/Menu.d.ts +198 -198
  52. package/dist/ui/Menu/menu.recipe.d.ts +11 -11
  53. package/dist/ui/Popover/Popover.d.ts +55 -55
  54. package/dist/ui/Popover/popover.recipe.d.ts +5 -5
  55. package/dist/ui/Progress/Progress.d.ts +27 -27
  56. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  57. package/dist/ui/Select/Select.d.ts +45 -45
  58. package/dist/ui/Select/select.recipe.d.ts +3 -3
  59. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  60. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  61. package/dist/ui/Tooltip/Tooltip.d.ts +30 -30
  62. package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
  63. package/dist/utils/queryKeys.d.ts +1 -0
  64. package/dist/utils/queryKeys.js +1 -0
  65. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { isString } from 'lodash-es';
4
+ import Image, {} from 'next/image';
5
+ import { useIntersectionObserver } from 'usehooks-ts';
6
+ import { useJackpotsNextQuery } from '../../../client/hooks/useJackpotsNextQuery.js';
7
+ import closeChest from '../../../images/close-chest.png';
8
+ import { isStyleEntries } from '../../../utils/isStyleEntries.js';
9
+ import { JackpotMultiStageDesktop } from './JackpotMultiStageDesktop.js';
10
+ import { JackpotMultiStageMobile } from './JackpotMultiStageMobile.js';
11
+ import { JackpotsListItemContext, JackpotsListPropsContext, } from './JackpotsListContext.js';
12
+ import { JackpotsListItemDesktop } from './JackpotsListItemDesktop.js';
13
+ import { JackpotsListItemMobile } from './JackpotsListItemMobile.js';
14
+ export function JackpotsListNext(props) {
15
+ const [ref, inView] = useIntersectionObserver({
16
+ threshold: 0.25,
17
+ });
18
+ const jackpotsNextQuery = useJackpotsNextQuery({
19
+ first: 100,
20
+ filter: {
21
+ deleted: {
22
+ equal: false,
23
+ },
24
+ },
25
+ sort: {
26
+ cursor: 'POOL',
27
+ order: 'DESC',
28
+ },
29
+ }, {
30
+ refetchInterval: inView ? 10_000 : false,
31
+ });
32
+ const jackpots = jackpotsNextQuery.data?.pages[0].edges.map((edge) => edge.node) ?? [];
33
+ console.log;
34
+ const styles = isStyleEntries(props.style, ['root', 'itemRoot'])
35
+ ? props.style
36
+ : { root: props.style };
37
+ const classNames = isString(props.className)
38
+ ? { root: props.className }
39
+ : (props.className ?? {});
40
+ return (_jsx(JackpotsListPropsContext, { value: props, children: _jsxs("div", { ref: ref, style: styles.root, className: classNames.root, children: [_jsx("div", { className: "mb-3 font-semibold text-lg lg:mb-4.5", children: props.heading ?? 'Jackpots' }), jackpots.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "hidden flex-col gap-6 lg:flex", children: jackpots.map((jackpot, index) => {
41
+ if (jackpot?.stages?.length) {
42
+ return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotMultiStageDesktop, { style: styles.itemRoot, className: classNames, animate: true, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, customJackpotStageChest: props.customJackpotStageChest }) }, index));
43
+ }
44
+ return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemDesktop, { style: styles.itemRoot, className: classNames, animate: true, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index));
45
+ }) }), _jsx("div", { className: "flex flex-col gap-6 lg:hidden", children: jackpots.map((jackpot, index) => {
46
+ if (jackpot?.stages?.length) {
47
+ return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotMultiStageMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier, customJackpotStageChest: props.customJackpotStageChest }) }, index));
48
+ }
49
+ return (_jsx(JackpotsListItemContext, { value: jackpot, children: _jsx(JackpotsListItemMobile, { style: styles.itemRoot, className: classNames, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape, chestImagesByTier: props.chestImagesByTier }) }, index));
50
+ }) })] })) : (_jsxs("div", { className: "mt-5 flex h-fit flex-col items-center justify-center lg:mt-0 lg:h-62", children: [_jsx(Image, { width: 100, height: 100, src: closeChest, alt: "closeChest", className: "size-full h-29.5 w-29.5 mix-blend-luminosity lg:h-25 lg:w-25" }), _jsx("div", { className: "mt-4 font-semibold text-base text-text-primary-900", children: "No Jackpots" }), _jsxs("div", { className: "mt-1 text-center text-sm text-text-tertiary-600", children: ["No jackpots are running at the moment. ", _jsx("br", {}), "Please check back later!"] })] }))] }) }));
51
+ }
@@ -0,0 +1,12 @@
1
+ import type { _Jackpot } from '../../../types';
2
+ import type { JackpotsListProps } from './JackpotsList';
3
+ export declare const JackpotsListPropsContext: (props: {
4
+ value: JackpotsListProps;
5
+ } & {
6
+ children?: import("react").ReactNode | undefined;
7
+ }) => React.ReactNode, useJackpotsListPropsContext: () => JackpotsListProps;
8
+ export declare const JackpotsListItemContext: (props: {
9
+ value: _Jackpot;
10
+ } & {
11
+ children?: import("react").ReactNode | undefined;
12
+ }) => React.ReactNode, useJackpotsListItemContext: () => _Jackpot;
@@ -0,0 +1,3 @@
1
+ import { createContext } from '../../../client/utils/createContext.js';
2
+ export const [JackpotsListPropsContext, useJackpotsListPropsContext] = createContext();
3
+ export const [JackpotsListItemContext, useJackpotsListItemContext] = createContext();
@@ -0,0 +1,43 @@
1
+ import { type ImageProps } from 'next/image';
2
+ import type { CSSProperties } from 'react';
3
+ import type { ClassNameEntries } from './JackpotsList';
4
+ interface JackpotsListItemDesktopProps {
5
+ className?: ClassNameEntries;
6
+ style?: CSSProperties;
7
+ animate?: boolean;
8
+ customJackpotChestImage?: {
9
+ image: {
10
+ open: string;
11
+ closed: string;
12
+ };
13
+ style?: {
14
+ wrapper?: string;
15
+ image?: string;
16
+ };
17
+ };
18
+ chestImagesByTier?: {
19
+ grand?: {
20
+ open: ImageProps['src'];
21
+ closed: ImageProps['src'];
22
+ };
23
+ major?: {
24
+ open: ImageProps['src'];
25
+ closed: ImageProps['src'];
26
+ };
27
+ minor?: {
28
+ open: ImageProps['src'];
29
+ closed: ImageProps['src'];
30
+ };
31
+ default?: {
32
+ open: ImageProps['src'];
33
+ closed: ImageProps['src'];
34
+ };
35
+ style?: {
36
+ wrapper?: string;
37
+ image?: string;
38
+ };
39
+ };
40
+ jackpotProfileShape?: 'oval' | 'star';
41
+ }
42
+ export declare function JackpotsListItemDesktop({ animate, customJackpotChestImage, chestImagesByTier, jackpotProfileShape, className, ...props }: JackpotsListItemDesktopProps): import("react/jsx-runtime").JSX.Element | null;
43
+ export {};
@@ -0,0 +1,117 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Progress } from '@ark-ui/react/progress';
3
+ import { format } from 'date-fns';
4
+ import Image, {} from 'next/image';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
7
+ import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
8
+ import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
9
+ import { StarIcon } from '../../../icons/StarIcon.js';
10
+ import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
11
+ import { User01Icon } from '../../../icons/User01Icon.js';
12
+ import closeChest from '../../../images/close-chest.png';
13
+ import firstPlace from '../../../images/first-place.png';
14
+ import leaderboard from '../../../images/leaderboard.png';
15
+ import openChest from '../../../images/open-chest.png';
16
+ import { Tooltip } from '../../../ui/Tooltip/index.js';
17
+ import { capitalize } from '../../../utils/capitalize.js';
18
+ import { formatNumber } from '../../../utils/formatNumber.js';
19
+ import { mask } from '../../../utils/mask.js';
20
+ import { parseDecimal } from '../../../utils/parseDecimal.js';
21
+ import styles from '../Jackpots.module.css';
22
+ import { useJackpotsListItemContext } from './JackpotsListContext.js';
23
+ import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
24
+ import { JackpotsListItemRules } from './JackpotsListItemRules.js';
25
+ import { useJackpotsListItemData } from './useJackpotsListItemData.js';
26
+ export function JackpotsListItemDesktop({ animate = true, customJackpotChestImage, chestImagesByTier, jackpotProfileShape = 'oval', className, ...props }) {
27
+ const jackpot = useJackpotsListItemContext();
28
+ const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, getTierFromName, } = useJackpotsListItemData();
29
+ const getChestImages = () => {
30
+ // Priority: chestImagesByTier > customJackpotChestImage > default
31
+ if (chestImagesByTier) {
32
+ const tier = getTierFromName(jackpot.name);
33
+ const tierImages = chestImagesByTier[tier] || chestImagesByTier.default;
34
+ if (tierImages) {
35
+ return {
36
+ open: tierImages.open,
37
+ closed: tierImages.closed,
38
+ style: chestImagesByTier.style,
39
+ };
40
+ }
41
+ }
42
+ if (customJackpotChestImage?.image) {
43
+ return {
44
+ open: customJackpotChestImage.image.open,
45
+ closed: customJackpotChestImage.image.closed,
46
+ style: customJackpotChestImage.style,
47
+ };
48
+ }
49
+ // Default fallback
50
+ return {
51
+ open: openChest,
52
+ closed: closeChest,
53
+ style: undefined,
54
+ };
55
+ };
56
+ const chestImages = getChestImages();
57
+ const ProfileIcon = () => jackpotProfileShape === 'oval' ? (_jsxs("div", { className: "relative flex h-18 w-18 items-center justify-center rounded-full bg-bg-tertiary", children: [_jsx(User01Icon, { className: "size-9 text-text-quarterary-500" }), _jsx("div", { className: twMerge('absolute right-0 bottom-safe-area-inset-bottom flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] })) : (_jsxs("div", { className: "relative grid h-18 w-18", children: [_jsx(StarIcon, { className: "col-start-1 row-start-1 h-full w-full" }), _jsx(User01Icon, { className: "z-10 col-start-1 row-start-1 size-9 place-self-center text-text-quarterary-500" }), _jsx("div", { className: twMerge('-right-0 absolute bottom-safe-area-inset-bottom z-20 flex h-7 w-7 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 text-center font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] }));
58
+ const PayoutBadge = () => (_jsxs("div", { className: twMerge('flex h-fit w-fit items-center gap-1 rounded-sm border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', className?.latestPayoutBadgeRoot), children: [_jsx(Trophy01Icon, { className: twMerge('size-3.5 text-utility-brand-600', className?.latestPayoutBadgeIcon) }), "Latest Payout"] }));
59
+ const ProgressBar = () => (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-1 flex justify-between", children: [_jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(0, {
60
+ currency: localeInfo.currency.code,
61
+ compact: true,
62
+ }) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
63
+ currency: localeInfo.currency.code,
64
+ compact: true,
65
+ }) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
66
+ currency: localeInfo.currency.code,
67
+ minDecimalPlaces: 2,
68
+ maxDecimalPlaces: 2,
69
+ })] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full bg-black opacity-30", style: {
70
+ width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
71
+ } }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
72
+ currency: localeInfo.currency.code,
73
+ minDecimalPlaces: 2,
74
+ maxDecimalPlaces: 2,
75
+ })] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
76
+ ? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
77
+ currency: localeInfo.currency.code,
78
+ compact: true,
79
+ })} Play now for your chance to win big! 🔥`
80
+ : getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }));
81
+ const RecentPayoutsTable = () => (_jsx("div", { className: twMerge('max-h-[17rem] overflow-y-scroll', styles.scrollArea), children: _jsx("div", { className: "overflow-hidden rounded-xl border-gray-200", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsx("tr", { className: twMerge('h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs', className?.recentPayoutsTableHeadRow), children: [
82
+ 'Player',
83
+ 'Game Provider',
84
+ 'Multiplier',
85
+ 'Prize',
86
+ 'Timestamp',
87
+ ].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
88
+ ? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: mask(jackpotPayout.member.name, {
89
+ totalCharsCount: 6,
90
+ }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: capitalize(jackpotPayout.game?.provider ?? '-') }), _jsxs("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(jackpotPayout.amount, {
91
+ currency: localeInfo.currency.code,
92
+ minDecimalPlaces: 2,
93
+ maxDecimalPlaces: 2,
94
+ }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
95
+ : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }) }));
96
+ if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
97
+ return null;
98
+ }
99
+ return (_jsxs("div", { ref: rootRef, className: twMerge('rounded-2xl border border-border-primary bg-bg-tertiary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: twMerge('relative flex shrink-0 rounded-2xl p-3 text-center lg:gap-4 lg:p-5'), children: [_jsxs("div", { className: "relative z-1 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", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
100
+ currency: localeInfo.currency.code,
101
+ minDecimalPlaces: 2,
102
+ maxDecimalPlaces: 2,
103
+ }) })] }), _jsx("div", { className: "min-w-30" }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 min-w-30 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 150, height: 150, src: isPayingOut ? chestImages.open : chestImages.closed, alt: "chest", className: twMerge('size-full h-25 w-25 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) })] }), _jsx("div", { className: twMerge('relative mt-4 hidden w-full gap-4 rounded-lg bg-bg-primary p-4 lg:flex', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
104
+ totalCharsCount: 6,
105
+ }) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
106
+ currency: localeInfo.currency.code,
107
+ minDecimalPlaces: 2,
108
+ maxDecimalPlaces: 2,
109
+ }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "firstPlace", className: "size-full h-auto w-[4.125rem] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _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 jackpot!" })] })] })) })] }) }) }), _jsx(ProgressBar, {})] }), _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 gap-2", children: [_jsx(Image, { width: 24, height: 24, src: leaderboard, alt: "leaderboardIcon", className: "size-full h-auto w-6" }), _jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', className?.recentPayoutsHeading), children: jackpotPayouts.length ? 'Recent Payouts' : 'Starting soon!' })] }), _jsx(JackpotsListItemRules, { className: {
110
+ button: className?.recentPayoutsJackpotRulesButton,
111
+ } })] }), _jsx(RecentPayoutsTable, {})] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl') }))] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders }))] }));
112
+ }
113
+ function getPercentage(value, total) {
114
+ const v = parseDecimal(value, 0);
115
+ const t = parseDecimal(total, 0);
116
+ return t === 0 ? 0 : (v / t) * 100;
117
+ }
@@ -0,0 +1,5 @@
1
+ import type { GameProviderData } from '../../../types';
2
+ export interface JackpotsListItemGameProvidersProps {
3
+ gameProviders: GameProviderData[];
4
+ }
5
+ export declare function JackpotsListItemGameProviders({ gameProviders, }: JackpotsListItemGameProvidersProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import useEmblaCarousel from 'embla-carousel-react';
3
+ import { isString } from 'lodash-es';
4
+ import Image from 'next/image';
5
+ import Link from 'next/link';
6
+ import { useCallback, useEffect, useState } from 'react';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { ArrowLeftIcon } from '../../../icons/ArrowLeftIcon.js';
9
+ import { ArrowRightIcon } from '../../../icons/ArrowRightIcon.js';
10
+ import { Button } from '../../../ui/Button/index.js';
11
+ import { callIfFn } from '../../../utils/callIfFn.js';
12
+ import { useJackpotsListPropsContext } from './JackpotsListContext.js';
13
+ export function JackpotsListItemGameProviders({ gameProviders, }) {
14
+ const jackpotsProps = useJackpotsListPropsContext();
15
+ const viewGamesUrl = (data) => {
16
+ return jackpotsProps.viewGamesUrl
17
+ ? callIfFn(jackpotsProps.viewGamesUrl, data)
18
+ .replace(':id', data.id)
19
+ .replace(':slug', data.slug)
20
+ : `/providers/${data.slug}`;
21
+ };
22
+ const classNames = isString(jackpotsProps.className)
23
+ ? { root: jackpotsProps.className }
24
+ : (jackpotsProps.className ?? {});
25
+ const [emblaRef, emblaApi] = useEmblaCarousel({
26
+ align: 'start',
27
+ slidesToScroll: 1,
28
+ });
29
+ const scrollPrev = useCallback(() => {
30
+ if (emblaApi)
31
+ emblaApi.scrollPrev();
32
+ }, [emblaApi]);
33
+ const scrollNext = useCallback(() => {
34
+ if (emblaApi)
35
+ emblaApi.scrollNext();
36
+ }, [emblaApi]);
37
+ const [canScrollPrev, setCanScrollPrev] = useState(false);
38
+ const [canScrollNext, setCanScrollNext] = useState(false);
39
+ const onSelect = useCallback(() => {
40
+ if (!emblaApi)
41
+ return;
42
+ setCanScrollPrev(emblaApi.canScrollPrev());
43
+ setCanScrollNext(emblaApi.canScrollNext());
44
+ }, [emblaApi]);
45
+ useEffect(() => {
46
+ if (!emblaApi)
47
+ return;
48
+ onSelect();
49
+ emblaApi.on('select', onSelect);
50
+ emblaApi.on('reInit', onSelect);
51
+ }, [emblaApi, onSelect]);
52
+ return (_jsxs("div", { className: twMerge('p-4 pb-8', classNames.providerRoot), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', classNames.providerHeading), children: "Jackpot Game Providers" }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: twMerge('rounded-r-none border-r-0', classNames.providerNavigationButton), "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: twMerge('rounded-l-none', classNames.providerNavigationButton), "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] }), _jsx("div", { className: "relative mt-3 overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-3.5", children: gameProviders.map((provider) => (_jsx(Link, { href: viewGamesUrl(provider), className: twMerge('min-w-27.5 rounded-md bg-brand-800 lg:bg-bg-primary-900', classNames.providerThumbnailRoot), children: _jsx(Image, { src: jackpotsProps.gameProviderImages?.[provider.id] ??
53
+ provider.logo, alt: "provider", className: twMerge('size-full', classNames.providerThumbnailImage), width: 300, height: 150 }) }, provider.slug))) }) })] }));
54
+ }
@@ -0,0 +1,43 @@
1
+ import { type ImageProps } from 'next/image';
2
+ import { type CSSProperties } from 'react';
3
+ import type { ClassNameEntries } from './JackpotsList';
4
+ interface JackpotsListItemMobileProps {
5
+ className?: ClassNameEntries;
6
+ style?: CSSProperties;
7
+ animate?: boolean;
8
+ customJackpotChestImage?: {
9
+ image: {
10
+ open: string;
11
+ closed: string;
12
+ };
13
+ style?: {
14
+ wrapper?: string;
15
+ image?: string;
16
+ };
17
+ };
18
+ chestImagesByTier?: {
19
+ grand?: {
20
+ open: ImageProps['src'];
21
+ closed: ImageProps['src'];
22
+ };
23
+ major?: {
24
+ open: ImageProps['src'];
25
+ closed: ImageProps['src'];
26
+ };
27
+ minor?: {
28
+ open: ImageProps['src'];
29
+ closed: ImageProps['src'];
30
+ };
31
+ default?: {
32
+ open: ImageProps['src'];
33
+ closed: ImageProps['src'];
34
+ };
35
+ style?: {
36
+ wrapper?: string;
37
+ image?: string;
38
+ };
39
+ };
40
+ jackpotProfileShape?: 'oval' | 'star';
41
+ }
42
+ export declare function JackpotsListItemMobile({ animate, customJackpotChestImage, jackpotProfileShape, chestImagesByTier, className, ...props }: JackpotsListItemMobileProps): import("react/jsx-runtime").JSX.Element | null;
43
+ export {};
@@ -0,0 +1,147 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Progress } from '@ark-ui/react/progress';
3
+ import { format } from 'date-fns';
4
+ import Image, {} from 'next/image';
5
+ import { useCallback, useEffect, useId, useState, } from 'react';
6
+ import { twMerge } from 'tailwind-merge';
7
+ import { ArrowNarrowDownIcon } from '../../../icons/ArrowNarrowDownIcon.js';
8
+ import { ArrowNarrowUpIcon } from '../../../icons/ArrowNarrowUpIcon.js';
9
+ import { ArrowNarrowUpRightIcon } from '../../../icons/ArrowNarrowUpRightIcon.js';
10
+ import { ChevronLeftIcon } from '../../../icons/ChevronLeftIcon.js';
11
+ import { ChevronRightIcon } from '../../../icons/ChevronRightIcon.js';
12
+ import { StarIcon } from '../../../icons/StarIcon.js';
13
+ import { Trophy01Icon } from '../../../icons/Trophy01Icon.js';
14
+ import { User01Icon } from '../../../icons/User01Icon.js';
15
+ import closeChest from '../../../images/close-chest.png';
16
+ import firstPlace from '../../../images/first-place.png';
17
+ import openChest from '../../../images/open-chest.png';
18
+ import { Button } from '../../../ui/Button/index.js';
19
+ import { Tooltip } from '../../../ui/Tooltip/index.js';
20
+ import { capitalize } from '../../../utils/capitalize.js';
21
+ import { formatNumber } from '../../../utils/formatNumber.js';
22
+ import { mask } from '../../../utils/mask.js';
23
+ import { parseDecimal } from '../../../utils/parseDecimal.js';
24
+ import styles from '../Jackpots.module.css';
25
+ import { useJackpotsListItemContext } from './JackpotsListContext.js';
26
+ import { JackpotsListItemGameProviders } from './JackpotsListItemGameProviders.js';
27
+ import { JackpotsListItemRules } from './JackpotsListItemRules.js';
28
+ import { useJackpotsListItemData } from './useJackpotsListItemData.js';
29
+ function getPercentage(value, total) {
30
+ const v = parseDecimal(value, 0);
31
+ const t = parseDecimal(total, 0);
32
+ return t === 0 ? 0 : (v / t) * 100;
33
+ }
34
+ export function JackpotsListItemMobile({ animate = true, customJackpotChestImage, jackpotProfileShape = 'oval', chestImagesByTier, className, ...props }) {
35
+ const jackpot = useJackpotsListItemContext();
36
+ const { rootRef, jackpotPayouts, topJackpotPayout, filteredGameProviders, localeInfo, isPayingOut, jackpotAmount, arrowImages, getAccumulatingJackpotDescription, getTierFromName, } = useJackpotsListItemData();
37
+ const getChestImages = () => {
38
+ // Priority: chestImagesByTier > customJackpotChestImage > default
39
+ if (chestImagesByTier) {
40
+ const tier = getTierFromName(jackpot.name);
41
+ const tierImages = chestImagesByTier[tier] || chestImagesByTier.default;
42
+ if (tierImages) {
43
+ return {
44
+ open: tierImages.open,
45
+ closed: tierImages.closed,
46
+ style: chestImagesByTier.style,
47
+ };
48
+ }
49
+ }
50
+ if (customJackpotChestImage?.image) {
51
+ return {
52
+ open: customJackpotChestImage.image.open,
53
+ closed: customJackpotChestImage.image.closed,
54
+ style: customJackpotChestImage.style,
55
+ };
56
+ }
57
+ // Default fallback
58
+ return {
59
+ open: openChest,
60
+ closed: closeChest,
61
+ style: undefined,
62
+ };
63
+ };
64
+ const chestImages = getChestImages();
65
+ const [isDetailsVisible, setIsDetailsVisible] = useState(false);
66
+ const [mainTooltipOpen, setMainTooltipOpen] = useState(false);
67
+ const [minLimitTooltipOpen, setMinLimitTooltipOpen] = useState(false);
68
+ const mainTooltipId = useId();
69
+ const minLimitTooltipId = useId();
70
+ const handleMainTooltipClick = useCallback((e) => {
71
+ e.stopPropagation();
72
+ setMainTooltipOpen((prev) => !prev);
73
+ }, []);
74
+ const handleMinLimitTooltipClick = useCallback((e) => {
75
+ e.stopPropagation();
76
+ setMinLimitTooltipOpen((prev) => !prev);
77
+ }, []);
78
+ useEffect(() => {
79
+ if (mainTooltipOpen) {
80
+ const timeout = setTimeout(() => setMainTooltipOpen(false), 3000);
81
+ return () => clearTimeout(timeout);
82
+ }
83
+ }, [mainTooltipOpen]);
84
+ useEffect(() => {
85
+ if (minLimitTooltipOpen) {
86
+ const timeout = setTimeout(() => setMinLimitTooltipOpen(false), 3000);
87
+ return () => clearTimeout(timeout);
88
+ }
89
+ }, [minLimitTooltipOpen]);
90
+ const ProfileIcon = () => jackpotProfileShape === 'oval' ? (_jsxs("div", { className: "relative flex h-18 w-18 items-center justify-center rounded-full bg-bg-tertiary", children: [_jsx(User01Icon, { className: "size-9 text-text-quarterary-500" }), _jsx("div", { className: twMerge('absolute right-0 bottom-safe-area-inset-bottom flex h-6 w-6 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] })) : (_jsxs("div", { className: "relative grid h-18 w-18", children: [_jsx(StarIcon, { className: "col-start-1 row-start-1 h-full w-full" }), _jsx(User01Icon, { className: "z-10 col-start-1 row-start-1 size-9 place-self-center text-text-quarterary-500" }), _jsx("div", { className: twMerge('-right-0 absolute bottom-safe-area-inset-bottom z-20 flex h-7 w-7 items-center justify-center rounded-full border-[1.5px] border-bg-primary bg-yellow-400 text-center font-bold text-brand-950 text-xs', className?.latestPayoutRankRoot), children: "1st" })] }));
91
+ const PayoutBadge = () => (_jsxs("div", { className: twMerge('flex h-fit w-fit items-center gap-1 rounded-sm border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', className?.latestPayoutBadgeRoot), children: [_jsx(Trophy01Icon, { className: twMerge('size-3.5 text-utility-brand-600', className?.latestPayoutBadgeIcon) }), "Recent Payout"] }));
92
+ const ProgressBar = () => (_jsxs("div", { className: "mt-3 lg:mt-4", children: [_jsxs("div", { className: "mb-1 flex justify-between", children: [_jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(0, {
93
+ currency: localeInfo.currency.code,
94
+ compact: true,
95
+ }) }), _jsxs("div", { className: "relative flex items-center justify-end gap-1.5", children: [isPayingOut ? (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-red-flash-1']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-red-flash-2']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-red-flash-3']), children: _jsx(ChevronLeftIcon, { className: "size-4.5" }) })] })) : (_jsxs("div", { className: "flex w-6 items-center", children: [_jsx("div", { className: twMerge('absolute left-0', styles['animate-arrow-green-flash-1']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-1.5', styles['animate-arrow-green-flash-2']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) }), _jsx("div", { className: twMerge('absolute left-3', styles['animate-arrow-green-flash-3']), children: _jsx(ChevronRightIcon, { className: "size-4.5" }) })] })), _jsx("div", { className: "font-semibold text-text-primary-900 text-xs", children: formatNumber(jackpot?.maximumJackpotPoolLimit, {
96
+ currency: localeInfo.currency.code,
97
+ compact: true,
98
+ }) })] })] }), _jsx(Progress.Root, { className: "h-2 w-full rounded-full bg-bg-primary lg:h-4", max: 100, value: getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuenow": getPercentage(jackpot.pool, jackpot.maximumJackpotPoolLimit), "aria-valuemax": 100, "aria-label": "Jackpot progress", children: _jsx(Progress.Track, { className: twMerge('h-full overflow-hidden rounded-full bg-bg-primary', className?.progressBarTrack), children: _jsxs(Progress.Range, { className: "relative h-full overflow-hidden rounded-full bg-brand-500 pl-1.5", children: [_jsxs(Tooltip.Root, { open: mainTooltipOpen, onOpenChange: (details) => setMainTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { className: "absolute inset-0 h-full w-full", onClick: handleMainTooltipClick, role: "button", tabIndex: 0, "aria-label": "Show current jackpot tooltip", "aria-describedby": mainTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: mainTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Current\uD83D\uDCB0:", ' ', formatNumber(jackpot.pool, {
99
+ currency: localeInfo.currency.code,
100
+ minDecimalPlaces: 2,
101
+ maxDecimalPlaces: 2,
102
+ })] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] }), _jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-start pl-1.5", "aria-hidden": "true", children: arrowImages }), _jsxs(Tooltip.Root, { open: minLimitTooltipOpen, onOpenChange: (details) => setMinLimitTooltipOpen(details.open), openDelay: 0, closeDelay: 100, lazyMount: true, unmountOnExit: true, positioning: { strategy: 'fixed', placement: 'top' }, children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsx("div", { onClick: handleMinLimitTooltipClick, className: "absolute inset-0 h-full bg-black opacity-30", style: {
103
+ width: `${getPercentage(jackpot.minimumJackpotPoolDrawingLimit, jackpot.pool)}%`,
104
+ }, role: "button", tabIndex: 0, "aria-label": "Show minimum payout limit tooltip", "aria-describedby": minLimitTooltipId }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { id: minLimitTooltipId, children: [_jsxs("div", { className: "text-xs", children: ["Minimum Payout Limit:", ' ', formatNumber(jackpot.minimumJackpotPoolDrawingLimit, {
105
+ currency: localeInfo.currency.code,
106
+ minDecimalPlaces: 2,
107
+ maxDecimalPlaces: 2,
108
+ })] }), _jsx(Tooltip.Arrow, { children: _jsx(Tooltip.ArrowTip, {}) })] }) })] })] }) }) }), _jsx("div", { className: "mt-1 block text-start text-2xs lg:hidden", children: isPayingOut
109
+ ? `The pot has hit ${formatNumber(jackpot?.maximumJackpotPoolLimit, {
110
+ currency: localeInfo.currency.code,
111
+ compact: true,
112
+ })} Play now for your chance to win big! 🔥`
113
+ : getAccumulatingJackpotDescription(Number(jackpot?.pool) ?? 0, Number(jackpot?.maximumJackpotPoolLimit) ?? 0) })] }));
114
+ const RecentPayoutsTable = () => (_jsx("div", { className: "overflow-x-auto border-gray-200", children: _jsxs("table", { className: "w-full min-w-[37.5rem]", children: [_jsx("thead", { children: _jsx("tr", { className: twMerge('h-8 whitespace-nowrap bg-bg-secondary text-left font-medium text-text-tertiary-600 text-xs', className?.recentPayoutsTableHeadRow), children: [
115
+ 'Player',
116
+ 'Game Provider',
117
+ 'Multiplier',
118
+ 'Prize',
119
+ 'Timestamp',
120
+ ].map((header) => (_jsx("th", { className: "px-4", children: header }, header))) }) }), _jsx("tbody", { children: jackpotPayouts.length
121
+ ? jackpotPayouts.map((jackpotPayout, i) => (_jsxs("tr", { className: twMerge('whitespace-nowrap bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: [_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: mask(jackpotPayout.member.name, {
122
+ totalCharsCount: 6,
123
+ }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: capitalize(jackpotPayout.game?.provider ?? '-', {
124
+ delimiter: capitalize.delimiters.UNDERSCORE,
125
+ }) }), _jsxs("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: [jackpotPayout.multiplier, "x"] }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4 text-brand-400', className?.recentPayoutsTableBodyData), children: formatNumber(jackpotPayout.amount, {
126
+ currency: localeInfo.currency.code,
127
+ minDecimalPlaces: 2,
128
+ maxDecimalPlaces: 2,
129
+ }) }), _jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: format(new Date(jackpotPayout.dateTimeCreated), 'dd MMM yyyy h:mm a') })] }, i)))
130
+ : Array.from({ length: 10 }).map((_, i) => (_jsx("tr", { className: twMerge('bg-bg-primary text-left text-sm text-text-secondary-700', className?.recentPayoutsTableBodyRow), children: Array.from({ length: 5 }).map((_, j) => (_jsx("td", { className: twMerge('h-12 border-border-secondary border-t-2 px-4', className?.recentPayoutsTableBodyData), children: "-" }, j))) }, i))) })] }) }));
131
+ if (jackpot.status === 'DISABLED' && jackpot.drawing !== true) {
132
+ return null;
133
+ }
134
+ return (_jsxs("div", { ref: rootRef, className: twMerge('rounded-2xl border border-border-primary bg-bg-primary', className?.itemRoot), children: [_jsxs("div", { style: props.style, className: "relative flex shrink-0 rounded-2xl bg-bg-tertiary p-3 text-center lg:gap-4 lg:p-5", children: [_jsxs("div", { className: "relative z-1 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", { children: [isPayingOut ? (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-success-200 bg-utility-success-50 px-2 py-0.5 font-medium text-utility-success-700 text-xs", children: [_jsx("span", { className: "full size-1.5 animate-pulse rounded bg-utility-success-500" }), "Paying Out"] })) : (_jsxs("div", { className: "flex w-fit items-center gap-1 rounded-full border border-utility-blue-200 bg-utility-blue-50 px-2 py-0.5 font-medium text-utility-blue-700 text-xs", children: [_jsx(ArrowNarrowUpRightIcon, { className: "size-3.5 text-utility-blue-500" }), "Accumulating"] })), _jsx("div", { className: "mt-1 text-left font-medium text-lg text-text-primary-900 lg:mt-5 lg:text-2xl", children: jackpot.name }), _jsx("div", { className: twMerge('mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl', className?.jackpotAmountRoot), children: formatNumber(jackpotAmount, {
135
+ currency: localeInfo.currency.code,
136
+ minDecimalPlaces: 2,
137
+ maxDecimalPlaces: 2,
138
+ }) })] }), _jsx("div", { className: twMerge('right-0 bottom-[-60] z-1 block min-w-34.5 lg:absolute', chestImages?.style?.wrapper), children: _jsx(Image, { width: 100, height: 100, src: isPayingOut ? chestImages.open : chestImages.closed, alt: "chest", className: twMerge('size-full h-34.5 w-34.5 p-2 lg:h-37.5 lg:w-37.5', chestImages?.style?.image) }) })] }) }) }) }), _jsx(ProgressBar, {}), _jsx("div", { className: twMerge('relative mt-4 flex w-full gap-4 rounded-lg bg-bg-primary p-4', className?.latestPayoutRoot), children: topJackpotPayout?.amount ? (_jsxs(_Fragment, { children: [_jsx(ProfileIcon, {}), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _jsx("div", { className: "font-semibold", children: mask(topJackpotPayout.member.name, {
139
+ totalCharsCount: 6,
140
+ }) }), _jsx("div", { className: twMerge('text-2xl text-brand-400', className?.latestPayoutAmount), children: formatNumber(topJackpotPayout.amount, {
141
+ currency: localeInfo.currency.code,
142
+ minDecimalPlaces: 2,
143
+ maxDecimalPlaces: 2,
144
+ }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Image, { width: 66, height: 87, src: firstPlace, alt: "closeChest", className: "size-full h-auto w-[4.125rem] mix-blend-luminosity" }), _jsxs("div", { className: "flex flex-col gap-1 text-left", children: [_jsx(PayoutBadge, {}), _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 jackpot!" })] })] })) }), _jsx(Button, { variant: "outline", className: twMerge('mt-5.5 px-3.5 py-2.5 text-sm', isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["See Details", _jsx(ArrowNarrowDownIcon, { className: "size-5" })] }) })] }), isPayingOut && animate && (_jsx("div", { className: twMerge(styles['light-rays'], 'absolute top-safe-area-inset-top right-0 rounded-2xl [--light-rays-top:15%] lg:[--light-rays-top:9.375rem]') }))] }), isDetailsVisible && (_jsxs("div", { children: [_jsxs("div", { className: "z-1 flex-1", children: [_jsxs("div", { className: "flex items-center justify-between p-3", children: [_jsx("div", { className: "flex gap-2", children: _jsx("div", { className: twMerge('font-semibold text-lg text-text-primary-900', className?.recentPayoutsHeading), children: jackpotPayouts.length ? 'Recent payouts' : 'Starting soon!' }) }), _jsx(JackpotsListItemRules, { className: {
145
+ button: className?.recentPayoutsJackpotRulesButton,
146
+ } })] }), _jsx(RecentPayoutsTable, {})] }), Boolean(filteredGameProviders.length) && (_jsx(JackpotsListItemGameProviders, { gameProviders: filteredGameProviders })), _jsx("div", { className: "m-3", children: _jsx(Button, { variant: "outline", className: twMerge('px-3.5 py-2.5 text-sm', !isDetailsVisible ? 'hidden' : 'flex'), onClick: () => setIsDetailsVisible(!isDetailsVisible), children: _jsxs("div", { className: "flex gap-1.5", children: ["Hide", _jsx(ArrowNarrowUpIcon, { className: "size-5" })] }) }) })] }))] }));
147
+ }
@@ -0,0 +1,8 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ export interface ClassNameEntries {
3
+ root?: string;
4
+ button?: string;
5
+ }
6
+ export declare function JackpotsListItemRules(props: PropsWithChildren<{
7
+ className?: string | ClassNameEntries;
8
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flag06Icon } from '../../../icons/Flag06Icon.js';
3
+ import { XIcon } from '../../../icons/XIcon.js';
4
+ import { Dialog } from '../../../ui/Dialog/index.js';
5
+ import { Portal } from '../../../ui/Portal/index.js';
6
+ import { useJackpotsListItemContext } from './JackpotsListContext.js';
7
+ export function JackpotsListItemRules(props) {
8
+ const classNames = typeof props.className === 'string'
9
+ ? { root: props.className }
10
+ : (props.className ?? {});
11
+ const jackpot = useJackpotsListItemContext();
12
+ return (_jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { asChild: true, children: props.children ?? (_jsx("button", { type: "button", className: classNames.button ??
13
+ 'flex font-semibold text-button-tertiary-fg text-sm', children: "Jackpot Rules" })) }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: classNames.root ??
14
+ 'mx-auto h-full w-full items-start overflow-y-auto lg:h-auto lg:max-h-[80vh] lg:w-[640px] lg:rounded-xl', children: [_jsxs("div", { className: "p-3xl", children: [_jsxs("div", { className: "mb-3 flex justify-between", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg border border-border-primary bg-bg-tertiary", children: _jsx(Flag06Icon, { className: "size-full p-3 text-text-tertiary-600" }) }), _jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })] }), _jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: "Jackpot Rules" }), _jsx("div", { className: "mt-1 text-sm text-text-tertiary-600", children: "Terms and Conditions" })] }), _jsx("div", { className: "border-gray-800 border-t-1 pb-3", children: _jsx("div", { dangerouslySetInnerHTML: { __html: jackpot.description }, className: "px-3xl py-3" }) })] }) })] })] }));
15
+ }
@@ -0,0 +1,20 @@
1
+ import type { GameProvider } from '../../../types';
2
+ export declare function useJackpotsListItemData(): {
3
+ rootRef: (node?: Element | null) => void;
4
+ jackpotPayouts: import("../../../types").JackpotPayout[];
5
+ topJackpotPayout: import("../../../types").JackpotPayout;
6
+ filteredGameProviders: {
7
+ redirectUrl: string;
8
+ providedLogo: string | import("next/dist/shared/lib/get-img-props").StaticImport | undefined;
9
+ id: GameProvider;
10
+ slug: string;
11
+ logo: import("next/image").ImageProps["src"];
12
+ name: string;
13
+ }[];
14
+ localeInfo: import("../../../utils/getLocaleInfo").LocaleInfo;
15
+ isPayingOut: boolean;
16
+ jackpotAmount: string;
17
+ arrowImages: import("react/jsx-runtime").JSX.Element[];
18
+ getAccumulatingJackpotDescription: (part: number, total: number) => string;
19
+ getTierFromName: (name: string) => "grand" | "major" | "minor" | "default";
20
+ };