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CAAAA,WAAAA,EAAAA,WAAAA,CAAAA,WAMAC,CAAAA,EAAAA,GAAAA,CAAAA,EAAAA,CAAAA,CAAAA,GAAAA,wBAAAA,CAAAA,2BAAAA,EAAAA,KAAAA,CAAAA,QAAAA,EAAAA,QAAAA,CAAAA","sources":["webpack://_N_E/../../node_modules/@mui/utils/getValidReactChildren/getValidReactChildren.js","webpack://_N_E/./components/biz/GameLink.tsx","webpack://_N_E/./apis/casino/live-wins.ts","webpack://_N_E/./hooks/useResponseWidth.ts","webpack://_N_E/../../node_modules/lodash-es/times.js","webpack://_N_E/./components/pages/casino/LiveWins/styles.ts","webpack://_N_E/./components/pages/casino/LiveWins/store.ts","webpack://_N_E/./components/pages/casino/LiveWins/index.tsx","webpack://_N_E/./helper/getDeviceUid.ts","webpack://_N_E/./hooks/useGlobalWebsocket/index.tsx","webpack://_N_E/./hooks/usePageVisibility/index.ts","webpack://_N_E/./types/WS.ts","webpack://_N_E/"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Gets only the valid children of a component,\n * and ignores any nullish or falsy child.\n *\n * @param children the children\n */\nexport default function getValidReactChildren(children) {\n return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));\n}","import { TGameListItem } from '@/apis/hub88';\nimport Link from 'next/link';\nimport { styled } from '@mui/material/styles';\nimport ImgFallback from '@/components/ui/LazyLoadedImage';\nimport React from 'react';\nimport { getGameCoverPath } from '@/components/features/game/helper';\n\nconst Wrapper = styled(Link)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n // gap: theme.spacing(1),\n position: 'relative',\n whiteSpace: 'nowrap',\n}));\n\nconst GameLink = ({\n game,\n children,\n showThumb = false,\n sx = {},\n}: {\n game: TGameListItem;\n showThumb?: boolean;\n children: React.ReactNode;\n sx?: Record;\n}) => {\n const { gameId, provider, thumbUrl, gameSlug } = game;\n const coverImg = getGameCoverPath(game);\n return (\n \n {showThumb ? (\n \n ) : null}\n {children}\n \n );\n};\n\nexport default GameLink;\n","import { z } from 'zod';\nimport {\n SliveWInBetsPeriodSchema,\n TInferSchemaType,\n} from '@/constants/schemas';\nimport request, { requestWithZod } from '@/apis';\n// @ts-ignore\nimport { SCurrencyInfoSchema, SGameProvidersSchema } from '@/types/api.ts';\n// import { CurrencyInfoSchema } from '@/types/api';\n\nexport const WinsSchema = z.object({\n amount: z.string(),\n currency: z.string(),\n id: z.string(),\n gameId: z.string(),\n currencyInfo: SCurrencyInfoSchema,\n multiplier: z.string(),\n gameName: z.string(),\n provider: SGameProvidersSchema,\n product: z.optional(z.string()),\n category: z.string(),\n payout: z.string(),\n thumbUrl: z.string(),\n timestamp: z.string(),\n userName: z.string(),\n});\n\nexport const getLiveWinBets = (\n period: TInferSchemaType,\n) => {\n return request({\n url: `/api/mc-api/game/live-wins/${period}`,\n method: 'get',\n // schema: z.object({\n // wins: z.array(WinsSchema),\n // }),\n });\n};\n","import useTheme from '@/theme/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\n/**\n * Define width values for different breakpoints: [XS, SM, MD, LG, XL].\n * @param widths\n */\nfunction useResponsiveWidth(widths = []) {\n const { theme } = useTheme();\n\n // default width for all breakpoints\n const defaultWidth = widths[0] || 160;\n\n const breakpoints = [\n useMediaQuery(theme.breakpoints.down('xs')),\n useMediaQuery(theme.breakpoints.between('xs', 'sm')),\n useMediaQuery(theme.breakpoints.between('sm', 'md')),\n useMediaQuery(theme.breakpoints.between('md', 'lg')),\n useMediaQuery(theme.breakpoints.up('lg')),\n ];\n\n // return the first width that matches the breakpoint\n for (let i = 0; i < breakpoints.length; i++) {\n if (breakpoints[i]) {\n return widths[i] || defaultWidth;\n }\n }\n\n return defaultWidth;\n}\n\nexport default useResponsiveWidth;\n","import baseTimes from './_baseTimes.js';\nimport castFunction from './_castFunction.js';\nimport toInteger from './toInteger.js';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\nfunction times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = castFunction(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n}\n\nexport default times;\n","import { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\n// 定义卡片容器样式\nexport const StyledCardContainer = styled(Box)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n borderRadius: '8px',\n // border: theme.palette.border.normal,\n // paddingTop: theme.spacing(0.5),\n justifyContent: 'space-between',\n}));\n\n// 定义图片部分样式\nexport const StyledImageSection = styled(Box)({\n height: '60%',\n minHeight: '60%',\n overflow: 'hidden',\n borderRadius: '8px 8px 0 0',\n});\n\n// 定义文本部分样式\nexport const StyledTextSection = styled(Box)(({ theme }) => ({\n padding: theme.spacing(0.5, 1, 2, 1),\n textAlign: 'center' as const,\n [theme.breakpoints.down('md')]: {\n padding: theme.spacing(0.5, 1, 1, 1),\n },\n}));\n\nexport const StyledProfitSection = styled(Box)(({ theme }) => ({\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n height: '16px',\n fontSize: '12px',\n borderRadius: '4px',\n border: '1px solid #3BC117',\n background: 'rgba(59, 193, 23, 0.40)',\n padding: theme.spacing(0, 0.5),\n transform: 'scale(1)',\n transformOrigin: 'left top',\n margin: 0,\n mt: theme.spacing(0.5),\n [theme.breakpoints.down('md')]: {\n padding: theme.spacing(0, 0.25),\n },\n}));\n","import { atom } from 'jotai';\nimport {\n SliveWInBetsPeriodSchema,\n TInferSchemaType,\n} from '@/constants/schemas';\nimport { WinsSchema } from '@/apis/casino/live-wins';\n\nexport const liveWinsDataStore = atom<\n Record<\n TInferSchemaType,\n Array>\n >\n>({\n latest: [],\n month: [],\n week: [],\n day: [],\n});\n","import { Box, Skeleton, ButtonGroup, Button } from '@mui/material';\nimport CatchError from '@/components/system/CacthError';\nimport { useTranslation } from 'next-i18next';\nimport React, { useRef, useEffect, useState, useCallback } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { useAtom } from 'jotai';\nimport queryKeysFactory from '@/reactQueryKeys/keysFactory';\nimport { getLiveWinBets, WinsSchema } from '@/apis/casino/live-wins';\nimport {\n SliveWInBetsPeriodSchema,\n TInferSchemaType,\n} from '@/constants/schemas';\nimport { formatCurrency } from '@coingecko/cryptoformat';\nimport TruncatedTextTooltip from '@/components/ui/TruncatedTextTooltip';\nimport useResponseWidth from '@/hooks/useResponseWidth';\nimport GameLink from '@/components/biz/GameLink';\nimport useGlobalWebSocket from '@/hooks/useGlobalWebsocket';\nimport { WebSocketCategoryEnum, WebSocketCommandsEnum } from '@/types/WS';\nimport { constant, flatten, times } from 'lodash-es';\nimport Carousel from 'nuka-carousel';\nimport {\n StyledCardContainer,\n StyledImageSection,\n StyledTextSection,\n} from './styles';\nimport CasinoCoverImage from '@/components/biz/casino/CasinoCoverImage';\nimport { TGameListItem } from '@/apis/hub88';\nimport { styled } from '@mui/material/styles';\nimport { liveWinsDataStore } from '@/components/pages/casino/LiveWins/store';\nimport { StyledButtonGroup } from '@/components/features/casino/crash/BetBox/styles';\nimport Tabs from '@mui/material/Tabs';\nimport Tab from '@mui/material/Tab';\nimport { usePageVisibility } from '@/hooks/usePageVisibility';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CasinoPageLivWinsProps {}\n\nconst liveWinLatestDataQue: Array> = [];\n\nexport const StyledLiveButtonGroup = styled(ButtonGroup)({\n ['& .MuiButtonGroup-grouped']: {\n borderRadius: '0px',\n },\n ['& .MuiButtonGroup-middleButton']: {\n borderRadius: '6px',\n },\n});\n\nexport const StyledLiveButton = styled(Button, {\n shouldForwardProp: (prop) => prop !== 'isActive',\n})<{ isActive?: boolean }>(({ theme, isActive }) => ({\n marginRight: '4px',\n borderRadius: `${theme.shape.borderRadius} !important`,\n ['&:hover']: {\n background: theme.palette.grey[800],\n color: theme.palette.primary.main,\n },\n ['&.Mui-disabled']: {\n color: theme.palette.grey[400],\n },\n ['&.Mui-selected']: {\n background: theme.palette.primary.light,\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.grey[900],\n minWidth: '40px',\n },\n ...(isActive && {\n background: theme.palette.primary.light,\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.grey[900],\n }),\n}));\n\nexport function CasinoPageLivWins(props: CasinoPageLivWinsProps) {\n const { t } = useTranslation();\n const liveWinTabs = [\n {\n label: t('Live Wins'),\n value: 'latest',\n },\n {\n label: t('D'),\n value: 'day',\n },\n {\n label: t('W'),\n value: 'week',\n },\n // {\n // label: t('M'),\n // value: 'month',\n // },\n ];\n\n const [liveWinLastUpdateTime, setLiveWinLastUpdateTime] = useState(0);\n const [currantBetTab, setCurrantBetTab] =\n useState>('latest');\n const [liveWinsDatas, setLiveWinsDatas] = useAtom(liveWinsDataStore);\n\n const queryKey =\n queryKeysFactory.casino.queryPlatformLiveWinBets(currantBetTab);\n const { isLoading, isFetching } = useQuery({\n keepPreviousData: true,\n cacheTime: Infinity,\n queryKey: queryKey,\n queryFn: (ctx) => {\n return getLiveWinBets(currantBetTab);\n },\n onSuccess: (data) => {\n setLiveWinsDatas((prev) => ({\n ...prev,\n [currantBetTab]: data?.data?.wins.slice(0, 20) || [],\n }));\n },\n });\n\n const currentTabData = liveWinsDatas[currantBetTab] || [];\n\n useGlobalWebSocket({\n category: WebSocketCategoryEnum.RECORD,\n command: WebSocketCommandsEnum.LIVE_WINS_LATEST_COMMAND,\n onMessage: ({ data }) => {\n try {\n if (data?.data) {\n liveWinLatestDataQue.push(data?.data);\n }\n } catch (e) {\n console.error(e, data);\n }\n },\n });\n\n useEffect(() => {\n const updateArray = (timestamp) => {\n const diff = (timestamp - liveWinLastUpdateTime) / 10;\n if (!liveWinLastUpdateTime || diff >= 4000) {\n if (liveWinLatestDataQue?.length > 0) {\n const newItem = liveWinLatestDataQue.shift();\n setLiveWinsDatas((prev) => ({\n ...prev,\n latest: [newItem, ...prev.latest].slice(0, 20),\n }));\n setLiveWinLastUpdateTime(timestamp);\n }\n }\n\n requestAnimationFrame(updateArray);\n };\n\n const frameId = requestAnimationFrame(updateArray);\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [liveWinLastUpdateTime]);\n\n const slideWidthWithDifferenceScreen = useResponseWidth([70, 70, 70, 70, 70]);\n\n const slideHeightWithDifferenceScreen = useResponseWidth([\n 100, 100, 100, 100, 100,\n ]);\n\n const spaceBetween = useResponseWidth([8, 8, 8, 8, 10]);\n\n const handleTabChange = (\n event: React.SyntheticEvent,\n newValue: TInferSchemaType,\n ) => {\n setCurrantBetTab(newValue);\n };\n\n const winsData = currentTabData || [];\n\n return (\n \n \n {liveWinTabs.map((child, index) => (\n \n ))}\n \n \n \n {isLoading || isFetching\n ? times(20, (index) => (\n \n \n \n \n \n \n \n \n ))\n : winsData?.map((item, index) => {\n return (\n \n \n \n \n \n \n \n theme.palette.success.main,\n fontSize: '10px',\n textAlign: 'center',\n fontWeight: 600,\n textTransform: 'capitalize',\n }}\n />\n \n \n \n );\n })}\n \n \n \n );\n}\n\nexport default CatchError(CasinoPageLivWins);\n","import { getLocalStorage, setLocalStorage } from '@/utils/localStoreHelper';\nimport { LOCAL_KEY_USER_UUID } from '@/constants/localStorageKeys';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport const getDeviceUid = () => {\n let deviceUid = getLocalStorage(LOCAL_KEY_USER_UUID);\n\n if (!deviceUid) {\n deviceUid = uuidv4();\n setLocalStorage(LOCAL_KEY_USER_UUID, deviceUid);\n }\n\n return deviceUid;\n};\n\nexport default getDeviceUid;\n","import useWebSocket, { ReadyState } from 'react-use-websocket';\nimport * as configs from '@/configs';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { useAtomValue } from 'jotai';\nimport { isLoggedIn } from '@/state/userInfo';\nimport { COOKIE_KEY_USER_TOKEN } from '@/constants/cookieStorageKeys';\nimport Cookie from '@/utils/cookies';\n\nimport getDeviceUid from '@/helper/getDeviceUid';\nimport {\n IWebSocketData,\n WebSocketCategoryEnum,\n WebSocketCommandsEnum,\n} from '@/types/WS';\nimport { getLocalStorage } from '@/utils/localStoreHelper';\nimport { LOCAL_KEY_USER_TOKEN } from '@/constants/localStorageKeys';\nimport { usePageVisibility } from '@/hooks/usePageVisibility';\n\nconst deviceUid = getDeviceUid();\nconst socketUrl = configs.env.endpoints.websocket;\n\nexport const useGlobalWebsocket = ({\n onMessage,\n category,\n command,\n shouldConnect: shouldReconnectProp,\n}: {\n onMessage?: (data: { data: IWebSocketData[T] }) => void;\n category: T;\n command?: WebSocketCommandsEnum;\n shouldConnect?: boolean;\n}) => {\n const isPageActive = usePageVisibility();\n const [deviceOrUserInfoRegistered, setDeviceOrUserInfoRegistered] =\n useState(false);\n const wsConnectedPromiseRef = useRef>();\n const wsConnectedResolveRef =\n useRef<(ins: WebSocketEventMap['open']) => void>();\n const isLogin = useAtomValue(isLoggedIn);\n const shouldConnect = true;\n\n const {\n sendMessage,\n sendJsonMessage,\n readyState,\n lastJsonMessage,\n getWebSocket,\n lastMessage,\n } = useWebSocket(\n socketUrl,\n {\n share: true,\n //Will attempt to reconnect on all close events, such as server shutting down\n shouldReconnect: (closeEvent) => isPageActive,\n heartbeat: {\n message: 'ping',\n returnMessage: 'pong',\n timeout: 60000, // 1 minute, if no response is received, the connection will be closed\n interval: 25000, // every 25 seconds, a ping message will be sent\n },\n filter: (message) => {\n if (message.data === 'pong') {\n return true;\n }\n const inComingMessage = JSON.parse(message.data);\n if (command === undefined && category === undefined) return true;\n return command === undefined\n ? inComingMessage.data?.category === category\n : inComingMessage.data?.category === category &&\n inComingMessage.data?.command === command;\n },\n onOpen: (ins) => {\n if (wsConnectedResolveRef.current) {\n wsConnectedResolveRef.current(ins);\n }\n },\n onClose: () => {\n console.log('WebSocket close');\n },\n onError: (e) => {\n console.error('WebSocket error', e);\n },\n onMessage: ({ data }) => {\n try {\n if (data === 'pong' || !data) return;\n const metaData = JSON.parse(data);\n // reconnect\n if (metaData?.command === WebSocketCommandsEnum.RECONNECT) {\n if (!isLogin) {\n registerDeviceInfo();\n return;\n }\n\n if (isLogin) {\n registerUserInfo();\n }\n }\n\n if (category === undefined && command === undefined) {\n return onMessage?.({ data: metaData });\n }\n if (category !== undefined && command !== undefined) {\n return (\n metaData?.data?.category === category &&\n metaData?.data?.command === command &&\n onMessage?.({ data: metaData })\n );\n }\n if (\n metaData?.data?.category === category ||\n metaData?.data?.command === command\n ) {\n return onMessage?.({ data: metaData });\n }\n } catch (e) {\n console.error(\n `useGlobalWebsocket onMessage error, category ${category}`,\n e,\n );\n }\n },\n },\n // shouldReconnect: true,\n shouldConnect,\n );\n\n const advancedSendJsonMessage = (message?: any) => {\n if (readyState === ReadyState.OPEN) {\n sendJsonMessage({\n ...message,\n });\n }\n };\n\n const registerDeviceInfo = useCallback(() => {\n if (readyState !== ReadyState.OPEN) return;\n sendJsonMessage({\n deviceUid,\n command: WebSocketCommandsEnum.LOGIN_REQUEST,\n });\n }, [readyState, sendJsonMessage]);\n\n const registerUserInfo = useCallback(() => {\n if (readyState !== ReadyState.OPEN) return;\n const { cookie } = new Cookie();\n const token =\n cookie.get(COOKIE_KEY_USER_TOKEN) ||\n getLocalStorage(LOCAL_KEY_USER_TOKEN);\n sendJsonMessage({\n deviceUid,\n token: token,\n command: WebSocketCommandsEnum.LOGIN_REQUEST,\n });\n }, [readyState, sendJsonMessage]);\n\n const clearUserInfo = () => {\n if (readyState !== ReadyState.OPEN) return;\n sendJsonMessage({\n deviceUid,\n command: 1,\n });\n setDeviceOrUserInfoRegistered(false);\n };\n\n useEffect(() => {\n wsConnectedPromiseRef.current = new Promise(\n (resolve) => {\n wsConnectedResolveRef.current = resolve;\n },\n );\n }, []);\n\n useEffect(() => {\n if (readyState === ReadyState.CONNECTING) return;\n\n if (!isLogin) {\n registerDeviceInfo();\n return;\n }\n\n if (isLogin) {\n registerUserInfo();\n }\n }, [readyState, isLogin, registerDeviceInfo, registerUserInfo]);\n\n return {\n readyState,\n sendMessage,\n sendJsonMessage: advancedSendJsonMessage,\n lastMessage,\n lastJsonMessage,\n registerDeviceInfo,\n registerUserInfo,\n };\n};\n\nexport default useGlobalWebsocket;\n","import { useEffect, useState } from 'react';\n\nexport const usePageVisibility = () => {\n const [isPageActive, setIsPageActive] = useState(true);\n\n useEffect(() => {\n const handleVisibilityChange = () => {\n setIsPageActive(!document.hidden);\n };\n\n document.addEventListener('visibilitychange', handleVisibilityChange);\n\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n };\n }, []);\n\n return isPageActive;\n};\n","import { IBetRecord } from '@/apis/bet-record';\nimport { TInferSchemaType, wsBalanceChangeSchema } from '@/constants/schemas';\n\nexport enum WebSocketCategoryEnum {\n /**\n * placeholder\n */\n UNKNOWN = 0,\n /**\n * message from websocket system\n */\n WEBSOCKET = 1,\n /**\n * message from Crash game\n */\n CRASH_GAME = 2,\n /**\n * message from Rush game\n */\n RUSH_GAME = 3,\n /**\n * message from payment system\n */\n PAYMENT = 4,\n /**\n * currently for betting record\n */\n RECORD = 5,\n}\n\nexport enum WebSocketCommandsEnum {\n UNKNOWN_COMMAND = 0,\n\n LOGIN_REQUEST = 1,\n\n LOGIN_RESPONSE = 2,\n\n GAME_ENTER_REQUEST = 3,\n\n GAME_ENTER_RESPONSE = 4,\n\n GAME_QUIT_REQUEST = 5,\n\n GAME_QUIT_RESPONSE = 6,\n\n MOON_CRASH_STATUS_NOTIFY_COMMAND = 7,\n\n MOON_CRASH_CASH_OUT_EVENT_NOTIFY_COMMAND = 8,\n\n MOON_CRASH_BET_EVENT_NOTIFY_COMMAND = 9,\n\n USER_ACCOUNT_CHANGE_COMMAND = 10,\n\n RECONNECT = 11,\n\n CRASH_ONLINE_USER_COMMAND = 12,\n\n GLOBAL_BET_HISTORY_COMMAND = 13,\n\n USER_BET_HISTORY_COMMAND = 14,\n\n HIGH_ROLLER_HISTORY_COMMAND = 15,\n\n /**\n * 推送rush最新的游戏状态\n */\n RUSH_STATUS_NOTIFY_COMMAND = 16,\n\n LIVE_WINS_LATEST_COMMAND = 21,\n LUCKY_BET_HISTORY_COMMAND = 20,\n\n RUSH_BET_EVENT = 22,\n\n // command logout\n}\n\nexport interface IWebSocketData {\n [WebSocketCategoryEnum.UNKNOWN]: any;\n [WebSocketCategoryEnum.WEBSOCKET]: any;\n [WebSocketCategoryEnum.CRASH_GAME]: any;\n [WebSocketCategoryEnum.RUSH_GAME]: any;\n [WebSocketCategoryEnum.PAYMENT]: {\n data: TInferSchemaType;\n };\n [WebSocketCategoryEnum.RECORD]: {\n data: IBetRecord;\n };\n}\n\nexport enum WsEvent {\n Subscribe = 'subscribe',\n Complete = 'complete',\n Unsubscribe = 'complete',\n}\n\nexport enum WsQuery {\n AllHouseBetsSubscription = 'AllHouseBetsSubscription',\n Crash = 'Crash',\n LuckyPot = 'LuckyPot',\n}\n\nexport interface WsRequest {\n id: string;\n type: WsEvent;\n payload: {\n query: WsQuery;\n };\n}\n"],"names":["getValidReactChildren","children","react__WEBPACK_IMPORTED_MODULE_0__","Children","toArray","filter","child","isValidElement","Wrapper","styled","Link","_ref","theme","display","alignItems","position","whiteSpace","__webpack_exports__","_ref2","game","_ref2$showThumb","showThumb","_ref2$sx","sx","gameId","provider","thumbUrl","gameSlug","coverImg","getGameCoverPath","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__","jsxs","href","concat","jsx","_components_ui_LazyLoadedImage__WEBPACK_IMPORTED_MODULE_1__","Z","src","alt","style","width","height","borderRadius","objectFit","marginRight","z","amount","currency","id","currencyInfo","SCurrencyInfoSchema","multiplier","gameName","SGameProvidersSchema","product","category","payout","timestamp","userName","useResponseWidth","widths","arguments","length","undefined","_useTheme","useTheme","defaultWidth","breakpoints","useMediaQuery","down","between","up","i","nativeMin","Math","min","lodash_es_times","n","iteratee","toInteger","index","_castFunction","result","_baseTimes","StyledCardContainer","Box","flexDirection","justifyContent","StyledImageSection","minHeight","overflow","StyledTextSection","defineProperty","padding","spacing","textAlign","_ref4","fontSize","border","background","transform","transformOrigin","margin","mt","liveWinsDataStore","atom","latest","month","week","day","liveWinLatestDataQue","StyledLiveButtonGroup","ButtonGroup","_styled","StyledLiveButton","Button","shouldForwardProp","prop","_objectSpread2","isActive","_objectSpread","shape","palette","grey","color","primary","main","light","minWidth","CasinoPageLivWins","props","t","_useTranslation","useTranslation","liveWinTabs","label","value","_useState","useState","liveWinLastUpdateTime","setLiveWinLastUpdateTime","_useState2","currantBetTab","setCurrantBetTab","_useAtom","useAtom","_useAtom2","slicedToArray","liveWinsDatas","setLiveWinsDatas","queryKey","queryKeysFactory","_useQuery","useQuery","keepPreviousData","cacheTime","Infinity","queryFn","ctx","request","url","method","onSuccess","data","prev","_data$data","wins","slice","isLoading","isFetching","currentTabData","useGlobalWebSocket","WebSocketCategoryEnum","command","WebSocketCommandsEnum","onMessage","push","e","console","error","useEffect","frameId","requestAnimationFrame","updateArray","diff","newItem","shift","toConsumableArray","cancelAnimationFrame","slideWidthWithDifferenceScreen","slideHeightWithDifferenceScreen","spaceBetween","winsData","jsx_runtime","mb","Tabs","onChange","event","newValue","gap","map","_child$value","Tab","dist","ZP","slideWidth","cellSpacing","renderBottomCenterControls","renderCenterLeftControls","renderCenterRightControls","slidesToScroll","times","Skeleton","animation","variant","item","GameLink","CasinoCoverImage","TruncatedTextTooltip","title","textSx","textTransform","formatCurrency","Number","decimalPlaces","success","fontWeight","LiveWins","CatchError","deviceUid","getLocalStorage","LOCAL_KEY_USER_UUID","uuidv4","setLocalStorage","socketUrl","configs","hooks_useGlobalWebsocket","shouldConnect","isPageActive","usePageVisibility","wsConnectedPromiseRef","useRef","wsConnectedResolveRef","isLogin","useAtomValue","isLoggedIn","_useWebSocket","useWebSocket","share","shouldReconnect","closeEvent","heartbeat","message","returnMessage","timeout","interval","_inComingMessage$data","_inComingMessage$data2","_inComingMessage$data3","inComingMessage","JSON","parse","onOpen","ins","current","onClose","log","onError","_metaData$data3","_metaData$data4","_metaData$data","_metaData$data2","metaData","registerDeviceInfo","registerUserInfo","sendMessage","sendJsonMessage","readyState","lastJsonMessage","lastMessage","getWebSocket","useCallback","ReadyState","LOGIN_REQUEST","token","cookie","Cookie","get","COOKIE_KEY_USER_TOKEN","LOCAL_KEY_USER_TOKEN","Promise","resolve","setIsPageActive","handleVisibilityChange","document","hidden","addEventListener","removeEventListener","WsEvent","WsQuery"],"sourceRoot":""}