= (props) => ;\n","import { FeedbackDialog } from '@ori-ui/components';\nimport { Button, styled } from '@ori-ui/mui';\nimport useTestId from '@ori/testid-generator';\nimport React from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport { useTranslations } from '../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport type { IConfirmDialogProps } from '../../interfaces';\nimport { TranslationKey } from '../../models';\n\nconst StyledFeedbackDialog = styled(FeedbackDialog)(({ theme }) => ({\n '& .MuiPaper-root': {\n maxWidth: '600px',\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n maxWidth: '100%',\n position: 'absolute',\n bottom: 0,\n margin: 0,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n}));\n\nconst ButtonDelete = styled(Button)(({ theme }) => ({\n background: theme.palette.error.main,\n color: theme.palette.primary.contrastText,\n '&:hover, &:focus': {\n background: theme.palette.error.main,\n color: theme.palette.primary.contrastText,\n },\n}));\n\nconst ButtonCancel = styled(Button)(({ theme }) => ({\n textDecoration: 'underline',\n '&:hover, &:focus': {\n background: 'inherit',\n textDecoration: 'underline',\n boxShadow: 'none',\n },\n}));\n\nconst children = (props: IConfirmDialogProps) => {props.children}
;\n\nconst withConfirm =\n (WrappedComponent: React.ComponentType
) =>\n (props: P) => {\n const { opened, handleConfirm, handleCancel } = props;\n const { formatMessage } = useTranslations();\n const { getTestIdProps } = useTestId();\n\n return (\n \n \n ,\n \n \n ,\n ]}\n >\n \n \n );\n };\n\nexport const ConfirmDeleteDialog = withConfirm(children);\n","import { useToken } from '@ori/auth';\nimport type { AxiosError, AxiosRequestConfig } from 'axios';\nimport axios from 'axios';\nimport useSWR from 'swr';\n\nimport { useConfiguration, useNotificationData } from '../../../contexts';\nimport { useTranslations } from '../../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport { MessageType } from '../../../interfaces';\nimport { TranslationKey } from '../../TranslationKey_simplified-registration-BrandPartner';\n\nconst axiosClient = axios.create();\n\nconst getEncodedFile = (blob: Blob): string => URL.createObjectURL(blob);\n\ninterface FetcherParams {\n url: string;\n tenant: string;\n registrationId: string;\n formattedToken: string;\n previewSize?: { height?: number; width?: number };\n}\n\nexport function useDocumentThumb(\n customerId: number | null,\n documentId?: number | null,\n previewSize?: { height?: number; width?: number },\n) {\n const { globalApiUrl, tenant, registrationId } = useConfiguration();\n const { formattedToken } = useToken();\n const { formatMessage } = useTranslations();\n\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const errorMeesage = formatMessage(TranslationKey.cannotGetData);\n\n const thumbUrl = `${globalApiUrl}/customers/${customerId}/documents/${documentId}/image`;\n const shouldFetch = Boolean(customerId && documentId && documentId !== -1);\n const fetchKey = shouldFetch ? `thumb-${customerId}-${documentId}` : null;\n\n const fetcher = async ({\n url,\n tenant,\n registrationId,\n formattedToken,\n previewSize,\n }: FetcherParams): Promise => {\n try {\n const headers: AxiosRequestConfig['headers'] = {\n 'x-tenant-context': tenant,\n 'x-registration-id': registrationId,\n Authorization: formattedToken,\n };\n const response = await axiosClient.get(url, {\n headers,\n responseType: 'blob',\n params: previewSize,\n });\n return getEncodedFile(response.data);\n } catch (error) {\n setNotificationData({\n isOpen: true,\n message: errorMeesage,\n type: MessageType.error,\n messageId: 'cannotGetData',\n });\n const axiosError = error as AxiosError;\n throw new Error(axiosError.message);\n }\n };\n\n const { data: documentURL } = useSWR(\n fetchKey ? [fetchKey, { url: thumbUrl, tenant, registrationId, formattedToken, previewSize }] : null,\n () => fetcher({ url: thumbUrl, tenant, registrationId, formattedToken, previewSize }),\n );\n\n return documentURL;\n}\n","import { useToken } from '@ori/auth';\nimport type { AxiosError, AxiosRequestConfig } from 'axios';\nimport axios from 'axios';\nimport useSWR from 'swr';\n\nimport { useConfiguration, useNotificationData } from '../../../contexts';\nimport { useTranslations } from '../../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport { MessageType } from '../../../interfaces';\nimport { TranslationKey } from '../../TranslationKey_simplified-registration-BrandPartner';\n\nconst axiosClient = axios.create();\n\nconst getEncodedFile = (blob: Blob): string => URL.createObjectURL(blob);\n\ninterface FetcherParams {\n url: string;\n tenant: string;\n registrationId: string;\n formattedToken: string;\n previewSize?: { height?: number; width?: number };\n}\n\nexport function useDocumentThumbDetail(\n customerId: number | null,\n documentId?: number | null,\n previewSize?: { height?: number; width?: number },\n) {\n const { globalApiUrl, tenant, registrationId } = useConfiguration();\n const { formattedToken } = useToken();\n const { formatMessage } = useTranslations();\n\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const errorMeesage = formatMessage(TranslationKey.cannotGetData);\n\n const thumbDetailUrl = `${globalApiUrl}/customers/${customerId}/documents/${documentId}/image`;\n\n const shouldFetch = Boolean(customerId && documentId && documentId !== -1);\n const fetchKey = shouldFetch ? `thumbDetail-${customerId}-${documentId}` : null;\n\n const fetcher = async ({\n url,\n tenant,\n registrationId,\n formattedToken,\n previewSize,\n }: FetcherParams): Promise => {\n try {\n const headers: AxiosRequestConfig['headers'] = {\n 'x-tenant-context': tenant,\n 'x-registration-id': registrationId,\n Authorization: formattedToken,\n };\n const response = await axiosClient.get(url, {\n headers,\n responseType: 'blob',\n params: previewSize,\n });\n return getEncodedFile(response.data);\n } catch (error) {\n setNotificationData({\n isOpen: true,\n message: errorMeesage,\n type: MessageType.error,\n messageId: 'cannotGetData',\n });\n const axiosError = error as AxiosError;\n throw new Error(axiosError.message);\n }\n };\n\n const { data: documentURL } = useSWR(\n fetchKey ? [fetchKey, { url: thumbDetailUrl, tenant, registrationId, formattedToken, previewSize }] : null,\n () => fetcher({ url: thumbDetailUrl, tenant, registrationId, formattedToken, previewSize }),\n );\n\n return documentURL;\n}\n","import { IconButton } from '@ori-ui/components';\nimport { Document, Clear } from '@ori-ui/icons';\nimport { Tooltip, Avatar, Dialog, DialogContent, DialogTitle, styled } from '@ori-ui/mui';\nimport useTestId from '@ori/testid-generator';\nimport type { MouseEvent, FC, ReactElement } from 'react';\nimport { useState, useEffect, useCallback } from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport type { IThumb, IDetailImage } from '../../interfaces';\nimport { TranslationKey } from '../../models';\nimport { useDocumentThumb, useDocumentThumbDetail, useRegistrationData } from '../../models/api';\nimport { Loading } from '../Loading';\n\nconst imagePreviewThumbSize = 80;\nconst imagePreviewDetailSize = 500;\n\nconst StyledDialogContent = styled(DialogContent)(({ theme }) => ({\n position: 'relative',\n minWidth: '60px',\n minHeight: '40px',\n}));\n\nconst CloseButton = styled(IconButton)(({ theme }) => ({\n position: 'absolute',\n top: 0,\n right: '6px',\n}));\n\nconst StyledAvatar = styled(Avatar)(({ theme }) => ({\n width: '80px',\n height: '80px',\n borderRadius: 0,\n background: 'transparent',\n color: theme.palette.text.primary,\n textDecoration: 'none',\n cursor: 'pointer',\n}));\n\nconst DocumentIcon = styled(Document)(({ theme }) => ({\n fontSize: '38px',\n}));\n\ninterface IThumbWithDetailProps {\n fileName: string;\n documentId: number;\n}\n\nexport const ThumbWithDetail: FC = (props) => {\n const { fileName, documentId } = props;\n\n const [detailOpened, setDetailOpened] = useState(false);\n const [imageThumb, setImageThumb] = useState({});\n const [imageDetail, setImageDetail] = useState({});\n\n const { data: registrationData } = useRegistrationData();\n\n const customerId = registrationData?.customerId ?? null;\n\n const documentThumbUrl = useDocumentThumb(customerId, documentId, {\n height: imagePreviewThumbSize,\n width: imagePreviewThumbSize,\n });\n\n const documentThumbDetailUrl = useDocumentThumbDetail(customerId, documentId, {\n height: imagePreviewDetailSize,\n width: imagePreviewDetailSize,\n });\n\n const { getTestIdProps } = useTestId();\n\n const mountOrUpdate = useCallback(() => {\n if (\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- is not always truthy we need this conditon\n imageThumb &&\n !imageThumb[documentId] &&\n /\\.(jpg|jpeg|png|bmp)$/gi.test(fileName) &&\n documentId > 0 &&\n customerId\n ) {\n const currentImages = {};\n setImageThumb({ ...currentImages, [documentId]: documentThumbUrl });\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps --- not needed other property\n }, [customerId, documentId, fileName, imageThumb]);\n\n useEffect(() => {\n mountOrUpdate();\n }, [customerId, mountOrUpdate]);\n\n const getDetailImage = (fileNameProperty: string) => {\n const imgUrl = imageDetail[documentId];\n if (imgUrl && detailOpened) {\n return (\n
\n );\n }\n\n return ;\n };\n\n const handleOpenDetail = (event: MouseEvent) => {\n event.preventDefault();\n setDetailOpened(true);\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- is not always truthy we need this conditon\n if (imageDetail && !imageDetail[documentId] && customerId) {\n const currentImages = {};\n setImageDetail({ ...currentImages, [documentId]: documentThumbDetailUrl });\n // await fetchImageDetail(customerId, documentId);\n }\n };\n\n const handleDetailClose = () => {\n setDetailOpened(false);\n };\n\n const getAvatar = (): ReactElement => {\n if (/\\.(jpg|jpeg|png|bmp)$/gi.test(fileName) && documentId > 0) {\n const thumb = imageThumb[documentId];\n\n return (\n \n }\n onClick={handleOpenDetail}\n {...getTestIdProps('thum-with-detail-tooltip-open-detail')}\n >\n \n \n );\n }\n\n return ;\n };\n\n const avatar = getAvatar();\n const detailImage = getDetailImage(fileName);\n\n return (\n <>\n {avatar}\n \n >\n );\n};\n","import { useToken } from '@ori/auth';\nimport type { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport axios from 'axios';\nimport useSWR from 'swr';\n\nimport { useConfiguration } from '../../../contexts';\n\nconst axiosClient = axios.create();\n\nconst getEncodedFile = (blob: Blob): string => URL.createObjectURL(blob);\n\nexport function useCustomerDocument(customerId: number | null, documentId?: number | null) {\n const { globalApiUrl, tenant, registrationId } = useConfiguration();\n const { formattedToken } = useToken();\n const shouldFetch = Boolean(\n customerId !== null && documentId !== null && documentId !== undefined && documentId !== -1,\n );\n const url = `${globalApiUrl}/customers/${customerId}/documents/${documentId}`;\n\n const { data: document } = useSWR(shouldFetch ? url.toString() : null, async (requestUrl: string) => {\n const headers: AxiosRequestConfig['headers'] = {\n 'x-tenant-context': tenant,\n 'x-registration-id': registrationId,\n };\n headers.Authorization = formattedToken;\n const { data } = await axiosClient\n .get(requestUrl, {\n headers,\n responseType: 'blob',\n })\n .then((blob) => blob)\n .catch((error: AxiosResponse) => error);\n\n return data;\n });\n\n return document === undefined ? undefined : getEncodedFile(document);\n}\n","import { Tooltip, styled, useTheme } from '@ori-ui/mui';\nimport type { GlobalCustomersDocumentApprovalDtoApprovalState } from '@ori/global-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { FC, ReactElement } from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport { TranslationKey } from '../../models';\n\nconst RootContainer = styled('div')(({ theme }) => ({\n fontSize: '12px',\n fontWeight: 'bold',\n lineHeight: '17px',\n textTransform: 'uppercase',\n}));\n\nconst StyledSpanLabel = styled('span')(({ theme }) => ({\n padding: '2px 15px',\n borderRadius: '5px',\n color: theme.palette.primary.contrastText,\n}));\n\ninterface IDocumentStateProps {\n state: GlobalCustomersDocumentApprovalDtoApprovalState;\n reason?: string;\n}\n\nexport const DocumentState: FC = (props) => {\n const { state, reason }: IDocumentStateProps = props;\n\n const theme = useTheme();\n\n const { getTestIdProps } = useTestId();\n\n const getLocalization = (approvalState: GlobalCustomersDocumentApprovalDtoApprovalState): ReactElement => {\n switch (approvalState) {\n case 'Approved':\n return (\n \n );\n case 'Pending':\n return (\n \n );\n case 'Rejected':\n return (\n \n );\n default:\n return (\n \n );\n }\n };\n\n const getStateColor = (approvalState: GlobalCustomersDocumentApprovalDtoApprovalState): string => {\n switch (approvalState) {\n case 'Approved':\n return theme.palette.secondary.main;\n case 'Pending':\n return theme.palette.warning.main;\n default:\n return 'transparent';\n }\n };\n\n const stateElement = (\n \n {getLocalization(state)}\n \n );\n\n if (reason) {\n return (\n \n {stateElement}\n \n );\n }\n\n return stateElement;\n};\n","import { Clear, ErrorCircle } from '@ori-ui/icons';\nimport { styled, LinearProgress } from '@ori-ui/mui';\n\nconst flexCenter = {\n display: 'flex',\n alignItems: 'center',\n};\n\nexport const StyledListItem = styled('li')(({ theme }) => ({\n position: 'relative',\n borderBottom: `1px solid ${theme.palette.grey[200]}`,\n '&:last-child': {\n borderBottom: 'none',\n },\n}));\n\nexport const StyledDivContent = styled('div')(({ theme }) => ({\n ...flexCenter,\n justifyContent: 'space-between',\n}));\n\nexport const StyledSpanInfo = styled('span')(({ theme }) => ({\n ...flexCenter,\n maxWidth: 'calc(100% - 50px)',\n width: '100%',\n}));\n\nexport const StyledSpanThumb = styled('span')(({ theme }) => ({\n ...flexCenter,\n justifyContent: 'center',\n minWidth: '80px',\n minHeight: '80px',\n marginRight: theme.spacing(3),\n}));\n\nexport const StyledSpanActions = styled('span')(({ theme }) => ({\n ...flexCenter,\n justifyContent: 'flex-end',\n}));\n\nexport const StyledSpanFile = styled('span')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n width: '100%',\n}));\n\nexport const StyledSpanFileName = styled('span')(({ theme }) => ({\n display: 'block',\n overflow: 'hidden',\n color: theme.palette.text.primary,\n fontSize: '14px',\n lineHeight: '19px',\n textOverflow: 'ellipsis',\n whitespace: 'nowrap',\n}));\n\nexport const StyledSpanFileNameLink = styled('a')(({ theme }) => ({\n display: 'block',\n overflow: 'hidden',\n color: theme.palette.text.primary,\n fontSize: '14px',\n lineHeight: '19px',\n textOverflow: 'ellipsis',\n whitespace: 'nowrap',\n cursor: 'pointer',\n '&:hover': {\n color: theme.palette.primary.main,\n textDecoration: 'underline',\n },\n}));\n\nexport const StyledSpanFileSize = styled('span')(({ theme }) => ({\n color: theme.palette.grey.A700,\n fontSize: '11px',\n lineHeight: '18px',\n}));\n\nexport const StyledErrorIcon = styled(ErrorCircle)(({ theme }) => ({\n color: theme.palette.error.main,\n fontSize: '35px',\n lineHeight: '24px',\n}));\n\nexport const StyledDeleteIcon = styled(Clear)(({ theme }) => ({\n fontSize: '23px',\n lineHeight: '16px',\n '&:hover': {\n background: 'transparent',\n color: theme.palette.primary.main,\n },\n marginRight: theme.spacing(3),\n}));\n\nexport const StyledProgress = styled(LinearProgress)(({ theme }) => ({\n position: 'absolute',\n right: 0,\n bottom: '5px',\n left: 0,\n}));\n","import type {\n GlobalCustomersDocumentApprovalDto,\n GlobalCustomersDocumentApprovalDtoApprovalState,\n} from '@ori/global-api-client-react';\nimport type { FC, MouseEvent, ReactElement } from 'react';\n\nimport type { IDocumentsInfo } from '../../interfaces';\nimport { useCustomerDocument, useRegistrationData } from '../../models/api';\nimport { DocumentState } from '../Document/DocumentState';\nimport {\n StyledSpanFile,\n StyledSpanFileName,\n StyledSpanFileNameLink,\n StyledSpanFileSize,\n} from './DocumentItemStyledComponents';\n\ninterface IDocumentItemFileProps {\n document: IDocumentsInfo;\n visibleApprovalState?: boolean;\n}\n\nconst bytesInKb = 1024;\n\nexport const DocumentItemFile: FC = (props) => {\n const { document, visibleApprovalState } = props;\n\n const { data: registrationData } = useRegistrationData();\n\n const customerId = registrationData?.customerId ?? null;\n\n const documentItemUrl = useCustomerDocument(customerId, document.documentId);\n\n const handleDownloadDocument = (event: MouseEvent) => {\n const link = event.target as HTMLLinkElement;\n\n if (!link.href) {\n event.preventDefault();\n\n const documentUrl = documentItemUrl ?? '';\n if (documentUrl !== '') {\n link.href = documentUrl;\n link.click();\n }\n }\n };\n\n const getDocumentItemLink = () => {\n const { fileName, documentId }: IDocumentsInfo = document;\n\n if (fileName && documentId && documentId < 0) {\n return {fileName};\n }\n\n if (fileName) {\n return {fileName};\n }\n\n return null;\n };\n\n const getDocumentSize = () => {\n const { fileSize }: IDocumentsInfo = document;\n const hundred = 100;\n const size = Math.round((fileSize ? fileSize / bytesInKb / bytesInKb : 0) * hundred) / hundred;\n\n return {size} MB;\n };\n\n const getApprovalState = (approval?: GlobalCustomersDocumentApprovalDto): ReactElement | null => {\n if (visibleApprovalState) {\n // if there is no approval information in document data,\n // it is automatically in \"Pending\" state\n let approvalState: GlobalCustomersDocumentApprovalDtoApprovalState = 'Pending';\n let approvalReason;\n\n if (approval?.approvalState) {\n const { approvalState: state, reason }: GlobalCustomersDocumentApprovalDto = approval;\n approvalState = state;\n approvalReason = reason;\n }\n\n return (\n \n );\n }\n\n return null;\n };\n\n return (\n \n {getDocumentItemLink()}\n {getDocumentSize()}\n {getApprovalState(document.approval)}\n \n );\n};\n","import { Tooltip, Typography } from '@ori-ui/mui';\nimport useTestId from '@ori/testid-generator';\nimport type { FC } from 'react';\nimport { useState } from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport type { IDocumentItemProps, IDocumentsInfo } from '../../interfaces';\nimport { TranslationKey } from '../../models';\nimport { ConfirmDeleteDialog } from '../ConfirmDeleteDialog';\nimport { ThumbWithDetail } from '../ThumbWithDetail';\nimport { DocumentItemFile } from './DocumentItemFile';\nimport {\n StyledDeleteIcon,\n StyledDivContent,\n StyledErrorIcon,\n StyledListItem,\n StyledProgress,\n StyledSpanActions,\n StyledSpanInfo,\n StyledSpanThumb,\n} from './DocumentItemStyledComponents';\n\nexport const DocumentItem: FC = (props) => {\n const {\n onDocumentRemove,\n document,\n isShowApprovalState,\n canDelete,\n errorMessage,\n isDeleteConfirmationRequired,\n uploadProgress,\n } = props;\n\n const [confirmOpened, setConfirmOpened] = useState(false);\n const { getTestIdProps } = useTestId();\n\n const confirmDelete = () => setConfirmOpened(true);\n\n const confirmCanceled = () => setConfirmOpened(false);\n\n const removeDocument = () => {\n if (onDocumentRemove && document.documentId) {\n onDocumentRemove(document.documentId);\n }\n };\n\n const deleteDocument = () => {\n if (onDocumentRemove) {\n onDocumentRemove(document.documentId);\n }\n\n setConfirmOpened(false);\n };\n\n const getDeleteButton = () => {\n const deleteAction = errorMessage || !isDeleteConfirmationRequired ? removeDocument : confirmDelete;\n\n if (canDelete || errorMessage) {\n return (\n \n );\n }\n\n return null;\n };\n\n const getProgressBar = () => {\n if (uploadProgress) {\n return (\n \n );\n }\n\n return null;\n };\n\n const getThumb = () => {\n const { fileName, documentId }: IDocumentsInfo = document;\n if (fileName && documentId) {\n return (\n \n );\n }\n\n return null;\n };\n\n const getError = () => {\n if (errorMessage) {\n return (\n \n \n \n );\n }\n\n return null;\n };\n\n return (\n \n \n \n {getThumb()}\n \n \n \n {getError()}\n {getDeleteButton()}\n \n \n {getProgressBar()}\n \n \n \n \n \n \n );\n};\n","import type { IDocumentItemProps, IDocumentsInfo, IDocumentsInfoStoreData } from '../../interfaces';\nimport { DocumentItem } from '../DocumentItem';\n\nconst mapToDocumentItemProps = (\n documentStoreData: IDocumentsInfoStoreData,\n canDelete: boolean,\n isShowApprovalState: boolean,\n deleteConfirmationRequired: boolean,\n removeDocument?: (documentId: number) => void,\n): IDocumentItemProps => {\n const document: IDocumentsInfo = {\n approval: documentStoreData.approval,\n documentId: documentStoreData.documentId,\n fileName: documentStoreData.fileName ?? '',\n fileSize: documentStoreData.fileSize,\n };\n\n return {\n document,\n canDelete,\n isShowApprovalState,\n onDocumentRemove: removeDocument,\n isDeleteConfirmationRequired: deleteConfirmationRequired || false,\n };\n};\n\nconst getFilesInProgress = (filesInProgress: IDocumentItemProps[], removeFile?: (fileKey: number) => void) => {\n const filesItems = filesInProgress.map((document) => ({\n ...document,\n onDocumentRemove: removeFile,\n }));\n\n return filesItems;\n};\n\nconst isDocumentPending = (document: IDocumentsInfoStoreData): boolean =>\n !document.approval || document.approval.approvalState === 'Pending';\n\nconst renderDocumentItem = (documentProps: IDocumentItemProps, key: number) => (\n \n);\n\nexport { mapToDocumentItemProps, getFilesInProgress, isDocumentPending, renderDocumentItem };\n","import { ArrowDownThin, HelpCircle } from '@ori-ui/icons';\nimport { styled, CircularProgress, Typography } from '@ori-ui/mui';\n\nexport const RootContainer = styled('div')(({ theme }) => ({\n position: 'relative',\n width: '100%',\n}));\n\nexport const StyledTitle = styled(Typography)(({ theme }) => ({\n marginLeft: theme.spacing(1),\n}));\n\nexport const StyledRequiredDocument = styled('div')(({ theme }) => ({\n color: theme.palette.error.dark,\n}));\n\nexport const StyledDivHeader = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'flex-end',\n justifyContent: 'space-between',\n marginTop: theme.spacing(6),\n}));\n\nexport const StyledHelpCircle = styled(HelpCircle)(({ theme }) => ({\n marginRight: theme.spacing(3),\n color: theme.palette.grey[300],\n fontSize: '29px',\n}));\n\nexport const StyledLabel = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n}));\n\nexport const StyledList = styled('ul')(({ theme }) => ({\n margin: 0,\n padding: 0,\n listStyle: 'none',\n}));\n\nexport const StyledListPending = styled('ul')(({ theme }) => ({\n margin: 0,\n padding: 0,\n listStyle: 'none',\n position: 'relative',\n zIndex: 2,\n overflow: 'hidden',\n borderRadius: '5px',\n boxShadow: '0 0 7px 0 rgba(0, 0, 0, 0.3)',\n}));\n\nexport const StyledDivWrapper = styled('div')<{ ownerState: { hasDocuments?: boolean } }>(\n ({ theme, ownerState: { hasDocuments = false } }) => ({\n marginBottom: hasDocuments ? theme.spacing(4) : theme.spacing(0),\n position: 'relative',\n }),\n);\n\nexport const StyledDivUploader = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBottom: theme.spacing(4),\n}));\n\nexport const StyledDivHistory = styled('div')(({ theme }) => ({\n borderTop: `1px solid ${theme.palette.grey[200]}`,\n}));\n\nexport const StyledExpanedIcon = styled(ArrowDownThin)(({ theme }) => ({\n flexDirection: 'row-reverse',\n padding: '5px 10px',\n transition: 'transform 0.3s ease-out',\n fontSize: '22px',\n lineHeight: '23px',\n margin: '0 5px',\n cursor: 'pointer',\n}));\n\nexport const StyledDivExpander = styled('div')(({ theme }) => ({\n borderBottom: `1px solid ${theme.palette.grey[200]}`,\n}));\n\nexport const StyledDivFileInput = styled('div')(({ theme }) => ({\n display: 'flex',\n width: '100%',\n '& > form': {\n width: '100%',\n minWidth: '120px',\n },\n}));\n\nexport const StyledProgress = styled(CircularProgress)(({ theme }) => ({\n marginRight: theme.spacing(2),\n}));\n\nexport const StyledDivBoxExpandHistory = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n cursor: 'pointer',\n fontSize: '14px',\n transition: 'all 0.3s ease-out',\n '&:hover': {\n color: theme.palette.primary.main,\n },\n}));\n","import type { FC } from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport type { IDocumentItemProps, IDocumentsInfo2, IDocumentsInfoStoreData } from '../../interfaces';\nimport { TranslationKey } from '../../models';\nimport { DocumentItem } from '../DocumentItem';\nimport {\n StyledDivBoxExpandHistory,\n StyledDivExpander,\n StyledDivHistory,\n StyledExpanedIcon,\n StyledList,\n} from './DocumentStyledComponents';\n\ninterface IDocumentHistoryProps {\n temporaryDocument: boolean;\n historyExpanded: boolean;\n documentIds?: number[];\n documentTypeId: number;\n deleteConfirmationRequired: boolean;\n editableDocument?: boolean;\n histroyDocumentsInfoData?: IDocumentsInfo2[];\n removeDocument?: (documentId: number) => void;\n handleToggleClick: () => void;\n documentPending: (document: IDocumentsInfoStoreData) => boolean;\n mapToDocumentItemProps: (\n documentStoreData: IDocumentsInfoStoreData,\n canDelete: boolean,\n isShowApprovalState: boolean,\n deleteConfirmationRequired: boolean,\n removeDocument?: (documentId: number) => void,\n ) => IDocumentItemProps;\n}\n\nconst renderDocumentItem = (documentProps: IDocumentItemProps, key: number) => (\n \n);\n\nexport const DocumentHistory: FC = (props) => {\n const {\n temporaryDocument,\n historyExpanded,\n documentIds,\n documentTypeId,\n deleteConfirmationRequired,\n histroyDocumentsInfoData,\n handleToggleClick,\n documentPending,\n mapToDocumentItemProps,\n removeDocument,\n } = props;\n\n const getInfoByType = (typeId?: number, includeTemporary?: boolean) =>\n histroyDocumentsInfoData\n ?.filter((info) => {\n const isTemporary = includeTemporary ?? false;\n\n return info.documentTypeId === typeId && (!info.isTemporary || isTemporary);\n })\n .sort((a, b) => {\n if (a.createdDate.getTime() && b.createdDate.getTime()) {\n return a.createdDate.getTime() - b.createdDate.getTime();\n }\n\n return 0;\n }) as IDocumentsInfoStoreData[];\n\n const getHistoryDocuments = (): IDocumentItemProps[] => {\n if (!documentIds?.length) {\n return [];\n }\n\n const documentItems: IDocumentItemProps[] = getInfoByType(documentTypeId, temporaryDocument)\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- we need this condition\n ?.filter((document) => documentIds.includes(document.documentId) && !documentPending(document))\n .map((document) => mapToDocumentItemProps(document, false, true, deleteConfirmationRequired, removeDocument));\n\n return documentItems;\n };\n\n const renderHistory = () => {\n const documents = getHistoryDocuments();\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- is not alway truthy we need this condition\n const existingDocuments = documents && documents.length > 0;\n if (!existingDocuments) {\n return null;\n }\n\n return (\n \n \n {documents.map(renderDocumentItem)}\n \n handleToggleClick()}>\n \n \n \n \n );\n };\n\n const documentsHistory = renderHistory();\n\n return {documentsHistory};\n};\n","import { CheckHeavy } from '@ori-ui/icons';\nimport useTestId from '@ori/testid-generator';\nimport type { FC } from 'react';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport { TranslationKey } from '../../models';\nimport { StyledProgress } from './DocumentStyledComponents';\n\ninterface IDocumentLoadingProgressProps {\n uploading: boolean;\n uploadFinished: boolean;\n}\n\nconst classes = {\n uploadProgress: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n fontSize: '16px',\n fontWeight: 'bold',\n lineHeight: '23px',\n },\n uploadProgressDone: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n fontSize: '16px',\n fontWeight: 'bold',\n lineHeight: '23px',\n '&::before': {\n margin: '-4px 8px 0 10px',\n fontSize: '22px',\n lineHeight: '22px',\n },\n },\n};\n\nexport const DocumentLoadingProgress: FC = (props) => {\n const { uploading, uploadFinished } = props;\n const { getTestIdProps } = useTestId();\n\n const renderLoadingProgress = () => {\n const progressSize = 16;\n const textUploading = (\n \n );\n const textDone = (\n \n );\n const progress = (\n \n );\n\n return (\n \n {uploading ? progress : null}\n {uploadFinished ? textDone : textUploading}\n \n );\n };\n\n const documentLoadingProgress = uploading || (uploadFinished && renderLoadingProgress());\n\n return {documentLoadingProgress}
;\n};\n","import type {\n GlobalCustomerRegistrationsRegistrationLegalDetailsDto,\n GlobalCustomersDocumentTypeDto,\n} from '@ori/global-api-client-react';\nimport type { StaticCustomersMetadataIdentityCardDocumentPropertyDto } from '@ori/static-api-client-react';\nimport type { FC } from 'react';\nimport { useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport type { IDocumentItemProps, IDocumentsInfoStoreData } from '../../interfaces';\nimport { TranslationKey } from '../../models';\nimport { useCustomerDocumentsInfos } from '../../models/api';\nimport { DatePickerField, SelectFormFieldByConfig, TextFormFieldByConfig } from '../FieldsByConfig';\nimport type { IFileUploadResult, IUploaderProps, IUploadResult } from '../Uploader';\nimport { Uploader } from '../Uploader';\nimport { getFilesInProgress, isDocumentPending, mapToDocumentItemProps, renderDocumentItem } from './DocumentActions';\nimport { DocumentHistory } from './DocumentHistory';\nimport { DocumentLoadingProgress } from './DocumentLoadingProgress';\nimport { StyledDivFileInput, StyledDivUploader, StyledDivWrapper, StyledListPending } from './DocumentStyledComponents';\n\ninterface IDocumentContentProps {\n documentTypeId: number;\n documentIds: number[];\n deleteConfirmationRequired?: boolean;\n editableDocument?: boolean;\n handleDocumentsChange?: (documentIds: number[]) => void;\n documentType?: GlobalCustomersDocumentTypeDto;\n documentInpuName: string;\n configDocument?: StaticCustomersMetadataIdentityCardDocumentPropertyDto;\n documentIsRequired: boolean;\n}\n\nexport const DocumentContent: FC = (props) => {\n const {\n documentIds,\n documentTypeId,\n deleteConfirmationRequired,\n documentType,\n editableDocument,\n documentInpuName,\n configDocument,\n documentIsRequired,\n handleDocumentsChange,\n } = props;\n\n const isTemporaryDocument = true;\n const hasDocuments = documentIds.length > 0;\n\n const [isHistoryExpanded, setIsHistoryExpanded] = useState(false);\n const [isUploading, setIsUploading] = useState(false);\n const [isUploadFinished, setIsUploadFinished] = useState(false);\n const [filesInProgress, setFilesInProgress] = useState([]);\n const [fetchKey, setFetchKey] = useState('');\n\n const { watch } = useFormContext();\n const values = watch();\n\n const { data: documentsInfoData } = useCustomerDocumentsInfos(fetchKey);\n\n const isDeleteConfirmationRequired = deleteConfirmationRequired ?? false;\n\n const setDefaultState = () => {\n setIsHistoryExpanded(false);\n setIsUploading(false);\n setIsUploadFinished(false);\n };\n\n const removeFile = (fileKey: number) => {\n setDefaultState();\n setFilesInProgress((previousState) =>\n previousState.filter((documentData) => documentData.document.documentId !== fileKey),\n );\n };\n\n const fileUploadFinished = (fileUploadResult: IFileUploadResult) => {\n const { isSuccess, fileKey, message }: IFileUploadResult = fileUploadResult;\n\n if (!isSuccess && fileKey < 0 && Boolean(message)) {\n setDefaultState();\n setFilesInProgress((previousState) =>\n previousState.map((documentData) => {\n const copyDocumentData = { ...documentData };\n if (copyDocumentData.document.documentId === fileKey) {\n copyDocumentData.errorMessage = message;\n }\n\n return copyDocumentData;\n }),\n );\n }\n };\n\n const uploadProgress = (progress: number, fileKey: number) => {\n setDefaultState();\n setFilesInProgress((previousState) =>\n previousState.map((documentData) => {\n const copyDocumentData = { ...documentData };\n if (copyDocumentData.document.documentId === fileKey) {\n copyDocumentData.uploadProgress = progress;\n }\n\n return copyDocumentData;\n }),\n );\n };\n\n const uploadStart = (files: FileList) => {\n const negativeOne = -1;\n // eslint-disable-next-line unicorn/prefer-spread -- we want this writing\n const uploadFilesInProgress: IDocumentItemProps[] = Array.from(files).map((file, key) => ({\n document: {\n documentId: (key + 1) * negativeOne,\n fileName: file.name,\n fileSize: file.size,\n },\n isDeleteConfirmationRequired: false,\n }));\n\n setFilesInProgress(uploadFilesInProgress);\n setIsUploading(true);\n };\n\n const showUploadFinishedMessage = () => {\n setIsUploadFinished(true);\n setIsUploading(false);\n\n const messageHideTimeout = 2000;\n setTimeout(() => {\n setIsUploadFinished(false);\n setIsUploading(false);\n }, messageHideTimeout);\n };\n\n const triggerDocumentsChange = (propertyDocumentIds: number[]) => {\n if (handleDocumentsChange) {\n handleDocumentsChange(propertyDocumentIds);\n }\n };\n\n const uploadFinished = (result: IUploadResult) => {\n showUploadFinishedMessage();\n setFetchKey(Date.now().toString());\n const uploadedDocuments = result.uploadedFiles.filter((d) => d.documentId && d.documentId > 0 && d.isSuccess);\n\n if (uploadedDocuments.length === 0) {\n return;\n }\n const uploadedDocumentIds = uploadedDocuments.map((d) => d.documentId ?? 0);\n const correctDocumentIds = documentIds.length > 0 ? documentIds : [];\n const newDocumentIds = documentType?.allowMultipleDocuments\n ? [...correctDocumentIds, ...uploadedDocumentIds]\n : uploadedDocumentIds.slice(0, 1);\n\n triggerDocumentsChange(newDocumentIds);\n\n uploadedDocuments.forEach((d) => removeFile(d.fileKey));\n };\n\n const removeDocument = (documentId: number) => {\n const newDocuments = documentIds.filter((id) => id !== documentId);\n\n triggerDocumentsChange(newDocuments);\n };\n\n const getInfoByType = (typeId?: number, includeTemporary?: boolean) =>\n documentsInfoData\n ?.filter((info) => {\n const isTemporary = includeTemporary ?? false;\n\n return info.documentTypeId === typeId && (!info.isTemporary || isTemporary);\n })\n .sort((a, b) => {\n if (a.createdDate.getTime() && b.createdDate.getTime()) {\n return a.createdDate.getTime() - b.createdDate.getTime();\n }\n\n return 0;\n }) as IDocumentsInfoStoreData[];\n\n const getDocuments = () => {\n if (documentIds.length === 0) {\n return [];\n }\n const items = documentsInfoData ? getInfoByType(documentTypeId, isTemporaryDocument) : [];\n const documentItems: IDocumentItemProps[] = items\n .filter((document) => documentIds.includes(document.documentId) && isDocumentPending(document))\n .map((document) =>\n mapToDocumentItemProps(document, Boolean(editableDocument), true, isDeleteConfirmationRequired, removeDocument),\n );\n\n return documentItems;\n };\n\n const renderDocuments = () => {\n const getfilesInProgress: IDocumentItemProps[] = getFilesInProgress(filesInProgress, removeFile);\n const documents: IDocumentItemProps[] = getDocuments();\n\n const documentsToRender = [...documents, ...getfilesInProgress];\n\n if (documentsToRender.length > 0) {\n return {documentsToRender.map(renderDocumentItem)};\n }\n\n return null;\n };\n\n const handleToggleClick = () => {\n setDefaultState();\n setIsHistoryExpanded(!isHistoryExpanded);\n };\n\n let fileInputProps: IUploaderProps = {\n isTemporary: isTemporaryDocument,\n handleFileUploaded: fileUploadFinished,\n handleUploadFinished: uploadFinished,\n handleUploadStart: uploadStart,\n handleFileUploadProgress: uploadProgress,\n inputName: documentInpuName,\n isRequired: documentIsRequired,\n };\n\n if (documentType) {\n fileInputProps = {\n ...fileInputProps,\n accept: documentType.supportedMimeTypes,\n documentTypeId: documentType.documentTypeId,\n maxFileSize: documentType.maxDataSize,\n isMultiple: documentType.allowMultipleDocuments,\n };\n }\n\n const uploaderDocument = () =>\n editableDocument ? (\n \n \n \n \n \n ) : null;\n\n const documentCardTypeField = (\n \n }\n title={\n \n }\n placeholder={\n \n }\n {...configDocument?.cardType}\n />\n );\n\n const documentCardNumberField = (\n \n }\n {...configDocument?.cardNumber}\n />\n );\n\n const disabledForIdentityCardTypes = configDocument?.expiration?.disabledForIdentityCardTypes;\n\n const disableExpirationField = disabledForIdentityCardTypes?.find(\n (cardType: string) => cardType === values.identityCard?.cardType,\n );\n\n const expirationDocumentField = !disableExpirationField && (\n \n }\n invalidMsg={TranslationKey.validationDateRegex}\n {...configDocument?.expiration}\n />\n );\n\n const documents = renderDocuments();\n const uploader = uploaderDocument();\n\n return (\n <>\n {documentCardTypeField}\n {documentCardNumberField}\n {expirationDocumentField}\n \n {uploader}\n \n {documents}\n {documentIds.length > 0 && (\n \n )}\n \n >\n );\n};\n","import { Tooltip } from '@ori-ui/mui';\nimport type { GlobalCustomersDocumentTypeDto } from '@ori/global-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { ReactElement, FC } from 'react';\n\nimport { StyledDivHeader, StyledHelpCircle, StyledLabel, StyledRequiredDocument } from './DocumentStyledComponents';\n\ninterface IDocumentHeaderProps {\n label?: ReactElement;\n documentType?: GlobalCustomersDocumentTypeDto;\n requiredDocument: boolean;\n}\n\nexport const DocumentHeader: FC = (props) => {\n const { documentType, label, requiredDocument } = props;\n const { getTestIdProps } = useTestId();\n\n const description = documentType?.description && (\n \n \n \n );\n\n return (\n \n \n {label}\n {requiredDocument ? * : null}\n {description}\n \n \n );\n};\n","import { Typography } from '@ori-ui/mui';\nimport type { GlobalCustomersDocumentTypeDto } from '@ori/global-api-client-react';\nimport type { StaticCustomersMetadataIdentityCardDocumentPropertyDto } from '@ori/static-api-client-react';\nimport type { ReactElement, FC } from 'react';\n\nimport { useCustomerDocumentsInfos, useDocumentTypes } from '../../models/api';\nimport { Loading } from '../Loading';\nimport { DocumentContent } from './DocumentContent';\nimport { DocumentHeader } from './DocumentHeader';\nimport { RootContainer } from './DocumentStyledComponents';\n\ninterface IDocumentProps {\n documentTypeId: number;\n documentLabel: ReactElement;\n documentInfoText: ReactElement;\n documentIds: number[];\n handleDocumentsChange?: (documentIds: number[]) => void;\n isDeleteConfirmationRequired?: boolean;\n editableDocument?: boolean;\n config?: StaticCustomersMetadataIdentityCardDocumentPropertyDto;\n name: string;\n isRequired?: boolean;\n}\n\nexport const Document: FC = (props) => {\n const {\n documentIds,\n documentTypeId,\n isDeleteConfirmationRequired,\n editableDocument,\n name,\n config,\n isRequired,\n documentLabel,\n documentInfoText,\n handleDocumentsChange,\n } = props;\n\n const { data: documentsTypeData } = useDocumentTypes();\n const { data: documentsInfoData } = useCustomerDocumentsInfos();\n\n const getTypeById = (documentTypeIdProperty: number): GlobalCustomersDocumentTypeDto | undefined =>\n documentsTypeData?.find((type) => type.documentTypeId === documentTypeIdProperty);\n\n const isLoading = !documentsTypeData || !documentsInfoData;\n\n const documentType = getTypeById(documentTypeId);\n\n return (\n \n \n \n {documentInfoText}\n \n \n {isLoading ? : null}\n \n );\n};\n","import { Grid, styled, Typography } from '@ori-ui/mui';\nimport type {\n GlobalCustomerRegistrationsRegistrationLegalDetailsDto,\n GlobalCustomersCustomerDocumentDto,\n GlobalCustomersCustomerDocumentsDto,\n} from '@ori/global-api-client-react';\nimport type { StaticCustomerRegistrationsMetadataRegistrationLegalDetailsMetadataDto } from '@ori/static-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { FC, ReactElement } from 'react';\nimport { useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { Localization } from '../../../Localization';\nimport { defaultTranslations } from '../../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport type { ILocalizationKey } from '../../../interfaces';\nimport { TranslationKey } from '../../../models';\nimport { Document } from '../../Document';\n\nconst RootContainer = styled('div')(({ theme }) => ({\n position: 'relative',\n}));\n\nexport interface ILegalDocumentsProps {\n documentsConfig?: StaticCustomerRegistrationsMetadataRegistrationLegalDetailsMetadataDto;\n}\n\nexport const LegalDocuments: FC = (props) => {\n const { documentsConfig } = props;\n const [localDocuments, setLocalDocuments] = useState();\n\n const { getTestIdProps } = useTestId();\n\n const { setValue, watch, trigger } = useFormContext();\n\n const values = watch();\n\n const getDocumentLabel = (localization: ILocalizationKey) => (\n \n \n \n );\n\n const updateIdentityCard = (documentIds: number[]) => {\n const documents: GlobalCustomersCustomerDocumentDto[] = documentIds.map((id) => ({\n documentId: id,\n }));\n\n setLocalDocuments({ ...documents, documentsCollection: documents });\n setValue('identityCard.documentsCollection', documents as never);\n trigger('identityCard.documentsCollection');\n };\n\n const updateAdditionalIdentityCard = (documentIds: number[]) => {\n const documents: GlobalCustomersCustomerDocumentDto[] = documentIds.map((id) => ({\n documentId: id,\n }));\n\n setLocalDocuments({ ...documents, documentsCollection: documents });\n setValue('additionalIdentityCard.documentsCollection', documents as never);\n trigger('additionalIdentityCard.documentsCollection');\n };\n\n const getDocumentIds = (documents?: GlobalCustomersCustomerDocumentsDto): number[] => {\n if (!documents) {\n return [];\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- we need this condition\n return documents.documentsCollection?.map((d) => d.documentId);\n };\n\n const renderIdentityCardDocument = (): ReactElement | null => {\n const config = documentsConfig?.identityCard;\n const isAvailable = config?.isAvailable ?? false;\n const isEditable = config?.isEditable ?? false;\n\n const idCardDocumentInfoText = (\n \n );\n\n if (!isAvailable) {\n return null;\n }\n\n const documentTypeId = config?.documentTypeId ?? 0;\n const correctDocuments = values.identityCard ?? localDocuments;\n\n return (\n \n );\n };\n\n const renderAdditionalIdentityCardDocument = (): ReactElement | null => {\n const config = documentsConfig?.additionalIdentityCard;\n const isAvailable = config?.isAvailable ?? false;\n const isEditable = config?.isEditable ?? false;\n\n const additionalDocumentInfoText = (\n \n );\n\n if (!isAvailable) {\n return null;\n }\n\n const documentTypeId = config?.documentTypeId ?? 0;\n const correctDocuments = values.additionalIdentityCard ?? localDocuments;\n\n return (\n \n );\n };\n\n const idCard = renderIdentityCardDocument();\n const additionalIdCard = renderAdditionalIdentityCardDocument();\n\n const documentsAvailableContent = (\n \n {idCard}\n {additionalIdCard}\n \n );\n\n const documentsContent =\n documentsConfig?.identityCard?.isAvailable || documentsConfig?.additionalIdentityCard?.isAvailable\n ? documentsAvailableContent\n : null;\n\n return {documentsContent};\n};\n","import { Typography, Grid } from '@ori-ui/mui';\nimport type { GlobalCustomerRegistrationsRegistrationLegalDetailsDto } from '@ori/global-api-client-react';\nimport type {\n StaticCustomerRegistrationsMetadataRegistrationLegalDetailsMetadataDto,\n StaticCustomersMetadataApprovalPropertyDto,\n} from '@ori/static-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { FC } from 'react';\nimport { useForm, FormProvider } from 'react-hook-form';\n\nimport { ContentKeys, Localization } from '../../../Localization';\nimport { defaultTranslations } from '../../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport {\n useStepperData,\n useVirtualPageAnalyticsData,\n useFormError,\n useConfiguration,\n GetContent,\n} from '../../../contexts';\nimport { TranslationKey } from '../../../models';\nimport { CheckboxFormFieldByConfig } from '../../FieldsByConfig';\nimport { FormValidationSummary } from '../../FormValidationSummary';\nimport { TermsConditionsCheckbox } from '../../TermsConditionsCheckbox';\nimport { LegalDetailApprovals } from './LegalDetailApprovals';\nimport { LegalDocuments } from './LegalDocuments';\nimport {\n StyledForm,\n BackButtton,\n ConditionTitle,\n ConditionsInfoWrapper,\n DocumentInfoWrapper,\n StyledArrowIcon,\n SubmitButtton,\n StyledLink,\n} from './StyledComponentsLegalForm';\n\ninterface ILegalDetailsFormProps {\n initialData?: GlobalCustomerRegistrationsRegistrationLegalDetailsDto;\n config?: StaticCustomerRegistrationsMetadataRegistrationLegalDetailsMetadataDto;\n isSuccessSubmit: boolean;\n onSubmitForm: (data: GlobalCustomerRegistrationsRegistrationLegalDetailsDto) => void;\n}\n\nexport const LegalDetailsForm: FC = (props) => {\n const { initialData, config, isSuccessSubmit, onSubmitForm } = props;\n const {\n context: { stepperData },\n } = useStepperData();\n const { activeStep, setActiveStep, stepsOrder } = stepperData;\n\n const { getTestIdProps } = useTestId();\n\n const { customerServiceUrl } = useConfiguration();\n\n const methods = useForm({\n defaultValues: initialData,\n reValidateMode: 'onChange',\n shouldFocusError: true,\n mode: 'all',\n });\n\n const { watch, formState } = methods;\n const { isValid, isSubmitting } = formState;\n\n const values = watch();\n\n const {\n context: { errorData },\n } = useFormError();\n const { customErrors } = errorData;\n\n const identityErr = Object.keys(values.identityCard ?? {}).map((value) => `identityCard.${value}`);\n const prevValues = Object.keys(values);\n const identityValues = identityErr;\n const newValues = [...prevValues, ...identityValues];\n\n const invalidCodeErrors = customErrors?.filter(\n (er) => !newValues.map((val) => val.toLowerCase()).includes(er.fieldName?.toLowerCase() ?? ''),\n );\n\n const availableApprovals =\n config?.approvals &&\n Object.values(config.approvals).filter(\n (approval: StaticCustomersMetadataApprovalPropertyDto) => approval.isAvailable,\n );\n const {\n virtualPageAnalyticsContext: { virtualPageAnalyticsData },\n } = useVirtualPageAnalyticsData();\n const { setPreviousStep } = virtualPageAnalyticsData;\n\n const handleBack = () => {\n setPreviousStep(stepsOrder[activeStep]);\n setActiveStep(activeStep - 1);\n };\n\n const isAnyAprrovalAvailable = Boolean(availableApprovals && availableApprovals.length > 0);\n\n const isAnyDocumentAvailable =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we need logical operator ||\n config?.identityCard?.isAvailable || config?.additionalIdentityCard?.isAvailable;\n\n return (\n \n \n \n {isAnyDocumentAvailable ? (\n \n \n \n \n \n \n \n \n ) : null}\n \n \n \n \n \n \n \n \n \n \n \n {isAnyAprrovalAvailable ? (\n \n ) : null}\n \n \n \n \n ),\n LegalDocument2_Link: (\n \n {' '}\n \n ),\n LegalDocument3_Link: (\n \n \n \n ),\n LegalDocument4_Link: (\n \n \n \n ),\n LegalDocument5_Link: (\n \n \n \n ),\n LegalDocument6_Link: (\n \n \n \n ),\n LegalDocument7_Link: (\n \n \n \n ),\n LegalDocument8_Link: (\n \n \n \n ),\n }}\n />\n {config?.confirmation1?.validation?.isMandatory ? ' *' : null}\n \n }\n value={values.confirmation1}\n {...config?.confirmation1}\n />\n \n \n \n \n ),\n LegalDocument2_Link: (\n \n \n \n ),\n LegalDocument3_Link: (\n \n \n \n ),\n LegalDocument4_Link: (\n \n \n \n ),\n LegalDocument5_Link: (\n \n \n \n ),\n LegalDocument6_Link: (\n \n \n \n ),\n LegalDocument7_Link: (\n \n \n \n ),\n LegalDocument8_Link: (\n \n \n \n ),\n }}\n />\n {config?.confirmation2?.validation?.isMandatory ? ' *' : null}\n \n }\n value={values.confirmation2}\n {...config?.confirmation2}\n />\n \n \n \n \n \n \n handleBack()}\n >\n \n \n \n \n \n );\n};\n","import * as UserRegisteredEvent from '@ori-events/user-registered';\nimport { Typography, styled } from '@ori-ui/mui';\nimport { Placement } from '@ori/analytics-data';\nimport {\n useApiClient,\n updateCustomerRegistration,\n updateCustomerRegistrationLegalDetails,\n getCustomerRegistrationAnalytics,\n HttpStatusCodes,\n} from '@ori/global-api-client-react';\nimport type {\n AxiosError,\n GlobalCustomerRegistrationsAnalyticsDto,\n GlobalCustomerRegistrationsRegistrationLegalDetailsDto,\n} from '@ori/global-api-client-react';\nimport type { FC } from 'react';\nimport { useState, useEffect } from 'react';\nimport type { SubmitHandler } from 'react-hook-form';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport {\n useConfiguration,\n useFormError,\n useNotificationData,\n useRegistrationStatus,\n useVirtualPageAnalyticsData,\n} from '../../contexts';\nimport type { IErrors } from '../../interfaces';\nimport { MessageType } from '../../interfaces';\nimport { FetchResult, TranslationKey } from '../../models';\nimport { useLegalData, useLegalMetadata } from '../../models/api';\nimport { applyNegative, scrollTopFunctionHelper, virtualPageEventDispatch } from '../../utils';\nimport { BasicSkeleton } from '../BasicSkeleton';\nimport { LegalDetailsForm } from '../Forms';\nimport { StyledTitle } from './StepsStyledComponents';\n\nconst RootContainer = styled('div')(({ theme }) => ({\n position: 'relative',\n width: '100%',\n}));\n\nconst ContentWrapper = styled('div')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n}));\n\nconst handleUserRegisteredEvent = (analyticsData: GlobalCustomerRegistrationsAnalyticsDto) => {\n const { consultantNumber, customerTypeId, registrationChannel, sponsorNumber, visitorSegment } = analyticsData;\n\n // workaround: date object contains client's timezone althrougt API returns only date portion\n const signUpDate = analyticsData.signUpDate ?? new Date();\n const signUpDateOffset = signUpDate.getTimezoneOffset() * 60000;\n const signUpDateWithoutOffset = new Date(signUpDate.getTime() - signUpDateOffset);\n const registerEventData: UserRegisteredEvent.Data = {\n registeredUserId: consultantNumber.toString(),\n customerTypeId: customerTypeId.toString(),\n registrationChannel: registrationChannel ?? '',\n registrationType: 'Self',\n sponsorNumber: sponsorNumber?.toString() ?? '',\n signUpDate: signUpDateWithoutOffset.toISOString(),\n visitorSegment: visitorSegment.toString(),\n placement: Placement.JoinUs,\n };\n window.dispatchEvent(\n new CustomEvent(UserRegisteredEvent.Name, {\n detail: registerEventData,\n }),\n );\n};\n\nexport const LegalStep: FC = () => {\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const { setFinished } = useRegistrationStatus();\n\n const [submitSuccess, setSubmitSuccess] = useState(false);\n\n const { registrationId } = useConfiguration();\n\n const { data: legalConfig } = useLegalMetadata();\n\n const isNegativeApprovals = Boolean(legalConfig?.approvals?.shared?.displayAsNegative);\n\n // initial data\n const { data: legalInitialData } = useLegalData(isNegativeApprovals);\n\n const {\n context: { errorData },\n } = useFormError();\n const { setErrorData, customErrors } = errorData;\n\n const api = useApiClient();\n\n const {\n virtualPageAnalyticsContext: { virtualPageAnalyticsData },\n } = useVirtualPageAnalyticsData();\n const { setPreviousStep, previousStep } = virtualPageAnalyticsData;\n\n const getCorrectSubmitData = (data: GlobalCustomerRegistrationsRegistrationLegalDetailsDto) => {\n let correctData = data;\n\n const emptyIDCard = {\n documentsCollection: [],\n };\n\n if (!data.identityCard?.documentsCollection) {\n correctData = { ...data, identityCard: { ...data.identityCard, ...emptyIDCard } };\n }\n\n if (!data.additionalIdentityCard?.documentsCollection) {\n correctData = { ...correctData, additionalIdentityCard: emptyIDCard };\n }\n\n return correctData;\n };\n\n const getAnalyticsData = async (): Promise => {\n try {\n const response = await getCustomerRegistrationAnalytics(api, registrationId);\n const result = new FetchResult(response.status);\n if (result.isSuccess()) {\n return response.data;\n }\n } catch (error: unknown) {\n setNotificationData({\n isOpen: true,\n message: (\n \n ),\n type: MessageType.error,\n });\n }\n\n return undefined;\n };\n\n useEffect(() => {\n scrollTopFunctionHelper();\n }, []);\n\n useEffect(() => {\n virtualPageEventDispatch('LegalInformationStep', previousStep, registrationId);\n setPreviousStep('LegalInformationStep');\n // eslint-disable-next-line react-hooks/exhaustive-deps -- virtual page event should be fired exacly once, no need to reevaluate\n }, []);\n\n const handleUpdateRegistration = async () => {\n try {\n const updateResponse = await updateCustomerRegistration(api, registrationId, {\n loginType: 'Email',\n registrationId,\n currentStep: 'SubmitStep',\n });\n const result = new FetchResult(updateResponse.status);\n\n if (result.isSuccess()) {\n setSubmitSuccess(true);\n setFinished(true);\n const analyticsData = await getAnalyticsData();\n if (analyticsData !== undefined) {\n handleUserRegisteredEvent(analyticsData);\n }\n if (customErrors && customErrors.length > 0) {\n setErrorData([]);\n }\n }\n } catch (error: unknown) {\n const errorResponse = error as AxiosError;\n if (errorResponse.response?.status === HttpStatusCodes.status400BadRequest) {\n const { Errors } = errorResponse.response.data as IErrors;\n const submitErrors = Errors?.map((er) => ({\n fieldName: er.PropertyName,\n errorCode: er.Code,\n }));\n if (submitErrors?.length && submitErrors.length > 0) {\n setErrorData(submitErrors);\n } else {\n setErrorData([]);\n }\n } else {\n setNotificationData({\n isOpen: true,\n message: (\n \n ),\n type: MessageType.error,\n });\n }\n }\n };\n\n const onSubmit: SubmitHandler = async (data) => {\n const submitData = getCorrectSubmitData(data);\n const currentSubmitData: GlobalCustomerRegistrationsRegistrationLegalDetailsDto = {\n ...submitData,\n approvals: submitData.approvals && applyNegative(submitData.approvals, isNegativeApprovals),\n };\n try {\n const updateResponseLegal = await updateCustomerRegistrationLegalDetails(api, registrationId, currentSubmitData);\n const result = new FetchResult(updateResponseLegal.status);\n\n if (result.isSuccess()) {\n await handleUpdateRegistration();\n }\n } catch (error: unknown) {\n const errorResponse = error as AxiosError;\n if (errorResponse.response?.status === HttpStatusCodes.status400BadRequest) {\n const { Errors } = errorResponse.response.data as IErrors;\n const submitErrors = Errors?.map((er) => ({\n fieldName: er.PropertyName,\n errorCode: er.Code,\n }));\n if (submitErrors?.length && submitErrors.length > 0) {\n setErrorData(submitErrors);\n } else {\n setErrorData([]);\n }\n } else {\n setNotificationData({\n isOpen: true,\n message: (\n \n ),\n type: MessageType.error,\n });\n }\n }\n };\n\n if (!legalInitialData) {\n return ;\n }\n\n return (\n \n \n \n \n \n \n \n \n\n \n \n \n );\n};\n","import type {\n ApiClient,\n StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDto,\n} from '@ori/static-api-client-react';\nimport {\n getTenantCustomerRegistrationsMetadatumSponsorDetailsMetadata,\n useApiClient,\n} from '@ori/static-api-client-react';\nimport useSWR from 'swr';\n\nimport { useConfiguration, useNotificationData } from '../../../contexts';\nimport { useTranslations } from '../../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport { MessageType, type IRegistrationType } from '../../../interfaces';\nimport { FetchResult } from '../../FetchResult';\nimport { TranslationKey } from '../../TranslationKey_simplified-registration-BrandPartner';\n\nasync function fetchSponsorMetadata(api: ApiClient, tenant: string, registrationType: IRegistrationType) {\n const emptySponsorMetadata: StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDto = {};\n\n try {\n const response = await getTenantCustomerRegistrationsMetadatumSponsorDetailsMetadata(api, tenant, registrationType);\n\n return new FetchResult(\n response.status,\n response.data,\n );\n } catch (error: unknown) {\n return FetchResult.errorFor(emptySponsorMetadata);\n }\n}\n\nexport const useSponsorMetadata = () => {\n const { tenant, registrationType } = useConfiguration();\n const { formatMessage } = useTranslations();\n const staticApi = useApiClient();\n\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const errorMeesage = formatMessage(TranslationKey.cannotGetData);\n\n return useSWR(\n [tenant, registrationType, 'sponsorMetadata'],\n async () => {\n const result = await fetchSponsorMetadata(staticApi, tenant, registrationType);\n if (result.isSuccess() && result.response) {\n return result.response;\n }\n throw new Error('request failed fetch sponsor metadata');\n },\n {\n onError(err?: FetchResult) {\n if (err) {\n setNotificationData({\n isOpen: true,\n message: errorMeesage,\n type: MessageType.error,\n messageId: 'cannotGetData',\n });\n }\n },\n },\n );\n};\n","import {\n getCustomerRegistrationSponsorDetails,\n type ApiClient,\n type GlobalCustomerRegistrationsRegistrationSponsorDetailsDto,\n useApiClient,\n} from '@ori/global-api-client-react';\nimport useSWR from 'swr';\n\nimport { useConfiguration, useNotificationData } from '../../../contexts';\nimport { useTranslations } from '../../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport { MessageType } from '../../../interfaces';\nimport { FetchResult } from '../../FetchResult';\nimport { TranslationKey } from '../../TranslationKey_simplified-registration-BrandPartner';\n\nasync function fetchSponsorData(api: ApiClient, registrationIdParam: string) {\n const emptySponsorData: GlobalCustomerRegistrationsRegistrationSponsorDetailsDto = {};\n\n try {\n const response = await getCustomerRegistrationSponsorDetails(api, registrationIdParam);\n\n return new FetchResult(response.status, response.data);\n } catch (error: unknown) {\n return FetchResult.errorFor(emptySponsorData);\n }\n}\n\nexport const useSponsorData = () => {\n const { registrationId } = useConfiguration();\n const { formatMessage } = useTranslations();\n const api = useApiClient();\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const errorMeesage = formatMessage(TranslationKey.cannotGetData);\n\n return useSWR(\n [registrationId, 'sponsorData'],\n async () => {\n const result = await fetchSponsorData(api, registrationId);\n if (result.isSuccess() && result.response) {\n return result.response;\n }\n throw new Error('request failed fetch sponsor data');\n },\n {\n onError(err?: FetchResult) {\n if (err) {\n setNotificationData({\n isOpen: true,\n message: errorMeesage,\n type: MessageType.error,\n messageId: 'cannotGetData',\n });\n }\n },\n },\n );\n};\n","import {\n getCustomerRegistrationSponsorDetailsSponsorInfo,\n type ApiClient,\n type GlobalCustomerRegistrationsRegistrationSponsorInfoDto,\n useApiClient,\n} from '@ori/global-api-client-react';\nimport useSWR from 'swr';\n\nimport { useConfiguration, useNotificationData } from '../../../contexts';\nimport { useTranslations } from '../../../hooks/useTranslations_simplified-registration-BrandPartner';\nimport { MessageType } from '../../../interfaces';\nimport { FetchResult } from '../../FetchResult';\nimport { TranslationKey } from '../../TranslationKey_simplified-registration-BrandPartner';\n\nasync function fetchSponsorInfoData(api: ApiClient, registrationIdParam: string) {\n const emptySponsorInfoData: GlobalCustomerRegistrationsRegistrationSponsorInfoDto = {};\n\n try {\n const response = await getCustomerRegistrationSponsorDetailsSponsorInfo(api, registrationIdParam);\n\n return new FetchResult(response.status, response.data);\n } catch (error: unknown) {\n return FetchResult.errorFor(emptySponsorInfoData);\n }\n}\n\nexport const useSponsorInfoData = (refetchKey?: string) => {\n const { registrationId } = useConfiguration();\n const { formatMessage } = useTranslations();\n const api = useApiClient();\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData } = notificationData;\n\n const errorMeesage = formatMessage(TranslationKey.cannotGetData);\n\n return useSWR(\n [registrationId, refetchKey, 'sponsorInfoData'],\n async () => {\n const result = await fetchSponsorInfoData(api, registrationId);\n if (result.isSuccess() && result.response) {\n return result.response;\n }\n throw new Error('request failed fetch sponsor info data');\n },\n {\n onError(err?: FetchResult) {\n if (err) {\n setNotificationData({\n isOpen: true,\n message: errorMeesage,\n type: MessageType.error,\n messageId: 'cannotGetData',\n });\n }\n },\n },\n );\n};\n","import { useToken } from '@ori/auth';\nimport type { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport axios from 'axios';\nimport useSWR from 'swr';\n\nimport { useConfiguration } from '../../../contexts';\n\nconst axiosClient = axios.create();\n\nconst getEncodedImage = (blob: Blob): string => URL.createObjectURL(blob);\n\nexport function useSponsorImage(registrationId: string, profileImageDocumentId?: number | null) {\n const { globalApiUrl, tenant } = useConfiguration();\n const { formattedToken } = useToken();\n const shouldFetch = Boolean(profileImageDocumentId !== null && profileImageDocumentId !== undefined);\n const url = `${globalApiUrl}/customerRegistrations/${registrationId}/sponsorDetails/profileImage`;\n\n const { data: sponsorImage } = useSWR(shouldFetch ? url.toString() : null, async (requestUrl: string) => {\n const headers: AxiosRequestConfig['headers'] = {\n 'x-tenant-context': tenant,\n };\n headers.Authorization = formattedToken;\n const { data } = await axiosClient\n .get(requestUrl, {\n headers,\n responseType: 'blob',\n })\n .then((blob) => blob)\n .catch((error: AxiosResponse) => error);\n\n return data;\n });\n\n return sponsorImage === undefined ? undefined : getEncodedImage(sponsorImage);\n}\n","import { Typography, styled, Button, Avatar } from '@ori-ui/mui';\nimport type { GlobalCustomerRegistrationsRegistrationSponsorInfoDto } from '@ori/global-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { ReactElement, FC } from 'react';\n\nimport { Localization } from '../../../Localization';\nimport { defaultTranslations } from '../../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport { useStepperData, useVirtualPageAnalyticsData } from '../../../contexts';\nimport { TranslationKey } from '../../../models';\nimport { stringAvatar } from '../../../utils';\n\ninterface ISponsorBoxProps {\n sponsorDetailInfo: GlobalCustomerRegistrationsRegistrationSponsorInfoDto;\n title: ReactElement;\n isVisibleNextButton: boolean;\n sponsorImage?: string;\n}\n\nconst RootContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n}));\n\nconst StyledAvatar = styled(Avatar)(({ theme }) => ({\n width: '120px',\n height: '120px',\n marginBottom: theme.spacing(2),\n color: theme.palette.text.primary,\n textDecoration: 'none',\n}));\n\nconst StyledNameLabel = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(1),\n}));\n\nconst StyledTitle = styled(Typography)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n fontWeight: 'bold',\n}));\n\nconst NexButtton = styled(Button)(({ theme }) => ({\n minWidth: '330px',\n marginTop: theme.spacing(8),\n}));\n\nexport const SponsorBox: FC = (props) => {\n const { sponsorDetailInfo, title, isVisibleNextButton, sponsorImage } = props;\n const { consultantNumber, fullName } = sponsorDetailInfo;\n\n const {\n context: { stepperData },\n } = useStepperData();\n const { activeStep, setActiveStep, stepsOrder } = stepperData;\n const {\n virtualPageAnalyticsContext: { virtualPageAnalyticsData },\n } = useVirtualPageAnalyticsData();\n const { setPreviousStep } = virtualPageAnalyticsData;\n\n const { getTestIdProps } = useTestId();\n\n const handleNextStep = () => {\n setPreviousStep(stepsOrder[activeStep]);\n setActiveStep(activeStep + 1);\n };\n\n return (\n \n \n {title}\n \n {fullName ? (\n \n ) : null}\n \n {fullName}\n \n \n {consultantNumber}\n \n\n {isVisibleNextButton ? (\n handleNextStep()}\n {...getTestIdProps('sponsorBox-next-step-btn')}\n >\n \n \n ) : null}\n \n );\n};\n","import { Toggle } from '@ori-ui/components';\nimport { ArrowLeftThin } from '@ori-ui/icons';\nimport {\n Box,\n Button,\n FormControlLabel,\n Grid,\n Radio,\n RadioGroup,\n styled,\n InputLabel,\n Typography,\n Select,\n MenuItem,\n FormControl,\n} from '@ori-ui/mui';\nimport type {\n GlobalCustomerRegistrationsRegistrationSponsorDetailsDto,\n GlobalCustomerRegistrationsRegistrationSponsorInfoDto,\n} from '@ori/global-api-client-react';\nimport type {\n StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDto,\n StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDtoPreselectedSponsorSelectionMethod,\n} from '@ori/static-api-client-react';\nimport useTestId from '@ori/testid-generator';\nimport type { ChangeEvent, FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\n\nimport { Localization } from '../../../Localization';\nimport { defaultTranslations } from '../../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport { useStepperData, useFormError, useVirtualPageAnalyticsData } from '../../../contexts';\nimport { TranslationKey } from '../../../models';\nimport { useAddressFormatMetadata } from '../../../models/api';\nimport { getOptionLabelSingleLine, defaultAddressFormat } from '../../../utils';\nimport { AddressAutocomplete } from '../../AddressAutocomplete';\nimport { TextFormFieldByConfig } from '../../FieldsByConfig';\nimport { FormValidationSummary } from '../../FormValidationSummary';\nimport { SponsorBox } from './SponsorBox';\n\nenum selectBpVariant {\n findSponsor = 'SponsorLocator',\n knowSponsorNumber = 'ManualInput',\n}\n\nconst StyledForm = styled('form')(({ theme }) => ({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n width: '100%',\n marginTop: theme.spacing(8),\n}));\n\nconst SubmitButtton = styled(Button)(({ theme }) => ({\n minWidth: '330px',\n marginTop: theme.spacing(3),\n}));\n\nconst FindButtton = styled(Button)(({ theme }) => ({\n width: '330px',\n maxWidth: '100%',\n height: '35px',\n margin: '0 auto',\n marginBottom: theme.spacing(10),\n}));\n\nconst BackButtton = styled(Button)(({ theme }) => ({\n display: 'flex',\n justifyContent: 'space-between',\n minWidth: '60px',\n marginTop: theme.spacing(2),\n}));\n\nconst StyledArrowIcon = styled(ArrowLeftThin)(({ theme }) => ({\n marginRight: theme.spacing(1),\n}));\n\nconst StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({\n alignItems: 'center',\n marginBottom: theme.spacing(3),\n}));\n\nconst AddressAutocompleteWrapper = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(6),\n}));\n\nconst StyledToggle = styled(Toggle)(({ theme }) => ({\n cursor: 'pointer',\n}));\n\nconst StyledSingleLineLabel = styled(Typography)(({ theme }) => ({\n display: 'flex',\n width: '100%',\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(5),\n}));\n\ninterface IConnectToBPFormProps {\n initialData?: GlobalCustomerRegistrationsRegistrationSponsorDetailsDto;\n config?: StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDto;\n sponsorInfo?: GlobalCustomerRegistrationsRegistrationSponsorInfoDto;\n profileSponsorImage?: string;\n isDefaultAddress: boolean;\n isSuccessSubmit: boolean;\n onSubmitForm: (data: GlobalCustomerRegistrationsRegistrationSponsorDetailsDto) => void;\n}\n\nexport const ConnectToBPForm: FC = (props) => {\n const { initialData, config, sponsorInfo, profileSponsorImage, isDefaultAddress, isSuccessSubmit, onSubmitForm } =\n props;\n const {\n context: { stepperData },\n } = useStepperData();\n const { activeStep, setActiveStep, stepsOrder } = stepperData;\n\n const defaultSelectSponsorType = config?.preselectedSponsorSelectionMethod ?? 'ManualInput';\n\n const {\n context: { errorData },\n } = useFormError();\n const { setErrorData, customErrors } = errorData;\n\n const [selectSponsorType, setSelectSponsorType] = useState(defaultSelectSponsorType);\n const [country, setCountry] = useState(false);\n const [resetKey, setResetKey] = useState(0);\n\n const { getTestIdProps } = useTestId();\n\n const methods = useForm({\n defaultValues: initialData,\n reValidateMode: 'onChange',\n mode: 'all',\n });\n\n const { formState, watch, setValue } = methods;\n\n const { isValid, isSubmitting } = formState;\n const countryOptions = config?.address?.country?.availableOptions ?? [];\n\n const values = watch();\n\n const invalidCodeErrors = customErrors?.filter(\n (er) =>\n !Object.keys(values)\n .map((val) => val.toLowerCase())\n .includes(er.fieldName?.toLowerCase() ?? ''),\n );\n\n const countryFieldName = 'address.country';\n\n const { data: formatAddressFields } = useAddressFormatMetadata('SingleLine');\n\n const {\n virtualPageAnalyticsContext: { virtualPageAnalyticsData },\n } = useVirtualPageAnalyticsData();\n const { setPreviousStep } = virtualPageAnalyticsData;\n\n const handleChangeSponsorFindType = (event: ChangeEvent) => {\n setSelectSponsorType(\n event.target\n .value as StaticCustomerRegistrationsMetadataRegistrationSponsorDetailsMetadataDtoPreselectedSponsorSelectionMethod,\n );\n setResetKey(Date.now());\n methods.reset(initialData);\n methods.clearErrors();\n setCountry(false);\n if (customErrors && customErrors.length > 0) {\n setErrorData([]);\n }\n setErrorData([]);\n };\n\n const handleBack = () => {\n setPreviousStep(stepsOrder[activeStep]);\n setActiveStep(activeStep - 1);\n };\n\n const handleNext = () => {\n setPreviousStep(stepsOrder[activeStep]);\n setActiveStep(activeStep + 1);\n };\n\n useEffect(() => {\n if (values.address?.zipcode) {\n setSelectSponsorType(selectBpVariant.findSponsor);\n }\n }, [values.address?.zipcode]);\n\n useEffect(() => {\n if (config?.address?.country?.isAvailable && selectSponsorType === selectBpVariant.findSponsor) {\n setValue(countryFieldName, countryOptions[0]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps --- not needed other property\n }, [selectSponsorType]);\n\n const isKnowSponsorNumber = selectSponsorType === selectBpVariant.knowSponsorNumber;\n const isFindSponsorSelected = selectSponsorType === selectBpVariant.findSponsor;\n\n const getAddressAutocomplete = () => {\n if (config?.address?.searchOptions?.isEnabled) {\n return (\n \n }\n />\n );\n }\n\n return null;\n };\n\n const handleChangeCountry = (countryProperty: boolean | string) => {\n setCountry(countryProperty);\n if (typeof countryProperty === 'boolean') {\n if (countryProperty) {\n setValue(countryFieldName, countryOptions[1]);\n } else {\n setValue(countryFieldName, countryOptions[0]);\n }\n } else {\n setValue(countryFieldName, countryProperty);\n }\n };\n\n const getCountryField = () => {\n if (countryOptions.length === 2) {\n return (\n \n \n handleChangeCountry(checked)}\n />\n \n );\n }\n return (\n \n \n \n }\n onChange={(e) => handleChangeCountry(e.target.value)}\n >\n {countryOptions.sort().map((opt) => (\n \n ))}\n \n \n );\n };\n\n const getCorrectSubmitButton = () => {\n if (isFindSponsorSelected) {\n return (\n handleNext()}\n {...getTestIdProps('submit-btn-sponsorForm')}\n >\n \n \n );\n }\n\n return (\n \n \n \n );\n };\n\n const addressAutocomplete = getAddressAutocomplete();\n\n const countryField = getCountryField();\n\n const isDisabledFind = !(values.address?.country ?? values.address?.zipcode);\n const submitButton = getCorrectSubmitButton();\n\n const knowSponsorLabelVariant = sponsorInfo?.consultantNumber ? 'body2' : 'body1';\n\n const formatedAddress = values.address?.zipcode\n ? getOptionLabelSingleLine(0, values.address, formatAddressFields ?? defaultAddressFormat)\n : null;\n\n const singleLineAddress =\n config?.address?.searchOptions?.isEnabled && formatedAddress ? (\n <>\n \n \n \n \n {formatedAddress}\n \n >\n ) : null;\n\n return (\n \n \n \n {sponsorInfo?.consultantNumber ? (\n \n }\n />\n ) : (\n \n \n \n \n }\n disabled={Boolean(sponsorInfo?.consultantNumber)}\n label={\n \n \n \n }\n />\n {isKnowSponsorNumber ? (\n \n }\n tooltipText={\n \n }\n {...config?.sponsorNumber}\n allowOnlyNumbers\n isEditable={isKnowSponsorNumber}\n validation={{ isMandatory: isKnowSponsorNumber }}\n />\n ) : null}\n \n \n }\n label={\n \n \n \n }\n style={{ order: 0 }}\n />\n {isFindSponsorSelected && !sponsorInfo?.consultantNumber ? (\n <>\n {config?.address?.country?.isAvailable && !isDefaultAddress ? (\n {countryField}
\n ) : null}\n {initialData?.address?.zipcode ? null : (\n <>\n \n {addressAutocomplete}\n {singleLineAddress}\n \n\n \n }\n tooltipText={\n \n }\n {...config?.address?.zipcode}\n isAddressMatchRequired\n validation={{ isMandatory: isFindSponsorSelected }}\n />\n >\n )}\n\n \n \n \n >\n ) : null}\n {sponsorInfo?.consultantNumber ? (\n \n \n }\n isVisibleNextButton={false}\n />\n
\n ) : null}\n \n \n \n {submitButton}\n \n )}\n handleBack()}\n >\n \n \n \n \n \n );\n};\n","import { Typography } from '@ori-ui/mui';\nimport { useApiClient, updateCustomerRegistrationSponsorDetails, HttpStatusCodes } from '@ori/global-api-client-react';\nimport type {\n AxiosError,\n GlobalCustomerRegistrationsRegistrationSponsorDetailsDto,\n GlobalSharedAddressDto,\n} from '@ori/global-api-client-react';\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport type { SubmitHandler } from 'react-hook-form';\n\nimport { Localization } from '../../Localization';\nimport { defaultTranslations } from '../../constants/defaultTranslations_simplified-registration-BrandPartner';\nimport {\n useConfiguration,\n useNotificationData,\n useFormError,\n useStepperData,\n useVirtualPageAnalyticsData,\n} from '../../contexts';\nimport type { IErrors } from '../../interfaces';\nimport { MessageType } from '../../interfaces';\nimport { FetchResult, TranslationKey } from '../../models';\nimport {\n useSponsorData,\n useSponsorInfoData,\n useSponsorMetadata,\n usePersonalData,\n useSponsorImage,\n} from '../../models/api';\nimport { scrollTopFunctionHelper, virtualPageEventDispatch } from '../../utils';\nimport { BasicSkeleton } from '../BasicSkeleton';\nimport { ConnectToBPForm } from '../Forms';\nimport { RootContainer, StyledTitle } from './StepsStyledComponents';\n\nexport const SponsorStep: FC = () => {\n const [fetchKey, setFetchKey] = useState('');\n const [submitSuccess, setSubmitSuccess] = useState(false);\n\n const { registrationId } = useConfiguration();\n\n const notificationStore = useNotificationData().context.notificationData;\n const {\n context: { errorData },\n } = useFormError();\n const { setErrorData, customErrors } = errorData;\n\n const {\n context: { stepperData },\n } = useStepperData();\n const { activeStep, setActiveStep } = stepperData;\n const {\n virtualPageAnalyticsContext: { virtualPageAnalyticsData },\n } = useVirtualPageAnalyticsData();\n const { setPreviousStep, previousStep } = virtualPageAnalyticsData;\n\n const { data: sponsorConfig } = useSponsorMetadata();\n const { data: sponsorInitialData } = useSponsorData();\n const { data: sponsorInfoData } = useSponsorInfoData(fetchKey);\n const { data: personalInitialData } = usePersonalData();\n const sponsorImage = useSponsorImage(registrationId, sponsorInfoData?.profileImageDocumentId);\n\n const api = useApiClient();\n\n const oneCountryMarket =\n sponsorConfig?.address?.country?.isAvailable && sponsorConfig.address.country.availableOptions.length === 1;\n\n useEffect(() => {\n scrollTopFunctionHelper();\n }, []);\n\n useEffect(() => {\n virtualPageEventDispatch('SponsorSelectionStep', previousStep, registrationId);\n setPreviousStep('SponsorSelectionStep');\n // eslint-disable-next-line react-hooks/exhaustive-deps -- virtual page event should be fired exacly once, no need to reevaluate\n }, []);\n\n const defaultAddressType = sponsorConfig?.address?.addressType?.availableOptions\n ? sponsorConfig.address.addressType.availableOptions[0]\n : 'Other';\n\n const onSubmit: SubmitHandler = async (data) => {\n let correctAddressData = null;\n let correctSponsorNumber = data.sponsorNumber as number | null | undefined;\n\n if (data.address) {\n correctAddressData = {\n address: { ...data.address, addressType: defaultAddressType },\n } as unknown;\n }\n\n if (data.sponsorNumber) {\n correctAddressData = null;\n }\n\n if (correctSponsorNumber === null) {\n correctSponsorNumber = undefined;\n } else {\n correctSponsorNumber = Number(data.sponsorNumber);\n }\n\n if (!data.sponsorNumber && personalInitialData?.address?.country) {\n correctAddressData = {\n address: { ...personalInitialData.address },\n };\n }\n\n if (!data.sponsorNumber && !data.address && oneCountryMarket) {\n correctAddressData = {\n address: {\n addressType: defaultAddressType,\n country: sponsorConfig.address?.country?.availableOptions[0],\n },\n };\n }\n\n const correctData: GlobalCustomerRegistrationsRegistrationSponsorDetailsDto = {\n ...(correctAddressData as GlobalSharedAddressDto),\n sponsorNumber: correctSponsorNumber,\n sponsorOrigin: data.sponsorOrigin,\n };\n try {\n const updateResponse = await updateCustomerRegistrationSponsorDetails(api, registrationId, correctData);\n const result = new FetchResult(updateResponse.status);\n\n if (result.isSuccess()) {\n setSubmitSuccess(true);\n if (correctData.sponsorNumber) {\n setActiveStep(activeStep + 1);\n } else {\n setFetchKey(Date.now().toString());\n }\n if (customErrors && customErrors.length > 0) {\n setErrorData([]);\n }\n }\n } catch (error: unknown) {\n const errorResponse = error as AxiosError;\n if (errorResponse.response?.status === HttpStatusCodes.status400BadRequest) {\n const { Errors } = errorResponse.response.data as IErrors;\n const submitErrors = Errors?.map((er) => ({\n fieldName: er.PropertyName,\n errorCode: er.Code,\n }));\n if (submitErrors?.length && submitErrors.length > 0) {\n setErrorData(submitErrors);\n } else {\n setErrorData([]);\n }\n } else {\n notificationStore.setNotificationData({\n isOpen: true,\n message: (\n \n ),\n type: MessageType.error,\n });\n }\n }\n };\n\n if (!sponsorInitialData) {\n return ;\n }\n\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we need logical operator ||\n const defaultAddressAvailable = personalInitialData?.address?.country || oneCountryMarket;\n\n return (\n \n \n \n \n \n \n \n \n \n );\n};\n","import { styled } from '@ori-ui/mui';\nimport type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { useSWRConfig } from 'swr';\n\nimport { useStepperData, useConfiguration } from '../../contexts';\nimport { Stepper } from '../Stepper';\nimport { LegalStep, PersonalStep, SponsorStep } from '../Steps';\n\nconst RootContainer = styled('div')(({ theme }) => ({\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n}));\n\nconst ContentContainer = styled('div')(({ theme }) => ({\n width: '100%',\n maxWidth: '500px',\n}));\n\ninterface IStepContentProps {\n currentStep?: string;\n steps: string[];\n}\n\nexport const StepperWithContent: FC = (props) => {\n const { currentStep, steps } = props;\n const {\n context: { stepperData },\n } = useStepperData();\n const { activeStep, setActiveStep, setStepsOrder } = stepperData;\n const { registrationType, referral } = useConfiguration();\n\n const { cache } = useSWRConfig();\n\n const isVipCustomerType = registrationType === 'VipCustomer';\n const isCorrectReferral = referral?.ReferralType === 'Pbs' || referral?.ReferralType === 'ReferralLink';\n\n const vipWithoutSponsor = isVipCustomerType && !isCorrectReferral;\n\n useEffect(() => {\n setStepsOrder(steps);\n }, [setStepsOrder, steps]);\n\n useEffect(() => {\n if (currentStep) {\n const actualStep = steps.indexOf(currentStep);\n\n if (actualStep !== -1) {\n setActiveStep(actualStep);\n cache.delete('registrationData');\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps --- not needed other property\n }, [currentStep]);\n const getStepperContent = () => {\n let content;\n switch (activeStep) {\n case 0:\n content = (\n \n \n \n );\n break;\n case 1:\n content = {vipWithoutSponsor ? : };\n break;\n case 2:\n content = (\n \n \n \n );\n break;\n default:\n content = null;\n }\n\n return content;\n };\n\n const stepperContent = getStepperContent();\n\n return (\n \n \n {stepperContent}\n \n );\n};\n","import { Box, Link, styled } from '@ori-ui/mui';\nimport type { FC } from 'react';\n\nimport { useIsMobile } from '../../utils';\n\nconst OriflameLogoSvg = styled('svg')(({ theme }) => ({\n fill: theme.palette.grey[700],\n height: '100%',\n width: 180,\n [theme.breakpoints.down('sm')]: {\n width: 100,\n },\n}));\n\nconst LogoSeparator = styled('div')(({ theme }) => ({\n position: 'absolute',\n bottom: 0,\n width: '100%',\n height: '2px',\n background: theme.palette.grey[100],\n}));\n\nconst StyledBox = styled(Box)(({ theme }) => ({\n position: 'sticky',\n top: 0,\n display: 'flex',\n justifyContent: 'center',\n height: '40px',\n width: '100%',\n maxWidth: '100%',\n background: theme.palette.background.default,\n padding: theme.spacing(3),\n zIndex: 20,\n marginLeft: '-15px',\n}));\n\nexport const OriflameLogo: FC = () => {\n const isMobile = useIsMobile();\n\n return (\n \n \n \n \n \n \n {isMobile ? : null}\n \n );\n};\n","import { FeedbackNotification } from '@ori-ui/components';\nimport { CheckHeavy, ErrorCircle } from '@ori-ui/icons';\nimport { styled } from '@ori-ui/mui';\nimport type { FC } from 'react';\nimport { useState, useCallback } from 'react';\n\nimport { StepperWithContent, PreStep, WelcomeStep, VerificationStep, OriflameLogo } from '../components';\nimport { useConfiguration, useNotificationData, useRegistrationStatus } from '../contexts';\nimport { MessageType } from '../interfaces';\nimport { useRegistrationData } from '../models/api';\n\nconst RootContainer = styled('div')(({ theme }) => ({\n position: 'relative',\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n paddingInline: theme.spacing(6),\n [theme.breakpoints.down('sm')]: {\n paddingInline: theme.spacing(3),\n },\n}));\n\nconst threeSteps = ['PersonalInfoStep', 'SponsorSelectionStep', 'LegalInformationStep'];\nconst twoSteps = ['PersonalInfoStep', 'LegalInformationStep'];\n\nexport const LandingPage: FC = () => {\n const {\n context: { notificationData },\n } = useNotificationData();\n const { setNotificationData, data } = notificationData;\n const { finished } = useRegistrationStatus();\n const [isVerified, setIsVerified] = useState(false);\n\n const { data: registrationData } = useRegistrationData();\n\n const feedBackIcon = data?.type === MessageType.error ? : ;\n\n const { registrationType, registrationId, referral } = useConfiguration();\n\n const handleClose = useCallback(() => {\n setNotificationData({ isOpen: false });\n // eslint-disable-next-line react-hooks/exhaustive-deps --- not needed updated on other property\n }, [notificationData]);\n\n const isVipCustomerType = registrationType === 'VipCustomer';\n const isCorrectReferral = referral?.ReferralType === 'Pbs' || referral?.ReferralType === 'ReferralLink';\n\n const vipWithoutSponsor = isVipCustomerType && !isCorrectReferral;\n const currentSteps = vipWithoutSponsor ? twoSteps : threeSteps;\n\n const getCorrectContent = () => {\n if (!registrationId) {\n return ;\n }\n if (registrationData?.currentStep === 'ContactVerification' && !isVerified) {\n return setIsVerified(true)} />;\n }\n if (finished || registrationData?.currentStep === 'SubmitStep') {\n return ;\n }\n if (registrationData?.registrationId) {\n return (\n \n );\n }\n\n return null;\n };\n\n const correctContent = getCorrectContent();\n\n return (\n \n {registrationId ? : null}\n {correctContent}\n \n \n {data?.message}\n \n \n \n );\n};\n","import { ThemeProvider, theme } from '@ori-ui/mui';\nimport { useToken } from '@ori/auth';\nimport { ClientCultureProvider } from '@ori/culture';\nimport { Team, TestIdProvider } from '@ori/testid-generator';\nimport { Suspense, type FC } from 'react';\n\nimport { BasicSkeleton } from './components';\nimport { APP_NAME } from './constants';\nimport { ApiProvider, ContentsContainer, ErrorBoundary, I18nContainer, RegisterStatusContainer } from './containers';\nimport {\n ConfigurationProvider,\n FormErrorProvider,\n NotificationProvider,\n StepperProvider,\n VirtualPageAnalyticsProvider,\n} from './contexts';\nimport { LandingPage } from './pages';\nimport type { ClientAppConfig } from './types/ClientAppConfig';\n\nexport type AppProps = { configuration: ClientAppConfig };\n\nexport const App: FC = ({ configuration }) => {\n const { formattedToken } = useToken();\n\n if (!formattedToken) {\n return null;\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 \n \n \n \n \n \n );\n};\n","import { ThemeProvider } from '@ori-ui/mui';\nimport { UniversalTokenProvider } from '@ori/auth';\nimport { parseClientAppConfig } from '@ori/client-app-config';\nimport { createRoot } from 'react-dom/client';\n\nimport { App } from './App';\nimport { EMOTION_CACHE_KEY } from './constants';\nimport { ErrorBoundary } from './containers/ErrorBoundary';\nimport type { ClientAppConfig } from './types/ClientAppConfig';\n\n/**\n * React app renderer that is used when app is used as a standalone app\n */\nexport async function render(rootElement: HTMLElement) {\n const { config = '' } = rootElement.dataset;\n const clientAppConfig = parseClientAppConfig(config, ['customerId', 'tenant']);\n const { customerId } = clientAppConfig;\n\n createRoot(rootElement).render(\n \n \n \n \n \n \n ,\n );\n}\n"],"names":["Root","styled","_ref","theme","display","flexDirection","alignItems","StepLogo","_ref2","paddingBottom","spacing","StepTitle","_ref3","StepSubTitle","_ref4","StepContent","_ref5","BasicSkeleton","useTheme","isMobile","useMediaQuery","breakpoints","down","_jsxs","children","_jsx","Skeleton","height","width","variant","animation","sx","borderRadius","ErrorBoundary","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","_inherits","_createClass","key","value","error","this","state","console","props","Component","defaultTranslations","Approval_BlockGuaranteeOrdering","Approval_Contact","Approval_MarketingConsultant","Approval_MarketingExternal","Approval_MarketingOriflame","Approval_Newletters","Approval_PersonalData","Approval_Publication","Approval_UplineLeaderBrowse","Approval_UplineLeaderData","Custom_text","EmailPrimaryChannelDescription","EmailPrimaryChannelLabel","EmailPrimaryChannelPlaceholder","EmailPrimaryChannelTitle","EmailPrimaryChannelTooltip","EmailVerification_Header","EmailVerification_ProceedingToRegistration","EmailVerification_SendAgain","EmailVerification_Text","EmailVerification_Verified","EmailVerification_WrongCode","Error_WrongCode","FirstStep_Address","FirstStep_Button","FirstStep_Country","FirstStep_Country_Placeholder","FirstStep_Country_Tooltip","FirstStep_DateOfBirth","FirstStep_DateOfBirthText","FirstStep_Email","FirstStep_Email_Optional","FirstStep_FirstName","FirstStep_FirstName_Tooltip","FirstStep_Gender","FirstStep_Gender_Placeholder","FirstStep_Header","FirstStep_LastName","FirstStep_LastName_Tooltip","FirstStep_Phone","FirstStep_PhoneWithPrefix","FirstStep_Phone_Optional","FirstStep_PlaceHolder","FirstStep_PlaceholderEmail","FirstStep_PlaceholderPhone","FirstStep_PlaceholderPhoneWithPrefix","FirstStep_SearchedAddress","FirstStep_Text","FirstStep_TooltipEmail","FirstStep_TooltipPhone","FirstStep_TooltipPhoneWithPrefix","FirstStep_UniqueId","FirstStep_UniqueId_Tooltip","LegalDocument1_Link_Label","LegalDocument2_Link_Label","LegalDocument3_Link_Label","LegalDocument4_Link_Label","LegalDocument5_Link_Label","LegalDocument6_Link_Label","LegalDocument7_Link_Label","LegalDocument8_Link_Label","PhonePrimaryChannelDescription","PhonePrimaryChannelLabel","PhonePrimaryChannelLabelWithPrefix","PhonePrimaryChannelPlaceholder","PhonePrimaryChannelPlaceholderWithPrefix","PhonePrimaryChannelTitle","PhonePrimaryChannelTooltip","PhonePrimaryChannelTooltipWithPrefix","PhoneVerification_Header","PhoneVerification_ProceedingToRegistration","PhoneVerification_SendAgain","PhoneVerification_Text","PhoneVerification_Verified","PhoneVerification_WrongCode","Prestep_Apple","Prestep_Button","Prestep_Email","Prestep_ExternalAccountAlreadyConnected","Prestep_Facebook","Prestep_Google","Prestep_Header","Prestep_InvitationCode","Prestep_InvitationCodeNotFound","Prestep_InvitationCodeTitle","Prestep_InvitationCodeTooltip","Prestep_LegalNotice","Prestep_LegalNotice_PrivacyPolicy_Label","Prestep_LegalNotice_TermsAndConditions_Label","Prestep_Or","Prestep_Password","Prestep_Phone","Prestep_PhoneWithPrefix","Prestep_PlaceholderEmail","Prestep_PlaceholderPassword","Prestep_PlaceholderPhone","Prestep_PlaceholderPhoneWithPrefix","Prestep_ReferralTitle","Prestep_RegistrationFailed","Prestep_TooltipEmail","Prestep_TooltipPhone","Prestep_TooltipPhoneWithPrefix","Prestep_UnauthorizedAccess","PrimaryChannelSubmitButton","PrivacyPolicy_Label","PrivacyPolicy_Text","Reseller","SecondStep_BrandPartnerNumber","SecondStep_Button","SecondStep_Button_Find","SecondStep_Country","SecondStep_FindTheBestBrandPartner","SecondStep_FindTheBestBrandPartner_Tooltip","SecondStep_Header","SecondStep_HeresYourBrandPartner","SecondStep_IKnowaBrandPartner","SecondStep_SearchedAddress","SecondStep_Text","SecondStep_YourAreConnected","SecondStep_YourZipCode","SecondStep_YourZipCode_Tooltip","TermsAndConditions","TermsAndConditions_Label","ThirdStep_AddYourDocument","ThirdStep_AdditionalIDCard_Header","ThirdStep_AdditionalIDCard_Text","ThirdStep_Button","ThirdStep_ChooseDocumentType","ThirdStep_Confirmation1","ThirdStep_Confirmation2","ThirdStep_DocumentDetails","ThirdStep_DocumentFileSize","ThirdStep_DocumentNumber","ThirdStep_DocumentNumber_Tooltip","ThirdStep_DocumentType","ThirdStep_Documents_Header","ThirdStep_ExpirationDate","ThirdStep_ExpirationDate_Tooltip","ThirdStep_GeneralConditions","ThirdStep_GeneralConditions_Text","ThirdStep_Header","ThirdStep_HeaderText","ThirdStep_IDCard_Header","ThirdStep_IDCard_Text","ThirdStep_ImageGuidelines","ThirdStep_KYCDocument_Header","ThirdStep_KYCDocument_Text","ThirdStep_More","ThirdStep_SelectFile","ThirdStep_ShowLess","ThirdStep_ShowMore","ThirdStep_UploadDocument","ThirdStep_UploadDocumentText","ThirdStep_Your_Documents_Header","ThirdStep_Your_Documents_Text","Welcome_App","Welcome_Button","Welcome_Header","Welcome_Text","addresResults","addressSearch","addressSearchTooltip","addressSearchValidation","area","area_Placeholder","area_Tooltip","back","birthDate_DoesntMatchUniqueId","birthDate_LegalRequirementsFailed","birthDate_OutOfRange","cancel","cannotCreate","cannotDelete","cannotGetData","cannotResend","cannotUpdate","cannotVerify","city","city_Placeholder","city_Tooltip","confirm","confirmDocumentDelete","country","country_Placeholder","customerServiceLinkLabel","customer_NotEligible","customer_NotUnique","delete","delivery","delivery2","delivery2_Placeholder","delivery2_Tooltip","delivery3","delivery3_Placeholder","delivery3_Tooltip","delivery_Placeholder","delivery_Tooltip","district","district_Placeholder","district_Tooltip","document_ExpirationTooSoon","errorOccured","fileTypeIsNotSupported","genderLabelMan","genderLabelOther","genderLabelWoman","hide","history","locality","locality_Placeholder","locality_Tooltip","loginLinkLabel","noSuggestions","optedOutOfSponsorSelect","orderHistory","passwordRequirementCharactersCount","passwordRequirementDigit","passwordRequirementLetter","passwordRequirementLowerCaseLetter","passwordRequirementSpecialCharacter","passwordRequirementUpperCaseLetter","province","province_Placeholder","province_Tooltip","readMore","region","region_Placeholder","region_Tooltip","resendInMinute","searchForAnAddress","selectFile","selectedFileExceedsMaximumSize","showImage","stateApproved","statePending","stateRejected","stateUnknown","streetAddress","streetAddressTooltip","streetAddress_Placeholder","successResend","termsAndConditions_Mandatory","uploadDone","uploading","validationBirthDateRegex","validationDateRegex","validationEmailIsAlreadyUsed","validationEmailTerminatedCustomer","validationLength","validationMandatoryPropertyIsNull","validationMaxLength","validationMaxValue","validationMinLength","validationMinValue","validationRegex","validationRegexBirthDate","validationRegexEmail","validationRegexIdentityCardDateExpiration","validationRegexPhone","validationRegexUniqueID","validationRequired","validationUniqueAlias","validationUniqueBankAccount","validationUniqueCustomerAttribute","validationUniqueDisplayName","validationUniquePhone","validationUniqueTaxCode","validationUniqueTaxCode2","validationUniqueUniqueId","validationValidConfirmationCode","validationValidOldPassword","validationValidPhone","validationValidSponsorNumber","validationValidUniqueId","validationXmlCharacters","warning","zipcode","zipcode_Placeholder","zipcode_Tooltip","configurationContextDefaultValues","currentLanguage","customerId","NOT_LOGGED_IN_USER_ID","globalApiUrl","identityUrl","staticApiUrl","tenant","registrationType","customerDashboardUrl","loginRedirectUrl","registrationId","validationErrorCode","customerLoginUrl","customerServiceUrl","configurationContext","createContext","ConfigurationProvider","Provider","useConfiguration","useContext","I18nContainer","_useConfiguration","token","useToken","correctTranslationNameSpace","correctDefalutTranslations","BPDefaultTranslations","VIPDefaultTranslations","translationProps","clientFetchConfiguration","baseUrl","onError","log","String","defaultTranslationsWithNamespaces","isTokenValid","TranslationsProvider","_objectSpread","TranslationsNamespaceProvider","namespace","ApiProvider","formattedToken","SWRConfig","swrConfig","GlobalApiClientProvider","language","StaticApiClientProvider","RegistrationContext","RegistrationStatusProvider","useRegistrationStatus","RegisterStatusContainer","_useState","_useState2","_useRegistrationStatu","useState","finished","_slicedToArray","setFinished","useEffect","justifyContent","position","top","left","transform","textAlign","Loading","memo","CircularProgress","color","contentsContext","ContentsProvider","GetContent","_contents$key$id","id","ApiError","_Error","message","data","name","_wrapNativeSuper","Error","RegistrationSufixUrlType","async","fetchContents","url","locale","document","documentElement","lang","navigator","getLocale","response","options","config","_objectWithoutProperties","_excluded","headers","authorization","axios","then","catch","fetcher","contents","Contents","defaultLanguage","DefaultLanguage","currentLocale","ContentsContainer","registrationTypeSufix","contentsData","VipCustomer","Consultant","useSWR","VirtualPageAnalyticsContext","virtualPageAnalyticsData","setPreviousStep","previousStep","undefined","VirtualPageAnalyticsProvider","useVirtualPageAnalyticsData","virtualPageAnalyticsContext","StepperContext","stepperData","setActiveStep","activeStep","setManualChange","manualChange","stepsOrder","setStepsOrder","StepperProvider","_useState3","_useState4","_useState5","_useState6","useStepperData","context","NotificationContext","notificationData","setNotificationData","NotificationProvider","useNotificationData","FormErrorContext","errorData","setErrorData","FormErrorProvider","customErrors","useFormError","Localization","defaultMessage","values","className","FormattedMessage","MessageType","HttpStatusCodes","FetchResult","httpStatus","isSuccess","get","InternalServerError","errors","httpStatuses","every","status","_len2","results","_key2","r","TranslationKey","useTranslations","useTranslationsFromNamespace","useRegistrationsMetadata","formatMessage","staticApi","useApiClient","errorMeesage","result","api","getTenantCustomerRegistrationsMetadatumRegistrationsMetadata","errorFor","isEnabled","fetchRegistrationsMetadata","err","isOpen","type","messageId","getErrorLocalizationByCode","errorCode","fieldName","ContentKeys","renderValidationMessage","max","min","customMessage","StyledHelpCircle","HelpCircle","fontSize","palette","grey","StyledLink","main","textDecoration","TextFormFieldByConfig","label","tooltipText","isEditable","isAvailable","displayOrder","validation","initialValue","isAddressMatchRequired","keyboardType","inputType","customPlaceholder","enableLowercaseLetters","useUpperCase","allowOnlyNumbers","_useFormContext","useFormContext","setFocus","setValue","_useTestId","useTestId","getTestIdProps","getTestId","submitError","find","_error$fieldName","toLowerCase","joinFormatError","split","map","item","camelCase","join","errorMessage","regexPattern","regularExpression","RegExp","readOnly","fieldPlaceholder","capitalize","readOnlyStyleBox","correctTabIndex","fieldComponent","Grid","xs","sm","style","order","Box","margin","maxWidth","Controller","rules","required","isMandatory","maxLength","minLength","pattern","defaultValue","render","_validation$minLength","_ref3$field","field","ref","onChange","fieldState","FormControl","fullWidth","TextField","placeholder","Boolean","helperText","disabled","inputProps","tabIndex","inputMode","autoCapitalize","textTransform","InputProps","endAdornment","ErrorCircle","Tooltip","title","enterTouchDelay","leaveTouchDelay","autoComplete","inputRef","onBlur","fieldValue","correctValue","toLocaleUpperCase","trim","shouldValidate","shouldDirty","shouldTouch","e","target","replaceAll","FormHelperText","loginLink","href","rel","_Fragment","usePhoneFormats","getTenantPhoneFormats","allowedFormats","fetchTenantPhoneFormats","useTenantsCountry","_result$response","getTenantCountries","collection","fetchTenantsCountry","FlagWrapper","marginRight","getCountryByCountryCode","countries","countryCode","_countries$find","PhoneFieldByConfig","tooltipWithPrefix","customPlaceholderWithPrefix","labelWithPrefix","setError","watch","clearErrors","phonePrefix","setPhonePrefix","isDisabledPrefix","setIsDisabledPrefix","phoneWithoutPrefix","setPhoneWithoutPrefix","phoneFormats","availableOptions","opt","internationalPrefix","isAnyPhoneFormats","onlyOnePrefix","watchValue","renderSelectOption","index","MenuItem","ReactCountryFlag","svg","objectFit","initialPrefix","aopt","includes","_availableOptions$","replace","_availableOptions$2","onlyOneOption","InputLabel","Select","displayEmpty","labelId","MenuProps","border","anchorOrigin","vertical","horizontal","transformOrigin","renderValue","selected","foundCode","event","currentValue","handlePrefixChange","_field$value","_ref4$field","available","startsWith","slice","test","handleChangeAllowOnlyNumber","iconStyle","StyledIconButton","IconButton","padding","PasswordToggle","isShowPassword","setPasswordVisible","icon","VisibilityOff","Visibility","InputAdornment","onClick","IconWrapper","marginTop","CheckIcon","CheckCircleFilled","default","light","CheckIconSuccess","primary","ErrorIcon","ErrorCircleFilled","dark","StyledLabel","Typography","PasswordRequirements","requirements","minChar","actualValue","validating","requirement","requirementProperty","PasswordFieldByConfig","_validation$maxLength","isPasswordVisible","setIsPasswordVisible","isShowRequirements","setIsShowRequirements","isValidatingRequirements","setIsValidatingRequirements","passwordRequirementsArray","configRequirements","_configRequirements$l","_configRequirements$l3","_configRequirements$u","_configRequirements$d","_configRequirements$s","_configRequirements$l2","_configRequirements$l4","_configRequirements$u2","_configRequirements$d2","_configRequirements$s2","correctRequirements","letter","isRequired","push","lowercaseLetter","uppercaseLetter","digit","specialCharacter","getPasswordRequirements","_validation$minLength2","onFocus","_e","onKeyUp","FormErrorSummary","StyledSubmitError","fontStyle","marginLeft","FormValidationSummary","invalidPropertyErrors","notPropertyError","customerServiceLink","GoogleIcon","version","xmlns","viewBox","fill","d","StyledForm","SubmitButtton","Button","minWidth","SocialWrapper","IconText","paddingLeft","SocialButtton","_ref6","minHeight","boxShadow","Separator","_ref7","marginBottom","HiddenInput","_ref8","_ref9","text","secondary","LegalNotice","_ref10","marginInline","AddInvitationCode","_ref11","fontWeight","cursor","axiosClient","usePublicSponsorImage","documentId","blob","shouldFetch","_useSWR","toString","requestUrl","Authorization","responseType","sponsorImage","URL","createObjectURL","stringAvatar","_firstName$charAt","_lastName$charAt","_name$split","_name$split2","lastName","firstName","charAt","RootContainer","StyledAvatar","Avatar","StyledInfo","PublicSponsorBox","_referral$CustomerId","referral","sponsorDocument","useGetCustomerProfileImage","CustomerId","FullName","src","align","getCorrectTabIndex","PreStepForm","_config$appleLogin","_config$facebookLogin","_config$googleLogin","_config$invitationCod","_config$invitationCod2","_config$legalNoticeTe","_config$legalNoticeTe2","_config$googleLogin2","_config$appleLogin2","_config$facebookLogin2","isSuccessSubmit","onSubmitForm","isInvitationFieldVisible","setIsInvitationFieldVisible","methods","useForm","reValidateMode","mode","formState","register","isValid","isSubmitted","isSubmitting","formValues","invalidCodeErrors","filter","er","_er$fieldName$toLower","_er$fieldName","Object","keys","val","socialValidationMessage","isShowCustomValidationMessage","BPAndLink","ReferralType","visibleByType","isShowSponsorBox","loginWithSocialNetwork","loginType","handleSubmit","contactEmail","contactTelephone","isAnySocialNetworkAvailable","appleLogin","facebookLogin","googleLogin","FormProvider","noValidate","onSubmit","container","invitationCode","Collapse","in","password","legalNoticeText","TermsAndConditions_Link","TermsAndConditions_Url","PrivacyPolicy_Link","PrivacyPolicy_Url","Apple","Facebook","paddingTop","WrapperCaptcha","PreStep","_captcha$siteKey","registrationConfig","_useGetApplicationsSi","useGetApplicationsSimplifiedRegistrationRequestValidation","captcha","isValidating","submitSuccess","setSubmitSuccess","recaptchaRef","useRef","submitErrorLoginType","showCaptcha","siteKey","_recaptchaRef$current","captchaToken","current","executeAsync","isNotSocialNetwork","currentData","currentStep","startDate","Date","sponsorOrigin","sponsorNumber","ConsultantNumber","createResponse","createCustomerRegistration","_data$password","redirectUrl","form","createElement","method","action","append","body","submit","_errorResponse$respon","errorResponse","status400BadRequest","Errors","submitErrors","PropertyName","Code","ReCAPTCHA","size","badge","sitekey","useContactMetadata","getTenantCustomerRegistrationsMetadatumContactDetailsMetadata","isVerificationEnabled","fetchContactMetadata","useContactData","reFetchkey","registrationIdParam","getCustomerRegistrationContactDetails","isContactVerified","fetchContactData","virtualPagePahNameMap","Map","getVirtualPageURL","urlBase","virtualStep","has","getVirtualPagePathName","getPageURL","step","window","location","origin","pathname","search","virtualPageEventDispatch","virtualPageEventData","virtualPageTitle","previousPageURL","virtualPageURL","CustomEvent","VirtualPageEvent","detail","dispatchEvent","AnchorResend","StyledTextField","ResendText","CodeDiv","ResendLink","handleResendCode","isResendDisabled","role","VerificationCodeInput","handleInput","handleDelete","handlePaste","isError","verificationInputRef","instance","onInput","onKeyDown","preventDefault","select","onPaste","Verify","handleSubmitVerification","invalidCodeError","codeInputRefs","submitErrorMessage","mountOrUpdate","useCallback","_codeInputRefs$curren","focus","onNumberDelete","_codeInputRefs$curren2","newInputIndex","setInputRef","submitVerification","_codeNumbers","codeNumbers","input","code","onNumberInput","_codeInputRefs$curren3","pastedCode","clipboardData","getData","codeLength","codeArray","forEach","codeInputRef","Number","isNaN","from","_x","renderVerificationCodeInput","paragraph","StyledTitle","StyledSubTitle","StyledGridContainer","VerificationChannelForm","_contactMetadata$emai","handlePrimaryChannel","contactMetadata","contactData","content","email","telephone","correctData","updateContactResponse","updateCustomerRegistrationContactDetails","RootLoader","VerificationLoading","VerifyWrapper","WrapperContainer","VerificationIcon","CheckCircle","A200","VerificationIconSuccess","VerificationStep","_contactData$contactT","_contactData$contactE","handleVerifySuccess","isVerification","setIsVerification","isPrimaryChannel","setIsPrimaryChannel","isVerified","setIsVerified","_useState7","_useState8","setIsSubmitting","_useState9","_useState10","resendDisabled","setResendDisabled","isEmailVerification","isLoginWithoutSocialNetwork","createConfirmResponse","createCustomerRegistrationContactDetailsConfirmation","confirmationCode","setTimeout","resendCodeResponse","StyledWelcomeTitle","WelcomeWrapper","WelcomeActionButton","WelcomeAppButton","backgroundColor","WelcomeStep","isIOS","isAndroid","isRedirectDisabled","setIsRedirectDisabled","isMobileOperatingSystem","userAgent","MSStream","dynamicLink","useGetTenantDigitalCatalogueDynamiclink","fallbackToWeb","clientApplication","handleLocationChange","addEventListener","removeEventListener","link","flexWrap","StyledStep","Step","Stepper","steps","visibleLables","canChangeStep","stepperWidth","MuiStepper","_createElement","stepNumber","StepLabel","usePersonalMetadata","getTenantCustomerRegistrationsMetadatumPersonalDetailsMetadata","fetchPersonalMetadata","usePersonalData","getCustomerRegistrationPersonalDetails","fetchPersonalData","revalidateOnFocus","scrollTopFunctionHelper","scrollTop","GenderLabelMapper","GenderLabelMapperInternal","transforms","Man","Other","Woman","_default","SelectWrapper","SelectFormFieldByConfig","_selectField$availabl","labelMapper","selectField","getLocalizationKey","currentOptions","StyledInfoBox","A400","StyledInfoCircle","InfoCircle","DatePickerField","_culture$calendarForm","_culture$calendarForm2","infoText","defaultDate","invalidMsg","culture","useCulture","culturePattern","calendarFormat","patterns","shortDatePattern","dateFormat","dateString","_step","usedDay","usedMonth","usedYear","usedSeparator","_iterator","_createForOfIteratorHelper","s","n","done","char","f","generateDateFormat","invalidDateMessage","correctFormat","toUpperCase","actualDate","setFullYear","getFullYear","minDate","minValue","maxDate","maxValue","formattedMax","format","formattedMin","invalidMaxDateMessage","invalidMinDateMessage","initialDate","renderInputProps","validate","currentDate","getTime","isValidMax","isValidMin","LocalizationProvider","dateAdapter","DateAdapter","DesktopDatePicker","disableOpenPicker","open","slotProps","textField","getOptionLabelSingleLine","lineNumber","addressFormat","_item$streetAddress","lines","fields","separators","idx","correctField","newField","at","defaultAddressFormat","fetchAddressFormatMetadata","typeParam","emptyAddressFormatMetadata","getAddressFormat","useAddressFormatMetadata","AddressAutocomplete","_form$formState$error","_values$address","searchOptions","searchedFields","errorKeys","address","isErrors","some","sf","suggestions","setSuggestions","isOpenSelect","setOpen","isItemClicked","setItemClicked","lastSearchedText","setLastSearchedText","countryValue","minSearchLength","handleSearchTextChange","getStateAddressSuggestions","searchText","pathKey","_searchOptions$maxRes","addressNodesResult","emptySuggestionsResponse","addressSuggestionsCollection","apiParams","SearchText","Top","Country","PathKey","nodes","getAddressSuggestions","maxResults","node","addressSummary","description","count","addressNodeId","handleOnClick","suggestedAddresses","renderInput","other","componentProps","renderAddressSuggestionItem","suggestion","renderSuggestions","getItemProps","items","component","suggestionProps","itemProps","whiteSpace","wordBreak","renderSuggestion","Paper","zIndex","right","overflow","background","maxHeight","overflowY","elevation","handleAutocompleteKeyUp","searchInput","trimStart","Downshift","defaultHighlightedIndex","selectedItem","onSelect","nodeId","addressNode","getAddressSearchResult","getAddress","entries","nodeKey","addressNodeKey","addressValue","entry","_entry","inputValue","onOuterClick","getInputProps","_getInputProps","_excluded2","mergedInputProps","startAdornment","Search","getAutocompleteContent","StyledGridItem","StyledSingleLineLabel","StyledSingleLineAddress","wordWrap","AddressSection","_configAddress$operat","_configAddress$operat2","_configAddress$operat3","_actualValues$address","_configAddress$search2","_configAddress$zipcod","_configAddress$zipcod2","_configAddress$street","_configAddress$street2","_configAddress$city","_configAddress$city2","_configAddress$provin","_configAddress$provin2","_configAddress$delive","_configAddress$delive2","_configAddress$delive3","_configAddress$area","_configAddress$area2","_configAddress$locali","_configAddress$locali2","_configAddress$distri","_configAddress$distri2","_configAddress$region","_configAddress$region2","fieldsConfig","resultFields","_configAddress$search","configAddress","actualValues","useUpperCaseAddress","formatAddressFields","canCreate","operations","create","canUpdate","update","canDelete","canEdit","formatedAddress","fieldsForValidateInSearch","_field$1$validation","singleLineAddress","addressAutocomplete","PersonalDetailsForm","_config$useUpperCase","_config$contactEmail","_config$contactTeleph","_config$address","_config$useUpperCase2","_formValues$address","_config$address2","_config$useUpperCase3","initialData","datePickerPlaceholder","defaultValues","read","uniqueId","gender","placeholderText","birthDate","PersonalStep","personalConfig","_usePersonalData","personalInitialData","actualHours","getHours","currentBirthDate","setHours","currentAddress","addressType","updateResponse","updateCustomerRegistrationPersonalDetails","useLegalMetadata","getTenantCustomerRegistrationsMetadatumLegalDetailsMetadata","fetchLegalMetadata","applyNegative","isNegative","personalData","contact","marketingOriflame","marketingExternal","publication","newsletters","uplineLeaderData","uplineLeaderBrowse","marketingConsultant","blockGuaranteeOrdering","useLegalData","isNegativeParam","getCustomerRegistrationLegalDetails","approvals","isReseller","confirmation1","confirmation2","fetchLegalData","StyledFormControlLabel","FormControlLabel","StyledCheckbox","Checkbox","customRequiredFields","Set","CheckboxFormFieldByConfig","customRequired","control","defaultChecked","checked","useCustomHeaders","useRegistrationData","registrationData","setRegistrationData","getResponse","getCustomerRegistration","statusNotFound","status404NotFound","useIsMobile","RootDiv","StyledTypography","_ref2$ownerState","ownerState","_ref2$ownerState$expa","expanded","_ref2$ownerState$visi","visibleMoreButton","_ref2$ownerState$heig","lineHeight","transition","OverlayWrapper","_ref3$ownerState$expa","Link","_ref4$ownerState$expa","borderBottom","ExpandableTextBlock","_customTextRef$curren","_customTextRef$curren2","_customTextRef$curren3","_customTextRef$curren4","isExpanded","setIsExpanded","customTextHeight","setCustomTextHeight","dataTestId","customTextRef","customTextVisibilityLength","customTextLength","innerText","customTextClientHeight","clientHeight","isMoreTextVisible","onResize","expandButton","underline","BackButtton","StyledArrowIcon","ArrowLeftThin","DocumentInfoWrapper","ConditionsInfoWrapper","up","ConditionTitle","PolicyText","CollapseBox","TermsConditionsCheckbox","_config$customText","_values$termsAndCondi","_config$termsAndCondi2","_config$termsAndCondi3","notificationStore","terms","setTerms","showPrivacyPolicy","setShowPrivacyPolicy","trigger","isCustomTextAvailable","customText","getTerms","termsResponse","getCustomerRequiredTerms","isShowPrivacyPolicy","requiredTerm","_config$termsAndCondi","termsAndConditions","termId","LegalDocument1_Link","LegalDocument2_Link","LegalDocument3_Link","LegalDocument4_Link","LegalDocument5_Link","LegalDocument6_Link","LegalDocument7_Link","LegalDocument8_Link","LegalDetailApprovals","_config$approvals","_approvalValues$appro","_approvalValues$appro2","_config$approvals2","_approvalValues$appro3","_approvalValues$appro4","_config$approvals3","_approvalValues$appro5","_approvalValues$appro6","_config$approvals4","_approvalValues$appro7","_approvalValues$appro8","_config$approvals5","_approvalValues$appro9","_approvalValues$appro10","_config$approvals6","_approvalValues$appro11","_approvalValues$appro12","_config$approvals7","_approvalValues$appro13","_approvalValues$appro14","_config$approvals8","_approvalValues$appro15","_approvalValues$appro16","_config$approvals9","_approvalValues$appro17","_approvalValues$appro18","_config$approvals10","_approvalValues$appro19","_approvalValues$appro20","_config$approvals11","_approvalValues$appro21","_approvalValues$appro22","_config$approvals12","_approvalValues$appro23","_approvalValues$appro24","_config$approvals13","approvalValues","showApprovals","setShowApprovals","isNegativeApprovals","shared","displayAsNegative","ArrowDownThin","useDocumentTypes","errorMsg","getTenantDocumentTypes","fetchCustomerDocumentType","useCustomerDocumentsInfos","_registrationData$cus","registrationCustomerId","customHeaders","_await$Promise$all","Promise","all","getCustomerDocumentsInfos","getCustomerDocumentApprovals","_await$Promise$all2","documents","info","documentApproval","approval","documentIds","fetchCustomerDocumentInfo","FileInputField","accept","isMultiple","inputLabel","htmlFor","multiple","UploadButtonWrapper","UploadButton","triggerFileUploadFinished","onFileUploadedProp","UploaderForm","handleFileChanged","onUploadStart","handleUploadStart","onFileUploaded","handleFileUploaded","onUploadFinished","handleUploadFinished","maxFileSize","documentTypeId","isTemporary","inputName","documentsInfoData","getInputRef","element","createDocument","customerIdProperty","requestBody","requestOptions","createCustomerDocument","replaceDocument","oldDocumentId","newDocumentRequestOptions","deleteResult","deleteCustomerDocument","deleteDocument","button","useMemo","_useMemo","_documentsInfoData$fi","sort","a","b","createdDate","lastOfType","fileMapper","file","fileKey","maxFileSizeProp","maxFileSizeError","maxMBs","Math","ceil","fetchResult","fileResult","_response$errors","fileUploadResult","mapToFileUploadResult","uploadedFiles","files","uploadPromises","handleChangeFile","click","Uploader","WrappedComponent","StyledFeedbackDialog","FeedbackDialog","bottom","borderBottomLeftRadius","borderBottomRightRadius","ButtonDelete","contrastText","ButtonCancel","ConfirmDeleteDialog","opened","handleConfirm","handleCancel","hideCloseButton","severity","header","actions","useDocumentThumb","previewSize","thumbUrl","fetchKey","params","useDocumentThumbDetail","thumbDetailUrl","StyledDialogContent","DialogContent","CloseButton","DocumentIcon","Document","ThumbWithDetail","fileName","detailOpened","setDetailOpened","imageThumb","setImageThumb","imageDetail","setImageDetail","documentThumbUrl","documentThumbDetailUrl","fileNameProperty","imgUrl","handleOpenDetail","avatar","thumb","getAvatar","detailImage","alt","Dialog","DialogTitle","Clear","useCustomerDocument","StyledSpanLabel","DocumentState","reason","stateElement","approvalState","getStateColor","getLocalization","flexCenter","StyledListItem","StyledDivContent","StyledSpanInfo","StyledSpanThumb","StyledSpanActions","StyledSpanFile","StyledSpanFileName","textOverflow","whitespace","StyledSpanFileNameLink","StyledSpanFileSize","A700","StyledErrorIcon","StyledDeleteIcon","StyledProgress","LinearProgress","_ref12","DocumentItemFile","fileSize","visibleApprovalState","documentItemUrl","handleDownloadDocument","documentUrl","round","approvalReason","getApprovalState","DocumentItem","deleteAction","onDocumentRemove","isShowApprovalState","isDeleteConfirmationRequired","uploadProgress","confirmOpened","setConfirmOpened","confirmDelete","removeDocument","mapToDocumentItemProps","documentStoreData","deleteConfirmationRequired","_documentStoreData$fi","isDocumentPending","renderDocumentItem","documentProps","StyledRequiredDocument","StyledDivHeader","StyledList","listStyle","StyledListPending","StyledDivWrapper","_ref9$ownerState$hasD","hasDocuments","StyledDivUploader","StyledDivHistory","borderTop","StyledExpanedIcon","StyledDivExpander","_ref13","StyledDivFileInput","_ref14","_ref15","StyledDivBoxExpandHistory","_ref16","DocumentHistory","temporaryDocument","historyExpanded","histroyDocumentsInfoData","handleToggleClick","documentPending","documentsHistory","_getInfoByType","typeId","includeTemporary","getHistoryDocuments","classes","uploadProgressDone","DocumentLoadingProgress","textUploading","textDone","progress","uploadFinished","documentLoadingProgress","CheckHeavy","DocumentContent","_configDocument$expir","documentType","editableDocument","documentInpuName","configDocument","documentIsRequired","handleDocumentsChange","isTemporaryDocument","isHistoryExpanded","setIsHistoryExpanded","isUploading","setIsUploading","isUploadFinished","setIsUploadFinished","filesInProgress","setFilesInProgress","setFetchKey","setDefaultState","removeFile","previousState","documentData","triggerDocumentsChange","propertyDocumentIds","newDocuments","getDocuments","fileInputProps","copyDocumentData","now","uploadedDocuments","uploadedDocumentIds","_d$documentId","correctDocumentIds","newDocumentIds","allowMultipleDocuments","_toConsumableArray","uploadFilesInProgress","handleFileUploadProgress","supportedMimeTypes","maxDataSize","documentCardTypeField","cardType","documentCardNumberField","cardNumber","disabledForIdentityCardTypes","expiration","expirationDocumentField","_values$identityCard","identityCard","getfilesInProgress","getFilesInProgress","documentsToRender","renderDocuments","uploader","DocumentHeader","requiredDocument","documentTypeIdProperty","documentLabel","documentInfoText","documentsTypeData","isLoading","LegalDocuments","_documentsConfig$iden","_documentsConfig$addi","documentsConfig","localDocuments","setLocalDocuments","getDocumentLabel","localization","updateIdentityCard","documentsCollection","updateAdditionalIdentityCard","getDocumentIds","_documents$documentsC","idCard","_config$isAvailable","_config$isEditable","_config$documentTypeI","_config$validation","idCardDocumentInfoText","correctDocuments","renderIdentityCardDocument","additionalIdCard","_config$isAvailable2","_config$isEditable2","_config$documentTypeI2","_values$additionalIde","_config$validation2","additionalIdentityCard","additionalDocumentInfoText","renderAdditionalIdentityCardDocument","documentsAvailableContent","documentsContent","LegalDetailsForm","_config$identityCard","_config$additionalIde","_config$confirmation","_config$confirmation2","shouldFocusError","identityErr","prevValues","identityValues","newValues","availableApprovals","isAnyAprrovalAvailable","isAnyDocumentAvailable","ContentWrapper","LegalStep","_legalConfig$approval","legalConfig","legalInitialData","handleUpdateRegistration","updateCustomerRegistration","analyticsData","getCustomerRegistrationAnalytics","getAnalyticsData","_analyticsData$signUp","_sponsorNumber$toStri","consultantNumber","customerTypeId","registrationChannel","visitorSegment","signUpDate","signUpDateOffset","getTimezoneOffset","signUpDateWithoutOffset","registerEventData","registeredUserId","toISOString","placement","Placement","JoinUs","UserRegisteredEvent","handleUserRegisteredEvent","submitData","_data$identityCard","_data$additionalIdent","emptyIDCard","getCorrectSubmitData","currentSubmitData","updateResponseLegal","updateCustomerRegistrationLegalDetails","_errorResponse$respon2","useSponsorMetadata","getTenantCustomerRegistrationsMetadatumSponsorDetailsMetadata","fetchSponsorMetadata","useSponsorData","getCustomerRegistrationSponsorDetails","fetchSponsorData","useSponsorInfoData","refetchKey","getCustomerRegistrationSponsorDetailsSponsorInfo","fetchSponsorInfoData","useSponsorImage","profileImageDocumentId","StyledNameLabel","NexButtton","SponsorBox","sponsorDetailInfo","isVisibleNextButton","fullName","selectBpVariant","FindButtton","AddressAutocompleteWrapper","StyledToggle","Toggle","ConnectToBPForm","_config$preselectedSp","_config$address$count","_values$address2","_values$address$count","_values$address3","_values$address4","_values$address5","_config$address6","_config$address7","_initialData$address","_config$address8","_config$address9","sponsorInfo","profileSponsorImage","isDefaultAddress","defaultSelectSponsorType","preselectedSponsorSelectionMethod","selectSponsorType","setSelectSponsorType","setCountry","resetKey","setResetKey","countryOptions","countryFieldName","findSponsor","_config$address3","_config$address5","_config$address4","isKnowSponsorNumber","knowSponsorNumber","isFindSponsorSelected","handleChangeCountry","countryProperty","countryField","mb","firstText","secondText","currentTarget","isDisabledFind","submitButton","knowSponsorLabelVariant","RadioGroup","reset","Radio","SponsorStep","_sponsorConfig$addres","_sponsorConfig$addres2","_personalInitialData$2","sponsorConfig","sponsorInitialData","sponsorInfoData","oneCountryMarket","defaultAddressType","defaultAddressAvailable","_personalInitialData$","_sponsorConfig$addres3","correctAddressData","correctSponsorNumber","updateCustomerRegistrationSponsorDetails","ContentContainer","StepperWithContent","cache","useSWRConfig","isVipCustomerType","isCorrectReferral","vipWithoutSponsor","actualStep","indexOf","stepperContent","getStepperContent","OriflameLogoSvg","LogoSeparator","StyledBox","OriflameLogo","flexGrow","paddingInline","threeSteps","twoSteps","LandingPage","_data$customIcon","feedBackIcon","handleClose","currentSteps","correctContent","FeedbackNotification","customIcon","onClose","App","configuration","TestIdProvider","team","Team","Acquisition","project","APP_NAME","Suspense","fallback","ThemeProvider","enableCacheProvider","cacheKey","ClientCultureProvider","swr","suspense","rootElement","_rootElement$dataset$","dataset","clientAppConfig","parseClientAppConfig","createRoot","UniversalTokenProvider","initialToken","EMOTION_CACHE_KEY"],"sourceRoot":""}