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3B,SAAAA,CAAA,CAAAT,IAAAA,CAAA,EAAgBlB,KAC5B0S,EAAA,UACA,IAAAxK,EAAA,MAA2B,GAAA9G,EAAAi4B,EAAA,EAAY,CACvCr6B,QAAAA,EACAo6B,OAAAA,EACAp3B,QAAAL,EAAAd,EAAA,GAEA,IAAAqH,EACA,OAAAA,EAEA,IAAgBmN,QAAAA,CAAA,CAAAikB,eAAAA,CAAA,IAAAhwB,EAAA,CAAmCpB,EACnD,OACA,GAAAoB,CAAA,CACAiwB,YAAAD,CACA,CACA,EACA,MAAW,GAAAzlB,EAAAzM,CAAA,EAAQ,CACnB0M,SAAA,cAAAslB,EAAAl4B,EAAAlC,GAAAmJ,cAAA,CACAuK,QAAAA,EACAqB,qBAAA,GACAtB,QAAA7C,CAAAA,CAAA5Q,CACA,EACA","sources":["webpack://_N_E/./node_modules/@azuro-org/sdk/dist/index.js"],"sourcesContent":["import {c as cookieKeys,a as configRef,l as localStorageKeys,D as DEFAULT_DEADLINE,L as LIVE_STATISTICS_SUPPORTED_SPORTS,b as LIVE_STATISTICS_SUPPORTED_PROVIDERS}from'./config.js';import {jsx,jsxs}from'react/jsx-runtime';import {createContext,useContext,useSyncExternalStore,useState,useEffect,useRef,useMemo,useCallback,useReducer}from'react';import {chainsData,liveHostAddress,calcPrematchOdds,calcLiveOdds,PrematchConditionsBatchDocument,getFreeBets,ODDS_DECIMALS,ConditionStatus,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,PrematchConditionFragmentDoc,Bet_OrderBy,OrderDirection,GraphBetStatus,PrematchBetsDocument,BetResult,SelectionResult,PrematchGraphGameStatus,LiveBetsDocument,GamesDocument,PrematchConditionsDocument,LiveConditionsDocument,MARGIN_DECIMALS,GameDocument,GameStatus,groupConditionsByMarket,Game_OrderBy,SportsDocument,SportsNavigationDocument,NavigationDocument,getLiveBetFee,BettorsDocument,GameBetsDocument,LiveBetFragmentDoc,PrematchBetFragmentDoc,BettorFragmentDoc,LiveConditionFragmentDoc,LiveConditionDocument,PrematchConditionDocument,liveCoreAbi,freeBetAbi,calcMindOdds,getLiveBetTypedData,createLiveBet,LiveBetState,getLiveBet,getPrematchBetDataBytes,getProviderFromId,getGameStatus,getPrecalculatedCashouts,getCalculatedCashout,getCashoutTypedData,createCashout,CashoutState,getCashout,getWaveLevels,getWaveStats,getWavePeriods,getWaveLeaderBoard,activateWave,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,createDeBridgeBet,getDeBridgeOrder,DeBridgeExternalCallStatus,DeBridgeOrderStatus}from'@azuro-org/toolkit';import {useAccount,useConfig,useWatchContractEvent,useChains,useSendTransaction,useWaitForTransactionReceipt,useReadContract,useBalance,useWalletClient,useWriteContract}from'wagmi';import {HttpLink,ApolloClient,InMemoryCache,useQuery as useQuery$1}from'@apollo/client';import {decodeEventLog,formatUnits,parseUnits,encodeFunctionData,erc20Abi,maxUint256,zeroAddress}from'viem';import {getMarketName,getSelectionName}from'@azuro-org/dictionaries';import {base,baseSepolia,gnosis}from'viem/chains';import {useQuery,useQueryClient,useMutation}from'@tanstack/react-query';import {waitForTransactionReceipt,getTransactionReceipt}from'wagmi/actions';import {readContract}from'@wagmi/core';var SportHub;\n(function (SportHub) {\n SportHub[\"Sports\"] = \"sports\";\n SportHub[\"Esports\"] = \"esports\";\n SportHub[\"Unique\"] = \"unique\";\n})(SportHub || (SportHub = {}));\nvar BetType;\n(function (BetType) {\n BetType[\"Unredeemed\"] = \"unredeemed\";\n BetType[\"Accepted\"] = \"accepted\";\n BetType[\"Settled\"] = \"settled\";\n BetType[\"CashedOut\"] = \"cashedOut\";\n})(BetType || (BetType = {}));const DumbContext = createContext(undefined);\nlet ready = false;\nlet listeners = [];\nconst readyStore = {\n setReady(value = true) {\n ready = value;\n emitChange();\n },\n subscribe(listener) {\n listeners = [...listeners, listener];\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n getSnapshot() {\n return ready;\n },\n};\nconst emitChange = () => {\n for (let listener of listeners) {\n listener();\n }\n};\nlet useAccountWithAA = () => useContext(DumbContext);\nlet _useAAWalletClient = () => useContext(DumbContext);\nconst useExtendedAccount = () => {\n const account = useAccount();\n const ready = useSyncExternalStore(readyStore.subscribe, readyStore.getSnapshot, () => false);\n const accountWithAA = useAccountWithAA();\n return accountWithAA || { ...account, isAAWallet: false, ready };\n};\nconst useAAWalletClient = () => {\n useSyncExternalStore(readyStore.subscribe, readyStore.getSnapshot, () => false);\n return _useAAWalletClient();\n};\n(async () => {\n try {\n const pkg = await import('@azuro-org/sdk-social-aa-connector');\n if (typeof pkg.useAccount === 'function') {\n useAccountWithAA = pkg.useAccount;\n }\n if (typeof pkg.useAAWalletClient === 'function') {\n _useAAWalletClient = pkg.useAAWalletClient;\n }\n readyStore.setReady();\n }\n catch (e) {\n readyStore.setReady();\n }\n})();const ChainContext = createContext(null);\nconst useChain = () => {\n return useContext(ChainContext);\n};\nconst ChainProvider = (props) => {\n const { children, initialChainId } = props;\n const [appChainId, setAppChainId] = useState(initialChainId);\n const { chain: walletChain, isAAWallet } = useExtendedAccount();\n const aaWalletClient = useAAWalletClient();\n const walletChainId = walletChain?.id || null;\n const isRightNetwork = walletChainId === appChainId;\n const { chain, contracts, betToken, graphql, socket, api, environment } = chainsData[appChainId];\n const handleChangeChain = (chainId) => {\n document.cookie = `${cookieKeys.appChainId}=${chainId};path=/;`;\n setAppChainId(chainId);\n };\n useEffect(() => {\n if (isAAWallet && aaWalletClient && aaWalletClient.chain.id !== appChainId) {\n aaWalletClient.switchChain({ id: appChainId });\n }\n }, [isAAWallet, aaWalletClient, appChainId]);\n const context = {\n appChain: chain,\n walletChain,\n contracts,\n betToken,\n graphql,\n socket,\n api,\n environment,\n isRightNetwork,\n setAppChainId: handleChangeChain,\n };\n return (jsx(ChainContext.Provider, { value: context, children: children }));\n};const getPrematchLink = (chainId) => {\n return new HttpLink({\n uri: ({ operationName }) => `${chainsData[chainId].graphql.prematch}?op=${operationName}`,\n });\n};\nconst getLiveLink = (chainId) => {\n return new HttpLink({\n uri: ({ operationName }) => `${chainsData[chainId].graphql.live}?op=${operationName}`,\n });\n};\nconst typePolicies = {\n Query: {\n fields: {\n bets: {\n merge(existing, incoming, { args }) {\n // in case of fetching first paginated portion, we should drop cache to avoid data mismatch/shifting\n if (!args?.skip || !existing?.length) {\n return incoming;\n }\n return [...(existing || []), ...incoming];\n },\n },\n liveBets: {\n merge(existing, incoming, { args }) {\n // in case of fetching first paginated portion, we should drop cache to avoid data mismatch/shifting\n if (!args?.skip || !existing?.length) {\n return incoming;\n }\n return [...(existing || []), ...incoming];\n },\n },\n },\n },\n};\nconst getPrematchApolloClient = (chainId) => {\n const link = getPrematchLink(chainId);\n return new ApolloClient({\n link,\n ssrMode: typeof window === 'undefined',\n cache: new InMemoryCache({ typePolicies }),\n connectToDevTools: true,\n assumeImmutableResults: true,\n });\n};\nconst getLiveApolloClient = (chainId) => {\n const link = getLiveLink(chainId);\n return new ApolloClient({\n link,\n ssrMode: typeof window === 'undefined',\n cache: new InMemoryCache(),\n connectToDevTools: true,\n assumeImmutableResults: true,\n });\n};\nconst apolloClients = {\n prematchClient: null,\n liveClient: null,\n};\nconst getApolloClients = (chainId) => {\n if (typeof window === 'undefined') {\n return {\n prematchClient: getPrematchApolloClient(chainId),\n liveClient: getLiveApolloClient(chainId),\n };\n }\n if (!apolloClients.prematchClient) {\n apolloClients.prematchClient = getPrematchApolloClient(chainId);\n apolloClients.liveClient = getLiveApolloClient(chainId);\n }\n return apolloClients;\n};\nconst Context = createContext(null);\nconst useApolloClients = () => {\n return useContext(Context);\n};\nconst ApolloProvider = (props) => {\n const { children } = props;\n const { appChain } = useChain();\n const prevAppChainIdRef = useRef(appChain.id);\n const apolloClientsRef = useRef(getApolloClients(appChain.id));\n // set new link before render for send requests with new one\n useMemo(() => {\n if (appChain.id !== prevAppChainIdRef.current) {\n const { prematchClient, liveClient } = apolloClientsRef.current;\n const prematchLink = getPrematchLink(appChain.id);\n prematchClient.setLink(prematchLink);\n prematchClient.resetStore();\n if (chainsData[prevAppChainIdRef.current].graphql.live !== chainsData[appChain.id].graphql.live) {\n const liveLink = getLiveLink(appChain.id);\n liveClient.setLink(liveLink);\n liveClient.resetStore();\n }\n prevAppChainIdRef.current = appChain.id;\n }\n }, [appChain.id]);\n return (jsx(Context.Provider, { value: apolloClientsRef.current, children: children }));\n};function debounce(func, wait, withMaxRequests) {\n let timeout;\n let requests = 0;\n return function (...args) {\n const context = this;\n const later = function () {\n timeout = undefined;\n requests = 0;\n func.apply(context, args);\n };\n if (withMaxRequests) {\n requests++;\n }\n if (requests > 10) {\n requests = 0;\n func.apply(context, args);\n }\n if (timeout !== undefined) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(later, wait);\n };\n}const createQueueAction = (subscribe, unsubscribe) => {\n const actions = {\n subscribe: [],\n unsubscribe: [],\n };\n // group batch requests\n const request = debounce(() => {\n const subscribeQueue = [...actions.subscribe];\n const unsubscribeQueue = [...actions.unsubscribe];\n actions.subscribe = [];\n actions.unsubscribe = [];\n const weights = {};\n subscribeQueue.forEach(id => {\n if (!weights[id]) {\n weights[id] = 1;\n }\n else {\n weights[id]++;\n }\n });\n unsubscribeQueue.forEach(id => {\n if (!weights[id]) {\n weights[id] = -1;\n }\n else {\n weights[id]--;\n }\n });\n const { subscribeWeights, unsubscribeWeights } = Object.keys(weights).reduce((acc, id) => {\n // ATTN: equal cause we need to fire subscribe for new elements\n // and then trigger watcher (we don't have store)\n if (weights[id] >= 0) {\n acc.subscribeWeights[id] = weights[id];\n }\n else if (weights[id] < 0) {\n acc.unsubscribeWeights[id] = weights[id];\n }\n return acc;\n }, {\n subscribeWeights: {},\n unsubscribeWeights: {},\n });\n if (Object.keys(subscribeWeights).length) {\n subscribe(subscribeWeights);\n }\n if (Object.keys(unsubscribeWeights).length) {\n unsubscribe(unsubscribeWeights);\n }\n }, 50);\n const run = (action, values) => {\n request();\n values.forEach(value => {\n actions[action].push(value);\n });\n };\n return run;\n};let ref = {\n lastUpdateTime: undefined,\n};\nconst getGameStartsAtValue = () => {\n let startsAt;\n const dateNow = Math.floor(Date.now() / 1000);\n // if first render or current time is greater the previous saved more than cache time\n if (!ref.lastUpdateTime\n || dateNow - ref.lastUpdateTime > configRef.gamesCacheTime) {\n startsAt = dateNow;\n ref.lastUpdateTime = dateNow;\n }\n else {\n startsAt = ref.lastUpdateTime;\n }\n return startsAt;\n};const getEventArgsFromTxReceipt = ({ receipt, eventName, abi, params }) => {\n const { logs } = receipt;\n let result;\n for (let index = 0; index < logs.length; index++) {\n try {\n const log = logs[index];\n result = decodeEventLog({\n abi,\n topics: log.topics,\n eventName,\n data: log.data,\n });\n if (result.eventName.toLowerCase() !== eventName.toLowerCase()) {\n result = undefined;\n continue;\n }\n if (params && result?.args) {\n const isMatchByParams = Object.keys(params).every(paramKey => {\n const argsParam = typeof params[paramKey] === 'string' ? (result.args[paramKey]?.toLowerCase()) : (result.args[paramKey]);\n const paramsParam = typeof params[paramKey] === 'string' ? (params[paramKey].toLowerCase()) : (params[paramKey]);\n return argsParam === paramsParam;\n });\n if (!isMatchByParams) {\n result = undefined;\n }\n }\n if (result) {\n break;\n }\n }\n catch { }\n }\n if (result?.args) {\n return result?.args;\n }\n};const formatToFixed = (value, digitsCount) => {\n value = String(value);\n if (!/\\./.test(value)) {\n return value;\n }\n const [int, digits] = value.split('.');\n if (digitsCount === 0) {\n return int;\n }\n return `${int}.${digits.substring(0, digitsCount)}`;\n};const createBatch = (fn, isSet = true) => {\n let idsWaitList = isSet ? new Set() : [];\n let resolversWaitList = [];\n const request = debounce(async (fn, ...rest) => {\n const ids = [...idsWaitList];\n const resolvers = resolversWaitList;\n if (idsWaitList instanceof Set) {\n idsWaitList.clear();\n }\n else {\n idsWaitList = [];\n }\n resolversWaitList = [];\n try {\n const data = await fn(ids, ...rest);\n resolvers.forEach((resolve) => {\n resolve(data);\n });\n }\n catch (err) {\n resolvers.forEach((resolve) => {\n resolve(undefined);\n });\n }\n }, 50, true);\n const batch = (ids, ...rest) => {\n request(fn, ...rest);\n ids.forEach(id => {\n if (idsWaitList instanceof Set) {\n idsWaitList.add(id);\n }\n else {\n idsWaitList.push(id);\n }\n });\n return new Promise((resolve) => {\n resolversWaitList.push(resolve);\n });\n };\n return batch;\n};const createWatcher = () => {\n const timers = new Map();\n const subscribers = new Map();\n const trigger = (key, value) => {\n const handlers = subscribers.get(key) || [];\n handlers.forEach((cb) => {\n cb(value);\n });\n };\n const subscribe = (key, cb) => {\n const handlers = subscribers.get(key) || [];\n handlers.push(cb);\n subscribers.set(key, handlers);\n return function unsubscribe() {\n const handlers = subscribers.get(key) || [];\n const newHandlers = handlers.filter((handler) => handler !== cb);\n if (newHandlers.length) {\n subscribers.set(key, newHandlers);\n }\n else {\n subscribers.delete(key);\n }\n };\n };\n const dispatch = (key, value) => {\n let timer = timers.get(key);\n if (timer !== undefined) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n timers.delete(key);\n trigger(key, value);\n }, 200);\n timers.set(key, timer);\n };\n return {\n subscribe,\n dispatch,\n };\n};const conditionStatusWatcher = createWatcher();const oddsWatcher = createWatcher();var SocketCloseReason$1;\n(function (SocketCloseReason) {\n SocketCloseReason[SocketCloseReason[\"ChainChanged\"] = 3000] = \"ChainChanged\";\n})(SocketCloseReason$1 || (SocketCloseReason$1 = {}));\nconst OddsSocketContext = createContext(null);\nconst useOddsSocket = () => {\n return useContext(OddsSocketContext);\n};\nconst OddsSocketProvider = ({ children }) => {\n const { appChain } = useChain();\n const [isSocketReady, setSocketReady] = useState(false);\n const prevChainId = useRef(appChain.id);\n const socket = useRef();\n const subscribers = useRef({});\n const subscribe = useCallback((weights) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n Object.keys(weights).forEach((conditionId) => {\n if (typeof subscribers.current[conditionId] === 'undefined') {\n subscribers.current[conditionId] = 0;\n }\n subscribers.current[conditionId] += weights[conditionId];\n });\n socket.current.send(JSON.stringify({\n action: 'subscribe',\n conditionIds: Object.keys(weights),\n }));\n }, []);\n const unsubscribeCall = (conditionIds) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n socket.current.send(JSON.stringify({\n action: 'unsubscribe',\n conditionIds,\n }));\n };\n const unsubscribe = useCallback((weights) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n // we mustn't unsubscribe for condition if it has more that 1 subscriber\n const newUnsubscribers = [];\n Object.keys(weights).forEach((conditionId) => {\n if (subscribers.current[conditionId]) {\n subscribers.current[conditionId] += weights[conditionId];\n if (subscribers.current[conditionId] === 0) {\n delete subscribers.current[conditionId];\n newUnsubscribers.push(conditionId);\n }\n }\n });\n if (!newUnsubscribers.length) {\n return;\n }\n unsubscribeCall(newUnsubscribers);\n }, []);\n const runAction = useCallback(createQueueAction(subscribe, unsubscribe), []);\n const subscribeToUpdates = useCallback((conditionIds) => {\n runAction('subscribe', conditionIds);\n }, []);\n const unsubscribeToUpdates = useCallback((conditionIds) => {\n runAction('unsubscribe', conditionIds);\n }, []);\n const connect = () => {\n socket.current = new WebSocket(`${chainsData[appChain.id].socket}/conditions`);\n socket.current.onopen = () => {\n setSocketReady(true);\n };\n socket.current.onclose = (event) => {\n subscribers.current = {};\n socket.current = undefined;\n setSocketReady(false);\n if (event.code === SocketCloseReason$1.ChainChanged) {\n return;\n }\n connect();\n };\n socket.current.onmessage = (message) => {\n JSON.parse(message.data.toString()).forEach((data) => {\n const { id: conditionId, reinforcement, margin, winningOutcomesCount } = data;\n if (data.outcomes) {\n const eventData = {\n conditionId: conditionId,\n reinforcement: +reinforcement,\n margin: +margin,\n winningOutcomesCount: +winningOutcomesCount,\n outcomes: {},\n };\n eventData.outcomes = data.outcomes.reduce((acc, { id, odds, clearOdds, maxStake }) => {\n acc[id] = {\n odds,\n clearOdds,\n maxBet: maxStake,\n };\n return acc;\n }, {});\n oddsWatcher.dispatch(conditionId, eventData);\n }\n if (data.state) {\n conditionStatusWatcher.dispatch(conditionId, data.state);\n }\n });\n };\n socket.current.onerror = () => {\n subscribers.current = {};\n socket.current = undefined;\n setSocketReady(false);\n setTimeout(connect, 1000);\n };\n };\n useEffect(() => {\n if (isSocketReady\n && socket.current\n && prevChainId.current !== appChain.id\n && chainsData[prevChainId.current].socket !== chainsData[appChain.id].socket) {\n unsubscribeCall(Object.keys(subscribers.current));\n socket.current.close(SocketCloseReason$1.ChainChanged);\n }\n prevChainId.current = appChain.id;\n }, [chainsData[appChain.id].socket, isSocketReady]);\n useEffect(() => {\n if (typeof socket.current !== 'undefined' || isSocketReady) {\n return;\n }\n connect();\n }, [chainsData[appChain.id].socket, isSocketReady]);\n const value = {\n isSocketReady,\n subscribeToUpdates,\n unsubscribeToUpdates,\n };\n return (jsx(OddsSocketContext.Provider, { value: value, children: children }));\n};const liveStatisticWatcher = createWatcher();var SocketCloseReason;\n(function (SocketCloseReason) {\n SocketCloseReason[SocketCloseReason[\"ChainChanged\"] = 3000] = \"ChainChanged\";\n})(SocketCloseReason || (SocketCloseReason = {}));\nvar Status;\n(function (Status) {\n Status[\"InProgress\"] = \"In progress\";\n Status[\"NotStarted\"] = \"Not started yet\";\n Status[\"Finished\"] = \"Finished\";\n Status[\"PreFinished\"] = \"PreFinished\";\n Status[\"CoverageLost\"] = \"Coverage lost\";\n Status[\"Suspended\"] = \"Suspended\";\n})(Status || (Status = {}));\nconst LiveStatisticsSocketContext = createContext(null);\nconst useLiveStatisticsSocket = () => {\n return useContext(LiveStatisticsSocketContext);\n};\nconst LiveStatisticsSocketProvider = ({ children }) => {\n const { appChain } = useChain();\n const [isSocketReady, setSocketReady] = useState(false);\n const prevChainId = useRef(appChain.id);\n const socket = useRef();\n const subscribers = useRef({});\n const subscribe = useCallback((weights) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n Object.keys(weights).forEach((gameId) => {\n if (typeof subscribers.current[gameId] === 'undefined') {\n subscribers.current[gameId] = 0;\n }\n subscribers.current[gameId] += weights[gameId];\n });\n socket.current.send(JSON.stringify({\n action: 'subscribe',\n gameIds: Object.keys(weights),\n }));\n }, []);\n const unsubscribeCall = (gameIds) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n socket.current.send(JSON.stringify({\n action: 'unsubscribe',\n gameIds,\n }));\n };\n const unsubscribe = useCallback((weights) => {\n if (socket.current?.readyState !== 1) {\n return;\n }\n // we mustn't unsubscribe for condition if it has more that 1 subscriber\n const newUnsubscribers = [];\n Object.keys(weights).forEach((gameId) => {\n if (subscribers.current[gameId]) {\n subscribers.current[gameId] += weights[gameId];\n if (subscribers.current[gameId] === 0) {\n delete subscribers.current[gameId];\n newUnsubscribers.push(gameId);\n }\n }\n });\n if (!newUnsubscribers.length) {\n return;\n }\n unsubscribeCall(newUnsubscribers);\n }, []);\n const runAction = useCallback(createQueueAction(subscribe, unsubscribe), []);\n const subscribeToUpdates = useCallback((gameIds) => {\n runAction('subscribe', gameIds);\n }, []);\n const unsubscribeToUpdates = useCallback((gameIds) => {\n runAction('unsubscribe', gameIds);\n }, []);\n const connect = () => {\n socket.current = new WebSocket(`${chainsData[appChain.id].socket}/statistics/games`);\n socket.current.onopen = () => {\n setSocketReady(true);\n };\n socket.current.onclose = (event) => {\n subscribers.current = {};\n socket.current = undefined;\n setSocketReady(false);\n if (event.code === SocketCloseReason.ChainChanged) {\n return;\n }\n connect();\n };\n socket.current.onmessage = (message) => {\n JSON.parse(message.data.toString()).forEach((data) => {\n const { id, fixture, live } = data;\n let statsData = {\n status: fixture?.status || null,\n scoreBoard: live?.scoreBoard || null,\n stats: live?.stats || null,\n };\n liveStatisticWatcher.dispatch(id, statsData);\n });\n };\n socket.current.onerror = () => {\n subscribers.current = {};\n socket.current = undefined;\n setSocketReady(false);\n setTimeout(connect, 1000);\n };\n };\n useEffect(() => {\n if (isSocketReady\n && socket.current\n && prevChainId.current !== appChain.id\n && chainsData[prevChainId.current].socket !== chainsData[appChain.id].socket) {\n unsubscribeCall(Object.keys(subscribers.current));\n socket.current.close(SocketCloseReason.ChainChanged);\n }\n prevChainId.current = appChain.id;\n }, [chainsData[appChain.id].socket, isSocketReady]);\n useEffect(() => {\n if (typeof socket.current !== 'undefined' || isSocketReady) {\n return;\n }\n connect();\n }, [chainsData[appChain.id].socket, isSocketReady]);\n const value = {\n isSocketReady,\n subscribeToUpdates,\n unsubscribeToUpdates,\n };\n return (jsx(LiveStatisticsSocketContext.Provider, { value: value, children: children }));\n};const useIsMounted = () => {\n const isMountedRef = useRef(false);\n useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n return () => isMountedRef.current;\n};const useOdds = ({ selections, betAmount, batchBetAmounts }) => {\n const { isSocketReady, subscribeToUpdates, unsubscribeToUpdates } = useOddsSocket();\n const { appChain } = useChain();\n const config = useConfig();\n const isMounted = useIsMounted();\n const { liveItems, prematchItems } = useMemo(() => {\n return selections.reduce((acc, item) => {\n if (item.coreAddress.toLocaleLowerCase() === liveHostAddress.toLocaleLowerCase()) {\n acc.liveItems.push(item);\n }\n else {\n acc.prematchItems.push(item);\n }\n return acc;\n }, {\n liveItems: [],\n prematchItems: [],\n });\n }, [selections]);\n const selectionsKey = useMemo(() => (selections.map(({ conditionId }) => conditionId).join('-')), [selections]);\n const liveKey = useMemo(() => (liveItems.map(({ conditionId }) => conditionId).join('-')), [liveItems]);\n const prematchKey = useMemo(() => (prematchItems.map(({ conditionId }) => conditionId).join('-')), [prematchItems]);\n const [odds, setOdds] = useState({});\n const [totalOdds, setTotalOdds] = useState(0);\n const [isPrematchOddsFetching, setPrematchOddsFetching] = useState(Boolean(prematchItems.length));\n const oddsDataRef = useRef({});\n const betAmountRef = useRef(betAmount);\n const batchBetAmountsRef = useRef(batchBetAmounts);\n const prevSelectionsKeyRef = useRef(selectionsKey);\n const prevPrematchKeyRef = useRef(prematchKey);\n if (prematchItems.length && (prematchKey !== prevPrematchKeyRef.current\n || betAmount !== betAmountRef.current\n || batchBetAmounts !== batchBetAmountsRef.current)) {\n setPrematchOddsFetching(true);\n }\n if (selectionsKey !== prevSelectionsKeyRef.current\n || betAmount !== betAmountRef.current\n || batchBetAmounts !== batchBetAmountsRef.current) {\n setOdds({});\n setTotalOdds(1);\n }\n prevSelectionsKeyRef.current = selectionsKey;\n prevPrematchKeyRef.current = prematchKey;\n betAmountRef.current = betAmount;\n batchBetAmountsRef.current = batchBetAmounts;\n const isLiveOddsFetching = useMemo(() => {\n return !liveItems.every(({ conditionId, outcomeId }) => Boolean(odds[`${conditionId}-${outcomeId}`]));\n }, [liveKey, odds]);\n const maxBet = useMemo(() => {\n if (!liveItems.length || liveItems.length > 1) {\n return undefined;\n }\n const { conditionId, outcomeId } = liveItems[0];\n return oddsDataRef.current?.[conditionId]?.outcomes?.[outcomeId]?.maxBet;\n }, [liveKey, odds]); // we need odds in deps because we update oddsDataRef with odds\n const fetchPrematchOdds = async () => {\n if (!prematchItems.length) {\n return;\n }\n try {\n const prematchOdds = await calcPrematchOdds({\n config,\n betAmount: betAmountRef.current,\n batchBetAmounts: batchBetAmountsRef.current,\n selections: prematchItems,\n chainId: appChain.id,\n });\n if (isMounted()) {\n setOdds(odds => {\n const newOdds = { ...odds, ...prematchOdds };\n const newTotalOdds = +formatToFixed(Object.keys(newOdds).reduce((acc, key) => acc * +newOdds[key], 1), 5);\n setTotalOdds(newTotalOdds);\n return newOdds;\n });\n setPrematchOddsFetching(false);\n }\n }\n catch (err) {\n if (isMounted()) {\n setPrematchOddsFetching(false);\n }\n }\n };\n const fetchLiveOdds = (items, newOddsData) => {\n if (!items.length) {\n return;\n }\n if (newOddsData) {\n oddsDataRef.current[newOddsData.conditionId] = newOddsData;\n }\n const liveOdds = items.reduce((acc, item) => {\n const { conditionId, outcomeId } = item;\n const oddsData = oddsDataRef.current[conditionId];\n if (!oddsData) {\n return acc;\n }\n acc[`${conditionId}-${outcomeId}`] = calcLiveOdds({ selection: item, betAmount: betAmountRef.current, oddsData });\n return acc;\n }, {});\n setOdds(odds => {\n const newOdds = { ...odds, ...liveOdds };\n const newTotalOdds = +formatToFixed(Object.keys(newOdds).reduce((acc, key) => acc * +newOdds[key], 1), 3);\n setTotalOdds(newTotalOdds);\n return newOdds;\n });\n };\n const fetchOdds = useCallback(debounce(() => {\n fetchPrematchOdds();\n fetchLiveOdds(liveItems);\n }, 100), [selectionsKey]);\n useEffect(() => {\n if (!isSocketReady || !liveItems.length) {\n return;\n }\n const ids = liveKey.split('-');\n subscribeToUpdates(ids);\n return () => {\n unsubscribeToUpdates(ids);\n };\n }, [liveKey, isSocketReady]);\n useEffect(() => {\n fetchOdds();\n }, [fetchOdds, betAmount, batchBetAmounts]);\n useEffect(() => {\n if (!selections?.length) {\n return;\n }\n const unsubscribeList = selections.map(({ conditionId }) => {\n return oddsWatcher.subscribe(`${conditionId}`, (oddsData) => {\n if (oddsData) {\n const item = liveItems.find(item => item.conditionId === oddsData.conditionId);\n fetchLiveOdds([item], oddsData);\n }\n else {\n setPrematchOddsFetching(true);\n fetchPrematchOdds();\n }\n });\n });\n return () => {\n unsubscribeList.forEach((unsubscribe) => {\n unsubscribe();\n });\n };\n }, [selectionsKey]);\n return {\n odds,\n totalOdds,\n maxBet,\n loading: isPrematchOddsFetching || isLiveOddsFetching,\n };\n};const getOutcomes = async (conditionEntityIds, client) => {\n const result = await client.query({\n query: PrematchConditionsBatchDocument,\n variables: {\n conditionFilter: {\n id_in: conditionEntityIds,\n },\n },\n fetchPolicy: 'network-only',\n });\n return result?.data?.conditions.reduce((acc, { conditionId, outcomes, status }) => {\n outcomes.forEach(({ outcomeId, odds }) => {\n const key = `${conditionId}-${outcomeId}`;\n acc[key] = {\n odds: +odds,\n status,\n };\n });\n return acc;\n }, {});\n};\nconst batchFetchOutcomes = createBatch(getOutcomes);const useStatuses = ({ selections }) => {\n const { isSocketReady, subscribeToUpdates, unsubscribeToUpdates } = useOddsSocket();\n const { prematchClient } = useApolloClients();\n const [statuses, setStatuses] = useState({});\n const { liveItems, prematchItems } = useMemo(() => {\n return selections.reduce((acc, item) => {\n if (item.coreAddress.toLocaleLowerCase() === liveHostAddress.toLocaleLowerCase()) {\n acc.liveItems.push(item);\n }\n else {\n acc.prematchItems.push(item);\n }\n return acc;\n }, {\n liveItems: [],\n prematchItems: [],\n });\n }, [selections]);\n const [isPrematchStatusesFetching, setPrematchStatusesFetching] = useState(Boolean(prematchItems.length));\n const selectionsKey = useMemo(() => (selections.map(({ conditionId }) => conditionId).join('-')), [selections]);\n const liveKey = useMemo(() => (liveItems.map(({ conditionId }) => conditionId).join('-')), [liveItems]);\n const prematchKey = useMemo(() => (prematchItems.map(({ conditionId }) => conditionId).join('-')), [prematchItems]);\n const prevSelectionsKeyRef = useRef(selectionsKey);\n const prevPrematchKey = useRef(prematchKey);\n if (prematchItems.length && prematchKey !== prevPrematchKey.current) {\n setPrematchStatusesFetching(true);\n }\n if (selectionsKey !== prevSelectionsKeyRef.current) {\n setStatuses({});\n }\n prevSelectionsKeyRef.current = selectionsKey;\n prevPrematchKey.current = prematchKey;\n const isLiveStatusesFetching = useMemo(() => {\n return !liveItems.every(({ conditionId }) => Boolean(statuses[conditionId]));\n }, [liveKey, statuses]);\n useEffect(() => {\n if (!isSocketReady || !liveItems.length) {\n return;\n }\n const ids = liveKey.split('-');\n subscribeToUpdates(ids);\n return () => {\n unsubscribeToUpdates(ids);\n };\n }, [liveKey, isSocketReady]);\n useEffect(() => {\n if (!selections.length) {\n return;\n }\n const unsubscribeList = selections.map(({ conditionId }) => {\n return conditionStatusWatcher.subscribe(conditionId, (newStatus) => {\n setStatuses(statuses => ({\n ...statuses,\n [conditionId]: newStatus,\n }));\n });\n });\n return () => {\n unsubscribeList.forEach((unsubscribe) => {\n unsubscribe();\n });\n };\n }, [selectionsKey]);\n useEffect(() => {\n if (!prematchItems.length) {\n return;\n }\n (async () => {\n const data = await batchFetchOutcomes(prematchItems.map(({ conditionId, coreAddress }) => `${coreAddress.toLowerCase()}_${conditionId}`), prematchClient);\n const prematchStatuses = (selections || []).reduce((acc, selection) => {\n const { conditionId, outcomeId } = selection || {};\n const key = `${conditionId}-${outcomeId}`;\n if (conditionId && data?.[key]) {\n acc[conditionId] = data[key].status;\n }\n return acc;\n }, {});\n setPrematchStatusesFetching(false);\n setStatuses(prematchStatuses);\n })();\n }, [prematchKey]);\n return {\n statuses,\n loading: isPrematchStatusesFetching || isLiveStatusesFetching,\n };\n};const useFreeBets = ({ account, affiliate, enabled }) => {\n const { appChain, api } = useChain();\n const queryFn = async () => {\n const freebets = await getFreeBets({\n chainId: appChain.id,\n account,\n affiliate,\n });\n if (!freebets) {\n return freebets;\n }\n return freebets.map(freebet => ({\n id: +freebet.id,\n contractAddress: freebet.contract.freebetContractAddress,\n signature: freebet.signature,\n expiresAt: freebet.expiresAt * 1000,\n amount: formatUnits(BigInt(freebet.amount), freebet.contract.decimals),\n rawAmount: BigInt(freebet.amount),\n minOdds: formatUnits(BigInt(freebet.minOdds), ODDS_DECIMALS),\n rawMinOdds: BigInt(freebet.minOdds),\n campaign: freebet.campaign,\n chainId: +freebet.contract.chainId,\n }));\n };\n const { data, ...rest } = useQuery({\n queryKey: ['freebets', api, account?.toLowerCase(), affiliate?.toLowerCase()],\n queryFn,\n refetchOnWindowFocus: false,\n enabled,\n });\n const appChainFreeBets = useMemo(() => {\n if (!data) {\n return data;\n }\n return data.filter(({ chainId }) => +chainId === appChain.id);\n }, [data, appChain.id]);\n return {\n data: appChainFreeBets,\n ...rest,\n };\n};const useForceUpdate = () => {\n const [increment, setState] = useState(0);\n const forceUpdate = useCallback(() => {\n setState((v) => ++v);\n }, []);\n return { increment, forceUpdate };\n};var BetslipDisableReason;\n(function (BetslipDisableReason) {\n BetslipDisableReason[\"ConditionStatus\"] = \"ConditionStatus\";\n BetslipDisableReason[\"BetAmountGreaterThanMaxBet\"] = \"BetAmountGreaterThanMaxBet\";\n BetslipDisableReason[\"BetAmountLowerThanMinBet\"] = \"BetAmountLowerThanMinBet\";\n BetslipDisableReason[\"BatchWithLive\"] = \"BatchWithLive\";\n BetslipDisableReason[\"ComboWithLive\"] = \"ComboWithLive\";\n BetslipDisableReason[\"ComboWithForbiddenItem\"] = \"ComboWithForbiddenItem\";\n BetslipDisableReason[\"ComboWithSameGame\"] = \"ComboWithSameGame\";\n BetslipDisableReason[\"PrematchConditionInStartedGame\"] = \"PrematchConditionInStartedGame\";\n BetslipDisableReason[\"FreeBetWithLive\"] = \"FreeBetWithLive\";\n BetslipDisableReason[\"FreeBetWithCombo\"] = \"FreeBetWithCombo\";\n BetslipDisableReason[\"FreeBetWithBatch\"] = \"FreeBetWithBatch\";\n BetslipDisableReason[\"FreeBetExpired\"] = \"FreeBetExpired\";\n BetslipDisableReason[\"FreeBetMinOdds\"] = \"FreeBetMinOdds\";\n})(BetslipDisableReason || (BetslipDisableReason = {}));\nconst BaseBetslipContext = createContext(null);\nconst DetailedBetslipContext = createContext(null);\nconst useBaseBetslip = () => {\n return useContext(BaseBetslipContext);\n};\nconst useDetailedBetslip = () => {\n return useContext(DetailedBetslipContext);\n};\nconst BetslipProvider = (props) => {\n const { children, affiliate, isBatchBetWithSameGameEnabled } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const { appChain } = useChain();\n const account = useExtendedAccount();\n const { forceUpdate } = useForceUpdate();\n const [items, setItems] = useState([]);\n const [selectedFreeBet, setFreeBet] = useState();\n const [betAmount, setBetAmount] = useState('');\n const [batchBetAmounts, setBatchBetAmounts] = useState({});\n const [isBatch, setBatch] = useState(false);\n const { data: freeBets, isFetching: isFreeBetsFetching } = useFreeBets({\n account: account.address,\n affiliate: affiliate,\n enabled: Boolean(affiliate),\n });\n const { odds, totalOdds, maxBet, loading: isOddsFetching } = useOdds({ betAmount, batchBetAmounts, selections: items });\n const { statuses, loading: isStatusesFetching } = useStatuses({ selections: items });\n const isCombo = !isBatch && items.length > 1;\n const checkDifferentGames = (items) => {\n const gameIds = items.map(({ game }) => game.gameId);\n return gameIds.length === new Set(gameIds).size;\n };\n const createInitialBatchAmounts = (items) => {\n setBatchBetAmounts(batchAmounts => {\n const newBatchAmounts = {};\n items.forEach(({ conditionId, outcomeId }) => {\n const key = `${conditionId}-${outcomeId}`;\n newBatchAmounts[key] = batchAmounts[key] || '';\n });\n return newBatchAmounts;\n });\n };\n const totalBetAmount = useMemo(() => {\n if (isBatch) {\n return String(Object.values(batchBetAmounts).reduce((acc, amount) => acc + +amount, 0));\n }\n if (selectedFreeBet) {\n return selectedFreeBet.amount;\n }\n return betAmount;\n }, [isBatch, betAmount, batchBetAmounts, selectedFreeBet]);\n const isLiveBet = useMemo(() => {\n return items.some(({ coreAddress }) => coreAddress === liveHostAddress);\n }, [items]);\n const isConditionsInCreatedStatus = useMemo(() => {\n return Object.values(statuses).every(status => status === ConditionStatus.Created);\n }, [statuses]);\n const isComboWithDifferentGames = useMemo(() => {\n return !isCombo || checkDifferentGames(items);\n }, [isCombo, items]);\n const isBatchAllowed = !isBatch || !isLiveBet;\n const isFreeBetAllowed = useMemo(() => {\n if (!selectedFreeBet || !totalOdds) {\n return true;\n }\n return (!isCombo && !isBatch && !isLiveBet\n && selectedFreeBet.expiresAt > Date.now()\n && totalOdds >= parseFloat(selectedFreeBet.minOdds));\n }, [selectedFreeBet, isCombo, isBatch, isLiveBet, totalOdds]);\n const isComboAllowed = useMemo(() => {\n return !isCombo || !isLiveBet && isComboWithDifferentGames && items.every(({ isExpressForbidden }) => !isExpressForbidden);\n }, [isCombo, items]);\n const isPrematchBetAllowed = useMemo(() => {\n return items.every(({ coreAddress, game: { startsAt } }) => {\n if (coreAddress === liveHostAddress) {\n return true;\n }\n return startsAt * 1000 > Date.now();\n });\n }, [items]);\n const minBet = isLiveBet && !appChain?.testnet ? MIN_LIVE_BET_AMOUNT : undefined;\n const isAmountLowerThanMaxBet = Boolean(betAmount) && typeof maxBet !== 'undefined' ? +betAmount <= maxBet : true;\n const isAmountBiggerThanMinBet = Boolean(betAmount) && typeof minBet !== 'undefined' ? +betAmount >= minBet : true;\n const isBetAllowed = (isConditionsInCreatedStatus\n && isComboAllowed\n && isBatchAllowed\n && isPrematchBetAllowed\n && isFreeBetAllowed\n && isAmountLowerThanMaxBet\n && isAmountBiggerThanMinBet);\n let disableReason = (() => {\n if (!isConditionsInCreatedStatus) {\n return BetslipDisableReason.ConditionStatus;\n }\n if (!isFreeBetAllowed) {\n if (isLiveBet) {\n return BetslipDisableReason.FreeBetWithLive;\n }\n else {\n if (isCombo) {\n return BetslipDisableReason.FreeBetWithCombo;\n }\n if (isBatch) {\n return BetslipDisableReason.FreeBetWithBatch;\n }\n }\n if (selectedFreeBet.expiresAt <= Date.now()) {\n return BetslipDisableReason.FreeBetExpired;\n }\n if (totalOdds < parseFloat(selectedFreeBet.minOdds)) {\n return BetslipDisableReason.FreeBetMinOdds;\n }\n }\n if (!isComboAllowed) {\n if (isLiveBet) {\n return BetslipDisableReason.ComboWithLive;\n }\n else if (!isComboWithDifferentGames) {\n return BetslipDisableReason.ComboWithSameGame;\n }\n else {\n return BetslipDisableReason.ComboWithForbiddenItem;\n }\n }\n if (!isPrematchBetAllowed) {\n return BetslipDisableReason.PrematchConditionInStartedGame;\n }\n if (!isBatchAllowed) {\n return BetslipDisableReason.BatchWithLive;\n }\n if (!isAmountLowerThanMaxBet) {\n return BetslipDisableReason.BetAmountGreaterThanMaxBet;\n }\n if (!isAmountBiggerThanMinBet) {\n return BetslipDisableReason.BetAmountLowerThanMinBet;\n }\n })();\n const changeBatch = useCallback((value) => {\n setBatch(value);\n if (value) {\n setBetAmount('');\n createInitialBatchAmounts(items);\n }\n else {\n setBatchBetAmounts({});\n }\n }, [items]);\n const changeBetAmount = useCallback((value) => {\n const decimals = [base.id, baseSepolia.id].includes(appChain.id) ? 4 : 2;\n setBetAmount(formatToFixed(value, decimals));\n }, [appChain]);\n const changeBatchBetAmount = useCallback((item, value) => {\n const { conditionId, outcomeId } = item;\n const key = `${conditionId}-${outcomeId}`;\n const decimals = [base.id, baseSepolia.id].includes(appChain.id) ? 4 : 2;\n setBatchBetAmounts(amounts => {\n return {\n ...amounts,\n [key]: formatToFixed(value, decimals),\n };\n });\n }, [appChain]);\n const addItem = useCallback((itemProps) => {\n const { gameId, coreAddress, lpAddress, conditionId, outcomeId } = itemProps;\n let game;\n let cache;\n let gameEntityId;\n if (coreAddress === liveHostAddress) {\n cache = liveClient.cache;\n gameEntityId = gameId;\n }\n else {\n cache = prematchClient.cache;\n gameEntityId = `${lpAddress.toLowerCase()}_${gameId}`;\n }\n game = cache.readFragment({\n id: cache.identify({ __typename: 'Game', id: gameEntityId }),\n fragment: MainGameInfoFragmentDoc,\n fragmentName: 'MainGameInfo',\n });\n if (!game) {\n return;\n }\n let marketName = getMarketName({ outcomeId });\n let selectionName = getSelectionName({ outcomeId, withPoint: true });\n if (coreAddress !== liveHostAddress) {\n const conditionEntityId = `${coreAddress.toLowerCase()}_${conditionId}`;\n const condition = cache.readFragment({\n id: cache.identify({ __typename: 'Condition', id: conditionEntityId }),\n fragment: PrematchConditionFragmentDoc,\n fragmentName: 'PrematchCondition',\n });\n if (condition?.title && condition.title !== 'null') {\n marketName = condition.title;\n const outcome = condition.outcomes.find(outcome => outcome.outcomeId === outcomeId);\n if (outcome?.title && outcome.title !== 'null') {\n selectionName = outcome.title;\n }\n }\n }\n const { participants, startsAt: _startsAt, title, sport: { sportId: _sportId, slug: sportSlug, name: sportName, }, league: { name: leagueName, slug: leagueSlug, country: { name: countryName, slug: countrySlug, }, }, } = game;\n const item = {\n ...itemProps,\n marketName,\n selectionName,\n game: {\n gameId,\n title,\n countryName,\n countrySlug,\n leagueName,\n leagueSlug,\n participants,\n startsAt: +_startsAt,\n sportId: +_sportId,\n sportSlug,\n sportName,\n },\n };\n setItems(items => {\n let newItems;\n const replaceIndex = items.findIndex(({ game: { gameId } }) => gameId === item.game.gameId);\n // if cart contains outcome from same game as new item\n // then replace old item\n if (replaceIndex !== -1) {\n if (isBatchBetWithSameGameEnabled) {\n const { conditionId, outcomeId } = items[replaceIndex];\n // if it's exactly the same outcome, don't change the state\n if (conditionId === item.conditionId && outcomeId === item.outcomeId) {\n return items;\n }\n newItems = [...items, item];\n setBatch(true);\n createInitialBatchAmounts(newItems);\n }\n else {\n newItems = [...items];\n newItems[replaceIndex] = item;\n }\n }\n else {\n newItems = [...items, item];\n }\n localStorage.setItem(localStorageKeys.betslipItems, JSON.stringify(newItems));\n if (isBatch) {\n createInitialBatchAmounts(newItems);\n }\n return newItems;\n });\n }, [isBatch]);\n const removeItem = useCallback((itemProps) => {\n const { conditionId, outcomeId } = itemProps;\n setItems(items => {\n const newItems = items.filter((item) => !(item.conditionId === conditionId\n && item.outcomeId === outcomeId));\n if (newItems.length < 2) {\n setBatch(false);\n }\n setBatchBetAmounts(batchAmounts => {\n if (newItems.length < 2) {\n const lastItem = newItems[0];\n if (lastItem) {\n const { conditionId, outcomeId } = lastItem;\n const amount = batchAmounts[`${conditionId}-${outcomeId}`];\n if (amount) {\n setBetAmount(amount);\n }\n }\n return {};\n }\n const newBatchAmounts = { ...batchAmounts };\n delete newBatchAmounts[`${conditionId}-${outcomeId}`];\n return newBatchAmounts;\n });\n localStorage.setItem(localStorageKeys.betslipItems, JSON.stringify(newItems));\n return newItems;\n });\n }, []);\n const clear = useCallback(() => {\n setItems([]);\n setBatch(false);\n setBatchBetAmounts({});\n setBetAmount('');\n setFreeBet(undefined);\n localStorage.setItem(localStorageKeys.betslipItems, JSON.stringify([]));\n }, []);\n const prevChainId = useRef(appChain.id);\n useEffect(() => {\n if (prevChainId.current !== appChain.id) {\n clear();\n prevChainId.current = appChain.id;\n }\n }, [appChain.id]);\n useEffect(() => {\n let storedItems = JSON.parse(localStorage.getItem(localStorageKeys.betslipItems) || '[]');\n if (!Array.isArray(storedItems)) {\n return;\n }\n const isDifferentGames = checkDifferentGames(storedItems);\n if (!isDifferentGames) {\n setBatch(true);\n createInitialBatchAmounts(storedItems);\n }\n setItems(storedItems);\n }, []);\n useEffect(() => {\n if (!selectedFreeBet || selectedFreeBet.expiresAt <= Date.now()) {\n return;\n }\n const timeout = setTimeout(() => {\n disableReason = BetslipDisableReason.FreeBetExpired;\n forceUpdate();\n }, selectedFreeBet.expiresAt - Date.now());\n return () => {\n clearTimeout(timeout);\n };\n }, [selectedFreeBet]);\n const baseValue = useMemo(() => ({\n items,\n addItem,\n removeItem,\n clear,\n }), [\n items,\n addItem,\n removeItem,\n clear,\n ]);\n const detailedValue = useMemo(() => ({\n betAmount: totalBetAmount,\n batchBetAmounts,\n odds,\n totalOdds,\n maxBet,\n minBet,\n selectedFreeBet,\n freeBets,\n statuses,\n disableReason,\n changeBetAmount,\n changeBatchBetAmount,\n changeBatch,\n selectFreeBet: setFreeBet,\n isBatch,\n isLiveBet,\n isStatusesFetching,\n isOddsFetching,\n isFreeBetsFetching,\n isBetAllowed,\n }), [\n totalBetAmount,\n batchBetAmounts,\n odds,\n totalOdds,\n maxBet,\n minBet,\n selectedFreeBet,\n freeBets,\n statuses,\n disableReason,\n changeBetAmount,\n changeBatchBetAmount,\n changeBatch,\n setFreeBet,\n isBatch,\n isLiveBet,\n isStatusesFetching,\n isOddsFetching,\n isFreeBetsFetching,\n isBetAllowed,\n ]);\n return (jsx(BaseBetslipContext.Provider, { value: baseValue, children: jsx(DetailedBetslipContext.Provider, { value: detailedValue, children: children }) }));\n};const useWatchers = () => {\n const { appChain, contracts } = useChain();\n useWatchContractEvent({\n address: contracts.prematchCore.address,\n abi: contracts.prematchCore.abi,\n eventName: 'NewBet',\n chainId: appChain.id,\n onLogs(logs) {\n if (logs) {\n logs.forEach(log => {\n const conditionId = log.args.conditionId;\n oddsWatcher.dispatch(conditionId.toString(), undefined);\n });\n }\n },\n });\n useWatchContractEvent({\n address: contracts.prematchComboCore.address,\n abi: contracts.prematchComboCore.abi,\n eventName: 'NewBet',\n chainId: appChain.id,\n onLogs(logs) {\n if (logs) {\n logs.forEach(log => {\n const { subBets } = log.args.bet;\n subBets.forEach(({ conditionId }) => {\n oddsWatcher.dispatch(conditionId.toString(), undefined);\n });\n });\n }\n },\n });\n useWatchContractEvent({\n address: contracts.prematchCore.address,\n abi: contracts.prematchCore.abi,\n eventName: 'OddsChanged',\n chainId: appChain.id,\n onLogs(logs) {\n if (logs) {\n logs.forEach(log => {\n const conditionId = log.args.conditionId;\n oddsWatcher.dispatch(conditionId.toString(), undefined);\n });\n }\n },\n });\n useWatchContractEvent({\n address: contracts.prematchCore.address,\n abi: contracts.prematchCore.abi,\n eventName: 'ConditionStopped',\n chainId: appChain.id,\n onLogs(logs) {\n if (logs) {\n logs.forEach(log => {\n const conditionId = log.args.conditionId;\n const isStopped = log.args.flag;\n const status = isStopped ? ConditionStatus.Paused : ConditionStatus.Created;\n conditionStatusWatcher.dispatch(conditionId.toString(), status);\n });\n }\n },\n });\n};function Watchers() {\n useWatchers();\n return null;\n}\nconst AzuroSDKProvider = (props) => {\n const { children, initialChainId, affiliate, isBatchBetWithSameGameEnabled } = props;\n return (jsx(ChainProvider, { initialChainId: initialChainId, children: jsx(OddsSocketProvider, { children: jsxs(LiveStatisticsSocketProvider, { children: [jsx(ApolloProvider, { children: jsx(BetslipProvider, { isBatchBetWithSameGameEnabled: isBatchBetWithSameGameEnabled, affiliate: affiliate, children: children }) }), jsx(Watchers, {})] }) }) }));\n};const LiveContext = createContext(null);\nconst useLive = () => {\n return useContext(LiveContext);\n};\nconst LiveProvider = (props) => {\n const { children, initialLiveState } = props;\n const { appChain, setAppChainId, contracts } = useChain();\n const chains = useChains();\n const isLiveExist = Boolean(contracts.liveCore);\n const [isLive, setLive] = useState(isLiveExist && Boolean(initialLiveState));\n useMemo(() => {\n if (!isLiveExist && isLive) {\n setLive(false);\n document.cookie = `${cookieKeys.live}=false;path=/;`;\n }\n }, [appChain]);\n const handleChangeLive = (value) => {\n document.cookie = `${cookieKeys.live}=${value};path=/;`;\n if (value && !isLiveExist) {\n const chainWithLive = chains.find(({ id }) => Boolean(chainsData[id]?.contracts?.liveCore));\n if (chainWithLive) {\n setAppChainId(chainWithLive.id);\n }\n }\n setLive(value);\n };\n const value = {\n isLive,\n changeLive: handleChangeLive,\n };\n return (jsx(LiveContext.Provider, { value: value, children: children }));\n};const usePrematchBets = (props) => {\n const { filter, orderBy = Bet_OrderBy.CreatedBlockTimestamp, orderDir = OrderDirection.Asc, } = props;\n const { prematchClient } = useApolloClients();\n const options = useMemo(() => {\n const variables = {\n first: filter.limit || 1000,\n skip: filter.offset,\n orderBy,\n orderDirection: orderDir,\n where: {\n actor: filter.bettor?.toLowerCase(),\n },\n };\n if (filter.type === BetType.Unredeemed) {\n variables.where.isRedeemable = true;\n }\n if (filter.type === BetType.Accepted) {\n variables.where.status = GraphBetStatus.Accepted;\n variables.where.isCashedOut = false;\n }\n if (filter.type === BetType.Settled) {\n variables.where.status_in = [GraphBetStatus.Resolved, GraphBetStatus.Canceled];\n }\n if (filter.type === BetType.CashedOut) {\n variables.where.isCashedOut = true;\n }\n if (filter.affiliate) {\n variables.where.affiliate = filter.affiliate;\n }\n return {\n variables,\n ssr: false,\n client: prematchClient,\n skip: !filter.bettor,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n filter.limit,\n filter.offset,\n filter.bettor,\n filter.type,\n filter.affiliate,\n orderBy,\n orderDir,\n ]);\n const { data, loading, error } = useQuery$1(PrematchBetsDocument, options);\n const bets = useMemo(() => {\n if (!data?.bets?.length) {\n return [];\n }\n return data.bets.map((rawBet) => {\n const { tokenId, status, amount, odds, settledOdds, createdAt, result, affiliate, core: { address: coreAddress, liquidityPool: { address: lpAddress } }, cashout: _cashout, isCashedOut, payout: _payout, isRedeemed: _isRedeemed, isRedeemable, freebet, txHash, selections, } = rawBet;\n const isWin = result === BetResult.Won;\n const isLose = result === BetResult.Lost;\n const isCanceled = status === GraphBetStatus.Canceled;\n // express bets have a specific feature - protocol redeems LOST expresses to release liquidity,\n // so we should validate it by \"win\"/\"canceled\" statuses\n const isRedeemed = (isWin || isCanceled) && _isRedeemed;\n const isFreebet = Boolean(freebet);\n const freebetId = freebet?.freebetId;\n const freebetContractAddress = freebet?.contractAddress;\n const payout = isRedeemable && isWin ? +_payout : null;\n const betDiff = isFreebet ? amount : 0; // for freebet we must exclude bonus value from possible win\n const totalOdds = settledOdds ? +settledOdds : +odds;\n const possibleWin = +amount * totalOdds - +betDiff;\n const cashout = isCashedOut ? _cashout?.payout : undefined;\n const outcomes = selections\n .map((selection) => {\n const { odds, result, outcome: { outcomeId, title: customSelectionName, condition: { conditionId, status: conditionStatus, title: customMarketName, game, }, }, } = selection;\n const isWin = result ? result === SelectionResult.Won : null;\n const isLose = result ? result === SelectionResult.Lost : null;\n const isCanceled = (conditionStatus === ConditionStatus.Canceled\n || game.status === PrematchGraphGameStatus.Canceled);\n const marketName = customMarketName && customMarketName !== 'null' ? customMarketName : getMarketName({ outcomeId });\n const selectionName = customSelectionName && customSelectionName !== 'null' ? customSelectionName : getSelectionName({ outcomeId, withPoint: true });\n return {\n selectionName,\n outcomeId,\n conditionId,\n coreAddress,\n odds: +odds,\n marketName,\n game,\n isWin,\n isLose,\n isCanceled,\n };\n })\n .sort((a, b) => +a.game.startsAt - +b.game.startsAt);\n const bet = {\n affiliate: affiliate,\n tokenId,\n freebetContractAddress: freebetContractAddress,\n freebetId,\n txHash,\n totalOdds,\n status,\n amount,\n possibleWin,\n payout,\n createdAt: +createdAt,\n cashout,\n isWin,\n isLose,\n isRedeemable,\n isRedeemed,\n isCanceled,\n isCashedOut,\n coreAddress: coreAddress,\n lpAddress: lpAddress,\n outcomes,\n isLive: false,\n };\n return bet;\n });\n }, [data]);\n return {\n loading,\n bets,\n error,\n };\n};const useLiveBets = (props) => {\n const { filter, orderBy = Bet_OrderBy.CreatedBlockTimestamp, orderDir = OrderDirection.Asc, } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const [bets, setBets] = useState([]);\n const [isGamesFetching, setGamesFetching] = useState(true);\n const options = useMemo(() => {\n const variables = {\n first: filter.limit || 1000,\n skip: filter.offset,\n orderBy,\n orderDirection: orderDir,\n where: {\n actor: filter.bettor?.toLowerCase(),\n },\n };\n if (filter.type === BetType.Unredeemed) {\n variables.where.isRedeemable = true;\n }\n if (filter.type === BetType.Accepted) {\n variables.where.status = GraphBetStatus.Accepted;\n variables.where.isCashedOut = false;\n }\n if (filter.type === BetType.Settled) {\n variables.where.status_in = [GraphBetStatus.Resolved, GraphBetStatus.Canceled];\n }\n if (filter.type === BetType.CashedOut) {\n variables.where.isCashedOut = true;\n }\n if (filter.affiliate) {\n variables.where.affiliate = filter.affiliate;\n }\n return {\n variables,\n ssr: false,\n client: prematchClient,\n skip: !filter.bettor,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n filter.limit,\n filter.offset,\n filter.bettor,\n filter.type,\n filter.affiliate,\n orderBy,\n orderDir,\n ]);\n const { data, loading: isBetsFetching, error } = useQuery$1(LiveBetsDocument, options);\n const { liveBets } = data || { liveBets: [] };\n const formattedBets = useMemo(() => {\n if (!liveBets.length) {\n return [];\n }\n return liveBets.map((rawBet) => {\n const { tokenId, status, amount, odds, settledOdds, createdAt, result, affiliate, core: { address: coreAddress, liquidityPool: { address: lpAddress } }, cashout: _cashout, isCashedOut, payout: _payout, isRedeemed: _isRedeemed, isRedeemable, txHash, selections, } = rawBet;\n const isWin = result === BetResult.Won;\n const isLose = result === BetResult.Lost;\n const isCanceled = status === GraphBetStatus.Canceled;\n // express bets have a specific feature - protocol redeems LOST expresses to release liquidity,\n // so we should validate it by \"win\"/\"canceled\" statuses\n const isRedeemed = (isWin || isCanceled) && _isRedeemed;\n const payout = isRedeemable && isWin ? +_payout : null;\n const totalOdds = settledOdds ? +settledOdds : +odds;\n const possibleWin = +amount * totalOdds;\n const cashout = isCashedOut ? _cashout?.payout : undefined;\n const outcomes = selections\n .map((selection) => {\n const { odds, result, outcome: { outcomeId, condition: { conditionId, status: conditionStatus, gameId } } } = selection;\n const isWin = result ? result === SelectionResult.Won : null;\n const isLose = result ? result === SelectionResult.Lost : null;\n const isCanceled = conditionStatus === ConditionStatus.Canceled;\n const marketName = getMarketName({ outcomeId });\n const selectionName = getSelectionName({ outcomeId, withPoint: true });\n return {\n selectionName,\n outcomeId,\n conditionId,\n coreAddress,\n odds: +odds,\n marketName,\n gameId,\n isWin,\n isLose,\n isCanceled,\n };\n });\n const bet = {\n affiliate: affiliate,\n tokenId,\n txHash,\n totalOdds,\n status,\n amount,\n possibleWin,\n payout,\n createdAt: +createdAt,\n cashout,\n isWin,\n isLose,\n isRedeemable,\n isRedeemed,\n isCanceled,\n isCashedOut,\n coreAddress: coreAddress,\n lpAddress: lpAddress,\n outcomes,\n isLive: true,\n };\n return bet;\n });\n }, [liveBets]);\n useEffect(() => {\n if (!formattedBets.length) {\n setGamesFetching(false);\n return;\n }\n (async () => {\n let games = {};\n const needToGetGames = new Set();\n formattedBets.forEach(({ outcomes }) => {\n const gameId = outcomes[0]?.gameId;\n const game = liveClient.cache.readFragment({\n id: liveClient.cache.identify({ __typename: 'Game', id: gameId }),\n fragment: MainGameInfoFragmentDoc,\n fragmentName: 'MainGameInfo',\n });\n if (game) {\n games[gameId] = game;\n }\n else {\n needToGetGames.add(gameId);\n }\n });\n if (needToGetGames.size) {\n const { data: { games: _games } } = await liveClient.query({\n query: GamesDocument,\n variables: {\n where: {\n gameId_in: [...needToGetGames],\n },\n },\n fetchPolicy: 'network-only',\n });\n const fetchedGames = _games.reduce((acc, game) => {\n acc[game.gameId] = game;\n return acc;\n }, {});\n games = {\n ...games,\n ...fetchedGames,\n };\n }\n const betsWithGames = formattedBets.map(bet => {\n const gameId = bet.outcomes[0]?.gameId;\n const game = games[gameId];\n if (game) {\n return {\n ...bet,\n outcomes: [{\n ...bet.outcomes[0],\n game,\n }],\n };\n }\n }).filter(Boolean);\n setGamesFetching(false);\n setBets(betsWithGames);\n })();\n return () => {\n setBets([]);\n };\n }, [formattedBets]);\n return {\n loading: isBetsFetching || isGamesFetching,\n bets,\n error,\n };\n};const defaultQueryProps = {\n pollInterval: undefined,\n skip: false,\n};\nconst useConditions = (props) => {\n const { gameId, filter, prematchQuery = defaultQueryProps, liveQuery = defaultQueryProps } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const { contracts } = useChain();\n const variables = useMemo(() => {\n const vars = {\n where: {\n game_: {\n gameId,\n },\n ...(filter || {}),\n },\n };\n return vars;\n }, [gameId, filter]);\n const { data: prematchData, loading: isPrematchLoading, error: prematchError, } = useQuery$1(PrematchConditionsDocument, {\n variables: variables,\n ssr: false,\n client: prematchClient,\n notifyOnNetworkStatusChange: true,\n ...prematchQuery,\n });\n const { data: liveData, loading: isLiveLoading, error: liveError, } = useQuery$1(LiveConditionsDocument, {\n variables: variables,\n ssr: false,\n client: liveClient,\n ...liveQuery,\n skip: liveQuery.skip || !contracts.liveCore,\n });\n return {\n prematchConditions: prematchData?.conditions,\n liveConditions: liveData?.conditions,\n loading: isPrematchLoading || isLiveLoading,\n error: prematchError || liveError,\n };\n};const useActiveConditions = (props) => {\n const { gameId, isLive, livePollInterval, filter, fetchPolicy } = props;\n const conditionsFilter = useMemo(() => {\n const _filter = {\n status_not: ConditionStatus.Resolved,\n };\n if (filter?.outcomeIds) {\n _filter.outcomesIds_contains = filter.outcomeIds;\n }\n if (filter?.maxMargin) {\n _filter.margin_lte = parseUnits(String(filter.maxMargin), MARGIN_DECIMALS).toString();\n _filter.status = ConditionStatus.Created;\n }\n return _filter;\n }, [filter?.outcomeIds, filter?.maxMargin]);\n const { prematchConditions, liveConditions, loading, error } = useConditions({\n gameId,\n filter: conditionsFilter,\n prematchQuery: {\n skip: isLive,\n fetchPolicy,\n },\n liveQuery: {\n pollInterval: livePollInterval,\n skip: !isLive,\n fetchPolicy,\n },\n });\n const conditions = isLive ? liveConditions : prematchConditions;\n return {\n conditions,\n loading,\n error,\n };\n};const useGame = (props) => {\n const { gameId } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const variables = useMemo(() => ({\n gameId: gameId,\n }), [gameId]);\n const { data: prematchData, loading: isPrematchLoading, error: prematchError } = useQuery$1(GameDocument, {\n variables,\n ssr: false,\n client: prematchClient,\n skip: !gameId,\n });\n const prematchGame = prematchData?.games?.[0];\n const isPrematchGameStarted = prematchGame ? (Date.now() >= +prematchGame.startsAt * 1000) : !isPrematchLoading;\n const { data: liveData, loading: isLiveLoading, error: liveError } = useQuery$1(GameDocument, {\n variables,\n ssr: false,\n client: liveClient,\n skip: !gameId || !isPrematchGameStarted,\n });\n const liveGame = liveData?.games?.[0];\n const game = liveGame || prematchGame;\n const isGameInLive = Boolean(liveGame);\n return {\n game,\n loading: isPrematchLoading || isLiveLoading,\n error: prematchError || liveError,\n isGameInLive,\n };\n};const useActiveMarkets = (props) => {\n const { gameId, gameStatus, filter, livePollInterval, fetchPolicy } = props;\n const { loading, conditions, error } = useActiveConditions({\n gameId,\n filter,\n isLive: gameStatus === GameStatus.Live,\n livePollInterval,\n fetchPolicy,\n });\n // generate unique key for memo deps\n const conditionIds = conditions?.map(({ id, outcomes }) => `${id}-${outcomes.length}`).join('_');\n const markets = useMemo(() => {\n if (!conditions?.length) {\n return [];\n }\n return groupConditionsByMarket(conditions);\n }, [conditionIds]);\n return {\n loading,\n markets,\n error,\n };\n};const useResolvedMarkets = (props) => {\n const { gameId } = props;\n const { loading, liveConditions, prematchConditions, error } = useConditions({\n gameId,\n filter: {\n status: ConditionStatus.Resolved,\n },\n });\n const prematchConditionIds = prematchConditions?.map(({ id, outcomes }) => `${id}-${outcomes.length}`).join('_');\n const liveConditionIds = liveConditions?.map(({ id, outcomes }) => `${id}-${outcomes.length}`).join('_');\n const prematchMarkets = useMemo(() => {\n if (!prematchConditions?.length) {\n return [];\n }\n return groupConditionsByMarket(prematchConditions);\n }, [prematchConditionIds]);\n const liveMarkets = useMemo(() => {\n if (!liveConditions?.length) {\n return [];\n }\n return groupConditionsByMarket(liveConditions);\n }, [liveConditionIds]);\n const groupedMarkets = useMemo(() => {\n if (!prematchMarkets?.length || !liveMarkets?.length) {\n if (prematchMarkets?.length) {\n return prematchMarkets;\n }\n if (liveMarkets?.length) {\n return liveMarkets;\n }\n }\n return Object.values([...liveMarkets, ...prematchMarkets].reduce((acc, market) => {\n const { marketKey } = market;\n if (!acc[marketKey]) {\n acc[marketKey] = market;\n }\n return acc;\n }, {}));\n }, [prematchMarkets, liveMarkets]);\n return {\n groupedMarkets,\n prematchMarkets,\n liveMarkets,\n loading,\n error,\n };\n};const useGames = (props) => {\n const { filter, orderBy = Game_OrderBy.CreatedBlockTimestamp, orderDir = OrderDirection.Desc, isLive, } = props || {};\n const { prematchClient, liveClient } = useApolloClients();\n const startsAt = getGameStartsAtValue();\n const options = useMemo(() => {\n const variables = {\n first: 1000,\n orderBy,\n orderDirection: orderDir,\n where: {\n hasActiveConditions: true,\n status_in: [PrematchGraphGameStatus.Created, PrematchGraphGameStatus.Paused],\n conditions_: {},\n sport_: {},\n league_: {},\n },\n };\n if (isLive) {\n variables.where.startsAt_lt = startsAt;\n }\n else {\n variables.where.startsAt_gt = startsAt;\n }\n if (filter?.limit) {\n variables.first = filter.limit;\n }\n if (filter?.offset) {\n variables.skip = filter.offset;\n }\n if (filter?.sportHub) {\n variables.where.sport_.sporthub = filter.sportHub;\n }\n if (filter?.sportSlug) {\n variables.where.sport_.slug_starts_with_nocase = filter.sportSlug;\n }\n if (filter?.sportIds?.length) {\n variables.where.sport_.sportId_in = filter?.sportIds;\n }\n if (filter?.leagueSlug) {\n variables.where.league_.slug_in = typeof filter.leagueSlug === 'string' ? [filter.leagueSlug] : filter.leagueSlug;\n }\n if (filter?.maxMargin) {\n variables.where.conditions_.margin_lte = parseUnits(String(filter.maxMargin), MARGIN_DECIMALS).toString();\n }\n if (filter?.conditionsStatus) {\n if (typeof filter.conditionsStatus === 'string') {\n variables.where.conditions_.status = filter.conditionsStatus;\n }\n else {\n variables.where.conditions_.status_in = filter.conditionsStatus;\n }\n }\n return {\n variables,\n ssr: false,\n client: isLive ? liveClient : prematchClient,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n filter?.limit,\n filter?.offset,\n filter?.sportHub,\n filter?.sportSlug,\n filter?.sportIds?.join('-'),\n filter?.leagueSlug,\n filter?.maxMargin,\n filter?.conditionsStatus,\n orderBy,\n orderDir,\n startsAt,\n isLive,\n ]);\n const { data, loading, error } = useQuery$1(GamesDocument, options);\n return {\n games: data?.games,\n loading,\n error,\n };\n};const useSports = (props) => {\n const { filter, gameOrderBy = Game_OrderBy.StartsAt, orderDir = OrderDirection.Asc, isLive, } = props || {};\n const { prematchClient, liveClient } = useApolloClients();\n const { contracts } = useChain();\n const startsAt = getGameStartsAtValue();\n const options = useMemo(() => {\n const variables = {\n first: filter?.limit || 1000,\n sportFilter: {},\n countryFilter: {},\n leagueFilter: {},\n gameFilter: {\n hasActiveConditions: true,\n status_in: [PrematchGraphGameStatus.Created, PrematchGraphGameStatus.Paused],\n },\n gameOrderBy,\n gameOrderDirection: orderDir,\n };\n if (filter?.sportSlug) {\n variables.sportFilter.slug = filter.sportSlug;\n }\n if (filter?.sportHub) {\n variables.sportFilter.sporthub = filter.sportHub;\n }\n if (filter?.sportIds?.length) {\n variables.sportFilter.sportId_in = filter?.sportIds;\n }\n if (filter?.countrySlug) {\n variables.countryFilter.slug = filter.countrySlug;\n }\n if (isLive) {\n variables.gameFilter.startsAt_lt = startsAt;\n }\n else {\n variables.gameFilter.startsAt_gt = startsAt;\n }\n variables.leagueFilter.games_ = variables.gameFilter;\n if (filter?.leagueSlug) {\n variables.leagueFilter.slug = filter.leagueSlug;\n }\n return {\n variables,\n ssr: false,\n client: isLive ? liveClient : prematchClient,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n isLive,\n gameOrderBy,\n orderDir,\n startsAt,\n filter?.limit,\n filter?.sportHub,\n filter?.sportSlug,\n filter?.countrySlug,\n filter?.leagueSlug,\n filter?.sportIds?.join('-'),\n ]);\n if (!isLive) {\n options.variables.gameFilter.liquidityPool = contracts.lp.address.toLowerCase();\n }\n const { data, loading, error } = useQuery$1(SportsDocument, options);\n const { sports } = data || { sports: [] };\n const formattedSports = useMemo(() => {\n if (!sports.length) {\n return [];\n }\n const filteredSports = sports.map(sport => {\n const { countries } = sport;\n const filteredCountries = countries.filter(({ leagues }) => leagues.length);\n return {\n ...sport,\n countries: filteredCountries,\n };\n }).filter(sport => sport.countries.length);\n if (gameOrderBy === Game_OrderBy.Turnover) {\n const sportsWithTurnover = filteredSports.map(sport => {\n const { countries } = sport;\n const turnover = countries.reduce((acc, { turnover }) => {\n acc += +turnover;\n return acc;\n }, 0);\n return {\n ...sport,\n turnover,\n };\n });\n return sportsWithTurnover.sort((a, b) => b.turnover - a.turnover);\n }\n if (gameOrderBy === Game_OrderBy.StartsAt) {\n return filteredSports.map(sport => {\n const { countries } = sport;\n const sortedCountries = countries.map(country => {\n const { leagues } = country;\n return {\n ...country,\n leagues: [...leagues].sort((a, b) => +a.games[0].startsAt - +b.games[0].startsAt),\n };\n }).sort((a, b) => +a.leagues[0].games[0].startsAt - +b.leagues[0].games[0].startsAt);\n return {\n ...sport,\n countries: sortedCountries,\n };\n }).sort((a, b) => +a.countries[0].leagues[0].games[0].startsAt - +b.countries[0].leagues[0].games[0].startsAt);\n }\n return filteredSports;\n }, [sports]);\n return {\n loading,\n sports: formattedSports,\n error,\n };\n};const useSportsNavigation = (props = {}) => {\n const { filter, withGameCount = false, isLive } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const startsAt = getGameStartsAtValue();\n const options = useMemo(() => {\n const variables = {\n first: 1000,\n withGameCount,\n sportFilter: {},\n gameFilter: {\n hasActiveConditions: true,\n status_in: [PrematchGraphGameStatus.Created, PrematchGraphGameStatus.Paused],\n },\n };\n if (isLive) {\n variables.gameFilter.startsAt_lt = startsAt;\n }\n else {\n variables.gameFilter.startsAt_gt = startsAt;\n }\n if (filter?.sportHub) {\n variables.sportFilter.sporthub = filter.sportHub;\n }\n if (filter?.sportIds?.length) {\n variables.sportFilter.sportId_in = filter?.sportIds;\n }\n return {\n variables,\n ssr: false,\n client: isLive ? liveClient : prematchClient,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n withGameCount,\n startsAt,\n isLive,\n filter?.sportHub,\n filter?.sportIds?.join('-'),\n ]);\n const { data, loading, error } = useQuery$1(SportsNavigationDocument, options);\n return {\n sports: data?.sports,\n loading,\n error,\n };\n};const useNavigation = (props = {}) => {\n const { filter, withGameCount = false, isLive } = props;\n const { prematchClient, liveClient } = useApolloClients();\n const startsAt = getGameStartsAtValue();\n const options = useMemo(() => {\n const variables = {\n first: 1000,\n withGameCount,\n sportFilter: {},\n gameFilter: {\n hasActiveConditions: true,\n status_in: [PrematchGraphGameStatus.Created, PrematchGraphGameStatus.Paused],\n },\n };\n if (isLive) {\n variables.gameFilter.startsAt_lt = startsAt;\n }\n else {\n variables.gameFilter.startsAt_gt = startsAt;\n }\n if (filter?.sportHub) {\n variables.sportFilter.sporthub = filter.sportHub;\n }\n if (filter?.sportIds?.length) {\n variables.sportFilter.sportId_in = filter?.sportIds;\n }\n return {\n variables,\n ssr: false,\n client: isLive ? liveClient : prematchClient,\n notifyOnNetworkStatusChange: true,\n };\n }, [\n withGameCount,\n startsAt,\n isLive,\n filter?.sportHub,\n filter?.sportIds?.join('-'),\n ]);\n const { data, loading, error } = useQuery$1(NavigationDocument, options);\n return {\n navigation: data?.sports,\n loading,\n error,\n };\n};const useLiveBetFee = ({ enabled } = { enabled: true }) => {\n const { appChain } = useChain();\n const queryFn = async () => {\n const { gasAmount, relayerFeeAmount, beautyRelayerFeeAmount, } = await getLiveBetFee(appChain.id);\n return {\n gasAmount: BigInt(gasAmount),\n relayerFeeAmount: BigInt(relayerFeeAmount),\n formattedRelayerFeeAmount: beautyRelayerFeeAmount,\n };\n };\n let { isFetching, data, refetch } = useQuery({\n queryKey: ['/live-bet-fee', appChain.id],\n queryFn,\n enabled,\n refetchOnWindowFocus: false,\n refetchInterval: 10_000,\n });\n if (!enabled) {\n data = undefined;\n }\n return {\n gasAmount: data?.gasAmount,\n relayerFeeAmount: data?.relayerFeeAmount,\n formattedRelayerFeeAmount: data?.formattedRelayerFeeAmount,\n refetch,\n loading: isFetching,\n };\n};const useBetsSummary = (props) => {\n const { account, affiliates } = props;\n const { betToken } = useChain();\n const { prematchClient } = useApolloClients();\n const options = useMemo(() => {\n const variables = {\n where: {\n address: account?.toLowerCase(),\n },\n };\n if (affiliates?.length) {\n variables.where.affiliate_in = affiliates.map(affiliate => affiliate.toLowerCase());\n }\n return {\n variables,\n ssr: false,\n client: prematchClient,\n notifyOnNetworkStatusChange: true,\n skip: !account,\n };\n }, [\n account,\n affiliates?.join('-'),\n ]);\n const { data, loading, error } = useQuery$1(BettorsDocument, options);\n const { bettors } = data || { bettors: [] };\n const formattedData = useMemo(() => {\n if (!bettors.length) {\n return {\n toPayout: '0',\n inBets: '0',\n totalPayout: '0',\n totalProfit: '0',\n betsCount: 0,\n wonBetsCount: 0,\n lostBetsCount: 0,\n };\n }\n const { rawToPayout, rawInBets, rawTotalPayout, rawTotalProfit, betsCount, wonBetsCount, lostBetsCount, } = bettors.reduce((acc, bettor) => {\n const { rawToPayout, rawInBets, rawTotalPayout, rawTotalProfit, betsCount, wonBetsCount, lostBetsCount } = bettor;\n acc.rawToPayout += BigInt(rawToPayout);\n acc.rawInBets += BigInt(rawInBets);\n acc.rawTotalPayout += BigInt(rawTotalPayout);\n acc.rawTotalProfit += BigInt(rawTotalProfit);\n acc.betsCount += betsCount;\n acc.wonBetsCount += wonBetsCount;\n acc.lostBetsCount += lostBetsCount;\n return acc;\n }, {\n rawToPayout: 0n,\n rawInBets: 0n,\n rawTotalPayout: 0n,\n rawTotalProfit: 0n,\n betsCount: 0,\n wonBetsCount: 0,\n lostBetsCount: 0,\n });\n return {\n toPayout: formatUnits(rawToPayout, betToken.decimals),\n inBets: formatUnits(rawInBets, betToken.decimals),\n totalPayout: formatUnits(rawTotalPayout, betToken.decimals),\n totalProfit: formatUnits(rawTotalProfit, betToken.decimals),\n betsCount,\n wonBetsCount,\n lostBetsCount,\n };\n }, [data]);\n return {\n ...formattedData,\n loading,\n error,\n };\n};const DIVIDER = 18;\nconst useBetsSummaryBySelection = ({ account, gameId, gameStatus, keyStruct = 'outcomeId' }) => {\n const { prematchClient } = useApolloClients();\n const { betToken } = useChain();\n const variables = useMemo(() => ({\n actor: account?.toLowerCase(),\n gameId,\n }), [account, gameId]);\n const { data, loading, error } = useQuery$1(GameBetsDocument, {\n variables,\n ssr: false,\n client: prematchClient,\n skip: !account || gameStatus !== GameStatus.Resolved,\n });\n const { bets: prematchBets, liveBets } = data || {};\n const betsSummary = useMemo(() => {\n if (!prematchBets?.length && !liveBets?.length) {\n return {};\n }\n const rawOne = parseUnits('1', ODDS_DECIMALS);\n const rawSummary = [...(prematchBets || []), ...(liveBets || [])].reduce((acc, bet) => {\n const { rawAmount: _rawAmount, rawPotentialPayout: _rawPotentialPayout, result, selections } = bet;\n const { freebet } = bet;\n const isExpress = selections.length > 1;\n const isWin = result === BetResult.Won;\n const rawAmount = BigInt(_rawAmount);\n const rawBetDiff = freebet ? rawAmount : 0n;\n const rawPayout = BigInt(_rawPotentialPayout) - rawBetDiff;\n let rawOddsSummary = 0n;\n if (isExpress) {\n selections.forEach(selection => {\n const { rawOdds } = selection;\n rawOddsSummary += BigInt(rawOdds) - rawOne;\n });\n }\n selections.forEach(selection => {\n const { outcome: { outcomeId, condition: { conditionId } } } = selection;\n if (isExpress) {\n const { outcome: { condition: { game: { gameId: _gameId } } } } = selection;\n if (gameId !== _gameId) {\n return;\n }\n }\n let key = outcomeId;\n if (keyStruct === 'conditionId-outcomeId') {\n key = `${conditionId}-${outcomeId}`;\n }\n if (!acc[key]) {\n acc[key] = 0n;\n }\n if (isExpress) {\n const { rawOdds: _rawOdds } = selection;\n const rawOdds = BigInt(_rawOdds);\n const rawSubBetOdds = parseUnits(String(rawOdds - rawOne), DIVIDER);\n const rawPartialOdds = rawSubBetOdds / rawOddsSummary / BigInt(10 ** (DIVIDER - ODDS_DECIMALS));\n const rawSubBetAmount = rawAmount * rawPartialOdds / BigInt(10 ** ODDS_DECIMALS);\n if (isWin) {\n acc[key] += rawSubBetAmount * rawOdds / BigInt(10 ** ODDS_DECIMALS);\n }\n else {\n acc[key] += rawSubBetAmount;\n }\n }\n else {\n acc[key] += isWin ? rawPayout : -rawAmount;\n }\n });\n return acc;\n }, {});\n return Object.keys(rawSummary).reduce((acc, key) => {\n acc[key] = formatUnits(rawSummary[key], betToken.decimals);\n return acc;\n }, {});\n }, [prematchBets, liveBets]);\n return {\n betsSummary,\n loading,\n error,\n };\n};const useBetsCache = () => {\n const { prematchClient, liveClient } = useApolloClients();\n const { contracts, betToken } = useChain();\n const { address } = useExtendedAccount();\n const updateBetCache = ({ coreAddress, tokenId }, values) => {\n const isLive = contracts.liveCore ? coreAddress.toLowerCase() === contracts.liveCore.address.toLowerCase() : false;\n const { cache } = prematchClient;\n const betEntityId = `${coreAddress.toLowerCase()}_${tokenId}`;\n let bet;\n if (isLive) {\n bet = cache.updateFragment({\n id: cache.identify({ __typename: 'LiveBet', id: betEntityId }),\n fragment: LiveBetFragmentDoc,\n fragmentName: 'LiveBet',\n }, (data) => ({\n ...data,\n ...values,\n }));\n if (values.isCashedOut) {\n prematchClient.cache.modify({\n id: prematchClient.cache.identify({ __typename: 'Query' }),\n fields: {\n liveBets: (bets, { storeFieldName, toReference }) => {\n const isValidStorage = (values.isCashedOut && storeFieldName.includes('\"isCashedOut\":true') // BetType.CashedOut\n );\n if (!isValidStorage) {\n return bets;\n }\n return [toReference(bet), ...bets];\n },\n },\n });\n }\n }\n else {\n bet = cache.updateFragment({\n id: cache.identify({ __typename: 'Bet', id: betEntityId }),\n fragment: PrematchBetFragmentDoc,\n fragmentName: 'PrematchBet',\n }, (data) => ({\n ...data,\n ...values,\n }));\n if (values.isCashedOut) {\n prematchClient.cache.modify({\n id: prematchClient.cache.identify({ __typename: 'Query' }),\n fields: {\n bets: (bets, { storeFieldName, toReference }) => {\n const isValidStorage = (values.isCashedOut && storeFieldName.includes('\"isCashedOut\":true') // BetType.CashedOut\n );\n if (!isValidStorage) {\n return bets;\n }\n return [toReference(bet), ...bets];\n },\n },\n });\n }\n }\n if (!bet || !bet.payout) {\n return;\n }\n const bettorEntity = `${contracts.lp.address.toLowerCase()}_${address.toLowerCase()}_${bet.affiliate.toLowerCase()}`;\n prematchClient.cache.updateFragment({\n id: prematchClient.cache.identify({ __typename: 'Bettor', id: bettorEntity }),\n fragment: BettorFragmentDoc,\n fragmentName: 'Bettor',\n }, (data) => {\n if (!data) {\n return data;\n }\n const rawPayout = parseUnits(bet.payout, betToken.decimals);\n const newRawToPayout = BigInt(data.rawToPayout) - rawPayout;\n return {\n ...data,\n rawToPayout: String(newRawToPayout),\n };\n });\n };\n const addBet = async (props) => {\n const { bet, odds, affiliate, receipt } = props;\n const { rawAmount, selections, freebetId } = bet;\n const coreAddress = selections[0].coreAddress;\n const isLive = coreAddress.toLowerCase() === liveHostAddress.toLowerCase();\n const client = isLive ? liveClient : prematchClient;\n const { cache } = client;\n const selectionFragments = [];\n for (let index = 0; index < selections.length; index++) {\n const { outcomeId, conditionId: _conditionId } = selections[index];\n const conditionId = String(_conditionId);\n if (isLive) {\n let condition = cache.readFragment({\n id: cache.identify({ __typename: 'Condition', id: conditionId }),\n fragment: LiveConditionFragmentDoc,\n fragmentName: 'LiveCondition',\n });\n if (!condition) {\n const { data: { condition: _condition } } = await client.query({\n query: LiveConditionDocument,\n variables: {\n conditionId,\n },\n fetchPolicy: 'network-only',\n });\n condition = _condition;\n }\n const gameId = condition.game.gameId;\n const selectionFragment = {\n __typename: 'LiveSelection',\n odds: String(odds[`${conditionId}-${outcomeId}`]),\n result: null,\n outcome: {\n __typename: 'LiveOutcome',\n outcomeId: String(outcomeId),\n condition: {\n __typename: 'LiveCondition',\n conditionId,\n status: ConditionStatus.Created,\n gameId,\n },\n },\n };\n selectionFragments.push(selectionFragment);\n }\n else {\n const conditionEntityId = `${coreAddress.toLowerCase()}_${conditionId}`;\n let condition = cache.readFragment({\n id: cache.identify({ __typename: 'Condition', id: conditionEntityId }),\n fragment: PrematchConditionFragmentDoc,\n fragmentName: 'PrematchCondition',\n });\n if (!condition) {\n const { data: { condition: _condition } } = await client.query({\n query: PrematchConditionDocument,\n variables: {\n id: conditionEntityId,\n },\n fetchPolicy: 'network-only',\n });\n condition = _condition;\n }\n const outcome = condition.outcomes.find((outcome) => outcome.outcomeId === outcomeId);\n const gameId = condition?.game.gameId;\n const gameEntityId = `${contracts.lp.address.toLowerCase()}_${gameId}`;\n let game = cache.readFragment({\n id: cache.identify({ __typename: 'Game', id: gameEntityId }),\n fragment: MainGameInfoFragmentDoc,\n fragmentName: 'MainGameInfo',\n });\n if (!game) {\n const { data: { games } } = await client.query({\n query: GameDocument,\n variables: {\n gameId,\n },\n fetchPolicy: 'network-only',\n });\n game = games[0];\n }\n const selectionFragment = {\n __typename: 'Selection',\n odds: String(odds[`${conditionId}-${outcomeId}`]),\n result: null,\n outcome: {\n __typename: 'Outcome',\n outcomeId: String(outcomeId),\n title: outcome.title,\n condition: {\n __typename: 'Condition',\n conditionId,\n status: ConditionStatus.Created,\n title: condition.title,\n game,\n },\n },\n };\n selectionFragments.push(selectionFragment);\n }\n }\n let tokenId;\n let rawOdds = 0n;\n if (isLive) {\n const receiptArgs = getEventArgsFromTxReceipt({ receipt, eventName: 'NewLiveBet', abi: liveCoreAbi });\n tokenId = (receiptArgs?.tokenId).toString();\n rawOdds = receiptArgs?.odds;\n }\n // we don't need additional for freeBet cause it triggers NewBet event on prematch core\n else {\n const isExpress = selections.length > 1;\n if (isExpress) {\n const receiptArgs = getEventArgsFromTxReceipt({\n receipt,\n eventName: 'NewBet',\n abi: contracts.prematchComboCore.abi,\n });\n tokenId = receiptArgs?.betId.toString();\n rawOdds = receiptArgs?.bet.odds;\n }\n else {\n const { conditionId, outcomeId } = selections[0];\n const eventParams = {\n conditionId: BigInt(conditionId),\n outcomeId: BigInt(outcomeId),\n };\n const receiptArgs = getEventArgsFromTxReceipt({\n receipt,\n eventName: 'NewBet',\n abi: contracts.prematchCore.abi,\n params: eventParams,\n });\n tokenId = receiptArgs?.tokenId.toString();\n rawOdds = receiptArgs?.odds;\n }\n }\n const rawPotentialPayout = rawAmount * rawOdds;\n const potentialPayout = formatUnits(rawPotentialPayout, betToken.decimals);\n const finalOdds = formatUnits(rawOdds, ODDS_DECIMALS);\n const amount = formatUnits(rawAmount, betToken.decimals);\n const actorArg = `\"actor\":\"${address.toLowerCase()}\"`;\n const affiliateArg = `\"affiliate\":\"${affiliate}\"`;\n if (isLive) {\n prematchClient.cache.modify({\n id: prematchClient.cache.identify({ __typename: 'Query' }),\n fields: {\n liveBets: (bets, { storeFieldName }) => {\n const isValidStorage = (storeFieldName.includes(`{${actorArg}}`) || // all bets\n storeFieldName.includes(`{${actorArg},${affiliateArg}}`) || // all bets with affiliate\n (storeFieldName.includes(actorArg) && storeFieldName.includes('\"status\":\"Accepted\"')) // BetType.Accepted\n );\n if (!isValidStorage) {\n return bets;\n }\n const betEntityId = `${coreAddress.toLowerCase()}_${tokenId}`;\n const data = {\n __typename: 'LiveBet',\n id: betEntityId,\n tokenId: tokenId,\n core: {\n address: coreAddress,\n liquidityPool: {\n address: contracts.lp.address,\n },\n },\n status: GraphBetStatus.Accepted,\n amount,\n odds: finalOdds,\n settledOdds: null,\n createdAt: String(Math.floor(Date.now() / 1000)),\n payout: null,\n potentialPayout: potentialPayout,\n result: null,\n cashout: null,\n txHash: receipt.transactionHash,\n affiliate,\n selections: selectionFragments,\n isRedeemed: false,\n isRedeemable: false,\n isCashedOut: false,\n };\n const newBet = prematchClient.cache.writeFragment({\n fragment: LiveBetFragmentDoc,\n fragmentName: 'LiveBet',\n data,\n });\n return [newBet, ...bets];\n },\n },\n });\n }\n else {\n prematchClient.cache.modify({\n id: prematchClient.cache.identify({ __typename: 'Query' }),\n fields: {\n bets: (bets, { storeFieldName }) => {\n const isValidStorage = (storeFieldName.includes(`{${actorArg}}`) || // all bets\n storeFieldName.includes(`{${actorArg},${affiliateArg}}`) || // all bets with affiliate\n (storeFieldName.includes(actorArg) && storeFieldName.includes('\"status\":\"Accepted\"')) // BetType.Accepted\n );\n if (!isValidStorage) {\n return bets;\n }\n const betEntityId = `${coreAddress.toLowerCase()}_${tokenId}`;\n const data = {\n __typename: 'Bet',\n id: betEntityId,\n tokenId: tokenId,\n core: {\n address: coreAddress,\n liquidityPool: {\n address: contracts.lp.address,\n },\n },\n status: GraphBetStatus.Accepted,\n amount,\n odds: finalOdds,\n settledOdds: null,\n createdAt: String(Math.floor(Date.now() / 1000)),\n payout: null,\n cashout: null,\n potentialPayout: potentialPayout,\n freebet: bet.freebetContractAddress ? {\n freebetId: String(freebetId),\n contractAddress: bet.freebetContractAddress,\n } : null,\n result: null,\n txHash: receipt.transactionHash,\n affiliate,\n selections: selectionFragments,\n isRedeemed: false,\n isRedeemable: false,\n isCashedOut: false,\n };\n const newBet = prematchClient.cache.writeFragment({\n fragment: PrematchBetFragmentDoc,\n fragmentName: 'PrematchBet',\n data,\n });\n return [newBet, ...bets];\n },\n },\n });\n }\n const bettorEntity = `${contracts.lp.address.toLowerCase()}_${address.toLowerCase()}_${affiliate.toLowerCase()}`;\n const bettorFragment = cache.readFragment({\n id: cache.identify({ __typename: 'Bettor', id: bettorEntity }),\n fragment: BettorFragmentDoc,\n fragmentName: 'Bettor',\n });\n if (bettorFragment) {\n prematchClient.cache.updateFragment({\n id: prematchClient.cache.identify({ __typename: 'Bettor', id: bettorEntity }),\n fragment: BettorFragmentDoc,\n fragmentName: 'Bettor',\n }, (data) => ({\n ...data,\n betsCount: data.betsCount + 1,\n rawInBets: String(BigInt(data.rawInBets) + rawAmount),\n }));\n }\n else {\n prematchClient.cache.modify({\n id: prematchClient.cache.identify({ __typename: 'Query' }),\n fields: {\n bettors: (bettors) => {\n const newBettor = prematchClient.cache.writeFragment({\n fragment: BettorFragmentDoc,\n fragmentName: 'Bettor',\n data: {\n __typename: 'Bettor',\n id: bettorEntity,\n rawToPayout: '0',\n rawInBets: String(rawAmount),\n rawTotalPayout: '0',\n rawTotalProfit: '0',\n betsCount: 1,\n wonBetsCount: 0,\n lostBetsCount: 0,\n },\n });\n return [...bettors, newBettor];\n },\n },\n });\n }\n };\n return {\n updateBetCache,\n addBet,\n };\n};const useRedeemBet = () => {\n const { contracts, appChain } = useChain();\n const wagmiConfig = useConfig();\n const { updateBetCache } = useBetsCache();\n const redeemTx = useSendTransaction();\n const account = useExtendedAccount();\n const aaClient = useAAWalletClient();\n const [aaTxState, setAaTxState] = useState({ isPending: false, data: undefined, error: null });\n const receipt = useWaitForTransactionReceipt({\n hash: aaTxState.data || redeemTx.data,\n query: {\n enabled: Boolean(aaTxState.data) || Boolean(redeemTx.data),\n },\n });\n const isAAWallet = Boolean(account.isAAWallet);\n const submit = async (props) => {\n const { bets } = props;\n const isBatch = bets.length > 1;\n redeemTx.reset();\n setAaTxState({\n isPending: isAAWallet,\n data: undefined,\n error: null,\n });\n let data;\n let to;\n if (isBatch) {\n const betsData = bets.map(({ tokenId, coreAddress }) => ({\n core: coreAddress,\n tokenId: BigInt(tokenId),\n isNative: false,\n }));\n to = contracts.proxyFront.address;\n data = encodeFunctionData({\n abi: contracts.proxyFront.abi,\n functionName: 'withdrawPayouts',\n args: [betsData],\n });\n }\n else {\n const { tokenId, coreAddress, freebetContractAddress, freebetId } = bets[0];\n if (freebetContractAddress && freebetId) {\n to = freebetContractAddress;\n data = encodeFunctionData({\n abi: freeBetAbi,\n functionName: 'withdrawPayout',\n args: [BigInt(freebetId)],\n });\n }\n else {\n to = contracts.lp.address;\n data = encodeFunctionData({\n abi: contracts.lp.abi,\n functionName: 'withdrawPayout',\n args: [\n coreAddress,\n BigInt(tokenId),\n ],\n });\n }\n }\n let hash;\n if (isAAWallet) {\n try {\n hash = await aaClient.sendTransaction({ to, data, chain: appChain });\n setAaTxState({\n data: hash,\n isPending: false,\n error: null,\n });\n }\n catch (error) {\n setAaTxState({\n data: undefined,\n isPending: false,\n error,\n });\n throw error;\n }\n }\n else {\n hash = await redeemTx.sendTransactionAsync({ to, data });\n }\n const receipt = await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n if (receipt?.status === 'reverted') {\n redeemTx.reset();\n setAaTxState({\n isPending: false,\n data: undefined,\n error: null,\n });\n throw new Error(`transaction ${receipt.transactionHash} was reverted`);\n }\n bets.forEach(({ tokenId, coreAddress }) => {\n updateBetCache({\n coreAddress,\n tokenId,\n }, {\n isRedeemed: true,\n isRedeemable: false,\n });\n });\n return receipt;\n };\n return {\n isPending: redeemTx.isPending || aaTxState.isPending,\n isProcessing: receipt.isLoading,\n data: redeemTx.data || aaTxState.data,\n error: redeemTx.error || aaTxState.error,\n submit,\n };\n};const useBetTokenBalance = () => {\n const { appChain, betToken } = useChain();\n const { address } = useExtendedAccount();\n const formatBalance = useCallback((rawBalance) => ({\n rawBalance,\n balance: formatUnits(rawBalance, betToken.decimals),\n }), [betToken.decimals]);\n const { data, isLoading, error, refetch } = useReadContract({\n address: betToken.address,\n abi: erc20Abi,\n functionName: 'balanceOf',\n chainId: appChain.id,\n args: [address],\n query: {\n enabled: Boolean(address),\n select: formatBalance,\n },\n });\n return {\n refetch,\n loading: isLoading,\n rawBalance: data?.rawBalance,\n balance: data?.balance,\n error,\n };\n};const useNativeBalance = () => {\n const { appChain } = useChain();\n const { address } = useExtendedAccount();\n const formatBalance = useCallback((data) => ({\n rawBalance: data.value,\n balance: formatUnits(data.value, data.decimals),\n }), []);\n const { isLoading, data, error, refetch } = useBalance({\n chainId: appChain.id,\n address,\n query: {\n enabled: Boolean(address),\n select: formatBalance,\n },\n });\n return {\n loading: isLoading,\n rawBalance: data?.rawBalance,\n balance: data?.balance,\n error,\n refetch,\n };\n};const simpleObjReducer$1 = (state, newState) => ({\n ...state,\n ...newState,\n});\nconst usePrepareBet = (props) => {\n const { betAmount: _betAmount, slippage, deadline, affiliate, selections, odds, totalOdds, freeBet, betGas, liveEIP712Attention, onSuccess, onError, } = props;\n const isLiveBet = useMemo(() => {\n return selections.some(({ coreAddress }) => coreAddress === liveHostAddress);\n }, [selections]);\n const isCombo = !isLiveBet && selections.length > 1;\n const isBatch = isCombo && typeof _betAmount === 'object';\n const isFreeBet = Boolean(freeBet) && !isCombo && !isBatch;\n const account = useExtendedAccount();\n const isAAWallet = Boolean(account.isAAWallet);\n const aaClient = useAAWalletClient();\n const { appChain, contracts, betToken, api } = useChain();\n const queryClient = useQueryClient();\n const wagmiConfig = useConfig();\n const walletClient = useWalletClient();\n const { relayerFeeAmount: rawRelayerFeeAmount, formattedRelayerFeeAmount: relayerFeeAmount, loading: isRelayerFeeFetching, } = useLiveBetFee({\n enabled: isLiveBet,\n });\n const { addBet } = useBetsCache();\n const { refetch: refetchBetTokenBalance } = useBetTokenBalance();\n const { refetch: refetchNativeBalance } = useNativeBalance();\n const [liveOrAABetTx, updateLiveOrAABetTx] = useReducer(simpleObjReducer$1, { data: undefined, isPending: false });\n const approveAddress = isLiveBet ? contracts.liveRelayer?.address : contracts.proxyFront.address;\n const allowanceTx = useReadContract({\n chainId: appChain.id,\n address: betToken.address,\n abi: erc20Abi,\n functionName: 'allowance',\n args: [\n account.address,\n approveAddress,\n ],\n query: {\n enabled: Boolean(account.address) && Boolean(approveAddress) && !isFreeBet,\n },\n });\n const approveTx = useWriteContract();\n const approveReceipt = useWaitForTransactionReceipt({\n hash: approveTx.data,\n query: {\n enabled: Boolean(approveTx.data),\n },\n });\n const betAmount = useMemo(() => {\n if (typeof _betAmount === 'string') {\n return +_betAmount;\n }\n return Object.values(_betAmount).reduce((acc, amount) => acc + +amount, 0);\n }, [_betAmount]);\n const isApproveRequired = useMemo(() => {\n if (!betAmount\n || typeof allowanceTx?.data === 'undefined'\n || (isLiveBet && typeof relayerFeeAmount === 'undefined')) {\n return false;\n }\n let approveAmount = betAmount;\n if (isLiveBet) {\n approveAmount += +relayerFeeAmount;\n }\n return allowanceTx.data < parseUnits(String(approveAmount), betToken.decimals);\n }, [allowanceTx.data, isLiveBet, relayerFeeAmount, betAmount]);\n const approve = async () => {\n const hash = await approveTx.writeContractAsync({\n address: betToken.address,\n abi: erc20Abi,\n functionName: 'approve',\n args: [\n approveAddress,\n maxUint256,\n ],\n });\n await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n allowanceTx.refetch();\n };\n const betTx = useSendTransaction();\n const betReceipt = useWaitForTransactionReceipt({\n hash: betTx.data || liveOrAABetTx.data,\n query: {\n enabled: Boolean(betTx.data) || Boolean(liveOrAABetTx.data),\n },\n });\n const placeBet = async () => {\n if (!totalOdds) {\n return;\n }\n let bets = [];\n const fixedAmount = formatToFixed(betAmount, betToken.decimals);\n const rawAmount = parseUnits(fixedAmount, betToken.decimals);\n const rawDeadline = BigInt(Math.floor(Date.now() / 1000) + (deadline || DEFAULT_DEADLINE));\n let txHash;\n betTx.reset();\n updateLiveOrAABetTx({\n data: undefined,\n isPending: isLiveBet || isAAWallet,\n });\n if (isAAWallet && aaClient) {\n await aaClient.switchChain({ id: appChain.id });\n }\n try {\n if (isLiveBet) {\n const fixedMinOdds = calcMindOdds({ odds: totalOdds, slippage });\n const rawMinOdds = parseUnits(fixedMinOdds, ODDS_DECIMALS);\n const { conditionId, outcomeId } = selections[0];\n if (isAAWallet && isApproveRequired) {\n const hash = await aaClient.sendTransaction({\n to: betToken.address,\n data: encodeFunctionData({\n abi: erc20Abi,\n functionName: 'approve',\n args: [\n approveAddress,\n maxUint256,\n ],\n }),\n });\n await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n confirmations: 1,\n });\n }\n bets.push({\n rawAmount,\n selections,\n });\n const liveBet = {\n attention: liveEIP712Attention || 'By signing this transaction, I agree to place a bet for a live event on \\'Azuro SDK Example',\n affiliate,\n core: contracts.liveCore.address,\n amount: String(rawAmount),\n chainId: appChain.id,\n conditionId: conditionId,\n outcomeId: +outcomeId,\n minOdds: String(rawMinOdds),\n nonce: String(Date.now()),\n expiresAt: Math.floor(Date.now() / 1000) + 2000,\n relayerFeeAmount: String(rawRelayerFeeAmount),\n };\n const typedData = getLiveBetTypedData({\n account: account.address,\n chainId: appChain.id,\n bet: liveBet,\n });\n const signature = isAAWallet\n ? await aaClient.signTypedData({ ...typedData, account: aaClient.account })\n : await walletClient.data.signTypedData(typedData);\n const createdOrder = await createLiveBet({\n account: account.address,\n chainId: appChain.id,\n bet: liveBet,\n signature,\n });\n const { id: orderId, state: newOrderState, errorMessage, } = createdOrder;\n if (newOrderState === LiveBetState.Created) {\n txHash = await new Promise((res, rej) => {\n const interval = setInterval(async () => {\n const order = await getLiveBet({\n chainId: appChain.id,\n orderId,\n });\n const { state, txHash, errorMessage } = order;\n if (state === LiveBetState.Rejected) {\n clearInterval(interval);\n rej(errorMessage);\n }\n if (txHash) {\n clearInterval(interval);\n res(txHash);\n }\n }, 1000);\n });\n updateLiveOrAABetTx({\n data: txHash,\n isPending: false,\n });\n }\n else {\n throw Error(errorMessage);\n }\n }\n else if (isFreeBet) {\n const { coreAddress, conditionId, outcomeId } = selections[0];\n const { id, expiresAt, contractAddress, rawMinOdds, rawAmount, signature, chainId } = freeBet;\n const fixedSelectionMinOdds = calcMindOdds({ odds: odds[`${conditionId}-${outcomeId}`], slippage });\n const rawSelectionMinOdds = parseUnits(fixedSelectionMinOdds, ODDS_DECIMALS);\n const rawFreeBetMinOdds = rawMinOdds > rawSelectionMinOdds ? rawMinOdds : rawSelectionMinOdds;\n bets.push({\n rawAmount,\n selections,\n freebetContractAddress: contractAddress,\n freebetId: String(id),\n });\n const data = encodeFunctionData({\n abi: freeBetAbi,\n functionName: 'bet',\n args: [\n {\n chainId: BigInt(chainId),\n expiresAt: BigInt(Math.floor(expiresAt / 1000)),\n amount: rawAmount,\n freeBetId: BigInt(id),\n minOdds: rawMinOdds,\n owner: account.address,\n },\n signature,\n coreAddress,\n BigInt(conditionId),\n BigInt(outcomeId),\n rawDeadline,\n rawFreeBetMinOdds,\n ],\n });\n txHash = isAAWallet ? (await aaClient.sendTransaction({ to: contractAddress, data, chain: appChain })) : (await betTx.sendTransactionAsync({\n to: contractAddress,\n data,\n ...(betGas || {}),\n }));\n }\n else {\n let betData;\n if (isBatch) {\n betData = selections.map(selection => {\n const { conditionId, outcomeId } = selection;\n const fixedAmount = parseFloat(_betAmount[`${conditionId}-${outcomeId}`]).toFixed(betToken.decimals);\n const rawAmount = parseUnits(fixedAmount, betToken.decimals);\n const fixedMinOdds = calcMindOdds({ odds: odds[`${conditionId}-${outcomeId}`], slippage });\n const rawMinOdds = parseUnits(fixedMinOdds, ODDS_DECIMALS);\n const data = getPrematchBetDataBytes([selection]);\n bets.push({\n rawAmount,\n selections: [selection],\n });\n return {\n core: contracts.prematchCore.address,\n amount: rawAmount,\n expiresAt: rawDeadline,\n extraData: {\n affiliate,\n minOdds: rawMinOdds,\n data,\n },\n };\n });\n }\n else {\n const fixedMinOdds = calcMindOdds({ odds: totalOdds, slippage });\n const rawMinOdds = parseUnits(fixedMinOdds, ODDS_DECIMALS);\n const coreAddress = selections.length > 1 ? contracts.prematchComboCore.address : contracts.prematchCore.address;\n const data = getPrematchBetDataBytes(selections);\n bets.push({\n rawAmount,\n selections,\n });\n betData = [\n {\n core: coreAddress,\n amount: rawAmount,\n expiresAt: rawDeadline,\n extraData: {\n affiliate,\n minOdds: rawMinOdds,\n data,\n },\n },\n ];\n }\n const betTxDTO = {\n to: contracts.proxyFront.address,\n data: encodeFunctionData({\n abi: contracts.proxyFront.abi,\n functionName: 'bet',\n args: [\n contracts.lp.address,\n betData,\n ],\n }),\n ...(betGas || {}),\n };\n if (isAAWallet) {\n const calls = isApproveRequired ? [\n {\n to: betToken.address,\n data: encodeFunctionData({\n abi: erc20Abi,\n functionName: 'approve',\n args: [\n approveAddress,\n maxUint256,\n ],\n }),\n },\n betTxDTO,\n ] : [\n betTxDTO,\n ];\n txHash = await aaClient.sendTransaction({\n calls,\n });\n updateLiveOrAABetTx({\n data: txHash,\n isPending: false,\n });\n }\n else {\n txHash = await betTx.sendTransactionAsync(betTxDTO);\n }\n }\n const receipt = await waitForTransactionReceipt(wagmiConfig, {\n hash: txHash,\n chainId: appChain.id,\n });\n refetchBetTokenBalance();\n refetchNativeBalance();\n allowanceTx.refetch();\n if (isFreeBet) {\n const queryKey = ['freebets', api, account.address.toLowerCase(), affiliate.toLowerCase()];\n await queryClient.cancelQueries({ queryKey });\n queryClient.setQueryData(queryKey, (oldFreeBets) => {\n const newFreeBets = [...oldFreeBets].filter(({ id, contractAddress }) => {\n return contractAddress.toLowerCase() !== freeBet.contractAddress.toLowerCase() || id !== freeBet.id;\n });\n return newFreeBets;\n });\n }\n if (receipt?.status === 'reverted') {\n betTx.reset();\n updateLiveOrAABetTx({\n data: undefined,\n isPending: false,\n });\n throw new Error(`transaction ${receipt.transactionHash} was reverted`);\n }\n if (receipt) {\n bets.forEach((bet) => {\n addBet({\n receipt,\n affiliate,\n odds,\n bet,\n });\n });\n }\n onSuccess?.(receipt);\n }\n catch (err) {\n if (isLiveBet) {\n updateLiveOrAABetTx({\n isPending: false,\n });\n }\n onError?.(err);\n }\n };\n const submit = () => {\n if (isApproveRequired && !isAAWallet) {\n return approve();\n }\n return placeBet();\n };\n return {\n submit,\n approveTx: {\n isPending: approveTx.isPending,\n isProcessing: approveReceipt.isLoading,\n },\n betTx: {\n data: betTx.data || liveOrAABetTx.data,\n receipt: betReceipt.data,\n isPending: betTx.isPending || liveOrAABetTx.isPending,\n isProcessing: betReceipt.isLoading,\n },\n relayerFeeAmount,\n isAllowanceLoading: allowanceTx.isLoading,\n isApproveRequired: isAAWallet ? false : isApproveRequired,\n isRelayerFeeLoading: isRelayerFeeFetching,\n };\n};const useSelection = ({ selection, initialOdds, initialStatus }) => {\n const { coreAddress, conditionId, outcomeId } = selection;\n const { appChain, contracts } = useChain();\n const { prematchClient } = useApolloClients();\n const { isSocketReady, subscribeToUpdates, unsubscribeToUpdates } = useOddsSocket();\n const config = useConfig();\n const isLive = coreAddress.toLowerCase() === liveHostAddress.toLowerCase();\n const [odds, setOdds] = useState(initialOdds || 0);\n const [isOddsFetching, setOddsFetching] = useState(!initialOdds);\n const [status, setStatus] = useState(initialStatus || ConditionStatus.Created);\n const [isStatusFetching, setStatusFetching] = useState(!initialStatus);\n const isLocked = status !== ConditionStatus.Created;\n useEffect(() => {\n if (!isLive || !isSocketReady) {\n return;\n }\n subscribeToUpdates([conditionId]);\n return () => {\n unsubscribeToUpdates([conditionId]);\n };\n }, [isSocketReady]);\n useEffect(() => {\n const unsubscribe = oddsWatcher.subscribe(`${conditionId}`, async (oddsData) => {\n let odds = oddsData?.outcomes?.[String(outcomeId)]?.odds;\n if (!odds) {\n const rawOdds = await readContract(config, {\n address: contracts.prematchCore.address,\n abi: contracts.prematchCore.abi,\n functionName: 'calcOdds',\n chainId: appChain.id,\n args: [\n BigInt(conditionId),\n BigInt(1),\n BigInt(outcomeId),\n ],\n });\n odds = formatUnits(rawOdds, ODDS_DECIMALS);\n }\n else {\n setOddsFetching(false);\n }\n setOdds(+odds);\n });\n return () => {\n unsubscribe();\n };\n }, [config]);\n useEffect(() => {\n const unsubscribe = conditionStatusWatcher.subscribe(`${conditionId}`, (newStatus) => {\n setStatusFetching(false);\n setStatus(newStatus);\n });\n return () => {\n unsubscribe();\n };\n }, []);\n useEffect(() => {\n if (isLive || (initialOdds && initialStatus)) {\n return;\n }\n (async () => {\n const conditionEntityId = `${contracts.prematchCore.address.toLowerCase()}_${conditionId}`;\n const key = `${conditionId}-${outcomeId}`;\n const data = await batchFetchOutcomes([conditionEntityId], prematchClient);\n if (!initialOdds) {\n setOdds(data?.[key]?.odds || 0);\n setOddsFetching(false);\n }\n if (!initialStatus) {\n setStatus(data?.[key]?.status || ConditionStatus.Created);\n setStatusFetching(false);\n }\n })();\n }, [prematchClient]);\n return {\n odds,\n isLocked,\n isOddsFetching,\n isStatusFetching,\n };\n};const useLiveStatistics = ({ gameId, sportId, gameStatus, enabled = true }) => {\n const [statistics, setStatistics] = useState();\n const { subscribeToUpdates, unsubscribeToUpdates, isSocketReady } = useLiveStatisticsSocket();\n const providerId = getProviderFromId(gameId);\n const isSportAllowed = LIVE_STATISTICS_SUPPORTED_SPORTS.includes(+sportId);\n const isProviderAllowed = LIVE_STATISTICS_SUPPORTED_PROVIDERS.includes(providerId);\n const isGameInLive = gameStatus === GameStatus.Live;\n const skip = (!enabled ||\n !gameId ||\n !sportId ||\n !isSportAllowed ||\n !isProviderAllowed ||\n !isGameInLive);\n const isAvailable = isSportAllowed && isGameInLive && isProviderAllowed;\n let isFetching = !skip && !statistics && statistics !== null;\n const prevGameIdRef = useRef(gameId);\n if (prevGameIdRef.current !== gameId) {\n setStatistics(undefined);\n if (!skip) {\n isFetching = true;\n }\n }\n prevGameIdRef.current = gameId;\n useEffect(() => {\n if (!isSocketReady || skip) {\n return;\n }\n subscribeToUpdates([gameId]);\n return () => {\n unsubscribeToUpdates([gameId]);\n };\n }, [skip, gameId, isSocketReady]);\n useEffect(() => {\n if (skip) {\n return;\n }\n const unsubscribe = liveStatisticWatcher.subscribe(gameId, async (data) => {\n if (data.stats === null) {\n setStatistics(null);\n }\n else {\n setStatistics(data);\n }\n });\n return () => {\n unsubscribe();\n };\n }, [skip, gameId]);\n return {\n statistics,\n isFetching,\n isAvailable,\n };\n};const useGameStatus = ({ graphStatus, startsAt, isGameExistInLive }) => {\n const startDate = +startsAt * 1000;\n const [isGameStarted, setGameStarted] = useState(Date.now() > startDate);\n const gameStatus = useMemo(() => {\n return getGameStatus({\n graphStatus,\n startsAt,\n isGameInLive: isGameExistInLive,\n });\n }, [graphStatus, isGameStarted, isGameExistInLive]);\n useEffect(() => {\n if (isGameStarted) {\n return;\n }\n const timer = setTimeout(() => {\n setGameStarted(true);\n }, startDate - Date.now());\n return () => {\n clearTimeout(timer);\n };\n }, [startDate]);\n return {\n status: gameStatus,\n isGameStarted,\n };\n};const findActiveCondition = ({ statuses, marketsByKey, sortedMarketKeys, activeMarketKey }) => {\n // try to find condition with Created status in active market\n let nextConditionIndex = marketsByKey[activeMarketKey].outcomeRows.findIndex((outcomes) => {\n return outcomes.some(({ conditionId }) => statuses[conditionId] === ConditionStatus.Created);\n });\n if (nextConditionIndex !== -1) {\n return {\n nextMarketKey: activeMarketKey,\n nextConditionIndex,\n };\n }\n else {\n // try to find next market and condition with Created status\n nextConditionIndex = 0;\n const nextMarketKey = sortedMarketKeys.find(marketKey => {\n return marketsByKey[marketKey].outcomeRows.find((outcomes, index) => {\n const isMatch = statuses[outcomes[0].conditionId] === ConditionStatus.Created;\n if (isMatch) {\n nextConditionIndex = index;\n }\n return isMatch;\n });\n });\n if (nextMarketKey) {\n return {\n nextMarketKey,\n nextConditionIndex,\n };\n }\n return {};\n }\n};const getConditions = async (conditionIds, api) => {\n const response = await fetch(`${api}/conditions`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n ids: [...conditionIds],\n }),\n });\n const data = await response.json();\n if (response.status === 404 || !response.ok) {\n return {};\n }\n return data?.reduce((acc, condition) => {\n const { id: conditionId } = condition;\n acc[conditionId] = condition;\n return acc;\n }, {});\n};\nconst batchFetchLiveConditions = createBatch(getConditions);const useActiveMarket = ({ markets }) => {\n const { api } = useChain();\n const isMounted = useIsMounted();\n const { isSocketReady, subscribeToUpdates, unsubscribeToUpdates } = useOddsSocket();\n const { sortedMarketKeys, marketsByKey } = useMemo(() => {\n const defaultValue = {\n sortedMarketKeys: [],\n marketsByKey: {},\n };\n if (!markets?.length) {\n return defaultValue;\n }\n return markets.reduce((acc, market) => {\n const { marketKey } = market;\n acc.sortedMarketKeys.push(marketKey);\n acc.marketsByKey[marketKey] = market;\n return acc;\n }, defaultValue);\n }, [markets]);\n const [activeMarketKey, setActiveMarketKey] = useState(sortedMarketKeys[0]);\n const [activeConditionIndex, setActiveConditionIndex] = useState(0);\n const otherMarkets = useMemo(() => {\n return sortedMarketKeys.filter(key => key !== activeMarketKey);\n }, [activeMarketKey, sortedMarketKeys]);\n const isLive = (markets?.[0]?.outcomeRows?.[0]?.[0]?.coreAddress?.toLocaleLowerCase() === liveHostAddress.toLocaleLowerCase());\n const selections = useMemo(() => {\n return markets.reduce((acc, market) => {\n const { outcomeRows } = market;\n outcomeRows.forEach(outcomes => {\n outcomes.forEach((outcome) => {\n acc.push(outcome);\n });\n });\n return acc;\n }, []);\n }, [markets]);\n // prematch part start\n const { statuses: prematchStatuses, loading: isPrematchStatusesFetching } = useStatuses({\n selections: isLive ? [] : selections,\n });\n useEffect(() => {\n if (isLive || !markets?.length) {\n return;\n }\n const activeConditionId = marketsByKey[activeMarketKey].outcomeRows[activeConditionIndex][0].conditionId;\n const activeStatus = (prematchStatuses[activeConditionId] || ConditionStatus.Created);\n if (activeStatus === ConditionStatus.Created) {\n return;\n }\n const { nextMarketKey, nextConditionIndex } = findActiveCondition({\n statuses: prematchStatuses,\n marketsByKey,\n sortedMarketKeys,\n activeMarketKey,\n });\n if (nextMarketKey) {\n setActiveMarketKey(nextMarketKey);\n }\n if (nextConditionIndex) {\n setActiveConditionIndex(nextConditionIndex);\n }\n }, [prematchStatuses]);\n // prematch part end\n // live part start\n const [liveConditionStatus, setLiveConditionStatus] = useState(ConditionStatus.Created);\n useEffect(() => {\n if (!isLive || !markets.length) {\n return;\n }\n const activeConditionId = marketsByKey[activeMarketKey].outcomeRows[activeConditionIndex][0].conditionId;\n const unsubscribe = conditionStatusWatcher.subscribe(activeConditionId, (newStatus) => {\n setLiveConditionStatus(newStatus);\n });\n return () => {\n unsubscribe();\n };\n }, [activeMarketKey, activeConditionIndex]);\n useEffect(() => {\n if (!isLive || !markets?.length || !isSocketReady) {\n return;\n }\n const activeConditionId = marketsByKey[activeMarketKey].outcomeRows[activeConditionIndex][0].conditionId;\n subscribeToUpdates([activeConditionId]);\n return () => {\n unsubscribeToUpdates([activeConditionId]);\n };\n }, [activeMarketKey, activeConditionIndex, isSocketReady]);\n useEffect(() => {\n if (!isLive || !markets?.length || liveConditionStatus === ConditionStatus.Created) {\n return;\n }\n let timeout;\n const getNextMarket = async () => {\n try {\n const conditionIds = [\n ...new Set(selections.map(({ conditionId }) => conditionId)),\n ];\n const data = await batchFetchLiveConditions(conditionIds, api);\n if (!isMounted()) {\n return;\n }\n const statusByConditionId = conditionIds.reduce((acc, conditionId) => {\n const { state } = data[conditionId] || { state: ConditionStatus.Paused };\n acc[conditionId] = state;\n return acc;\n }, {});\n const { nextMarketKey, nextConditionIndex } = findActiveCondition({\n statuses: statusByConditionId,\n marketsByKey,\n sortedMarketKeys,\n activeMarketKey,\n });\n if (nextMarketKey) {\n setActiveMarketKey(nextMarketKey);\n if (nextConditionIndex) {\n setActiveConditionIndex(nextConditionIndex);\n }\n setLiveConditionStatus(ConditionStatus.Created);\n }\n // refetch in timeout\n else {\n const isContainsPausedState = Object.values(statusByConditionId).some(status => status === ConditionStatus.Paused);\n // if we have condition in paused state\n // then refetch statuses in 10s\n if (isContainsPausedState) {\n timeout = setTimeout(() => {\n if (isMounted()) {\n getNextMarket();\n }\n }, 10_000);\n }\n }\n }\n catch { }\n };\n getNextMarket();\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [activeMarketKey, activeConditionIndex, liveConditionStatus]);\n // live part end\n return {\n marketsByKey,\n activeMarketKey,\n activeConditionIndex,\n otherMarkets,\n sortedMarketKeys,\n loading: isPrematchStatusesFetching,\n };\n};const wrapAbi = [\n {\n 'constant': false,\n 'inputs': [],\n 'name': 'deposit',\n 'outputs': [],\n 'payable': true,\n 'stateMutability': 'payable',\n 'type': 'function',\n },\n {\n 'constant': false,\n 'inputs': [\n {\n 'name': 'wad',\n 'type': 'uint256',\n },\n ],\n 'name': 'withdraw',\n 'outputs': [],\n 'payable': false,\n 'stateMutability': 'nonpayable',\n 'type': 'function',\n },\n];\nconst WRAP_CHAINS = [gnosis.id, base.id, baseSepolia.id];\nconst useWrapTokens = () => {\n const { appChain, betToken } = useChain();\n const account = useExtendedAccount();\n const aaClient = useAAWalletClient();\n const wagmiConfig = useConfig();\n const depositTx = useSendTransaction();\n const withdrawTx = useSendTransaction();\n const { refetch: refetchBetTokenBalance } = useBetTokenBalance();\n const { refetch: refetchNativeBalance } = useNativeBalance();\n const [aaDepositTxState, setAaDepositTxState] = useState({\n data: undefined,\n isPending: false,\n });\n const [aaWithdrawTxState, setAaWithdrawTxState] = useState({\n data: undefined,\n isPending: false,\n });\n const depositReceipt = useWaitForTransactionReceipt({\n hash: aaDepositTxState.data || depositTx.data,\n query: {\n enabled: Boolean(aaDepositTxState.data) || Boolean(depositTx.data),\n },\n });\n const withdrawReceipt = useWaitForTransactionReceipt({\n hash: aaWithdrawTxState.data || withdrawTx.data,\n query: {\n enabled: Boolean(aaWithdrawTxState.data) || Boolean(withdrawTx.data),\n },\n });\n const isAAWallet = Boolean(account.isAAWallet);\n const wrap = async (amount) => {\n if (!WRAP_CHAINS.includes(appChain.id)) {\n throw new Error('insufficient chain, please use Gnosis or Base');\n }\n depositTx.reset();\n setAaDepositTxState({\n isPending: isAAWallet,\n data: undefined,\n });\n const fixedAmount = formatToFixed(amount, appChain.nativeCurrency.decimals);\n const rawAmount = parseUnits(fixedAmount, appChain.nativeCurrency.decimals);\n const tx = {\n to: betToken.address,\n value: rawAmount,\n data: encodeFunctionData({\n abi: wrapAbi,\n functionName: 'deposit',\n }),\n };\n let hash;\n if (isAAWallet) {\n try {\n hash = await aaClient.sendTransaction({ ...tx, chain: appChain });\n setAaDepositTxState({\n data: hash,\n isPending: false,\n });\n }\n catch (error) {\n setAaDepositTxState({\n data: undefined,\n isPending: false,\n });\n throw error;\n }\n }\n else {\n hash = await depositTx.sendTransactionAsync(tx);\n }\n const receipt = await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n refetchBetTokenBalance();\n refetchNativeBalance();\n return receipt;\n };\n const unwrap = async (amount) => {\n if (!WRAP_CHAINS.includes(appChain.id)) {\n throw new Error('insufficient chain, please use Gnosis or Base');\n }\n withdrawTx.reset();\n setAaWithdrawTxState({\n isPending: isAAWallet,\n data: undefined,\n });\n const fixedAmount = formatToFixed(amount, betToken.decimals);\n const rawAmount = parseUnits(fixedAmount, betToken.decimals);\n const tx = {\n to: betToken.address,\n data: encodeFunctionData({\n abi: wrapAbi,\n functionName: 'withdraw',\n args: [rawAmount],\n }),\n };\n let hash;\n if (isAAWallet) {\n try {\n hash = await aaClient.sendTransaction({ ...tx, chain: appChain });\n setAaWithdrawTxState({\n data: hash,\n isPending: false,\n });\n }\n catch (error) {\n setAaWithdrawTxState({\n data: undefined,\n isPending: false,\n });\n throw error;\n }\n }\n else {\n hash = await withdrawTx.sendTransactionAsync(tx);\n }\n const receipt = await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n refetchBetTokenBalance();\n refetchNativeBalance();\n return receipt;\n };\n return {\n wrap,\n unwrap,\n wrapTx: {\n data: depositTx.data || aaDepositTxState.data,\n receipt: depositReceipt.data,\n isPending: depositTx.isPending || aaDepositTxState.isPending,\n isProcessing: depositReceipt.isLoading,\n },\n unwrapTx: {\n data: withdrawTx.data || aaWithdrawTxState.data,\n receipt: withdrawReceipt.data,\n isPending: withdrawTx.isPending || aaWithdrawTxState.isPending,\n isProcessing: withdrawReceipt.isLoading,\n },\n };\n};const getCashouts = async (conditionIds, chainId) => {\n const data = await getPrecalculatedCashouts({\n chainId,\n conditionIds,\n });\n return data?.reduce((acc, { conditionId, available, outcomes }) => {\n outcomes.forEach(({ outcomeId, multiplier }) => {\n const key = `${conditionId}-${outcomeId}`;\n acc[key] = {\n conditionId,\n outcomeId: outcomeId.toString(),\n isAvailable: available,\n multiplier,\n };\n });\n return acc;\n }, {});\n};\nconst batchFetchCashouts = createBatch(getCashouts);const usePrecalculatedCashouts = ({ tokenId, selections, graphBetStatus, enabled = true }) => {\n const { appChain, api } = useChain();\n // const isLive = selections[0]!.coreAddress === contracts.liveCore?.address\n const conditionsKey = useMemo(() => {\n return selections.map(({ conditionId, outcomeId }) => `${conditionId}/${outcomeId}`).join('-');\n }, [selections]);\n const isConditionsFromDifferentProviders = useMemo(() => {\n if (!conditionsKey) {\n return false;\n }\n const providerIds = new Set(selections.map(({ conditionId }) => getProviderFromId(conditionId)));\n return providerIds.size > 1;\n }, [conditionsKey]);\n const queryFn = async () => {\n const data = await batchFetchCashouts(selections.map(({ conditionId }) => conditionId), appChain.id);\n const newCashouts = selections.reduce((acc, { conditionId, outcomeId }) => {\n const key = `${conditionId}-${outcomeId}`;\n const cashout = data?.[key];\n acc[key] = cashout;\n return acc;\n }, {});\n return newCashouts;\n };\n const { data: cashouts, isFetching } = useQuery({\n queryKey: ['cashout/precalculate', api, tokenId, conditionsKey],\n queryFn,\n gcTime: 0, // disable cache\n refetchInterval: 60_000,\n refetchOnWindowFocus: false,\n enabled: (enabled &&\n !isConditionsFromDifferentProviders &&\n Boolean(selections.length) &&\n graphBetStatus === GraphBetStatus.Accepted\n // !isLive\n ),\n });\n const isCashoutAvailable = useMemo(() => {\n if (!cashouts || !Object.keys(cashouts).length) {\n return false;\n }\n return Object.values(cashouts).every(({ isAvailable }) => isAvailable);\n }, [cashouts]);\n const totalMultiplier = useMemo(() => {\n if (!cashouts || !Object.keys(cashouts).length) {\n return 1;\n }\n if (Object.keys(cashouts).length === 1) {\n return +Object.values(cashouts)[0].multiplier;\n }\n return Object.values(cashouts).reduce((acc, { multiplier }) => acc *= +multiplier, 1);\n }, [cashouts]);\n return {\n cashouts,\n totalMultiplier,\n isCashoutAvailable,\n isFetching,\n };\n};const simpleObjReducer = (state, newState) => ({\n ...state,\n ...newState,\n});\nconst useCashout = (props) => {\n const { tokenId, selections, EIP712Attention, onSuccess, onError, } = props;\n const { appChain, contracts, api, betToken } = useChain();\n const { updateBetCache } = useBetsCache();\n const queryClient = useQueryClient();\n const account = useExtendedAccount();\n const isAAWallet = Boolean(account.isAAWallet);\n const aaClient = useAAWalletClient();\n const walletClient = useWalletClient();\n const wagmiConfig = useConfig();\n const { refetch: refetchBalance } = useBalance({\n chainId: appChain.id,\n address: account.address,\n token: betToken.address,\n });\n const [cashoutTx, updateCashoutTx] = useReducer(simpleObjReducer, {\n data: undefined, isPending: false,\n });\n const updatePrecalculatedCache = () => {\n const conditionsKey = selections.map(({ conditionId, outcomeId }) => `${conditionId}/${outcomeId}`).join('-');\n const queryKey = ['cashout/precalculate', api, tokenId, conditionsKey];\n // set precalculate query unavailable to cashout\n queryClient.setQueryData(queryKey, (oldPrecalcCashouts) => {\n if (!oldPrecalcCashouts) {\n return oldPrecalcCashouts;\n }\n const newPrecalcCashouts = { ...oldPrecalcCashouts };\n selections.forEach(({ conditionId, outcomeId }) => {\n const key = `${conditionId}-${outcomeId}`;\n newPrecalcCashouts[key] = {\n ...newPrecalcCashouts[key],\n isAvailable: false,\n };\n });\n return newPrecalcCashouts;\n });\n };\n const isLive = selections[0].coreAddress.toLowerCase() === contracts.liveCore?.address.toLowerCase();\n const betCoreAddress = selections[0].coreAddress;\n const betNftContractAddress = betCoreAddress.toLowerCase() === contracts.prematchComboCore.address.toLowerCase() ? (contracts.prematchComboCore.address) : (contracts.azuroBet.address);\n const calculationQuery = useQuery({\n queryKey: ['cashout/calculate', api, account.address?.toLowerCase(), tokenId, isLive],\n queryFn: () => getCalculatedCashout({\n chainId: appChain.id,\n account: account.address,\n graphBetId: `${betCoreAddress.toLowerCase()}_${tokenId}`,\n isLive,\n }),\n refetchOnWindowFocus: false,\n retry: () => {\n updatePrecalculatedCache();\n return false; // disable retries on error\n },\n gcTime: 0, // disable cache\n enabled: (\n // !isLive &&\n !!account.address),\n });\n const { data: calculation } = calculationQuery;\n const { calculationId, multiplier, expiredAt, approveExpiredAt } = calculation || {};\n const isCashoutAvailable = (\n // !isLive &&\n Boolean(calculationId));\n const allowanceTx = useReadContract({\n chainId: appChain.id,\n address: betNftContractAddress,\n abi: contracts.azuroBet.abi,\n functionName: 'isApprovedForAll',\n args: [\n account.address,\n contracts.cashout?.address,\n ],\n query: {\n enabled: (Boolean(account.address) &&\n Boolean(contracts.cashout?.address) &&\n isCashoutAvailable),\n },\n });\n const isApproveRequired = (!allowanceTx.isLoading &&\n !allowanceTx.data);\n const approveTx = useWriteContract();\n const approveReceipt = useWaitForTransactionReceipt({\n hash: approveTx.data,\n });\n const cashoutReceipt = useWaitForTransactionReceipt({\n hash: cashoutTx.data,\n });\n const approve = async () => {\n const hash = await approveTx.writeContractAsync({\n address: betNftContractAddress,\n abi: contracts.azuroBet.abi,\n functionName: 'setApprovalForAll',\n args: [\n contracts.cashout?.address,\n true,\n ],\n });\n await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n allowanceTx.refetch();\n };\n const cashout = async () => {\n try {\n if (!isCashoutAvailable) {\n throw new Error('cashout unavailable');\n }\n updateCashoutTx({\n data: undefined,\n isPending: true,\n });\n // switch chain and approve\n if (isAAWallet && aaClient) {\n await aaClient.switchChain({ id: appChain.id });\n if (isApproveRequired) {\n const hash = await aaClient.sendTransaction({\n to: betNftContractAddress,\n data: encodeFunctionData({\n abi: contracts.azuroBet.abi,\n functionName: 'setApprovalForAll',\n args: [\n contracts.cashout?.address,\n true,\n ],\n }),\n });\n await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n }\n }\n const attention = EIP712Attention || 'By signing this transaction, I agree to cash out on \\'Azuro SDK Example';\n const typedData = getCashoutTypedData({\n chainId: appChain.id,\n account: account.address,\n attention,\n tokenId,\n betCoreAddress,\n multiplier: multiplier,\n expiredAt: expiredAt,\n });\n const signature = isAAWallet\n ? await aaClient.signTypedData({ ...typedData, account: aaClient.account })\n : await walletClient.data.signTypedData(typedData);\n if (Date.now() >= approveExpiredAt) {\n throw new Error('expired call');\n }\n const createdCashout = await createCashout({\n chainId: appChain.id,\n calculationId: calculationId,\n betCoreAddress,\n attention,\n signature,\n });\n const { id: orderId, state: newOrderState, errorMessage, } = createdCashout;\n let txHash;\n if (newOrderState && newOrderState !== CashoutState.Rejected) {\n txHash = await new Promise((res, rej) => {\n const interval = setInterval(async () => {\n const order = await getCashout({\n chainId: appChain.id,\n orderId,\n });\n const { state, txHash, errorMessage } = order;\n if (state === CashoutState.Rejected) {\n clearInterval(interval);\n rej(errorMessage);\n }\n if (txHash) {\n clearInterval(interval);\n res(txHash);\n }\n }, 1000);\n });\n }\n else {\n throw Error(errorMessage);\n }\n updateCashoutTx({\n data: txHash,\n isPending: false,\n });\n const receipt = await waitForTransactionReceipt(wagmiConfig, {\n hash: txHash,\n chainId: appChain.id,\n });\n const receiptArgs = getEventArgsFromTxReceipt({\n receipt,\n eventName: 'Transfer',\n abi: erc20Abi,\n params: {\n to: account.address,\n },\n });\n refetchBalance();\n allowanceTx.refetch();\n updatePrecalculatedCache();\n updateBetCache({\n coreAddress: betCoreAddress,\n tokenId,\n }, {\n isCashedOut: true,\n cashout: {\n __typename: 'Cashout',\n payout: formatUnits(receiptArgs?.value || 0n, betToken.decimals),\n },\n });\n onSuccess?.(receipt);\n }\n catch (err) {\n updateCashoutTx({\n isPending: false,\n });\n onError?.(err);\n }\n };\n const submit = () => {\n if (isApproveRequired && !isAAWallet) {\n return approve();\n }\n return cashout();\n };\n return {\n submit,\n calculationQuery,\n approveTx: {\n isPending: approveTx.isPending,\n isProcessing: approveReceipt.isLoading,\n },\n cashoutTx: {\n data: cashoutTx.data,\n receipt: cashoutReceipt.data,\n isPending: cashoutTx.isPending,\n isProcessing: cashoutReceipt.isLoading,\n },\n isAllowanceFetching: allowanceTx.isLoading,\n isCashoutAvailable,\n isApproveRequired,\n };\n};const useWaveLevels = ({ waveId } = { waveId: 'active' }) => {\n const { appChain, api } = useChain();\n const queryFn = () => (getWaveLevels({\n chainId: appChain.id,\n waveId,\n }));\n return useQuery({\n queryKey: ['wave/levels', waveId, api],\n queryFn,\n refetchOnWindowFocus: false,\n });\n};const useWaveStats = ({ account, waveId = 'active' }) => {\n const { appChain, api } = useChain();\n const queryFn = async () => {\n const data = await getWaveStats({\n account,\n waveId,\n chainId: appChain.id,\n });\n if (!data) {\n return data;\n }\n const { address, levelActivated, ...rest } = data;\n return {\n ...rest,\n isActivated: levelActivated,\n };\n };\n return useQuery({\n queryKey: ['wave/stats', waveId, api, account?.toLowerCase()],\n queryFn,\n refetchOnWindowFocus: false,\n enabled: Boolean(account),\n });\n};const useWavePeriods = ({ waveId } = { waveId: 'active' }) => {\n const { appChain, api } = useChain();\n const queryFn = async () => {\n const data = await getWavePeriods({\n waveId,\n chainId: appChain.id,\n });\n if (!data) {\n return data;\n }\n return [...data].reverse().map(({ id, startsAt, endsAt, totalPoints }, index) => {\n const fromTimestamp = new Date(startsAt).getTime();\n const toTimestamp = new Date(endsAt).getTime() - 1000;\n return {\n id,\n startsAt: Math.floor(fromTimestamp / 1000),\n endsAt: Math.floor(toTimestamp / 1000),\n totalPoints,\n isBonusPreCalc: !index,\n };\n });\n };\n return useQuery({\n queryKey: ['wave/periods', waveId, api],\n queryFn,\n refetchOnWindowFocus: false,\n });\n};const useWaveLeaderBoard = ({ waveId = 'active', account, startsAt, enabled }) => {\n const { appChain, api } = useChain();\n const queryFn = () => (getWaveLeaderBoard({\n waveId,\n account,\n startsAt,\n chainId: appChain.id,\n }));\n return useQuery({\n queryKey: ['wave/leaderboard', waveId, api, account?.toLowerCase(), startsAt],\n queryFn,\n refetchOnWindowFocus: false,\n enabled,\n });\n};const useWaveActivation = ({ account, waveId = 'active' }) => {\n const queryClient = useQueryClient();\n const { appChain, api } = useChain();\n const mutationFn = () => (activateWave({\n account,\n waveId,\n chainId: appChain.id,\n }));\n const { mutate, mutateAsync, isPending } = useMutation({\n mutationFn,\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['wave/stats', waveId, api, account?.toLowerCase()] });\n queryClient.invalidateQueries({ queryKey: ['wave/leaderboard', waveId, api, account?.toLowerCase()] });\n },\n });\n return {\n activate: mutate,\n activateAsync: mutateAsync,\n isPending,\n };\n};const useDeBridgeSupportedChains = ({ enabled } = { enabled: true }) => {\n const queryFn = async () => {\n const chains = await getDeBridgeSupportedChains();\n if (!chains) {\n return chains;\n }\n const chainIds = chains.map(({ originalChainId }) => originalChainId);\n return {\n chains,\n chainIds,\n };\n };\n const { isFetching, data, refetch } = useQuery({\n queryKey: ['/debridge-supported-chains'],\n queryFn,\n enabled,\n refetchOnWindowFocus: false,\n });\n return {\n supportedChains: data?.chains,\n supportedChainIds: data?.chainIds,\n refetch,\n loading: isFetching,\n };\n};const useDeBridgeSupportedTokens = ({ chainId, enabled = true }) => {\n const queryFn = async () => {\n const tokens = await getDeBridgeSupportedTokens(chainId);\n if (!tokens) {\n return tokens;\n }\n const supportedTokens = Object.values(tokens);\n return {\n supportedTokens,\n tokenAddresses: supportedTokens.map(({ address }) => address),\n };\n };\n const { isFetching, data, refetch } = useQuery({\n queryKey: ['/debridge-supported-tokens', chainId],\n queryFn,\n enabled,\n refetchOnWindowFocus: false,\n });\n return {\n supportedTokens: data?.supportedTokens,\n supportedTokenAddresses: data?.tokenAddresses,\n refetch,\n loading: isFetching,\n };\n};const useDeBridgeBet = (props) => {\n const { fromChainId, fromTokenAddress, betAmount, slippage, deadline, referralCode, affiliate, selections, odds, totalOdds, onSuccess, onError, } = props;\n const { appChain, betToken } = useChain();\n const { prematchClient } = useApolloClients();\n const { addBet } = useBetsCache();\n const wagmiConfig = useConfig();\n const account = useExtendedAccount();\n const [isBetPending, setBetPending] = useState(false);\n const [isBetProcessing, setBetProcessing] = useState(false);\n const isLiveBet = selections.some(({ coreAddress }) => coreAddress === liveHostAddress);\n useEffect(() => {\n if (account.isAAWallet) {\n console.warn('Azuro SDK: deBridge must not be used with AA wallets.');\n }\n }, [account.isAAWallet]);\n const { supportedChainIds, loading: isDeBridgeSupportedChainsFetching, } = useDeBridgeSupportedChains({\n enabled: !isLiveBet,\n });\n const { supportedTokenAddresses, loading: isDeBridgeSupportedTokensFetching, } = useDeBridgeSupportedTokens({\n chainId: fromChainId,\n enabled: !isLiveBet && !isDeBridgeSupportedChainsFetching && (supportedChainIds || []).includes(fromChainId),\n });\n const queryFn = () => (createDeBridgeBet({\n account: account.address,\n betAmount,\n dstChainId: appChain.id,\n srcChainId: fromChainId,\n srcChainTokenIn: fromTokenAddress,\n selections,\n totalOdds,\n slippage,\n deadline,\n affiliate,\n referralCode,\n }));\n const selectionsKey = selections.map(({ conditionId }) => conditionId).join('-');\n const { isFetching: isCreateTxFetching, data } = useQuery({\n queryKey: ['/debridge-create-tx', fromChainId, fromTokenAddress, account?.address, betAmount, selectionsKey, totalOdds, slippage],\n queryFn,\n enabled: (!isLiveBet\n && !isBetPending\n && !isBetProcessing\n && Boolean(fromChainId)\n && Boolean(fromTokenAddress)\n && Boolean(account)\n && Boolean(+betAmount)\n && Boolean(selections.length)\n && Boolean(totalOdds) && totalOdds !== 1\n && !isDeBridgeSupportedChainsFetching\n && !isDeBridgeSupportedTokensFetching\n && (supportedChainIds || []).includes(appChain.id)\n && (supportedChainIds || []).includes(fromChainId)\n && (supportedTokenAddresses || []).includes(fromTokenAddress)),\n refetchOnWindowFocus: false,\n refetchInterval: 20_000,\n });\n const { orderId, estimation, tx: betTxData, fixFee } = data || {};\n const isTxReady = Boolean(betTxData);\n const isNative = estimation?.srcChainTokenIn?.address === zeroAddress;\n const allowanceTx = useReadContract({\n chainId: fromChainId,\n address: estimation?.srcChainTokenIn.address,\n abi: erc20Abi,\n functionName: 'allowance',\n args: [\n account.address,\n betTxData?.to,\n ],\n query: {\n enabled: !isNative && Boolean(account.address) && isTxReady,\n refetchOnWindowFocus: false,\n },\n });\n const isApproveRequired = Boolean(allowanceTx.data !== undefined\n && allowanceTx.data < (BigInt(estimation?.srcChainTokenIn?.amount || 0) * 4n / 3n));\n const approveTx = useWriteContract();\n const betTx = useSendTransaction();\n const approveReceipt = useWaitForTransactionReceipt({\n hash: approveTx.data,\n query: {\n enabled: Boolean(approveTx.data),\n },\n });\n const approve = async () => {\n try {\n const hash = await approveTx.writeContractAsync({\n address: estimation?.srcChainTokenIn.address,\n abi: erc20Abi,\n chainId: fromChainId,\n functionName: 'approve',\n args: [\n betTxData?.to,\n maxUint256,\n ],\n });\n await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: appChain.id,\n });\n allowanceTx.refetch();\n }\n catch (err) {\n onError?.(err);\n }\n };\n const placeBet = async () => {\n try {\n setBetPending(true);\n await betTx.sendTransactionAsync(betTxData);\n setBetPending(false);\n setBetProcessing(true);\n const txHash = await new Promise((res, rej) => {\n const interval = setInterval(async () => {\n try {\n const order = await getDeBridgeOrder(orderId);\n const { state: orderStatus, externalCallState: betPlacingStatus, fulfilledDstEventMetadata, } = order;\n const isBetPlaced = betPlacingStatus === DeBridgeExternalCallStatus.Completed;\n const isOrderFulfilled = isBetPlaced || orderStatus === DeBridgeOrderStatus.Fulfilled || orderStatus === DeBridgeOrderStatus.ClaimedUnlock;\n if (isOrderFulfilled) {\n clearInterval(interval);\n res(fulfilledDstEventMetadata?.transactionHash?.stringValue);\n }\n let error = '';\n if (betPlacingStatus === DeBridgeExternalCallStatus.Cancelled) {\n error = DeBridgeExternalCallStatus.Cancelled;\n }\n if (betPlacingStatus === DeBridgeExternalCallStatus.Failed) {\n error = DeBridgeExternalCallStatus.Failed;\n }\n if (orderStatus === DeBridgeOrderStatus.SentOrderCancel) {\n error = DeBridgeOrderStatus.SentOrderCancel;\n }\n if (orderStatus === DeBridgeOrderStatus.OrderCancelled) {\n error = DeBridgeOrderStatus.OrderCancelled;\n }\n if (error) {\n clearInterval(interval);\n rej(error);\n }\n }\n catch { }\n }, 5000);\n });\n let receipt;\n if (txHash) {\n receipt = await getTransactionReceipt(wagmiConfig, {\n hash: txHash,\n chainId: appChain.id,\n });\n if (receipt?.status === 'reverted') {\n betTx.reset();\n throw new Error(`transaction ${receipt.transactionHash} was reverted`);\n }\n if (receipt) {\n const fixedAmount = parseFloat(betAmount).toFixed(betToken.decimals);\n const rawAmount = parseUnits(fixedAmount, betToken.decimals);\n addBet({\n receipt,\n affiliate,\n odds,\n bet: {\n rawAmount,\n selections,\n },\n });\n }\n }\n else {\n prematchClient.refetchQueries({\n include: ['Bets'],\n });\n }\n setBetProcessing(false);\n onSuccess?.(receipt);\n }\n catch (err) {\n setBetPending(false);\n setBetProcessing(false);\n onError?.(err);\n }\n };\n const submit = () => {\n if (account.isAAWallet) {\n console.error('Azuro SDK: deBridge must not be used with AA wallets.');\n return;\n }\n if (isApproveRequired) {\n return approve();\n }\n return placeBet();\n };\n return {\n orderId,\n submit,\n estimation,\n fixFee,\n supportedChainIds,\n approveTx: {\n isPending: approveTx.isPending,\n isProcessing: approveReceipt.isLoading,\n },\n betTx: {\n isPending: isBetPending,\n isProcessing: isBetProcessing,\n },\n isAllowanceLoading: allowanceTx.isLoading,\n isApproveRequired,\n isTxReady,\n loading: isCreateTxFetching || isDeBridgeSupportedChainsFetching,\n };\n};export{ApolloProvider,AzuroSDKProvider,BaseBetslipContext,BetType,BetslipDisableReason,BetslipProvider,ChainProvider,DetailedBetslipContext,LIVE_STATISTICS_SUPPORTED_PROVIDERS,LIVE_STATISTICS_SUPPORTED_SPORTS,LiveContext,LiveProvider,LiveStatisticsSocketProvider,OddsSocketProvider,SportHub,WRAP_CHAINS,Watchers,cookieKeys,getApolloClients,localStorageKeys,useActiveConditions,useActiveMarket,useActiveMarkets,useApolloClients,useBaseBetslip,useBetTokenBalance,useBetsSummary,useBetsSummaryBySelection,useCashout,useChain,useConditions,useDeBridgeBet,useDeBridgeSupportedChains,useDeBridgeSupportedTokens,useDetailedBetslip,useFreeBets,useGame,useGameStatus,useGames,useLive,useLiveBetFee,useLiveBets,useLiveStatistics,useNativeBalance,useNavigation,useOdds,usePrecalculatedCashouts,usePrematchBets,usePrepareBet,useRedeemBet,useResolvedMarkets,useSelection,useSports,useSportsNavigation,useStatuses,useWatchers,useWaveActivation,useWaveLeaderBoard,useWaveLevels,useWavePeriods,useWaveStats,useWrapTokens};"],"names":["SportHub","BetType","SocketCloseReason","Status","BetslipDisableReason","SocketCloseReason$1","DumbContext","react__WEBPACK_IMPORTED_MODULE_2__","createContext","undefined","ready","listeners","readyStore","setReady","value","emitChange","subscribe","listener","filter","l","getSnapshot","useAccountWithAA","useContext","_useAAWalletClient","useExtendedAccount","account","wagmi__WEBPACK_IMPORTED_MODULE_5__","m","useSyncExternalStore","accountWithAA","isAAWallet","useAAWalletClient","pkg","Promise","all","__webpack_require__","e","then","bind","useAccount","ChainContext","useChain","ChainProvider","children","initialChainId","props","appChainId","setAppChainId","useState","chain","walletChain","aaWalletClient","isRightNetwork","walletChainId","id","contracts","betToken","graphql","socket","api","environment","_azuro_org_toolkit__WEBPACK_IMPORTED_MODULE_3__","Hp","useEffect","switchChain","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__","jsx","Provider","appChain","document","cookie","_config_js__WEBPACK_IMPORTED_MODULE_0__","c","chainId","getPrematchLink","_apollo_client__WEBPACK_IMPORTED_MODULE_6__","u","uri","operationName","prematch","getLiveLink","live","typePolicies","Query","fields","bets","merge","existing","incoming","args","skip","length","liveBets","getPrematchApolloClient","link","_apollo_client__WEBPACK_IMPORTED_MODULE_7__","f","ssrMode","window","cache","_apollo_client__WEBPACK_IMPORTED_MODULE_8__","h","connectToDevTools","assumeImmutableResults","getLiveApolloClient","apolloClients","prematchClient","liveClient","getApolloClients","Context","useApolloClients","ApolloProvider","prevAppChainIdRef","useRef","apolloClientsRef","useMemo","current","prematchLink","setLink","resetStore","liveLink","debounce","func","wait","withMaxRequests","timeout","requests","context","apply","clearTimeout","setTimeout","createQueueAction","unsubscribe","actions","request","subscribeQueue","unsubscribeQueue","weights","forEach","subscribeWeights","unsubscribeWeights","Object","keys","reduce","acc","action","values","push","ref","lastUpdateTime","getGameStartsAtValue","startsAt","dateNow","Math","floor","Date","now","a","gamesCacheTime","getEventArgsFromTxReceipt","receipt","eventName","abi","params","result","logs","index","log","viem__WEBPACK_IMPORTED_MODULE_9__","F","topics","data","toLowerCase","every","paramKey","argsParam","paramsParam","formatToFixed","digitsCount","String","test","int","digits","split","substring","createBatch","fn","isSet","idsWaitList","Set","resolversWaitList","rest","ids","resolvers","clear","resolve","err","add","createWatcher","timers","Map","subscribers","trigger","key","handlers","get","cb","set","newHandlers","handler","delete","dispatch","timer","conditionStatusWatcher","oddsWatcher","OddsSocketContext","useOddsSocket","OddsSocketProvider","isSocketReady","setSocketReady","prevChainId","useCallback","readyState","conditionId","send","JSON","stringify","conditionIds","unsubscribeCall","newUnsubscribers","runAction","subscribeToUpdates","unsubscribeToUpdates","connect","WebSocket","onopen","onclose","event","code","ChainChanged","onmessage","parse","message","toString","reinforcement","margin","winningOutcomesCount","outcomes","eventData","odds","clearOdds","maxStake","maxBet","state","onerror","close","liveStatisticWatcher","LiveStatisticsSocketContext","useLiveStatisticsSocket","LiveStatisticsSocketProvider","gameId","gameIds","fixture","statsData","status","scoreBoard","stats","useIsMounted","isMountedRef","useOdds","selections","betAmount","batchBetAmounts","config","wagmi__WEBPACK_IMPORTED_MODULE_10__","Z","isMounted","liveItems","prematchItems","item","coreAddress","toLocaleLowerCase","i1","selectionsKey","map","join","liveKey","prematchKey","setOdds","totalOdds","setTotalOdds","isPrematchOddsFetching","setPrematchOddsFetching","Boolean","oddsDataRef","betAmountRef","batchBetAmountsRef","prevSelectionsKeyRef","prevPrematchKeyRef","isLiveOddsFetching","outcomeId","fetchPrematchOdds","prematchOdds","TH","newOdds","newTotalOdds","fetchLiveOdds","items","newOddsData","liveOdds","oddsData","ks","selection","fetchOdds","unsubscribeList","find","loading","batchFetchOutcomes","conditionEntityIds","client","query","d_","variables","conditionFilter","id_in","fetchPolicy","conditions","useStatuses","statuses","setStatuses","isPrematchStatusesFetching","setPrematchStatusesFetching","prevPrematchKey","isLiveStatusesFetching","newStatus","prematchStatuses","useFreeBets","affiliate","enabled","queryFn","freebets","mB","freebet","contractAddress","contract","freebetContractAddress","signature","expiresAt","amount","viem__WEBPACK_IMPORTED_MODULE_11__","b","BigInt","decimals","rawAmount","minOdds","jk","rawMinOdds","campaign","_tanstack_react_query__WEBPACK_IMPORTED_MODULE_12__","queryKey","refetchOnWindowFocus","useForceUpdate","increment","setState","forceUpdate","v","BaseBetslipContext","DetailedBetslipContext","useBaseBetslip","useDetailedBetslip","BetslipProvider","isBatchBetWithSameGameEnabled","setItems","selectedFreeBet","setFreeBet","setBetAmount","setBatchBetAmounts","isBatch","setBatch","freeBets","isFetching","isFreeBetsFetching","address","isOddsFetching","isStatusesFetching","isCombo","checkDifferentGames","game","size","createInitialBatchAmounts","batchAmounts","newBatchAmounts","totalBetAmount","isLiveBet","some","isConditionsInCreatedStatus","M4","Created","isComboWithDifferentGames","isBatchAllowed","isFreeBetAllowed","parseFloat","isComboAllowed","isExpressForbidden","isPrematchBetAllowed","minBet","testnet","u5","isAmountLowerThanMaxBet","isAmountBiggerThanMinBet","isBetAllowed","disableReason","ConditionStatus","FreeBetWithLive","FreeBetWithCombo","FreeBetWithBatch","FreeBetExpired","FreeBetMinOdds","BetAmountLowerThanMinBet","BetAmountGreaterThanMaxBet","BatchWithLive","PrematchConditionInStartedGame","ComboWithLive","ComboWithForbiddenItem","ComboWithSameGame","changeBatch","changeBetAmount","viem_chains__WEBPACK_IMPORTED_MODULE_13__","viem_chains__WEBPACK_IMPORTED_MODULE_14__","L","includes","changeBatchBetAmount","amounts","addItem","gameEntityId","lpAddress","itemProps","readFragment","identify","__typename","fragment","qR","fragmentName","marketName","_azuro_org_dictionaries__WEBPACK_IMPORTED_MODULE_4__","lA","selectionName","Lb","withPoint","conditionEntityId","condition","Tm","title","outcome","participants","_startsAt","sport","sportId","_sportId","slug","sportSlug","name","sportName","league","leagueName","leagueSlug","country","countryName","countrySlug","newItems","replaceIndex","findIndex","localStorage","setItem","betslipItems","removeItem","lastItem","storedItems","getItem","Array","isArray","baseValue","detailedValue","selectFreeBet","useWatchers","wagmi__WEBPACK_IMPORTED_MODULE_15__","G","prematchCore","onLogs","prematchComboCore","subBets","bet","isStopped","flag","Paused","Watchers","AzuroSDKProvider","jsxs","LiveContext","useLive","LiveProvider","initialLiveState","chains","wagmi__WEBPACK_IMPORTED_MODULE_16__","C","isLiveExist","liveCore","isLive","setLive","changeLive","chainWithLive","usePrematchBets","orderBy","_L","CreatedBlockTimestamp","orderDir","N9","Asc","options","first","limit","offset","orderDirection","where","actor","bettor","type","Unredeemed","isRedeemable","Accepted","a$","isCashedOut","Settled","status_in","Resolved","Canceled","CashedOut","ssr","notifyOnNetworkStatusChange","error","_apollo_client__WEBPACK_IMPORTED_MODULE_17__","aM","o4","tokenId","settledOdds","createdAt","core","liquidityPool","cashout","_cashout","payout","_payout","isRedeemed","_isRedeemed","txHash","rawBet","isWin","fD","Won","isLose","Lost","isCanceled","freebetId","customSelectionName","conditionStatus","customMarketName","KF","ym","sort","possibleWin","isFreebet","useLiveBets","setBets","isGamesFetching","setGamesFetching","isBetsFetching","Xv","formattedBets","games","needToGetGames","_games","WW","gameId_in","fetchedGames","betsWithGames","defaultQueryProps","pollInterval","useConditions","prematchQuery","liveQuery","game_","prematchData","isPrematchLoading","prematchError","tX","liveData","isLiveLoading","liveError","MY","prematchConditions","liveConditions","useActiveConditions","livePollInterval","_filter","status_not","outcomeIds","outcomesIds_contains","maxMargin","margin_lte","viem__WEBPACK_IMPORTED_MODULE_18__","Fq","useGame","rF","prematchGame","isPrematchGameStarted","liveGame","isGameInLive","useActiveMarkets","gameStatus","XI","Live","markets","R_","useResolvedMarkets","prematchConditionIds","liveConditionIds","prematchMarkets","liveMarkets","groupedMarkets","market","marketKey","useGames","zu","Desc","hasActiveConditions","conditions_","sport_","league_","startsAt_lt","startsAt_gt","sportHub","sporthub","slug_starts_with_nocase","sportIds","sportId_in","slug_in","conditionsStatus","useSports","gameOrderBy","StartsAt","sportFilter","countryFilter","leagueFilter","gameFilter","gameOrderDirection","games_","lp","Ly","sports","filteredSports","countries","filteredCountries","leagues","Turnover","sportsWithTurnover","turnover","sortedCountries","useNavigation","withGameCount","nf","navigation","useLiveBetFee","gasAmount","relayerFeeAmount","beautyRelayerFeeAmount","MZ","formattedRelayerFeeAmount","refetch","refetchInterval","useBetsSummary","affiliates","affiliate_in","Uz","bettors","toPayout","inBets","totalPayout","totalProfit","betsCount","wonBetsCount","lostBetsCount","rawToPayout","rawInBets","rawTotalPayout","rawTotalProfit","useBetsSummaryBySelection","keyStruct","oo","prematchBets","betsSummary","rawOne","rawSummary","_rawAmount","rawPotentialPayout","_rawPotentialPayout","isExpress","rawPayout","rawOddsSummary","rawOdds","_gameId","_rawOdds","rawSubBetAmount","DIVIDER","useBetsCache","updateBetCache","betEntityId","updateFragment","hO","modify","storeFieldName","toReference","pq","bettorEntity","Dm","newRawToPayout","addBet","selectionFragments","_conditionId","dR","_condition","Jf","selectionFragment","uI","receiptArgs","kB","betId","eventParams","potentialPayout","finalOdds","actorArg","affiliateArg","transactionHash","writeFragment","useRedeemBet","wagmiConfig","redeemTx","wagmi__WEBPACK_IMPORTED_MODULE_19__","p","aaClient","aaTxState","setAaTxState","isPending","wagmi__WEBPACK_IMPORTED_MODULE_20__","A","hash","submit","to","reset","betsData","isNative","proxyFront","viem__WEBPACK_IMPORTED_MODULE_21__","R","functionName","PF","sendTransaction","sendTransactionAsync","wagmi_actions__WEBPACK_IMPORTED_MODULE_22__","isProcessing","isLoading","useBetTokenBalance","formatBalance","rawBalance","balance","wagmi__WEBPACK_IMPORTED_MODULE_23__","viem__WEBPACK_IMPORTED_MODULE_24__","Wo","select","useNativeBalance","wagmi__WEBPACK_IMPORTED_MODULE_25__","K","simpleObjReducer$1","newState","usePrepareBet","_betAmount","slippage","deadline","freeBet","betGas","liveEIP712Attention","onSuccess","onError","isFreeBet","queryClient","_tanstack_react_query__WEBPACK_IMPORTED_MODULE_26__","NL","walletClient","wagmi__WEBPACK_IMPORTED_MODULE_27__","rawRelayerFeeAmount","isRelayerFeeFetching","refetchBetTokenBalance","refetchNativeBalance","liveOrAABetTx","updateLiveOrAABetTx","useReducer","approveAddress","liveRelayer","allowanceTx","approveTx","wagmi__WEBPACK_IMPORTED_MODULE_28__","S","approveReceipt","isApproveRequired","approveAmount","approve","writeContractAsync","viem__WEBPACK_IMPORTED_MODULE_29__","zL","betTx","betReceipt","placeBet","fixedAmount","rawDeadline","D","fixedMinOdds","rn","confirmations","liveBet","attention","nonce","typedData","jV","signTypedData","orderId","newOrderState","errorMessage","nG","kK","res","rej","interval","setInterval","HX","Rejected","clearInterval","Error","fixedSelectionMinOdds","rawSelectionMinOdds","rawFreeBetMinOdds","freeBetId","owner","betData","toFixed","Ls","extraData","betTxDTO","calls","cancelQueries","setQueryData","oldFreeBets","isAllowanceLoading","isRelayerFeeLoading","useSelection","initialOdds","initialStatus","setOddsFetching","setStatus","isStatusFetching","setStatusFetching","isLocked","_wagmi_core__WEBPACK_IMPORTED_MODULE_30__","useLiveStatistics","statistics","setStatistics","providerId","Fj","isSportAllowed","isProviderAllowed","prevGameIdRef","isAvailable","useGameStatus","graphStatus","isGameExistInLive","startDate","isGameStarted","setGameStarted","VS","findActiveCondition","marketsByKey","sortedMarketKeys","activeMarketKey","nextConditionIndex","outcomeRows","nextMarketKey","isMatch","batchFetchLiveConditions","response","fetch","method","headers","body","json","ok","useActiveMarket","defaultValue","setActiveMarketKey","activeConditionIndex","setActiveConditionIndex","otherMarkets","activeStatus","liveConditionStatus","setLiveConditionStatus","activeConditionId","getNextMarket","statusByConditionId","viem_chains__WEBPACK_IMPORTED_MODULE_31__","batchFetchCashouts","ME","available","multiplier","usePrecalculatedCashouts","graphBetStatus","conditionsKey","isConditionsFromDifferentProviders","providerIds","cashouts","gcTime","isCashoutAvailable","totalMultiplier","simpleObjReducer","useCashout","EIP712Attention","refetchBalance","token","cashoutTx","updateCashoutTx","updatePrecalculatedCache","oldPrecalcCashouts","newPrecalcCashouts","betCoreAddress","betNftContractAddress","azuroBet","calculationQuery","Fz","graphBetId","retry","calculation","calculationId","expiredAt","approveExpiredAt","cashoutReceipt","$c","Er","LQ","Uw","isAllowanceFetching","useWaveStats","waveId","$d","levelActivated","isActivated"],"sourceRoot":""}