\n {showAdvancedHeader &&
}\n {((isMobile() && onBack) || showGoBack) &&
}\n\n {isMobile() || isLive || isLivePage ? (\n
\n \n
\n ) : (\n
\n )}\n\n {isLivePage ? (\n !isMobile() ? (\n hasAdditionalStatistics ? (\n
\n ) : null\n ) : MATCH_TRACKER_AVAILABLE_SPORTS.includes(params.sport) || isLive ? (\n
\n ) : null\n ) : null}\n\n {isMobile() &&\n (isLive || isLivePage) &&\n configs.spbLayoutType !== ESportsbookLayoutTypes.ADVANCED && (\n
{}}\n items={[\n {\n key: 'markets',\n title: (\n \n )\n },\n {\n key: 'matches',\n title: (\n \n )\n }\n ]}\n />\n )}\n \n \n );\n};\n","import {\n memo,\n ReactElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch, useSelector } from 'react-redux';\nimport {\n getSportsbookSingleGameRelations,\n PAYOUT_AVAILABLE_SPORTS,\n PREMATCH_GAME_TYPE_FOR_SWARM\n} from 'utils/constants/sportsbook/data-fields';\nimport { GAME_TYPE_LIVE } from 'utils/constants/sportsbook/generic';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { GLOBALS } from 'utils/generic/global-variables';\nimport { lazy } from 'utils/generic/lazy';\nimport { getMountPath, mountPoint } from 'utils/generic/route-manipulation';\nimport { showToastWarning } from 'utils/generic/show-toast-warning';\nimport { ESPORTS_ADDITIONAL_DATA } from 'utils/helpers/moba-games-statistics-options';\nimport { isMobile } from 'utils/is-mobile';\nimport { setMissingMarketGroupNameOther } from 'utils/sportsbook/set-missing-market-group-name-other';\nimport RidGenerator from 'utils/swarm/rid-generator';\nimport { ENotRealSports } from 'interfaces/not-real-sports';\nimport {\n ESportsbookLayoutTypes,\n ESportsbookPageTypes,\n TSportsbookConfigs\n} from 'interfaces/sportsbook-configs';\nimport {\n GameInfoAdditionalDataMap,\n Sport\n} from 'interfaces/sportsbook-data-levels';\nimport { executeCommand, unsubscribeCommand } from 'services/get-data-level';\nimport { SingleGameViewSkeleton } from './SingleGameViewSkeleton';\nimport { addQuery, getSavedLocation } from 'components/QueryRoute';\nimport { Viewport } from 'components/Viewport';\nimport { useSportsbookConfigs } from 'hooks/sportsbook/useSportsbookConfigs';\nimport { useScrollToTop } from 'hooks/useScrollToTop';\nimport { useSearchParams } from 'hooks/useSearchParams';\nimport { useCustomHistory } from 'newhooks/generic/useCustomHistory';\nimport { useSbRouteMatch } from 'newhooks/generic/useSbRouteMatch';\nimport { setAdditionalStatisticsData } from 'store/actions';\nimport { resetMatchStreamingState } from 'store/actions/match-streaming';\nimport {\n setAllMetaData,\n setCompetitionMetaData,\n setGameMetaData,\n setSportMetaData\n} from 'store/actions/meta-data';\nimport {\n setSingleGameData,\n setSportsbookSelectedSport\n} from 'store/actions/new-sportsbook';\nimport { TGameDataWithMoreInfo } from 'store/reducers/new-sportsbook';\nimport { getAdditionalStatisticsData } from 'store/selectors/e-sport-data';\nimport {\n getSingleGameData,\n getSportsbookSelectedSport\n} from 'store/selectors/new-sportsbook';\nimport './index.less';\n\nconst { SingleGameViewMobile } = lazy(\n () => import(/* webpackChunkName: \"single-view-mobile\" */ './Mobile')\n);\n\nconst { SingleGameViewDesktop } = lazy(\n () => import(/* webpackChunkName: \"single-view-desktop\" */ './Desktop')\n);\n\nexport type TSingleGameViewProps = {\n gameData: TGameDataWithMoreInfo;\n onBack: () => void;\n isLive: boolean;\n openTimeLine: boolean;\n setOpenTimeLine: (arg: (prev: any) => boolean) => void;\n configs: TSportsbookConfigs;\n showGoBack?: boolean;\n showAdvancedHeader?: boolean;\n};\n\nexport const SingleGameView = memo(\n ({\n showGoBack,\n showAdvancedHeader\n }: Pick<\n TSingleGameViewProps,\n 'showGoBack' | 'showAdvancedHeader'\n >): ReactElement | null => {\n const configs = useSportsbookConfigs();\n const { params, path } = useSbRouteMatch();\n const { region, competition, game, sport } = params;\n const searchParams = useSearchParams();\n const { history, goBack } = useCustomHistory();\n const dispatch = useDispatch();\n const { t } = useTranslation();\n\n const additionalStatisticsData = useSelector(getAdditionalStatisticsData);\n const selectedSport = useSelector(getSportsbookSelectedSport);\n\n const currentMapData = useMemo(\n () => ESPORTS_ADDITIONAL_DATA[sport],\n [sport]\n );\n\n const [openTimeLine, setOpenTimeLine] = useState(false);\n\n const isFavoriteTeam =\n params.category === ENotRealSports.team ||\n params['0'] === ENotRealSports.team;\n\n const gameId = isFavoriteTeam && !isMobile() ? competition : game;\n\n const gameData = useSelector(getSingleGameData)?.[gameId];\n\n const isLive =\n gameData?.game.type === 1 || Number(searchParams.gameType) === 1;\n\n const hasAdditionalStatistics =\n Object.keys(ESPORTS_ADDITIONAL_DATA).includes(sport) && isLive;\n\n useScrollToTop(isMobile() ? 'singleGameViewPage' : 'desktopScrollArea', [\n gameData?.game.id\n ]);\n\n const setGameData = (swarmData: { sport: Record