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AA,EAAAA,EAAAA,EAAAA,EAAU,YAAa,UAErB9F,GACF+F,CAAAA,EAAAA,EAAAA,CAAAA,EAAgB/F,EAAY5B,EAEhC,CACF,mICxNO,SAASqH,sBAAsBnF,CAAuB,QAC3D,EAAIA,IACFR,EAAAA,CAAcA,CAACkG,OAAO,CAAC,iBAAkB1F,GAClC,GAGX,CAKO,SAAS2F,oBACd,OAAOnG,EAAAA,CAAcA,CAACC,OAAO,CAAC,iBAChC","sources":["webpack://_N_E/./src/features/rewards/api/getRewardDetails.ts","webpack://_N_E/./src/utils/analytics/usePageViewCall.tsx","webpack://_N_E/./src/utils/xFusionQueryIdHelpers.ts","webpack://_N_E/"],"sourcesContent":["/**\n * Copyright 2022 AutoZone, Inc.\n * Content is confidential to and proprietary information of AutoZone, Inc., its\n * subsidiaries and affiliates.\n */\nimport { getAxios } from '@/lib/axios';\nimport { type QueryClient, useQuery } from '@tanstack/react-query';\nimport { type RewardsDetailsData, type RewardsDetailsResponse } from '../interface';\nimport { requestBaseURL } from '@/config/serviceAPI';\nimport { countryCodes } from '@/constants/locale';\nimport { useLocale } from '@/hooks/useLocale';\nimport { useSelector } from 'react-redux';\nimport { type ReduxState } from '@/types';\nimport type { AxiosInstance } from 'axios';\nimport { useHeaderData } from '@/features/header/api/getHeader';\n\nconst URL = `${requestBaseURL}/ecomm/b2c/v1/currentUser/rewards`;\n\nconst getRewardDetails = async (axiosInstance?: AxiosInstance) => {\n const response = await getAxios(axiosInstance).get(URL);\n return selector(response.data);\n};\n\nconst selector = (data: RewardsDetailsResponse): RewardsDetailsData => data;\n\nconst getRewardDetailsKey = (userAuthenticated: boolean) =>\n ['user', 'rewardDetails', { userAuthenticated }] as const;\n\nexport const useRewardDetails = () => {\n const { isFetching: isFetchingHeader } = useHeaderData();\n\n const userAuthenticated = useSelector((state: ReduxState) => state.appData.userAuthenticated);\n\n const locale = useLocale();\n\n return useQuery({\n queryKey: getRewardDetailsKey(userAuthenticated),\n queryFn: () => getRewardDetails(),\n // The query will not execute until the headerData exists\n enabled: !isFetchingHeader && userAuthenticated && locale !== countryCodes.mx,\n });\n};\n\nexport const prefetchRewardDetails = async (\n axiosInstance: AxiosInstance,\n queryClient: QueryClient,\n userAuthenticated: boolean\n) => {\n return queryClient.prefetchQuery({\n queryKey: getRewardDetailsKey(userAuthenticated),\n queryFn: () => getRewardDetails(axiosInstance),\n });\n};\n\nexport const getRewardDetailsFromCache = (queryClient: QueryClient, userAuthenticated: boolean) => {\n return queryClient.getQueryData(getRewardDetailsKey(userAuthenticated));\n};\n","/**\n * Copyright 2020 AutoZone, Inc.\n * Content is confidential to and proprietary information of AutoZone, Inc., its\n * subsidiaries and affiliates.\n */\nimport { getRewardsBalance } from '@/utils/getRewardsBalance';\nimport { useSelector } from 'react-redux';\nimport { type ReduxState } from '@/types';\nimport { useHeaderData } from '@/features/header/api/getHeader';\nimport { useStoreDetailsData } from '@/features/header/api/getStoreDetails';\nimport type { PageViewCall, PageSpecificAnalyticsDataType } from '@/types/analytics';\nimport { useRouter } from 'next/router';\nimport { useRewardDetails } from '@/features/rewards/api/getRewardDetails';\nimport { getKiboDecisionFromCache } from '@/features/kibo/api/getKiboDecision';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { sessionStorage } from '@/utils/sessionStorage';\nimport { persistXFusionQueryId } from '@/utils/xFusionQueryIdHelpers';\nimport { getDecodedCookies, setCookie } from '../cookie';\nimport { trackAddVehicle } from '../trackAddVehicle';\nimport { LinkRewardsContext } from '@/components/LinkRewardsContext';\nimport { useContext } from 'react';\nimport { STAND_ALONE_USER_TYPE } from '@/features/header';\nimport { useMyProfile } from '@/features/myProfile/api/getMyProfile';\nimport { useLocale } from '@/hooks/useLocale';\nimport { countryCodes } from '@/constants/locale';\n\nexport const usePageViewCall = (): PageViewCall => {\n const { showRewardSigninView } = useContext(LinkRewardsContext);\n const locale = useLocale();\n const isUS = locale === countryCodes.us;\n const { data: headerData } = useHeaderData();\n const { data: storeDetails } = useStoreDetailsData();\n const { data: userData } = useMyProfile();\n const userType = userData?.userType;\n const isStandAloneUser = userType === Number(STAND_ALONE_USER_TYPE);\n const appData = useSelector(({ appData }: ReduxState) => appData);\n const userAuthenticated = useSelector(({ appData }: ReduxState) => appData.userAuthenticated);\n const { data: rewardCardNumber } = useRewardDetails();\n const isClient = typeof document !== 'undefined';\n const router = useRouter();\n const searchRedirectText =\n typeof router.query.searchText === 'string' ? router.query.searchText : '';\n const queryClient = useQueryClient();\n const cookies = isClient ? getDecodedCookies(['autoLogin']) : null;\n const isPersistentLogin = cookies?.get('autoLogin') ?? (userAuthenticated ? 'false' : '');\n const vehiclesInfo = headerData?.vehicleMap;\n const vehicleId = vehiclesInfo?.catalogVehicleId;\n const prevSessionVehicleId = sessionStorage.getItem('previousPreferredVehicleId');\n const isAddByURL = router.query.vehicleId === vehicleId && vehicleId !== prevSessionVehicleId;\n\n return (\n pageSpecificAnalyticsData: PageSpecificAnalyticsDataType,\n pageSpecificRemoveAnalyticsData?: string[] | null\n ) => {\n const lwTestExperience = pageSpecificAnalyticsData?.lwTestExperience;\n const productRank = pageSpecificAnalyticsData?.productRank;\n const xFusionQueryId = pageSpecificAnalyticsData?.xFusionQueryId;\n const allSearchTerms = window.utag_data?.allSearchTerms;\n const loginFlow = window.utag_data?.loginFlow;\n const loginInteractionMethod = window.utag_data?.loginInteractionMethod;\n const loginMethod = window.utag_data?.loginMethod;\n const authenticationStatus = appData.userAuthenticated;\n const rewardsCustomerStatus = headerData?.myAccountMap?.rewardsId?.length ? true : false;\n const profileId = headerData?.myAccountMap?.profileId ?? '';\n const rewardsId = headerData?.myAccountMap?.rewardsId ?? '';\n const jSessionId = window.utag_data?.jSessionId;\n const eCookieId = window.utag_data?.eCookieId;\n const preferredZipCode = storeDetails?.zip ?? '';\n const preferredStoreId = storeDetails?.storeNumber ?? '';\n const persistentLogin = isPersistentLogin;\n const { vehicleMap } = headerData ?? {};\n const preferredVehicleYear = vehicleMap?.year ?? '';\n const preferredVehicleMake = vehicleMap?.make ?? '';\n const preferredVehicleModel = vehicleMap?.model ?? '';\n const preferredVehicleEngine =\n vehicleMap?.vehicleName\n .replace(`${preferredVehicleYear} ${preferredVehicleMake} ${preferredVehicleModel}`, '')\n ?.trim() ?? '';\n const preferredVehicleId = vehicleMap?.catalogVehicleId ?? '';\n const userVehicleCount = window.utag_data?.userVehicleCount ?? '0';\n const serverInfo = window.utag_data?.serverInfo;\n const device = appData.deviceType;\n const userType = headerData?.myAccountMap?.userType ?? ''; // we can get some of the \"previous\" information from the utag data\n const previousPageName = window.utag_data?.pageName ?? '';\n const previousPageType = window.utag_data?.pageType ?? '';\n //To determine whether the certona script call loaded correctly or not.\n const certonaCalled = !window?.certonaNotCalled;\n const previousPageSiteSection = window.utag_data?.siteSection ?? '';\n const pageURL = window.utag_data?.pageURL ?? '';\n const previousPageURL = window.utag_data?.previousPageURL ?? '';\n const referrer = window.utag_data?.referrer ?? '';\n const nddMarket = headerData?.analyticsData?.nddMarket ?? '';\n const pageLazyLoad = pageSpecificAnalyticsData.pageLazyLoad ?? false;\n const searchMethod = pageSpecificAnalyticsData.searchMethod ?? '';\n const nddHub = headerData?.analyticsData?.nddHubStore ?? '';\n const nddStore = headerData?.analyticsData?.nddStore ?? '';\n const currentNumberOfCredits = rewardCardNumber?.currentNumberOfCredits ?? '';\n const rewardsBalance = rewardCardNumber?.rewardBalance ?? '';\n const availableRewardBalance = rewardsBalance ? getRewardsBalance(rewardsBalance) : '';\n const hashedEId = window.utag_data?.hashedEId ?? '';\n const revenueBucket = window.utag_data?.revenueBucket ?? '';\n const typeaheadValue = sessionStorage.getItem('typeAheadValue');\n const visualPartTypeDisplayed = pageSpecificAnalyticsData?.visualPartTypeDisplayed;\n const partTypeFiltersAvailable = pageSpecificAnalyticsData?.partTypeFiltersAvailable;\n\n const kiboData = getKiboDecisionFromCache(queryClient);\n const experienceNames = kiboData?.actions\n ? Object.values(kiboData.actions).map(\n (action) =>\n `${action.impressionReporting[0].experience_label} | ${action.impressionReporting[0].variant_label}`\n )\n : undefined;\n\n const data = {\n allSearchTerms,\n authenticationStatus,\n availableRewardBalance,\n currentNumberOfCredits,\n eCookieId,\n rewardsCustomerStatus,\n profileId,\n rewardsId,\n jSessionId,\n preferredZipCode,\n preferredStoreId,\n preferredVehicleYear,\n preferredVehicleMake,\n preferredVehicleModel,\n preferredVehicleEngine,\n preferredVehicleId,\n userVehicleCount,\n serverInfo,\n device,\n userType,\n previousPageName,\n previousPageType,\n previousPageSiteSection,\n pageURL,\n previousPageURL,\n referrer,\n nddMarket,\n nddHub,\n nddStore,\n hashedEId,\n revenueBucket,\n pageLazyLoad,\n loginFlow,\n loginInteractionMethod,\n loginMethod,\n searchMethod,\n experienceNames,\n lwTestExperience,\n certonaCalled,\n visualPartTypeDisplayed,\n persistentLogin,\n partTypeFiltersAvailable,\n ...(!!productRank && {\n productRank,\n }),\n ...(!!xFusionQueryId && {\n xFusionQueryId,\n }),\n ...(!!searchRedirectText && {\n searchKeyword: searchRedirectText,\n eventType: 'successfulSearch',\n }),\n ...(!!typeaheadValue && {\n searchKeyword: typeaheadValue,\n eventType: 'successfulSearch',\n }),\n ...pageSpecificAnalyticsData,\n productFindingMethod: pageSpecificAnalyticsData.productFindingMethod ?? '',\n };\n if (\n !data.lwTestExperience ||\n (data.pageType.includes('shelf') && !router.asPath.includes('search'))\n ) {\n delete data.lwTestExperience;\n }\n\n if (\n !data.eventType ||\n (!router.asPath.includes('searchresult') &&\n !router.asPath.includes('redirect') &&\n data.eventType !== 'loadMore' &&\n !data.selectedFilterValue)\n ) {\n delete data.eventType;\n delete window.utag_data?.['eventType'];\n }\n\n if (!data.visualPartTypeDisplayed || !router.asPath.includes('searchresult')) {\n delete data.visualPartTypeDisplayed;\n }\n\n if (\n !data.partTypeFiltersAvailable ||\n (!data.pageType.includes('shelf') &&\n !data.pageType.includes('Brand Profile') &&\n !router.asPath.includes('searchresult'))\n ) {\n delete data.partTypeFiltersAvailable;\n }\n\n // persist xFusionQueryId so it can be passed via /item request\n persistXFusionQueryId(xFusionQueryId);\n\n pageSpecificRemoveAnalyticsData?.length &&\n pageSpecificRemoveAnalyticsData.forEach((removeItem) => {\n // @ts-expect-error refine type\n delete data[removeItem];\n // @ts-expect-error refine type\n delete window.utag_data[removeItem];\n });\n\n window.utag_data = data;\n window.utag?.view(data);\n sessionStorage.removeItem('typeAheadValue');\n if (isPersistentLogin == 'true') {\n if (isUS && isStandAloneUser) {\n showRewardSigninView(true);\n }\n setCookie('autoLogin', 'false');\n }\n if (isAddByURL) {\n trackAddVehicle(isAddByURL, headerData);\n }\n };\n};\n","/**\n * Copyright 2024 AutoZone, Inc.\n * Content is confidential to and proprietary information of AutoZone, Inc., its\n * subsidiaries and affiliates.\n */\nimport { sessionStorage } from './sessionStorage';\n\n/** This wrapper for sessionStorage.setItem() should only be called on shelf pages (brand or product) or search.\n *\n * @param xFusionQueryId the current session's xFusionQueryId\n * @returns true if xFusionQueryId was stored, it should never return false\n */\nexport function persistXFusionQueryId(xFusionQueryId?: string) {\n if (xFusionQueryId) {\n sessionStorage.setItem('xFusionQueryId', xFusionQueryId);\n return true;\n }\n return false;\n}\n\n/**\n * @returns sessionStorage.getItem('xFusionQueryId')\n */\nexport function getXFusionQueryId() {\n return sessionStorage.getItem('xFusionQueryId');\n}\n"],"names":["URL","concat","requestBaseURL","getRewardDetails","axiosInstance","response","getAxios","get","selector","data","getRewardDetailsKey","userAuthenticated","useRewardDetails","isFetching","isFetchingHeader","useHeaderData","useSelector","state","appData","locale","useLocale","useQuery","queryKey","queryFn","enabled","countryCodes","mx","getRewardDetailsFromCache","queryClient","getQueryData","usePageViewCall","cookies","showRewardSigninView","useContext","LinkRewardsContext","isUS","us","headerData","storeDetails","useStoreDetailsData","userData","useMyProfile","userType","isStandAloneUser","Number","STAND_ALONE_USER_TYPE","param","rewardCardNumber","router","useRouter","searchRedirectText","query","searchText","useQueryClient","isClient","document","getDecodedCookies","isPersistentLogin","vehiclesInfo","vehicleMap","vehicleId","catalogVehicleId","prevSessionVehicleId","sessionStorage","getItem","isAddByURL","pageSpecificAnalyticsData","pageSpecificRemoveAnalyticsData","window","lwTestExperience","productRank","xFusionQueryId","allSearchTerms","utag_data","loginFlow","loginInteractionMethod","loginMethod","authenticationStatus","rewardsCustomerStatus","myAccountMap","rewardsId","length","profileId","jSessionId","eCookieId","preferredZipCode","zip","preferredStoreId","storeNumber","preferredVehicleYear","year","preferredVehicleMake","make","preferredVehicleModel","model","preferredVehicleEngine","vehicleName","replace","trim","preferredVehicleId","userVehicleCount","serverInfo","device","deviceType","previousPageName","pageName","previousPageType","pageType","certonaCalled","certonaNotCalled","previousPageSiteSection","siteSection","pageURL","previousPageURL","referrer","nddMarket","analyticsData","pageLazyLoad","searchMethod","nddHub","nddHubStore","nddStore","currentNumberOfCredits","rewardsBalance","rewardBalance","availableRewardBalance","getRewardsBalance","hashedEId","revenueBucket","typeaheadValue","visualPartTypeDisplayed","partTypeFiltersAvailable","kiboData","getKiboDecisionFromCache","experienceNames","actions","Object","values","map","action","impressionReporting","experience_label","variant_label","undefined","_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_18__","_","_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_19__","persistentLogin","searchKeyword","eventType","productFindingMethod","includes","asPath","selectedFilterValue","persistXFusionQueryId","forEach","removeItem","utag","view","setCookie","trackAddVehicle","setItem","getXFusionQueryId"],"sourceRoot":""}