{"version":3,"file":"index-839459d8.js","sources":["../../../client-app/src/common/myPagesUi/components/box/Box.tsx","../../../client-app/src/common/components/CddWizard/formikFieldsFromQuestions.tsx","../../../client-app/src/common/lib/FetchHelpers.ts","../../../client-app/src/common/services/oddService/index.ts","../../../client-app/src/common/myPagesUi/components/Layout/Spacing/Spacing.tsx","../../../client-app/src/common/components/CddWizard/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport styles from \"./Box.module.css\"\n\ntype BoxType = 'marketing' | 'notify' |'notifyThemeColoredText' | 'white' | 'whiteThemeColoredText' | 'subtle' | 'gradient' | 'flippedGradient' | 'whiteShadow';\ntype Padding = 'default' | 'small' | 'none';\n\ntype boxProps = {\n children?: React.ReactNode;\n type: BoxType,\n padding?: Padding,\n className?: string\n}\n\nfunction getClassName(direction: BoxType): string {\n switch (direction) {\n case 'marketing':\n return `${styles.box} ${styles.boxMarketing}`;\n case 'notify':\n return `${styles.box} ${styles.box200}`;\n case 'notifyThemeColoredText':\n return `${styles.box} ${styles.box200ThemedTextColor}`;\n case 'subtle':\n return `${styles.box} ${styles.boxSubtle}`;\n case 'white':\n return `${styles.box} ${styles.boxWhite}`;\n case 'whiteThemeColoredText':\n return `${styles.box} ${styles.boxWhiteThemedTextColor}`;\n case 'gradient':\n return `${styles.box} ${styles.gradientInner}`;\n case 'flippedGradient':\n return `${styles.box} ${styles.gradientInner}`;\n case 'whiteShadow':\n return `${styles.box} ${styles.boxWhiteShadow}`;\n default:\n return `${styles.box} ${styles.boxSubtle}`;\n }\n}\n\nfunction getPadding(direction: Padding): string {\n switch (direction) {\n case 'small':\n return `${styles.boxSmall}`;\n case 'none':\n return \"\";\n default:\n return `${styles.boxDefault}`;\n }\n}\n\ntype combinedBoxProps = boxProps & React.HTMLAttributes;\n\ntype clickableBoxProps = {\n onClick: () => void;\n nameforuitesting: string;\n}\n\n\nexport function ClickableBox({children, onClick, ...props}: clickableBoxProps & combinedBoxProps) {\n return {\n if (e.nativeEvent.key ==='Enter') {\n onClick();\n }\n }} tabIndex={0} onClick={onClick} {...props}>\n {children}\n \n}\n\nexport function Box({ children, type, padding = \"default\", className = '', ...props }: combinedBoxProps) {\n return (\n
\n
\n {children}\n
\n {type === 'marketing' && \n \n \n \n \n \n \n \n \n \n \n }\n
\n );\n}","import { valueAt } from '@n2-common/lib/utils';\nimport { TFunction } from 'i18next';\nimport { AmountInput, FormikInput, FormikSelect } from '../../ui';\nimport { OptionProps } from '../../ui/Select';\nimport { amountNotEmpty } from '../../validation/common/amount';\nimport { stringRequired } from '../../validation/common/string';\nimport { addPleaseSelectOption } from '../MultiStageOnePageWizard';\nimport { schemaOfType } from '@n2-common/lib/yup-helpers';\nimport type { StageField } from '../MultiStageOnePageWizard/types';\nimport { Question } from '@n2-common/serverGeneratedTypings/question';\nimport { AnswerOption } from '@n2-common/serverGeneratedTypings/answerOption';\nimport { ValidationError } from 'yup';\nimport { CompareValidation } from '@n2-common/applicationPages/CddPage/cddSpec';\nimport { PreFilledAnswer } from '.';\nimport * as Yup from 'yup';\n\ntype FormFromQuestions = { [K in Extract]: string | null };\n\nexport function formikFieldsFromQuestions>(\n questions: Questions,\n t: TFunction,\n countries: AnswerOption[],\n preFilledAnswersToHide: PreFilledAnswer[] | null | undefined\n): StageField[] {\n return questions.map((q) => {\n let answerOptions: OptionProps[] = [];\n if (q.QuestionType.toLowerCase() === 'countrycode') {\n answerOptions = countries.map((o) => ({\n value: o.AnswerCode,\n text: o.TranslationText,\n }));\n } else if (q.AnswerOptions.length) {\n answerOptions = q.AnswerOptions.map((o) => ({\n value: o.AnswerCode,\n text: o.TranslationText,\n }));\n }\n const isSelect = answerOptions.length > 0;\n const preFilled = preFilledAnswersToHide ? preFilledAnswersToHide.find((m) => m.questionCode === q.QuestionCode) : null;\n const isNumeric = q.IsNumeric === true;\n const dependsOnFieldName = q.DependsOnQuestionCode;\n const fieldValidation = isNumeric ? amountNotEmpty(q.TranslationText, t) : q.IsOptional ? Yup.string().notRequired() : stringRequired(t);\n const field: StageField = {\n name: q.QuestionCode as StageField['name'],\n\n hidden: (values) => {\n if (!dependsOnFieldName) {\n return preFilled ? !!preFilled.answerCode : false;\n }\n const dependentValue = valueAt(values, dependsOnFieldName as PathsOfType);\n return !dependentValue || !q.ShowIfValues.includes(dependentValue as string);\n },\n validation: dependsOnFieldName\n ? schemaOfType(fieldValidation).test(\n `is-dependent-on-${dependsOnFieldName}-check`,\n t('validation:string.required'),\n async function test(val, ctx) {\n const values = ctx.parent || ctx.options.context?.formikValues;\n\n /* if (values && !values[dependsOnFieldName]) {\n console.warn(`No reference to '${dependsOnFieldName}', when validating '${q.QuestionCode}'.`, ctx);\n } */\n if (values && dependsOnFieldName in values && q.ShowIfValues.includes(values[dependsOnFieldName])) {\n try {\n // NOTE: scheme.validateSync is communicating errors via throwing ValidationError!\n await fieldValidation.validateSync(val);\n return true;\n } catch (err) {\n if (err instanceof ValidationError) {\n return ctx.createError({ message: err.message });\n }\n return false;\n }\n }\n return true;\n }\n )\n : fieldValidation,\n\n Component: (props) =>\n isSelect ? (\n \n ) : isNumeric ? (\n \n ) : (\n \n ),\n componentProps: { label: `${q.TranslationText}` },\n };\n const comparrison = CompareValidation.find((cv) => cv.questionCode == q.QuestionCode);\n if (comparrison) {\n field.validation = field.validation.test(`compare-to-${comparrison.compareTo}`, t(comparrison.message), function test(val, ctx) {\n const dependsOnFieldName = comparrison.compareTo;\n const values = (dependsOnFieldName in ctx.parent && ctx.parent) || ctx.options.context?.value;\n\n /* if (values && !values[dependsOnFieldName]) {\n console.warn(`No reference to '${dependsOnFieldName}', when validating '${q.QuestionCode}'.`, ctx);\n } */\n if (values && dependsOnFieldName in values) {\n return comparrison.validate(val, values[dependsOnFieldName]);\n }\n return true;\n });\n }\n return field;\n });\n}\n","export function isJsonResponse(response: Response): boolean {\n const contentType = response.headers.get('content-type');\n if (typeof contentType == 'string' && contentType.includes('application/json')) {\n return true;\n }\n return false;\n}\n\nexport type ProblemDetail = {\n detail: string;\n status: number;\n title: string;\n type: string;\n};\nexport function isProblemDetail(obj: Record): obj is ProblemDetail {\n if (typeof obj == 'object') {\n if (obj != null) {\n return (obj as ProblemDetail).type == 'https://tools.ietf.org/html/rfc7231#section-6.5.4';\n }\n }\n return false;\n}\n\n//\"2023-07-13T07:16:36.9811813Z\"\nconst dateFormat = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d*)?Z?(\\+\\d{2}:\\d{2})?$/;\n\nexport type JsonType = string | number | boolean | null | JsonType[] | { [key: string]: JsonType };\n\nfunction reviver(key: string, value: JsonType) {\n if (typeof value === 'string' && dateFormat.test(value)) {\n return new Date(value);\n }\n\n return value;\n}\n\nexport async function parseJsonResponseWithDate(response: Response) {\n const text = await response.text();\n return JSON.parse(text, reviver) as T;\n}\n\nexport function checkFor401AndMaybeLoadLoggedOutPage(response: Response) {\n if (response.status == 401) {\n window.location.hash = '/loggedOut';\n }\n}\n","import { default as fetch } from '@n2-common/lib/fetchProxy';\nimport { checkFor401AndMaybeLoadLoggedOutPage, parseJsonResponseWithDate } from '@n2-common/lib/FetchHelpers';\nimport { DueDiligenceStatus } from '@n2-common/serverGeneratedTypings/dueDiligenceStatus';\nimport { PepStatusResponse } from '@n2-common/serverGeneratedTypings/pepStatusResponse';\nimport { CddAnswer } from '@n2-common/serverGeneratedTypings/cddAnswer';\nimport { SubmitOddAnswerModel } from '@n2-common/serverGeneratedTypings/submitOddAnswerModel';\nimport { SubmitOddAnswersResponse } from '@n2-common/serverGeneratedTypings/submitOddAnswersResponse';\nimport { DueDiligenceQuestionsModel } from '@n2-common/serverGeneratedTypings/dueDiligenceQuestionsModel';\nimport { UploadDocumentResponse } from '@n2-common/serverGeneratedTypings/uploadDocumentResponse';\n\nexport async function getOddStatus(): Promise {\n const requestUrl = `/api/n2/mypage/odd/status`;\n\n const response = await fetch(requestUrl, { method: 'GET', redirect: 'error' });\n checkFor401AndMaybeLoadLoggedOutPage(response);\n return parseJsonResponseWithDate(response);\n}\n\nexport async function getOddQuestions(): Promise {\n const requestUrl = `/api/n2/mypage/odd/questions`;\n\n const response = await fetch(requestUrl, { method: 'GET', redirect: 'error' });\n checkFor401AndMaybeLoadLoggedOutPage(response);\n return parseJsonResponseWithDate(response);\n}\n\nexport async function postOddAnswers(payload: CddAnswer[], includesEnhanced: boolean, submissionId: string) {\n const requestUrl = `/api/n2/mypage/odd/answers`;\n const model: SubmitOddAnswerModel = {\n CddQuestionsWithAnswers: payload,\n IncludesEnhanced: includesEnhanced,\n SubmissionId: submissionId\n };\n const response = await fetch(requestUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n redirect: 'error',\n body: JSON.stringify(model),\n });\n checkFor401AndMaybeLoadLoggedOutPage(response);\n return parseJsonResponseWithDate(response);\n\n}\n\nexport async function uploadOddDocument(documentKey: string, data: FormData): Promise {\n const response = await fetch(\n `/api/n2/mypage/odd/document?documentKey=${documentKey}`,\n {\n method: 'POST',\n body: data,\n }\n );\n checkFor401AndMaybeLoadLoggedOutPage(response);\n const res = (await response.json()) as UploadDocumentResponse;\n return res;\n}\n\nexport async function getPepStatus(): Promise {\n const requestUrl = `/api/n2/mypage/odd/pepStatus`;\n\n const response = await fetch(requestUrl, { method: 'GET', redirect: 'error' });\n checkFor401AndMaybeLoadLoggedOutPage(response);\n return parseJsonResponseWithDate(response);\n}\n","import React, { ReactNode } from \"react\";\nimport styles from './Spacing.module.css';\n\ntype Spacing = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\ntype SpacingProps = {\n children?: ReactNode;\n direction?: 'horizontal' | 'vertical';\n spacing?: Spacing;\n spaceBetween?: boolean\n};\n\nexport const Spacing = ({ children, direction = \"vertical\", spacing = 6, spaceBetween = false }: SpacingProps) => {\n let className = '';\n switch(direction){\n case 'horizontal':\n className = `${styles['spacing-'+spacing.toString()]} ${styles.horizontal}`;\n break;\n case 'vertical':\n className = `${styles['spacing-'+spacing.toString()]} ${styles.vertical}`;\n break;\n }\n \n return
{children}
;\n};","import { trueFalseValues } from '@n2-common/uiFieldValues/applicationFormFields';\nimport { FormikValues } from 'formik';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { CddAnswer } from '../../serverGeneratedTypings/cddAnswer';\nimport { Button, ButtonRowContainer, DismissableErrorMessage, Headline, InputGroup, Paragraph } from '../../ui';\nimport Wizard from '../MultiStageOnePageWizard';\nimport style from './style.module.scss';\nimport type { SubmitState, WizardStage } from '../MultiStageOnePageWizard/types';\nimport { SubmitProgressBox } from '@n2-common/ui/SubmitProgress';\nimport { Question } from '@n2-common/serverGeneratedTypings/question';\nimport { AnswerOption } from '@n2-common/serverGeneratedTypings/answerOption';\nimport { formikFieldsFromQuestions } from './formikFieldsFromQuestions';\nimport FileUploadButton from '../FileUploadButton';\nimport { DocumentInfo, Uploads } from '../UploadDocuments';\nimport { uploadOddDocument } from '@n2-common/services/oddService';\nimport { Box } from '@n2-common/myPagesUi/components/box/Box';\nimport { Spacing } from '@n2-common/myPagesUi/components/Layout/Spacing/Spacing';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\n\nexport interface DependendQuestion {\n DependsOnFieldName: string;\n ShowIfValues: string[];\n}\n\n/*\nconst getFormikFieldsFilteredByQuestionDependencies = (\n formikFields: StageField[],\n dependencies: Map\n) => {\n const fields: StageField[] = [];\n formikFields.forEach((field) => {\n const dependendField = dependencies.get(field.name);\n field.hidden = field.hidden === undefined ? false : field.hidden;\n if (dependendField) {\n field.hidden = (values) => {\n const dependentValue = valueAt(values, dependendField.DependsOnFieldName);\n return !dependentValue || !dependendField.ShowIfValues.includes(dependentValue as string);\n };\n\n const validation = field.validation;// Capture original validation - we don't want stack overflow!\n field.validation = defineSchema(field.validation.type).when(dependendField.DependsOnFieldName, {\n This should be changed to test function (like in formikFieldsFromQuestions) if ever un-commented again :-)\n is: (val: string) => dependendField.ShowIfValues.includes(val),\n then: () => validation,\n otherwise: () => defineSchema(field.validation.type).nullable().notRequired(),\n });\n }\n fields.push(field);\n });\n return fields;\n};*/\n\nexport interface PreFilledAnswer {\n questionCode: string;\n answerCode: string;\n}\n\nexport interface CddQuestionGroups {\n amlPage1: string[];\n pepQuestions: string[];\n extendedQuestions: string[];\n}\n/*\nexport type CddSubmitState = {\n submitState: SubmitState;\n askForExtendedInformation: boolean;\n}*/\n\nexport type CddProps = {\n isPepFieldName: string;\n isPep: boolean;\n questions: Question[];\n documentUploadQuestions?: Question[];\n countries: AnswerOption[];\n questionGrups: CddQuestionGroups;\n preFilledAnswers?: PreFilledAnswer[] | null;\n hideHeadlines?: boolean;\n onSubmit: (\n payload: CddAnswer[],\n setSubmitState: (state: SubmitState) => void,\n setWizardStep: (step: CddSteps) => void,\n includesEnhanced: boolean\n ) => void;\n};\n\nexport type CddFormProps = React.PropsWithChildren & CddProps;\n\nexport enum CddSteps {\n Aml,\n IsPep,\n Pep,\n Extended,\n}\n\nexport default function CddForm({\n isPep,\n isPepFieldName,\n onSubmit,\n questionGrups,\n documentUploadQuestions,\n // children,\n preFilledAnswers,\n questions,\n countries,\n hideHeadlines,\n}: CddFormProps): JSX.Element {\n const [cddFormValues, setCddFormValues] = useState({});\n const [pepFormValues, setPepFormValues] = useState({});\n const [customerSaysPep, setCustomerSaysPep] = useState(null);\n\n const { t } = useTranslation('common');\n\n const getSubmitButtonText = (submitState: SubmitState) => {\n switch (submitState) {\n case 'Done':\n return t('FormSubmitButton.Done');\n case 'NotSent':\n return t('FormSubmitButton.NextStep');\n case 'Processing':\n return t('FormSubmitButton.Processing');\n case 'Submitted':\n return t('FormSubmitButton.Submitted');\n case 'Error':\n return t('FormSubmitButton.Error');\n }\n return t('FormSubmitButton.NextStep');\n };\n const topOfFormRef = useRef(null);\n const [submitState, setSubmitState] = useState('NotSent');\n const [wizardStep, setWizardStep] = useState(CddSteps.Aml);\n const [showPepError, setShowPepError] = useState(false);\n\n const [documentsPendingUpload, setdocumentsPendingUpload] = useState(false);\n const emptyDocumentGuidList: CddAnswer[] =useMemo(() => {\n return documentUploadQuestions ? documentUploadQuestions.map((elm) => {return { QuestionCode: elm.QuestionCode, AnswerCode: null }}): [];\n }, [documentUploadQuestions]);\n const [uploadedDocumentGuids, setUploadedDocumentGuids ] = useState(emptyDocumentGuidList);\n\n useEffect(() => {\n if (documentUploadQuestions && documentUploadQuestions.length > 0) {\n setdocumentsPendingUpload(true);\n }\n }, [documentUploadQuestions]);\n\n const [cddGroups, pepGroups, extendedGroups] = useMemo(() => {\n const allQuestionsAsFormikFields = formikFieldsFromQuestions(questions, t, countries, preFilledAnswers);\n type TF = Parameters>[0];\n const cddQuestionsAsFormikFields = allQuestionsAsFormikFields.filter((m) => questionGrups.amlPage1.includes(m.name));\n //const cddfields = getFormikFieldsFilteredByQuestionDependencies(cddQuestionsAsFormikFields, dependencies);\n const cddGroups: WizardStage[] = [{ fields: [...cddQuestionsAsFormikFields], legend: '', sectionNameForTracking: 'CDD' }];\n\n const pepQuestionsAsFormikFields = allQuestionsAsFormikFields.filter((m) => questionGrups.pepQuestions.includes(m.name));\n // const pepFields = getFormikFieldsFilteredByQuestionDependencies(pepQuestionsAsFormikFields, dependencies);\n const pepGroups: WizardStage[] = [{ fields: pepQuestionsAsFormikFields, legend: '', sectionNameForTracking: 'PEP' }];\n\n const extendedQuestionsAsFormikFields = allQuestionsAsFormikFields.filter((m) => questionGrups.extendedQuestions.includes(m.name));\n // const extendedFields = getFormikFieldsFilteredByQuestionDependencies(extendedQuestionsAsFormikFields, dependencies);\n const extendedGroups: WizardStage[] = [{ fields: extendedQuestionsAsFormikFields, legend: '', sectionNameForTracking: 'Extended' }];\n\n return [cddGroups, pepGroups, extendedGroups];\n }, [countries, preFilledAnswers, questionGrups, questions, t]);\n\n const onAmlSubmit = useCallback(\n (val: FormikValues) => {\n setCddFormValues(val);\n if (isPep) {\n setWizardStep(CddSteps.Pep);\n } else {\n setWizardStep(CddSteps.IsPep);\n }\n },\n [isPep]\n );\n\n useEffect(() => {\n if (!topOfFormRef) {\n return;\n }\n //console.log('Scrolling to top of form from step-change');\n topOfFormRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }, [topOfFormRef, wizardStep]);\n\n const onPepSubmitFunc = useCallback(\n (val: FormikValues) => {\n setPepFormValues(val);\n const total = getAnswerPayload(cddFormValues, val, [], questions, customerSaysPep, isPepFieldName);\n onSubmit(total, setSubmitState, setWizardStep, false);\n },\n [cddFormValues, customerSaysPep, isPepFieldName, onSubmit, questions]\n );\n\n const onExtendedSubmitFunc = useCallback(\n (val: FormikValues) => {\n const total = getAnswerPayload(cddFormValues, pepFormValues, val, questions, customerSaysPep, isPepFieldName);\n if (documentUploadQuestions) {\n documentUploadQuestions.forEach((e) => {\n const documentGuidForDocumentQuestion = uploadedDocumentGuids.find(m => m.QuestionCode === e.QuestionCode);\n if (!documentGuidForDocumentQuestion) {\n logErrorToServerside(\"Unable to find document-guid for uploaded document when submitting e-odd. This should never happen\", '', '', {QuestionCode: e.QuestionCode});\n return;\n }\n total.push({\n QuestionCode: e.QuestionCode,\n AnswerCode: documentGuidForDocumentQuestion?.AnswerCode\n })\n\n })\n \n }\n onSubmit(total, setSubmitState, setWizardStep, true);\n },\n [cddFormValues, customerSaysPep, isPepFieldName, onSubmit, questions, pepFormValues, documentUploadQuestions, uploadedDocumentGuids]\n );\n\n const onAreYouPepNextButtonFunc = useCallback(() => {\n if (customerSaysPep === null) {\n setShowPepError(true);\n return;\n }\n if (customerSaysPep) {\n setWizardStep(CddSteps.Pep);\n } else {\n const total = getAnswerPayload(cddFormValues, [], [], questions, customerSaysPep, isPepFieldName);\n onSubmit(total, setSubmitState, setWizardStep, false);\n }\n }, [cddFormValues, customerSaysPep, isPepFieldName, onSubmit, questions]);\n\n const cddInitialValues = useMemo(() => {\n const cddQuestionArr = questions.filter((m) => questionGrups.amlPage1.includes(m.QuestionCode));\n if (preFilledAnswers === null) {\n return null;\n }\n return generateInitialValuesFromFormAndPrefill(cddQuestionArr, preFilledAnswers);\n }, [preFilledAnswers, questionGrups, questions]);\n\n const pepInitialValues = useMemo(() => {\n if (preFilledAnswers === null) {\n return null;\n }\n const pepQuestionArr = questions.filter((m) => questionGrups.pepQuestions.includes(m.QuestionCode));\n return generateInitialValuesFromFormAndPrefill(pepQuestionArr, preFilledAnswers);\n }, [preFilledAnswers, questionGrups, questions]);\n\n const extendedInitialValues = useMemo(() => {\n if (preFilledAnswers === null) {\n return null;\n }\n const extendedQuestionArr = questions.filter((m) => questionGrups.extendedQuestions.includes(m.QuestionCode));\n return generateInitialValuesFromFormAndPrefill(extendedQuestionArr, preFilledAnswers);\n }, [preFilledAnswers, questionGrups, questions]);\n\n const headLines = useMemo(() => {\n if (wizardStep === CddSteps.Aml) {\n return (\n <>\n {t('Cdd.AmlHeadline')}\n {t('Cdd.AmlDescription')}\n \n );\n }\n if (wizardStep === CddSteps.Pep) {\n if (isPep) {\n return {t('Cdd.PepDescriptionIsPep')};\n }\n return {t('Cdd.PepDescriptionSelectedPep')};\n }\n }, [wizardStep, isPep, t]);\n\n return (\n <>\n {cddGroups &&\n cddGroups.length > 0 &&\n pepGroups &&\n pepGroups.length > 0 &&\n cddInitialValues &&\n pepInitialValues &&\n extendedInitialValues ? (\n <>\n ('Cdd.Submitted')}\n processingText={t('Cdd.Processing')}\n >\n \n \n {hideHeadlines ? null : headLines}\n {wizardStep === CddSteps.IsPep ? (\n
\n {t('Cdd.AreYouPepHeadline')}\n {\n setCustomerSaysPep(e.target.value === 'true');\n setShowPepError(false);\n }}\n label={t('Cdd.AreYouPepQuestion')}\n type={'radio'}\n options={trueFalseValues(t)}\n helptext={t('Cdd.WhatIsPep')}\n error={showPepError && t('Cdd.YouMustChoose')}\n horisontal={true}\n />\n\n \n \n \n
\n ) : null}\n
\n \n
\n
\n \n
\n\n
\n {documentsPendingUpload && documentUploadQuestions ? (\n setdocumentsPendingUpload(false)}\n setUploadedDocumentGuids={setUploadedDocumentGuids}\n uploadedDocumentGuids={uploadedDocumentGuids}\n />\n ) : (\n \n )}\n
\n \n ) : (\n <>\n )}\n \n );\n}\nfunction UploadDocumentsSection({\n documentUploadQuestions,\n setallDocumentUploaded,\n uploadedDocumentGuids,\n setUploadedDocumentGuids,\n\n}: {\n documentUploadQuestions: Question[];\n setallDocumentUploaded: () => void;\n uploadedDocumentGuids: CddAnswer[];\n setUploadedDocumentGuids: (arr: CddAnswer[]) => void\n}) {\n const { t } = useTranslation('mypage');\n\n /* const [documentsUploaded, setDocumentsUploaded] = useState<{ questionCode: string; uploaded: boolean }[]>(\n documentUploadQuestions.map((elm) => ({ questionCode: elm.QuestionCode, uploaded: false }))\n );*/\n\n const setDocumentUploaded = (questionCode: string, documentGuid: string) => {\n const newArr: CddAnswer[] = uploadedDocumentGuids.map((elm) => (elm.QuestionCode === questionCode ? { QuestionCode: elm.QuestionCode, AnswerCode: documentGuid } : elm));\n\n setUploadedDocumentGuids(newArr);\n };\n const allDocumentsUploaded = !uploadedDocumentGuids.find((m) => !m.AnswerCode);\n\n return (\n <>\n {t('dueDiligence.Documents.DocumentUploadsHeadline')}\n \n {documentUploadQuestions.map((elm, i) => (\n \n ))}\n \n {allDocumentsUploaded && (\n
\n

{t('dueDiligence.Documents.AllDocumentUploaded')}

\n \n \n \n
\n )}\n \n );\n}\nfunction UploadDocumentsSectionInner({\n documentUploadQuestion,\n setDocumentUploadedFunc,\n}: {\n documentUploadQuestion: Question;\n setDocumentUploadedFunc: (questionCode: string, documentGuid: string) => void;\n}) {\n const [working, setWorking] = useState(false);\n const { t } = useTranslation('mypage');\n\n const [errorMsg, setErrorMsg] = useState(null);\n\n const [documentUploaded, setDocumentUploaded] = useState(false);\n\n const documentInfo: DocumentInfo[] = documentUploaded\n ? [{ status: '', deleteable: false, trusted: false, id: '', ref: '', filename: t('dueDiligence.Documents.DocumentUploaded') }]\n : [];\n\n const uploadDocumentHandler = async (form: FormData) => {\n setWorking(true);\n setErrorMsg(null);\n try {\n const uploadRes = await uploadOddDocument(documentUploadQuestion.QuestionCode, form);\n setWorking(false);\n setDocumentUploaded(true);\n setDocumentUploadedFunc(documentUploadQuestion.QuestionCode, uploadRes.DocumentGuid);\n } catch (err) {\n setErrorMsg(t('dueDiligence.Documents.UploadError'));\n setWorking(false);\n }\n };\n return (\n \n

\n {t('dueDiligence.Documents.UploadDocumentHeadline')} {documentUploadQuestion.TranslationText}\n

\n ('Sign.Documents.UploadTitle')*/}\n buttonLabel={t('dueDiligence.Documents.UploadButtonTitle')}\n uploadingLabel={t('dueDiligence.Documents.UploadInProgress')}\n />\n\n setErrorMsg(null)} />\n\n {}}\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n footnoteSelector={() => {\n return null;\n }}\n />\n
\n );\n}\n\nfunction BackButton({\n wizardStep,\n setWizardStep,\n isPep,\n}: {\n wizardStep: CddSteps;\n setWizardStep: (value: React.SetStateAction) => void;\n isPep: boolean;\n}) {\n if (wizardStep === CddSteps.Pep) {\n return ;\n }\n if (wizardStep === CddSteps.IsPep) {\n return ;\n }\n return null;\n}\n\nfunction BackButtonElm({ wizardStep, setWizardStep }: { wizardStep: CddSteps; setWizardStep: (value: React.SetStateAction) => void }) {\n const { t } = useTranslation('common');\n\n return (\n {\n e.preventDefault();\n setWizardStep(wizardStep);\n }}\n >\n {'< '} {t('Navigation.Back')}\n \n );\n}\n\nfunction generateInitialValuesFromFormAndPrefill(questions: Question[], preFilledAnswers?: PreFilledAnswer[] | null) {\n if (!questions) {\n return null;\n }\n const initialValues: Record = questions.reduce((m, q) => ({ ...m, [q.QuestionCode]: '' }), {});\n\n if (preFilledAnswers) {\n preFilledAnswers.forEach((q) => {\n const question = questions.find((m) => m.QuestionCode === q.questionCode);\n if (question) {\n //Only fill in prefilled if this is part of the questions\n initialValues[q.questionCode] = q.answerCode;\n }\n });\n }\n\n return initialValues;\n}\n\nfunction getAnswerPayload(\n amlValues: FormikValues,\n pepValues: FormikValues | null,\n enhancedValues: FormikValues | null,\n questions: Question[],\n customerSaidPep: boolean | null,\n isPepFieldName: string\n) {\n const amlValuesArr = Object.entries(amlValues);\n const pepValuesArr = pepValues !== null ? Object.entries(pepValues) : null;\n const enhancedValuesArr = enhancedValues !== null ? Object.entries(enhancedValues) : null;\n const pepAndAmlValues = pepValuesArr !== null ? amlValuesArr.concat(pepValuesArr) : amlValuesArr;\n const allValues = enhancedValuesArr !== null ? pepAndAmlValues.concat(enhancedValuesArr) : pepAndAmlValues;\n\n const answerPayload = questions.map((q) => {\n const theAnswer = allValues.find((m) => m[0] === q.QuestionCode);\n let answerCode = theAnswer?.[1];\n if (customerSaidPep !== null && q.QuestionCode === isPepFieldName) {\n answerCode = customerSaidPep ? 'True' : 'False';\n }\n const retVal: CddAnswer = {\n QuestionCode: q.QuestionCode,\n AnswerCode: answerCode,\n };\n return retVal;\n });\n return answerPayload;\n}\n"],"names":["getClassName","direction","styles","getPadding","ClickableBox","children","onClick","props","Box","e","type","padding","className","jsxs","jsx","formikFieldsFromQuestions","questions","t","countries","preFilledAnswersToHide","q","answerOptions","o","isSelect","preFilled","m","isNumeric","dependsOnFieldName","fieldValidation","amountNotEmpty","Yup.string","stringRequired","field","values","dependentValue","valueAt","schemaOfType","val","ctx","_a","err","ValidationError","FormikSelect","addPleaseSelectOption","AmountInput","FormikInput","comparrison","CompareValidation","cv","dateFormat","reviver","key","value","parseJsonResponseWithDate","response","text","checkFor401AndMaybeLoadLoggedOutPage","getOddStatus","fetch","getOddQuestions","postOddAnswers","payload","includesEnhanced","submissionId","uploadOddDocument","documentKey","data","getPepStatus","Spacing","spacing","spaceBetween","CddSteps","CddSteps2","CddForm","isPep","isPepFieldName","onSubmit","questionGrups","documentUploadQuestions","preFilledAnswers","hideHeadlines","cddFormValues","setCddFormValues","useState","pepFormValues","setPepFormValues","customerSaysPep","setCustomerSaysPep","useTranslation","getSubmitButtonText","submitState","topOfFormRef","useRef","setSubmitState","wizardStep","setWizardStep","showPepError","setShowPepError","documentsPendingUpload","setdocumentsPendingUpload","emptyDocumentGuidList","useMemo","elm","uploadedDocumentGuids","setUploadedDocumentGuids","useEffect","cddGroups","pepGroups","extendedGroups","allQuestionsAsFormikFields","onAmlSubmit","useCallback","onPepSubmitFunc","total","getAnswerPayload","onExtendedSubmitFunc","documentGuidForDocumentQuestion","logErrorToServerside","onAreYouPepNextButtonFunc","cddInitialValues","cddQuestionArr","generateInitialValuesFromFormAndPrefill","pepInitialValues","pepQuestionArr","extendedInitialValues","extendedQuestionArr","headLines","Fragment","Headline","Paragraph","SubmitProgressBox","BackButton","InputGroup","trueFalseValues","ButtonRowContainer","Button","style","Wizard","UploadDocumentsSection","setallDocumentUploaded","setDocumentUploaded","questionCode","documentGuid","newArr","allDocumentsUploaded","i","UploadDocumentsSectionInner","documentUploadQuestion","setDocumentUploadedFunc","working","setWorking","errorMsg","setErrorMsg","documentUploaded","documentInfo","uploadDocumentHandler","form","uploadRes","FileUploadButton","DismissableErrorMessage","Uploads","BackButtonElm","initialValues","amlValues","pepValues","enhancedValues","customerSaidPep","amlValuesArr","pepValuesArr","enhancedValuesArr","pepAndAmlValues","allValues","theAnswer","answerCode"],"mappings":"0YAaA,SAASA,GAAaC,EAA4B,CAChD,OAAQA,EAAW,CACjB,IAAK,YACH,MAAO,GAAGC,EAAO,GAAG,IAAIA,EAAO,YAAY,GAC7C,IAAK,SACH,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,MAAM,GACvC,IAAK,yBACD,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,qBAAqB,GACxD,IAAK,SACH,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,SAAS,GAC1C,IAAK,QACH,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,QAAQ,GACzC,IAAK,wBACD,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,uBAAuB,GAC1D,IAAK,WACH,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,aAAa,GAC9C,IAAK,kBACH,MAAO,GAAGA,EAAO,GAAG,IAAIA,EAAO,aAAa,GAC9C,IA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