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AAoC9D,EAAE,4BACpD,WAAC6D,MAAAA,CAAIC,UAAU,mHACb,UAACD,MAAAA,CAAIC,UAAU,iDACb,UAACE,EAAAA,CAASA,CAAAA,CACRrE,cAAeA,EACfE,oBAAqBA,EACrBC,SAAUA,EACV2B,YAAaA,EACbwC,gBAAiB,CACfC,oBAAoB,EACpBC,eAAgB,CACdC,IAAK,GAAkBlE,MAAAA,CAAfiB,EAAAA,EAAYA,EAAY,OAATjB,EAAS,2CAClC,EACAmE,eAAgB,CACdD,IAAK,GAAkBlE,MAAAA,CAAfiB,EAAAA,EAAYA,EAAY,OAATjB,EAAS,+BAClC,CACF,MAIJ,WAAC2D,MAAAA,CAAIC,UAAU,kDACb,UAACQ,KAAAA,CACCC,WAAS,kBACTT,UAAU,2DAET9D,EAAE,6BAGL,UAAC6D,MAAAA,CAAIU,WAAS,gBAAgBT,UAAU,wCACrCZ,QAAAA,KAAAA,EAAAA,EAAgBsB,GAAG,CAAC,MAApBtB,GAAqBuB,CAAAA,EACpB,IAAMC,EAAMC,OAAOC,IAAI,CAACH,EAAK,CAAC,EAAE,CAEhC,MACE,WAACZ,MAAAA,CAAcU,WAAUG,EAAKZ,UAAU,6CACtC,UAACe,EAAAA,EAAIA,CAAAA,CAACf,UAAU,eAAegB,KAAM1B,CAAO,CAACsB,EAAI,GACjD,UAACK,KAAAA,CAAGjB,UAAU,mCAA2BW,CAAI,CAACC,EAAI,KAF1CA,EAKd,KAGF,UAACM,IAAAA,CACCC,KAAM/D,EACNqD,WAAS,UACTT,UAAU,8DAET9D,EAAE,gCAEL,UAACkF,IAAAA,CAAEX,WAAS,iBAAiBT,UAAU,wBACpC9D,EAAE,0CAKX,UAACmF,EAAAA,EAASA,CAAAA,CAACC,UAAW1E,EAAW2E,QAASzE,EAAQD,WAAYA,MAGpE","sources":["webpack://_N_E/?860f","webpack://_N_E/./pages/hilton-honors/login/index.tsx"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/hilton-honors/login\",\n function () {\n return require(\"private-next-pages/hilton-honors/login/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/hilton-honors/login\"])\n });\n }\n ","import { AKAMAI_BM_TELEMETRY_HEADER_GUEST } from '../../../utils/constants';\nimport { getDisplayRecaptcha, isFeatureEnabled } from '../../../utils/feature-toggles';\nimport { getAppId, getSourceId } from '../../../utils/guest-login';\nimport type {\n GetServerSideProps,\n GetServerSidePropsContext,\n InferGetServerSidePropsType,\n} from 'next';\nimport LoginForm from '../../../components/login-form/login-form';\nimport { useEffect } from 'react';\nimport { useTranslation } from 'next-i18next';\nimport { makeAuthClient } from '@dx-ui/framework-auth-provider';\nimport { useRouter } from 'next/router';\nimport { buildForwardUrl, isRelative, isValidForwardUri } from '../../../utils/forwardUri';\nimport {\n Speedbump,\n getSpeedBumpFeatureConfig,\n makeAnchorEventTarget,\n useSpeedbump,\n} from '@dx-ui/osc-speedbump';\nimport { OHW_BASE_URL, APP_NAME, QUERY_CLIENT_ENV_VARS } from '../../../utils/env';\nimport { useMetrics } from '../../../utils/metrics';\nimport { HonorsLayout } from '../../../components/honors-layout/honors-layout';\nimport { Icon } from '@dx-ui/osc-icon';\nimport type { GuestLoginResponse } from '../../../typings/app/guest-login';\nimport { Goals } from '../../../typings/app/goals';\nimport { sendReward } from '@dx-ui/framework-conductrics';\nimport { logError } from '@dx-ui/framework-logger';\nimport { generateError } from '@dx-ui/utilities-generate-error';\nimport { getServerSideClients, serverSideProps } from '../../../utils/serverSideProps';\n\nconst HiltonHonorsLoginPage = ({\n showRecaptcha,\n shouldSendTelemetry,\n sourceId,\n}: InferGetServerSidePropsType<typeof getServerSideProps>) => {\n const { t } = useTranslation(['login', 'error']);\n const router = useRouter();\n const language = router.locale || 'en';\n const forwardPageURI = router.query?.forwardPageURI as string;\n const metrics = useMetrics();\n const { isVisible, onContinue, onHide, onShow } = useSpeedbump(language, APP_NAME);\n\n const auth = makeAuthClient({\n ...QUERY_CLIENT_ENV_VARS,\n appName: APP_NAME,\n });\n\n const enrollmentUrl = `${OHW_BASE_URL}${language}/hilton-honors/join/?ocode=ASPEW`;\n const accountUrl = `${OHW_BASE_URL}${language}/hilton-honors/guest/my-account/`;\n\n useEffect(() => {\n if (showRecaptcha) {\n // https://github.com/dozoisch/react-google-recaptcha#global-properties-used-by-recaptcha\n window.recaptchaOptions = {\n useRecaptchaNet: true,\n };\n }\n }, [showRecaptcha]);\n\n const handleLogin = async ({ data, error }: GuestLoginResponse) => {\n if (data) {\n await auth\n .login({ data, error })\n .catch((error: Error) => logError('HONORS_LOGIN', error, 'auth client login failed'));\n sendReward(Goals.SignInSuccess);\n const isAuthenticated = Boolean(data.userInfo?.guestId);\n\n const newForwardUrl =\n forwardPageURI && isValidForwardUri(forwardPageURI) ? forwardPageURI : accountUrl;\n\n if (isAuthenticated) {\n metrics.setEventAction([{ eventAction: 'signIn' }]);\n metrics.trackEvent(['trackUserLoggedIn']);\n\n const targetUrl = !isRelative(newForwardUrl)\n ? newForwardUrl\n : buildForwardUrl(newForwardUrl);\n\n if (targetUrl) {\n const fakeEventTarget = makeAnchorEventTarget(targetUrl);\n if (!onShow(fakeEventTarget)) {\n onContinue();\n if (targetUrl) window.location.assign(targetUrl);\n }\n }\n }\n }\n };\n\n const memberBenefits = t('loginContent.memberBenefits', { returnObjects: true });\n\n const iconMap = {\n lowestPrice: 'price',\n wiFi: 'wifi',\n digitalCheckIn: 'app',\n honorsPoints: 'points',\n } as const;\n\n return (\n <HonorsLayout\n hasMinimalHeader={true}\n language={language}\n title=\"Hilton Honors Login\"\n metaDescription=\"Login to your Hilton Honors account to book rooms, manage reservations, and earn and spend points. You can also reset your sign in information here.\"\n >\n <div className=\"container pb-8\">\n <h1 className=\"font-headline mb-5 mt-7 text-3xl\">{t('loginContent.pageTitle')}</h1>\n <div className=\"md:divide-border flex flex-col space-y-12 md:flex-row md:space-y-0 md:divide-x rtl:md:divide-x-reverse\">\n <div className=\"w-full md:w-1/2 md:pr-16 rtl:md:pl-16\">\n <LoginForm\n showRecaptcha={showRecaptcha}\n shouldSendTelemetry={shouldSendTelemetry}\n sourceId={sourceId}\n handleLogin={handleLogin}\n loginFormConfig={{\n showCreatePassword: true,\n forgetInfoLink: {\n url: `${OHW_BASE_URL}${language}/hilton-honors/login/forgot-information/`,\n },\n secureInfoLink: {\n url: `${OHW_BASE_URL}${language}/p/global-privacy-statement/`,\n },\n }}\n />\n </div>\n\n <div className=\"w-full md:w-1/2 md:pl-16 rtl:md:pr-16\">\n <h2\n data-e2e=\"notAmemberLabel\"\n className=\"text-primary mb-4 text-center text-xl font-bold\"\n >\n {t('loginContent.notAmember')}\n </h2>\n\n <div data-e2e=\"benefitsGroup\" className=\"mb-6 flex flex-wrap md:mb-10\">\n {memberBenefits?.map((item) => {\n const key = Object.keys(item)[0] as keyof (typeof memberBenefits)[number];\n\n return (\n <div key={key} data-e2e={key} className=\"flex w-1/2 pb-5 lg:w-1/4 lg:pb-4\">\n <Icon className=\"text-primary\" name={iconMap[key]} />\n <h3 className=\"px-2 text-xs md:text-sm\">{item[key]}</h3>\n </div>\n );\n })}\n </div>\n\n <a\n href={enrollmentUrl}\n data-e2e=\"joinBtn\"\n className=\"btn btn-2xl btn-primary-outline w-full text-center\"\n >\n {t('loginContent.notAmemberCTA')}\n </a>\n <p data-e2e=\"wiFiDisclaimer\" className=\"mt-8 text-xs\">\n {t('loginContent.wifiDisclaimer')}\n </p>\n </div>\n </div>\n </div>\n <Speedbump isShowing={isVisible} onClose={onHide} onContinue={onContinue} />\n </HonorsLayout>\n );\n};\n\nexport const getServerSideProps = (async (context: GetServerSidePropsContext) => {\n if (!getAppId(getSourceId(context))) {\n return { notFound: true };\n }\n\n const { queryClient } = getServerSideClients(context);\n\n await getSpeedBumpFeatureConfig(queryClient).catch((err) => {\n const error = generateError(err);\n logError(\n `[dx-auth2-ui] - Error retrieving speedbump feature config at ${context.req.url}`,\n error\n );\n });\n\n return serverSideProps({\n context,\n queryClient,\n namespaces: ['footer', 'error'],\n pageProps: ({ sourceId, featureToggles }) => ({\n shouldSendTelemetry: isFeatureEnabled(featureToggles, AKAMAI_BM_TELEMETRY_HEADER_GUEST),\n showRecaptcha: getDisplayRecaptcha(sourceId, featureToggles),\n pageMetrics: {\n trackingData: {\n pageView: 'honorsPageView',\n pageData: {\n pageName: 'Login',\n pageType: 'signin_join',\n language: context.locale,\n },\n },\n },\n }),\n });\n}) satisfies GetServerSideProps;\n\nexport default HiltonHonorsLoginPage;\n"],"names":["router","showRecaptcha","HiltonHonorsLoginPage","shouldSendTelemetry","sourceId","useTranslation","t","useRouter","language","locale","forwardPageURI","query","metrics","useMetrics","useSpeedbump","APP_NAME","isVisible","onContinue","onHide","onShow","auth","makeAuthClient","QUERY_CLIENT_ENV_VARS","appName","enrollmentUrl","OHW_BASE_URL","accountUrl","useEffect","window","recaptchaOptions","useRecaptchaNet","handleLogin","data","error","isAuthenticated","newForwardUrl","targetUrl","fakeEventTarget","login","catch","logError","sendReward","Goals","SignInSuccess","Boolean","userInfo","guestId","isValidForwardUri","setEventAction","eventAction","trackEvent","isRelative","buildForwardUrl","makeAnchorEventTarget","location","assign","memberBenefits","returnObjects","iconMap","lowestPrice","wiFi","digitalCheckIn","honorsPoints","HonorsLayout","hasMinimalHeader","title","metaDescription","div","className","h1","LoginForm","loginFormConfig","showCreatePassword","forgetInfoLink","url","secureInfoLink","h2","data-e2e","map","item","key","Object","keys","Icon","name","h3","a","href","p","Speedbump","isShowing","onClose"],"sourceRoot":"","ignoreList":[]}