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GAAGjD,EAAAA,EAAYA,CAAAA,EAAGjB,EAAS,4BAA4B,CAAC,CAEjE,MAIJ,WAAC0D,MAAAA,CAAIC,UAAU,kDACb,UAACS,KAAAA,CACCC,WAAS,kBACTV,UAAU,2DAET/D,EAAE,6BAGL,UAAC8D,MAAAA,CAAIW,WAAS,gBAAgBV,UAAU,wCACrCZ,GAAgBuB,IAAI,IACnB,IAAMC,EAAMC,OAAOC,IAAI,CAACC,EAAK,CAAC,EAAE,CAEhC,OACE,OAAChB,MAAAA,CAAcW,WAAUE,EAAKZ,UAAU,6CACtC,MAACgB,EAAAA,EAAIA,CAAAA,CAAChB,UAAU,eAAeiB,KAAM3B,CAAO,CAACsB,EAAI,GACjD,MAACM,KAAAA,CAAGlB,UAAU,mCAA2Be,CAAI,CAACH,EAAI,KAF1CA,EAKd,KAGF,UAACO,IAAAA,CACCC,KAAM/D,EACNqD,WAAS,UACTV,UAAU,8DAET/D,EAAE,gCAEL,UAACoF,IAAAA,CAAEX,WAAS,iBAAiBV,UAAU,wBACpC/D,EAAE,0CAKX,UAACqF,EAAAA,EAASA,CAAAA,CAACC,UAAW5E,EAAW6E,QAAS3E,EAAQD,WAAYA,MAGpE","sources":["webpack://_N_E/?b31e","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    language,\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=\"mb-5 mt-7 font-headline text-3xl\">{t('loginContent.pageTitle')}</h1>\n        <div className=\"flex flex-col space-y-12 md:flex-row md:space-y-0 md:divide-x md:divide-border 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=\"mb-4 text-center text-xl font-bold text-primary\"\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":["showRecaptcha","HiltonHonorsLoginPage","shouldSendTelemetry","t","useTranslation","router","useRouter","language","locale","forwardPageURI","query","metrics","useMetrics","isVisible","onContinue","onHide","onShow","useSpeedbump","APP_NAME","auth","makeAuthClient","QUERY_CLIENT_ENV_VARS","appName","enrollmentUrl","OHW_BASE_URL","accountUrl","useEffect","window","recaptchaOptions","useRecaptchaNet","handleLogin","data","error","login","catch","logError","sendReward","Goals","SignInSuccess","isAuthenticated","Boolean","userInfo","guestId","newForwardUrl","isValidForwardUri","setEventAction","eventAction","trackEvent","targetUrl","isRelative","buildForwardUrl","makeAnchorEventTarget","location","assign","memberBenefits","returnObjects","iconMap","lowestPrice","wiFi","digitalCheckIn","honorsPoints","HonorsLayout","hasMinimalHeader","title","metaDescription","div","className","h1","LoginForm","sourceId","loginFormConfig","showCreatePassword","forgetInfoLink","url","secureInfoLink","h2","data-e2e","map","key","Object","keys","item","Icon","name","h3","a","href","p","Speedbump","isShowing","onClose"],"sourceRoot":"","ignoreList":[]}