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,oBAAqBU,IAAK,EAAK,EAEvF,CACEhB,MAAO,mBACP5mC,MAAO,kBACPknC,SAAU,8BACVU,IAAK,EACP,EACA,CACEhB,MAAO,WACP5mC,MAAO,YACPknC,SAAU,sBACVU,IAAK,EACP,EACA,CACEhB,MAAO,iBACP5mC,MAAO,UACPknC,SAAU,4BACVU,IAAK,EACP,EACA,CACEhB,MAAO,gDACP5mC,MAAO,iBACPknC,SAAU,6BACVU,IAAK,EACP,EAEA,CACEhB,MAAO,mCACP5mC,MAAO,gBACPknC,SAAU,iCACVU,IAAK,EACP,EACA,CACEhB,MAAO,wCACP5mC,MAAO,qBACPknC,SAAU,gCACVU,IAAK,EACP,EAEA,CACEhB,MAAO,iCACP5mC,MAAO,cACPknC,SAAU,mCACVU,IAAK,EACP,EACA,CACEhB,MAAO,+CACP5mC,MAAO,mBACPknC,SAAU,4BACVU,IAAK,EACP,EAEA,CACEhB,MAAO,eACP5mC,MAAO,YACPknC,SAAU,wBACVU,IAAK,GACLlQ,KAAM,MACR,EAEA,CACEkP,MAAO,2BACP5mC,MAAO,oBACPknC,SAAU,oCACVU,IAAK,GACLlQ,KAAM,kBACR,EACA,CACEkP,MAAO,mBACP5mC,MAAO,WACPknC,SAAU,4BACVU,IAAK,GACLlQ,KAAM,UACR,EAEA,CACEkP,MAAO,6BACP5mC,MAAO,uBACPknC,SAAU,sCACVU,IAAK,GACLlQ,KAAM,oBACR,EACA,CACEkP,MAAO,mBACP5mC,MAAO,UACPknC,SAAU,4BACVU,IAAK,GACLlQ,KAAM,UACR,EAEA,CACEkP,MAAO,eACP5mC,MAAO,OACPknC,SAAU,wBACVU,IAAK,GACLlQ,KAAM,MACR,EACA,CACEkP,MAAO,gBACP5mC,MAAO,GACPknC,SAAU,yBACVU,IAAK,GACLlQ,KAAM,OACR,EACA,CACEkP,MAAO,wCACP5mC,MAAO,eACPknC,SAAU,sBACVU,IAAK,EACP,EACA,CACEhB,MAAO,yCACP5mC,MAAO,sBACPknC,SAAU,gCAC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AeA,EAAW,EAAE3gC,SAAS,CACpE,EAAE,CACJ,C","sources":["webpack:///./components/dialogs/Dialog.tsx","webpack:///./components/rich-text-formatting.tsx","webpack:///./features/approvals/types/ApprovalsFilter.ts","webpack:///./features/approvals/types/ApprovalsTab.ts","webpack:///./features/i18n/commonMessages.ts","webpack:///./features/verification/components/UnableToVerify.tsx","webpack:///./features/verification/utils/utils.ts","webpack:///./features/verification/verification.ts","webpack:///./features/verification/utils/availability.ts","webpack:///./features/verification/hooks/useOwnershipVerification.ts","webpack:///./features/verification/hooks/useVerification.ts","webpack:///./features/verification/components/InquiryDialog.tsx","webpack:///./features/verification/services/phoneVerification.ts","webpack:///./features/verification/utils/validatePhoneNumber.ts","webpack:///./features/verification/components/steps/Step.tsx","webpack:///./features/verification/components/steps/EnterPhoneNumber.tsx","webpack:///./features/verification/components/steps/EnterVerificationCode.tsx","webpack:///./features/verification/components/steps/VerifyNumberSuccess.tsx","webpack:///./features/verification/components/VerifyNumber.tsx","webpack:///./legacy/components/user/onboardingWizard/company/ownershipInformation/services/ownershipInformationService.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/helper.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/CodeMessageFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/CodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/DisableVerificationFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/SmsPhoneFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/QrCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/ScanCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/UserOtpQrCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/VerificationProviderFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorStepper.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialogContents.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/defaultMethod/presentation/LoginPopupDefaultMethodDialog.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/business/LoginPopupMultiple.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/business/LoginPopupMultiple.handleQueries.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/useLoginPopupMultipleMethods.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/LoginPopupMultipleMethods.presentation.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/LoginPopupMultipleMethods.bindings.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.presentation.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/business/LoginPopup.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/business/LoginPopup.handleQueries.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/useLoginPopup.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.bindings.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/shared/constants.ts","webpack:///./legacy/features/user/singleSignOn/services/api.ts","webpack:///./legacy/features/user/twoFactorAuthentication/recaptcha/recaptcha.helpers.ts","webpack:///./legacy/modals/genericInfoModal.ts","webpack:///./legacy/modals/react/TitleMessageDialog.tsx","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeout.reducer.ts","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeoutDialog.tsx","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeoutFragment.tsx","webpack:///./legacy/components/user/signin/ssoSessionTimeout/SsoSessionTimeoutDialog.tsx","webpack:///./legacy/modals/sessionTimeout.ts","webpack:///./legacy/services/UnsavedChangedConfirmationService.ts","webpack:///./legacy/services/routers.ts","webpack:///./legacy/services/sessionTimeout.ts","webpack:///./legacy/services/verification/verificationCompany.ts","webpack:///./legacy/services/verification/verificationUser.ts","webpack:///./legacy/utils/reactHelpers.ts","webpack:///./legacy/features/companies/serviceSubscriptions/modals/billingDebitFailedModal.ts","webpack:///./legacy/services/company/promoCodes.ts","webpack:///./legacy/viewmodels/shell.ts","webpack:///./routes/durandal.ts","webpack:///./utils/result.ts"],"sourcesContent":["import { ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\nimport { Close } from '@mui/icons-material';\nimport {\n Dialog,\n DialogProps,\n DialogTitle,\n IconButton,\n PaperProps as MuiPaperProps,\n} from '@mui/material';\n\nimport commonMessages from '@/features/i18n/commonMessages';\n\ninterface Props extends Omit {\n children: ReactNode;\n PaperProps?: MuiPaperProps;\n isOpen?: boolean;\n isClosable?: boolean;\n onDialogClose?: () => void;\n title?: ReactNode;\n}\n\nconst PlootoDialog = ({\n children,\n isClosable = true,\n isOpen = false,\n onDialogClose,\n PaperProps = undefined,\n title,\n ...dialogProps\n}: Props) => {\n const { formatMessage } = useIntl();\n\n return (\n \n {isClosable ? (\n \n \n \n ) : null}\n {title ? {title} : null}\n {children}\n \n );\n};\n\nexport default PlootoDialog;\nexport { Props as DialogProps };\n","import { ReactNode } from 'react';\nimport { Link } from '@mui/material';\n\n/** Rich Text Formatting that wraps text in an tag. */\nexport const Emphasis = (chunks: Array) => {chunks};\n\n/** Rich Text Formatting that wraps text in a tag. */\nexport const Strong = (chunks: Array) => {chunks};\n\n/** Rich Text Formatting that wraps text in an underline component. */\nexport const Underline = (chunks: Array) => (\n {chunks}\n);\n\n/** Rich Text Formatting that wraps text in a link tag with a `tel` href. */\nexport const PhoneLink = (chunk: Array) => {chunk};\n\n/** Rich Text Formatting that wraps text in a link tag with a `mailto` href. */\nexport const EmailLink = (chunk: Array) => {chunk};\n\n/** Support email address as a link tag with a `mailto` href. */\nexport const SupportEmailLink = EmailLink(['support@plooto.com']);\n","export enum ApprovalsFilter {\n Mine = 'my',\n All = 'all',\n}\n","export enum ApprovalsTab {\n Payments = 'payments',\n Controls = 'controls',\n}\n","import { defineMessages } from 'react-intl';\n\nconst commonMessages = defineMessages({\n approve: {\n defaultMessage: 'Approve',\n },\n back: {\n defaultMessage: 'Back',\n },\n cancel: {\n defaultMessage: 'Cancel',\n },\n close: {\n defaultMessage: 'Close',\n },\n closeDialog: {\n defaultMessage: 'Close dialog',\n },\n comingSoon: {\n defaultMessage: 'Coming Soon',\n },\n continue: {\n defaultMessage: 'Continue',\n },\n delete: {\n defaultMessage: 'Delete',\n },\n emDash: {\n defaultMessage: '—',\n },\n goPlanName: {\n defaultMessage: 'Go',\n },\n gotIt: {\n defaultMessage: 'Got it',\n },\n growPlanName: {\n defaultMessage: 'Grow',\n },\n growUnlimitedPlanName: {\n defaultMessage: 'Grow Unlimited',\n },\n learnMore: {\n defaultMessage: 'Learn more',\n },\n loading: {\n defaultMessage: 'Loading…',\n },\n logout: {\n defaultMessage: 'Logout',\n },\n new: {\n defaultMessage: 'New',\n },\n none: {\n defaultMessage: 'None',\n },\n okay: {\n defaultMessage: 'Okay',\n },\n or: {\n defaultMessage: 'or',\n },\n other: {\n defaultMessage: 'Other',\n },\n reject: {\n defaultMessage: 'Reject',\n },\n save: {\n defaultMessage: 'Save',\n },\n showLess: {\n defaultMessage: 'Show less',\n },\n showMore: {\n defaultMessage: 'Show more',\n },\n skipForNow: {\n defaultMessage: 'Skip for now',\n },\n subtotal: {\n defaultMessage: 'Subtotal',\n },\n tryAgain: {\n defaultMessage: 'Try again',\n },\n typeToSearch: {\n defaultMessage: 'Type to search',\n },\n unlimited: {\n defaultMessage: 'Unlimited',\n },\n});\n\nexport default commonMessages;\n","import { FormattedMessage } from 'react-intl';\nimport { Link, Stack, Typography } from '@mui/material';\n\nexport const UnableToVerify = () => (\n \n \n \n \n \n verification@plooto.com,\n }}\n />\n \n \n);\n","import { Status } from '@/legacy/services/verification/verification';\n\nimport { VerificationProgress } from '../types';\n\n/**\n * Converts a backend status to a frontend verification progress status.\n * @param status The backend status.\n * @returns The frontend progress status.\n */\nexport function backendStatusToProgressPersona(status: Status): VerificationProgress {\n switch (status) {\n case 'COMPLETED':\n case 'REVIEWED':\n return 'completed';\n case 'PROCESSING':\n case 'INPUT_REQUIRED':\n case 'PENDING_OTHER':\n case 'PENDING_CAPABILITIES':\n case 'IDENTITY_REVERIFICATION_REQUIRED':\n return 'in-progress';\n case 'REJECTED':\n return 'rejected';\n case 'PENDING':\n case 'UPLOAD_REQUIRED':\n case null:\n default:\n return 'not-started';\n }\n}\n\nexport function backendStatusToProgressJumio(status: Status): VerificationProgress {\n switch (status) {\n case 'COMPLETED':\n case 'REVIEWED':\n return 'completed';\n case 'PROCESSING':\n case 'INPUT_REQUIRED':\n case 'UPLOAD_REQUIRED':\n case 'PENDING_OTHER':\n case 'PENDING_CAPABILITIES':\n case 'IDENTITY_REVERIFICATION_REQUIRED':\n return 'in-progress';\n case 'REJECTED':\n return 'rejected';\n case 'PENDING':\n case null:\n default:\n return 'not-started';\n }\n}\n","import app from 'durandal/app';\nimport * as ko from 'knockout';\n\nimport OwnershipInformationService from '@/legacy/components/user/onboardingWizard/company/ownershipInformation/services/ownershipInformationService';\nimport { Instance as companyService } from '@/legacy/services/company';\nimport { Instance as userService } from '@/legacy/services/user';\nimport {\n Instance as verificationService,\n Status,\n} from '@/legacy/services/verification/verification';\nimport { Instance as verificationCompanyService } from '@/legacy/services/verification/verificationCompany';\nimport { Instance as verificationUserService } from '@/legacy/services/verification/verificationUser';\nimport {\n combineResults,\n mapResultObservable,\n observableToAsyncResult,\n Result,\n} from '@/utils/result';\n\nimport { backendStatusToProgressJumio, backendStatusToProgressPersona } from './utils/utils';\nimport { VerificationProgress } from './types';\n\nexport const additionalVerificationItems = observableToAsyncResult(\n companyService.CompanyId,\n async (companyId) => {\n if (!companyId) {\n return Promise.reject(new Error('No company ID'));\n }\n return verificationService.getOutstandingVerificationItems(companyId);\n }\n);\n\n/** Backing field for {@see bankAccountVerificationInProgress} */\nconst bankAccountVerificationInProgressHack = ko.observableArray();\n\n/**\n * Adding a bank account doesn't trigger any app invalidations. SignalR doesn't fire a company\n * updated event. We do some hacking to pretend that all that stuff worked, similar to identity\n * verification in X1. We handle company changes by storing the companyId versus just a straight\n * boolean value globally for the app session.\n */\nexport const bankAccountVerificationInProgress = ko.pureComputed({\n deferEvaluation: true,\n read: () =>\n bankAccountVerificationInProgressHack.indexOf(companyService.CompanyId()) >= 0 ||\n companyService.profile()?.bankAdded(),\n write: (value) => {\n if (!value) {\n bankAccountVerificationInProgressHack.remove(companyService.CompanyId());\n } else if (bankAccountVerificationInProgressHack.indexOf(companyService.CompanyId()) < 0) {\n bankAccountVerificationInProgressHack.push(companyService.CompanyId());\n }\n },\n});\n\nexport const bankAccountVerificationCompleted = ko.pureComputed({\n deferEvaluation: true,\n read: () => companyService.profile()?.isAnyBankAccountVerified(),\n});\n\nexport const bankAccountVerificationProgress = ko.pureComputed({\n deferEvaluation: true,\n read: (): VerificationProgress => {\n if (bankAccountVerificationCompleted()) {\n return 'completed';\n }\n if (bankAccountVerificationInProgress()) {\n return 'in-progress';\n }\n return 'not-started';\n },\n});\n\nexport const bankAccountVerificationNotStarted = ko.pureComputed({\n deferEvaluation: true,\n read: () => bankAccountVerificationProgress() === 'not-started',\n});\n\nexport const verification = observableToAsyncResult(\n companyService.CompanyId,\n async (companyId: string) => {\n if (!companyId) {\n return Promise.reject(new Error('No company ID'));\n }\n return verificationService.getOnboardingWizardStatus(companyId);\n }\n);\n\nexport const companyVerification = observableToAsyncResult(\n companyService.CompanyId,\n async (companyId) => {\n if (!companyId) {\n return Promise.reject(new Error('No company ID'));\n }\n return verificationCompanyService.GetVerifyCompanyStatus(companyId);\n }\n);\n\nconst companyVerificationStatusHack = ko.observable | undefined>(undefined);\n\nexport const companyVerificationStatus = combineResults(\n [verification, companyVerificationStatusHack] as const,\n (verificationDto, hack) => {\n if (hack) {\n return hack;\n }\n return verificationDto?.companyVerificationStatus;\n },\n { write: companyVerificationStatusHack }\n);\n\nexport const companyVerificationProgress = mapResultObservable(\n companyVerificationStatus,\n (companyStatus) => {\n if (!companyStatus) {\n return 'not-started';\n }\n return companyService.profile()?.isSubjectToPersonaOnboarding()\n ? backendStatusToProgressPersona(companyStatus)\n : backendStatusToProgressJumio(companyStatus);\n }\n);\n\nexport const companyVerificationCompleted = mapResultObservable(\n companyVerificationProgress,\n (companyProgress) => companyProgress === 'completed'\n);\n\nexport const companyVerificationInProgress = mapResultObservable(\n companyVerificationProgress,\n (companyProgress) => companyProgress === 'in-progress'\n);\n\nexport const companyVerificationNotStarted = mapResultObservable(\n companyVerificationProgress,\n (companyProgress) => companyProgress === 'not-started'\n);\n\nexport const companyVerificationFailed = mapResultObservable(\n companyVerificationProgress,\n (companyProgress) => companyProgress === 'rejected'\n);\n\nexport const ownershipInformation = observableToAsyncResult(\n companyService.CompanyId,\n async (companyId) => {\n if (!companyId) {\n return Promise.reject(new Error('No company ID'));\n }\n return OwnershipInformationService.get();\n },\n {\n errorValue: [],\n initialValue: [],\n pendingValue: [],\n }\n);\n\nconst companyAndUserId = ko.computed(() => [companyService.CompanyId(), userService.UserId()]);\n\nexport const userVerification = observableToAsyncResult(\n companyAndUserId,\n async ([companyId, userId]) => {\n if (!companyId) {\n return Promise.reject(new Error('No company ID'));\n }\n if (!userId) {\n return Promise.reject(new Error('No user ID'));\n }\n return verificationUserService.GetVerifyIdentityStatus(companyId, userId);\n }\n);\n\n/**\n * Identity verification doesn't trigger any app invalidations. SignalR doesn't fire a user updated\n * event. We do some hacking to pretend that all that stuff worked.\n * @returns `null` when loading, `boolean` for status indicator.\n */\nexport const userVerificationCompleted = combineResults(\n [userVerification],\n (userVerificationDto) => userVerificationDto?.isIdentityVerified\n);\n\nconst userVerificationProgressBackend = mapResultObservable(\n userVerification,\n (userVerificationDto) => {\n if (!userVerificationDto) {\n return 'not-started';\n }\n return companyService.profile()?.isSubjectToPersonaOnboarding()\n ? backendStatusToProgressPersona(userVerificationDto.status)\n : backendStatusToProgressJumio(userVerificationDto.status);\n }\n);\n\n/** Backing field for {@see userVerificationProgress} */\nconst userVerificationProgressHack = ko.observable | undefined>(\n undefined\n);\n\nexport const userVerificationProgress = combineResults(\n [userVerificationProgressBackend, userVerificationProgressHack] as const,\n (backend, hack) => {\n if (hack) {\n return hack;\n }\n return backend;\n },\n {\n write: userVerificationProgressHack,\n }\n);\n\nexport function userVerificationInProgressCombiner(\n progress: VerificationProgress,\n status: { isIdentitySubmitted: boolean }\n): boolean {\n return progress === 'in-progress' || status?.isIdentitySubmitted;\n}\n\n/**\n * Identity verification doesn't trigger any app invalidations. SignalR doesn't fire a user updated\n * event. We do some hacking to pretend that all that stuff worked.\n */\nexport const userVerificationInProgress = combineResults(\n [userVerificationProgress, userVerification] as const,\n userVerificationInProgressCombiner\n);\n\nexport const userVerificationNotStarted = mapResultObservable(\n userVerificationProgress,\n (userProgress) => userProgress === 'not-started'\n);\n\nexport const userVerificationFailed = mapResultObservable(\n userVerificationProgress,\n (userProgress) => userProgress === 'rejected'\n);\n\nexport const userVerificationStatus = mapResultObservable(userVerification, (data) => data.status);\n\nexport function verificationCompletedCombiner(\n company: boolean,\n identity: boolean,\n unable: boolean\n): boolean {\n return company && identity && !unable;\n}\n\nexport const verificationCompleted = combineResults(\n [companyVerificationCompleted, userVerificationCompleted, userVerificationFailed],\n verificationCompletedCombiner\n);\n\nexport function verificationInProgressCombiner(company: boolean, identity: boolean): boolean {\n return company || identity || bankAccountVerificationInProgress();\n}\n\nexport const verificationInProgress = combineResults(\n [companyVerificationInProgress, userVerificationInProgress],\n verificationInProgressCombiner\n);\n\nexport function verificationFailedCombiner(company: boolean, identity: boolean): boolean {\n return company || identity;\n}\n\nexport const verificationFailed = combineResults(\n [companyVerificationFailed, userVerificationFailed],\n verificationFailedCombiner\n);\n\n/** Backing field for {@see testPaymentMade} */\nconst testPaymentMadeHack = ko.observableArray();\n\n/**\n * Creating a payable doesn't trigger any app invalidations. SignalR doesn't fire a company updated\n * event. We do some hacking to pretend that all that stuff worked, similar to identity verification\n * in X1. We handle company changes by storing the companyId versus just a straight boolean value\n * globally for the app session.\n */\nexport const testPaymentMade = ko.pureComputed({\n deferEvaluation: true,\n read: () =>\n testPaymentMadeHack.indexOf(companyService.CompanyId()) >= 0 ||\n companyService.profile()?.paymentAdded(),\n write: (value) => {\n if (!value) {\n testPaymentMadeHack.remove(companyService.CompanyId());\n } else if (testPaymentMadeHack.indexOf(companyService.CompanyId()) < 0) {\n testPaymentMadeHack.push(companyService.CompanyId());\n }\n },\n});\n\nexport const allVerificationResults = combineResults(\n [\n additionalVerificationItems,\n companyVerification,\n companyVerificationCompleted,\n companyVerificationInProgress,\n companyVerificationNotStarted,\n companyVerificationProgress,\n companyVerificationStatus,\n ownershipInformation,\n userVerification,\n userVerificationCompleted,\n userVerificationInProgress,\n userVerificationNotStarted,\n userVerificationProgress,\n userVerificationStatus,\n verification,\n verificationCompleted,\n verificationFailed,\n verificationInProgress,\n ] as const,\n (\n additionalVerificationItemsData,\n companyVerificationData,\n companyVerificationCompletedData,\n companyVerificationInProgressData,\n companyVerificationNotStartedData,\n companyVerificationProgressData,\n companyVerificationStatusData,\n ownershipInformationData,\n userVerificationData,\n userVerificationCompletedData,\n userVerificationInProgressData,\n userVerificationNotStartedData,\n userVerificationProgressData,\n userVerificationStatusData,\n verificationData,\n verificationCompletedData,\n verificationFailedData,\n verificationInProgressData\n ) => ({\n additionalVerificationItems: additionalVerificationItemsData,\n companyVerification: companyVerificationData,\n companyVerificationCompleted: companyVerificationCompletedData,\n companyVerificationInProgress: companyVerificationInProgressData,\n companyVerificationNotStarted: companyVerificationNotStartedData,\n companyVerificationProgress: companyVerificationProgressData,\n companyVerificationStatus: companyVerificationStatusData,\n ownershipInformation: ownershipInformationData,\n userVerification: userVerificationData,\n userVerificationCompleted: userVerificationCompletedData,\n userVerificationInProgress: userVerificationInProgressData,\n userVerificationNotStarted: userVerificationNotStartedData,\n userVerificationProgress: userVerificationProgressData,\n userVerificationStatus: userVerificationStatusData,\n verification: verificationData,\n verificationCompleted: verificationCompletedData,\n verificationFailed: verificationFailedData,\n verificationInProgress: verificationInProgressData,\n })\n);\n\napp.on('onboarding:identity:updated').then(() => {\n userVerificationProgressHack({ data: 'in-progress', error: null, isLoading: false });\n});\napp.on('onboarding:account:updated').then(() => {\n verificationService.getOutstandingVerificationItems(companyService.CompanyId()).then((items) => {\n additionalVerificationItems({ data: items, error: null, isLoading: false });\n });\n companyService.LoadCompanyProfile(companyService.CompanyId());\n});\n","import * as ko from 'knockout';\n\nimport { FeatureFlag, FeatureToggleService } from '@/features/feature-flags';\nimport { Instance as CompanyService } from '@/legacy/services/company';\nimport { Instance as UserService } from '@/legacy/services/user';\nimport { VerificationStatusIdentityViewModel } from '@/legacy/services/verification/verification';\nimport { combineResults, observableToAsyncResult, Result } from '@/utils/result';\n\nimport {\n companyVerification,\n companyVerificationCompleted,\n companyVerificationInProgress,\n ownershipInformation,\n userVerification,\n userVerificationCompleted,\n userVerificationFailed,\n userVerificationInProgress,\n} from '../verification';\n\n/**\n * Checks if the user is part of the Persona onboarding cohort for use when\n * there is no company - because there is no company profile to check for the\n * backend flag.\n */\nexport const isPersonaEnabled = observableToAsyncResult(UserService.UserId, (userId) =>\n FeatureToggleService.isFeatureEnabled(FeatureFlag.SPR5_24_ONBOARDING_PERSONA, userId)\n);\n\nexport const isPartOfPersonaCohort = combineResults(\n [isPersonaEnabled],\n (isFeatureFlagEnabled) =>\n isFeatureFlagEnabled || CompanyService.profile()?.isSubjectToPersonaOnboarding()\n);\n\n/**\n * Checks to see if the company is part of the Persona onboarding cohort.\n * Ignores the feature flag state.\n */\nexport const isPersonaActive = combineResults(\n [userVerificationCompleted, companyVerificationCompleted],\n (userVerificationResult, companyVerificationResult) => {\n const isAccountingFirm = CompanyService.profile()?.isAccountingFirm();\n const hasAccountingFirmCompanyId = Boolean(CompanyService.profile()?.accountingFirmCompanyId());\n const isCompanySubjectToOnboarding =\n CompanyService.profile()?.isSubjectToPersonaOnboarding() &&\n !isAccountingFirm &&\n !hasAccountingFirmCompanyId;\n const isUserAndCompanyVerified = userVerificationResult && companyVerificationResult;\n return isCompanySubjectToOnboarding && !isUserAndCompanyVerified;\n }\n);\n\nconst isKybSubmittingUserHack = ko.observable>(undefined);\n\nexport const isKybSubmittingUser = combineResults(\n [companyVerification, isKybSubmittingUserHack] as const,\n (companyVerificationResult, hack) => {\n if (hack) {\n return hack;\n }\n return companyVerificationResult?.submittedByUserId === UserService.UserId();\n },\n { write: isKybSubmittingUserHack }\n);\n\nexport const isUbo = combineResults(\n [ownershipInformation],\n (ownershipInformationResult) =>\n ownershipInformationResult?.some(\n (owner) => owner.email?.toLowerCase() === UserService.profile()?.email().toLowerCase()\n ) ?? false\n);\n\nexport const isKycStep = combineResults(\n [\n companyVerificationCompleted,\n companyVerificationInProgress,\n isUbo,\n userVerification,\n userVerificationFailed,\n userVerificationCompleted,\n userVerificationInProgress,\n ],\n (\n isCompanyVerificationCompleted,\n isCompanyVerificationInProgress,\n isUserUbo,\n userVerificationResult: VerificationStatusIdentityViewModel,\n hasUserVerificationFailed,\n isUserVerificationCompleted,\n isUserVerificationInProgress\n ) => {\n const isCompanyVerificationCompletedOrInProgress =\n isCompanyVerificationCompleted || isCompanyVerificationInProgress;\n const isUboUserVerificationIncomplete = !(\n hasUserVerificationFailed ||\n userVerificationResult?.isIdentitySubmitted ||\n userVerificationResult?.isIdentityVerified\n );\n const isNonUboUserVerificationIncomplete = !(\n hasUserVerificationFailed ||\n isUserVerificationCompleted ||\n isUserVerificationInProgress\n );\n return (\n isCompanyVerificationCompletedOrInProgress &&\n (isUserUbo ? isUboUserVerificationIncomplete : isNonUboUserVerificationIncomplete)\n );\n }\n);\n","import { useContext } from 'react';\nimport { useQuery } from '@tanstack/react-query';\n\nimport { ApiService } from '@/features/api';\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as CompanyService } from '@/legacy/services/company';\nimport CompanyContext from '@/providers/CompanyContext';\n\nenum VerificationStatus {\n Pending = 'PENDING',\n Processing = 'PROCESSING',\n Completed = 'COMPLETED',\n Rejected = 'REJECTED',\n}\n\ninterface OwnershipVerificationModel {\n id: string;\n verificationStatus: VerificationStatus;\n notificationFirstSentDate: string | null;\n nonComplianceDateDeadline: string | null;\n personaInquiryId: string | null;\n}\n\nexport const useOwnershipVerification = () => {\n const { companyId } = useContext(CompanyContext);\n\n const profile = useSyncKoObservable(CompanyService.profile);\n const isSubjectToPersonaOnboarding = useSyncKoObservable(profile?.isSubjectToPersonaOnboarding);\n\n const {\n data: ownershipVerification,\n isInitialLoading,\n isError,\n } = useQuery({\n queryFn: () =>\n ApiService.get(\n `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/verifications/company/${companyId}/ownership`\n ),\n queryKey: ['verifications', 'company', companyId, 'ownership'],\n // companies which are subject to Persona onboarding will never go through\n // the ownership verification flow, so don't call the ownership endpoint.\n enabled: isSubjectToPersonaOnboarding === false,\n });\n\n const isOwnershipVerificationRequired =\n !isInitialLoading && !isError\n ? Boolean(ownershipVerification?.notificationFirstSentDate) &&\n ownershipVerification?.verificationStatus === VerificationStatus.Pending\n : null;\n\n return {\n isInitialLoading,\n isOwnershipVerificationRequired,\n personaInquiryId: ownershipVerification?.personaInquiryId,\n };\n};\n","import { useCallback } from 'react';\n\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { OwnerInformation } from '@/legacy/components/user/onboardingWizard/company/ownershipInformation/model/OwnerInformation';\nimport {\n CompanyOutstandingVerificationItemsViewModel,\n OnboardingWizardStatusViewModel,\n Status,\n VerificationStatus,\n VerificationStatusIdentityViewModel,\n} from '@/legacy/services/verification/verification';\n\nimport { VerificationProgress } from '../types';\nimport {\n isKybSubmittingUser as isKybSubmittingUserObservable,\n isKycStep as isKycStepObservable,\n isUbo as isUboObservable,\n} from '../utils/availability';\nimport {\n allVerificationResults as allResults,\n bankAccountVerificationCompleted as bankAccountVerificationCompletedObservable,\n bankAccountVerificationInProgress as bankAccountVerificationInProgressObservable,\n bankAccountVerificationNotStarted as bankAccountVerificationNotStartedObservable,\n bankAccountVerificationProgress as bankAccountVerificationProgressObservable,\n companyVerificationStatus as companyVerificationStatusObservable,\n testPaymentMade as testPaymentMadeObservable,\n userVerificationProgress as userVerificationProgressObservable,\n} from '../verification';\n\nexport type VerificationActions = {\n setCompanyOnboardingStatus: (status: Status) => void;\n setIsKybSubmittingUser: (isSubmitting: boolean) => void;\n setUserVerificationSubmitted: (isSubmitted: boolean) => void;\n};\n\nexport type VerificationState = {\n additionalVerificationItems: CompanyOutstandingVerificationItemsViewModel;\n bankAccountVerificationCompleted: boolean;\n bankAccountVerificationInProgress: boolean;\n bankAccountVerificationNotStarted: boolean;\n bankAccountVerificationProgress: VerificationProgress;\n companyVerification: VerificationStatus;\n companyVerificationCompleted: boolean;\n companyVerificationInProgress: boolean;\n companyVerificationNotStarted: boolean;\n companyVerificationProgress: VerificationProgress;\n /**\n * Raw backend status for company verification. Please refer to @see {@link Status} for more\n * information.\n */\n companyVerificationStatus: Status;\n error: unknown;\n isKybSubmittingUser: boolean;\n isKycStep: boolean;\n isLoading: boolean;\n isUbo: boolean;\n ownershipInformation: Array;\n testPaymentMade: boolean;\n userVerification: VerificationStatusIdentityViewModel;\n userVerificationCompleted: boolean;\n userVerificationInProgress: boolean;\n userVerificationNotStarted: boolean;\n userVerificationProgress: VerificationProgress;\n /**\n * Raw backend status for user verification. Please refer to @see {@link Status} for more\n * information.\n */\n userVerificationStatus: Status;\n verification: OnboardingWizardStatusViewModel;\n verificationCompleted: boolean;\n verificationFailed: boolean;\n verificationInProgress: boolean;\n};\n\nexport function useVerification(): [VerificationState, VerificationActions] {\n const bankAccountVerificationCompleted = useSyncKoObservable(\n bankAccountVerificationCompletedObservable\n );\n const bankAccountVerificationInProgress = useSyncKoObservable(\n bankAccountVerificationInProgressObservable\n );\n const bankAccountVerificationNotStarted = useSyncKoObservable(\n bankAccountVerificationNotStartedObservable\n );\n const bankAccountVerificationProgress = useSyncKoObservable(\n bankAccountVerificationProgressObservable\n );\n const testPaymentMade = useSyncKoObservable(testPaymentMadeObservable);\n const {\n data: {\n additionalVerificationItems,\n companyVerification,\n companyVerificationCompleted,\n companyVerificationInProgress,\n companyVerificationNotStarted,\n companyVerificationProgress,\n companyVerificationStatus,\n ownershipInformation,\n userVerification,\n userVerificationCompleted,\n userVerificationInProgress,\n userVerificationNotStarted,\n userVerificationProgress,\n userVerificationStatus,\n verification,\n verificationCompleted,\n verificationFailed,\n verificationInProgress,\n },\n error,\n isLoading,\n } = useSyncKoObservable(allResults);\n const {\n data: isKybSubmittingUser,\n error: isKybSubmittingUserError,\n isLoading: isKybSubmittingUserLoading,\n } = useSyncKoObservable(isKybSubmittingUserObservable);\n const {\n data: isUbo,\n error: isUboError,\n isLoading: isUboLoading,\n } = useSyncKoObservable(isUboObservable);\n const {\n data: isKycStep,\n error: isKycStepError,\n isLoading: isKycStepLoading,\n } = useSyncKoObservable(isKycStepObservable);\n const setCompanyOnboardingStatus = useCallback((status: Status) => {\n companyVerificationStatusObservable({ data: status, error: null, isLoading: false });\n }, []);\n const setIsKybSubmittingUser = useCallback((isSubmitting: boolean) => {\n isKybSubmittingUserObservable({ data: isSubmitting, error: null, isLoading: false });\n }, []);\n const setUserVerificationSubmitted = useCallback((isSubmitted: boolean) => {\n userVerificationProgressObservable({\n data: isSubmitted ? 'in-progress' : 'not-started',\n error: null,\n isLoading: false,\n });\n }, []);\n return [\n {\n additionalVerificationItems,\n bankAccountVerificationCompleted,\n bankAccountVerificationInProgress,\n bankAccountVerificationNotStarted,\n bankAccountVerificationProgress,\n companyVerification,\n companyVerificationCompleted,\n companyVerificationInProgress,\n companyVerificationNotStarted,\n companyVerificationProgress,\n companyVerificationStatus,\n error: error || isKybSubmittingUserError || isKycStepError || isUboError,\n isKybSubmittingUser,\n isKycStep,\n isLoading: isLoading || isKybSubmittingUserLoading || isKycStepLoading || isUboLoading,\n isUbo,\n ownershipInformation,\n testPaymentMade,\n userVerification,\n userVerificationCompleted,\n userVerificationInProgress,\n userVerificationNotStarted,\n userVerificationProgress,\n userVerificationStatus,\n verification,\n verificationCompleted,\n verificationFailed,\n verificationInProgress,\n },\n {\n setCompanyOnboardingStatus,\n setIsKybSubmittingUser,\n setUserVerificationSubmitted,\n },\n ];\n}\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport app from 'durandal/app';\nimport { Box, CircularProgress, DialogContent, DialogTitle, styled } from '@mui/material';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { noop } from 'lodash-es';\nimport { useConfirm } from 'material-ui-confirm';\nimport { Inquiry } from 'persona';\nimport { InquiryAttributes } from 'persona/dist/lib/interfaces';\n\nimport Dialog from '@/components/dialogs/Dialog';\nimport { ApiService } from '@/features/api';\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as companyService } from '@/legacy/services/company';\nimport { Instance as userService } from '@/legacy/services/user';\nimport {\n Instance as verificationService,\n PersonaVerificationResponse,\n} from '@/legacy/services/verification/verification';\n\nimport { useOwnershipVerification } from '../hooks/useOwnershipVerification';\nimport { useVerification } from '../hooks/useVerification';\n\ntype PersonaVerificationBindingModel = {\n companyInformation?: {\n address: {\n address: string;\n city: string;\n country: string;\n state: string;\n suite: string;\n zipCode: string;\n };\n businessUrl: string;\n companyId: string;\n corporationType: string;\n name: string;\n operatingName: string;\n };\n userInformation: {\n userId: string;\n companyId: string;\n /**\n * Only used for KYB\n */\n isCompanyOwner?: boolean;\n };\n};\n\nfunction isSubmitterCompanyOwner(fields: InquiryAttributes): boolean {\n const isSoleProp = fields['entity-type']?.value === 'Sole Prop';\n const isFormFillerOwner = fields['form-filler-is-also-owner']?.value ?? false;\n return isSoleProp || isFormFillerOwner;\n}\n\nfunction mapPersonaCorporationType(corporationType: string): string {\n if (!corporationType) {\n return '';\n }\n const corporationTypeMap: { [key: string]: string } = {\n 'Sole Prop': 'Sole Proprietorship',\n Corporation: 'Business Corporation',\n 'LLC/Etc': 'Condominium Corporation',\n Charity: 'Nonprofit or Charity (Registered)',\n };\n return corporationTypeMap[corporationType] || '';\n}\n\nfunction mapToPersonaVerificationBindingModel(\n fields: InquiryAttributes,\n companyId: string,\n userId: string,\n isKyc: boolean\n): PersonaVerificationBindingModel {\n if (isKyc) {\n return {\n userInformation: {\n userId,\n companyId,\n },\n };\n }\n return {\n companyInformation: {\n companyId,\n name: fields['business-name']?.value,\n operatingName: fields['operating-business-name']?.value,\n corporationType: mapPersonaCorporationType(fields['entity-type']?.value),\n businessUrl: fields['company-website']?.value,\n address: {\n address: fields['business-registered-address-street-1']?.value,\n city: fields['business-registered-address-city']?.value,\n country: fields['business-registered-address-country-code']?.value,\n state: fields['business-registered-address-subdivision']?.value,\n suite: '',\n zipCode: fields['business-registered-address-postal-code']?.value,\n },\n },\n userInformation: {\n userId,\n companyId,\n isCompanyOwner: isSubmitterCompanyOwner(fields),\n },\n };\n}\n\nconst PersonaFlowContainer = styled(Box)(({ theme }) => ({\n '& > iframe': {\n minHeight: '720px',\n minWidth: '400px',\n },\n [theme.breakpoints.down('sm')]: {\n '& > iframe': {\n minWidth: '300px',\n },\n },\n}));\n\ntype InquiryDialogProps = {\n isOpen: boolean;\n onClose: () => void;\n onSuccess?: () => void;\n trackVerificationCancelled?: (inquiryId: string, referenceId: string) => void;\n trackVerificationInitiated?: (inquiryId: string, referenceId: string) => void;\n trackVerificationSubmitted?: (inquiryId: string, referenceId: string) => void;\n};\n\nexport const InquiryDialog = ({\n isOpen,\n onClose,\n onSuccess,\n trackVerificationCancelled,\n trackVerificationInitiated,\n trackVerificationSubmitted,\n}: InquiryDialogProps) => {\n const queryClient = useQueryClient();\n const confirm = useConfirm();\n const companyId = useSyncKoObservable(companyService.CompanyId);\n const companyProfile = useSyncKoObservable(companyService.profile);\n const userId = useSyncKoObservable(userService.UserId);\n const userProfile = useSyncKoObservable(userService.profile);\n const [\n {\n companyVerificationCompleted,\n companyVerificationInProgress,\n isKycStep,\n isLoading: isVerificationLoading,\n isUbo,\n userVerification,\n },\n { setCompanyOnboardingStatus, setIsKybSubmittingUser, setUserVerificationSubmitted },\n ] = useVerification();\n const {\n isInitialLoading: isOwnershipVerificationInitialLoading,\n isOwnershipVerificationRequired,\n personaInquiryId: ownershipVerificationPersonaInquiryId,\n } = useOwnershipVerification();\n\n let referenceType = 'kyb';\n if (isOwnershipVerificationRequired) {\n referenceType = 'cov';\n } else if (companyVerificationCompleted || companyVerificationInProgress) {\n referenceType = 'kyc';\n }\n const referenceId = `${referenceType}:${companyId}:${userId}`;\n const { data: companyPersonaMetadata, isFetching: isCompanyPersonaMetadataLoading } = useQuery({\n enabled: isUbo,\n queryFn: async () =>\n ApiService.get<{ caseId: string }>(\n `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/companies/${companyId}/companyPersonaMetadata`\n ),\n queryKey: ['companies', companyId, 'companyPersonaMetadata'],\n });\n let existingInquiryId: string | null | undefined;\n try {\n existingInquiryId =\n userVerification?.personaInquiryId ||\n ownershipVerificationPersonaInquiryId ||\n localStorage.getItem(referenceId);\n } catch (_) {\n // Ignore error\n }\n const templateInfo = useMemo(() => {\n // Template ID/Version should not be passed if inquiryId is provided\n // https://docs.withpersona.com/docs/embedded-flow-parameters#resuming-existing-inquiries\n if (existingInquiryId) {\n return null;\n }\n if (isOwnershipVerificationRequired) {\n return {\n templateId: import.meta.env.PERSONA_OWNERSHIP_TEMPLATE_ID,\n templateVersionId: import.meta.env.PERSONA_OWNERSHIP_TEMPLATE_VERSION_ID,\n };\n }\n if (isKycStep) {\n return {\n templateId: import.meta.env.PERSONA_KYC_TEMPLATE_ID,\n templateVersionId: import.meta.env.PERSONA_KYC_TEMPLATE_VERSION_ID,\n };\n }\n return {\n templateId: import.meta.env.PERSONA_GET_STARTED_TEMPLATE_ID,\n templateVersionId: import.meta.env.PERSONA_GET_STARTED_TEMPLATE_VERSION_ID,\n };\n }, [existingInquiryId, isKycStep, isOwnershipVerificationRequired]);\n const prefilledPersonaFields = useMemo(() => {\n const caseId = companyPersonaMetadata?.caseId;\n const res = caseId ? { kyb_case_id: caseId } : {};\n if (isOwnershipVerificationRequired) {\n return {\n ...res,\n form_submitter_id: userId,\n };\n }\n if (isKycStep) {\n return caseId ? res : undefined;\n }\n return {\n ...res,\n email_address: userProfile.email(), // Business/work email address\n form_filler_email_address: userProfile.email(), // User's email address\n business_name: companyProfile.name(),\n business_physical_address_country_code: companyProfile.country(),\n name_first: userProfile.firstName(),\n name_last: userProfile.lastName(),\n phone_number: companyProfile.businessPhone(),\n };\n }, [\n companyPersonaMetadata?.caseId,\n companyProfile,\n isKycStep,\n userProfile,\n isOwnershipVerificationRequired,\n userId,\n ]);\n\n const onSuccessfulOwnershipSubmission = useCallback(() => {\n onSuccess?.();\n trackVerificationSubmitted?.(existingInquiryId ?? '', referenceId);\n queryClient.invalidateQueries({ queryKey: ['companies', companyId, 'onboarding', 'status'] });\n queryClient.invalidateQueries({\n queryKey: ['companies', companyId, 'verification', 'outstandingVerificationItems'],\n });\n\n app.trigger('onboarding:company:updated');\n app.trigger('onboarding:identity:updated');\n\n try {\n localStorage.removeItem(referenceId);\n } catch (_) {\n // Ignore error\n }\n\n onClose();\n }, [\n companyId,\n existingInquiryId,\n onClose,\n onSuccess,\n queryClient,\n referenceId,\n trackVerificationSubmitted,\n ]);\n\n const onSuccessfulPersonaSubmission = useCallback(\n (result: PersonaVerificationResponse): void => {\n onSuccess?.();\n if (result.companyVerification) {\n setIsKybSubmittingUser(true);\n setCompanyOnboardingStatus(result.companyVerification.status);\n }\n if (result.userVerification) {\n setUserVerificationSubmitted(true);\n }\n trackVerificationSubmitted?.(existingInquiryId ?? '', referenceId);\n queryClient.invalidateQueries({ queryKey: ['companies', companyId, 'onboarding', 'status'] });\n queryClient.invalidateQueries({\n queryKey: ['companies', companyId, 'verification', 'outstandingVerificationItems'],\n });\n app.trigger('onboarding:company:updated');\n app.trigger('onboarding:identity:updated');\n try {\n localStorage.removeItem(referenceId);\n } catch (_) {\n // Ignore error\n }\n onClose();\n },\n [\n companyId,\n existingInquiryId,\n onClose,\n onSuccess,\n queryClient,\n referenceId,\n setCompanyOnboardingStatus,\n setIsKybSubmittingUser,\n setUserVerificationSubmitted,\n trackVerificationSubmitted,\n ]\n );\n const onUnsuccessfulSubmission = useCallback(\n (error: any): void => {\n const errorMessage = error?.message ?? error?.type;\n confirm({\n description: errorMessage ? (\n \n ) : (\n \n ),\n hideCancelButton: true,\n title: ,\n }).catch(noop);\n },\n [confirm]\n );\n\n const { mutate: submitOwnershipVerification, isSuccess: hasCompletedOwnershipVerification } =\n useMutation({\n mutationFn: verificationService.postOwnershipVerification,\n onError: onUnsuccessfulSubmission,\n onSuccess: onSuccessfulOwnershipSubmission,\n });\n\n const { mutate: submitPersonaVerification, isSuccess: hasCompletedPersonaVerification } =\n useMutation({\n mutationFn: verificationService.postPersonaVerification,\n onError: onUnsuccessfulSubmission,\n onSuccess: onSuccessfulPersonaSubmission,\n });\n\n const { data: inquirySession, isFetching: isInquirySessionLoading } = useQuery({\n enabled:\n Boolean(existingInquiryId) &&\n (!hasCompletedPersonaVerification || !hasCompletedOwnershipVerification),\n queryFn: async () =>\n ApiService.post<{ sessionToken: string }>(\n `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/companies/${companyId}/resumePersonaInquiry/${existingInquiryId}`\n ),\n queryKey: ['companies', companyId, 'resumePersonaInquiry', existingInquiryId],\n });\n\n const handleComplete = useCallback(\n ({ fields }) => {\n if (isOwnershipVerificationRequired) {\n return submitOwnershipVerification(companyId);\n }\n\n const bindingModel = mapToPersonaVerificationBindingModel(\n fields,\n companyId,\n userId,\n isKycStep\n );\n return submitPersonaVerification(bindingModel);\n },\n [\n companyId,\n isKycStep,\n isOwnershipVerificationRequired,\n submitOwnershipVerification,\n submitPersonaVerification,\n userId,\n ]\n );\n const handleEvent = useCallback(\n (name: string, metadata: Record): void => {\n // [PLP-37416][PLP-37281] Keep session alive when user interacts with Persona flow. It can\n // take a pretty long time to complete the Persona flow, so we need to keep the session alive.\n // While they are in the iframe, our frame does not receive the window events we use to detect\n // user activity (blur, mousemove, etc.).\n app.trigger('user:keepSessionAlive');\n if (\n name === 'start' &&\n typeof metadata.inquiryId === 'string' &&\n metadata.inquiryId &&\n !existingInquiryId\n ) {\n trackVerificationInitiated?.(existingInquiryId ?? metadata.inquiryId, referenceId);\n try {\n localStorage.setItem(referenceId, metadata.inquiryId);\n } catch (_) {\n // Ignore error\n }\n }\n },\n [existingInquiryId, referenceId, trackVerificationInitiated]\n );\n const handleCancel = useCallback((): void => {\n trackVerificationCancelled?.(existingInquiryId ?? '', referenceId);\n }, [existingInquiryId, referenceId, trackVerificationCancelled]);\n const handleDialogClose = useCallback((): void => {\n if (\n (!hasCompletedPersonaVerification || !hasCompletedOwnershipVerification) &&\n trackVerificationCancelled\n ) {\n trackVerificationCancelled(existingInquiryId ?? '', referenceId);\n }\n onClose();\n }, [\n existingInquiryId,\n hasCompletedOwnershipVerification,\n hasCompletedPersonaVerification,\n onClose,\n referenceId,\n trackVerificationCancelled,\n ]);\n const isLoading =\n isVerificationLoading ||\n isOwnershipVerificationInitialLoading ||\n isCompanyPersonaMetadataLoading ||\n isInquirySessionLoading;\n return (\n \n \n \n \n \n {isLoading ? (\n \n \n \n ) : (\n \n \n \n )}\n \n \n );\n};\n","import { ApiService } from '@/features/api';\n\nexport type VerifyResponse = {\n status: 'pending' | 'verified';\n valid: boolean;\n};\n\nexport const phoneVerificationService = {\n /**\n * Sends an SMS to the provided phone number. Phone number must be in E.164 format. Only `+1` is\n * supported.\n * @param phoneNumber The phone number to send the SMS to.\n */\n sendCode: async (phoneNumber: string): Promise =>\n ApiService.post(`${import.meta.env.APP_URLS_API_URL}/v1/users/verification/phone`, {\n body: { phoneNumber },\n }),\n verify: async (code: string, phoneNumber: string): Promise =>\n ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/users/verification/phone/verificationToken`,\n {\n body: { code, phoneNumber },\n }\n ),\n} as const;\n","export function validatePhoneNumber(phoneNumber: string): boolean {\n if (phoneNumber.match(/[a-zA-Z]/)) {\n return false;\n }\n const onlyNumbers = phoneNumber.replace(/\\D/g, '');\n return onlyNumbers.length === 10 || (onlyNumbers[0] === '1' && onlyNumbers.length === 11);\n}\n","import { FormattedMessage } from 'react-intl';\nimport { Card, Stack, Typography } from '@mui/material';\n\nexport type StepProps = {\n children: React.ReactNode;\n};\n\nexport const Step = ({ children }: StepProps): React.JSX.Element => (\n \n \n \n \n \n \n \n \n \n \n \n \n {children}\n \n \n \n);\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport Person from '@mui/icons-material/Person';\nimport SecurityUpdateGoodOutlined from '@mui/icons-material/SecurityUpdateGoodOutlined';\nimport { Stack, Typography } from '@mui/material';\nimport { Field, Form, FormikHelpers, FormikProvider, useFormik } from 'formik';\nimport { TextField } from 'formik-mui';\nimport { object, string } from 'yup';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport { SessionTimeoutService } from '@/legacy/services/sessionTimeout';\n\nimport { validatePhoneNumber } from '../../utils/validatePhoneNumber';\n\nimport { Step } from './Step';\n\nexport type EnterPhoneNumberProps = {\n onComplete: (phoneNumber: string) => void;\n onSendSms: (phoneNumber: string) => Promise;\n};\n\nexport const EnterPhoneNumber = ({\n onComplete,\n onSendSms,\n}: EnterPhoneNumberProps): React.JSX.Element => {\n const { formatMessage } = useIntl();\n const validationSchema = useMemo(\n () =>\n object({\n phoneNumber: string()\n .required(formatMessage({ defaultMessage: 'Please enter a phone number' }))\n .test(\n 'is-valid-phone-number',\n formatMessage({ defaultMessage: 'Please enter a valid phone number' }),\n validatePhoneNumber\n ),\n }),\n [formatMessage]\n );\n const onSubmit = useCallback(\n async (\n data: { phoneNumber: string },\n { setFieldError }: FormikHelpers<{ phoneNumber: string }>\n ): Promise => {\n try {\n let formattedNumber = data.phoneNumber.replace(/\\D/g, '');\n switch (formattedNumber.substring(0, 2)) {\n case '+1':\n break;\n case '1':\n formattedNumber = `+${formattedNumber}`;\n break;\n default:\n formattedNumber = `+1${formattedNumber}`;\n break;\n }\n await onSendSms(formattedNumber);\n onComplete(formattedNumber);\n } catch (error) {\n if (error.type === 'invalid.session') {\n await SessionTimeoutService.showTimeout();\n return;\n }\n if (error.type === 'invalid.parameter') {\n setFieldError('phoneNumber', formatMessage({ defaultMessage: 'Invalid phone number' }));\n }\n const message = error.message\n ? formatMessage(\n { defaultMessage: 'Unable to send SMS: {errorMessage}' },\n { errorMessage: error.message }\n )\n : formatMessage({ defaultMessage: 'Unable to send SMS' });\n setFieldError('phoneNumber', message);\n }\n },\n [formatMessage, onComplete, onSendSms]\n );\n const formik = useFormik({ initialValues: { phoneNumber: '' }, onSubmit, validationSchema });\n const { isSubmitting } = formik;\n return (\n \n \n \n \n \n \n
\n \n }\n name=\"phoneNumber\"\n sx={{ maxWidth: 300 }}\n type=\"tel\"\n />\n \n \n \n \n \n \n \n
\n
\n
\n );\n};\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport CheckCircle from '@mui/icons-material/CheckCircle';\nimport Person from '@mui/icons-material/Person';\nimport { Link, Typography } from '@mui/material';\nimport { Stack } from '@mui/system';\nimport { Field, Form, FormikHelpers, FormikProvider, useFormik } from 'formik';\nimport { TextField } from 'formik-mui';\nimport { object, string } from 'yup';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport { SessionTimeoutService } from '@/legacy/services/sessionTimeout';\n\nimport { phoneVerificationService, VerifyResponse } from '../../services/phoneVerification';\n\nimport { Step } from './Step';\n\nexport type EnterVerificationCodeRendererProps = {\n lastPhoneDigits: string;\n onComplete: () => void;\n onResendCode: () => Promise;\n onVerifyCode: (verificationCode: string) => Promise;\n};\n\nexport const EnterVerificationCodeRenderer = ({\n lastPhoneDigits,\n onComplete,\n onResendCode,\n onVerifyCode,\n}: EnterVerificationCodeRendererProps) => {\n const { formatMessage } = useIntl();\n const validationSchema = useMemo(\n () =>\n object({\n verificationCode: string()\n .required(formatMessage({ defaultMessage: 'Please enter a verification code' }))\n .length(6, formatMessage({ defaultMessage: 'Verification code must be 6 digits' })),\n }),\n [formatMessage]\n );\n const onSubmit = useCallback(\n async (\n data: { verificationCode: string },\n { setFieldError }: FormikHelpers<{ verificationCode: string }>\n ): Promise => {\n try {\n const result = await onVerifyCode(data.verificationCode);\n if (!result.valid) {\n setFieldError(\n 'verificationCode',\n formatMessage({ defaultMessage: 'The code you have entered is incorrect' })\n );\n } else {\n onComplete();\n }\n } catch (error) {\n if (error.type === 'invalid.authentication') {\n await SessionTimeoutService.showTimeout();\n return;\n }\n const message = error.message\n ? formatMessage(\n {\n defaultMessage: 'Unable to verify code: {errorMessage}',\n },\n { errorMessage: error.message }\n )\n : formatMessage({ defaultMessage: 'Unable to verify code' });\n setFieldError('verificationCode', message);\n }\n },\n [formatMessage, onComplete, onVerifyCode]\n );\n const formik = useFormik({ initialValues: { verificationCode: '' }, onSubmit, validationSchema });\n const { isSubmitting } = formik;\n return (\n \n \n \n \n \n \n
\n \n }\n name=\"verificationCode\"\n sx={{ maxWidth: 300 }}\n type=\"text\"\n />\n \n \n \n \n \n \n \n
\n
\n \n \n \n \n {/* This is valid because MUI will render a button element */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n \n \n \n \n
\n );\n};\n\nexport type EnterVerificationCodeProps = {\n onComplete: () => Promise;\n onResendCode: () => Promise;\n phoneNumber: string;\n};\n\nexport const EnterVerificationCode = ({\n onComplete,\n onResendCode,\n phoneNumber,\n}: EnterVerificationCodeProps) => {\n const onVerifyCode = useCallback(\n async (code: string) => phoneVerificationService.verify(code, phoneNumber),\n [phoneNumber]\n );\n const lastPhoneDigits = useMemo(() => (phoneNumber ? phoneNumber.slice(-4) : ''), [phoneNumber]);\n return (\n \n );\n};\n","import { useMemo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Button, Card, Stack, Typography } from '@mui/material';\n\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { durandalRoutes } from '@/routes/durandal';\n\nexport const VerifyNumberSuccess = (): React.JSX.Element => {\n const totalAccountingFirmMemberships = useSyncKoObservable(userService.accountingFirmMemberships);\n const totalUserMemberships = useSyncKoObservable(userService.memberships);\n const buttonHref = useMemo(() => {\n const totalAccountingFirmMembershipsCount = totalAccountingFirmMemberships?.length ?? 0;\n const totalUserMembershipsCount = totalUserMemberships?.length ?? 0;\n const totalMembershipsCount = totalAccountingFirmMembershipsCount + totalUserMembershipsCount;\n if (totalMembershipsCount === 0) {\n return durandalRoutes.user.tutorials.companyInfo;\n }\n return durandalRoutes.user.dashboard.index;\n }, [totalAccountingFirmMemberships?.length, totalUserMemberships?.length]);\n return (\n \n \n \n \n \n \n \n \n );\n};\n","import { useCallback, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport router from 'plugins/router';\nimport { Button, Stack } from '@mui/material';\n\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { durandalRoutes } from '@/routes/durandal';\n\nimport { phoneVerificationService } from '../services/phoneVerification';\n\nimport { EnterPhoneNumber } from './steps/EnterPhoneNumber';\nimport { EnterVerificationCode } from './steps/EnterVerificationCode';\nimport { VerifyNumberSuccess } from './steps/VerifyNumberSuccess';\n\nexport const VerifyNumber = (): React.JSX.Element => {\n const userProfile = useSyncKoObservable(userService.profile);\n const isCompleted = useSyncKoObservable(userProfile.isSignupPhoneVerificationDone);\n const [step, setStep] = useState<'add' | 'success' | 'verify'>(isCompleted ? 'success' : 'add');\n const [phoneNumber, setPhoneNumber] = useState(null);\n const onCompleteEnterPhoneNumber = useCallback((addedPhoneNumber: string) => {\n setStep('verify');\n setPhoneNumber(addedPhoneNumber);\n }, []);\n const totalAccountingFirmMemberships = useSyncKoObservable(userService.accountingFirmMemberships);\n const totalUserMemberships = useSyncKoObservable(userService.memberships);\n const onCompleteEnterVerificationCode = useCallback(async () => {\n const totalAccountingFirmMembershipsCount = totalAccountingFirmMemberships?.length ?? 0;\n const totalUserMembershipsCount = totalUserMemberships?.length ?? 0;\n const totalMembershipsCount = totalAccountingFirmMembershipsCount + totalUserMembershipsCount;\n try {\n await userService.LoadProfile(); // Reload profile to update phoneVerification status.\n } catch (_err) {\n // ignore error\n }\n if (totalMembershipsCount === 0) {\n router.navigate(durandalRoutes.user.tutorials.companyInfo);\n } else {\n router.navigate(durandalRoutes.user.dashboard.index);\n }\n }, [totalAccountingFirmMemberships, totalUserMemberships]);\n const onSendSms = useCallback(\n async (addedPhoneNumber: string): Promise =>\n phoneVerificationService.sendCode(addedPhoneNumber),\n []\n );\n const onResendSms = useCallback(\n async (): Promise => phoneVerificationService.sendCode(phoneNumber),\n [phoneNumber]\n );\n const handleLogOut = useCallback(() => {\n userService.Logout();\n }, []);\n return (\n \n {step === 'add' ? (\n \n ) : null}\n {step === 'verify' ? (\n \n ) : null}\n {step === 'success' ? : null}\n \n \n );\n};\n","import { OwnerInformation } from '@/legacy/components/user/onboardingWizard/company/ownershipInformation/model/OwnerInformation';\nimport AuthFetchService from '@/legacy/services/authFetch';\nimport * as companyService from '@/legacy/services/company';\nimport { ErrorModel } from '@/legacy/utils/reactHelpers';\n\nclass OwnershipInformationService {\n public static async get(): Promise> {\n const companyId: string = companyService.Instance.CompanyId();\n const url = `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/company/${companyId}/owners`;\n const response = await AuthFetchService.httpGet(url);\n\n if (response.ok) {\n return response.json();\n }\n\n throw new Error(response.statusText);\n }\n\n public static async update(\n owners: Array\n ): Promise | ErrorModel> {\n const companyId: string = companyService.Instance.CompanyId();\n const url = `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/company/${companyId}/owners`;\n const response = await AuthFetchService.httpPut(url, JSON.stringify(owners));\n\n if (response.ok) {\n return response.json();\n }\n\n if (response.status === 400) {\n return Promise.reject(await response.json());\n }\n\n throw new Error(response.statusText);\n }\n}\n\nexport default OwnershipInformationService;\n","enum SmsCountry {\n CA = 'CA',\n US = 'US',\n}\n\nenum VerificationStep {\n SelectVerificationProvider = 'SelectVerificationProvider',\n EnterPhoneNumber = 'EnterPhoneNumber',\n EnterDisableSmsCode = 'EnterDisableSmsCode',\n EnterSmsCode = 'EnterSmsCode',\n OtpQrCode = 'OtpQrCode',\n ConfirmDisableOtpCode = 'ConfirmDisableOtpCode',\n ConfirmOtpCode = 'ConfirmOtpCode',\n SelectDisabler = 'SelectDisabler',\n}\n\nexport { SmsCountry, VerificationStep };\n","import { Dispatch } from 'react';\n\nimport { ApiError } from '@/features/api';\nimport TwoFactorAuthenticationService, {\n TwoFactorAuthentication,\n TwoFactorAuthenticationStatus,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport * as companyService from '@/legacy/services/company';\nimport { Instance as UserService } from '@/legacy/services/user';\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport Constants from '../shared/constants';\n\nimport { SmsCountry, VerificationStep } from './helper';\n\nenum ActionType {\n AddErrors = 'AddErrors',\n\n SetSteps = 'SetSteps',\n NextStep = 'NextStep',\n PreviousStep = 'PreviousStep',\n\n SetFormPhoneNumber = 'SetFormPhoneNumber',\n SetFormCountry = 'SetFormCountry',\n SetFormVerificationMethod = 'SetFormVerificationMethod',\n SetDisableVerificationMethod = 'SetDisableVerificationMethod',\n SetCode = 'SetCode',\n\n HandleFormFieldErrors = 'HandleFormFieldErrors',\n ShowDialog = 'ShowDialog',\n CloseDialog = 'CloseDialog',\n ShowFieldError = 'ShowFieldError',\n UnableToScan = 'UnableToScan',\n ResendSmsCode = 'ResendSmsCode',\n CallUser = 'CallUser',\n\n // Queries\n QuerySubmitPhoneNumber = 'QuerySubmitPhoneNumber',\n QuerySubmitTwoFactorStatus = 'QuerySubmitTwoFactorStatus',\n QuerySendDisableCode = 'QuerySendDisableCode',\n QueryGenerateOtp = 'QueryGenerateOtp',\n QueryCallSetupCode = 'QueryCallSetupCode',\n}\n\ninterface DialogProps {\n title: string;\n message: string;\n closeModal?: boolean;\n}\n\ninterface NewFieldError {\n fieldName: string;\n errorMessage: string;\n}\n\ninterface FieldError {\n errors: Array;\n name: string;\n}\n\ninterface StepperStep {\n blockBack?: boolean;\n isFinal?: boolean;\n step: VerificationStep;\n title: string;\n}\n\ninterface GenerateOtpResponse {\n secretKey: string;\n temporaryMfaSetupId: string;\n}\n\ninterface GenerateSmsResponse {\n temporaryMfaSetupId: string;\n}\n\ninterface State {\n isLoading: boolean;\n isEnabled: boolean;\n\n phoneNumber: string;\n smsCountry: SmsCountry;\n code: string;\n\n verificationMethod: TwoFactorAuthenticationType;\n verificationStep: number;\n\n steps: Array;\n\n queries: Array>;\n fieldErrors: Array;\n dialog: DialogProps | null;\n otpSecretKey: string | null;\n temporaryMfaSetupId: string | null;\n isUnableToScan: boolean;\n otpAccountName: string;\n\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n\n /**\n * If an existing method was selected\n */\n twoFactorAuthentication?: TwoFactorAuthentication;\n /**\n * If any exist (during new 2FA addition)\n */\n twoFactorAuthentications?: Array;\n isMaxNumberOfAuthMethodsReachedForCurrentType: boolean;\n}\n\nfunction reducer(state: State, action: Action): State {\n const { type, payload } = action;\n switch (type) {\n case ActionType.AddErrors:\n return {\n ...state,\n isLoading: false,\n };\n\n case ActionType.SetFormPhoneNumber: {\n const phoneNumber = (payload as string).replace(/[^0-9]+/g, ''); // Don't\n if (phoneNumber.length > 10) {\n // Max phone length\n return state;\n }\n\n // clear any field errors.\n const fieldErrors = state.fieldErrors.filter((e) => e.name !== 'phoneNumber');\n\n return {\n ...state,\n phoneNumber,\n fieldErrors,\n };\n }\n\n case ActionType.SetFormCountry:\n return {\n ...state,\n smsCountry: payload,\n };\n\n case ActionType.UnableToScan:\n return {\n ...state,\n isUnableToScan: true,\n };\n\n case ActionType.SetCode: {\n const code = (payload as string).replace(/[^0-9]+/g, '');\n if (code.length > 6) {\n // Max sms code length\n return state;\n }\n\n // clear any field errors.\n const fieldErrors = state.fieldErrors.filter((e) => e.name !== 'code');\n\n return {\n ...state,\n code,\n fieldErrors,\n };\n }\n\n case ActionType.SetFormVerificationMethod:\n return {\n ...state,\n verificationMethod: payload,\n isMaxNumberOfAuthMethodsReachedForCurrentType: isMaxNumberOfTwoFactorAuthReached(\n payload,\n state.twoFactorAuthentications\n ),\n };\n\n case ActionType.PreviousStep:\n return {\n ...state,\n verificationStep: state.verificationStep - 1,\n };\n\n case ActionType.NextStep: {\n const currentStep = state.steps[state.verificationStep];\n switch (currentStep.step) {\n case VerificationStep.SelectVerificationProvider: {\n if (state.verificationMethod !== TwoFactorAuthenticationType.Otp) {\n break;\n }\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QueryGenerateOtp,\n payload: {},\n },\n ],\n };\n }\n\n case VerificationStep.EnterPhoneNumber: {\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitPhoneNumber,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n },\n ],\n };\n }\n\n case VerificationStep.ConfirmOtpCode:\n case VerificationStep.EnterSmsCode: {\n /**\n * If we're disabling 2FA.\n */\n const { twoFactorAuthenticationDisabler, twoFactorAuthentication } = state;\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitTwoFactorStatus,\n payload: {\n code: state.code,\n temporaryMfaSetupId: state.temporaryMfaSetupId,\n type: state.verificationMethod,\n closeOnSuccess: currentStep.isFinal,\n /**\n * If we're disabling 2FA\n */\n twoFactorAuthentication: twoFactorAuthenticationDisabler,\n twoFactorAuthenticationIdToUpdate: twoFactorAuthentication?.id,\n },\n },\n ],\n };\n }\n\n case VerificationStep.ConfirmDisableOtpCode:\n case VerificationStep.EnterDisableSmsCode: {\n // @todo handle state change\n return {\n ...state,\n };\n }\n\n case VerificationStep.SelectDisabler:\n if (state.twoFactorAuthenticationDisabler.type === TwoFactorAuthenticationType.Otp) {\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n };\n }\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n },\n },\n ],\n };\n }\n\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n };\n }\n\n case ActionType.ResendSmsCode: {\n const query = state.isEnabled\n ? {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n },\n }\n : {\n type: ActionType.QuerySubmitPhoneNumber,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n };\n\n return {\n ...state,\n isLoading: true,\n queries: [query],\n };\n }\n\n case ActionType.CallUser: {\n const query = state.isEnabled\n ? {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n shouldCallUser: true,\n },\n }\n : {\n type: ActionType.QueryCallSetupCode,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n };\n\n return {\n ...state,\n queries: [query],\n };\n }\n\n case ActionType.SetSteps: {\n const newSteps = [];\n if (state.isEnabled && state.twoFactorAuthentications.length > 1) {\n newSteps.push({\n step: VerificationStep.SelectDisabler,\n title: 'Choose your Two-Step Provider to Disable Old Two-Step Provider',\n });\n }\n\n if (!state.isEnabled) {\n newSteps.push({\n step: VerificationStep.SelectVerificationProvider,\n title: `Choose Your ${state.isEnabled ? 'New ' : ''}Two-Step Provider`,\n blockBack: true,\n });\n\n const methodSpecificActivation =\n state.verificationMethod === TwoFactorAuthenticationType.Otp\n ? [\n { step: VerificationStep.OtpQrCode, title: 'Add to Authenticator (Scan QR Code)' },\n { step: VerificationStep.ConfirmOtpCode, title: 'Verify Authenticator' },\n ]\n : [\n { step: VerificationStep.EnterPhoneNumber, title: 'Enter Verification Details' },\n { step: VerificationStep.EnterSmsCode, title: 'Enter SMS Verification Code' },\n ];\n\n newSteps.push(...methodSpecificActivation);\n } else if (state.verificationMethod === TwoFactorAuthenticationType.Otp) {\n newSteps.push({ step: VerificationStep.ConfirmOtpCode, title: 'Enter Authenticator Code' });\n } else {\n newSteps.push({\n step: VerificationStep.EnterSmsCode,\n title: 'Enter SMS Verification Code',\n });\n }\n\n newSteps[newSteps.length - 1].isFinal = true;\n return {\n ...state,\n steps: newSteps,\n };\n }\n\n case ActionType.ShowDialog: {\n const dialog = payload as DialogProps;\n\n return {\n ...state,\n dialog,\n isLoading: false,\n };\n }\n\n case ActionType.CloseDialog:\n return {\n ...state,\n dialog: null,\n };\n\n case ActionType.ShowFieldError: {\n const { fieldName, errorMessage } = payload as NewFieldError;\n\n return {\n ...state,\n code: '', // Clear code\n isLoading: false,\n fieldErrors: [{ name: fieldName, errors: [errorMessage] }],\n };\n }\n\n case ActionType.HandleFormFieldErrors: {\n const { fields: fieldErrors } = payload;\n\n return {\n ...state,\n isLoading: false,\n fieldErrors,\n };\n }\n\n case ActionType.SetDisableVerificationMethod:\n return {\n ...state,\n twoFactorAuthenticationDisabler: payload,\n verificationMethod: payload.type,\n };\n\n // Handle Query responses\n case ActionType.QuerySubmitTwoFactorStatus:\n case ActionType.QuerySubmitPhoneNumber:\n case ActionType.QueryCallSetupCode:\n case ActionType.QuerySendDisableCode: {\n const queries = [];\n const nextStep = state.steps[state.verificationStep + 1];\n if (nextStep?.step === VerificationStep.EnterDisableSmsCode) {\n queries.push({ type: ActionType.QuerySendDisableCode });\n }\n\n const { temporaryMfaSetupId } = payload as GenerateSmsResponse;\n return {\n ...state,\n verificationStep: state.verificationStep + (nextStep ? 1 : 0),\n code: '',\n queries,\n isLoading: false,\n fieldErrors: [],\n temporaryMfaSetupId,\n };\n }\n\n case ActionType.QueryGenerateOtp: {\n const { secretKey, temporaryMfaSetupId } = payload as GenerateOtpResponse;\n\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n isLoading: false,\n otpSecretKey: secretKey,\n temporaryMfaSetupId,\n };\n }\n }\n\n return state;\n}\n\nasync function handleQueries(\n queries: Array>,\n dispatch: Dispatch>,\n onClose: { (close: boolean): void }\n): Promise {\n const handleError = (error: ApiError) => {\n if (error && error.type) {\n const getErrorDialog = (): DialogProps => {\n switch (error.type) {\n case 'invalid.code':\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: error.message,\n fieldName: 'code',\n } as NewFieldError,\n });\n return undefined;\n\n case 'invalid.status.enabled':\n return {\n title: 'Already enabled',\n message: 'This two-step authentication is already enabled.',\n closeModal: true,\n };\n\n case 'invalid.status.disabled':\n return {\n title: 'Is not enabled',\n message: 'You can only disable two-step authentications that are already enabled.',\n closeModal: true,\n };\n\n case 'invalid.switch.status.disabled':\n return {\n title: 'Is not enabled',\n message: 'You can only switch two-step authentications that are already enabled.',\n closeModal: true,\n };\n\n case 'invalid.switch.number.duplicate':\n return {\n title: 'Duplicate phone number',\n message: 'You can only switch the authentication to a new number.',\n closeModal: true,\n };\n\n case 'invalid.twoFactorForced':\n return {\n title: 'Two Factor is mandatory',\n message:\n 'You can not disable your two-step authentication because your company administrator has requested a mandatory two-step authentication.',\n closeModal: true,\n };\n\n case 'invalid.twoFactorCompliance':\n return {\n title: 'Two Factor is mandatory',\n message:\n \"You can not disable your two factor authentication because your account is required to have it enabled as per Plooto's security requirements.\",\n closeModal: true,\n };\n\n case 'duplicate.phone.generate.code':\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: error.message,\n fieldName: 'phoneNumber',\n } as NewFieldError,\n });\n return undefined;\n\n case 'duplicate.phone.add.mfa':\n return {\n title: 'Duplicate phone number',\n message:\n 'This phone number is already registered for multi-factor authentication via SMS.',\n closeModal: true,\n };\n\n case 'invalid.phoneCountry':\n return {\n title: 'Unsupported country',\n message: error.message,\n closeModal: true,\n };\n\n case 'rateLimit.smsSetup':\n return {\n title: 'Rate limit error',\n message:\n 'Only 5 codes for new device registration allowed per hour. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId':\n return {\n title: 'Invalid setup ID',\n message: 'Invalid MFA setup ID or it has expired. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.userId':\n return {\n title: 'Invalid user ID',\n message: 'Invalid user ID. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.isDeleted':\n return {\n title: 'An issue with this MFA setup',\n message: 'There was an issue with this MFA setup. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.deviceId':\n return {\n title: 'Invalid Cookie Settings',\n message:\n 'Your browser privacy settings must allow cookies to be set to enable Two Factor Authentication.',\n closeModal: true,\n };\n\n default: {\n return {\n title: 'Unexpected Error',\n message: `There was an error submitting your code. Please try again later. Error code: ${error.type}`,\n };\n }\n }\n };\n\n switch (error.type) {\n case 'invalid.parameter':\n dispatch({ type: ActionType.HandleFormFieldErrors, payload: error });\n return;\n\n default: {\n const errorDialog = getErrorDialog();\n if (errorDialog) {\n dispatch({ type: ActionType.ShowDialog, payload: errorDialog });\n }\n }\n }\n } else {\n const errorDialog: DialogProps = {\n title: 'Unexpected Error',\n message: 'There was an error submitting your code. Please try again later.',\n };\n // @todo log error to App Insights\n dispatch({ type: ActionType.ShowDialog, payload: errorDialog });\n }\n };\n\n queries.forEach(async (query) => {\n const { type, payload } = query;\n\n switch (type) {\n case ActionType.QuerySubmitPhoneNumber: {\n const { phoneCountry, phoneNumber } = payload;\n\n if (!phoneNumber) {\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: 'Phone Number is required',\n fieldName: 'phoneNumber',\n } as NewFieldError,\n });\n return;\n }\n\n try {\n const smsCodeResponse = await TwoFactorAuthenticationService.generateSmsCode({\n phoneCountry,\n phoneNumber,\n });\n dispatch({ type, payload: smsCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QueryCallSetupCode: {\n const { phoneCountry, phoneNumber } = payload;\n\n try {\n const smsCodeResponse = await TwoFactorAuthenticationService.generateSmsCode({\n phoneCountry,\n phoneNumber,\n shouldCallUser: true,\n });\n dispatch({ type, payload: smsCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QuerySubmitTwoFactorStatus: {\n const {\n code,\n temporaryMfaSetupId,\n type: mfaType,\n closeOnSuccess,\n twoFactorAuthentication,\n twoFactorAuthenticationIdToUpdate,\n } = payload;\n\n if (!code) {\n let errorMessage: string;\n switch (mfaType) {\n case TwoFactorAuthenticationType.Otp:\n errorMessage = 'Authenticator Code is required';\n break;\n case TwoFactorAuthenticationType.Sms:\n errorMessage = 'SMS Code is required';\n break;\n }\n\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage,\n fieldName: 'code',\n } as NewFieldError,\n });\n return;\n }\n\n try {\n if (!twoFactorAuthentication) {\n await TwoFactorAuthenticationService.addTwoFactorAuthentication({\n code,\n temporaryMfaSetupId,\n type: mfaType,\n });\n } else {\n await TwoFactorAuthenticationService.updateTwoFactorAuthentication(\n twoFactorAuthentication.id,\n {\n code,\n status: TwoFactorAuthenticationStatus.Disabled,\n twoFactorAuthenticationIdToUpdate,\n }\n );\n }\n\n if (closeOnSuccess) {\n onClose(true);\n } else {\n dispatch({ type });\n }\n } catch (e) {\n handleError(e);\n }\n\n break;\n }\n\n case ActionType.QuerySendDisableCode: {\n const { id } = payload.twoFactorAuthenticationDisabler as TwoFactorAuthentication;\n const { shouldCallUser } = payload;\n\n try {\n const smsSettings = await TwoFactorAuthenticationService.sendDisableCode(id, {\n shouldCallUser,\n });\n dispatch({ type, payload: smsSettings });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QueryGenerateOtp: {\n try {\n const otpCodeResponse = await TwoFactorAuthenticationService.generateOtpCode();\n dispatch({ type, payload: otpCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n }\n });\n}\n\ninterface StateInitialValues {\n twoFactorAuthentication: TwoFactorAuthentication | null;\n twoFactorAuthentications: Array | null;\n}\n\nconst isMaxNumberOfTwoFactorAuthReached = (\n twoFactorAuthenticationType: TwoFactorAuthenticationType,\n twoFactorAuthentications: Array\n) =>\n twoFactorAuthentications?.filter((tfa) => tfa.type === twoFactorAuthenticationType)?.length ===\n Constants.MAX_NUMBER_OF_2FAS_PER_TYPE;\n\nfunction getInitialState(initialValues: StateInitialValues): State {\n const { twoFactorAuthentication, twoFactorAuthentications } = initialValues;\n\n const queries = [];\n\n const isMaxNumberOfOtpTwoFactorAuthReached = isMaxNumberOfTwoFactorAuthReached(\n TwoFactorAuthenticationType.Otp,\n twoFactorAuthentications\n );\n\n const isMaxNumberOfSmsTwoFactorAuthReached = isMaxNumberOfTwoFactorAuthReached(\n TwoFactorAuthenticationType.Sms,\n twoFactorAuthentications\n );\n\n let verificationMethod: TwoFactorAuthenticationType;\n if (isMaxNumberOfOtpTwoFactorAuthReached) {\n verificationMethod = TwoFactorAuthenticationType.Sms;\n } else if (isMaxNumberOfSmsTwoFactorAuthReached) {\n verificationMethod = TwoFactorAuthenticationType.Otp;\n } else {\n verificationMethod = TwoFactorAuthenticationType.Otp;\n }\n\n let isMaxNumberOfAuthMethodsReachedForCurrentType;\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Otp:\n isMaxNumberOfAuthMethodsReachedForCurrentType = isMaxNumberOfOtpTwoFactorAuthReached;\n break;\n case TwoFactorAuthenticationType.Sms:\n isMaxNumberOfAuthMethodsReachedForCurrentType = isMaxNumberOfSmsTwoFactorAuthReached;\n break;\n }\n\n let twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n if (twoFactorAuthentication) {\n // Only 1 possible disable method.\n if (!twoFactorAuthentications.length || twoFactorAuthentications.length === 1) {\n twoFactorAuthenticationDisabler = twoFactorAuthentication;\n\n verificationMethod = twoFactorAuthenticationDisabler.type;\n\n if (twoFactorAuthenticationDisabler.type === TwoFactorAuthenticationType.Sms) {\n queries.push({\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler,\n },\n });\n }\n } else {\n [twoFactorAuthenticationDisabler] = twoFactorAuthentications;\n }\n }\n\n return {\n isLoading: false,\n isEnabled: !!twoFactorAuthentication,\n\n phoneNumber: '',\n smsCountry:\n companyService.Instance.CompanyCountry() === SmsCountry.CA ? SmsCountry.CA : SmsCountry.US,\n\n // Ensure we always have something filled in case 2FA was required and email couldn't be loaded.\n // We'll try their email, then their name, then their User ID, and then in the weird case where\n // we have nothing, the URL of the Plooto environment they signed up from (which should surely\n // never be used, but it will always be defined).\n otpAccountName:\n UserService.DisplayEmail() ||\n UserService.DisplayName() ||\n UserService.UserId() ||\n import.meta.env.APP_URLS_APP_URL,\n\n code: '',\n\n otpSecretKey: null,\n temporaryMfaSetupId: null,\n\n steps: [],\n\n verificationMethod,\n verificationStep: 0,\n\n queries,\n fieldErrors: [],\n dialog: null,\n isUnableToScan: false,\n twoFactorAuthentication, // Currently selected 2FA method\n twoFactorAuthentications, // Previously created 2FAs,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n twoFactorAuthenticationDisabler,\n };\n}\n\nexport { State, ActionType, getInitialState, handleQueries, reducer };\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Typography } from '@mui/material';\n\nimport { Strong } from '@/components/rich-text-formatting';\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n isEnabled?: boolean;\n phoneNumber: string;\n verificationMethod: TwoFactorAuthenticationType;\n}\n\nconst CodeMessage = (props: Props): React.JSX.Element => {\n const { isEnabled, phoneNumber, verificationMethod } = props;\n\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Sms:\n return (\n \n {isEnabled ? (\n DISABLE
your two-step authentication:\"\n values={{ Strong }}\n />\n ) : (\n {phoneNumber} . Enter this code in the field below to enable your two-step authentication:\"\n values={{ Strong, phoneNumber }}\n />\n )}\n \n );\n\n case TwoFactorAuthenticationType.Otp:\n return (\n \n {isEnabled ? (\n DISABLE your two-step authentication:\"\n values={{ Strong }}\n />\n ) : (\n \n )}\n \n );\n\n default:\n return null;\n }\n};\n\nexport default memo(CodeMessage);\n","import { ChangeEvent, memo } from 'react';\nimport { Box, FormControl, TextField } from '@mui/material';\n\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { getFieldError } from '@/legacy/utils/reactHelpers';\n\nimport SmsBackupOptions from '../shared/SmsBackupOptionsFragment';\n\nimport CodeMessage from './CodeMessageFragment';\n\ninterface FieldError {\n errors: Array;\n name: string;\n}\n\ninterface Props {\n code: string;\n fieldErrors: Array;\n isEnabled: boolean;\n isLoading: boolean;\n onCodeChange: { (e: ChangeEvent): void };\n onResendCode: () => void;\n onCallMe: () => void;\n phoneNumber: string;\n verificationMethod: TwoFactorAuthenticationType;\n}\n\nconst Code = (props: Props): React.JSX.Element => {\n const {\n code,\n fieldErrors,\n isEnabled,\n isLoading,\n onCodeChange,\n onResendCode,\n onCallMe,\n phoneNumber,\n verificationMethod,\n } = props;\n\n const getCodeLabel = () => {\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n };\n\n return (\n <>\n \n \n \n \n \n \n \n\n {verificationMethod === TwoFactorAuthenticationType.Sms && (\n \n )}\n \n \n );\n};\n\nexport default memo(Code);\n","import { ChangeEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n FormControl,\n FormHelperText,\n InputLabel,\n MenuItem,\n Select,\n Typography,\n} from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n errorMessage?: string;\n isLoading?: boolean;\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n}\n\nconst VerificationProvider = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n errorMessage = undefined,\n isLoading,\n onTwoFactorAuthenticationDisablerChange,\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n } = props;\n\n const handleVerificationChange = useCallback(\n (e: ChangeEvent) => {\n const newMethod = twoFactorAuthenticationDisablers.find(\n (method) => method.id === e.target.value\n );\n\n onTwoFactorAuthenticationDisablerChange(newMethod);\n },\n [onTwoFactorAuthenticationDisablerChange, twoFactorAuthenticationDisablers]\n );\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n\n \n {twoFactorAuthenticationDisablers.map((method) => (\n \n {method.displayName}\n \n ))}\n \n\n {errorMessage && {errorMessage}}\n \n \n \n );\n};\n\nexport default memo(VerificationProvider);\n","import { ChangeEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n FormControl,\n Grid,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport { SmsCountry } from './helper';\n\ninterface Props {\n isLoading?: boolean;\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onSmsCountryChange: {\n (e: ChangeEvent): void;\n };\n phoneNumber: string;\n phoneNumberErrorMessage: string;\n smsCountry: string;\n}\n\nconst SmsPhoneFragment = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n isLoading,\n onPhoneNumberChange,\n onSmsCountryChange,\n phoneNumber,\n phoneNumberErrorMessage,\n smsCountry,\n } = props;\n\n const SecondaryText = useCallback(\n (chunk) => (\n \n \n {chunk}\n \n \n ),\n []\n );\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n (+1)\"\n values={{\n SecondaryText,\n }}\n />\n \n\n \n (+1)\"\n values={{\n SecondaryText,\n }}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(SmsPhoneFragment);\n","import { Component, memo } from 'react';\nimport * as QRCode from 'qrcode';\n\ninterface Props {\n data: string;\n}\n\nclass QrCodeFragment extends Component {\n componentDidMount(): void {\n const { data } = this.props;\n\n const generateQRCode = (qrCodeData: string) => {\n QRCode.toCanvas(document.getElementById('qrCodeContainer'), qrCodeData, {}, (error) => {\n if (error) {\n console.error(error);\n }\n });\n };\n\n generateQRCode(data);\n }\n\n render(): React.JSX.Element {\n return (\n
\n \n
\n );\n }\n}\n\nexport default memo(QrCodeFragment);\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Button, Paper } from '@mui/material';\n\ninterface Props {\n isUnableToScan?: boolean;\n onUnableToScan: { (): void };\n otpSecretKey: string;\n}\n\nconst ScanCode = (props: Props): React.JSX.Element => {\n const { isUnableToScan, onUnableToScan, otpSecretKey } = props;\n\n if (isUnableToScan) {\n return (\n \n \n \n \n \n\n {otpSecretKey}\n \n \n );\n }\n\n return (\n \n );\n};\n\nexport default memo(ScanCode);\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Typography } from '@mui/material';\n\nimport QrCodeFragment from './QrCodeFragment';\nimport ScanCode from './ScanCodeFragment';\n\ninterface Props {\n isUnableToScan?: boolean;\n onUnableToScan: { (): void };\n otpSecretKey: string;\n otpAccountName: string;\n}\n\nconst UserOtpQrCodeFragment = (props: Props): React.JSX.Element => {\n const { isUnableToScan, onUnableToScan, otpSecretKey, otpAccountName: otpAccountNameRaw } = props;\n\n if (!otpSecretKey) {\n return null;\n }\n\n // This will show up as Plooto () in authenticator with the associated user email\n const otpAccountName = encodeURIComponent(otpAccountNameRaw);\n const qrCodeData = `otpauth://totp/Plooto:${otpAccountName}?secret=${otpSecretKey}&issuer=Plooto`;\n\n return (\n <>\n \n \n \n \n\n \n
    \n
  1. \n \n
  2. \n
  3. \n \n
  4. \n
  5. \n \n
  6. \n
\n
\n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(UserOtpQrCodeFragment);\n","import { ChangeEvent, memo, ReactNode, useCallback } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, MenuItem, TextField, Typography } from '@mui/material';\n\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n isLoading?: boolean;\n onVerificationMethodChange: {\n (e: ChangeEvent): void;\n };\n verificationMethod: TwoFactorAuthenticationType;\n isMaxNumberOfAuthMethodsReachedForCurrentType: boolean;\n}\n\nconst VerificationProvider = (props: Props): React.JSX.Element => {\n const {\n isLoading,\n onVerificationMethodChange,\n verificationMethod,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n } = props;\n\n const SecondaryText = useCallback(\n (chunk: ReactNode) => (\n \n {chunk}\n \n ),\n []\n );\n\n return (\n <>\n \n \n \n \n \n \n }\n autoFocus\n disabled={isLoading}\n error={isMaxNumberOfAuthMethodsReachedForCurrentType}\n helperText={\n isMaxNumberOfAuthMethodsReachedForCurrentType ? (\n \n ) : null\n }\n >\n \n (Recommended)\"\n values={{ SecondaryText }}\n />\n \n \n \n \n \n \n \n );\n};\n\nexport default memo(VerificationProvider);\n","import * as React from 'react';\nimport { ChangeEvent, memo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { Box, Button, Step, StepContent, StepLabel, Stepper, Typography } from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { getFieldError } from '@/legacy/utils/reactHelpers';\n\nimport Code from './CodeFragment';\nimport DisableVerification from './DisableVerificationFragment';\nimport { VerificationStep } from './helper';\nimport SmsPhoneFragment from './SmsPhoneFragment';\nimport { State } from './TwoFactorSetupDialog.reducer';\nimport UserOtpQrCodeFragment from './UserOtpQrCodeFragment';\nimport VerificationProvider from './VerificationProviderFragment';\n\ninterface Props {\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n state: State;\n onCodeChange: { (e: React.ChangeEvent): void };\n onNextStep: { (): void };\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onPreviousStep: { (): void };\n onSmsCountryChange: { (e: ChangeEvent): void };\n onVerificationChange: { (e: ChangeEvent): void };\n onUnableToScan: { (): void };\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst TwoFactorStepper = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n state,\n onCodeChange,\n onNextStep,\n onPhoneNumberChange,\n onPreviousStep,\n onSmsCountryChange,\n onVerificationChange,\n onUnableToScan,\n onTwoFactorAuthenticationDisablerChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const {\n code,\n fieldErrors,\n isEnabled,\n isLoading,\n isUnableToScan,\n otpSecretKey,\n phoneNumber,\n smsCountry,\n steps,\n verificationMethod,\n otpAccountName,\n twoFactorAuthentication,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n } = state;\n\n const currentStep = state.verificationStep;\n\n const getStepContent = (step: VerificationStep): React.JSX.Element => {\n switch (step) {\n case VerificationStep.SelectVerificationProvider:\n return (\n \n );\n\n case VerificationStep.EnterPhoneNumber:\n return (\n \n );\n\n case VerificationStep.EnterSmsCode:\n case VerificationStep.ConfirmOtpCode:\n case VerificationStep.EnterDisableSmsCode:\n case VerificationStep.ConfirmDisableOtpCode:\n return (\n \n );\n\n case VerificationStep.OtpQrCode:\n return (\n \n );\n\n case VerificationStep.SelectDisabler:\n return (\n \n );\n\n default:\n return null;\n }\n };\n\n return (\n \n {steps.map(({ step, title, blockBack }, stepIndex) => (\n \n {title}\n\n \n {getStepContent(step)}\n
\n
\n {currentStep !== 0 && (\n \n \n \n \n \n )}\n\n \n {stepIndex === steps.length - 1\n ? formatMessage({ defaultMessage: 'Finish' })\n : formatMessage({ defaultMessage: 'Continue' })}\n \n
\n
\n
\n
\n ))}\n
\n );\n};\n\nexport default memo(TwoFactorStepper);\n","import * as React from 'react';\nimport { ChangeEvent, FC, FormEvent, memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport TitleMessageDialog from '@/legacy/modals/react/TitleMessageDialog';\n\nimport { State } from './TwoFactorSetupDialog.reducer';\nimport TwoFactorStepper from './TwoFactorStepper';\n\ninterface Props {\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n state: State;\n isOpen: boolean;\n onSubmit: () => void;\n onClose: () => void;\n onCodeChange: { (e: React.ChangeEvent): void };\n onNextStep: { (): void };\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onPreviousStep: { (): void };\n onSmsCountryChange: { (e: ChangeEvent): void };\n onVerificationChange: { (e: ChangeEvent): void };\n onUnableToScan: { (): void };\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst TwoFactorSetupDialogContents: FC = (props: Props): React.JSX.Element => {\n const {\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n state,\n isOpen,\n onSubmit,\n onClose,\n onCodeChange,\n onNextStep,\n onPhoneNumberChange,\n onPreviousStep,\n onSmsCountryChange,\n onVerificationChange,\n onUnableToScan,\n onTwoFactorAuthenticationDisablerChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const handeClose = () => {\n onClose();\n };\n\n const getDialog = () => {\n const { dialog } = state;\n if (!dialog) {\n return null;\n }\n\n return (\n {\n handeClose();\n }}\n />\n );\n };\n\n const getDialogTitle = (): string => {\n if (state.isEnabled) {\n return 'Disable';\n }\n\n return 'Enable';\n };\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n onSubmit();\n\n return false;\n };\n\n // @todo These need to be updated once we remove React.ChangeEvent\n const handleCodeChange = onCodeChange;\n const handleNextStep = onNextStep;\n const handlePhoneNumberChange = onPhoneNumberChange;\n const handlePreviousStep = onPreviousStep;\n const handleSmsCountryChange = onSmsCountryChange;\n const handleVerificationChange = onVerificationChange;\n const handleUnableToScan = onUnableToScan;\n const handleResendCode = onResendCode;\n const handleCallMe = onCallMe;\n\n return (\n <>\n {getDialog()}\n \n \n \n \n\n \n \n
\n \n \n
\n
\n\n \n \n \n \n\n
\n\n \n \n \n \n );\n};\n\nexport default memo(TwoFactorSetupDialogContents);\n","import { ChangeEvent, FC, memo, useCallback, useEffect, useReducer } from 'react';\n\nimport {\n TwoFactorAuthentication,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport { SmsCountry } from './helper';\nimport {\n ActionType,\n getInitialState,\n handleQueries,\n reducer,\n State,\n} from './TwoFactorSetupDialog.reducer';\nimport TwoFactorSetupDialogContents from './TwoFactorSetupDialogContents';\n\ninterface Props {\n isOpen: boolean;\n onClose: { (isSuccess: boolean): void };\n\n /**\n * If passed in identifies which TwoFactorAuthentication we're updating\n * If not specified user will be adding a new authentication method\n */\n twoFactorAuthentication?: TwoFactorAuthentication;\n /**\n * If passed, it can be used to find out any information about currently set up\n * two factor authentications for current user.\n */\n twoFactorAuthentications?: Array;\n}\n\nconst TwoFactorSetupDialog: FC = (props: Props): React.JSX.Element => {\n const { isOpen, onClose, twoFactorAuthentication, twoFactorAuthentications } = props;\n\n const [state, dispatch] = useReducer(\n reducer,\n getInitialState({\n twoFactorAuthentication,\n twoFactorAuthentications,\n })\n );\n\n // We'll pass down state without queries so we don't re-render if queries change\n const { queries, ...stateWithoutQueries } = state;\n\n useEffect(\n () => {\n handleQueries(queries, dispatch, onClose);\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [queries]\n );\n\n // @todo move this business logic into the reducer\n useEffect(() => {\n dispatch({ type: ActionType.SetSteps });\n }, [state.isEnabled, state.verificationMethod]);\n\n const handleSmsCountryChange = useCallback(\n (e) => dispatch({ type: ActionType.SetFormCountry, payload: e.target.value as SmsCountry }),\n []\n );\n\n const handlePhoneNumberChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetFormPhoneNumber,\n payload: e.target.value as string,\n }),\n []\n );\n\n const handleUnableToScan = useCallback(() => dispatch({ type: ActionType.UnableToScan }), []);\n\n const handleVerificationChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetFormVerificationMethod,\n payload: e.target.value as TwoFactorAuthenticationType,\n }),\n []\n );\n\n const handleNextStep = useCallback(() => dispatch({ type: ActionType.NextStep }), []);\n\n const handlePreviousStep = useCallback(() => dispatch({ type: ActionType.PreviousStep }), []);\n\n const handleCodeChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetCode,\n payload: e.target.value as string,\n }),\n []\n );\n\n const handleSubmit = useCallback(() => {\n dispatch({ type: ActionType.NextStep });\n }, []);\n\n const handleClose = () => {\n dispatch({ type: ActionType.CloseDialog });\n onClose(false);\n };\n\n const handleDisableVerificationChange = useCallback((verification: TwoFactorAuthentication) => {\n if (!verification) {\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n fieldName: 'disableVerification',\n errorMessage: \"Please select a verification method to verify it's really you.\",\n },\n });\n } else {\n dispatch({\n type: ActionType.SetDisableVerificationMethod,\n payload: verification,\n });\n }\n }, []);\n\n const handleResendCode = useCallback(() => dispatch({ type: ActionType.ResendSmsCode }), []);\n\n const handleCallMe = useCallback(() => dispatch({ type: ActionType.CallUser }), []);\n\n return (\n \n );\n};\n\nexport default memo(TwoFactorSetupDialog);\n","import { ChangeEvent, FormEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n TextField,\n} from '@mui/material';\n\nimport { Strong } from '@/components/rich-text-formatting';\nimport SmsBackupOptions from '@/legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment';\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nfunction getCodeLabel(twoFactorAuthentication: TwoFactorAuthenticationType): string {\n switch (twoFactorAuthentication) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n}\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen: boolean;\n onCodeUpdate: (code: string) => void;\n onSubmitCode: () => void;\n onSwitchToMultipleMode: () => void;\n onClose: () => void;\n onResendCode: () => void;\n onCallMe: () => void;\n twoFactorDisplayName: string;\n twoFactorAuthenticationType: TwoFactorAuthenticationType;\n numberOfTwoFactorAuthentications: number;\n rememberDevice: boolean;\n onRememberDeviceChange: (rememberDevice: boolean) => void;\n}\n\nconst LoginPopupDefaultMethodDialog = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n code,\n errorMessage,\n isLoading = false,\n isOpen,\n onCodeUpdate,\n onResendCode,\n onCallMe,\n twoFactorDisplayName,\n twoFactorAuthenticationType,\n numberOfTwoFactorAuthentications,\n onSubmitCode,\n onSwitchToMultipleMode,\n onRememberDeviceChange,\n onClose,\n rememberDevice,\n } = props;\n\n const handleCodeSubmit = useCallback(\n (e: FormEvent) => {\n e.preventDefault();\n onSubmitCode();\n },\n [onSubmitCode]\n );\n\n const handleCodeChange = useCallback(\n (e: ChangeEvent) => {\n onCodeUpdate(e.target.value);\n },\n [onCodeUpdate]\n );\n\n const handleRememberDeviceChange = useCallback(\n (e: ChangeEvent) => onRememberDeviceChange(e.target.checked),\n [onRememberDeviceChange]\n );\n\n return (\n \n
\n \n \n \n {isLoading && (\n \n \n \n \n \n )}\n {!isLoading && (\n \n \n {twoFactorDisplayName}:\"\n values={{ twoFactorDisplayName, Strong }}\n />\n \n\n \n \n \n\n {twoFactorAuthenticationType === TwoFactorAuthenticationType.Sms && (\n \n )}\n\n \n }\n label={formatMessage({\n defaultMessage: 'Remember this device for the next 30 days',\n })}\n />\n\n {numberOfTwoFactorAuthentications === 1 && (\n \n My Profile > Two-Step Authentication.\"\n values={{ Strong }}\n />\n \n )}\n\n {numberOfTwoFactorAuthentications > 1 && (\n <>\n \n \n \n \n My Profile > Two-Step Authentication.\"\n values={{\n twoFactorDisplayName,\n Strong,\n }}\n />\n \n \n )}\n \n )}\n \n \n \n \n
\n
\n );\n};\n\nexport default memo(LoginPopupDefaultMethodDialog);\nexport type { Props };\n","import { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nenum ActionType {\n AdvanceStep = 'AdvanceStep',\n RegressStep = 'RegressStep',\n SetStep = 'SetStep',\n QuerySubmitCode = 'QuerySubmitCode',\n QueryClosePopup = 'QueryClosePopup',\n QueryClearInput = 'QueryClearInput',\n}\n\nenum LoginStep {\n ChooseProvider,\n VerifyAuthenticator,\n}\n\ninterface State extends QueryState {\n step: LoginStep;\n}\n\nfunction getInitialState(): State {\n return {\n step: LoginStep.ChooseProvider,\n queries: [],\n };\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case ActionType.AdvanceStep: {\n if (state.step === LoginStep.VerifyAuthenticator) {\n return {\n ...state,\n queries: [\n {\n type: ActionType.QuerySubmitCode,\n },\n ],\n };\n }\n\n return {\n ...state,\n step: state.step + 1,\n };\n }\n\n case ActionType.RegressStep: {\n if (state.step === LoginStep.ChooseProvider) {\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryClosePopup,\n },\n ],\n };\n }\n\n return {\n ...state,\n step: state.step - 1,\n queries: [\n {\n type: ActionType.QueryClearInput,\n },\n ],\n };\n }\n\n case ActionType.SetStep:\n return {\n ...state,\n step: action.payload,\n };\n\n default:\n return { ...state };\n }\n}\n\nexport default reducer;\nexport type { State };\nexport { ActionType, LoginStep, getInitialState };\n","import { Dispatch } from 'react';\n\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport { ActionType } from './LoginPopupMultiple.reducer';\n\ninterface ActionCallbacks {\n onSubmitCode: () => void;\n onClose: () => void;\n onClearInput: () => void;\n}\n\nfunction handleQueries(\n queries: Array>,\n dispatch: Dispatch>,\n callbacks: ActionCallbacks\n): void {\n queries.forEach(async (query) => {\n switch (query.type) {\n case ActionType.QuerySubmitCode: {\n callbacks.onSubmitCode();\n break;\n }\n case ActionType.QueryClosePopup: {\n callbacks.onClose();\n break;\n }\n case ActionType.QueryClearInput: {\n callbacks.onClearInput();\n break;\n }\n }\n });\n}\n\nexport default handleQueries;\nexport { ActionCallbacks };\n","import { useCallback, useEffect, useReducer } from 'react';\n\nimport handleQueries, { ActionCallbacks } from '../business/LoginPopupMultiple.handleQueries';\nimport reducer, {\n ActionType,\n getInitialState,\n LoginStep,\n State,\n} from '../business/LoginPopupMultiple.reducer';\n\ninterface Actions {\n stepForward: () => void;\n stepBack: () => void;\n}\n\ntype Props = ActionCallbacks;\n\nfunction useLoginPopupMultipleMethods(props: Props): [State, Actions] {\n const { onClose, onSubmitCode, onClearInput } = props;\n\n const [state, dispatch] = useReducer(reducer, getInitialState());\n\n useEffect(\n () => {\n handleQueries(state.queries, dispatch, { onClose, onSubmitCode, onClearInput });\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.queries]\n );\n\n const stepForward = useCallback(() => dispatch({ type: ActionType.AdvanceStep }), []);\n\n const stepBack = useCallback(() => dispatch({ type: ActionType.RegressStep }), []);\n\n return [\n state,\n {\n stepForward,\n stepBack,\n },\n ];\n}\n\nexport default useLoginPopupMultipleMethods;\nexport { ActionType, getInitialState, LoginStep, reducer };\nexport type { Actions, Props };\n","import { ChangeEvent, memo, useCallback, useEffect, useRef } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n Button,\n Checkbox,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n FormControlLabel,\n FormHelperText,\n MenuItem,\n Select,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n TextField,\n} from '@mui/material';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport { Strong } from '@/components/rich-text-formatting';\nimport SmsBackupOptions from '@/legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment';\nimport {\n TwoFactorAuthentication,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport { LoginStep } from './useLoginPopupMultipleMethods';\n\nfunction getCodeLabel(twoFactorAuthentication: TwoFactorAuthenticationType): string {\n switch (twoFactorAuthentication) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n}\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen?: boolean;\n onBackPressed: () => void;\n onCodeUpdated: (code: string) => void;\n onNextPressed: () => void;\n onProviderChange: (selectedTwoFactorAuthentication: TwoFactorAuthentication) => void;\n onRememberDeviceChange: (isChecked: boolean) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n rememberDevice: boolean;\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n step: LoginStep;\n twoFactorAuthentications: Array;\n}\n\nconst LoginPopupMultipleMethodsPresentation = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n errorMessage,\n step,\n twoFactorAuthentications,\n isLoading,\n selectedTwoFactorAuthentication,\n rememberDevice,\n code,\n isOpen,\n onBackPressed,\n onNextPressed,\n onProviderChange,\n onCodeUpdated,\n onRememberDeviceChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const codeInputRef = useRef(null);\n\n // If we get an error while entering code re-focus the code entry\n // Also re-focus once we finish loading two factor authentications\n useEffect(() => {\n if (\n step === LoginStep.VerifyAuthenticator &&\n (errorMessage || !isLoading) &&\n codeInputRef.current\n ) {\n codeInputRef.current.focus();\n }\n }, [errorMessage, step, isLoading]);\n\n const handleCodeUpdated = useCallback(\n (e: ChangeEvent) => onCodeUpdated(e.target.value),\n [onCodeUpdated]\n );\n\n const handleRememberDeviceChange = useCallback(\n (e: ChangeEvent) => onRememberDeviceChange(e.target.checked),\n [onRememberDeviceChange]\n );\n\n const handleProviderChange = useCallback(\n (e: ChangeEvent) => {\n const matchingTwoFactorAuthentication = twoFactorAuthentications.find(\n (twoFactorAuthentication) => twoFactorAuthentication.id === e.target.value\n );\n\n onProviderChange(matchingTwoFactorAuthentication);\n },\n [onProviderChange, twoFactorAuthentications]\n );\n\n return (\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n {twoFactorAuthentications.map((method) => (\n \n {method.displayName}\n \n ))}\n \n\n {errorMessage && {errorMessage}}\n \n \n \n\n \n \n \n \n\n \n \n {twoFactorDisplayName}:\"\n values={{\n twoFactorDisplayName: selectedTwoFactorAuthentication?.displayName,\n Strong,\n }}\n />\n \n\n \n \n\n {selectedTwoFactorAuthentication?.type === TwoFactorAuthenticationType.Sms && (\n \n )}\n \n\n \n \n }\n label={formatMessage({\n defaultMessage: 'Remember this device for the next 30 days',\n })}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(LoginPopupMultipleMethodsPresentation);\n","import { memo, useCallback } from 'react';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport LoginPopupMultipleMethodsPresentation from './LoginPopupMultipleMethods.presentation';\nimport useLoginPopupMultipleMethods from './useLoginPopupMultipleMethods';\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen?: boolean;\n onClose: () => void;\n onCodeUpdate: (code: string) => void;\n onRememberDeviceChange: (rememberDevice: boolean) => void;\n onSubmitCode: () => void;\n onTwoFactorAuthenticationChange: (\n selectedTwoFactorAuthentication: TwoFactorAuthentication\n ) => void;\n onClearInput: () => void;\n onCallMe: () => void;\n rememberDevice: boolean;\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n twoFactorAuthentications: Array;\n onResendCode: () => void;\n}\n\nconst LoginPopupMultipleMethods = (props: Props): React.JSX.Element => {\n const {\n code,\n errorMessage,\n isLoading = true,\n isOpen = false,\n onClose,\n onCodeUpdate,\n onRememberDeviceChange,\n onSubmitCode,\n onClearInput,\n onTwoFactorAuthenticationChange,\n onResendCode,\n onCallMe,\n rememberDevice,\n selectedTwoFactorAuthentication,\n twoFactorAuthentications,\n } = props;\n\n const [state, actions] = useLoginPopupMultipleMethods({\n onClose,\n onSubmitCode,\n onClearInput,\n });\n\n const handleCodeUpdated = useCallback(\n (verificationCode: string) => {\n const filteredCode = verificationCode.replace(/[^0-9]+/g, '');\n onCodeUpdate(filteredCode);\n },\n [onCodeUpdate]\n );\n\n return (\n \n );\n};\n\nexport default memo(LoginPopupMultipleMethods);\n","import { memo } from 'react';\n\nimport LoginPopupDefaultMethod from '../../defaultMethod/presentation/LoginPopupDefaultMethodDialog';\nimport LoginPopupMultipleMethods from '../../multipleMethods/presentation/LoginPopupMultipleMethods.bindings';\n\nimport { Handlers, State } from './useLoginPopup';\n\ninterface Props {\n handlers: Handlers;\n state: State;\n}\n\nconst LoginPopupPresentation = (props: Props): React.JSX.Element => {\n const { handlers, state } = props;\n\n if (!state.isOpen) {\n return null;\n }\n\n return state.isDefaultTwoFactorAuthenticationMode ? (\n \n ) : (\n \n );\n};\n\nexport default memo(LoginPopupPresentation);\n","import { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nconst localConfig = {\n /**\n * How many digits is the code that is sent to the user (exact digits)\n */\n exactCodeLength: 6,\n};\n\nenum ActionType {\n ResendCode = 'ResendCode',\n BeginCallAuthentication = 'BeginCallAuthentication',\n SelectTwoFactorAuthentication = 'SelectTwoFactorAuthentication',\n SetIsAuthenticationStarted = 'SetIsAuthenticationStarted',\n SetErrorMessage = 'SetErrorMessage',\n SetIsDefaultTwoFactorAuthenticationMode = 'SetIsDefaultTwoFactorAuthenticationMode',\n SetIsLoading = 'SetIsLoading',\n SetIsOpen = 'SetIsOpen',\n SetIsRememberDevice = 'SetIsRememberDevice',\n SetTwoFactorAuthentications = 'SetTwoFactorAuthentications',\n SubmitCode = 'SubmitCode',\n UpdateCode = 'UpdateCode',\n\n QueryBeginAuthentication = 'QueryBeginAuthentication',\n QueryGetTwoFactorAuthentications = 'QueryGetTwoFactorAuthentications',\n QuerySubmitCode = 'QuerySubmitCode',\n QueryBeginCallAuthentication = 'QueryBeginCallAuthentication',\n}\n\n/**\n * The state of the hook.\n */\ninterface State extends QueryState {\n /**\n * The two-factor authentication code.\n */\n code: string;\n /**\n * Any message to display to the user in the case of an unhappy flow.\n */\n errorMessage: string;\n /**\n * Used to track whether the default or alternative two-factor authentication should be used.\n */\n isDefaultTwoFactorAuthenticationMode: boolean;\n /**\n * Tracks loading state.\n */\n isLoading: boolean;\n /**\n * Tracks whether the dialog is displayed.\n */\n isOpen: boolean;\n /**\n * Lets the user select this device as a \"trusted\" device.\n */\n isRememberDevice: boolean;\n /**\n * The default method or the method chosen by the user.\n */\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n /**\n * A list of all authentication methods associated with this user.\n */\n twoFactorAuthentications: Array;\n}\n\nfunction getInitialState(initializer?: Partial): State {\n const initialState: State = {\n code: '',\n errorMessage: '',\n isDefaultTwoFactorAuthenticationMode: true,\n isLoading: true,\n isOpen: false,\n isRememberDevice: false,\n queries: [],\n selectedTwoFactorAuthentication: undefined,\n twoFactorAuthentications: [],\n };\n\n if (initializer) {\n return { ...initialState, ...initializer };\n }\n\n return initialState;\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case ActionType.ResendCode:\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: state.selectedTwoFactorAuthentication?.id,\n },\n ],\n };\n\n case ActionType.SelectTwoFactorAuthentication: {\n const selectedTwoFactorAuthentication = action.payload as TwoFactorAuthentication;\n\n return {\n ...state,\n selectedTwoFactorAuthentication,\n errorMessage: null, // Clear any previous error message during MFA selection\n code: null,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: selectedTwoFactorAuthentication.id,\n },\n ],\n };\n }\n\n case ActionType.SetIsDefaultTwoFactorAuthenticationMode:\n return {\n ...state,\n isDefaultTwoFactorAuthenticationMode: action.payload,\n errorMessage: null, // Clear any previous error message\n code: null, // Clear any previously introduced OTP code\n };\n\n case ActionType.SetIsRememberDevice:\n return {\n ...state,\n isRememberDevice: action.payload,\n };\n\n case ActionType.SetErrorMessage:\n return {\n ...state,\n errorMessage: action.payload,\n isLoading: false,\n };\n\n case ActionType.SubmitCode:\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitCode,\n payload: {\n id: state.selectedTwoFactorAuthentication?.id,\n rememberDevice: state.isRememberDevice,\n code: state.code,\n },\n },\n ],\n };\n\n case ActionType.SetIsOpen: {\n const isOpen = action.payload as boolean;\n\n if (isOpen) {\n return {\n ...state,\n isOpen,\n code: '',\n isLoading: true,\n isRememberDevice: false,\n isDefaultTwoFactorAuthenticationMode: true,\n errorMessage: '',\n queries: [\n {\n type: ActionType.QueryGetTwoFactorAuthentications,\n },\n ],\n };\n }\n\n return {\n ...state,\n isOpen,\n };\n }\n\n case ActionType.SetTwoFactorAuthentications: {\n const twoFactorAuthentications = action.payload as Array;\n const defaultTwoFactorAuthentication = twoFactorAuthentications.find((tfa) => tfa.isDefault);\n\n const errorMessage = '';\n const isLoading = false;\n\n if (defaultTwoFactorAuthentication) {\n return {\n ...state,\n errorMessage,\n isLoading,\n isDefaultTwoFactorAuthenticationMode: true,\n selectedTwoFactorAuthentication: defaultTwoFactorAuthentication,\n twoFactorAuthentications,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: defaultTwoFactorAuthentication.id,\n },\n ],\n };\n }\n\n return {\n ...state,\n errorMessage,\n isLoading,\n twoFactorAuthentications: action.payload,\n };\n }\n\n case ActionType.UpdateCode: {\n const code = (action.payload as string).replace(/[^0-9]+/g, '');\n if (code.length > localConfig.exactCodeLength) {\n return state;\n }\n\n return {\n ...state,\n errorMessage: null, // Clear error message when user starts typing\n code,\n };\n }\n\n case ActionType.BeginCallAuthentication:\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryBeginCallAuthentication,\n payload: state.selectedTwoFactorAuthentication?.id,\n },\n ],\n };\n\n default:\n return { ...state };\n }\n}\n\nexport default reducer;\nexport type { State };\nexport { ActionType, getInitialState };\n","import { ApiError } from '@/features/api';\nimport TwoFactorAuthenticationService, {\n EventType,\n UserSessionTwoFactorStatus,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport EventsService from '@/legacy/services/eventsService';\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport { ActionType } from './LoginPopup.reducer';\n\ntype Dispatchable = (value: T) => void;\n\n/**\n * Callbacks passed to the hook to enable it to interact with external functionality.\n */\ninterface Callbacks {\n /**\n * Requests the view to close.\n */\n onClose: () => void;\n /**\n * Requests to proceed with the login successfully.\n */\n onSuccessfulTwoFactorChallenge: () => void;\n}\n\nfunction handleQueries(\n queries: Array>,\n dispatch: Dispatchable>,\n callbacks: Callbacks\n): void {\n queries.forEach(async (query) => {\n switch (query.type) {\n case ActionType.QueryBeginAuthentication: {\n try {\n const isAuthenticationStarted = await TwoFactorAuthenticationService.beginAuthentication(\n query.payload\n );\n\n if (isAuthenticationStarted) {\n dispatch({\n type: ActionType.SetIsAuthenticationStarted,\n payload: isAuthenticationStarted,\n });\n } else {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n } catch (err) {\n if (err.type && err.type === 'rateLimit.smsAuth') {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Maximum attempts reached. Please try again later.',\n });\n\n break;\n }\n\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n break;\n }\n\n case ActionType.QueryBeginCallAuthentication: {\n const errorMessage = 'Failed initializing authentication via phone call. Please try again.';\n\n try {\n const isAuthenticationStarted =\n await TwoFactorAuthenticationService.beginCallAuthentication(query.payload);\n\n if (isAuthenticationStarted) {\n dispatch({\n type: ActionType.SetIsAuthenticationStarted,\n payload: isAuthenticationStarted,\n });\n } else {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: errorMessage,\n });\n }\n } catch (err) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: errorMessage,\n });\n }\n break;\n }\n\n case ActionType.QueryGetTwoFactorAuthentications: {\n try {\n const twoFactorAuthentications =\n await TwoFactorAuthenticationService.getTwoFactorAuthentications();\n\n dispatch({\n type: ActionType.SetTwoFactorAuthentications,\n payload: twoFactorAuthentications,\n });\n } catch (err) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n break;\n }\n\n case ActionType.QuerySubmitCode: {\n const { onClose, onSuccessfulTwoFactorChallenge } = callbacks;\n const { code, id, rememberDevice } = query.payload;\n\n if (!code) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'This field is required.',\n });\n return;\n }\n\n try {\n const authenticationResponse = await TwoFactorAuthenticationService.authenticate(id, {\n code,\n rememberDevice,\n });\n\n // Authorized is the only expected response in this case\n if (authenticationResponse.status === UserSessionTwoFactorStatus.Authorized) {\n onSuccessfulTwoFactorChallenge();\n\n EventsService.emit(EventType.UserTwoFactorAuthenticationSuccess);\n } else {\n onClose(); // If we got a different response close the dialog\n dispatch({ type: ActionType.SetIsOpen, payload: false });\n }\n } catch (err) {\n const getErrorMessage = () => {\n const apiError = err as ApiError;\n\n switch (apiError.type) {\n case 'invalid.deviceId':\n // This can happen when SameSite cookie is not set (or cookies were cleared)\n return '3rd party cookies are disabled. Please check your browser configuration.';\n }\n\n return apiError.message;\n };\n\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: getErrorMessage(),\n });\n }\n break;\n }\n }\n });\n}\n\nexport default handleQueries;\n","import { useCallback, useEffect, useReducer } from 'react';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport handleQueries from '../business/LoginPopup.handleQueries';\nimport reducer, { ActionType, getInitialState, State } from '../business/LoginPopup.reducer';\n\n/**\n * All possible callbacks and actions for the LoginPopup hook.\n */\ninterface Handlers {\n /**\n * Switch to multiple authentication mode.\n */\n handleSwitchToMultipleMode: () => void;\n /**\n * Update the two-factor authentication code.\n *\n * ## Example:\n * ```ts\n * const handleCodeChange = useCallback(\n * (e: ChangeEvent) => {\n * handleCodeUpdate(e.target.value);\n * }, [handleCodeUpdate],\n * );\n * ```\n */\n handleCodeUpdate: (code: string) => void;\n /**\n * Submit the two-factor authentication code for verification.\n */\n handleCodeSubmit: () => void;\n /**\n * Sets the \"Remember Device\" checkbox.\n */\n handleRememberDeviceChange: (rememberDevice: boolean) => void;\n /**\n * Sets the selected two-factor authentication.\n */\n handleTwoFactorAuthenticationChange: (twoFactorAuthentication: TwoFactorAuthentication) => void;\n /**\n * Resend the code to the user, if using SMS.\n */\n handleResendCode: () => void;\n /**\n * Call user instead of sending SMS code.\n */\n handleCallMe: () => void;\n /**\n * Closes the dialog.\n */\n handleClose: () => void;\n /**\n * Clears code and error.\n */\n handleClearInput: () => void;\n}\n\ninterface Props {\n isOpen: boolean;\n /**\n * Requests the view to close.\n */\n onClose: () => void;\n /**\n * Requests to proceed with the login successfully.\n */\n onSuccessfulTwoFactorChallenge: () => void;\n}\n\n/**\n * React hook to encapsulate Login Popup business logic.\n * @param callbacks To enable the hook to work with with external modules.\n * {@link Callbacks More information here}.\n * @returns The {@link State state} for the component and all possible {@link Handlers actions}.\n */\nfunction useLoginPopup(props: Props): [State, Handlers] {\n const { isOpen, onClose, onSuccessfulTwoFactorChallenge } = props;\n const [state, dispatch] = useReducer(reducer, getInitialState({ isOpen }));\n\n const handleSwitchToMultipleMode = useCallback(\n () => dispatch({ type: ActionType.SetIsDefaultTwoFactorAuthenticationMode, payload: false }),\n []\n );\n\n const handleCodeUpdate = useCallback(\n (code: string) => dispatch({ type: ActionType.UpdateCode, payload: code }),\n []\n );\n\n const handleCodeSubmit = useCallback(() => dispatch({ type: ActionType.SubmitCode }), []);\n\n const handleRememberDeviceChange = useCallback(\n (rememberDevice: boolean) =>\n dispatch({ type: ActionType.SetIsRememberDevice, payload: rememberDevice }),\n []\n );\n\n const handleTwoFactorAuthenticationChange = useCallback(\n (twoFactorAuthentication: TwoFactorAuthentication) =>\n dispatch({\n type: ActionType.SelectTwoFactorAuthentication,\n payload: twoFactorAuthentication,\n }),\n []\n );\n\n const handleResendCode = useCallback(() => dispatch({ type: ActionType.ResendCode }), []);\n\n const handleCallMe = useCallback(\n () => dispatch({ type: ActionType.BeginCallAuthentication }),\n []\n );\n\n const handleClose = useCallback(() => {\n dispatch({ type: ActionType.SetIsOpen, payload: false });\n onClose();\n }, [onClose]);\n\n const handleClearInput = useCallback(\n () => dispatch({ type: ActionType.UpdateCode, payload: '' }),\n []\n );\n\n useEffect(\n () => {\n handleQueries(state.queries, dispatch, { onClose, onSuccessfulTwoFactorChallenge });\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.queries]\n );\n\n // Knockout (or React) will eventually set isOpen to true which will initiate open dialog logic\n useEffect(() => {\n dispatch({ type: ActionType.SetIsOpen, payload: isOpen });\n }, [isOpen]);\n\n return [\n state,\n {\n handleSwitchToMultipleMode,\n handleCodeUpdate,\n handleCodeSubmit,\n handleRememberDeviceChange,\n handleTwoFactorAuthenticationChange,\n handleResendCode,\n handleClose,\n handleClearInput,\n handleCallMe,\n },\n ];\n}\n\nexport default useLoginPopup;\nexport type { Handlers, Props, State };\n","import { memo } from 'react';\n\nimport LoginPopupPresentation from './LoginPopup.presentation';\nimport useLoginPopup, { Props as LoginPopupHookProps } from './useLoginPopup';\n\ntype Props = LoginPopupHookProps;\n\nconst LoginPopupBindings = (props: Props): React.JSX.Element => {\n const [state, handlers] = useLoginPopup(props);\n return ;\n};\n\nexport default memo(LoginPopupBindings);\n","import { memo, MouseEvent, useCallback, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Link, MenuItem, Popover } from '@mui/material';\n\ninterface Props {\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst SmsBackupOptions = (props: Props): React.JSX.Element => {\n const { onCallMe, onResendCode } = props;\n\n const [popoverAnchor, setPopoverAnchor] = useState(null);\n\n const handleClosePopover = useCallback(() => {\n setPopoverAnchor(null);\n }, []);\n\n const handleResendCode = useCallback(() => {\n onResendCode();\n setPopoverAnchor(null);\n }, [onResendCode]);\n\n const handleCallMe = useCallback(() => {\n onCallMe();\n setPopoverAnchor(null);\n }, [onCallMe]);\n\n const handleOpenPopover = useCallback((e: MouseEvent) => {\n setPopoverAnchor(e.currentTarget);\n }, []);\n\n return (\n <>\n \n {/* FIXME: make this anchor a button */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(SmsBackupOptions);\n","export default class Constants {\n static readonly MAX_NUMBER_OF_2FAS_PER_TYPE = 2;\n}\n","import { ApiService } from '@/features/api';\n\nimport SingleSignOnLoginRequest from '../models/singleSignOnLoginRequest';\n\nfunction getSingleSignOnLoginRequest(email: string): Promise {\n return ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/singleSignOn/login`,\n {\n body: email,\n }\n );\n}\n\nfunction getUserSessionFromCode(code: string): Promise {\n return ApiService.get(\n `${import.meta.env.APP_URLS_API_URL}/v1/singleSignOn/userSession?code=${code}`,\n null,\n true\n );\n}\n\nexport { getSingleSignOnLoginRequest, getUserSessionFromCode };\n","/* eslint-disable arrow-body-style */\n\nimport { once } from 'lodash-es';\n\nimport { RECAPTCHA_V2_KEY } from '@/config/env';\n\nconst recaptchaKey = RECAPTCHA_V2_KEY;\n\n/** Resolves when reCAPTCHA has finished loading. */\nconst waitForReady = once(\n () =>\n new Promise((resolve) => {\n window.grecaptcha.ready(resolve);\n })\n);\n\n/**\n * Takes in an HTML element and binds Google reCAPTCHA to it.\n * @returns widgetId that can be used on grecaptcha.getResponse() and grecaptcha.execute()\n */\nconst getRecaptchaWidgetId = async (\n recaptchaElement: HTMLElement | string,\n callback: () => void\n): Promise => {\n if (!recaptchaKey) {\n return ''; // No recaptcha required if key is not set for localhost testing\n }\n\n await waitForReady();\n\n const recaptchaWidgetId = window.grecaptcha.render(recaptchaElement, {\n sitekey: recaptchaKey,\n\n // This callback is triggered after .getResponse()/.execute() is called in QuerySubmitLoginForm\n callback,\n size: 'invisible',\n });\n\n return recaptchaWidgetId;\n};\n\n/**\n * Takes in a widgetId that was generated from getRecaptchaWidgetId()\n * @returns reCAPTCHA response that needs to be passed together with a form to backend\n */\nconst getRecaptchaResponse = async (recaptchaWidgetId: string): Promise => {\n if (!recaptchaKey) {\n return 'NOT_REQUIRED'; // Not required in localhost\n }\n\n await waitForReady();\n\n const recaptchaResponse = window.grecaptcha.getResponse(recaptchaWidgetId);\n\n if (!recaptchaResponse) {\n window.grecaptcha.execute(recaptchaWidgetId);\n }\n\n return recaptchaResponse;\n};\n\n/**\n * Returns true if reCAPTCHA is configured (by default there is no key on localhost)\n */\nconst isRecaptchaEnabled = (): boolean => {\n return !!recaptchaKey;\n};\n\n/**\n * Resets reCAPTCHA state on current Window object\n */\nconst resetRecaptcha = async (): Promise => {\n try {\n if (isRecaptchaEnabled()) {\n await waitForReady();\n window.grecaptcha.reset();\n }\n } catch (recaptchaErr) {\n // ignore error\n }\n};\n\nexport { getRecaptchaResponse, getRecaptchaWidgetId, isRecaptchaEnabled, resetRecaptcha };\n","import * as dialog from 'plugins/dialog';\n\nimport BaseModal from '@/legacy/modals/BaseModal';\n\ndeclareModules({\n 'modals/genericInfoModal.html': () => import('@/legacy/modals/genericInfoModal.html'),\n});\n\ninterface GenericInfoButton {\n title: string;\n cssClass: string;\n}\ninterface ViewModelParams {\n message: string;\n title: string;\n continueButtonLabel?: string;\n cancelButtonLabel?: string;\n /**\n * If set the Yes/No buttons locations will be swapped and \"No\" option will have primary color\n * */\n swapButtons?: boolean;\n}\n\nclass StyledModal extends BaseModal {\n view = 'modals/genericInfoModal';\n\n public params: ViewModelParams;\n\n constructor(params: ViewModelParams) {\n super();\n params.continueButtonLabel = params.continueButtonLabel ? params.continueButtonLabel : 'Yes';\n params.cancelButtonLabel = params.cancelButtonLabel ? params.cancelButtonLabel : 'No';\n params.swapButtons = !!params.swapButtons;\n\n this.params = params;\n }\n\n public close(): void {\n return dialog.close(this, 'Yes');\n }\n\n public cancel(): void {\n return dialog.close(this, 'No');\n }\n\n public static show(params: ViewModelParams): JQueryPromise {\n return dialog.show(new StyledModal(params));\n }\n}\n\nexport default StyledModal;\n","import * as React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\ninterface Props {\n title: React.ReactNode;\n message: React.ReactNode;\n onClose: () => void;\n}\nconst TitleMessageDialog: React.FC = ({ title, message, onClose }) => (\n \n {title}\n \n {message}\n \n \n \n \n \n);\n\nexport default React.memo(TitleMessageDialog);\n","/* eslint-disable no-await-in-loop */ // Effecting query/pattern usability\n\nimport { Dispatch } from 'react';\n\nimport {\n getRecaptchaResponse,\n getRecaptchaWidgetId,\n isRecaptchaEnabled,\n} from '@/legacy/features/user/twoFactorAuthentication/recaptcha/recaptcha.helpers';\nimport * as UserService from '@/legacy/services/user';\nimport { UserLoginResponse } from '@/legacy/services/user';\nimport { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nenum ActionType {\n SubmitForm = 'SubmitForm',\n UpdatePassword = 'UpdatePassword',\n UpdateErrorMessage = 'UpdateErrorMessage',\n Logout = 'Logout',\n UpdateRecaptchaWidgetId = 'UpdateRecaptchaWidgetId',\n StartFormSubmit = 'StartFormSubmit',\n\n ShowTwoFactorCodeDialog = 'ShowTwoFactorCodeDialog',\n CloseTwoFactorCodeDialog = 'CloseTwoFactorCodeDialog',\n\n ShowTwoFactorSignupDialog = 'ShowTwoFactorSignupDialog',\n CloseTwoFactorSignupDialog = 'CloseTwoFactorSignupDialog',\n\n QuerySubmitLoginForm = 'QuerySubmitLoginForm',\n QueryLogout = 'QueryLogout',\n QueryRecaptchaWidget = 'QueryRecaptchaWidget',\n QueryLoginSuccess = 'QueryLoginSuccess',\n}\n\ninterface QuerySubmitLoginFormPayload {\n email: string;\n password: string;\n recaptchaWidgetId: string;\n}\n\ninterface UpdateErrorMessagePayload {\n errorMessage: string;\n\n /**\n * If an error is \"blocking\" then the entire form is disabled (logout button still works)\n */\n isBlocking?: boolean;\n\n /**\n * If set to true clears the password\n */\n resetPassword?: boolean;\n}\n\ninterface CloseTwoFactorCodeDialogPayload {\n /**\n * If true the 2FA code challenge was entered successfully\n * If false the user clicked back button in 2FA entry popup\n */\n isSuccessful: boolean;\n}\n\ninterface LoginCallbacks {\n onLoginSuccess?: () => void;\n onLogout?: () => void;\n}\n\ninterface State extends QueryState {\n email: string;\n password: string;\n errorMessage: string | null;\n isLoading: boolean;\n\n /**\n * This is reCAPTCHA widget id that is sent from QueryRecaptchaWidget query (on load)\n */\n recaptchaWidgetId?: string;\n\n isTwoFactorCodePopupOpen: boolean;\n isTwoFactorSignupOpen: boolean;\n}\nconst getInitialState = (initializer?: Partial): State => {\n const initialState: State = {\n email: '',\n password: '',\n errorMessage: null,\n isLoading: true, // By default we'll be loading until recaptcha is fully loaded\n isTwoFactorCodePopupOpen: false, // Shows when 2fa code is required\n isTwoFactorSignupOpen: false, // Shows when 2fa signup is required\n\n queries: [\n {\n type: ActionType.QueryRecaptchaWidget, // On load bind to recaptcha\n },\n ],\n };\n\n return {\n ...initialState,\n ...initializer,\n };\n};\n\nconst localConfig = {\n /**\n * This maximum password length matches the backend binding model\n */\n maxPasswordLength: 100,\n};\n\nconst reducer = (state: State, action: Action): State => {\n const { payload, type } = action;\n\n switch (type) {\n case ActionType.SubmitForm: {\n const { email, password, recaptchaWidgetId } = state;\n\n return {\n ...state,\n errorMessage: null, // Clear any errors\n\n queries: [\n {\n type: ActionType.QuerySubmitLoginForm,\n payload: {\n email,\n password,\n recaptchaWidgetId,\n } as QuerySubmitLoginFormPayload,\n },\n ],\n };\n }\n\n case ActionType.UpdatePassword: {\n if (payload.length >= localConfig.maxPasswordLength) {\n return state;\n }\n\n return {\n ...state,\n password: payload as string,\n errorMessage: null, // Clear any errors\n };\n }\n\n case ActionType.ShowTwoFactorCodeDialog:\n return {\n ...state,\n isTwoFactorCodePopupOpen: true,\n password: '',\n isLoading: false,\n };\n\n case ActionType.CloseTwoFactorCodeDialog: {\n const { isSuccessful } = payload as CloseTwoFactorCodeDialogPayload;\n const getSuccessQuery = () => {\n if (!isSuccessful) {\n return {};\n }\n\n // If user entered 2FA code then we'll close the code and callback props.onLoginSuccess\n return {\n queries: [\n {\n type: ActionType.QueryLoginSuccess,\n },\n ],\n };\n };\n\n return {\n ...state,\n isTwoFactorCodePopupOpen: isSuccessful, // If it's successful we'll show the popup until the whole dialog is closed\n ...getSuccessQuery(),\n };\n }\n\n case ActionType.ShowTwoFactorSignupDialog:\n return {\n ...state,\n isTwoFactorSignupOpen: true,\n password: '',\n isLoading: false,\n };\n\n case ActionType.CloseTwoFactorSignupDialog:\n return {\n ...state,\n isTwoFactorSignupOpen: false,\n };\n\n case ActionType.UpdateErrorMessage: {\n const { errorMessage, isBlocking, resetPassword } = payload as UpdateErrorMessagePayload;\n\n return {\n ...state,\n errorMessage,\n password: resetPassword ? '' : state.password, // Optionally clears password entry on error\n isLoading: isBlocking, // Re-enables form (if non-blocking)\n };\n }\n case ActionType.UpdateRecaptchaWidgetId: {\n return {\n ...state,\n recaptchaWidgetId: payload as string,\n isLoading: false,\n };\n }\n\n case ActionType.StartFormSubmit: {\n return {\n ...state,\n isLoading: true,\n };\n }\n\n case ActionType.Logout: {\n return {\n ...state,\n queries: [{ type: ActionType.QueryLogout }],\n };\n }\n\n default:\n return { ...state };\n }\n};\n\nconst handleQueries = async (\n queries: Array>,\n dispatch: Dispatch>,\n callbacks: LoginCallbacks\n): Promise => {\n const showPasswordError = ({\n errorMessage,\n isBlocking = false,\n resetPassword = true,\n }: UpdateErrorMessagePayload) => {\n // @todo figure out how to focus on error field\n dispatch({\n type: ActionType.UpdateErrorMessage,\n payload: {\n errorMessage,\n isBlocking,\n resetPassword,\n },\n });\n };\n\n for (const { type, payload } of queries) {\n switch (type) {\n case ActionType.QueryRecaptchaWidget: {\n // If we fail loading recaptcha or for some reason element isn't in DOM block form.\n const recaptchaElement = document.getElementById('sessionTimeout-recaptcha');\n if (!recaptchaElement) {\n showPasswordError({\n errorMessage: 'Failed loading Google reCAPTCHA. Please logout to continue.',\n isBlocking: true,\n });\n break;\n }\n\n try {\n const recaptchaWidgetId = await getRecaptchaWidgetId(recaptchaElement, () => {\n // Re-submit the form (which will trigger QuerySubmitLoginForm again)\n dispatch({\n type: ActionType.SubmitForm,\n });\n });\n\n dispatch({\n type: ActionType.UpdateRecaptchaWidgetId,\n payload: recaptchaWidgetId,\n });\n } catch (err) {\n showPasswordError({\n errorMessage: 'Failed binding Google reCAPTCHA. Please logout to continue.',\n isBlocking: true,\n });\n break;\n }\n\n break;\n }\n case ActionType.QueryLogout: {\n if (callbacks.onLogout) {\n callbacks.onLogout();\n }\n break;\n }\n case ActionType.QueryLoginSuccess: {\n if (callbacks.onLoginSuccess) {\n callbacks.onLoginSuccess();\n }\n break;\n }\n\n case ActionType.QuerySubmitLoginForm: {\n try {\n const { email, password, recaptchaWidgetId } = payload as QuerySubmitLoginFormPayload;\n\n const recaptchaV2Response = await getRecaptchaResponse(recaptchaWidgetId);\n if (!recaptchaV2Response) {\n return;\n }\n\n // If we get here the user has successfully completed recaptcha\n dispatch({\n type: ActionType.StartFormSubmit,\n });\n\n const userLoginResult = await UserService.Instance.Login({\n email,\n passphrase: password,\n recaptchaV2Response,\n });\n\n const userLoginResponse = userLoginResult.userLoginResponse as UserLoginResponse;\n switch (userLoginResponse) {\n case UserLoginResponse.TwoFactorAuthenticationRequired:\n dispatch({\n type: ActionType.ShowTwoFactorCodeDialog,\n });\n break;\n case UserLoginResponse.Successful:\n if (callbacks.onLoginSuccess) {\n callbacks.onLoginSuccess();\n }\n break;\n case UserLoginResponse.TwoFactorComplianceRequired:\n case UserLoginResponse.TwoFactorSignupRequired:\n dispatch({\n type: ActionType.ShowTwoFactorSignupDialog,\n });\n break;\n }\n } catch (err) {\n if (!err || !err.error) {\n showPasswordError({\n errorMessage: 'Could not connect to Plooto login server. Please try again later.',\n });\n return;\n }\n\n switch (err.type) {\n case 'invalid.user':\n showPasswordError({\n errorMessage: 'Incorrect password. Please try again.',\n });\n break;\n case 'invalid.recaptchav2':\n case 'incorrect.captcha':\n showPasswordError({\n errorMessage: 'Incorrect captcha response. Please try again.',\n });\n break;\n case 'rateLimit.login':\n showPasswordError({\n errorMessage: 'Login rate limited exceeded. Please try again later.',\n });\n break;\n\n default:\n showPasswordError({\n errorMessage: 'Unexpected login error. Please try again later.',\n });\n break;\n }\n\n // Attempt to reset recaptcha on any error\n try {\n if (isRecaptchaEnabled()) {\n window.grecaptcha.reset();\n }\n } catch (recaptchaErr) {\n // Silently handled\n }\n }\n }\n }\n }\n};\n\nexport { State, ActionType, getInitialState, handleQueries, reducer, LoginCallbacks };\n","import { FormEvent, memo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport LoadingButton from '@/components/LoadingButton';\n\nimport { State } from './SessionTimeout.reducer';\n\ninterface Props {\n state: Pick;\n isOpen: boolean;\n\n onSubmit: () => void;\n onLogout: () => void;\n onChangePassword: (password: string) => void;\n}\n\nconst SessionTimeoutDialog = ({ state, isOpen, onSubmit, onLogout, onChangePassword }: Props) => {\n const { formatMessage } = useIntl();\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n onChangePassword(event.target.value)}\n autoComplete=\"off\"\n error={!!state.errorMessage}\n helperText={state.errorMessage}\n disabled={state.isLoading}\n margin=\"normal\"\n />\n \n \n \n \n \n \n \n \n {/* This element is used for reCAPTCHA (bound in QueryRecaptchaWidget on load) */}\n
\n \n );\n};\n\nexport type { Props as SessionTimeoutDialogProps };\nexport default memo(SessionTimeoutDialog);\n","import { useEffect, useReducer } from 'react';\n\nimport LoginPopup from '@/legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.bindings';\nimport TwoFactorSetupDialog from '@/legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog';\n\nimport {\n ActionType,\n getInitialState,\n handleQueries,\n LoginCallbacks,\n reducer,\n State,\n} from './SessionTimeout.reducer';\nimport SessionTimeoutDialog from './SessionTimeoutDialog';\n\ninterface Props extends LoginCallbacks {\n email: string;\n}\n\nconst SessionTimeoutFragment = (props: Props): React.JSX.Element => {\n const { email } = props;\n\n const initialState = getInitialState({\n email,\n });\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n // We'll pass down state without queries so we don't re-render if queries change\n const { queries, ...stateWithoutQueries } = state;\n\n useEffect(\n () => {\n handleQueries(queries, dispatch, props);\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [queries]\n );\n\n // @todo add useCallbacks here\n\n const handleLogout = () => {\n dispatch({\n type: ActionType.Logout,\n });\n };\n\n const handleSubmit = () => {\n dispatch({\n type: ActionType.SubmitForm,\n });\n };\n\n const handleChangePassword = (password: string) => {\n dispatch({\n type: ActionType.UpdatePassword,\n payload: password,\n });\n };\n\n const handleCloseTwoFactorCodePopup = () => {\n dispatch({\n type: ActionType.CloseTwoFactorCodeDialog,\n payload: { isSuccessful: false },\n });\n };\n\n const handleSuccessfulTwoFactorChallenge = () => {\n dispatch({\n type: ActionType.CloseTwoFactorCodeDialog,\n payload: { isSuccessful: true },\n });\n };\n\n const handleCloseSignupDialog = () => {\n dispatch({\n type: ActionType.CloseTwoFactorSignupDialog,\n });\n };\n\n return (\n <>\n \n \n \n \n );\n};\n\nexport default SessionTimeoutFragment;\n","import { useRef } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { LoginCallbacks } from '@/legacy/components/user/signin/sessionTimeout/SessionTimeout.reducer';\nimport { getSingleSignOnLoginRequest } from '@/legacy/features/user/singleSignOn/services/api';\n\ninterface SsoSessionTimeoutDialogProps extends LoginCallbacks {\n email: string;\n isOpen: boolean;\n}\n\nfunction getRoute(): string {\n return window.location.hash;\n}\n\nconst SsoSessionTimeoutDialog = (props: SsoSessionTimeoutDialogProps): React.JSX.Element => {\n const { email, isOpen, onLogout } = props;\n const formRef = useRef(null);\n const samlRequestRef = useRef(null);\n\n const handleLogout = () => {\n onLogout();\n };\n\n const handleLogin = () => {\n getSingleSignOnLoginRequest(email).then((response) => {\n formRef.current.action = response.url;\n samlRequestRef.current.value = response.samlRequest;\n formRef.current.submit();\n });\n };\n\n return (\n \n \n \n \n \n \n \n \n\n
\n \n \n
\n\n \n \n\n \n \n
\n \n );\n};\n\nexport { SsoSessionTimeoutDialogProps };\nexport default SsoSessionTimeoutDialog;\n","import * as app from 'durandal/app';\nimport * as dialog from 'plugins/dialog';\nimport * as segmentAnalytics from 'segmentAnalytics';\n\nimport SessionTimeoutFragment from '@/legacy/components/user/signin/sessionTimeout/SessionTimeoutFragment';\nimport SsoSessionTimeoutDialog from '@/legacy/components/user/signin/ssoSessionTimeout/SsoSessionTimeoutDialog';\nimport BaseModal from '@/legacy/modals/BaseModal';\nimport RealtimeEvent from '@/legacy/services/realtime/models/realtimeEvent';\nimport * as userService from '@/legacy/services/user';\n\nimport { EventName, FormEventType } from '../features/analytics/helper';\n\ndeclareModules({\n 'modals/sessionTimeout.html': () => import('@/legacy/modals/sessionTimeout.html'),\n});\n\nclass SessionTimeout extends BaseModal {\n view = 'modals/sessionTimeout';\n\n public react = {\n fragments: {\n SessionTimeoutFragment,\n SsoSessionTimeoutDialog,\n },\n };\n\n public email: string;\n\n public showSsoTimeoutModal = ko.pureComputed({\n read: () => userService.Instance.profile()?.isSingleSignOnSession(),\n deferEvaluation: true,\n });\n\n /**\n * This field ensures that only one SessionTimeout dialog is rendered, and de-duplicates calls\n * that happen in error handlers and whatnot. It should resolve when the dialog closes.\n */\n private static dialogPromise: Promise | null = null;\n\n constructor(email: string) {\n super();\n this.email = email;\n }\n\n public onLoginSuccess() {\n dialog.close(this, true);\n }\n\n public onLogout() {\n segmentAnalytics.track(EventName.UserSignedOut, {\n source: FormEventType.ButtonClicked,\n });\n\n segmentAnalytics.reset();\n\n userService.Instance.Logout();\n }\n\n public static show(email: string): Promise {\n if (SessionTimeout.dialogPromise != null) {\n return SessionTimeout.dialogPromise;\n }\n\n const sessionTimeoutDialog = new SessionTimeout(email);\n SessionTimeout.dialogPromise = Promise.resolve(dialog.show(sessionTimeoutDialog)).then(Boolean);\n\n // If we lose connection with SignalR while timeout is visible logout the user\n const realtimeListener = app.on(RealtimeEvent.Offline).then(() => {\n dialog.close(sessionTimeoutDialog, undefined); // This will call Logout()\n }, this);\n\n SessionTimeout.dialogPromise.finally(() => {\n SessionTimeout.dialogPromise = null;\n realtimeListener.off();\n });\n\n return SessionTimeout.dialogPromise;\n }\n\n /** Returns `true` if the SessionTimeout dialog is currently displayed. */\n public static get isDisplayed() {\n return this.dialogPromise != null;\n }\n}\n\nexport default SessionTimeout;\n","class UnsavedChangesConfirmationService {\n public hasChanges = (): boolean => null;\n\n public showConfirmationDialog = false;\n}\n\nconst Instance = new UnsavedChangesConfirmationService();\nexport default Instance;\n","class Routers {\n public static Root: DurandalRouter = null;\n\n public static User: DurandalRouter = null;\n\n public static Settings: DurandalRouter = null;\n}\n\nexport default Routers;\n","import app from 'durandal/app';\nimport $ from 'jquery';\nimport { throttle } from 'lodash-es';\n\nimport { ApiService } from '@/features/api';\nimport SessionTimeout from '@/legacy/modals/sessionTimeout';\nimport * as userService from '@/legacy/services/user';\n\n/** Time to wait before presenting a session reactivation dialog. */\nconst SESSION_TIMEOUT = 15 * 60 * 1000;\n\n/** Time to wait for session reactivation before automatically killing it. */\nconst SESSION_KILL = 5 * 60 * 1000;\n\n/** Time between user activity pings (mouse movement, etc.). */\nconst PING_INTERVAL = 3 * 60 * 1000;\n\nclass SessionTimeoutService {\n private sessionTimeout: ReturnType;\n\n private sessionKill: ReturnType;\n\n constructor() {\n // To avoid creating a circular dependency chain between this and UserService (and the dialog\n // viewmodel), expose the public methods to the Durandal event bus so that indirect calls can be\n // made after module initialization.\n app.on('user:keepSessionAlive').then(this.keepSessionAlive);\n app.on('user:resetSessionTimeout').then(this.resetSessionTimeout);\n app.on('user:showSessionTimeout').then(this.showTimeout);\n $(window).on('focus resize mousemove keyup', this.keepSessionAlive);\n }\n\n private keepSessionAlive = throttle(() => {\n if (userService.Instance.IsAuthenticated() && !SessionTimeout.isDisplayed) {\n this.resetSessionTimeout();\n this.ping();\n }\n }, PING_INTERVAL);\n\n private setLastSessionActionToNow() {\n try {\n localStorage.setItem('lastSessionAction', Date.now().toString());\n } catch {\n // do nothing\n }\n }\n\n private getLastSessionAction() {\n try {\n const valueAsString = localStorage.getItem('lastSessionAction');\n const value = valueAsString ? Number.parseInt(valueAsString, 10) : Number.NaN;\n return Number.isNaN(value) ? null : value;\n } catch {\n return null;\n }\n }\n\n private getTimeSinceLastSession() {\n const lastSessionAction = this.getLastSessionAction();\n return lastSessionAction != null ? Date.now() - lastSessionAction : null;\n }\n\n private disconnectSession() {\n userService.Instance.clearAuthenticationToken();\n\n if (!userService.Instance.IsAuthenticated()) {\n return;\n }\n\n this.showTimeout();\n\n // force session termination if timer runs out\n const resetSessionKill = (waitMs: number) => {\n if (this.sessionKill != null) {\n clearTimeout(this.sessionKill);\n this.sessionKill = undefined;\n }\n\n this.sessionKill = setTimeout(() => {\n this.sessionKill = undefined;\n\n // Ensure user didn't interact with any other Plooto windows. If they did, keep this session\n // alive.\n const timeSinceLastSession = this.getTimeSinceLastSession();\n if (timeSinceLastSession != null) {\n const nextWaitMs = SESSION_TIMEOUT + SESSION_KILL - timeSinceLastSession;\n if (nextWaitMs > 0) {\n resetSessionKill(nextWaitMs);\n return;\n }\n }\n\n // check if connection is still available\n userService.Instance.Logout();\n }, waitMs);\n };\n\n resetSessionKill(SESSION_KILL);\n }\n\n private resetSessionTimeout = () => {\n // Only set last action in localStorage if user has a valid token. We'll use this timestamp for\n // cross-window sessions.\n if (userService.Instance.hasAuthenticationToken()) {\n this.setLastSessionActionToNow();\n }\n\n if (this.sessionKill != null) {\n clearTimeout(this.sessionKill);\n this.sessionKill = undefined;\n }\n\n const startSessionTimeout = (waitMs: number) => {\n if (this.sessionTimeout != null) {\n clearTimeout(this.sessionTimeout);\n this.sessionTimeout = undefined;\n }\n\n this.sessionTimeout = setTimeout(() => {\n this.sessionTimeout = undefined;\n\n // Ensure user didn't interact with any other Plooto windows. If they did, keep this session\n // alive.\n const timeSinceLastSession = this.getTimeSinceLastSession();\n if (timeSinceLastSession != null) {\n const nextWaitMs = SESSION_TIMEOUT - timeSinceLastSession;\n if (nextWaitMs > 0) {\n startSessionTimeout(nextWaitMs);\n return;\n }\n }\n\n this.disconnectSession();\n }, waitMs);\n };\n\n startSessionTimeout(SESSION_TIMEOUT);\n };\n\n public showTimeout = (eventArgs?: { reloadAfterAuthenticate?: boolean }) =>\n SessionTimeout.show(userService.Instance.DisplayEmail()).then((didAuthenticate) => {\n if (didAuthenticate && eventArgs?.reloadAfterAuthenticate === true) {\n window.location.reload();\n }\n return didAuthenticate;\n });\n\n private ping(): void {\n // XXX: Ideally, we would await this call and trigger the session timeout behaviour if the\n // session expired server-side for whatever reason (e.g. the tab was suspended due to sleep\n // mode).\n ApiService.post(`${import.meta.env.APP_URLS_API_URL}/v1/user/ping`);\n }\n}\n\nconst Instance = new SessionTimeoutService();\n\nexport { Instance as SessionTimeoutService };\n","import * as system from 'durandal/system';\nimport * as analytics from 'analytics';\n\nimport * as companyService from '@/legacy/services/company';\nimport * as userService from '@/legacy/services/user';\nimport * as verificationService from '@/legacy/services/verification/verification';\nimport * as plootoUtils from '@/legacy/utils/plooto';\nimport * as addModels from '@/legacy/viewmodels/addModels';\nimport * as viewModels from '@/legacy/viewmodels/viewModels';\n\nconst API_PREFIX = 'v1';\n\nexport class CompanyDirectorUpdateBindingModel {\n public userId: string;\n\n public isDirector: boolean;\n}\n\nexport class VerificationCompanyService {\n public GetVerifyCompanyStatus(companyId): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/status`\n )\n .then((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public GetTeamVerifications(\n companyId\n ): JQueryPromise> {\n return system\n .defer>((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/teamVerifications`\n )\n .then((verificationInfo: any) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail(\n (verificationInfo: Array) => {\n dfd.reject(verificationInfo);\n }\n );\n })\n .promise();\n }\n\n public GetAccountsPinsVerified(companyId): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/accounts/pinsVerified`\n )\n .then((isAllPinsVerified: any) => {\n dfd.resolve(isAllPinsVerified);\n })\n .fail((error) => {\n dfd.reject(error);\n });\n })\n .promise();\n }\n\n public VerifyCompany(\n companyId: string,\n formData: FormData\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedUpload(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/companies/${companyId}/verification`,\n formData\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostBusinessInformation(\n companyId: string,\n formData: addModels.BusinessInformationAddModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/businessInformation`,\n formData\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n analytics.send(\n 'action',\n 'user-verification',\n 'user-verification-completed',\n companyService.Instance.CompanyId()\n );\n\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostBusinessDirectors(\n companyId: string,\n formData: addModels.BusinessDirectorsAddModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/businessInformation/directors`,\n formData\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public GetBusinessInformationStatus(\n companyId\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/businessInformation`\n )\n .then((verificationInfo) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n analytics.send(\n 'action',\n 'company-registration',\n 'company-registration-completed',\n companyService.Instance.CompanyId()\n );\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostCompanyBusinessDetails(\n companyId: string,\n personalInformation: verificationService.CompanyBusinessDetailsBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/businessDetails`,\n personalInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostCompanyAddressDetails(\n companyId: string,\n addressInformation: verificationService.AddressInformationBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/addressDetails`,\n addressInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public SetCompanyVerificationStatusUploadRequired(\n companyId: string,\n userId: string,\n status: string\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPut(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/company/${userId}/${status}`\n )\n .then((data, textStatus, request) => {\n if (plootoUtils.IsNullOrUndefined(data) || data.error) {\n dfd.reject(data);\n return;\n }\n dfd.resolve(data);\n })\n .fail((error) => {\n dfd.reject(error);\n });\n })\n .promise();\n }\n}\nexport const Instance = new VerificationCompanyService();\n","import * as system from 'durandal/system';\n\nimport * as userService from '@/legacy/services/user';\nimport * as verificationService from '@/legacy/services/verification/verification';\nimport * as plootoUtils from '@/legacy/utils/plooto';\nimport * as viewModels from '@/legacy/viewmodels/viewModels';\n\nconst API_PREFIX = 'v1';\n\nexport enum AccountVerificationStatus {\n Pending = 0,\n PinPending,\n PinSent,\n PinFailed,\n UploadRequired,\n Completed,\n Processing,\n}\nexport class AccountVerificationResult {\n public status: AccountVerificationStatus;\n\n public accountId: string;\n\n public priority: boolean;\n\n public currency: string;\n\n public microDepositStatus: string;\n\n public microDepositError: string;\n\n public displayName: string;\n\n public maskedAccountNumber: string;\n}\n\nexport class VerificationUserService {\n public VerifyIdentity(formData: FormData): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedUpload(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/users/verification`,\n formData\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostIdentityPersonalInformation(\n personalInformation: verificationService.PersonalInformationBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/users/verification/personalInformation`,\n personalInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostIdentityAddressInformation(\n addressInformation: verificationService.AddressInformationBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/users/verification/addressInformation`,\n addressInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo as any);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public GetVerifyIdentityStatus(\n companyId: string,\n userId: string\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/users/${userId}/status`\n )\n .then((verificationInfo) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((error) => {\n dfd.reject(error);\n });\n })\n .promise();\n }\n\n public GetAccountVerificationStatus(companyId): JQueryPromise> {\n return system\n .defer>((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/accounts`\n )\n .then((accountVerificationStatus: any) => {\n if (\n plootoUtils.IsNullOrUndefined(accountVerificationStatus) ||\n accountVerificationStatus.error\n ) {\n dfd.reject(accountVerificationStatus);\n return;\n }\n dfd.resolve(accountVerificationStatus);\n })\n .fail((accountVerificationStatus) => {\n dfd.reject(accountVerificationStatus);\n });\n })\n .promise();\n }\n}\nexport const Instance = new VerificationUserService();\n","import { ApiDateFormat, DisplayDateFormat, formatLocalDate } from '@/utils/formatDate';\n\n// For reducer queries\n\n/**\n * @deprecated Use Action or PayloadAction from App\\utils\\stateManagementModels instead.\n */\ninterface Action {\n type: T;\n payload?: any;\n}\n\ninterface ErrorModel {\n error: boolean;\n fields: Array;\n}\n\ninterface FieldError {\n name: string;\n errors: Array;\n}\n\n/**\n * Boilerplate for the queries pattern.\n * @deprecated Use QueryState from App\\utils\\stateManagementModels instead\n */\ninterface QueryState {\n readonly queries: Array>;\n}\n\nconst getFieldError = (fieldName: string, fieldErrors: Array) => {\n // Try to find and return first error for the field with this name\n const matchingField = fieldErrors.find((fieldError) => fieldError.name === fieldName);\n if (matchingField && matchingField.errors.length > 0) {\n return matchingField.errors[0];\n }\n\n return null;\n};\n\nconst areScalarArraysEqualIgnoreOrder = (array1: Array, array2: Array): boolean => {\n if (array1.length != array2.length) {\n return false;\n }\n\n const array2Sorted = array2.slice().sort();\n\n return array1\n .slice()\n .sort()\n .every((value, index) => value === array2Sorted[index]);\n};\n\n/// any arrays items are considered to be of primitive type\n/// arrays are compared ignoring order\n\nfunction areObjectsEqual(object1: T, object2: T, ignoredFields?: Array): boolean {\n if (object1 === object2) {\n return true;\n }\n\n if (!(object1 instanceof Object) || !(object2 instanceof Object)) {\n return false;\n }\n\n if (Array.isArray(object1) && Array.isArray(object2)) {\n return areScalarArraysEqualIgnoreOrder(object1, object2);\n }\n\n const uniqueKeys = Object.keys(object1)\n .concat(Object.keys(object2))\n .filter((value, index, self) => self.indexOf(value) === index);\n\n for (let i = 0; i <= uniqueKeys.length; i += 1) {\n const key = uniqueKeys[i];\n\n const shouldSkip = ignoredFields?.some((field) => field === key);\n if (!shouldSkip) {\n const value1 = object1[key];\n const value2 = object2[key];\n\n if (!areObjectsEqual(value1, value2)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction getFixedDate(value: string | Date): Date {\n let fixedDate: Date;\n if (!(value instanceof Date)) {\n const objectDate = new Date(value);\n fixedDate = new Date(objectDate.getTime() + objectDate.getTimezoneOffset() * 60000);\n } else {\n fixedDate = value;\n }\n\n return fixedDate;\n}\n\nfunction dateToYYYYMMDD(date: string | Date, delimiter = '-'): string {\n const fixedDate = getFixedDate(date);\n return formatLocalDate(fixedDate, ApiDateFormat.DateOnly);\n}\n\nfunction dateToString(date: string | Date): string {\n const fixedDate = getFixedDate(date);\n const result = formatLocalDate(fixedDate, DisplayDateFormat.ShortDate);\n return result;\n}\n\nexport {\n Action,\n ErrorModel,\n FieldError,\n QueryState,\n getFieldError,\n areScalarArraysEqualIgnoreOrder,\n areObjectsEqual,\n dateToYYYYMMDD,\n dateToString,\n};\n","import * as dialog from 'plugins/dialog';\nimport * as router from 'plugins/router';\n\nimport * as companyService from '@/legacy/services/company';\n\nclass BillingDebitFailedModal {\n view = 'features/companies/serviceSubscriptions/modals/billingDebitFailedModal';\n\n /* Because SelectCompany can be called multiple times (ex: during invitation) we want to ensure we\n never show more than 1 of these modals */\n public static isVisible = false;\n\n public companyService = companyService.Instance;\n\n public Close(): void {\n BillingDebitFailedModal.isVisible = false;\n dialog.close(this, false);\n }\n\n public Continue(): void {\n BillingDebitFailedModal.isVisible = false;\n dialog.close(this, true);\n router.navigate('user/settings/billing');\n }\n\n public static show(): JQueryPromise {\n if (BillingDebitFailedModal.isVisible) {\n return;\n }\n\n BillingDebitFailedModal.isVisible = true;\n dialog.show(new BillingDebitFailedModal());\n }\n}\n\nexport default BillingDebitFailedModal;\n","import * as app from 'durandal/app';\nimport * as system from 'durandal/system';\n\nimport * as companyService from '@/legacy/services/company';\nimport * as companyPaymentService from '@/legacy/services/company/payment';\nimport * as userService from '@/legacy/services/user';\nimport * as plootoUtils from '@/legacy/utils/plooto';\n\nconst API_PREFIX = 'v1';\n\nexport class PromoCodeApplyCodeViewModel {\n public id: string;\n\n public expiry: string;\n\n public totalFreeTransactions: number;\n\n public addedFreeTransactions: number;\n}\n\nexport class PromoCodeService {\n private companyService: companyService.CompanyService;\n\n private userService: userService.UserService;\n\n constructor() {\n this.companyService = companyService.Instance;\n this.userService = userService.Instance;\n\n this.BindPaymentEventCallbacks();\n }\n\n private BindPaymentEventCallbacks() {\n // Bind to a few extra events so we can adjust our free transactions accordingly\n app.on('payment:create').then((createdPayment: companyPaymentService.Payment) => {\n const { freeTransactions } = this.companyService.profile();\n if (createdPayment.freeTransactionUsed()) {\n freeTransactions(freeTransactions() - 1); // Remove 1 free transaction\n }\n });\n\n const decreaseFreeTransaction = (deletedPayment: companyPaymentService.Payment) => {\n const { freeTransactions } = this.companyService.profile();\n if (deletedPayment.freeTransactionUsed()) {\n freeTransactions(freeTransactions() + 1); // Add back 1 free transaction\n }\n };\n\n app.on('payment:delete').then(decreaseFreeTransaction);\n app.on('payment:reject').then(decreaseFreeTransaction);\n }\n\n public PutApplyCode(code: string): JQueryPromise {\n const companyId: string = this.companyService.CompanyId();\n if (companyId === undefined) {\n return undefined;\n }\n\n return system\n .defer((dfd) => {\n this.userService\n .AuthorizedPut(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/promoCodes/applyCode`,\n {\n code,\n }\n )\n .done((exchangeRateData) => {\n if (\n plootoUtils.IsNullOrUndefined(exchangeRateData) ||\n exchangeRateData.error === true\n ) {\n dfd.reject(exchangeRateData);\n return;\n }\n dfd.resolve(exchangeRateData);\n })\n .fail(() => {\n dfd.reject();\n });\n })\n .promise();\n }\n}\n\nexport const Instance = new PromoCodeService();\n","import * as app from 'durandal/app';\nimport * as system from 'durandal/system';\nimport * as router from 'plugins/router';\nimport * as ko from 'knockout';\nimport CssBaseline from '@mui/material/CssBaseline';\n\nimport { isPersonaActive, isPersonaEnabled } from '@/features/verification';\nimport BillingDebitFailedModal from '@/legacy/features/companies/serviceSubscriptions/modals/billingDebitFailedModal';\nimport genericInfoModal from '@/legacy/modals/genericInfoModal';\nimport * as companyService from '@/legacy/services/company';\nimport * as promoCodesService from '@/legacy/services/company/promoCodes'; // Leave this here because we initialize an event inside\nimport routers from '@/legacy/services/routers';\nimport unsavedChangedConfirmationService from '@/legacy/services/UnsavedChangedConfirmationService';\nimport * as userService from '@/legacy/services/user';\n\ndeclareModules({\n 'components/user/companies/capabilities/freeTrialEndedBanner': () =>\n import('@/legacy/components/user/companies/capabilities/freeTrialEndedBanner'),\n 'components/user/companies/capabilities/freeTrialEndedBanner.html': () =>\n import('@/legacy/components/user/companies/capabilities/freeTrialEndedBanner.html'),\n 'components/user/layout/navbar-footer': () =>\n import('@/legacy/components/user/layout/navbar-footer'),\n 'components/user/layout/navbar-footer.html': () =>\n import('@/legacy/components/user/layout/navbar-footer.html'),\n 'components/user/layout/navbar-top': () => import('@/legacy/components/user/layout/navbar-top'),\n 'components/user/layout/navbar-top.html': () =>\n import('@/legacy/components/user/layout/navbar-top.html'),\n 'components/user/onboarding/parts/reminderBar': () =>\n import('@/legacy/components/user/onboarding/parts/reminderBar'),\n 'components/user/onboarding/parts/reminderBar.html': () =>\n import('@/legacy/components/user/onboarding/parts/reminderBar.html'),\n 'viewmodels/contacts/shell': () => import('@/legacy/viewmodels/contacts/shell'),\n 'viewmodels/emailmoneytransfer/shell': () =>\n import('@/legacy/viewmodels/emailmoneytransfer/shell'),\n 'viewmodels/emailSubscriptions': () => import('@/legacy/viewmodels/emailSubscriptions'),\n 'viewmodels/forgotPassphrase': () => import('@/legacy/viewmodels/forgotPassphrase'),\n 'viewmodels/notFound': () => import('@/legacy/viewmodels/notFound'),\n 'viewmodels/oauth/shell': () => import('@/legacy/viewmodels/oauth/shell'),\n 'viewmodels/quickbooksonline/shell': () => import('@/legacy/viewmodels/quickbooksonline/shell'),\n 'viewmodels/register': () => import('@/legacy/viewmodels/register'),\n 'viewmodels/requests/shell': () => import('@/legacy/viewmodels/requests/shell'),\n 'viewmodels/resetPassphrase': () => import('@/legacy/viewmodels/resetPassphrase'),\n 'viewmodels/signin': () => import('@/legacy/viewmodels/signin'),\n 'viewmodels/signup': () => import('@/legacy/viewmodels/signup'),\n 'viewmodels/ssoLoadingPage': () => import('@/legacy/viewmodels/ssoLoadingPage'),\n 'viewmodels/ssoLogin': () => import('@/legacy/viewmodels/ssoLogin'),\n 'viewmodels/user/shell': () => import('@/legacy/viewmodels/user/shell'),\n 'viewmodels/verificationEmailSent': () => import('@/legacy/viewmodels/verificationEmailSent'),\n 'viewmodels/verify/onetimeLogin': () => import('@/legacy/viewmodels/verify/onetimeLogin'),\n 'viewmodels/verify/verifyEmail': () => import('@/legacy/viewmodels/verify/verifyEmail'),\n 'viewmodels/verifyNewEmail': () => import('@/legacy/viewmodels/verifyNewEmail'),\n 'viewmodels/xero/shell': () => import('@/legacy/viewmodels/xero/shell'),\n 'views/contacts/shell.html': () => import('@/legacy/views/contacts/shell.html'),\n 'views/emailmoneytransfer/shell.html': () =>\n import('@/legacy/views/emailmoneytransfer/shell.html'),\n 'views/emailSubscriptions.html': () => import('@/legacy/views/emailSubscriptions.html'),\n 'views/forgotPassphrase.html': () => import('@/legacy/views/forgotPassphrase.html'),\n 'views/notFound.html': () => import('@/legacy/views/notFound.html'),\n 'views/oauth/shell.html': () => import('@/legacy/views/oauth/shell.html'),\n 'views/quickbooksonline/shell.html': () => import('@/legacy/views/quickbooksonline/shell.html'),\n 'views/register.html': () => import('@/legacy/views/register.html'),\n 'views/requests/shell.html': () => import('@/legacy/views/requests/shell.html'),\n 'views/resetPassphrase.html': () => import('@/legacy/views/resetPassphrase.html'),\n 'views/signin.html': () => import('@/legacy/views/signin.html'),\n 'views/signup.html': () => import('@/legacy/views/signup.html'),\n 'views/ssoLoadingPage.html': () => import('@/legacy/views/ssoLoadingPage.html'),\n 'views/ssoLogin.html': () => import('@/legacy/views/ssoLogin.html'),\n 'views/user/shell.html': () => import('@/legacy/views/user/shell.html'),\n 'views/verificationEmailSent.html': () => import('@/legacy/views/verificationEmailSent.html'),\n 'views/verify/onetimeLogin.html': () => import('@/legacy/views/verify/onetimeLogin.html'),\n 'views/verify/verifyEmail.html': () => import('@/legacy/views/verify/verifyEmail.html'),\n 'views/verifyNewEmail.html': () => import('@/legacy/views/verifyNewEmail.html'),\n 'views/xero/shell.html': () => import('@/legacy/views/xero/shell.html'),\n});\n\nexport class ViewModel {\n public router: DurandalRouter;\n\n public userService: userService.UserService;\n\n public companyService: companyService.CompanyService;\n\n private promoCodesService: promoCodesService.PromoCodeService = promoCodesService.Instance;\n\n private showBillingDebitFailedModalSubscription: DurandalEventSubscription;\n\n constructor() {\n this.router = router;\n this.companyService = companyService.Instance;\n this.userService = userService.Instance;\n }\n\n public react = {\n fragments: {\n /**\n * CssBaseline uses Emotion's GlobalStyle API under the hood, which bypasses the cache. Init\n * it once globally here to avoid creating thousands of redundant CSSStyleSheet instances in\n * the DOM. */\n CssBaseline,\n },\n };\n\n public NavigateHome(): void {\n // don't navigate anywhere when tutorial is visible\n\n if ($('body').hasClass('tutorial-visible')) {\n router.navigate('user/tutorials/companyInfo');\n return;\n }\n\n if (this.userService.IsAuthenticated() === false) {\n router.navigate('https://www.plooto.com/');\n } else {\n router.navigate('user');\n }\n $('html, body').scrollTop(0);\n }\n\n public ShowSignIn(): void {\n router.navigate('signin');\n }\n\n public SwitchCompany(): void {\n router.navigate('user/company/select');\n }\n\n public attached(view: HTMLElement, parent: HTMLElement): void {\n $(view)\n .find('[data-toggle=popover]')\n .popover({\n trigger: 'manual',\n html: true,\n content() {\n return $(this).parent().find('.content').html();\n },\n })\n .click(function (evt) {\n evt.stopPropagation();\n $(this).popover('show');\n });\n $('html').on('click', (e) => {\n if (\n typeof $(e.target).data('original-title') === 'undefined' &&\n !$(e.target).parents().is('.popover.in')\n ) {\n $('[data-original-title]').popover('hide');\n }\n });\n\n const showBillingDebitFailedModalSubscription = app\n .on('billing:showDebitFailedModal')\n .then(() => BillingDebitFailedModal.show());\n }\n\n public detached(): void {\n this.showBillingDebitFailedModalSubscription?.off();\n }\n\n public IsDemoCompany: KnockoutComputed = ko.pureComputed({\n read: () => this.companyService.IsDemo(),\n deferEvaluation: true,\n });\n\n public FooterClass: KnockoutComputed = ko.pureComputed({\n read: () => (this.userService.IsAuthenticated() ? 'authenticated' : 'not-authenticated'),\n deferEvaluation: true,\n });\n\n public IsLimitedDomesticPaymentsCompanyFeatureEnabled: KnockoutComputed =\n ko.pureComputed({\n read: () =>\n this.userService.IsAuthenticated() &&\n this.companyService.CompanyId() &&\n this.companyService.isLimitedDomesticPaymentsFeatureEnabled(),\n });\n\n public SignInVisible: KnockoutComputed = ko.pureComputed({\n read: () => {\n const instruction = router.activeInstruction();\n if (!instruction) {\n return false;\n }\n\n return (\n instruction.fragment != 'qbo_connect' && instruction.config.route != 'requests*details'\n );\n },\n deferEvaluation: true,\n });\n\n public isFooterPadded: KnockoutComputed = ko.pureComputed({\n read: () => {\n const instruction = router.activeInstruction();\n if (!instruction) {\n return false;\n }\n\n return instruction.fragment.indexOf('user/onboardingWizard') !== 0;\n },\n deferEvaluation: true,\n });\n\n public activate(): JQueryPromise {\n let lastRouteChecksum;\n\n router.activeInstruction.subscribe((newValue: DurandalRouteInstruction) => {\n if (!newValue || !newValue.config) {\n return;\n }\n const { moduleId } = newValue.config;\n\n let newRouteChecksum = newValue.config.hash;\n if (newValue.params.length > 0 && newValue.params[0] != null) {\n newRouteChecksum += '[params]';\n }\n\n if (lastRouteChecksum == newRouteChecksum) {\n return;\n }\n\n lastRouteChecksum = newRouteChecksum;\n\n $(document.body).toggleClass('state_authenticated', this.userService.IsAuthenticated());\n\n $(document.body).toggleClass('view_home', /^viewmodels\\/home$/.test(moduleId));\n\n const navbar = $('.navbar');\n navbar.removeClass('deactivated');\n navbar.removeClass('active');\n });\n\n $(window).scroll(() => {\n const MIN_SCROLL_ADD = 200;\n const MIN_SCROLL_REMOVE = 100;\n const body = $(document.body);\n\n if (body.hasClass('view_home')) {\n const scrollTop = $(window).scrollTop();\n const navbar = $('.navbar');\n\n if (scrollTop > MIN_SCROLL_ADD && !navbar.hasClass('active')) {\n navbar.removeClass('deactivated');\n navbar.addClass('active');\n }\n if (scrollTop < MIN_SCROLL_REMOVE && navbar.hasClass('active')) {\n navbar.removeClass('active');\n navbar.addClass('deactivated');\n }\n }\n });\n\n const retVal = router\n .map([\n {\n route: [\n '',\n 'signin(/:resumeFragment)',\n 'signin/company/:companyId(/:resumeFragment)',\n 'signin/dialog/twoFactorSettings',\n ],\n title: 'Sign In',\n moduleId: 'viewmodels/signin',\n nav: true,\n },\n { route: 'signup(/:email)', title: 'Sign Up', moduleId: 'viewmodels/signup', nav: true },\n\n {\n route: 'forgotPassphrase',\n title: 'Forgot Password',\n moduleId: 'viewmodels/forgotPassphrase',\n nav: true,\n },\n {\n route: 'ssoLogin',\n title: 'SSO Login',\n moduleId: 'viewmodels/ssoLogin',\n nav: true,\n },\n {\n route: 'ssoLoadingPage',\n title: 'Loading',\n moduleId: 'viewmodels/ssoLoadingPage',\n nav: false,\n },\n {\n route: 'resetPassphrase(/:userId)(/:verificationCode)',\n title: 'Reset Password',\n moduleId: 'viewmodels/resetPassphrase',\n nav: true,\n },\n\n {\n route: 'forwardSession/:key1/:key2/:key3',\n title: 'Logging In...',\n moduleId: 'viewmodels/verify/onetimeLogin',\n nav: true,\n },\n {\n route: 'verifyEmail/:userId/:verificationCode',\n title: 'Email Verification',\n moduleId: 'viewmodels/verify/verifyEmail',\n nav: true,\n },\n\n {\n route: 'verificationEmailSent(/:email)',\n title: 'Almost Done',\n moduleId: 'viewmodels/verificationEmailSent',\n nav: true,\n },\n {\n route: 'verifyNewEmail(/:userId)(/:verificationCode)',\n title: 'Verify New Email',\n moduleId: 'viewmodels/verifyNewEmail',\n nav: false,\n },\n\n {\n route: 'user*details',\n title: 'Dashboard',\n moduleId: 'viewmodels/user/shell',\n nav: false,\n hash: 'user',\n },\n\n {\n route: 'quickbooksonline*details',\n title: 'QuickBooks Online',\n moduleId: 'viewmodels/quickbooksonline/shell',\n nav: false,\n hash: 'quickbooksonline',\n },\n {\n route: 'requests*details',\n title: 'Requests',\n moduleId: 'viewmodels/requests/shell',\n nav: false,\n hash: 'requests',\n },\n\n {\n route: 'emailmoneytransfer*details',\n title: 'Email Money Transfer',\n moduleId: 'viewmodels/emailmoneytransfer/shell',\n nav: false,\n hash: 'emailmoneytransfer',\n },\n {\n route: 'contacts*details',\n title: 'Contact',\n moduleId: 'viewmodels/contacts/shell',\n nav: false,\n hash: 'contacts',\n },\n\n {\n route: 'xero*details',\n title: 'Xero',\n moduleId: 'viewmodels/xero/shell',\n nav: false,\n hash: 'xero',\n },\n {\n route: 'oauth*details',\n title: '',\n moduleId: 'viewmodels/oauth/shell',\n nav: false,\n hash: 'oauth',\n },\n {\n route: 'register(/:email)(/:verificationCode)',\n title: 'Set Password',\n moduleId: 'viewmodels/register',\n nav: false,\n },\n {\n route: 'emailSubscriptions(/:email)(/:groupId)',\n title: 'Email Subscriptions',\n moduleId: 'viewmodels/emailSubscriptions',\n nav: false,\n },\n ])\n .buildNavigationModel()\n .mapUnknownRoutes('viewmodels/notFound');\n retVal.guardRoute = (\n instance: Record,\n instruction: DurandalRouteInstruction\n ): JQueryPromise =>\n system\n .defer(async (dfd) => {\n if (\n unsavedChangedConfirmationService.showConfirmationDialog &&\n unsavedChangedConfirmationService.hasChanges()\n ) {\n await genericInfoModal\n .show({\n title: 'Leave page?',\n message:\n 'You have unsaved changes. Are you sure you want to leave the page without saving?',\n swapButtons: true,\n })\n .then((result) => {\n if (result === 'No') {\n dfd.resolve(false);\n }\n });\n }\n\n if (\n instruction.fragment.indexOf('tutorials/') >= 0 ||\n instruction.fragment.indexOf('forwardSession/') >= 0 ||\n instruction.fragment.indexOf('user/onboardingWizard') >= 0 ||\n instruction.fragment.indexOf('user/your-first-payment/') >= 0\n ) {\n $('body').addClass('tutorial-visible');\n } else {\n $('body').removeClass('tutorial-visible');\n }\n\n if (\n this.userService.IsAuthenticated() &&\n this.userService.profile()?.isSignupPhoneVerificationRequired() &&\n !this.userService.profile()?.isSignupPhoneVerificationDone() &&\n (isPersonaActive().data || isPersonaEnabled().data)\n ) {\n dfd.resolve(\n instruction.fragment === 'user/tutorials/addPhoneNumber' ||\n 'user/tutorials/addPhoneNumber'\n );\n return;\n }\n\n if (instruction.fragment == 'home' && this.userService.IsAuthenticated()) {\n dfd.resolve('user');\n return;\n }\n\n if (instruction.fragment == 'user' || /^user\\//.test(instruction.fragment)) {\n if (!this.userService.IsAuthenticated()) {\n dfd.resolve(`signin/${encodeURIComponent(instruction.fragment)}`);\n return;\n }\n }\n\n // checks if the verify email route has an associated email\n if (\n this.userService.IsAuthenticated() &&\n instruction.config.moduleId === 'viewmodels/verify/verifyEmail'\n ) {\n dfd.resolve('user/company/select');\n return;\n }\n\n dfd.resolve(true);\n })\n .promise();\n\n routers.Root = retVal;\n\n return router.activate();\n }\n}\n","import { ApprovalsFilter } from '@/features/approvals/types/ApprovalsFilter';\nimport { ApprovalsTab } from '@/features/approvals/types/ApprovalsTab';\n\nconst ApprovalsTabToKey: Record = {\n [ApprovalsTab.Controls]: 'controls',\n [ApprovalsTab.Payments]: 'payments',\n};\n\n/** Durandal routes map */\nexport const durandalRoutes = {\n clients: {\n addNewClient: '#user/tutorials/companyInfo',\n inviteAsClient: '#user/settings/accountingFirm/dialog/companyAccountingFirmInvite',\n },\n user: {\n accounts: {\n index: '#user/bank',\n locked: '#user/bank/locked',\n newBankAccount: '#user/bank/accounts/dialog/newBankAccount',\n },\n dashboard: {\n index: '#user',\n pendingPayments: '#user/dashboard/pendingPayments',\n pendingRequests: '#user/dashboard/pendingRequests',\n paymentApprovals: '#user/dashboard/approvePayments',\n wizard: '#user/dashboard/dashboardWizard',\n },\n onboarding: {\n connectBankAccountDialog: '#user/dialog/addBankAccount',\n firstPayWizard: '#user/your-first-payment',\n firstPayWizardSkipIntro: '#user/your-first-payment/choose-bill',\n outstandingVerificationItems: '#user/dashboard/outstandingVerificationItems',\n validateCompanyDialog: '#user/dashboard/dashboardWizard/dialog/validateCompany',\n verifyIdentity: '#user/dashboard/dashboardWizard/dialog/validateIdentity',\n wizard: '#user/dashboard/dashboardWizard',\n },\n integrations: {\n creditCards: '#user/integrations/creditCardLanding',\n },\n payments: {\n index: '#user/payments',\n locked: '#user/payments/locked',\n },\n referrals: '#user/referrals',\n requests: {\n index: '#user/requests',\n locked: '#user/requests/locked',\n },\n settings: {\n accountingSoftware: '#user/settings/users/integrations',\n controls: '#user/settings/controls',\n profile: '#user/settings',\n billing: '#user/settings/billing',\n billingItem: (billingItemId: string) => `#user/settings/billing/${billingItemId}`,\n sso: '#user/settings/sso',\n userManagement: '#user/settings/users',\n accountingFirmClients: '#user/settings/accountingFirm',\n },\n transferFunds: {\n index: '#user/transferFunds',\n prefundCad: '#user/transferFunds/prefund_PI_CAD',\n prefundUsd: '#user/transferFunds/prefund_PI_USD',\n },\n tutorials: {\n complete: '#user/tutorials/complete',\n companyInfo: '#user/tutorials/companyInfo',\n selectPaymentPlan: '#user/tutorials/selectPaymentPlan',\n },\n capture: '#user/documents',\n payables: '#user/payments',\n paymentAdd: '#user/payments/add',\n paymentEdit: (paymentId: string) => `#user/payments/edit/${paymentId}`,\n paymentDetails: (paymentId: string) => `#user/payments/view/${paymentId}`,\n receivables: '#user/requests',\n receivableEdit: (requestId: string) => `#user/requests/edit/${requestId}`,\n receivableDetails: (requestId: string) => `#user/requests/view/${requestId}`,\n contacts: '#user/payees',\n contactDetails: (payeeId: string) => `#user/payees/view/${payeeId}`,\n contactEdit: (payeeId: string) => `#user/payees/edit/${payeeId}`,\n approvals: {\n default: '#user/approvals',\n tab({\n isRestrictedToMyPayments,\n activeTab,\n itemId,\n }: {\n isRestrictedToMyPayments: boolean;\n activeTab: ApprovalsTab;\n itemId?: string;\n }) {\n const filter = isRestrictedToMyPayments ? ApprovalsFilter.Mine : ApprovalsFilter.All;\n const tab = ApprovalsTabToKey[activeTab];\n return itemId\n ? `#user/approvals/${filter}/${tab}/${itemId}`\n : `#user/approvals/${filter}/${tab}`;\n },\n },\n companySelect: '#user/company/select',\n },\n signIn: '#signin',\n signInWithEmail: (email: string) => `#signin?email=${encodeURIComponent(email)}`,\n} as const;\n","import * as ko from 'knockout';\n\nexport type Result = {\n data: T;\n error: any;\n isLoading: boolean;\n};\n\n/**\n * Creates a Knockout computed observable that maps the result of an async function to a Result\n * object.\n * @param mapFunction The function to map the result of the async function to the data property\n * of the Result object.\n * @param options The options for the observable.\n * @returns The computed observable that is writeable to the observable provided in the options.\n */\nexport function combineResults<\n TArgs extends ReadonlyArray>>,\n TData,\n>(\n observables: TArgs,\n combineFunction: (\n ...data: {\n [index in keyof TArgs]: TArgs[index] extends KnockoutReadonlyObservable>\n ? TValue\n : never;\n }\n ) => TData,\n options: {\n write: (value: Result) => void;\n }\n): KnockoutComputed> | KnockoutReadonlyComputed>;\n/**\n * Creates a Knockout computed observable that maps the result of an async function to a Result object.\n * @param mapFunction The function to map the result of the async function to the data property of the Result object.\n * @returns The readonly computed observable.\n */\nexport function combineResults<\n TArgs extends ReadonlyArray>>,\n TData,\n>(\n observables: TArgs,\n combineFunction: (\n ...data: {\n [index in keyof TArgs]: TArgs[index] extends KnockoutReadonlyObservable>\n ? TValue\n : never;\n }\n ) => TData\n): KnockoutReadonlyComputed>;\nexport function combineResults<\n TArgs extends ReadonlyArray>>,\n TData,\n>(\n observables: TArgs,\n combineFunction: (\n ...data: {\n [index in keyof TArgs]: TArgs[index] extends KnockoutReadonlyObservable>\n ? TValue\n : never;\n }\n ) => TData,\n options?: { write?: (value: Result) => void }\n): KnockoutComputed> | KnockoutReadonlyComputed> {\n if (options?.write) {\n return ko.pureComputed({\n deferEvaluation: true,\n read: () => {\n const results = observables.map((observable) => observable());\n return {\n data: combineFunction(...(results.map((result) => result?.data) as any)),\n isLoading: results.some((result) => result?.isLoading),\n error: results.find((result) => result?.error)?.error ?? null,\n };\n },\n write: options.write,\n }) as KnockoutComputed>;\n }\n return ko.pureComputed({\n deferEvaluation: true,\n read: () => {\n const results = observables.map((observable) => observable());\n return {\n data: combineFunction(...(results.map((result) => result?.data) as any)),\n isLoading: results.some((result) => result?.isLoading),\n error: results.find((result) => result?.error)?.error ?? null,\n };\n },\n }) as KnockoutReadonlyComputed>;\n}\n\nexport function mapResultObservable(\n observable: KnockoutReadonlyObservable>,\n mapFunction: (data: TData) => TResult\n): KnockoutReadonlyComputed> {\n return ko.pureComputed(() => {\n const { data, error, isLoading } = observable();\n return {\n data: error || isLoading ? (data as unknown as TResult) : mapFunction(data),\n error,\n isLoading,\n };\n });\n}\n\nexport function observableToAsyncResult(\n observable: KnockoutObservable,\n mapFunction: (arg: TArg) => Promise,\n options?: {\n errorValue?: TData;\n initialValue?: TData;\n pendingValue?: TData;\n }\n): KnockoutObservable> & KnockoutSubscription {\n return observable.mapAsync>(\n (value) =>\n mapFunction(value).then(\n (data) => ({ data, error: null, isLoading: false }),\n (error) => ({ data: options?.errorValue ?? null, error, isLoading: false })\n ),\n {\n initialValue: { data: options?.initialValue, error: null, isLoading: true },\n pendingValue: { data: options?.pendingValue, error: null, isLoading: true },\n }\n );\n}\n\nexport function reduceResults(\n reducer: (accumulator: TData, data: TData) => TData,\n ...observables: Array<\n | KnockoutComputed>\n | KnockoutObservable>\n | KnockoutReadonlyObservable>\n >\n): KnockoutReadonlyComputed> {\n return ko.pureComputed(() => ({\n data: observables.map((observable) => observable().data).reduce(reducer),\n error: observables.reduce((err, observable) => err || observable().error, null),\n isLoading: observables.some((observable) => observable().isLoading),\n }));\n}\n"],"names":["PlootoDialog","children","isClosable","isOpen","onDialogClose","PaperProps","undefined","title","dialogProps","formatMessage","useIntl","_jsxs","_Dialog","open","_jsx","_IconButton","sx","position","top","right","mt","mr","onClick","_Close","titleAccess","commonMessages","closeDialog","_DialogTitle","pr","Emphasis","chunks","Strong","Underline","style","textDecoration","PhoneLink","chunk","_Link","href","EmailLink","SupportEmailLink","ApprovalsFilter","ApprovalsTab","defineMessages","approve","id","defaultMessage","back","cancel","close","comingSoon","continue","delete","emDash","goPlanName","gotIt","growPlanName","growUnlimitedPlanName","learnMore","loading","logout","new","none","okay","or","other","reject","save","showLess","showMore","skipForNow","subtotal","tryAgain","typeToSearch","unlimited","UnableToVerify","_Stack","alignItems","justifyContent","_Typography","gutterBottom","textAlign","variant","FormattedMessage","maxWidth","values","emailLink","backendStatusToProgressPersona","status","backendStatusToProgressJumio","additionalVerificationItems","observableToAsyncResult","companyService","CompanyId","companyId","verificationService","getOutstandingVerificationItems","Promise","Error","bankAccountVerificationInProgressHack","ko","bankAccountVerificationInProgress","deferEvaluation","read","indexOf","profile","bankAdded","write","value","push","remove","bankAccountVerificationCompleted","isAnyBankAccountVerified","bankAccountVerificationProgress","bankAccountVerificationNotStarted","verification","getOnboardingWizardStatus","companyVerification","verificationCompanyService","GetVerifyCompanyStatus","companyVerificationStatusHack","companyVerificationStatus","combineResults","verificationDto","hack","companyVerificationProgress","mapResultObservable","companyStatus","isSubjectToPersonaOnboarding","companyVerificationCompleted","companyProgress","companyVerificationInProgress","companyVerificationNotStarted","companyVerificationFailed","ownershipInformation","OwnershipInformationService","get","errorValue","initialValue","pendingValue","companyAndUserId","userService","UserId","userVerification","userId","verificationUserService","GetVerifyIdentityStatus","userVerificationCompleted","userVerificationDto","isIdentityVerified","userVerificationProgressBackend","userVerificationProgressHack","userVerificationProgress","backend","userVerificationInProgressCombiner","progress","isIdentitySubmitted","userVerificationInProgress","userVerificationNotStarted","userProgress","userVerificationFailed","userVerificationStatus","data","verificationCompletedCombiner","company","identity","unable","verificationCompleted","verificationInProgressCombiner","verificationInProgress","verificationFailedCombiner","verificationFailed","testPaymentMadeHack","testPaymentMade","paymentAdded","allVerificationResults","additionalVerificationItemsData","companyVerificationData","companyVerificationCompletedData","companyVerificationInProgressData","companyVerificationNotStartedData","companyVerificationProgressData","companyVerificationStatusData","ownershipInformationData","userVerificationData","userVerificationCompletedData","userVerificationInProgressData","userVerificationNotStartedData","userVerificationProgressData","userVerificationStatusData","verificationData","verificationCompletedData","verificationFailedData","verificationInProgressData","app","then","error","isLoading","items","LoadCompanyProfile","isPersonaEnabled","UserService","FeatureToggleService","isFeatureEnabled","FeatureFlag","SPR5_24_ONBOARDING_PERSONA","isPartOfPersonaCohort","isFeatureFlagEnabled","CompanyService","isPersonaActive","userVerificationResult","companyVerificationResult","isAccountingFirm","hasAccountingFirmCompanyId","Boolean","accountingFirmCompanyId","isKybSubmittingUserHack","isKybSubmittingUser","submittedByUserId","isUbo","ownershipInformationResult","some","owner","email","toLowerCase","isKycStep","isCompanyVerificationCompleted","isCompanyVerificationInProgress","isUserUbo","hasUserVerificationFailed","isUserVerificationCompleted","isUserVerificationInProgress","isCompanyVerificationCompletedOrInProgress","isUboUserVerificationIncomplete","VerificationStatus","useOwnershipVerification","useContext","CompanyContext","useSyncKoObservable","ownershipVerification","isInitialLoading","isError","useQuery","queryFn","ApiService","Object","create","globalThis","import_meta_env","FEATURE_VERIFICATION_BASE_URL","queryKey","enabled","isOwnershipVerificationRequired","notificationFirstSentDate","verificationStatus","Pending","personaInquiryId","useVerification","bankAccountVerificationCompletedObservable","bankAccountVerificationInProgressObservable","bankAccountVerificationNotStartedObservable","bankAccountVerificationProgressObservable","testPaymentMadeObservable","allResults","isKybSubmittingUserError","isKybSubmittingUserLoading","isKybSubmittingUserObservable","isUboError","isUboLoading","isUboObservable","isKycStepError","isKycStepLoading","isKycStepObservable","setCompanyOnboardingStatus","useCallback","companyVerificationStatusObservable","setIsKybSubmittingUser","isSubmitting","setUserVerificationSubmitted","isSubmitted","userVerificationProgressObservable","isSubmitterCompanyOwner","fields","isSoleProp","isFormFillerOwner","mapPersonaCorporationType","corporationType","Corporation","Charity","mapToPersonaVerificationBindingModel","isKyc","userInformation","companyInformation","name","operatingName","businessUrl","address","city","country","state","suite","zipCode","isCompanyOwner","PersonaFlowContainer","_styled","_Box","theme","minHeight","minWidth","breakpoints","down","InquiryDialog","onClose","onSuccess","trackVerificationCancelled","trackVerificationInitiated","trackVerificationSubmitted","queryClient","useQueryClient","confirm","useConfirm","companyProfile","userProfile","isVerificationLoading","isOwnershipVerificationInitialLoading","ownershipVerificationPersonaInquiryId","referenceType","referenceId","companyPersonaMetadata","isFetching","isCompanyPersonaMetadataLoading","existingInquiryId","localStorage","getItem","templateInfo","useMemo","templateId","PERSONA_OWNERSHIP_TEMPLATE_ID","templateVersionId","PERSONA_OWNERSHIP_TEMPLATE_VERSION_ID","PERSONA_KYC_TEMPLATE_ID","PERSONA_KYC_TEMPLATE_VERSION_ID","PERSONA_GET_STARTED_TEMPLATE_ID","PERSONA_GET_STARTED_TEMPLATE_VERSION_ID","prefilledPersonaFields","caseId","res","kyb_case_id","form_submitter_id","email_address","form_filler_email_address","business_name","business_physical_address_country_code","name_first","firstName","name_last","lastName","phone_number","businessPhone","onSuccessfulOwnershipSubmission","invalidateQueries","removeItem","onSuccessfulPersonaSubmission","result","onUnsuccessfulSubmission","errorMessage","message","type","description","hideCancelButton","catch","_noop","mutate","submitOwnershipVerification","isSuccess","hasCompletedOwnershipVerification","useMutation","mutationFn","postOwnershipVerification","onError","submitPersonaVerification","hasCompletedPersonaVerification","postPersonaVerification","inquirySession","isInquirySessionLoading","post","handleComplete","bindingModel","handleEvent","metadata","inquiryId","setItem","handleCancel","handleDialogClose","Dialog","fullWidth","_DialogContent","display","_CircularProgress","Inquiry","environmentId","PERSONA_GET_STARTED_ENVIRONMENT_ID","onCancel","onComplete","onEvent","sessionToken","phoneVerificationService","sendCode","phoneNumber","APP_URLS_API_URL","body","verify","code","validatePhoneNumber","match","onlyNumbers","replace","length","Step","spacing","_Card","p","EnterPhoneNumber","onSendSms","validationSchema","object","string","required","test","onSubmit","setFieldError","formattedNumber","substring","SessionTimeoutService","showTimeout","formik","useFormik","initialValues","direction","Person","fontSize","color","SecurityUpdateGoodOutlined","FormikProvider","Form","Field","component","TextField","label","LoadingButton","EnterVerificationCodeRenderer","lastPhoneDigits","onResendCode","onVerifyCode","verificationCode","valid","Stack","CheckCircle","autocomplete","inputMode","EnterVerificationCode","slice","VerifyNumberSuccess","totalAccountingFirmMemberships","accountingFirmMemberships","totalUserMemberships","memberships","buttonHref","totalAccountingFirmMembershipsCount","totalUserMembershipsCount","durandalRoutes","user","tutorials","companyInfo","dashboard","index","_Button","VerifyNumber","isCompleted","isSignupPhoneVerificationDone","step","setStep","useState","setPhoneNumber","onCompleteEnterPhoneNumber","addedPhoneNumber","onCompleteEnterVerificationCode","totalMembershipsCount","LoadProfile","router","onResendSms","handleLogOut","Logout","size","url","response","AuthFetchService","httpGet","ok","json","statusText","update","owners","httpPut","JSON","stringify","SmsCountry","VerificationStep","ActionType","reducer","action","payload","AddErrors","SetFormPhoneNumber","fieldErrors","filter","e","SetFormCountry","smsCountry","UnableToScan","isUnableToScan","SetCode","SetFormVerificationMethod","verificationMethod","isMaxNumberOfAuthMethodsReachedForCurrentType","isMaxNumberOfTwoFactorAuthReached","twoFactorAuthentications","PreviousStep","verificationStep","NextStep","currentStep","steps","SelectVerificationProvider","TwoFactorAuthenticationType","Otp","queries","QueryGenerateOtp","QuerySubmitPhoneNumber","phoneCountry","toString","ConfirmOtpCode","EnterSmsCode","twoFactorAuthenticationDisabler","twoFactorAuthentication","QuerySubmitTwoFactorStatus","temporaryMfaSetupId","closeOnSuccess","isFinal","twoFactorAuthenticationIdToUpdate","ConfirmDisableOtpCode","EnterDisableSmsCode","SelectDisabler","QuerySendDisableCode","ResendSmsCode","query","isEnabled","CallUser","shouldCallUser","QueryCallSetupCode","SetSteps","newSteps","blockBack","methodSpecificActivation","OtpQrCode","ShowDialog","dialog","CloseDialog","ShowFieldError","fieldName","errors","HandleFormFieldErrors","SetDisableVerificationMethod","nextStep","secretKey","otpSecretKey","handleQueries","dispatch","handleError","getErrorDialog","closeModal","errorDialog","forEach","smsCodeResponse","TwoFactorAuthenticationService","generateSmsCode","mfaType","Sms","updateTwoFactorAuthentication","TwoFactorAuthenticationStatus","Disabled","addTwoFactorAuthentication","smsSettings","sendDisableCode","otpCodeResponse","generateOtpCode","twoFactorAuthenticationType","tfa","Constants","MAX_NUMBER_OF_2FAS_PER_TYPE","getInitialState","isMaxNumberOfOtpTwoFactorAuthReached","isMaxNumberOfSmsTwoFactorAuthReached","CompanyCountry","CA","US","otpAccountName","DisplayEmail","DisplayName","APP_URLS_APP_URL","CodeMessage","props","memo","Code","onCodeChange","onCallMe","getCodeLabel","_Fragment","mb","my","_FormControl","_TextField","onChange","autoFocus","disabled","getFieldError","helperText","autoComplete","SmsBackupOptions","VerificationProvider","onTwoFactorAuthenticationDisablerChange","twoFactorAuthenticationDisablers","handleVerificationChange","newMethod","find","method","target","_InputLabel","_Select","labelId","defaultValue","map","_MenuItem","displayName","_FormHelperText","SmsPhoneFragment","onPhoneNumberChange","onSmsCountryChange","phoneNumberErrorMessage","SecondaryText","ml","_Grid","container","item","sm","md","QrCodeFragment","Component","componentDidMount","qrCodeData","QRCode","document","getElementById","console","render","ScanCode","onUnableToScan","_Paper","fontWeight","UserOtpQrCodeFragment","otpAccountNameRaw","encodeURIComponent","flexDirection","alignContent","justifyItems","onVerificationMethodChange","select","TwoFactorStepper","onNextStep","onPreviousStep","onVerificationChange","getStepContent","DisableVerification","_Stepper","activeStep","orientation","stepIndex","_Step","_StepLabel","_StepContent","TwoFactorSetupDialogContents","handeClose","getDialog","TitleMessageDialog","getDialogTitle","handleSubmit","preventDefault","handleCodeChange","handleNextStep","handlePhoneNumberChange","handlePreviousStep","handleSmsCountryChange","handleUnableToScan","handleResendCode","handleCallMe","dialogTitle","_DialogContentText","_DialogActions","rel","flexGrow","TwoFactorSetupDialog","useReducer","stateWithoutQueries","useEffect","handleClose","handleDisableVerificationChange","LoginPopupDefaultMethodDialog","onCodeUpdate","twoFactorDisplayName","numberOfTwoFactorAuthentications","onSubmitCode","onSwitchToMultipleMode","onRememberDeviceChange","rememberDevice","handleCodeSubmit","handleRememberDeviceChange","checked","margin","_FormControlLabel","control","_Checkbox","LoginStep","ChooseProvider","AdvanceStep","VerifyAuthenticator","QuerySubmitCode","RegressStep","QueryClosePopup","QueryClearInput","SetStep","callbacks","onClearInput","useLoginPopupMultipleMethods","stepForward","stepBack","LoginPopupMultipleMethodsPresentation","selectedTwoFactorAuthentication","onBackPressed","onNextPressed","onProviderChange","onCodeUpdated","codeInputRef","useRef","current","focus","handleCodeUpdated","handleProviderChange","matchingTwoFactorAuthentication","nonLinear","inputRef","LoginPopupMultipleMethods","onTwoFactorAuthenticationChange","actions","filteredCode","LoginPopupPresentation","handlers","isDefaultTwoFactorAuthenticationMode","LoginPopupDefaultMethod","handleCodeUpdate","handleSwitchToMultipleMode","isRememberDevice","handleTwoFactorAuthenticationChange","handleClearInput","localConfig","exactCodeLength","initializer","initialState","ResendCode","QueryBeginAuthentication","SelectTwoFactorAuthentication","SetIsDefaultTwoFactorAuthenticationMode","SetIsRememberDevice","SetErrorMessage","SubmitCode","SetIsOpen","QueryGetTwoFactorAuthentications","SetTwoFactorAuthentications","defaultTwoFactorAuthentication","isDefault","UpdateCode","BeginCallAuthentication","QueryBeginCallAuthentication","isAuthenticationStarted","beginAuthentication","SetIsAuthenticationStarted","err","beginCallAuthentication","getTwoFactorAuthentications","onSuccessfulTwoFactorChallenge","authenticate","UserSessionTwoFactorStatus","Authorized","EventsService","emit","EventType","UserTwoFactorAuthenticationSuccess","getErrorMessage","apiError","useLoginPopup","LoginPopupBindings","popoverAnchor","setPopoverAnchor","handleClosePopover","handleOpenPopover","currentTarget","cursor","underline","_Popover","anchorEl","getSingleSignOnLoginRequest","getUserSessionFromCode","recaptchaKey","RECAPTCHA_V2_KEY","waitForReady","_once","resolve","window","grecaptcha","ready","getRecaptchaWidgetId","recaptchaElement","callback","sitekey","getRecaptchaResponse","recaptchaWidgetId","recaptchaResponse","getResponse","execute","isRecaptchaEnabled","resetRecaptcha","reset","declareModules","modals/genericInfoModal.html","StyledModal","BaseModal","view","constructor","params","continueButtonLabel","cancelButtonLabel","swapButtons","show","React","password","isTwoFactorCodePopupOpen","isTwoFactorSignupOpen","QueryRecaptchaWidget","maxPasswordLength","SubmitForm","QuerySubmitLoginForm","UpdatePassword","ShowTwoFactorCodeDialog","CloseTwoFactorCodeDialog","isSuccessful","getSuccessQuery","QueryLoginSuccess","ShowTwoFactorSignupDialog","CloseTwoFactorSignupDialog","UpdateErrorMessage","isBlocking","resetPassword","UpdateRecaptchaWidgetId","StartFormSubmit","QueryLogout","showPasswordError","onLogout","onLoginSuccess","recaptchaV2Response","Login","passphrase","userLoginResponse","UserLoginResponse","TwoFactorAuthenticationRequired","Successful","TwoFactorComplianceRequired","TwoFactorSignupRequired","SessionTimeoutDialog","onChangePassword","event","className","handleLogout","handleChangePassword","handleCloseTwoFactorCodePopup","handleSuccessfulTwoFactorChallenge","handleCloseSignupDialog","LoginPopup","getRoute","location","hash","formRef","samlRequestRef","handleLogin","samlRequest","submit","ref","modals/sessionTimeout.html","SessionTimeout","react","fragments","SessionTimeoutFragment","SsoSessionTimeoutDialog","showSsoTimeoutModal","pureComputed","isSingleSignOnSession","dialogPromise","segmentAnalytics","EventName","UserSignedOut","source","FormEventType","ButtonClicked","sessionTimeoutDialog","realtimeListener","RealtimeEvent","Offline","finally","off","isDisplayed","UnsavedChangesConfirmationService","hasChanges","showConfirmationDialog","Routers","Root","User","Settings","SESSION_TIMEOUT","SESSION_KILL","PING_INTERVAL","keepSessionAlive","resetSessionTimeout","$","on","_throttle","IsAuthenticated","ping","setLastSessionActionToNow","Date","now","getLastSessionAction","valueAsString","Number","parseInt","NaN","isNaN","getTimeSinceLastSession","lastSessionAction","disconnectSession","clearAuthenticationToken","resetSessionKill","waitMs","sessionKill","clearTimeout","setTimeout","timeSinceLastSession","nextWaitMs","hasAuthenticationToken","startSessionTimeout","sessionTimeout","eventArgs","didAuthenticate","reloadAfterAuthenticate","reload","Instance","API_PREFIX","CompanyDirectorUpdateBindingModel","VerificationCompanyService","system","dfd","AuthorizedGet","verificationInfo","plootoUtils","fail","promise","GetTeamVerifications","GetAccountsPinsVerified","isAllPinsVerified","VerifyCompany","formData","AuthorizedUpload","done","PostBusinessInformation","AuthorizedPost","analytics","PostBusinessDirectors","GetBusinessInformationStatus","PostCompanyBusinessDetails","personalInformation","PostCompanyAddressDetails","addressInformation","SetCompanyVerificationStatusUploadRequired","AuthorizedPut","textStatus","request","AccountVerificationStatus","AccountVerificationResult","VerificationUserService","VerifyIdentity","PostIdentityPersonalInformation","PostIdentityAddressInformation","GetAccountVerificationStatus","accountVerificationStatus","matchingField","fieldError","areScalarArraysEqualIgnoreOrder","array1","array2","array2Sorted","sort","every","areObjectsEqual","object1","object2","ignoredFields","Array","isArray","uniqueKeys","keys","concat","self","i","key","field","value1","value2","getFixedDate","fixedDate","objectDate","getTime","getTimezoneOffset","dateToYYYYMMDD","date","delimiter","formatLocalDate","ApiDateFormat","DateOnly","dateToString","DisplayDateFormat","ShortDate","BillingDebitFailedModal","isVisible","Close","Continue","PromoCodeApplyCodeViewModel","PromoCodeService","BindPaymentEventCallbacks","createdPayment","freeTransactions","freeTransactionUsed","decreaseFreeTransaction","deletedPayment","PutApplyCode","exchangeRateData","components/user/companies/capabilities/freeTrialEndedBanner","components/user/companies/capabilities/freeTrialEndedBanner.html","components/user/layout/navbar-footer","components/user/layout/navbar-footer.html","components/user/layout/navbar-top","components/user/layout/navbar-top.html","components/user/onboarding/parts/reminderBar","components/user/onboarding/parts/reminderBar.html","viewmodels/contacts/shell","viewmodels/emailmoneytransfer/shell","viewmodels/emailSubscriptions","viewmodels/forgotPassphrase","viewmodels/notFound","viewmodels/oauth/shell","viewmodels/quickbooksonline/shell","viewmodels/register","viewmodels/requests/shell","viewmodels/resetPassphrase","viewmodels/signin","viewmodels/signup","viewmodels/ssoLoadingPage","viewmodels/ssoLogin","viewmodels/user/shell","viewmodels/verificationEmailSent","viewmodels/verify/onetimeLogin","viewmodels/verify/verifyEmail","viewmodels/verifyNewEmail","viewmodels/xero/shell","views/contacts/shell.html","views/emailmoneytransfer/shell.html","views/emailSubscriptions.html","views/forgotPassphrase.html","views/notFound.html","views/oauth/shell.html","views/quickbooksonline/shell.html","views/register.html","views/requests/shell.html","views/resetPassphrase.html","views/signin.html","views/signup.html","views/ssoLoadingPage.html","views/ssoLogin.html","views/user/shell.html","views/verificationEmailSent.html","views/verify/onetimeLogin.html","views/verify/verifyEmail.html","views/verifyNewEmail.html","views/xero/shell.html","ViewModel","promoCodesService","CssBaseline","NavigateHome","hasClass","scrollTop","ShowSignIn","SwitchCompany","attached","parent","popover","trigger","html","content","click","evt","stopPropagation","parents","is","showBillingDebitFailedModalSubscription","detached","IsDemoCompany","IsDemo","FooterClass","IsLimitedDomesticPaymentsCompanyFeatureEnabled","isLimitedDomesticPaymentsFeatureEnabled","SignInVisible","instruction","fragment","config","route","isFooterPadded","activate","lastRouteChecksum","subscribe","newValue","moduleId","newRouteChecksum","toggleClass","navbar","removeClass","scroll","MIN_SCROLL_ADD","addClass","MIN_SCROLL_REMOVE","retVal","nav","buildNavigationModel","mapUnknownRoutes","guardRoute","instance","unsavedChangedConfirmationService","genericInfoModal","isSignupPhoneVerificationRequired","routers","ApprovalsTabToKey","Controls","Payments","clients","addNewClient","inviteAsClient","accounts","locked","newBankAccount","pendingPayments","pendingRequests","paymentApprovals","wizard","onboarding","connectBankAccountDialog","firstPayWizard","firstPayWizardSkipIntro","outstandingVerificationItems","validateCompanyDialog","verifyIdentity","integrations","creditCards","payments","referrals","requests","settings","accountingSoftware","controls","billing","billingItem","billingItemId","sso","userManagement","accountingFirmClients","transferFunds","prefundCad","prefundUsd","complete","selectPaymentPlan","capture","payables","paymentAdd","paymentEdit","paymentId","paymentDetails","receivables","receivableEdit","requestId","receivableDetails","contacts","contactDetails","payeeId","contactEdit","approvals","default","tab","isRestrictedToMyPayments","activeTab","itemId","Mine","All","companySelect","signIn","signInWithEmail","observables","combineFunction","options","results","observable","mapFunction","mapAsync","reduceResults","reduce"],"sourceRoot":""}