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YAAU,WACR,IAAKuC,EAAU,CACb,KACgBC,EAAAA,EAAAA,OAEZC,iBAAiB,eAAgBZ,EAAsB,CACrDa,SAAS,IAGb,MAAOC,GACPC,QAAQC,IAAI,CAAEC,WAAYH,KAC1BI,EAAAA,EAAAA,IAAe,IACfvD,EAAOkB,KAAK,KAEd,OAAO,WACLsC,oBAAoB,eAAgBnB,EAAsB,CACxDa,SAAS,QAId,CAAClD,EAAQ+C,ICdZU,CAAqBZ,GAErB,IAAMa,EAAqB,mCAAG,qFAC5Bd,GAAmBA,KAEnBW,EAAAA,EAAAA,IAAe,KACfI,EAAAA,EAAAA,IAAa,IAJe,SAKtB3D,EAAOkB,KACX,CACEd,SAAUJ,EAAO4D,MACjBzD,MAAO,CAAED,eAAgB,cAE3B2D,EACA,CAAEC,SAAS,IAXe,2CAAH,qDAqB3B,eAN2BC,EAAAA,EAAAA,GAAa,CACtCC,QAAStB,EAAqBI,GAC9BmB,OAAQP,EACRQ,SAAU,OAGZ,IAEER,sBAAAA","sources":["webpack://_N_E/./src/api/enrollmentClient/index.tsx","webpack://_N_E/./src/components/layout/Form.tsx","webpack://_N_E/./src/components/layout/PageContent.tsx","webpack://_N_E/./src/components/shared/Modal.tsx","webpack://_N_E/./src/components/shared/Spinner.tsx","webpack://_N_E/./src/hooks/useTokenVerification.ts","webpack://_N_E/./src/hooks/useSessionTimer.ts"],"sourcesContent":["import {\n Enrollment as EnrollmentClient,\n Enrollment,\n} from '@clear-denver/tpc-openapi-typescript'\nimport { getXCLEARCorrelationInfo } from '@api/utils'\nimport { preEnrollmentClient, Client, preEnrollmentConfig } from './config'\nimport { copyAndRemoveEmptyEntries } from './utils'\n\nexport const enrollmentHelperClient = new Enrollment.EnrollmentHelperApi(\n preEnrollmentConfig\n)\n\nexport async function startEnrollment(\n plan: string,\n client: Client,\n affiliate?: string\n): Promise {\n return client\n .startEnrollment({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n planSelectionCommand: {\n plan,\n affiliate,\n },\n })\n .then(({ enrollment }: EnrollmentClient.EnrollmentCreated) => {\n return enrollment\n })\n}\n\nexport function submitPreEligibility(\n preEligibilityStep: Exclude<\n EnrollmentClient.Enrollment['eligibility'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.confirmEligibility({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preEligibilityStep,\n })\n}\n\nexport function submitPreCitizenship(\n preCitizenshipStep: Exclude<\n EnrollmentClient.Enrollment['citizenship'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.reportCitizenship({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preCitizenshipStep: copyAndRemoveEmptyEntries(preCitizenshipStep),\n })\n}\n\nexport function submitPreDocumentCheck(\n preDocumentCheckStep: Exclude<\n EnrollmentClient.Enrollment['documentCheck'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.chooseDocuments({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preDocumentCheckStep: copyAndRemoveEmptyEntries(preDocumentCheckStep),\n })\n}\n\nexport async function submitPreIdentity(\n preIdentityStep: Exclude<\n EnrollmentClient.Enrollment['identityHints'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.giveIdentityHints({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preIdentityStep,\n })\n}\n\nexport async function submitPreBiographicInfo(\n preBiographicInfo: Exclude<\n EnrollmentClient.Enrollment['biographicInfo'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.biographicInfo({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preBiographicInfoStep: copyAndRemoveEmptyEntries({\n ...preBiographicInfo,\n dateOfBirth: new Date(preBiographicInfo?.dateOfBirth),\n }),\n })\n}\n\nexport async function submitContact(\n preContactStep: Exclude,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.provideContact({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preContactStep,\n })\n}\n\nexport async function submitPreAttributes(\n preAttributesStep: Exclude<\n EnrollmentClient.Enrollment['attributes'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.provideAttributes({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preAttributesStep: {\n ...preAttributesStep,\n aliases: preAttributesStep.aliases.map((item: any) =>\n copyAndRemoveEmptyEntries(item)\n ),\n previousNames: preAttributesStep.previousNames.map((item: any) =>\n copyAndRemoveEmptyEntries(item)\n ),\n },\n })\n}\n\nexport async function submitPreLegalQuestionnaire(\n preLegalQuestionnaireStep: Exclude<\n EnrollmentClient.Enrollment['legal'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.answerLegalQuestionnaire({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preLegalQuestionnaireStep,\n })\n}\n\nexport async function submitFinalizeEnrollment(\n preFinalizeStepCommand: Exclude<\n EnrollmentClient.PreFinalizeStepCommand,\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.finalizePreEnrollment({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preFinalizeStepCommand,\n })\n}\n\nexport async function promotionOpt(\n opt: Enrollment.ClearPromotionsOptOptEnum,\n enrollmentId: string,\n email: string\n) {\n return enrollmentHelperClient.clearPromotionsOpt({\n enrollmentId,\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n opt,\n clearPromotionForm: { email: email },\n })\n}\n\nexport async function verifyAddress(address: Enrollment.Address) {\n return enrollmentHelperClient.addressSuggestions({\n address,\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n })\n}\n\nexport async function uploadDocument(\n enrollmentId: string,\n file: File,\n isNameLinking: boolean,\n type: string\n) {\n if (!isNameLinking) {\n return preEnrollmentClient.attachmentUpload({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n file,\n fileName: file.name,\n type,\n purposes: [Enrollment.AttachmentUploadPurposesEnum.CITIZENSHIP],\n })\n } else {\n return preEnrollmentClient.attachmentUpload({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n file,\n fileName: file.name,\n purposes: [Enrollment.AttachmentUploadPurposesEnum.NAMELINKING],\n })\n }\n}\n\nexport async function deleteDocument(\n enrollmentId: string,\n attachmentId: string\n) {\n return preEnrollmentClient.deleteAttachment({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n attachmentId,\n })\n}\n\nexport async function finishUploadingDocuments(\n preDocumentUploadStepCommand: Exclude<\n EnrollmentClient.Enrollment['documents'],\n undefined\n >,\n client: Client,\n enrollmentId: string\n): Promise {\n return client.finishDocumentUpload({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preDocumentUploadStepCommand,\n })\n}\n\nexport async function searchExistenceStatusByBiographics(\n biographics: Enrollment.BiographicsLookup\n): Promise {\n return enrollmentHelperClient.searchExistenceByBiographics({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n biographicsLookup: biographics,\n })\n}\n\nexport async function acceptTermsAndConditions(\n accepted: boolean,\n enrollmentId: string\n): Promise {\n return preEnrollmentClient.acceptAgreement({\n enrollmentId,\n agreement: {\n agreementType: Enrollment.AgreementAgreementTypeEnum.TERMSANDCONDITIONS,\n accepted,\n },\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n })\n}\n\nexport async function finalizePreEnrollment(\n preFinalizeStepCommand: Enrollment.PreFinalizeStepCommand,\n enrollmentId: string\n): Promise {\n return preEnrollmentClient.finalizePreEnrollment({\n xCLEARCorrelationInfo: getXCLEARCorrelationInfo(),\n enrollmentId,\n preFinalizeStepCommand,\n })\n}\n","import React, { FormHTMLAttributes } from 'react'\nimport { Text, TextProps, Flex, FlexProps } from '@clear/design-system'\n\ntype FormProps = FlexProps & FormHTMLAttributes\n\nexport const Form: React.FC = (props) => (\n \n)\n\nexport const Row: React.FC = (props) => (\n \n)\n\nexport const Actions: React.FC = (props) => (\n \n)\n\nexport const StepTitle: React.FC = (props) => (\n \n)\n\nexport const StepSubTitle: React.FC = (props) => (\n \n)\n\nexport const ErrorMessage = React.forwardRef(\n ({ children, ...props }, ref) => (\n \n Error: {children}\n \n )\n)\n\nErrorMessage.displayName = 'ErrorMessage'\n","import React, { useState, useEffect } from 'react'\nimport { useRouter } from 'next/router'\nimport { Box, BoxProps } from '@clear/design-system'\nimport { Modal } from '@components/shared/Modal'\nimport useEnrollmentApi from '@hooks/useEnrollmentApi'\nimport { useSessionTimer } from '@hooks/useSessionTimer'\n\ntype PageContentProps = BoxProps\nconst PageContent: React.FC = ({ ...props }) => {\n const { clearState: clearEnrollmentState } = useEnrollmentApi()\n const router = useRouter()\n const sessionTimeout =\n (router && router.query && router.query.sessionTimeout) || ''\n const pathname = (router && router.pathname) || ''\n const [showSessionModal, setShowSessionModal] = useState(false)\n\n const successClickFunction = () => {\n router.push('/')\n }\n\n useEffect(() => {\n const shouldShowModal = sessionTimeout === 'true' && pathname !== '/'\n if (shouldShowModal) {\n setShowSessionModal(true)\n }\n }, [pathname, sessionTimeout])\n\n useSessionTimer(clearEnrollmentState)\n\n return (\n \n \n \n \n )\n}\n\nexport default PageContent\n","import React, { SetStateAction, ReactNode } from 'react'\nimport { Flex, Text, Button } from '@clear/design-system'\nimport { ColorType } from '@clear/design-system/lib/theme/colors'\nimport Link from 'next/link'\n\nexport interface ModalProps {\n header?: string\n body: string | ReactNode\n bodyNote?: string\n showModal: boolean\n setShowModal: React.Dispatch>\n canClose?: boolean\n successButtonText?: string\n closeButtonText?: string\n successLink?: string\n successClick?: () => void\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {}\n\nexport function Modal(props: ModalProps) {\n const {\n header,\n body,\n bodyNote,\n showModal,\n setShowModal,\n canClose,\n successButtonText = 'success',\n successLink,\n successClick,\n } = props\n\n const handleCloseModal = () => setShowModal(false)\n\n return (\n <>\n {showModal ? (\n <>\n \n e.stopPropagation()}\n mx={[6, null]}\n >\n {/* header */}\n \n {header && (\n \n {header}\n \n )}\n \n {body}\n \n {bodyNote && (\n \n {bodyNote}\n \n )}\n \n \n {successLink ? (\n \n \n \n ) : (\n \n )}\n \n \n \n
\n \n ) : null}\n \n )\n}\n","import React from 'react'\n\nexport default function Spinner() {\n return (\n
\n
\n
\n
\n
\n
\n \n
\n
\n )\n}\n","import { useRouter } from 'next/router'\nimport { useEffect } from 'react'\nimport { getAccessToken, setAccessToken } from '@api/utils'\n\nconst beforeUnloadListener = (event: any) => {\n event.preventDefault()\n return (event.returnValue = 'Are you sure you want to exit?')\n}\n\nexport function useTokenVerification(disabled = false) {\n const router = useRouter()\n\n useEffect(() => {\n if (!disabled) {\n try {\n const token = getAccessToken()\n if (token) {\n addEventListener('beforeunload', beforeUnloadListener, {\n capture: true,\n })\n }\n } catch (err) {\n console.log({ tokenError: err })\n setAccessToken('')\n router.push('/')\n }\n return () => {\n removeEventListener('beforeunload', beforeUnloadListener, {\n capture: true,\n })\n }\n }\n }, [router, disabled])\n}\n","import { useRouter } from 'next/router'\nimport { useIdleTimer } from 'react-idle-timer'\nimport { useTokenVerification } from './useTokenVerification'\nimport { setAccessToken, setSessionId } from '@api/utils'\n\nconst FIFTEEN_MINUTES_IN_MILLIS = 1000 * 60 * 15\n\nexport const getInactivityTimeout = (\n INACTIVITY_TIMEOUT = FIFTEEN_MINUTES_IN_MILLIS\n) => INACTIVITY_TIMEOUT\n\nexport function useSessionTimer(\n timeoutCallback?: () => void,\n disableTokenVerification?: boolean,\n inactivityTimeout?: number\n) {\n const router = useRouter()\n\n useTokenVerification(disableTokenVerification)\n\n const sessionTimeoutHandler = async () => {\n timeoutCallback && timeoutCallback()\n // Sign out of cognito\n setAccessToken('')\n setSessionId('')\n await router.push(\n {\n pathname: router.route,\n query: { sessionTimeout: 'true' },\n },\n undefined,\n { shallow: true }\n )\n }\n\n const idleTimerFunctions = useIdleTimer({\n timeout: getInactivityTimeout(inactivityTimeout),\n onIdle: sessionTimeoutHandler,\n debounce: 500,\n })\n\n return {\n ...idleTimerFunctions,\n sessionTimeoutHandler,\n }\n}\n"],"names":["enrollmentHelperClient","Enrollment","preEnrollmentConfig","submitFinalizeEnrollment","preFinalizeStepCommand","client","enrollmentId","finalizePreEnrollment","xCLEARCorrelationInfo","getXCLEARCorrelationInfo","promotionOpt","opt","email","clearPromotionsOpt","clearPromotionForm","verifyAddress","address","addressSuggestions","searchExistenceStatusByBiographics","biographics","searchExistenceByBiographics","biographicsLookup","Form","props","as","flexDirection","Row","alignItems","mx","Actions","mt","justifyContent","StepTitle","textAlign","color","variant","fontSize","mb","StepSubTitle","my","ErrorMessage","React","ref","children","displayName","clearEnrollmentState","useEnrollmentApi","clearState","router","useRouter","sessionTimeout","query","pathname","useState","showSessionModal","setShowSessionModal","useEffect","useSessionTimer","px","width","showModal","setShowModal","header","body","successButtonText","successClick","push","canClose","noop","Modal","bodyNote","successLink","className","onClick","p","backgroundColor","e","stopPropagation","pb","href","passHref","size","text","textProps","Spinner","beforeUnloadListener","event","preventDefault","returnValue","FIFTEEN_MINUTES_IN_MILLIS","getInactivityTimeout","INACTIVITY_TIMEOUT","timeoutCallback","disableTokenVerification","inactivityTimeout","disabled","getAccessToken","addEventListener","capture","err","console","log","tokenError","setAccessToken","removeEventListener","useTokenVerification","sessionTimeoutHandler","setSessionId","route","undefined","shallow","useIdleTimer","timeout","onIdle","debounce"],"sourceRoot":""}