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AAbb,QAAa,IAAbA,OAAa,EAAbA,EAAeQ,eAUlB,OAPeM,EAAAA,EAAAA,UACb,MACEnH,gBAEF,CAACA,GAGU,C,6DCvDR,MAAMkD,EAAwBA,KACnC,MAAMkE,EAAgBC,EAAAA,EAAMC,WAAWC,QAAQC,cAE3CJ,IACFK,EAAAA,EAAAA,IAAcL,EAChB,C,4GCHK,MAAMM,EAAeC,IAEH,QAAjB,OAAJA,QAAI,IAAJA,OAAI,EAAJA,EAAMC,aAA2C,QAAhB,OAAJD,QAAI,IAAJA,OAAI,EAAJA,EAAME,WAC/B,GAAGF,EAAKC,cAAcD,EAAKE,YAC3BF,EAAKG,WAEI,GAGJC,EAAqBJ,GACzBD,EAAYC,GAAMK,OAAO,EAAG,GAAGC,cAG3BC,EAAmB,CAAC,UAAW,YAE/BpE,EAA+BA,IAC1C5E,EAAAA,EAAaC,SACXC,EAAAA,EAAAA,GAAe,UAAW,gCAC1B+I,OAAOC,MAAQC,Q","sources":["components/Login/hooks/useLoginCallback.ts","utils/constants/account/iframe-api-open-profile-pages.ts","components/MessageListener/index.tsx","hooks/auth/useUpdateUser.ts","utils/account/push-notifications.ts","utils/account/user-info.ts"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\nimport qs from 'qs';\nimport { checkAndStoreFcmToken } from 'utils/account/push-notifications';\nimport { setUserLoginLimitStartTimeLS } from 'utils/account/user-info';\nimport LocalStorage from 'utils/bom-dom-manipulation/local-storage';\nimport { setCookieLoginCredentials } from 'utils/bom-dom-manipulation/login-credentials';\nimport { sendPostMessage } from 'utils/bom-dom-manipulation/send-post-message-to-iframe';\nimport SessionStorage from 'utils/bom-dom-manipulation/session-storage';\nimport { VAIX_IFRAME_ID } from 'utils/constants/app/iframe-ids';\nimport { CookieExpiration } from 'utils/constants/dateInfo/dateInfo';\nimport {\n  MILLISECONDS_IN_SECOND,\n  SECONDS_PER_MINUTE\n} from 'utils/constants/dateInfo/time-numbers';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { storageKeyName } from 'utils/generic/storage-key-name';\nimport { loginState } from 'utils/sportsbook/api-post-message-sender';\nimport {\n  AuthData,\n  LoginResponse,\n  ProfileData\n} from 'interfaces/authentication';\nimport { AfterSignIn } from 'services/afterSignIn';\nimport {\n  getUser,\n  sendRestoreLoginPostMsg,\n  setTermsAndConditionVersion\n} from 'services/authentication';\nimport { getUserAllNotifications } from 'services/sportsbook/notifications';\nimport { getSavedLocation } from 'components/QueryRoute';\nimport { useUpdateUser } from 'hooks/auth/useUpdateUser';\nimport { setLoginLimit, setUserData, setUserLoggedIn } from 'store/actions';\nimport { setShowAdditionalInfo } from 'store/actions/app-data';\nimport { getRegFieldData } from 'store/selectors/app-data';\n\ntype TLoginCallbackProps = {\n  rememberMe: boolean;\n  userGroups?: string | null;\n  username: string | null;\n  password: string | null;\n  inPopup?: boolean;\n};\n\ntype ReturnType = {\n  loginCallback: (data: LoginResponse) => void;\n  updateAuthData: () => void;\n  isTwoFactorPopupVisible: boolean;\n  qrCodeOrigin?: string;\n};\n\nconst TWO_FACTOR_AUTHENTICATION_STATUS = 4;\n\nexport const useLoginCallback = ({\n  rememberMe,\n  userGroups,\n  inPopup\n}: TLoginCallbackProps): ReturnType => {\n  const authData = useRef<AuthData>();\n  const [isTwoFactorPopupVisible, setIsTwoFactorPopupVisible] = useState(false);\n  const [qrCodeOrigin, setQrCodeOrigin] = useState<string>();\n  const dispatch = useDispatch();\n  const history = useHistory();\n\n  const regFieldsData = useSelector(getRegFieldData);\n\n  const personalId = regFieldsData?.find(\n    field => field && field.formType === 'personalId'\n  );\n\n  const loginCallback = (data: LoginResponse) => {\n    const {\n      auth_token,\n      user_id,\n      qr_code_origin,\n      authentication_status,\n      jwe_token\n    } = data;\n\n    authData.current = {\n      auth_token,\n      user_id,\n      qr_code_origin,\n      jwe_token\n    };\n\n    if (authentication_status === TWO_FACTOR_AUTHENTICATION_STATUS) {\n      setIsTwoFactorPopupVisible(true);\n      setQrCodeOrigin(qr_code_origin);\n\n      return;\n    }\n\n    if (SpringConfigs.ADD_INFO_AFTER_LOGIN) {\n      dispatch(setShowAdditionalInfo(true));\n      LocalStorage.setItem(\n        storageKeyName('customPopup', 'SHOW_ADDITIONAL_INFO'),\n        'true'\n      );\n    }\n\n    checkAndStoreFcmToken();\n\n    updateAuthData();\n\n    sendPostMessage({ type: 'userId', value: data.user_id }, VAIX_IFRAME_ID);\n\n    window.popupIframe && sendRestoreLoginPostMsg(data);\n\n    if (SpringConfigs.IFRAME_SPORTSBOOK) {\n      loginState('loggedIn');\n    }\n\n    if (\n      SpringConfigs.LOGIN_LIMIT_POPUP ||\n      SpringConfigs.PLAYER_ACTIVITY_CHECK\n    ) {\n      setUserLoginLimitStartTimeLS();\n    }\n  };\n\n  const updateAuthData = () => {\n    LocalStorage.setItem(\n      storageKeyName('account', 'AUTH_DATA'),\n      JSON.stringify(authData.current)\n    );\n    getUser(\n      (data: ProfileData) => {\n        storeUser(data);\n\n        if (\n          data.terms_and_conditions_version !== 'v2' &&\n          SpringConfigs.SHOW_ADDITIONAL_CHECKBOX_FOR_LOGIN &&\n          SpringConfigs.VERIFICATION_TYPE === 0\n        ) {\n          setTermsAndConditionVersion('v2', () => {});\n        }\n      },\n      updateUser,\n      'login',\n      false,\n      !!(\n        personalId?.editForm.showOnEditProfile &&\n        personalId.editForm.personalIdType === '2' &&\n        personalId?.editForm.sendCPFAsDocNumber === '1'\n      )\n    );\n\n    if (SpringConfigs.PUSH_NOTIFICATIONS_ENABLED) {\n      getUserAllNotifications();\n    }\n  };\n\n  const { updateUser } = useUpdateUser();\n\n  const storeUser = (userData: ProfileData) => {\n    setCookieLoginCredentials('loginCredentials', {\n      rememberMe,\n      userGroups: userGroups || '',\n      jwe_token: authData?.current?.jwe_token || ''\n    });\n\n    dispatch(\n      setUserData({\n        ...userData,\n        last_login_date:\n          userData.last_login_date ||\n          Math.floor(new Date().getTime() / MILLISECONDS_IN_SECOND)\n      })\n    );\n    dispatch(\n      setLoginLimit((userData.session_duration || 0) * SECONDS_PER_MINUTE)\n    );\n\n    userData.active_time_in_casino &&\n      SessionStorage.setItem(\n        storageKeyName('account', 'ACTIVE_TIME_IN_CASINO'),\n        `${userData.active_time_in_casino}`\n      );\n\n    const afterSignIn = new AfterSignIn();\n    afterSignIn.setAfterExecutionCallback(() => {\n      if (afterSignIn.isActionsExist()) {\n        !inPopup && getSavedLocation();\n      } else {\n        const savedLocation = getSavedLocation();\n\n        const splitLocation = savedLocation.split('?');\n\n        const parsedQuery = qs.parse(splitLocation[1], {\n          ignoreQueryPrefix: true\n        }) as Record<string, string>;\n\n        if (parsedQuery['accounts'] && parsedQuery['login']) {\n          delete parsedQuery.accounts;\n          delete parsedQuery.login;\n        }\n\n        const updatedLocation = `${splitLocation[0]}?${qs.stringify(\n          parsedQuery\n        )}`;\n\n        history.push(updatedLocation);\n      }\n\n      dispatch(setUserLoggedIn(true));\n      LocalStorage.setItem(\n        storageKeyName('account', 'PARENT_ACCOUNT_CURRENCY'),\n        userData.currency\n      );\n\n      setCookieLoginCredentials(\n        'sbuser',\n        {\n          rememberMe,\n          userGroups: userGroups ? userGroups || '' : ''\n        },\n        CookieExpiration.DAYS_15\n      );\n    });\n    afterSignIn.executeActions();\n  };\n\n  return {\n    loginCallback,\n    updateAuthData,\n    isTwoFactorPopupVisible,\n    qrCodeOrigin\n  };\n};\n","export const IframeApiOpenProfilePages: Record<\n  string,\n  Record<string, string>\n> = {\n  profile: { accounts: '*', settings: '*', profile: '*' },\n  documents: { accounts: '*', settings: '*', documents: '*' },\n  selfExclusion: { accounts: '*', settings: '*', 'self-exclusion': '*' },\n  timeout: { accounts: '*', settings: '*', timeout: '*' },\n  password: { accounts: '*', settings: '*', password: '*' },\n  betHistory: { accounts: '*', 'bet-history': '*' },\n  deposit: { accounts: '*', wallet: '*', deposit: '*' },\n  balanceHistory: { accounts: '*', wallet: '*', 'balance-history': '*' },\n  bonusSportsbook: {\n    accounts: '*',\n    bonuses: '*',\n    bonus: '*',\n    bonusType: '1'\n  },\n  bonusCasino: {\n    accounts: '*',\n    bonuses: '*',\n    bonus: '*',\n    bonusType: '2'\n  }\n};\n","import { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\nimport { arrayFindBy } from 'utils/collection-manipulation/array-find-by';\nimport { IframeApiOpenProfilePages } from 'utils/constants/account/iframe-api-open-profile-pages';\nimport { ODD_FORMATS } from 'utils/constants/betslip/odd-formats';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { useAccountLogout } from 'hooks/auth/useAccountLogout';\nimport { useRestoreLogin } from 'hooks/auth/useRestoreLogin';\nimport { useChangeOddFormat } from 'hooks/betslip/useChangeOddFormat';\nimport { getIsLoggedIn } from 'store/selectors/user-data';\nimport { saveCurrentLocation, updateQuery } from '../QueryRoute';\n\nexport const MessageListener = function (): null {\n  const restoreLogin = useRestoreLogin(true);\n  const accountLogout = useAccountLogout();\n  const changeOddFormat = useChangeOddFormat();\n  const history = useHistory();\n  const isLoggedIn = useSelector(getIsLoggedIn);\n\n  const messageListener = (event: MessageEvent) => {\n    const { data } = event;\n\n    if (data?.action === 'login' && data?.credentials) {\n      restoreLogin({\n        auth_token: data.credentials.auth_token\n      });\n    }\n\n    if (SpringConfigs.IFRAME_SPORTSBOOK) {\n      if (data?.action === 'logout') {\n        accountLogout(true);\n      }\n\n      if (data?.action === 'changeOddType') {\n        const format = {\n          ...arrayFindBy(ODD_FORMATS, 'value', data.type, false)\n        };\n\n        const { id, value } = format;\n        changeOddFormat(id, value);\n      }\n\n      if (\n        data?.action === 'openProfile' &&\n        data?.page &&\n        IframeApiOpenProfilePages[data.page]\n      ) {\n        saveCurrentLocation();\n        history.push(updateQuery(IframeApiOpenProfilePages[data.page]));\n      }\n    }\n  };\n\n  useEffect(() => {\n    window.onmessage = messageListener;\n    // window.addEventListener('message', messageListener, false);\n\n    return () => {\n      window.onmessage = null;\n      //   window.removeEventListener('message', messageListener);\n    };\n  }, [isLoggedIn]);\n\n  return null;\n};\n","import { useCallback, useMemo } from 'react';\nimport { useDispatch } from 'react-redux';\nimport LocalStorage from 'utils/bom-dom-manipulation/local-storage';\nimport SpringConfigs from 'utils/constants/swarm/spring-configs';\nimport { storageKeyName } from 'utils/generic/storage-key-name';\nimport { ProfileData } from 'interfaces/authentication';\nimport { useAccountLogout } from 'hooks/auth/useAccountLogout';\nimport { useFetchAccountParams } from 'newhooks/account/useFetchAccountParams';\nimport { setPendingSuperBets, updateUserData } from 'store/actions';\nimport { updateOpenBets } from 'store/actions/betslip';\n\ntype TArgs = {\n  updateUser: (userData: ProfileData) => void;\n};\n\nexport const useUpdateUser = (): TArgs => {\n  const dispatch = useDispatch();\n  const { accountParams } = useFetchAccountParams();\n  const accountLogout = useAccountLogout();\n\n  const updateUser = useCallback(\n    (userData: ProfileData) => {\n      const switchMultiAccount = LocalStorage.getItem(\n        storageKeyName('account', 'SWITCH_MULTI_ACCOUNT')\n      );\n\n      LocalStorage.removeItem(\n        storageKeyName('account', 'SWITCH_MULTI_ACCOUNT')\n      );\n\n      if (userData) {\n        if (userData.logout && !JSON.parse(switchMultiAccount)) {\n          if (\n            +accountParams?.singleSignIn ||\n            SpringConfigs.IS_MULTI_ACCOUNT_DISABLED\n          ) {\n            accountLogout(true);\n          }\n        } else {\n          dispatch(updateUserData(userData));\n\n          if (userData.super_bet) {\n            dispatch(setPendingSuperBets(userData.super_bet));\n            dispatch(updateOpenBets());\n          }\n        }\n      }\n    },\n    [accountParams?.singleSignIn]\n  );\n\n  const result = useMemo(\n    () => ({\n      updateUser\n    }),\n    [updateUser]\n  );\n\n  return result;\n};\n","import { storeFcmToken } from 'services/authentication';\nimport store from 'store';\n\nexport const checkAndStoreFcmToken = (): void => {\n  const firebaseToken = store.getState().appData.fireBaseToken;\n\n  if (firebaseToken) {\n    storeFcmToken(firebaseToken);\n  }\n};\n","import dayjs from 'dayjs';\nimport { ProfileData } from 'interfaces/authentication';\nimport LocalStorage from '../bom-dom-manipulation/local-storage';\nimport { storageKeyName } from '../generic/storage-key-name';\n\nexport const getUserName = (user: ProfileData): string => {\n  const name =\n    user?.first_name !== null && user?.last_name !== null\n      ? `${user.first_name} ${user.last_name}`\n      : user.username;\n\n  return name || '';\n};\n\nexport const getUserAvatarName = (user: ProfileData): string => {\n  return getUserName(user).substr(0, 2).toUpperCase();\n};\n\nexport const ITEMS_WITH_BADGE = ['bonuses', 'messages'];\n\nexport const setUserLoginLimitStartTimeLS = () =>\n  LocalStorage.setItem(\n    storageKeyName('account', 'LOGIN_LIMIT_POPUP_START_TIME'),\n    String(dayjs().unix())\n  );\n"],"names":["useLoginCallback","_ref","rememberMe","userGroups","inPopup","authData","useRef","isTwoFactorPopupVisible","setIsTwoFactorPopupVisible","useState","qrCodeOrigin","setQrCodeOrigin","dispatch","useDispatch","history","useHistory","regFieldsData","useSelector","getRegFieldData","personalId","find","field","formType","updateAuthData","LocalStorage","setItem","storageKeyName","JSON","stringify","current","getUser","data","storeUser","terms_and_conditions_version","SpringConfigs","SHOW_ADDITIONAL_CHECKBOX_FOR_LOGIN","VERIFICATION_TYPE","setTermsAndConditionVersion","updateUser","editForm","showOnEditProfile","personalIdType","sendCPFAsDocNumber","PUSH_NOTIFICATIONS_ENABLED","getUserAllNotifications","useUpdateUser","userData","_authData$current","setCookieLoginCredentials","jwe_token","setUserData","last_login_date","Math","floor","Date","getTime","MILLISECONDS_IN_SECOND","setLoginLimit","session_duration","SECONDS_PER_MINUTE","active_time_in_casino","SessionStorage","afterSignIn","AfterSignIn","setAfterExecutionCallback","isActionsExist","getSavedLocation","splitLocation","split","parsedQuery","qs","ignoreQueryPrefix","accounts","login","updatedLocation","push","setUserLoggedIn","currency","CookieExpiration","DAYS_15","executeActions","loginCallback","auth_token","user_id","qr_code_origin","authentication_status","ADD_INFO_AFTER_LOGIN","setShowAdditionalInfo","checkAndStoreFcmToken","sendPostMessage","type","value","VAIX_IFRAME_ID","window","popupIframe","sendRestoreLoginPostMsg","IFRAME_SPORTSBOOK","loginState","LOGIN_LIMIT_POPUP","PLAYER_ACTIVITY_CHECK","setUserLoginLimitStartTimeLS","IframeApiOpenProfilePages","profile","settings","documents","selfExclusion","timeout","password","betHistory","deposit","wallet","balanceHistory","bonusSportsbook","bonuses","bonus","bonusType","bonusCasino","MessageListener","restoreLogin","useRestoreLogin","accountLogout","useAccountLogout","changeOddFormat","useChangeOddFormat","isLoggedIn","getIsLoggedIn","messageListener","event","action","credentials","format","arrayFindBy","ODD_FORMATS","id","page","saveCurrentLocation","updateQuery","useEffect","onmessage","accountParams","useFetchAccountParams","useCallback","switchMultiAccount","getItem","removeItem","logout","parse","singleSignIn","IS_MULTI_ACCOUNT_DISABLED","updateUserData","super_bet","setPendingSuperBets","updateOpenBets","useMemo","firebaseToken","store","getState","appData","fireBaseToken","storeFcmToken","getUserName","user","first_name","last_name","username","getUserAvatarName","substr","toUpperCase","ITEMS_WITH_BADGE","String","dayjs","unix"],"sourceRoot":""}