{"version":3,"sources":["InternetApp.tsx","IdUpload/state.ts","IdUpload/domain.ts","IdUpload/Addresses/state.ts","IdUpload/ClientData/PersonalDataForm/PersonalDataForm.tsx","IdUpload/ClientData/PersonalDocumentForm/PersonalDocumentForm.tsx","IdUpload/utils.ts","IdUpload/AddressForm/AddressForm.tsx","IdUpload/BankerOPUAndCEXCard/api.ts","IdUpload/PermanentAddress/state.ts","IdUpload/PermanentAddress/base64FileSize.ts","IdUpload/ClientData/state.ts","IdUpload/api.ts","IdUpload/ClientData/PersonalDataForm/SecondCitizenshipField.tsx","IdUpload/ClientData/CountryOfBirthDropdown.tsx","IdUpload/Addresses/AddressBlock.tsx","IdUpload/AdditionalDocument/DocumentUploadField.tsx","IdUpload/AddressForm/AddressFormEdit.tsx","IdUpload/AddressForm/AddressSuggestionsDropdown.tsx","IdUpload/AddressForm/CountryDropdown.tsx","IdUpload/ClientData/PersonalDataForm/TitleDropdown.tsx","IdUpload/IdUpload.tsx","IdUpload/PermanentAddress/ProofOfAddressForm.tsx","IdUpload/ClientData/ClientDataForm.tsx","IdUpload/Addresses/AdditionalAddresses.tsx","IdUpload/PermanentAddress/PermanentAddress.tsx","IdUpload/ClientData/ConfirmClientData.tsx","IdUpload/ClientData/AdditionalChecks.tsx","IdUpload/BankerOPUAndCEXCard/BankerOPUAndCEXCard.tsx","IdUpload/SelfieCheck/SelfieCheck.tsx","IdUpload/SelfieCheck/ok.png","IdUpload/SelfieCheck/partial.png","IdUpload/SelfieCheck/dark.png","IdUpload/SelfieCheck/sunglasses.png","IdUpload/SelfieCheck/SelfieCheckOverview.tsx","IdUpload/AdditionalDocument/AdditionalDocuments.tsx","IdUpload/AdditionalDocument/MultipleDocumentsField.tsx","IdUpload/AdditionalDocument/MultipleDocumentsDialog.tsx","IdUpload/addressFormUtils.tsx","IdUpload/ClientData/PersonalDataForm/CitizenshipDropdown.tsx","IdUpload/AddressForm/AddressSuggestionForm.tsx","IdUpload/ClientData/PersonalDataForm/PersonalDataFormEdit.tsx","IdUpload/ClientData/PersonalDocumentForm/PersonalDocumentFormEdit.tsx","IdUpload/ClientData/PersonalDocumentForm/AuthorityDropdown.tsx","IdUpload/ClientData/AdditionalPersonalDataForm/AdditionalPersonalDataForm.tsx","IdUpload/ClientData/AddressSuggestionsForm.tsx","IdUpload/ClientData/api.ts"],"names":["EmailActivationLink","lazy","PendingApplicationEmailLink","BankerFlowLinkData","MobileUploadLinkVerify","ClientRedirect","UserNotClientOwner","RemoteOnboarding","CredentialsMobile","Mortgage","handleExit","window","location","href","origin","InternetApp","getVersion","useLibraryInfo","useEffect","console","info","apiEndpoint","buildConfig","apiPort","render","foldInternetLocation","NotFound","channel","MobileSelfieTest","EmailVerification","id","fallback","constNull","uuid","UploadDocumentsLinkWithBankerFlow","params","linkId","content","applicationId","bankerFlowId","option","some","emailLinkType","UploadDocumentsLink","none","PendingApplicationLink","MobileCreateProfile","renderStandardLoan","MobileCreateProfileAndSign","MobileIdUpload","type","MobileProofOfIncomeUpload","MobileSelfieCheck","MobileHologramCheck","MobileFullCheck","data","product","optionalParams","promo","calculatorData","OpenApplication","encryptedApplicationId","showPasswordWasResetMessage","authInfo","_","isThirdParty","existing","openFromLink","onExit","isExistingClient","UploadDocumentsState","t","biometricConsent","optionFromUndefined","activeIndex","ConfirmDataState","AdditionalDocumentsState","PermanentAddressState","SelfieCheckState","ConfirmSelfieState","AdditionalAddressesState","CompletedState","StateWithoutGdpr","StateGdpr","showGdprConsent","gdprData","getFranchiseBranchGdprDataOutput","gdprAccepted","State","foldState","state","match","whenUploadDocuments","whenConfirmData","whenSelfieCheck","whenConfirmSelfie","whenAdditionalDocuments","whenPermanentAddress","whenAdditionalAddresses","whenCompleted","ConfirmUploadedDocumentsAction","payload","hasSelfieCheckStep","confirmUploadedDocumentsAction","ConfirmSelfieAction","confirmSelfieAction","SetConfirmDataStepAction","setConfirmDataStepAction","ConfirmDataAction","hasPermanentAddressStep","hasAdditionalAddressesStep","hasAdditionalDocumentsStep","confirmDataAction","ConfirmAdditionalDocumentsAction","confirmAdditionalDocumentsAction","ConfirmPermanentAddressAction","confirmPermanentAddressAction","ConfirmAdditionalAddressesAction","confirmAdditionalAddressessAction","SetBiometricConsentAction","setBiometricConsentAction","SetShowGdprConsentAction","show","setShowGdprConsentAction","AcceptGdprConsentAction","acceptGdpr","UploadAgainAction","uploadAgainAction","RemoveUploadedDocumentsAction","removeUploadedDocumentsAction","SetActiveItemAction","setActiveItemAction","activeItem","Action","reducerConfig","sharedReducerConfig","action","pipe","map","i","AddressType","Current","Contact","eqAddressType","eq","eqStrict","StreetSuggestion","streetName","zipCode","CitySuggestion","cityName","LocalizedString","provinceName","Address","NonEmptyString","streetNumber","city","withFallback","country","CountryCode","AddressWrite","eqAddressWrite","getStructEq","getEq","eqString","AddressOCR","Citizenship","CZE","SVK","CitizenshipForeign","AUT","BEL","BGR","CYP","DEU","DNK","EST","ESP","FIN","FRA","GRC","HRV","HUN","IRL","ITA","LTU","LUX","LVA","MLT","NLD","POL","PRT","ROU","SWE","SVN","AllSupportedCitizenships","keys","CountryOption","tenant","optionFromNullable","Tenant","label","countryCode","AllCitizenships","ForeignCountries","PersonalData","title","titleAfter","name","surname","sex","Sex","maritalStatus","MaritalStatus","dateOfBirth","DateFromSQLString","birthNumber","placeOfBirth","countryOfBirth","citizenship","secondCitizenship","localPersonalNumber","CitizenshipOrOther","eqDate","OTHER","PersonalDataOCR","PersonalDocument","idNumber","dateOfIssuing","validUntil","authority","authorityMandatory","issuer","issuerMandatory","PersonalDocumentOCR","eqBoolean","PersonalDocumentProofOfAddress","eqPersonalDocumentOfAddress","PersonalInfoError","personalData","optionFromArray","documentDetails","permanentAddress","generalError","PersonalProfileDocUploadSubmitError","compareDocs","ClientDataOCR","documentType","DocumentType","addressSuggestions","nonEmptyArray","validationErrors","ClientDataResult","UploadAgain","EditData","Continue","Abort","ContinueWithWarning","EditDataWithWarning","ClientDataCheck","FraudCheckResult","Redo","ClientDataEdit","AddressCountries","AllCountries","formInEditing","error","GenericError","currentAddress","shared","submitting","ShareWithClientAction","SetErrorAction","SetCurrentAddressAction","address","CancelEditingAction","SetEditingCurrentAddressAction","SetSubmitAddress","ResetSubmitAddress","shareWithClientAction","setCurrentAddressAction","setErrorAction","cancelEditingAction","editCurrentAddressAction","submitAddress","resetSubmitAddress","formStateFromPersonalDataOCR","getOrElse","constant","validableDate","fromDate","filter","formStateFromPersonalData","PersonalDataForm","props","config","r6NewSironMapping","newSironMapping","useAppContext","formatMessage","useFormatMessage","formatSex","useFormatSex","formatMaritalStatus","useFormatMaritalStatus","isSupportedForeign","readOnly","values","fieldProps","value","isForeign","formatIssues","formatFeedback","useFormatReworkData","reworkPersonalData","renderTextFieldOrReadOnly","placeholder","size","feedback","issues","sexOptions","rec","record","renderSexFieldOrReadOnly","fold","options","renderOption","optionKey","o","toString","isOptionDisabled","constFalse","renderOptionChildren","variant","renderMaritalStatusFieldOrReadOnly","clearable","renderCountryOfBirthFieldOrReadOnly","countries","useQuery","idUploadApi","result","remoteData","identity","renderSecondCitizenship","isSome","array","findFirst","c","v","renderCitizenshipFieldOrReadOnly","items","supportForeign","renderDateOfBirthFieldOrReadonly","format","flatten","width","renderTitleBeforeFieldOrReadOnly","renderTitleAfterFieldOrReadOnly","nameField","surnameField","birthNumberField","onChange","s","length","placeOfBirthField","renderLocalPersonalNumberField","data-test-id","heading","errors","e","displayCountryOfBirth","formStateFromPersonalDocument","personalDocument","formStateFromPersonalDocumentOCR","PersonalDocumentForm","formatDocumentType","useFormatDocumentType","reworkDocumentDetails","formatClientProfileFeedback","reworkClientProfile","expiredBanner","actions","onDismiss","lostOrStolenBanner","renderValidUntilField","canEditValidUntilField","displayFormat","renderAuthorityFieldOrReadOnly","idNumberField","documentTypeField","dateOfIssuingField","renderDateFieldOrReadOnly","rendeIssuerFieldOrReadOnly","showAuthority","trim","showIssuer","issue","foldIssue","DifferentDocument","PrimaryDocumentExpired","PrimaryDocumentLostOrStolen","checkLostStolen","SecondaryDocumentExpired","SecondaryDocumentLostOrStolen","NoPrimaryDocument","showDocumentType","isForeign_","AddressForm","reworkFeedback","message","renderHint","hint","units","toNullable","readonlyCountryOverride","lockCountryEdit","countryField","lockCzSk","reworkAddress","chain","r","toUndefined","streetNameField","suggestionsStatus","streetSuggestions","status","onSelectSuggestion","onSelect","loadingMessage","confirmedField","streetNumberField","cityField","citiesSuggestions","zipCodeField","formActions","cancelButton","submitButton","needConfirmation","undefined","displayConfirmation","CEXType","fullName","OPUType","branchCode","branchName","branchAddress","getBranchInfoOutput","cexCode","getBankerBranchInfo","apiCall","path","inputCodec","inputEq","fromEquals","outputCodec","get3PBranchInfo","GetCEXListOutput","getCEXList","constTrue","GetOPUListOutput","getOPUList","EditBranchInfoInput","editBankerBranchInfo","edit3PBranchInfo","SimpleError","MissingPermanentAddressError","Error","ProofOfAddressSubmitError","ProofOfAddress","document","proofOfAddress","SetPermanentAddressAction","SetEditingAction","ProofOfAddressChangeAction","setPermanentAddressAction","setEditingAction","editing","proofOfAddressChangeAction","base64FileSize","base64","endsWith","NotSharedState","SharedState","EditDataAction","editDataAction","IDStreetSuggestionsInput","eqIDStreetSuggestionsInput","IDStreetSuggestionsOutput","IDAddressCountriesInput","eqIDAddressCountriesInput","IDAddressCountriesOutput","IDAllCountriesOutput","allCountries","allForeignSupportedCountries","IDCitySuggestionsInput","searchTerm","eqIDCitySuggestionsInput","IDCitySuggestionsOutput","citySuggestions","IDAddressSubmitInput","withCoApplicant","addressType","eqIDAddressSubmitInput","eqWithCoApplicant","addressSubmit","ClientDataInput","idType","DocumentPurpose","eqClientDataInput","ClientDataOutput","primary","secondary","canUploadAgain","documentMismatch","extractedAddress","clientData","clientDataPersonalProfile","FraudCheckResultInput","zenIdPurpose","FRAUD_CHECK_HOLOGRAM","FRAUD_CHECK_SELFIE","FRAUD_CHECK_SELFIE_AND_HOLOGRAM","fraudCheckResult","fraudCheckSelfie","fileContent","CompressedFileContent","RejectDataInput","rejectData","rejectDataUkonto","PersonalInfoEditInput","PersonalInfoEditError","personalInfoEdit","errorCodec","personalInfoEditUkonto","PersonalInfoSubmitInput","personalInfoSubmit","personalInfoSubmitUkonto","ResidencySubmitInput","residency","residencySubmitUkonto","PermanentAddressSubmitInput","eqPermanentAddressSubmitInput","permanentAddressSubmit","ProofOfAddressSubmitInput","eqProofOfAddressSubmitInput","proofOfAddressSubmit","ProofOfAddressDocumentSubmitInput","side","First","Second","eqProofOfAddressDocumentSubmitInput","proofOfAddressDocumentSubmit","ProofOfAddressDocumentRemoveInput","eqProofOfAddressDocumentRemoveInput","proofOfAddressDocumentRemove","AdditionalDocumentUploadInput","documentKey","NonResidentsAdditionalDocumentsType","eqAdditionalDocumentUploadInput","additionalDocumentUpload","AdditionalDocumentRemoveInput","eqAdditionalDocumentRemoveInput","additionalDocumentRemove","atLeastOneDocUploaded","AdditionalDocumentsRemoveInput","documentKeys","eqAdditionalDocumentsRemoveInput","additionalDocumentsRemove","AddressValidationInput","eqAddressValidateInput","AddressValidationOutput","AddressValidationErrorWithSuggestion","addresses","addressValidation","DocumentAuthoritiesOutput","documentAuthorities","CountryOfBirthSubmitInput","withApplicantIndex","countryOfBirthSubmit","SecondCitizenshipSubmitInput","secondCitizenshipSubmit","personalProfileDocUploadSubmit","resetUploadAttempts","ignoreAddressValidation","SecondCitizenshipField","formatCitizenship","useFormatCitizenship","sort","ord","ordString","contramap","readonly","secondCitizenshipField","secondCitizenshipRadio","selectedCitizenship","onBlur","constVoid","dropdownOptionToValue","searchable","CountryOfBirthDropdown","identificationApi","mapCountriesToOptions","selectedDropdownOption","AddressWrapper","children","isEditing","wrapper","editingWrapper","AddressBlock","foldStatus","whenEditing","initialState","whenAddNew","whenReadOnly","displayTooltipContent","tooltipContent","color","palette","blue600","controlButtons","fluid","onEdit","disabled","onRemove","defaultCountry","useDefaultCountryCode","initialValues","useMemo","addressOCR","formStateFromAddressOCR","saveAddress","onSave","column","grow","shrink","vAlignContent","weight","subtitle","addNewContent","buttonLabel","addAddressLabel","addressDescription","icon","PinIcon","optionalFields","onValidate","taskEither","right","onSuggestionSubmit","onSubmit","onCancel","submitInvalid","foreignSupport","forceValidateForForeign","hasResidency","foldScanStep","scanStep","whenReady","whenChooseMode","whenScanning","mode","DocumentUploadField","externalCommunication","setScanStep","useState","isContentModalOpen","setIsContentModalOpen","onUploadModalConfirm","onUploadModalDismiss","launcherOrDocument","uploaded","boolean","FileIcon","disableMobileUpload","onConfirm","coApplicant","mobileFeatureStatus","_mockScanner","onDocumentAcquired","scannedDocument","fromTask","task","fromIO","fromPredicate","Boolean","file","fromOption","fileName","searchTermRegExp","streetNumberRegExp","splitSearchTerm","test","blocks","fromNullable","validateStreetNumberRegex","AddressFormEdit","isInitialForeign","skipValidation","setSkipValidation","validateConfirmation","manualSkipValidation","suggestions","setSuggestions","addressValidate","useCommand","formatError","fieldIssues","defaultCountryCode","confirmed","getCitySuggestionLabel","unsafeLocalizedString","nonBlankString","latinCharactersOnly","digitsOnly","useValidators","checkOptionalityAndValidate","validator","validators","validateIfNonEmpty","inSequence","formState","setValues","setFormState","handleSubmit","formErrors","useForm","fieldValidators","flow","defined","splits","checked","addressFields","decode","fromEither","bimap","genericError","either","constUndefined","chainW","addressValidator","mapLeft","err","chainFirst","validatedAddress","noSuggestions","fetchstreetSuggestions","skipTracking","fetchCitySuggestions","cityAndProvince","streetQueryTerms","useDebounceState","useRemoteData","cityQueryTerms","replace","skipValidate","autocompleteInputStatusFromRemoteData","suggestion","errorMessage","AddressSuggestionsDropdown","addressWriteToDropdownOption","CountryDropdown","TitleDropdown","apiParameters","titlesAfterBefore","IdUpload","uploadToServer","uploadDocumentApi","saveApplication","ukontoApi","resetAfterScannerCancel","useNewMobileIdUploadUx","newMobileIdUpload","localBirthNumberEnabled","OPUCEXAssignmentEnabled","enableDigitalId","checkTenant","useCheckTenant","useScrollTopOnChange","extractedData","setExtractedData","restoredData","feStep","extractData","extractDataResult","documentPayload","mergeExtractDataDocumentsOutput","canEdit","showWarning","fraudCheck","uploadIdKey","setUploadIdKey","uploadReset","setUploadReset","isSubmitResidency","setIsSubmitResidency","previousBiometricConsent","setPreviousBiometricConsent","clientExistencyCheckData","setClientExistencyCheckData","Date","applicantIndex","opuAndCexLoaded","setOpuAndCexLoaded","opuAndCexValid","setOpuAndCexValid","checkOpuAndCex","showOpuAndCexError","setShowOpuAndCexError","disableAccordionNavigation","setDisableAccordionNavigation","showGdprDialog","setShowGdprDialog","setType","isWaitingForOpuAndCex","isResident","setIsResident","resetUploadDocumentStep","k","onComplete","left","scrollTo","top","body","scrollHeight","behavior","isPersonalProfile","productType","exists","item","isLocalClient","foldCitizenship","CZ","SK","isNone","documentIdentificationFlow","dispatch","useParentSharedReducer","restartDocumentsUpload","branchExperienceFeaturesActive","useBranchExperienceContext","digitalIdEnabled","disableDigitalId","isMobileLayout","useIsMobileLayout","useNewMobileUx","uploadDocumentsStep","hideTitle","resetNextSteps","neutral700","digitalIdSwitch","onContinue","resetUpload","onUploadAgain","onFailure","consent","previousConsent","hideBiometricConsent","setBiometricConsent","uploadCommand","index","extractCommand","forceMobileRecipientSelection","allowCopyIdDocumentAgreementEdit","foreignSupported","isUploadAgain","confirmDataStep","move","clientExistencyCommand","onDataChange","excludeAdditionalAddress","convertToCheckDataBn","onAbort","onShouldClientContinue","checkIfInLastFlowStep","banner","submitDataCommand","submitConfirmedDataCommand","documentsMismatch","onMismatchDialogDismiss","showMismatchDialog","noGoBack","onReset","editPersonalInfoCommand","hasParentPadding","submitResidencyCommand","onResidencyChange","SelfieCheckStep","resetProcess","additionalDocumentsStep","incomeInfo","transactionsInfo","onRemoveLastDoc","permanentAddressStep","isNotCzSk","showLocalPersonalNumber","foldTenant","getOrElseW","next","personalNumber","bn","clientExistency","sequenceS","selectedMainApplicant","isUkonto","isWithResidency","onContinueAdditionalAddress","onContinueAdditionalAddressWithGdpr","additionalAddressStep","onEditingChange","concat","compact","flowIdx","isFromPersonalProfile","flowAccordion","disableNavigation","align","onShareWithClient","accepted","onOpuAndCexComplete","cexCodeOption","disableEdit","ProofOfAddressForm","foldDocumentType","whenIDCard","whenPassport","whenDrivingLicense","whenLongTermResidencePermit","whenPermanentResidencePermit","whenTemporaryResidencePermit","_foldDocumentType","setError","uploadDocument","uploadApi","removeDocument","documentHasTwoSides","validDate","maxLength","minimumDate","firstDocumentSide","proofOfAddressDocs","first","secondDocumentSide","second","p","validateIfDefined","definedNoExtract","validBirthNumber","onFormChange","firstDocumentLabel","secondDocumentLabel","onDocumentChange","onChangeDocument","onDocumentRemove","m","onDocumentUpload","fromArray","hAlignContent","branchExperienceState","sharedWithClient","submitLabel","isEditingForm","ClientDataForm","formInEdit","setFormInEdit","editForm","editedData","setEditedData","additionalDocumentDetails","documentPurposeFromIdentificationFlow","form","setIsEditing","onCancelEdit","f","personalDataFormState","getDocumentDetailsFormState","isAdditional","getFormState","permanentAddressFromOCR","formStateFromAddress","setPermanentAddress","addressWriteToAddress","onFormSave","formatEditErrors","is","subform","newEditedData","newData","localSubForm","renderDocumentDetailsForm","formKey","isTouchScreen","useIsTouchScreen","canAutoEdit","hideConfirmDescription","askAdditionalPersonalData","additionalPersonalData","countryOfBirthFieldProps","isChild","details","additionalDocumentType","mustSelectAddressSuggestion","suggestionProps","addressSuggestionProps","AdditionalAddresses","portalBlocked","usePortalStatusContext","hasAddresses","currentAddressBody","rightIO","bracket","CurrentAddressForm","addressWriteToAddressOCR","disabledLink","labels","normal","success","loading","PermanentAddress","permanentAddressUkontoSubmit","proofOfAddressUkontoSubmit","setEditPermanentAddress","submitProofOfAddress","orElse","leftIO","displayProofOfAddress","submitPermanentAddress","ConfirmClientData","canceled","setCanceled","editCountryOfBirth","uploadIdApi","editSecondCitizenship","clientExistencyCheck","useClientExistencyCheck","r1EnableForeignNonResidentSupport","nonResidentSupported","isInPerson","useIsInPersonChannel","sectionErrors","setSectionErrors","residencySupport","showAdditionalChecks","latestClientExistencyCheckData","useRef","clientExistencyCheckDataFromClientData","genericClientDataErrors","mapMainDocumentErrors","every","alt","of","mapAdditionalDocumentErrors","isSingleDocumentPurpose","flowType","submitCountryOfBirth","current","clientExists","duplicateContacts","hasBlockingNotes","personalNumberMatch","userID","clientNumber","shouldContinue","addressSuggestion","isCobSame","equals","hasSecondCitizenship","onEditData","mainSubmit","additionalSubmit","residencySubmit","getTaskValidation","semigroup","getStructSemigroup","getFirstSemigroup","getLastSemigroup","sequence","uniq","validateData","newClientData","updatedSectionErrors","subformErrors","subformsHaveError","Object","clientExistencyCheckDataFromPersonalData","documentsMismatchDialog","WarningIcon","shareWithClientButtonProps","useShareWithClientButtonProps","additionalPersonalDataProps","addressSuggestionsProps","style","padding","AdditionalChecks","dialogStatus","setDialogStatus","onSelectRecipient","recipient","onUploadFromSameDevice","onMockScannerUpload","mobileRecipientType","onError","onFraudCheck","BankerOPUAndCEXCard","isDialogOpen","setIsDialogOpen","branchInfo","refreshBranchInfo","opuAndCexApi","cexList","refreshCexList","opuList","refreshOpuList","updateBranchInfo","refreshOPUAndCEXData","opuToLabel","opu","opuToDropdownOption","cexToLabel","cex","cexId","cexName","cexToDropdownOption","setFormValuesToFetchedValues","fullCEX","find","cexItem","fullOPU","opuItem","dismissModal","renderReadonlyForm","opuLabel","cexLabel","opuOptions","list","cexOptions","opuFieldProps","cexFieldProps","dialogDescendant","MobileCheckFlow","missingSelfieError","ExampleImage","className","idClasses","src","image","description","height","SelfieCheck","setStatus","toReady","toChooseRecipient","toFraudCheck","toOverview","toCheckOnSameDevice","Placeholder","onClick","WrapInUI","component","OKExampleImage","isOk","DarkExampleImage","PartialExampleImage","SunglassesExampleImage","whenChooseRecipient","whenFraudCheck","whenOverview","whenSelfieCheckOnSameDevice","reason","isSameDevice","uploadDocumentFlowType","SelfieCheckOverview","api","basis","classes","srcFromBase64","AdditionalDocuments","formatNonResidentsAdditionalDocumentsLabel","useFormatNonResidentsAdditionalDocumentsLabel","removeDocuments","getAdditionalRequiredDocuments","refreshList","requiredKeys","atLeastOneDocumentUploaded","setAtLeastOneDocumentUploaded","hasAdditionalDocuments","onRemoveDocuments","response","loadingError","loader","additionalRequiredDocuments","documents","requiredDocuments","onUploadComplete","renderMultipleDocUploadField","MultipleDocumentsField","doc","join","MultipleDocumentsDialog","checkAllDocsUploaded","allDocumentsUploaded","setAllDocumentsUploaded","allDocsUploaded","query","suggestionsMap","isLoading","formatProvinceCity","countryToDropdownOption","unwrapOptionalString","a","CitizenshipDropdown","AddressSuggestionForm","nameForbiddenChars","PersonalDataFormEdit","validBirthDate","nameValidator","PersonalDocumentFormEdit","AuthorityDropdown","authorities","toUpperCase","AdditionalPersonalDataForm","AddressSuggestionsForm","CheckExistingClientInput","lastAndFirstName","eqCheckExistingClientInput","eqWithApplicantIndex","CheckExistingClientOutput","existingClient","multipleUsers","checkExistingClient","ApplicationLimitError","GetClientDataForConfirmationInput","eqGetClientDataForConfirmationInput","GetClientDataForConfirmationOutput","secondaryDocumentType","secondaryDocumentDetails","getClientDataForConfirmation"],"mappings":"8FAAA,uKAeA,MAAMA,EAAsBC,eAC1B,IACE,kCAGEC,EAA8BD,eAClC,IAAM,6FAGFE,EAAqBF,eACzB,IAAM,kCAGFG,EAAyBH,eAC7B,IAAM,+DAGFI,EAAiBJ,eAAK,IAAM,sFAE5BK,EAAqBL,eACzB,IAAM,kCAGFM,EAAmBN,eACvB,IAAM,+DAGFO,EAAoBP,eACxB,IAAM,kCAGFQ,EAAWR,eAAK,IAAM,6IAEtBS,EAAa,KACjBC,OAAOC,SAASC,KAAOF,OAAOG,QAGzB,SAASC,IACd,MAAM,WAAEC,GAAeC,2BAKvB,OAJAC,oBAAU,KACRC,QAAQC,KAAM,8BAA6BJ,MAC1C,IAGD,cAAC,IAAD,CACEK,YAAaC,IAAYD,YACzBE,QAASD,IAAYC,QAFvB,SAIE,cAAC,IAAD,CACEC,OAAQC,YAAqB,CAC3BC,SAAU,IACR,cAAC,IAAD,CAAyBC,QAAQ,aAAjC,SACE,cAAC,IAAD,MAGJC,iBAAkB,IAChB,cAAC,IAAD,CAAuBD,QAAQ,aAA/B,SAC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AClBC,WAAYkwB,EACZjwB,QAASmwB,EACTjwB,YAAamwB,EACbrrB,WAAYyrB,MAGRC,EAAoCvoC,OACxC,CACEmb,OAAQjb,YAAoBkb,MAE9B,qCAGIotB,EAAsC/jC,IAAGkB,YAAY,CACzDwV,OAAQld,IAAO2H,MAAMnB,IAAGC,YAGpB+jC,EAAqCzoC,OACzC,CACEgL,aAAcC,IACdT,aAAcxK,eAAe,CAC3B0J,IACA1J,OAAO,CAAEqJ,kBAAmBnJ,YAAoBkI,SAElDsC,gBAAiBP,IACjBu+B,sBAAuBxoC,YAAoB+K,KAC3C09B,yBAA0BzoC,YAAoBiK,KAC9CQ,iBAAkBzK,YAAoB4F,MAExC,qCAGW8iC,EAA+BlxB,YAAQ,CAClDC,KAAM,CACJ,WACA,SACA,iBACA,kBACA,gCAEFC,WAAY2wB,EACZ1wB,QAAS2wB,EACTzwB,YAAa0wB","file":"static/js/index~0c69bfb2.14c374c3.chunk.js","sourcesContent":["import { lazy, Suspense, useEffect } from \"react\";\nimport { buildConfig } from \"./config\";\nimport { InternetRouter, foldInternetLocation } from \"./internetRouter\";\nimport { RemoteNoAuthAppProvider } from \"./RemoteNoAuthAppProvider\";\nimport { constNull } from \"fp-ts/function\";\nimport { AnonymousAuthProvider } from \"./AnonymousAuthProvider\";\nimport { Loader, useLibraryInfo } from \"design-system\";\nimport { BuildConfigProvider } from \"./BuildConfigProvider\";\nimport { ThirdPartyAppProvider } from \"./ThirdPartyAppProvider\";\nimport { option } from \"fp-ts\";\nimport { PageNotFound } from \"./Common/PageNotFound\";\nimport { PotentialClientAuthProvider } from \"./PotentialClientAuthProvider\";\nimport { OpenLoanApplicationForRemoteSigningWrapper } from \"./Common/OpenLoanApplicationWrapper/OpenLoanApplicationForRemoteSigningWrapper\";\nimport { SelfieTestPage } from \"./UploadDocuments/MobileIdUpload/demo/SelfieTestPage\";\n\nconst EmailActivationLink = lazy(\n () =>\n import(\"./PhoneAndEmailVerification/EmailVerification/EmailActivationLink\")\n);\n\nconst PendingApplicationEmailLink = lazy(\n () => import(\"./PendingApplicationEmailLink/PendingApplicationEmailLink\")\n);\n\nconst BankerFlowLinkData = lazy(\n () => import(\"./PendingApplicationEmailLink/BankerFlowLinkData\")\n);\n\nconst MobileUploadLinkVerify = lazy(\n () => import(\"./UploadDocuments/MobileIdUpload/MobileUploadLinkVerify\")\n);\n\nconst ClientRedirect = lazy(() => import(\"./ClientRedirect/ClientRedirect\"));\n\nconst UserNotClientOwner = lazy(\n () => import(\"./ClientRedirect/UserNotClientOwner\")\n);\n\nconst RemoteOnboarding = lazy(\n () => import(\"./RemoteOnboarding/RemoteOnboarding\")\n);\n\nconst CredentialsMobile = lazy(\n () => import(\"./UKontoSecondPart/Credentials/CredentialsMobile\")\n);\n\nconst Mortgage = lazy(() => import(\"./Mortgage/Mortgage\"));\n\nconst handleExit = () => {\n window.location.href = window.origin;\n};\n\nexport function InternetApp() {\n const { getVersion } = useLibraryInfo();\n useEffect(() => {\n console.info(`Omnichannel Design System v${getVersion()}`);\n }, []);\n\n return (\n \n (\n \n \n \n ),\n MobileSelfieTest: () => (\n \n \n \n ),\n EmailVerification: ({ id }) => (\n // TODO(gio): PWS_Remote does not make sense for the email verification URL.\n // Channel should be retrieved via API here, similarly to how we do it for a mobile upload URL\n \n \n \n \n \n ),\n UploadDocumentsLinkWithBankerFlow: params => (\n \n \n (\n \n )}\n />\n \n \n ),\n UploadDocumentsLink: params => (\n \n \n \n \n \n ),\n PendingApplicationLink: params => (\n \n \n \n \n \n ),\n MobileCreateProfile: params => (\n \n }>\n <>}\n />\n \n \n ),\n MobileCreateProfileAndSign: params => (\n \n }>\n (\n \n }>\n \n \n \n )}\n />\n \n \n ),\n MobileIdUpload: ({ id }) => (\n /*\n Note: Simone\n AnonymousAuthProvider will create a dummy AppContext with channel=Branch.\n This is necessary because we need to verify the link and then call\n the endpoint to get the link parameters (that will contain the real channel to be used).\n To do this, we need the translated messages that depend on the channel.\n After we get the right channel from the link parameter endpoint,\n we will create a new AppContext with the right channel.\n */\n \n }>\n \n \n \n ),\n MobileProofOfIncomeUpload: ({ id }) => (\n \n }>\n \n \n \n ),\n MobileSelfieCheck: ({ id }) => (\n \n }>\n \n \n \n ),\n MobileHologramCheck: ({ id }) => (\n \n }>\n \n \n \n ),\n MobileFullCheck: ({ id }) => (\n \n }>\n \n \n \n ),\n ClientRedirect: params => (\n \n \n \n ),\n UserNotClientOwner: params => (\n \n \n \n ),\n RemoteOnboarding: data => (\n \n \n \n \n \n ),\n OpenApplication: ({ encryptedApplicationId }) => (\n \n {_ => (\n \n \n \n )}\n \n ),\n })}\n />\n \n );\n}\n","import { option } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport { Option } from \"fp-ts/Option\";\nimport * as t from \"io-ts\";\nimport { optionFromUndefined } from \"../globalDomain\";\nimport { sharedReducerConfig } from \"../BranchExperience/useSharedReducer\";\nimport {\n FranchiseBranchGdprData,\n getFranchiseBranchGdprDataOutput,\n} from \"../GDPR/api\";\n\nconst UploadDocumentsState = t.type({\n id: t.literal(\"UploadDocuments\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype UploadDocumentsState = t.TypeOf;\nconst ConfirmDataState = t.type({\n id: t.literal(\"ConfirmData\"),\n // none only when the biometricConsent feature is disabled\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype ConfirmDataState = t.TypeOf;\nconst AdditionalDocumentsState = t.type({\n id: t.literal(\"AdditionalDocuments\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype AdditionalDocumentsState = t.TypeOf;\nconst PermanentAddressState = t.type({\n id: t.literal(\"PermanentAddress\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype PermanentAddressState = t.TypeOf;\nconst SelfieCheckState = t.type({\n id: t.literal(\"SelfieCheck\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype SelfieCheckState = t.TypeOf;\nconst ConfirmSelfieState = t.type({\n id: t.literal(\"ConfirmSelfie\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype ConfirmSelfieState = t.TypeOf;\nconst AdditionalAddressesState = t.type({\n id: t.literal(\"AdditionalAddresses\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype AdditionalAddressesState = t.TypeOf;\nconst CompletedState = t.type({\n id: t.literal(\"Completed\"),\n biometricConsent: optionFromUndefined(t.boolean),\n activeIndex: optionFromUndefined(t.number),\n});\ntype CompletedState = t.TypeOf;\nconst StateWithoutGdpr = t.union([\n UploadDocumentsState,\n ConfirmDataState,\n AdditionalDocumentsState,\n PermanentAddressState,\n AdditionalAddressesState,\n CompletedState,\n SelfieCheckState,\n ConfirmSelfieState,\n]);\nconst StateGdpr = t.partial({\n showGdprConsent: t.boolean,\n gdprData: getFranchiseBranchGdprDataOutput,\n gdprAccepted: t.boolean,\n});\nexport const State = t.intersection([StateWithoutGdpr, StateGdpr]);\nexport type State = t.TypeOf;\n\nexport function foldState(\n state: State,\n match: {\n whenUploadDocuments: (state: UploadDocumentsState) => T;\n whenConfirmData: (state: ConfirmDataState) => T;\n whenAdditionalDocuments: (state: AdditionalDocumentsState) => T;\n whenPermanentAddress: (state: PermanentAddressState) => T;\n whenAdditionalAddresses: (state: AdditionalAddressesState) => T;\n whenCompleted: (state: CompletedState) => T;\n whenSelfieCheck: (state: SelfieCheckState) => T;\n whenConfirmSelfie: (state: ConfirmSelfieState) => T;\n }\n) {\n switch (state.id) {\n case \"UploadDocuments\":\n return match.whenUploadDocuments(state);\n case \"ConfirmData\":\n return match.whenConfirmData(state);\n case \"SelfieCheck\":\n return match.whenSelfieCheck(state);\n case \"ConfirmSelfie\":\n return match.whenConfirmSelfie(state);\n case \"AdditionalDocuments\":\n return match.whenAdditionalDocuments(state);\n case \"PermanentAddress\":\n return match.whenPermanentAddress(state);\n case \"AdditionalAddresses\":\n return match.whenAdditionalAddresses(state);\n case \"Completed\":\n return match.whenCompleted(state);\n }\n}\n\nconst ConfirmUploadedDocumentsAction = t.type({\n id: t.literal(\"ConfirmUploadedDocuments\"),\n payload: t.type({\n hasSelfieCheckStep: t.boolean,\n }),\n});\nexport function confirmUploadedDocumentsAction(\n hasSelfieCheckStep: boolean\n): Action {\n return {\n id: \"ConfirmUploadedDocuments\",\n payload: { hasSelfieCheckStep },\n };\n}\n\nconst ConfirmSelfieAction = t.type({\n id: t.literal(\"ConfirmSelfie\"),\n});\nexport const confirmSelfieAction: Action = {\n id: \"ConfirmSelfie\",\n};\n\nconst SetConfirmDataStepAction = t.type({\n id: t.literal(\"SetConfirmDataStep\"),\n});\n\nexport const setConfirmDataStepAction: Action = {\n id: \"SetConfirmDataStep\",\n};\n\nconst ConfirmDataAction = t.type({\n id: t.literal(\"ConfirmData\"),\n payload: t.type({\n hasPermanentAddressStep: t.boolean,\n hasAdditionalAddressesStep: t.boolean,\n hasAdditionalDocumentsStep: t.boolean,\n }),\n});\nexport function confirmDataAction(\n hasPermanentAddressStep: boolean,\n hasAdditionalAddressesStep: boolean,\n hasAdditionalDocumentsStep: boolean\n): Action {\n return {\n id: \"ConfirmData\",\n payload: {\n hasPermanentAddressStep,\n hasAdditionalAddressesStep,\n hasAdditionalDocumentsStep,\n },\n };\n}\n\nconst ConfirmAdditionalDocumentsAction = t.type({\n id: t.literal(\"ConfirmAdditionalDocuments\"),\n payload: t.type({\n hasPermanentAddressStep: t.boolean,\n hasAdditionalAddressesStep: t.boolean,\n }),\n});\nexport function confirmAdditionalDocumentsAction(\n hasPermanentAddressStep: boolean,\n hasAdditionalAddressesStep: boolean\n): Action {\n return {\n id: \"ConfirmAdditionalDocuments\",\n payload: { hasPermanentAddressStep, hasAdditionalAddressesStep },\n };\n}\n\nconst ConfirmPermanentAddressAction = t.type({\n id: t.literal(\"ConfirmPermanentAddress\"),\n payload: t.type({\n hasAdditionalAddressesStep: t.boolean,\n }),\n});\nexport function confirmPermanentAddressAction(\n hasAdditionalAddressesStep: boolean\n): Action {\n return {\n id: \"ConfirmPermanentAddress\",\n payload: { hasAdditionalAddressesStep },\n };\n}\n\nconst ConfirmAdditionalAddressesAction = t.type({\n id: t.literal(\"ConfirmAdditionalAddresses\"),\n});\nexport const confirmAdditionalAddressessAction: Action = {\n id: \"ConfirmAdditionalAddresses\",\n};\n\nconst SetBiometricConsentAction = t.type({\n id: t.literal(\"SetBiometricConsent\"),\n payload: t.boolean,\n});\nexport function setBiometricConsentAction(biometricConsent: boolean): Action {\n return {\n id: \"SetBiometricConsent\",\n payload: biometricConsent,\n };\n}\nexport type SetBiometricConsentAction = t.TypeOf<\n typeof SetBiometricConsentAction\n>;\nconst SetShowGdprConsentAction = t.type({\n id: t.literal(\"SetShowGdprConsentAction\"),\n payload: t.type({\n show: t.boolean,\n gdprData: t.union([getFranchiseBranchGdprDataOutput, t.undefined]),\n }),\n});\nexport function setShowGdprConsentAction(\n show: boolean,\n gdprData?: FranchiseBranchGdprData\n): Action {\n return {\n id: \"SetShowGdprConsentAction\",\n payload: { show, gdprData },\n };\n}\nconst AcceptGdprConsentAction = t.type({\n id: t.literal(\"AcceptGdprConsentAction\"),\n});\nexport function acceptGdpr(): Action {\n return {\n id: \"AcceptGdprConsentAction\",\n };\n}\nconst UploadAgainAction = t.type({\n id: t.literal(\"UploadAgain\"),\n});\nexport const uploadAgainAction: Action = { id: \"UploadAgain\" };\n\nconst RemoveUploadedDocumentsAction = t.type({\n id: t.literal(\"RemoveUploadedDocuments\"),\n});\nexport const removeUploadedDocumentsAction: Action = {\n id: \"RemoveUploadedDocuments\",\n};\n\nconst SetActiveItemAction = t.type({\n id: t.literal(\"SetActiveItem\"),\n payload: optionFromUndefined(t.number),\n});\nexport function setActiveItemAction(activeItem: Option): Action {\n return {\n id: \"SetActiveItem\",\n payload: activeItem,\n };\n}\n\nconst Action = t.union([\n ConfirmUploadedDocumentsAction,\n ConfirmDataAction,\n ConfirmSelfieAction,\n ConfirmAdditionalDocumentsAction,\n ConfirmPermanentAddressAction,\n ConfirmAdditionalAddressesAction,\n SetBiometricConsentAction,\n RemoveUploadedDocumentsAction,\n UploadAgainAction,\n SetActiveItemAction,\n SetConfirmDataStepAction,\n SetShowGdprConsentAction,\n AcceptGdprConsentAction,\n]);\ntype Action = t.TypeOf;\n\nfunction reducer(state: State, action: Action): State {\n switch (action.id) {\n case \"ConfirmUploadedDocuments\":\n if (action.payload.hasSelfieCheckStep) {\n return {\n ...state,\n id: \"SelfieCheck\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n return {\n ...state,\n id: \"ConfirmData\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n case \"ConfirmSelfie\":\n return {\n ...state,\n id: \"ConfirmSelfie\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n case \"ConfirmData\":\n if (action.payload.hasAdditionalDocumentsStep) {\n return {\n ...state,\n id: \"AdditionalDocuments\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n if (action.payload.hasPermanentAddressStep) {\n return {\n ...state,\n id: \"PermanentAddress\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n if (action.payload.hasAdditionalAddressesStep) {\n return {\n ...state,\n id: \"AdditionalAddresses\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n return {\n ...state,\n id: \"Completed\",\n activeIndex: option.none,\n };\n case \"ConfirmAdditionalDocuments\":\n if (action.payload.hasPermanentAddressStep) {\n return {\n ...state,\n id: \"PermanentAddress\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n if (action.payload.hasAdditionalAddressesStep) {\n return {\n ...state,\n id: \"AdditionalAddresses\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n return {\n ...state,\n id: \"Completed\",\n activeIndex: option.none,\n };\n case \"ConfirmPermanentAddress\":\n if (action.payload.hasAdditionalAddressesStep) {\n return {\n ...state,\n id: \"AdditionalAddresses\",\n activeIndex: pipe(\n state.activeIndex,\n option.map(i => i + 1)\n ),\n };\n }\n return {\n ...state,\n id: \"Completed\",\n activeIndex: option.none,\n };\n case \"ConfirmAdditionalAddresses\":\n return {\n ...state,\n id: \"Completed\",\n activeIndex: option.none,\n };\n\n case \"SetBiometricConsent\":\n return { ...state, biometricConsent: option.some(action.payload) };\n case \"SetShowGdprConsentAction\":\n return {\n ...state,\n showGdprConsent: action.payload.show,\n gdprData: action.payload.gdprData,\n gdprAccepted: false,\n };\n case \"AcceptGdprConsentAction\":\n return {\n ...state,\n gdprAccepted: true,\n };\n case \"RemoveUploadedDocuments\":\n case \"UploadAgain\":\n return { ...state, id: \"UploadDocuments\", activeIndex: option.some(0) };\n case \"SetActiveItem\":\n return { ...state, activeIndex: action.payload };\n case \"SetConfirmDataStep\":\n return {\n ...state,\n id: \"ConfirmData\",\n };\n }\n}\n\nexport const reducerConfig = sharedReducerConfig(\n \"IdUpload\",\n State,\n Action,\n reducer\n);\n","import * as t from \"io-ts\";\nimport { Eq } from \"fp-ts/Eq\";\nimport {\n CountryCode,\n DateFromSQLString,\n ForeignCountries,\n MaritalStatus,\n optionFromArray,\n optionFromUndefined,\n Sex,\n Tenant,\n} from \"../globalDomain\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { eq, option } from \"fp-ts\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\nimport { ClientDataCheck, DocumentType } from \"../UploadDocuments/domain\";\nimport { withFallback } from \"io-ts-types/lib/withFallback\";\nimport { nonEmptyArray } from \"io-ts-types/nonEmptyArray\";\nimport { LocalizedString } from \"design-system\";\n\nexport const AddressType = t.keyof({\n Current: true,\n Contact: true,\n});\nexport type AddressType = t.TypeOf;\nexport const eqAddressType: Eq = eq.eqStrict;\n\nexport const StreetSuggestion = t.type(\n {\n streetName: t.string,\n zipCode: t.string,\n },\n \"StreetSuggestion\"\n);\nexport type StreetSuggestion = t.TypeOf;\n\nexport const CitySuggestion = t.type(\n {\n cityName: LocalizedString,\n provinceName: LocalizedString,\n },\n \"CitySuggestion\"\n);\nexport type CitySuggestion = t.TypeOf;\n\nexport const Address = t.type(\n {\n streetName: optionFromUndefined(NonEmptyString),\n streetNumber: optionFromUndefined(NonEmptyString),\n city: optionFromUndefined(NonEmptyString),\n provinceName: optionFromUndefined(NonEmptyString),\n zipCode: withFallback(optionFromUndefined(NonEmptyString), option.none), // fallback due to SBL-24916\n country: CountryCode,\n },\n \"Address\"\n);\nexport type Address = t.TypeOf;\n\n// when submitting an address the province is required\nexport const AddressWrite = t.type(\n {\n streetName: optionFromUndefined(NonEmptyString),\n streetNumber: optionFromUndefined(NonEmptyString),\n city: optionFromUndefined(NonEmptyString),\n provinceName: optionFromUndefined(NonEmptyString),\n zipCode: optionFromUndefined(NonEmptyString),\n country: CountryCode,\n },\n \"Address\"\n);\nexport type AddressWrite = t.TypeOf;\n\nexport const eqAddressWrite: Eq = eq.getStructEq({\n streetName: option.getEq(eq.eqString),\n streetNumber: option.getEq(eq.eqString),\n city: option.getEq(eq.eqString),\n provinceName: option.getEq(eq.eqString),\n zipCode: option.getEq(eq.eqString),\n country: eq.eqString,\n});\n\nexport const AddressOCR = t.type(\n {\n streetName: optionFromUndefined(NonEmptyString),\n streetNumber: optionFromUndefined(t.string),\n city: optionFromUndefined(NonEmptyString),\n provinceName: withFallback(\n // fallback due to SBL-32898\n optionFromUndefined(NonEmptyString),\n option.none\n ),\n zipCode: optionFromUndefined(NonEmptyString),\n country: optionFromUndefined(CountryCode),\n },\n \"AddressOCR\"\n);\nexport type AddressOCR = t.TypeOf;\n\nexport const Citizenship = t.keyof({\n CZE: true,\n SVK: true,\n});\nexport type Citizenship = t.TypeOf;\n\n//supported foreign citizenships\nexport const CitizenshipForeign = t.keyof({\n AUT: true,\n BEL: true,\n BGR: true,\n CYP: true,\n DEU: true,\n DNK: true,\n EST: true,\n ESP: true,\n FIN: true,\n FRA: true,\n GRC: true,\n HRV: true,\n HUN: true,\n IRL: true,\n ITA: true,\n LTU: true,\n LUX: true,\n LVA: true,\n MLT: true,\n NLD: true,\n POL: true,\n PRT: true,\n ROU: true,\n SWE: true,\n SVN: true,\n});\nexport type CitizenshipForeign = t.TypeOf;\n\nexport const AllSupportedCitizenships = t.keyof({\n ...Citizenship.keys,\n ...CitizenshipForeign.keys,\n});\nexport type AllSupportedCitizenships = t.TypeOf<\n typeof AllSupportedCitizenships\n>;\n\nexport const CountryOption = t.type(\n {\n tenant: optionFromNullable(Tenant),\n label: LocalizedString,\n countryCode: CountryCode,\n },\n \"CountryOption\"\n);\nexport type CountryOption = t.TypeOf;\n\nexport const AllCitizenships = t.keyof({\n ...Citizenship.keys,\n ...ForeignCountries.keys,\n});\nexport type AllCitizenships = t.TypeOf;\n\nexport const PersonalData = t.type({\n title: optionFromUndefined(NonEmptyString),\n titleAfter: optionFromUndefined(NonEmptyString),\n name: NonEmptyString,\n surname: NonEmptyString,\n sex: Sex,\n maritalStatus: optionFromUndefined(MaritalStatus),\n dateOfBirth: DateFromSQLString,\n birthNumber: optionFromUndefined(NonEmptyString),\n placeOfBirth: NonEmptyString,\n countryOfBirth: optionFromUndefined(CountryCode),\n citizenship: AllSupportedCitizenships,\n secondCitizenship: optionFromUndefined(AllCitizenships),\n localPersonalNumber: optionFromUndefined(NonEmptyString),\n});\nexport type PersonalData = t.TypeOf;\nexport const eqPersonalData: Eq = eq.getStructEq({\n title: option.getEq(eq.eqString),\n titleAfter: option.getEq(eq.eqString),\n name: eq.eqString,\n surname: eq.eqString,\n sex: eq.eqString,\n maritalStatus: option.getEq(eq.eqString),\n dateOfBirth: eq.eqDate,\n birthNumber: option.getEq(eq.eqString),\n placeOfBirth: eq.eqString,\n countryOfBirth: option.getEq(eq.eqString),\n citizenship: eq.eqString,\n});\n\nexport const CitizenshipOrOther = t.keyof({\n ...AllSupportedCitizenships.keys,\n ...ForeignCountries.keys,\n OTHER: true,\n});\nexport type CitizenshipOrOther = t.TypeOf;\n\nexport const PersonalDataOCR = t.type({\n title: optionFromUndefined(NonEmptyString),\n titleAfter: optionFromUndefined(NonEmptyString),\n name: optionFromUndefined(NonEmptyString),\n surname: optionFromUndefined(NonEmptyString),\n sex: optionFromUndefined(Sex),\n maritalStatus: optionFromUndefined(MaritalStatus),\n dateOfBirth: optionFromUndefined(DateFromSQLString),\n birthNumber: optionFromUndefined(NonEmptyString),\n placeOfBirth: optionFromUndefined(NonEmptyString),\n countryOfBirth: optionFromUndefined(CountryCode),\n citizenship: withFallback(\n optionFromUndefined(CitizenshipOrOther),\n option.some(\"OTHER\" as const)\n ),\n localPersonalNumber: optionFromUndefined(NonEmptyString),\n secondCitizenship: optionFromUndefined(AllCitizenships), // not OCRed, but for compat\n});\nexport type PersonalDataOCR = t.TypeOf;\n\nexport const PersonalDocument = t.type({\n idNumber: NonEmptyString,\n dateOfIssuing: DateFromSQLString,\n validUntil: optionFromUndefined(DateFromSQLString),\n authority: optionFromUndefined(t.string),\n authorityMandatory: t.boolean,\n issuer: optionFromUndefined(t.string),\n issuerMandatory: t.boolean,\n});\nexport type PersonalDocument = t.TypeOf;\nexport const eqPersonalDocument: Eq = eq.getStructEq({\n idNumber: eq.eqString,\n dateOfIssuing: eq.eqStrict,\n validUntil: option.getEq(eq.eqStrict),\n authority: option.getEq(eq.eqString),\n authorityMandatory: eq.eqBoolean,\n issuer: option.getEq(eq.eqString),\n issuerMandatory: eq.eqBoolean,\n});\n\nexport const PersonalDocumentOCR = t.type({\n idNumber: optionFromUndefined(NonEmptyString),\n dateOfIssuing: optionFromUndefined(DateFromSQLString),\n validUntil: optionFromUndefined(DateFromSQLString),\n authority: optionFromUndefined(NonEmptyString),\n authorityMandatory: t.boolean,\n issuer: optionFromUndefined(NonEmptyString),\n issuerMandatory: t.boolean,\n});\nexport type PersonalDocumentOCR = t.TypeOf;\n\nexport const PersonalDocumentProofOfAddress = t.type({\n idNumber: optionFromUndefined(NonEmptyString),\n dateOfIssuing: DateFromSQLString,\n validUntil: optionFromUndefined(DateFromSQLString),\n issuer: optionFromUndefined(t.string),\n localPersonalNumber: optionFromUndefined(NonEmptyString),\n});\nexport type PersonalDocumentProofOfAddress = t.TypeOf<\n typeof PersonalDocumentProofOfAddress\n>;\nexport const eqPersonalDocumentOfAddress: Eq = eq.getStructEq(\n {\n idNumber: option.getEq(eq.eqString),\n dateOfIssuing: eq.eqStrict,\n validUntil: option.getEq(eq.eqStrict),\n issuer: option.getEq(eq.eqString),\n localPersonalNumber: option.getEq(eq.eqString),\n }\n);\nexport const PersonalInfoError = t.strict({\n personalData: optionFromArray(LocalizedString),\n documentDetails: optionFromArray(LocalizedString),\n permanentAddress: optionFromArray(LocalizedString),\n generalError: optionFromArray(LocalizedString),\n});\nexport type PersonalInfoError = t.TypeOf;\n\nexport const PersonalProfileDocUploadSubmitError = t.intersection([\n PersonalInfoError,\n t.strict({ compareDocs: t.boolean }),\n]);\nexport type PersonalProfileDocUploadSubmitError = t.TypeOf<\n typeof PersonalProfileDocUploadSubmitError\n>;\n\nexport const ClientDataOCR = t.type({\n documentType: DocumentType,\n personalData: PersonalDataOCR,\n documentDetails: PersonalDocumentOCR,\n permanentAddress: optionFromUndefined(AddressOCR),\n addressSuggestions: optionFromUndefined(nonEmptyArray(AddressWrite)),\n validationErrors: withFallback(\n optionFromUndefined(PersonalInfoError),\n option.none\n ),\n});\nexport type ClientDataOCR = t.TypeOf;\n\nexport const ClientDataResult = t.union([\n t.keyof({\n UploadAgain: true,\n EditData: true,\n Continue: true,\n Abort: true,\n ContinueWithWarning: true,\n EditDataWithWarning: true,\n }),\n ClientDataCheck,\n]);\nexport type ClientDataResult = t.TypeOf;\n\nexport const FraudCheckResult = t.union(\n [\n ClientDataResult,\n t.keyof({\n Redo: true,\n }),\n ],\n \"FraudCheckResult\"\n);\nexport type FraudCheckResult = t.TypeOf;\n\nexport const ClientDataEdit = t.partial({\n personalData: PersonalData,\n documentDetails: PersonalDocument,\n permanentAddress: Address,\n});\nexport type ClientDataEdit = t.TypeOf;\n\nexport const AddressCountries = t.array(CountryOption, \"AddressCountries\");\nexport type AddressCountries = t.TypeOf;\n\nexport const AllCountries = t.array(CountryOption, \"AllCountries\");\nexport type AllCountries = t.TypeOf;\n","import * as t from \"io-ts\";\nimport { sharedReducerConfig } from \"../../BranchExperience/useSharedReducer\";\nimport { AddressWrite } from \"../domain\";\nimport { option } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { GenericError, optionFromUndefined } from \"../../globalDomain\";\n\nconst State = t.type({\n formInEditing: t.boolean,\n error: optionFromUndefined(GenericError),\n currentAddress: optionFromUndefined(AddressWrite),\n shared: t.boolean,\n submitting: t.boolean,\n});\ntype State = t.TypeOf;\n\nconst ShareWithClientAction = t.type({\n id: t.literal(\"ShareWithClient\"),\n});\n\nconst SetErrorAction = t.type({\n id: t.literal(\"SetError\"),\n payload: GenericError,\n});\n\nconst SetCurrentAddressAction = t.type({\n id: t.literal(\"SetCurrentAddress\"),\n payload: t.type({\n address: optionFromUndefined(AddressWrite),\n }),\n});\n\nconst CancelEditingAction = t.type({\n id: t.literal(\"CancelEditing\"),\n});\n\nconst SetEditingCurrentAddressAction = t.type({\n id: t.literal(\"SetEditingCurrentAddress\"),\n});\n\nconst SetSubmitAddress = t.type({\n id: t.literal(\"SetSubmitAddress\"),\n});\n\nconst ResetSubmitAddress = t.type({\n id: t.literal(\"ResetSubmitAddress\"),\n});\n\nconst Action = t.union([\n ShareWithClientAction,\n SetErrorAction,\n SetCurrentAddressAction,\n CancelEditingAction,\n SetEditingCurrentAddressAction,\n SetSubmitAddress,\n ResetSubmitAddress,\n]);\n\ntype Action = t.TypeOf;\n\nexport function shareWithClientAction(): Action {\n return {\n id: \"ShareWithClient\",\n };\n}\n\nexport function setCurrentAddressAction(address: Option): Action {\n return {\n id: \"SetCurrentAddress\",\n payload: {\n address,\n },\n };\n}\n\nexport function setErrorAction(error: GenericError): Action {\n return {\n id: \"SetError\",\n payload: error,\n };\n}\n\nexport function cancelEditingAction(): Action {\n return {\n id: \"CancelEditing\",\n };\n}\n\nexport function editCurrentAddressAction(): Action {\n return {\n id: \"SetEditingCurrentAddress\",\n };\n}\n\nexport function submitAddress(): Action {\n return {\n id: \"SetSubmitAddress\",\n };\n}\n\nexport function resetSubmitAddress(): Action {\n return {\n id: \"ResetSubmitAddress\",\n };\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.id) {\n case \"SetCurrentAddress\":\n return {\n ...state,\n formInEditing: false,\n currentAddress: action.payload.address,\n shared: false,\n submitting: false,\n };\n case \"SetError\":\n return {\n ...state,\n formInEditing: false,\n error: option.some(action.payload),\n submitting: false,\n };\n case \"ShareWithClient\":\n return {\n ...state,\n formInEditing: false,\n error: option.none,\n shared: true,\n submitting: false,\n };\n case \"CancelEditing\":\n return {\n ...state,\n formInEditing: false,\n submitting: false,\n };\n case \"SetEditingCurrentAddress\":\n return {\n ...state,\n error: option.none,\n formInEditing: true,\n submitting: false,\n };\n case \"SetSubmitAddress\":\n return {\n ...state,\n submitting: true,\n };\n case \"ResetSubmitAddress\":\n return {\n ...state,\n submitting: false,\n };\n }\n}\n\nexport const reducerConfig = sharedReducerConfig(\n \"AdditionalAddresses\",\n State,\n Action,\n reducer\n);\n","import {\n AllCitizenships,\n AllSupportedCitizenships,\n Citizenship,\n PersonalData,\n PersonalDataOCR,\n} from \"../../domain\";\nimport {\n ComputedFieldProps,\n DateField,\n ExtractFieldsOfType,\n Form,\n FormRow,\n FormSection,\n Issue,\n LocalizedString,\n RadioGroupField,\n ReadOnlyField,\n TextField,\n ValidableDate,\n validableDate,\n} from \"design-system\";\nimport {\n useFormatMaritalStatus,\n useFormatMessage,\n useFormatSex,\n} from \"../../../intl\";\n\nimport { constant, constFalse, identity, pipe } from \"fp-ts/function\";\nimport { array, nonEmptyArray, option, record } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\n\nimport { CountryCode, MaritalStatus, Sex } from \"../../../globalDomain\";\nimport { MaritalStatusDropdown } from \"../../../Common/MaritalStatusDropdown/MaritalStatusDropdown\";\nimport { CitizenshipDropdown } from \"./CitizenshipDropdown\";\nimport { TitleDropdown } from \"./TitleDropdown\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { ReadOnlyDateField } from \"../../../Common/ReadOnlyDateField/ReadOnlyDateField\";\nimport { CountryOfBirthDropdown } from \"../CountryOfBirthDropdown\";\nimport { ReworkPersonalData } from \"../../../MortgageDashboard/domain\";\nimport { useFormatReworkData } from \"../../../MortgageDashboard/useFormatReworkData\";\nimport { useQuery } from \"../../../useAPI\";\nimport * as idUploadApi from \"../../../IdUpload/api\";\nimport * as remoteData from \"../../../RemoteData\";\nimport { isForeign } from \"../../utils\";\nimport { DocumentType } from \"../../../UploadDocuments/domain\";\nimport { useAppContext } from \"../../../useAppContext\";\n\nexport type FormState = {\n title: Option;\n titleAfter: Option;\n name: string;\n surname: string;\n sex: Option;\n maritalStatus: Option;\n birthNumber: Option;\n placeOfBirth: string;\n countryOfBirth: Option;\n dateOfBirth: Option;\n citizenship: Option;\n secondCitizenship: Option;\n localPersonalNumber: Option;\n};\n\nexport function formStateFromPersonalDataOCR(\n personalData: PersonalDataOCR\n): FormState {\n return {\n title: personalData.title,\n titleAfter: personalData.titleAfter,\n name: pipe(personalData.name, option.getOrElse(constant(\"\"))),\n surname: pipe(personalData.surname, option.getOrElse(constant(\"\"))),\n sex: personalData.sex,\n maritalStatus: personalData.maritalStatus,\n birthNumber: personalData.birthNumber,\n dateOfBirth: pipe(\n personalData.dateOfBirth,\n option.map(validableDate.fromDate)\n ),\n placeOfBirth: pipe(\n personalData.placeOfBirth,\n option.getOrElse(constant(\"\"))\n ),\n countryOfBirth: personalData.countryOfBirth,\n citizenship: pipe(\n personalData.citizenship,\n option.filter(\n (citizenship): citizenship is Citizenship => citizenship !== \"OTHER\"\n )\n ),\n localPersonalNumber: personalData.localPersonalNumber,\n secondCitizenship: personalData.secondCitizenship,\n };\n}\n\nexport function formStateFromPersonalData(\n personalData: PersonalData\n): FormState {\n return {\n title: personalData.title,\n titleAfter: personalData.titleAfter,\n name: personalData.name,\n surname: personalData.surname,\n sex: option.some(personalData.sex),\n maritalStatus: personalData.maritalStatus,\n birthNumber: personalData.birthNumber,\n dateOfBirth: option.some(validableDate.fromDate(personalData.dateOfBirth)),\n placeOfBirth: personalData.placeOfBirth,\n countryOfBirth: personalData.countryOfBirth,\n citizenship: option.some(personalData.citizenship),\n localPersonalNumber: personalData.localPersonalNumber,\n secondCitizenship: personalData.secondCitizenship,\n };\n}\n\ntype Props = {\n errors: Option>;\n heading?: React.ComponentProps[\"heading\"];\n reworkPersonalData: Option;\n documentType?: DocumentType;\n} & (\n | {\n readOnly: true;\n displayCountryOfBirth: boolean;\n values: FormState;\n fieldProps?: never;\n secondCitizenship: Option; // specified explicitly for control when to show since it is not on any document so not really \"personal data\"\n }\n | {\n readOnly: false;\n displayCountryOfBirth: boolean;\n fieldProps: (\n name: K\n ) => ComputedFieldProps;\n values?: never;\n supportForeign: boolean;\n }\n);\n\nexport function PersonalDataForm(props: Props) {\n const {\n config: { r6NewSironMapping: newSironMapping },\n } = useAppContext();\n const formatMessage = useFormatMessage();\n const formatSex = useFormatSex();\n const formatMaritalStatus = useFormatMaritalStatus();\n\n const isSupportedForeign = pipe(\n props.readOnly\n ? props.values.citizenship\n : props.fieldProps(\"citizenship\").value,\n isForeign\n );\n\n const { formatIssues, formatFeedback } = useFormatReworkData(\n props.reworkPersonalData\n );\n\n const renderTextFieldOrReadOnly = ({\n name,\n label,\n placeholder,\n }: {\n name: ExtractFieldsOfType;\n label: LocalizedString;\n placeholder: LocalizedString;\n }) =>\n props.readOnly ? (\n \n ) : (\n \n );\n\n const sexOptions = pipe(\n PersonalData.props.sex.keys,\n rec => record.keys(rec) as NonEmptyArray\n );\n\n const renderSexFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n o.toString()}\n isOptionDisabled={constFalse}\n renderOptionChildren={() => option.none}\n {...props.fieldProps(\"sex\")}\n label={formatMessage(\"Identification.personalData.sex\")}\n variant=\"horizontal\"\n issues={formatIssues(\"sex\", props.fieldProps(\"sex\").issues)}\n />\n );\n\n const renderMaritalStatusFieldOrReadOnly = props.readOnly ? (\n \n formatMaritalStatus(maritalStatus)\n )\n )}\n feedback={formatFeedback(\"maritalStatus\")}\n />\n ) : (\n \n );\n\n const renderCountryOfBirthFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n \n );\n\n const countries = pipe(\n useQuery(idUploadApi.allCountries),\n ([result]) => result,\n remoteData.fold(constant([]), constant([]), identity)\n );\n\n const renderSecondCitizenship =\n props.readOnly &&\n newSironMapping &&\n option.isSome(props.secondCitizenship) ? (\n \n pipe(\n props.secondCitizenship,\n option.fold(constFalse, v => c.countryCode === v)\n )\n ),\n option.map(c => c.label),\n option.getOrElse(constant(\"\"))\n )}\n />\n ) : null;\n\n const renderCitizenshipFieldOrReadOnly = props.readOnly ? (\n \n pipe(\n items,\n array.findFirst(c =>\n pipe(\n props.values[\"citizenship\"],\n option.fold(constFalse, v => c.countryCode === v)\n )\n ),\n option.map(c => c.label),\n option.getOrElse(constant(\"\"))\n )\n )}\n feedback={formatFeedback(\"citizenship\")}\n />\n ) : (\n \n );\n\n const renderDateOfBirthFieldOrReadonly = props.readOnly ? (\n \n ) : (\n \n );\n\n const renderTitleBeforeFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n \n );\n\n const renderTitleAfterFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n \n );\n\n const nameField = renderTextFieldOrReadOnly({\n name: \"name\",\n label: formatMessage(\"Identification.personalData.name\"),\n placeholder: formatMessage(\"Identification.personalData.name\"),\n });\n\n const surnameField = renderTextFieldOrReadOnly({\n name: \"surname\",\n label: formatMessage(\"Identification.personalData.surname\"),\n placeholder: formatMessage(\"Identification.personalData.surname\"),\n });\n\n const birthNumberField = props.readOnly ? (\n \"\")\n )}\n feedback={formatFeedback(\"birthNumber\")}\n />\n ) : (\n \n props\n .fieldProps(\"birthNumber\")\n .onChange(\n s.length > 0 ? option.some(s as NonEmptyString) : option.none\n )\n }\n value={pipe(\n props.fieldProps(\"birthNumber\").value,\n option.getOrElse(() => \"\")\n )}\n label={formatMessage(\"Identification.personalData.birthNumber\")}\n placeholder={formatMessage(\"Identification.personalData.birthNumber\")}\n issues={formatIssues(\n \"birthNumber\",\n props.fieldProps(\"birthNumber\").issues\n )}\n />\n );\n\n const placeOfBirthField = renderTextFieldOrReadOnly({\n name: \"placeOfBirth\",\n label: formatMessage(\"Identification.personalData.birthPlace\"),\n placeholder: formatMessage(\"Identification.personalData.birthPlace\"),\n });\n\n const renderLocalPersonalNumberField =\n props.readOnly &&\n props.values &&\n props.values.localPersonalNumber &&\n option.isSome(props.values.localPersonalNumber) ? (\n \n ) : null;\n\n return (\n
\n e.value)))}\n >\n \n {renderTitleBeforeFieldOrReadOnly}\n {renderTitleAfterFieldOrReadOnly}\n \n \n {nameField}\n {surnameField}\n \n {renderSexFieldOrReadOnly}\n {isSupportedForeign ? (\n props.documentType === \"IDCard\" && (\n {renderMaritalStatusFieldOrReadOnly}\n )\n ) : (\n {renderMaritalStatusFieldOrReadOnly}\n )}\n \n {renderDateOfBirthFieldOrReadonly}\n {isSupportedForeign ? null : birthNumberField}\n \n \n {placeOfBirthField}\n {props.displayCountryOfBirth\n ? renderCountryOfBirthFieldOrReadOnly\n : renderCitizenshipFieldOrReadOnly}\n \n {props.displayCountryOfBirth && (\n \n {renderCitizenshipFieldOrReadOnly}\n {renderLocalPersonalNumberField}\n \n )}\n {!!renderSecondCitizenship && (\n {renderSecondCitizenship}\n )}\n {!props.displayCountryOfBirth && (\n {renderLocalPersonalNumberField}\n )}\n \n \n );\n}\n","import { PersonalDocument, PersonalDocumentOCR } from \"../../domain\";\nimport {\n FormRow,\n Form,\n ReadOnlyField,\n TextField,\n DateField,\n FormSection,\n Banner,\n ComputedFieldProps,\n LocalizedString,\n ExtractFieldsOfType,\n ValidableDate,\n validableDate,\n Issue,\n} from \"design-system\";\nimport { useFormatDocumentType, useFormatMessage } from \"../../../intl\";\nimport { Option } from \"fp-ts/Option\";\nimport { nonEmptyArray, option } from \"fp-ts\";\nimport { constant, constNull, pipe } from \"fp-ts/function\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { AuthorityDropdown } from \"./AuthorityDropdown\";\nimport { DocumentType } from \"../../../UploadDocuments/domain\";\nimport { ReadOnlyDateField } from \"../../../Common/ReadOnlyDateField/ReadOnlyDateField\";\nimport {\n PrimaryDocumentIssue,\n SecondaryDocumentIssue,\n} from \"../../../ClientProfile/domain\";\nimport { foldIssue } from \"../../../ClientProfile/utils\";\nimport {\n ReworkCustomer,\n ReworkDocumentDetails,\n} from \"../../../MortgageDashboard/domain\";\nimport { useFormatReworkData } from \"../../../MortgageDashboard/useFormatReworkData\";\n\nexport type FormState = {\n [k in Exclude<\n keyof PersonalDocument,\n | \"dateOfIssuing\"\n | \"validUntil\"\n | \"authority\"\n | \"authorityMandatory\"\n | \"issuer\"\n | \"issuerMandatory\"\n >]: string;\n} & {\n authority: Option;\n authorityMandatory: boolean;\n issuer: Option;\n issuerMandatory: boolean;\n dateOfIssuing: Option;\n validUntil: Option;\n};\n\nexport function hasAuthority(documentType: DocumentType) {\n return documentType === \"IDCard\";\n}\n\nexport function formStateFromPersonalDocument(\n personalDocument: PersonalDocument\n): FormState {\n return {\n ...personalDocument,\n dateOfIssuing: option.some(\n validableDate.fromDate(personalDocument.dateOfIssuing)\n ),\n validUntil: pipe(\n personalDocument.validUntil,\n option.map(validableDate.fromDate)\n ),\n };\n}\n\nexport function formStateFromPersonalDocumentOCR(\n personalDocument: PersonalDocumentOCR\n): FormState {\n return {\n idNumber: pipe(personalDocument.idNumber, option.getOrElse(constant(\"\"))),\n authority: personalDocument.authority,\n issuer: personalDocument.issuer,\n dateOfIssuing: pipe(\n personalDocument.dateOfIssuing,\n option.map(validableDate.fromDate)\n ),\n validUntil: pipe(\n personalDocument.validUntil,\n option.map(validableDate.fromDate)\n ),\n authorityMandatory: personalDocument.authorityMandatory,\n issuerMandatory: personalDocument.issuerMandatory,\n };\n}\n\ntype Props = {\n documentType: DocumentType;\n errors: Option>;\n heading?: React.ComponentProps[\"heading\"];\n showDocumentType?: boolean;\n issue: Option;\n checkLostStolen?: boolean;\n reworkDocumentDetails: Option;\n reworkClientProfile: Option;\n authorityMandatory: boolean;\n issuerMandatory: boolean;\n} & (\n | {\n readOnly: true;\n values: FormState;\n }\n | {\n readOnly: false;\n canEditValidUntilField?: boolean;\n fieldProps: (\n name: K\n ) => ComputedFieldProps;\n }\n);\n\nexport function PersonalDocumentForm(props: Props) {\n const formatMessage = useFormatMessage();\n const formatDocumentType = useFormatDocumentType();\n\n const { formatIssues, formatFeedback } = useFormatReworkData(\n props.reworkDocumentDetails\n );\n const { formatFeedback: formatClientProfileFeedback } = useFormatReworkData(\n props.reworkClientProfile\n );\n\n const expiredBanner = (\n \n );\n\n const lostOrStolenBanner = (\n \n );\n\n const renderTextFieldOrReadOnly = ({\n name,\n label,\n placeholder,\n }: {\n name: ExtractFieldsOfType;\n label: LocalizedString;\n placeholder: LocalizedString;\n }) =>\n props.readOnly ? (\n \n ) : (\n \n );\n\n const renderDateFieldOrReadOnly = ({\n name,\n label,\n placeholder,\n }: {\n name: ExtractFieldsOfType>;\n label: LocalizedString;\n placeholder: LocalizedString;\n }) =>\n props.readOnly ? (\n \n ) : (\n \n );\n\n const renderValidUntilField =\n props.readOnly || !props.canEditValidUntilField ? (\n \n ) : (\n \n );\n\n const renderAuthorityFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n \n );\n\n const idNumberField = renderTextFieldOrReadOnly({\n name: \"idNumber\",\n label: formatMessage(\"Identification.personalData.idNumber\"),\n placeholder: formatMessage(\"Identification.personalData.idNumber\"),\n });\n\n const documentTypeField = (\n \n );\n\n const dateOfIssuingField = renderDateFieldOrReadOnly({\n name: \"dateOfIssuing\",\n label: formatMessage(\"Identification.personalData.dateOfIssuing\"),\n placeholder: formatMessage(\"Identification.personalData.dateOfIssuing\"),\n });\n\n const rendeIssuerFieldOrReadOnly = props.readOnly ? (\n \n ) : (\n \n props.fieldProps(\"issuer\").onChange(option.some(value))\n }\n value={pipe(\n props.fieldProps(\"issuer\").value,\n option.getOrElse(constant(\"\"))\n )}\n label={formatMessage(\"Identification.personalData.placeOfIssue\")}\n placeholder={formatMessage(\"Identification.personalData.placeOfIssue\")}\n issues={formatIssues(\"issuer\", props.fieldProps(\"issuer\").issues)}\n />\n );\n\n const showAuthority = props.readOnly\n ? props.authorityMandatory ||\n (option.isSome(props.values.authority) &&\n props.values.authority.value.trim() !== \"\")\n : true;\n const showIssuer = props.readOnly\n ? props.issuerMandatory ||\n (option.isSome(props.values.issuer) &&\n props.values.issuer.value.trim() !== \"\")\n : true;\n\n return (\n
\n e.value)))}\n >\n {pipe(\n props.issue,\n option.fold(constNull, issue =>\n foldIssue(issue, {\n DifferentDocument: constNull,\n PrimaryDocumentExpired: () => expiredBanner,\n PrimaryDocumentLostOrStolen: () =>\n props.checkLostStolen ? lostOrStolenBanner : null,\n SecondaryDocumentExpired: () => expiredBanner,\n SecondaryDocumentLostOrStolen: () =>\n props.checkLostStolen ? lostOrStolenBanner : null,\n NoPrimaryDocument: constNull,\n })\n )\n )}\n {props.showDocumentType ? (\n \n {documentTypeField}\n {idNumberField}\n \n ) : (\n {idNumberField}\n )}\n \n {dateOfIssuingField}\n {renderValidUntilField}\n \n {showAuthority && showIssuer ? (\n \n {renderAuthorityFieldOrReadOnly}\n {rendeIssuerFieldOrReadOnly}\n \n ) : showAuthority ? (\n {renderAuthorityFieldOrReadOnly}\n ) : showIssuer ? (\n {rendeIssuerFieldOrReadOnly}\n ) : (\n <>\n )}\n \n \n );\n}\n","import { AllSupportedCitizenships } from \"./domain\";\nimport { Option } from \"fp-ts/Option\";\nimport { option } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\n\nexport function isForeign(citizenship: Option) {\n return pipe(\n citizenship,\n option.fold(\n () => false, //default cz/sk\n isForeign_\n )\n );\n}\n\nexport function isForeign_(citizenship: AllSupportedCitizenships) {\n return citizenship !== \"SVK\" && citizenship !== \"CZE\";\n}\n\nexport function isCzSk(citizenship: Option) {\n return pipe(\n citizenship,\n option.fold(\n () => true, //default cz/sk\n citizenship => citizenship === \"SVK\" || citizenship === \"CZE\"\n )\n );\n}\n","import { useFormatMessage } from \"../../intl\";\nimport {\n DropdownOption,\n Form,\n FormRow,\n Space,\n AutocompleteInputField,\n SuggestionsStatus,\n Banner,\n ReadOnlyField,\n FormSection,\n TextField,\n ComputedFieldProps,\n LocalizedString,\n Issue,\n CheckboxField,\n} from \"design-system\";\nimport { option, nonEmptyArray } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport { Option } from \"fp-ts/Option\";\nimport { CitySuggestion, StreetSuggestion } from \"../domain\";\nimport { AddressFormState } from \"../addressFormUtils\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { CountryDropdown } from \"./CountryDropdown\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { ReworkAddress } from \"../../MortgageDashboard/domain\";\nimport { ComponentProps } from \"react\";\n\ntype Props = (\n | {\n readOnly: true;\n values: AddressFormState;\n fieldProps?: never;\n errors: Option>;\n reworkAddress: Option;\n displayConfirmation?: boolean;\n }\n | {\n readOnly: false;\n fieldProps: (\n name: K\n ) => ComputedFieldProps;\n values?: never;\n citiesSuggestions: {\n status: SuggestionsStatus;\n onSelect: (suggestion: DropdownOption) => unknown;\n };\n streetSuggestions: {\n status: SuggestionsStatus;\n onSelect: (suggestion: DropdownOption) => unknown;\n };\n errors: Option>;\n submitButton: {\n label: LocalizedString;\n action: TaskEither;\n disabled?: boolean;\n };\n cancelButton?: {\n label: LocalizedString;\n action: () => unknown;\n disabled?: boolean;\n };\n lockCountryEdit?: boolean;\n supportForeign?: boolean;\n displayConfirmation?: boolean;\n }\n) & {\n lockCzSk: boolean;\n hint: Option;\n};\n\nexport function AddressForm(props: Props) {\n const formatMessage = useFormatMessage();\n\n const reworkFeedback: ComponentProps[\"feedback\"] = {\n type: \"warning\",\n message: formatMessage(\"Mortgage.Dashboard.ReworkData.fieldChangedMessage\"),\n };\n\n const renderHint = pipe(\n props.hint,\n option.map(hint => (\n <>\n \n \n \n )),\n option.toNullable\n );\n\n const readonlyCountryOverride = !props.readOnly && !!props.lockCountryEdit;\n const countryField = props.readOnly ? (\n r.country),\n option.map(() => reworkFeedback),\n option.toUndefined\n )}\n />\n ) : (\n \n );\n\n const streetNameField = props.readOnly ? (\n r.streetName),\n option.map(() => reworkFeedback),\n option.toUndefined\n )}\n />\n ) : (\n \n );\n\n const confirmedField = props.readOnly ? (\n <>\n ) : (\n \n );\n\n const streetNumberField = props.readOnly ? (\n r.streetNumber),\n option.map(() => reworkFeedback),\n option.toUndefined\n )}\n />\n ) : (\n \n );\n\n const cityField = props.readOnly ? (\n r.city),\n option.map(() => reworkFeedback),\n option.toUndefined\n )}\n />\n ) : (\n \n );\n\n const zipCodeField = props.readOnly ? (\n r.zipCode),\n option.map(() => reworkFeedback),\n option.toUndefined\n )}\n />\n ) : (\n \n );\n\n const formActions = props.readOnly\n ? {}\n : {\n cancelButton: props.cancelButton,\n submitButton: props.submitButton,\n };\n\n const needConfirmation =\n props.displayConfirmation != undefined && props.displayConfirmation;\n\n return (\n
\n e.value)))}\n >\n {countryField}\n \n {cityField}\n {streetNameField}\n \n \n {streetNumberField}\n {zipCodeField}\n \n {needConfirmation && {confirmedField}}\n {renderHint}\n \n \n );\n}\n","import * as t from \"io-ts\";\nimport { eq } from \"fp-ts\";\nimport { apiCall } from \"../../APICall\";\nimport { constFalse, constTrue } from \"fp-ts/function\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\n\nconst CEXType = t.type({\n fullName: t.string,\n id: NonEmptyString,\n});\n\nexport type CEXType = t.TypeOf;\n\nconst OPUType = t.type({\n branchCode: NonEmptyString,\n branchName: t.string,\n branchAddress: t.string,\n});\n\nexport type OPUType = t.TypeOf;\n\nconst getBranchInfoOutput = t.type({\n branchCode: NonEmptyString,\n branchAddress: t.string,\n cexCode: optionFromNullable(NonEmptyString),\n});\n\ntype getBranchInfoOutput = t.TypeOf;\n\nexport const getBankerBranchInfo = apiCall({\n path: [\"authorization\", \"banker\", \"getBranchInfo\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: getBranchInfoOutput,\n});\n\nexport const get3PBranchInfo = apiCall({\n path: [\"authorization\", \"3P\", \"getBranchInfo\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: getBranchInfoOutput,\n});\n\nconst GetCEXListOutput = t.array(CEXType);\n\ntype GetCEXListOutput = t.TypeOf;\n\nexport const getCEXList = apiCall({\n path: [\"utilities\", \"barcex\", \"noauth\", \"list\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constTrue),\n outputCodec: GetCEXListOutput,\n});\n\nconst GetOPUListOutput = t.array(OPUType);\n\ntype GetOPUListOutput = t.TypeOf;\n\nexport const getOPUList = apiCall({\n path: [\"utilities\", \"branchcollection\", \"noauth\", \"list\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constTrue),\n outputCodec: GetOPUListOutput,\n});\n\nconst EditBranchInfoInput = t.type({\n branchCode: NonEmptyString,\n cexCode: NonEmptyString,\n});\n\ntype EditBranchInfoInput = t.TypeOf;\n\nexport const editBankerBranchInfo = apiCall({\n path: [\"authorization\", \"banker\", \"editBranchInfo\"],\n inputCodec: EditBranchInfoInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n\nexport const edit3PBranchInfo = apiCall({\n path: [\"authorization\", \"3P\", \"editBranchInfo\"],\n inputCodec: EditBranchInfoInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n","import * as t from \"io-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { option } from \"fp-ts\";\nimport { optionFromUndefined } from \"../../globalDomain\";\nimport { sharedReducerConfig } from \"../../BranchExperience/useSharedReducer\";\nimport { Address, PersonalDocumentProofOfAddress } from \"../domain\";\nimport { DocumentType } from \"../../UploadDocuments/domain\";\nimport { ProofOfAddressSubmitError } from \"../api\";\n\nconst SimpleError = t.keyof({\n MissingPermanentAddressError: true,\n GenericError: true,\n});\nconst Error = t.union([SimpleError, ProofOfAddressSubmitError]);\ntype Error = t.TypeOf;\n\nconst ProofOfAddress = t.type({\n documentType: DocumentType,\n document: optionFromUndefined(PersonalDocumentProofOfAddress),\n isForeign: t.boolean,\n});\ntype ProofOfAddress = t.TypeOf;\n\nconst State = t.type({\n formInEditing: t.boolean,\n error: optionFromUndefined(Error),\n permanentAddress: optionFromUndefined(Address),\n proofOfAddress: ProofOfAddress,\n shared: t.boolean,\n});\ntype State = t.TypeOf;\n\nconst SetErrorAction = t.type({\n id: t.literal(\"SetError\"),\n payload: optionFromUndefined(Error),\n});\n\nconst SetPermanentAddressAction = t.type({\n id: t.literal(\"SetPermanentAddress\"),\n payload: optionFromUndefined(Address),\n});\n\nconst SetEditingAction = t.type({\n id: t.literal(\"SetEditing\"),\n payload: t.boolean,\n});\n\nconst ShareWithClientAction = t.type({\n id: t.literal(\"ShareWithClient\"),\n payload: ProofOfAddress,\n});\n\nconst ProofOfAddressChangeAction = t.type({\n id: t.literal(\"ProofOfAddressChange\"),\n});\n\nconst Action = t.union([\n SetErrorAction,\n SetPermanentAddressAction,\n SetEditingAction,\n ShareWithClientAction,\n ProofOfAddressChangeAction,\n]);\ntype Action = t.TypeOf;\n\nexport function setErrorAction(error: Option): Action {\n return {\n id: \"SetError\",\n payload: error,\n };\n}\n\nexport function setPermanentAddressAction(address: Option
): Action {\n return {\n id: \"SetPermanentAddress\",\n payload: address,\n };\n}\n\nexport function setEditingAction(editing: boolean): Action {\n return {\n id: \"SetEditing\",\n payload: editing,\n };\n}\n\nexport function shareWithClientAction(proofOfAddress: ProofOfAddress): Action {\n return {\n id: \"ShareWithClient\",\n payload: proofOfAddress,\n };\n}\n\nexport function proofOfAddressChangeAction(): Action {\n return {\n id: \"ProofOfAddressChange\",\n };\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.id) {\n case \"SetError\":\n return {\n ...state,\n error: action.payload,\n };\n case \"SetPermanentAddress\":\n return {\n ...state,\n permanentAddress: action.payload,\n shared: false,\n error: option.none,\n formInEditing: false,\n };\n case \"SetEditing\":\n return {\n ...state,\n formInEditing: action.payload,\n };\n case \"ShareWithClient\":\n return {\n ...state,\n proofOfAddress: action.payload,\n shared: true,\n };\n case \"ProofOfAddressChange\":\n return {\n ...state,\n shared: false,\n };\n }\n}\n\nexport const reducerConfig = sharedReducerConfig(\n \"PermanentAddress\",\n State,\n Action,\n reducer\n);\n","export function base64FileSize(base64: string): number {\n // https://softwareengineering.stackexchange.com/questions/288670/know-file-size-with-a-base64-string\n return base64.length * (3 / 4) - (base64.endsWith(\"==\") ? 2 : 1);\n}\n","import * as t from \"io-ts\";\nimport { sharedReducerConfig } from \"../../BranchExperience/useSharedReducer\";\n\nconst NotSharedState = t.type({ id: t.literal(\"notShared\") });\nconst SharedState = t.type({ id: t.literal(\"sharedWithClient\") });\n\nconst State = t.union([NotSharedState, SharedState]);\ntype State = t.TypeOf;\n\nconst ShareWithClientAction = t.type({\n id: t.literal(\"ShareWithClient\"),\n});\nexport const shareWithClientAction: Action = {\n id: \"ShareWithClient\",\n};\nconst EditDataAction = t.type({\n id: t.literal(\"EditData\"),\n});\nexport const editDataAction: Action = {\n id: \"EditData\",\n};\nconst Action = t.union([ShareWithClientAction, EditDataAction]);\ntype Action = t.TypeOf;\n\nfunction reducer(_: State, action: Action): State {\n switch (action.id) {\n case \"ShareWithClient\":\n return { id: \"sharedWithClient\" };\n case \"EditData\":\n return { id: \"notShared\" };\n }\n}\n\nexport const reducerConfig = sharedReducerConfig(\n \"ConfirmClientData\",\n State,\n Action,\n reducer\n);\n","import * as t from \"io-ts\";\nimport { eq, option } from \"fp-ts\";\nimport { Eq } from \"fp-ts/Eq\";\nimport {\n AddressCountries,\n AddressType,\n AddressWrite,\n AllCitizenships,\n AllCountries,\n CitySuggestion,\n ClientDataEdit,\n ClientDataOCR,\n ClientDataResult,\n eqAddressType,\n eqAddressWrite,\n eqPersonalDocumentOfAddress,\n FraudCheckResult,\n PersonalDocumentProofOfAddress,\n PersonalInfoError,\n PersonalProfileDocUploadSubmitError,\n StreetSuggestion,\n} from \"./domain\";\nimport { apiCall } from \"../APICall\";\nimport { constFalse, constTrue } from \"fp-ts/function\";\nimport {\n CompressedFileContent,\n CountryCode,\n DocumentPurpose,\n eqWithCoApplicant,\n GenericError,\n optionFromUndefined,\n withCoApplicant,\n} from \"../globalDomain\";\nimport { nonEmptyArray } from \"io-ts-types/lib/nonEmptyArray\";\nimport { LocalizedString } from \"design-system\";\nimport { withApplicantIndex } from \"../MortgageDashboard/domain\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { NonResidentsAdditionalDocumentsType } from \"../UKontoSecondPart/domain\";\n\nconst IDStreetSuggestionsInput = t.type(\n {\n streetName: t.string,\n zipCode: t.string,\n cityName: t.string,\n provinceName: t.string,\n country: CountryCode,\n },\n \"IDStreetSuggestionsInput\"\n);\ninterface IDStreetSuggestionsInput\n extends t.TypeOf {}\nconst eqIDStreetSuggestionsInput: Eq = eq.getStructEq(\n {\n streetName: eq.eqString,\n zipCode: eq.eqString,\n cityName: eq.eqString,\n provinceName: eq.eqString,\n }\n);\nconst IDStreetSuggestionsOutput = t.array(\n StreetSuggestion,\n \"IDStreetSuggestionsOutput\"\n);\nexport interface IDStreetSuggestionsOutput\n extends t.TypeOf {}\nexport const streetSuggestions = apiCall({\n inputEq: eqIDStreetSuggestionsInput,\n path: [\"clients\", \"identification\", \"address\", \"streetSuggestions\"],\n inputCodec: IDStreetSuggestionsInput,\n outputCodec: IDStreetSuggestionsOutput,\n});\n\nconst IDAddressCountriesInput = t.void;\ntype IDAddressCountriesInput = t.TypeOf;\nconst eqIDAddressCountriesInput: Eq = eq.fromEquals(\n constTrue\n);\nconst IDAddressCountriesOutput = AddressCountries;\ninterface IDAddressCountriesOutput\n extends t.TypeOf {}\nexport const countries = apiCall({\n inputEq: eqIDAddressCountriesInput,\n path: [\"clients\", \"identification\", \"address\", \"countries\"],\n inputCodec: IDAddressCountriesInput,\n outputCodec: IDAddressCountriesOutput,\n});\n\nconst IDAllCountriesOutput = AllCountries;\nexport const allCountries = apiCall({\n inputEq: eq.fromEquals(constTrue),\n path: [\"clients\", \"identification\", \"noauth\", \"address\", \"allCountries\"],\n inputCodec: t.void,\n outputCodec: IDAllCountriesOutput,\n});\n\nexport const allForeignSupportedCountries = apiCall({\n path: [\"clients\", \"foreign\", \"noauth\", \"supportedCountries\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: IDAllCountriesOutput,\n});\n\nconst IDCitySuggestionsInput = t.type(\n {\n searchTerm: t.string,\n country: CountryCode,\n },\n \"IDCitySuggestionsInput\"\n);\ninterface IDCitySuggestionsInput\n extends t.TypeOf {}\nconst eqIDCitySuggestionsInput: Eq = eq.getStructEq({\n searchTerm: eq.eqString,\n});\n\nconst IDCitySuggestionsOutput = t.array(\n CitySuggestion,\n \"IDCitySuggestionsOutput\"\n);\n\nexport interface IDCitySuggestionsOutput\n extends t.TypeOf {}\nexport const citySuggestions = apiCall({\n inputEq: eqIDCitySuggestionsInput,\n path: [\"clients\", \"identification\", \"address\", \"citySuggestions\"],\n inputCodec: IDCitySuggestionsInput,\n outputCodec: IDCitySuggestionsOutput,\n});\n\nexport const IDAddressSubmitInput = withCoApplicant(\n t.type(\n {\n addressType: AddressType,\n address: AddressWrite,\n },\n \"IDAddressSubmitInput\"\n )\n);\nexport type IDAddressSubmitInput = t.TypeOf;\nexport const eqIDAddressSubmitInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n addressType: eqAddressType,\n address: eqAddressWrite,\n })\n);\n\nexport const addressSubmit = apiCall({\n inputEq: eqIDAddressSubmitInput,\n path: [\"clients\", \"identification\", \"address\", \"submit\"],\n inputCodec: IDAddressSubmitInput,\n});\n\nexport const ClientDataInput = withCoApplicant(\n t.type(\n {\n idType: optionFromUndefined(DocumentPurpose),\n },\n \"ClientDataInput\"\n )\n);\n\nexport type ClientDataInput = t.TypeOf;\n\nexport const eqClientDataInput = eqWithCoApplicant(\n eq.getStructEq({\n idType: option.getEq(eq.eqString),\n })\n);\n\nexport const ClientDataOutput = t.type({\n primary: optionFromUndefined(ClientDataOCR),\n secondary: optionFromUndefined(ClientDataOCR),\n result: ClientDataResult,\n canUploadAgain: t.boolean,\n documentMismatch: optionFromUndefined(t.boolean),\n extractedAddress: t.union([t.string, t.null, t.undefined]),\n});\nexport type ClientDataOutput = t.TypeOf;\n\nexport const clientData = apiCall({\n path: [\"clients\", \"identification\", \"extractData\"],\n inputCodec: ClientDataInput,\n inputEq: eqClientDataInput,\n outputCodec: ClientDataOutput,\n});\n\nexport const clientDataPersonalProfile = apiCall({\n path: [\"clients\", \"personalProfile\", \"docUpload\", \"extractData\"],\n inputCodec: ClientDataInput,\n inputEq: eqClientDataInput,\n outputCodec: ClientDataOutput,\n});\n\nexport type ExtractClientDataCommand = TaskEither;\n\nconst FraudCheckResultInput = t.type(\n {\n zenIdPurpose: t.keyof({\n FRAUD_CHECK_HOLOGRAM: true,\n FRAUD_CHECK_SELFIE: true,\n FRAUD_CHECK_SELFIE_AND_HOLOGRAM: true,\n }),\n },\n \"FraudCheckResultInput\"\n);\n\nexport const fraudCheckResult = apiCall({\n path: [\"clients\", \"identification\", \"fraudCheck\"],\n inputCodec: FraudCheckResultInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: FraudCheckResult,\n});\n\nexport const fraudCheckSelfie = apiCall({\n path: [\"clients\", \"identification\", \"fraudCheck\", \"selfie\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constTrue),\n outputCodec: t.type({\n fileContent: optionFromNullable(CompressedFileContent),\n }),\n});\n\nconst RejectDataInput = withCoApplicant(\n t.type({\n idType: optionFromUndefined(DocumentPurpose),\n })\n);\ntype RejectDataInput = t.TypeOf;\n\nexport const rejectData = apiCall({\n path: [\"clients\", \"identification\", \"extractData\", \"reject\"],\n inputCodec: RejectDataInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n\nexport const rejectDataUkonto = apiCall({\n path: [\"packages\", \"uKonto\", \"identification\", \"extractData\", \"reject\"],\n inputCodec: RejectDataInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n\nconst PersonalInfoEditInput = withCoApplicant(\n t.type({\n clientData: ClientDataEdit,\n idType: DocumentPurpose,\n })\n);\nexport type PersonalInfoEditInput = t.TypeOf;\nconst PersonalInfoEditError = nonEmptyArray(LocalizedString);\nexport type PersonalInfoEditError = t.TypeOf;\n\nexport const personalInfoEdit = apiCall({\n path: [\"clients\", \"identification\", \"personalInfo\", \"edit\"],\n inputCodec: PersonalInfoEditInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: PersonalInfoEditError,\n});\n\nexport const personalInfoEditUkonto = apiCall({\n path: [\"packages\", \"uKonto\", \"identification\", \"personalInfo\", \"edit\"],\n inputCodec: PersonalInfoEditInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: PersonalInfoEditError,\n});\n\nconst PersonalInfoSubmitInput = withCoApplicant(\n t.type({\n idType: DocumentPurpose,\n })\n);\nexport type PersonalInfoSubmitInput = t.TypeOf;\n\nexport const personalInfoSubmit = apiCall({\n path: [\"clients\", \"identification\", \"personalInfo\", \"submit\"],\n inputCodec: PersonalInfoSubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: PersonalInfoError,\n});\n\nexport const personalInfoSubmitUkonto = apiCall({\n path: [\"packages\", \"uKonto\", \"identification\", \"personalInfo\", \"submit\"],\n inputCodec: PersonalInfoSubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: PersonalProfileDocUploadSubmitError,\n});\n\nconst ResidencySubmitInput = t.type({ residency: t.boolean });\nexport type ResidencySubmitInput = t.TypeOf;\nexport const residencySubmitUkonto = apiCall({\n path: [\"packages\", \"uKonto\", \"identification\", \"residency\", \"submit\"],\n inputCodec: ResidencySubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: t.unknown,\n});\n\nexport const PermanentAddressSubmitInput = withCoApplicant(\n t.type(\n {\n permanentAddress: AddressWrite,\n },\n \"PermanentAddressSubmitInput\"\n )\n);\nexport interface PermanentAddressSubmitInput\n extends t.TypeOf {}\nexport const eqPermanentAddressSubmitInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n permanentAddress: eqAddressWrite,\n })\n);\nexport const permanentAddressSubmit = apiCall({\n inputEq: eqPermanentAddressSubmitInput,\n path: [\"clients\", \"identification\", \"permanentAddress\", \"submit\"],\n inputCodec: PermanentAddressSubmitInput,\n});\n\nexport const ProofOfAddressSubmitInput = withCoApplicant(\n t.type(\n {\n proofOfAddress: PersonalDocumentProofOfAddress,\n },\n \"ProofOfAddressSubmitInput\"\n )\n);\nexport interface ProofOfAddressSubmitInput\n extends t.TypeOf {}\nconst eqProofOfAddressSubmitInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n proofOfAddress: eqPersonalDocumentOfAddress,\n })\n);\n\nexport const ProofOfAddressSubmitError = t.strict({\n error: LocalizedString,\n});\nexport type ProofOfAddressSubmitError = t.TypeOf<\n typeof ProofOfAddressSubmitError\n>;\nexport const proofOfAddressSubmit = apiCall({\n path: [\"clients\", \"identification\", \"proofOfAddress\", \"submit\"],\n inputCodec: ProofOfAddressSubmitInput,\n inputEq: eqProofOfAddressSubmitInput,\n outputCodec: t.unknown,\n errorCodec: ProofOfAddressSubmitError,\n});\n\nexport const ProofOfAddressDocumentSubmitInput = withCoApplicant(\n t.type(\n {\n side: t.keyof({\n First: true,\n Second: true,\n }),\n fileContent: CompressedFileContent,\n },\n \"ProofOfAddressDocumentSubmitInput\"\n )\n);\nexport interface ProofOfAddressDocumentSubmitInput\n extends t.TypeOf {}\nconst eqProofOfAddressDocumentSubmitInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n side: eq.eqStrict,\n fileContent: eq.eqStrict,\n })\n);\nexport const proofOfAddressDocumentSubmit = apiCall({\n inputCodec: ProofOfAddressDocumentSubmitInput,\n inputEq: eqProofOfAddressDocumentSubmitInput,\n path: [\"clients\", \"identification\", \"proofOfAddress\", \"document\", \"submit\"],\n});\n\nexport const ProofOfAddressDocumentRemoveInput = withCoApplicant(\n t.type(\n {\n side: t.keyof({\n First: true,\n Second: true,\n }),\n },\n \"ProofOfAddressDocumentRemoveInput\"\n )\n);\nexport interface ProofOfAddressDocumentRemoveInput\n extends t.TypeOf {}\nconst eqProofOfAddressDocumentRemoveInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n side: eq.eqStrict,\n })\n);\nexport const proofOfAddressDocumentRemove = apiCall({\n inputCodec: ProofOfAddressDocumentRemoveInput,\n inputEq: eqProofOfAddressDocumentRemoveInput,\n path: [\"clients\", \"identification\", \"proofOfAddress\", \"document\", \"remove\"],\n});\n\nexport const AdditionalDocumentUploadInput = withCoApplicant(\n t.type(\n {\n documentKey: NonResidentsAdditionalDocumentsType,\n fileContent: CompressedFileContent,\n },\n \"AdditionalDocumentUploadInput\"\n )\n);\nexport interface AdditionalDocumentUploadInput\n extends t.TypeOf {}\nconst eqAdditionalDocumentUploadInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n documentKey: eq.eqStrict,\n fileContent: eq.eqStrict,\n })\n);\nexport const additionalDocumentUpload = apiCall({\n inputCodec: AdditionalDocumentUploadInput,\n inputEq: eqAdditionalDocumentUploadInput,\n path: [\"clients\", \"identification\", \"additionalDocument\", \"upload\"],\n outputCodec: t.unknown,\n});\n\nexport const AdditionalDocumentRemoveInput = withCoApplicant(\n t.type(\n {\n documentKey: NonResidentsAdditionalDocumentsType,\n },\n \"AdditionalDocumentRemoveInput\"\n )\n);\nexport interface AdditionalDocumentRemoveInput\n extends t.TypeOf {}\nconst eqAdditionalDocumentRemoveInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n documentKey: eq.eqStrict,\n })\n);\nexport const additionalDocumentRemove = apiCall({\n inputCodec: AdditionalDocumentRemoveInput,\n inputEq: eqAdditionalDocumentRemoveInput,\n path: [\"clients\", \"identification\", \"additionalDocument\", \"remove\"],\n outputCodec: t.type({\n atLeastOneDocUploaded: t.boolean,\n }),\n});\n\nexport const AdditionalDocumentsRemoveInput = withCoApplicant(\n t.type(\n {\n documentKeys: t.array(NonResidentsAdditionalDocumentsType),\n },\n \"AdditionalDocumentRemoveInput\"\n )\n);\nexport interface AdditionalDocumentsRemoveInput\n extends t.TypeOf {}\nconst eqAdditionalDocumentsRemoveInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n documentKeys: eq.eqStrict,\n })\n);\nexport const additionalDocumentsRemove = apiCall({\n inputCodec: AdditionalDocumentsRemoveInput,\n inputEq: eqAdditionalDocumentsRemoveInput,\n path: [\"clients\", \"identification\", \"additionalDocument\", \"removeMany\"],\n outputCodec: t.type({\n atLeastOneDocUploaded: t.boolean,\n }),\n});\n\nconst AddressValidationInput = t.type(\n {\n address: AddressWrite,\n },\n \"AddressValidationInput\"\n);\n\ninterface AddressValidationInput\n extends t.TypeOf {}\n\nconst eqAddressValidateInput: Eq = eq.getStructEq({\n address: eqAddressWrite,\n});\n\nconst AddressValidationOutput = t.type({\n zipCode: optionFromUndefined(NonEmptyString),\n});\n\nconst AddressValidationError = t.type({\n id: t.union([t.literal(\"InvalidFlowId\"), t.literal(\"InvalidAddress\")]),\n});\n\nconst AddressValidationErrorWithSuggestion = t.intersection([\n t.partial({\n id: t.union([t.literal(\"InvalidFlowId\"), t.literal(\"InvalidAddress\")]),\n }),\n t.partial({\n addresses: nonEmptyArray(AddressWrite),\n }),\n]);\n\nexport type AddressValidationError = t.TypeOf;\n\nexport const addressValidation = apiCall({\n inputEq: eqAddressValidateInput,\n inputCodec: AddressValidationInput,\n path: [\"clients\", \"identification\", \"address\", \"validate\"],\n outputCodec: AddressValidationOutput,\n errorCodec: AddressValidationErrorWithSuggestion,\n});\n\nconst DocumentAuthoritiesOutput = t.array(LocalizedString);\nexport const documentAuthorities = apiCall({\n path: [\"clients\", \"identification\", \"documentAuthorities\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constTrue),\n outputCodec: DocumentAuthoritiesOutput,\n});\n\nconst CountryOfBirthSubmitInput = withApplicantIndex(\n t.type(\n {\n countryOfBirth: CountryCode,\n idType: optionFromUndefined(DocumentPurpose),\n },\n \"CountryOfBirthSubmitInput\"\n )\n);\nexport interface CountryOfBirthSubmitInput\n extends t.TypeOf {}\nexport const countryOfBirthSubmit = apiCall({\n path: [\"clients\", \"identification\", \"countryOfBirth\", \"submit\"],\n inputCodec: CountryOfBirthSubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: GenericError,\n});\n\nconst SecondCitizenshipSubmitInput = withApplicantIndex(\n t.type(\n {\n secondCitizenship: AllCitizenships,\n },\n \"SecondCitizenshipSubmitInput\"\n )\n);\nexport type SecondCitizenshipSubmitInput = t.TypeOf<\n typeof SecondCitizenshipSubmitInput\n>;\nexport const secondCitizenshipSubmit = apiCall({\n path: [\"clients\", \"identification\", \"secondCitizenship\", \"submit\"],\n inputCodec: SecondCitizenshipSubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: GenericError,\n});\n\nexport const personalProfileDocUploadSubmit = apiCall({\n path: [\"clients\", \"personalProfile\", \"docUpload\", \"submit\"],\n inputCodec: PersonalInfoSubmitInput,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n errorCodec: PersonalProfileDocUploadSubmitError,\n});\n\nexport const resetUploadAttempts = apiCall({\n path: [\"clients\", \"identification\", \"resetUploadAttempts\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n\nexport const ignoreAddressValidation = apiCall({\n path: [\n \"clients\",\n \"identification\",\n \"personalInfo\",\n \"edit\",\n \"permanentAddress\",\n \"ignoreAddressValidation\",\n ],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n});\n","import {\n ComputedFieldProps,\n DropdownOption,\n ReadOnlyField,\n Space,\n} from \"design-system\";\nimport { Option } from \"fp-ts/Option\";\nimport { DropdownField } from \"../../../Common/DropdownField/DropdownField\";\nimport { array, nonEmptyArray, option, ord, record } from \"fp-ts\";\nimport {\n constant,\n constFalse,\n constVoid,\n identity,\n pipe,\n} from \"fp-ts/function\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { useFormatCitizenship, useFormatMessage } from \"../../../intl\";\nimport { useQuery } from \"../../../useAPI\";\nimport * as idUploadApi from \"../../api\";\nimport * as remoteData from \"../../../RemoteData\";\nimport { AllCitizenships } from \"../../domain\";\nimport { dropdownOptionToValue } from \"../../../Common/selectDropdownOption\";\nimport { YesNoRadioGroupField } from \"../../../Common/YesNoRadioGroup/YesNoRadioGroupField\";\n\ntype Props =\n | {\n secondCitizenshipRadio: ComputedFieldProps>;\n secondCitizenshipField: ComputedFieldProps>;\n readonly?: false;\n }\n | {\n secondCitizenshipField: Option;\n readonly: true;\n };\n\nexport function SecondCitizenshipField(props: Props) {\n const formatCitizenship = useFormatCitizenship();\n const formatMessage = useFormatMessage();\n const countries = pipe(\n useQuery(idUploadApi.allCountries),\n ([result]) => result,\n remoteData.fold(constant([]), constant([]), identity)\n );\n\n const options = pipe(\n AllCitizenships.keys,\n rec => record.keys(rec) as NonEmptyArray,\n nonEmptyArray.map(citizenship => ({\n value: citizenship,\n label: formatCitizenship(citizenship, countries),\n })),\n array.sort(\n pipe(\n ord.ordString,\n ord.contramap(\n ({ label }: DropdownOption) => label + \"\"\n )\n )\n )\n );\n\n return !!props.readonly ? (\n \n formatCitizenship(citizenship, countries)\n )\n )}\n />\n ) : (\n <>\n \n {pipe(\n props.secondCitizenshipRadio.value,\n option.getOrElse(constFalse)\n ) && (\n <>\n \n \n pipe(\n options,\n array.findFirst(\n country => country.value === selectedCitizenship\n )\n )\n ),\n option.flatten\n )}\n onBlur={constVoid}\n options={options}\n onChange={v =>\n props.secondCitizenshipField.onChange(dropdownOptionToValue(v))\n }\n label={formatMessage(\"SecondCitizenship.dropdown.label\")}\n placeholder={formatMessage(\n \"SecondCitizenship.dropdown.placeholder\"\n )}\n clearable={false}\n searchable\n />\n \n )}\n \n );\n}\n","import { ComputedFieldProps, ReadOnlyField } from \"design-system\";\n\nimport { useFormatMessage } from \"../../intl\";\nimport { mapCountriesToOptions } from \"../addressFormUtils\";\nimport { pipe, constant, identity, constFalse } from \"fp-ts/function\";\nimport { array, option } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { useQuery } from \"../../useAPI\";\nimport * as remoteData from \"../../RemoteData\";\nimport * as identificationApi from \"../api\";\nimport { CountryCode } from \"../../globalDomain\";\nimport { selectedDropdownOption } from \"../../Common/selectDropdownOption\";\nimport { DropdownField } from \"../../Common/DropdownField/DropdownField\";\nimport { ComponentProps } from \"react\";\n\ntype Props = (\n | ({ readOnly: false } & ComputedFieldProps>)\n | { readOnly: true; value: Option }\n) & {\n feedback?: ComponentProps[\"feedback\"];\n issues?: ComponentProps[\"issues\"];\n};\n\nexport function CountryOfBirthDropdown(props: Props) {\n const formatMessage = useFormatMessage();\n\n const countries = pipe(\n useQuery(identificationApi.allCountries),\n ([result]) => result,\n remoteData.fold(constant([]), constant([]), identity)\n );\n\n const options = mapCountriesToOptions(countries);\n\n return props.readOnly ? (\n \n pipe(\n props.value,\n option.fold(constFalse, v => c.countryCode === v)\n )\n ),\n option.map(c => c.label),\n option.getOrElse(constant(\"\"))\n )}\n label={formatMessage(\"Identification.countryOfBirth.label\")}\n feedback={props.feedback}\n />\n ) : (\n {\n if (option.isSome(value)) {\n props.onChange(option.some(value.value.value));\n }\n }}\n label={formatMessage(\"Identification.countryOfBirth.label\")}\n placeholder={formatMessage(\"Identification.countryOfBirth.placeholder\")}\n options={options}\n searchable\n clearable={false}\n issues={props.issues}\n />\n );\n}\n","import { FC, ReactElement, useMemo } from \"react\";\nimport { option, taskEither } from \"fp-ts\";\nimport { AddressOCR, AddressWrite } from \"../domain\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n Box,\n Button,\n Heading,\n Space,\n Tooltip,\n InfoIcon,\n Launcher,\n PinIcon,\n Card,\n Body,\n Children,\n LocalizedString,\n} from \"design-system\";\nimport { AddressForm } from \"../AddressForm/AddressForm\";\n\nimport { useFormatMessage } from \"../../intl\";\nimport { constFalse, constNull, constTrue, pipe } from \"fp-ts/function\";\nimport { palette } from \"design-system/lib/styleConstants\";\nimport {\n formStateFromAddressOCR,\n useDefaultCountryCode,\n} from \"../addressFormUtils\";\nimport { AddressFormEdit } from \"../AddressForm/AddressFormEdit\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { ReworkAddress } from \"../../MortgageDashboard/domain\";\n\ntype Props = {\n initialState: Option;\n isEditing: boolean;\n submitInvalid: boolean;\n onSave: (address: AddressWrite, isNew: boolean) => TaskEither;\n onRemove: Option<() => unknown>;\n onEdit: Option<() => unknown>;\n onCancel: () => unknown;\n title: LocalizedString;\n subtitle: Option;\n hint: Option;\n disabled: boolean;\n tooltipContent: LocalizedString;\n \"data-test-id\"?: string;\n lockCountryEdit?: boolean;\n optionalFields?: boolean;\n reworkAddress: Option;\n foreignSupport?: boolean;\n forceValidateForForeign?: boolean;\n hasResidency?: () => boolean;\n lockCzSk?: boolean;\n} & (\n | {\n addNewContent: () => Children;\n }\n | {\n addNewContent?: never;\n addressDescription: LocalizedString;\n addAddressLabel: LocalizedString;\n }\n);\n\ntype AddressWrapperProps = {\n isEditing: boolean;\n wrapper: (children: Children) => ReactElement;\n editingWrapper: (children: Children) => ReactElement;\n};\n\nconst AddressWrapper: FC = ({\n children,\n isEditing,\n wrapper,\n editingWrapper,\n}) =>\n isEditing\n ? editingWrapper(children as Children)\n : wrapper(children as Children);\n\nexport function AddressBlock(props: Props) {\n const formatMessage = useFormatMessage();\n\n function foldStatus(match: {\n whenAddNew: () => T;\n whenReadOnly: (address: AddressOCR) => T;\n whenEditing: () => T;\n }): T {\n if (props.isEditing) {\n return match.whenEditing();\n }\n return pipe(\n props.initialState,\n option.fold(match.whenAddNew, state => match.whenReadOnly(state))\n );\n }\n\n const displayTooltipContent = () => (\n <>\n \n \n \n \n \n );\n\n const controlButtons = foldStatus({\n whenReadOnly: () => (\n <>\n \n {pipe(\n props.onEdit,\n option.fold(constNull, onEdit => (\n \n ))\n )}\n {pipe(\n props.onRemove,\n option.fold(constNull, onRemove => (\n <>\n \n \n \n ))\n )}\n \n ),\n whenAddNew: displayTooltipContent,\n whenEditing: displayTooltipContent,\n });\n\n const defaultCountry = useDefaultCountryCode();\n\n const initialValues = useMemo(() => {\n return pipe(\n props.initialState,\n option.map(addressOCR =>\n formStateFromAddressOCR(addressOCR, defaultCountry)\n )\n );\n }, [props.initialState]);\n\n const saveAddress = (address: AddressWrite) =>\n props.onSave(\n address,\n pipe(props.initialState, option.fold(constTrue, constFalse))\n );\n\n return (\n (\n \n {children}\n \n )}\n editingWrapper={children => (\n \n \n {children}\n \n \n )}\n >\n \n \n \n {props.title}\n \n {pipe(\n props.subtitle,\n option.fold(constNull, subtitle => (\n <>\n \n \n {subtitle}\n \n \n ))\n )}\n \n {controlButtons}\n \n \n {foldStatus({\n whenAddNew:\n props.addNewContent ||\n (() =>\n pipe(\n props.onEdit,\n option.fold(constNull, onEdit => (\n \n ))\n )),\n whenEditing: () => (\n \n ),\n whenReadOnly: address => (\n \n ),\n })}\n \n );\n}\n","import { useState } from \"react\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n LocalizedString,\n Box,\n Button,\n Heading,\n FileIcon,\n FieldIssues,\n Launcher,\n Stack,\n Issues,\n} from \"design-system\";\nimport { useFormatMessage } from \"../../intl\";\nimport { boolean, option, task, taskEither } from \"fp-ts\";\nimport { constant, constNull, pipe } from \"fp-ts/function\";\nimport { FileImageDialog } from \"../../Common/Dialogs/FileImageDialog\";\nimport { ScannedDocument } from \"../../UploadDocuments/domain\";\nimport { GenericDocumentScanDialog } from \"../../UploadDocuments/GenericDocumentScanDialog\";\nimport { UploadModeDialog } from \"../../UploadDocuments/UploadModeDialog\";\nimport { UploadModeDialogWithMobile } from \"../../UploadDocuments/UploadModeDialogWithMobile\";\nimport { useAppContext } from \"../../useAppContext\";\nimport { UploadMode } from \"../../UploadDocuments/state\";\nimport { CoApplicantInput } from \"../../globalDomain\";\n\ntype Props = {\n onChange: (scannedDocument: Option) => unknown;\n value: Option;\n uploaded: boolean;\n disabled: boolean;\n issues: Option;\n id?: string;\n label: LocalizedString;\n disableMobileUpload?: boolean;\n} & CoApplicantInput;\n\ntype ScanStep =\n | { id: \"Ready\" }\n | { id: \"ChooseMode\" }\n | { id: \"Scanning\"; mode: UploadMode };\n\nfunction foldScanStep(\n scanStep: ScanStep,\n match: {\n whenReady: () => T;\n whenChooseMode: () => T;\n whenScanning: (mode: UploadMode) => T;\n }\n) {\n switch (scanStep.id) {\n case \"Ready\":\n return match.whenReady();\n case \"ChooseMode\":\n return match.whenChooseMode();\n case \"Scanning\":\n return match.whenScanning(scanStep.mode);\n }\n}\n\nexport function DocumentUploadField(props: Props) {\n const formatMessage = useFormatMessage();\n\n const {\n config: { externalCommunication },\n } = useAppContext();\n\n const [scanStep, setScanStep] = useState({ id: \"Ready\" });\n const [isContentModalOpen, setIsContentModalOpen] = useState(false);\n\n const onDocumentAcquired = (scannedDocument: ScannedDocument) => {\n setScanStep({ id: \"Ready\" });\n props.onChange(\n pipe(\n scannedDocument,\n option.fromPredicate(scannedDocument => Boolean(scannedDocument.base64))\n )\n );\n };\n\n const onUploadModalConfirm = ({ mode }: { mode: UploadMode }) =>\n setScanStep({ id: \"Scanning\", mode });\n\n const onUploadModalDismiss = () => setScanStep({ id: \"Ready\" });\n\n const launcherOrDocument = pipe(\n props.uploaded,\n boolean.fold(\n () => (\n setScanStep({ id: \"ChooseMode\" })}\n icon={FileIcon}\n />\n ),\n () => (\n \n \n {props.label}\n \n \n props.onChange(option.none)}\n disabled={props.disabled}\n />\n \n \n )\n )\n );\n\n return (\n \n {launcherOrDocument}\n {foldScanStep(scanStep, {\n whenReady: constNull,\n whenChooseMode: () =>\n externalCommunication && !props.disableMobileUpload ? (\n \n ) : (\n \n ),\n whenScanning: (mode: UploadMode) => {\n switch (mode) {\n case \"Scanner\":\n case \"_MockScanner\":\n return (\n \n taskEither.fromTask(\n task.fromIO(() => onDocumentAcquired(scannedDocument))\n )\n }\n onDismiss={() => setScanStep({ id: \"Ready\" })}\n />\n );\n case \"Mobile\":\n return null;\n }\n },\n })}\n {isContentModalOpen && (\n v.base64),\n taskEither.fromOption(constant(\"MissingDocument\"))\n )}\n title={props.label}\n onDismiss={() => setIsContentModalOpen(false)}\n fileName={props.label}\n />\n )}\n {pipe(\n props.issues,\n option.map(issues => ),\n option.toNullable\n )}\n \n );\n}\n","import { useEffect, useMemo, useState } from \"react\";\nimport {\n fieldIssues,\n Issue,\n LocalizedString,\n unsafeLocalizedString,\n useForm,\n Validator,\n validators,\n} from \"design-system\";\nimport {\n constant,\n constFalse,\n constTrue,\n constUndefined,\n flow,\n pipe,\n} from \"fp-ts/function\";\nimport { useCommand } from \"../../useAPI\";\nimport * as identificationApi from \"../api\";\nimport { AddressWrite, AllSupportedCitizenships } from \"../domain\";\nimport { boolean, either, option, taskEither } from \"fp-ts\";\nimport { useFormatMessage } from \"../../intl\";\nimport { genericError, GenericError } from \"../../globalDomain\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport {\n AddressFormState,\n autocompleteInputStatusFromRemoteData,\n getCitySuggestionLabel,\n useDefaultCountryCode,\n} from \"../addressFormUtils\";\nimport { Option } from \"fp-ts/Option\";\nimport { AddressForm } from \"./AddressForm\";\nimport { useRemoteData } from \"../../useRemoteData\";\nimport * as remoteData from \"../../RemoteData\";\nimport { useValidators } from \"../../Common/useValidators\";\nimport { useDebounceState } from \"../../Common/useDebounceState\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { AddressSuggestionForm } from \"./AddressSuggestionForm\";\nimport { isForeign_ } from \"../utils\";\n\nconst searchTermRegExp = /(.+),\\s+(.+)/;\nconst streetNumberRegExp = /^[ÁáÉéÍíÓóÚúÝýĹĺŔŕÄäĚěÔôŐőŮůÜüČčĎ^ŇňŘřŠšŤťŽža-zA-Z0-9,.\\\"';:\\-_()\\/€’„“”–—\\s\\t]{1,255}$/;\n\nfunction splitSearchTerm(\n searchTerm: string\n): Option<{ city: NonEmptyString; provinceName: NonEmptyString }> {\n if (!searchTermRegExp.test(searchTerm)) return option.none;\n\n const blocks = searchTerm.match(searchTermRegExp);\n\n return pipe(\n option.fromNullable(blocks),\n option.map(blocks => ({\n city: blocks[1] as NonEmptyString,\n provinceName: blocks[2] as NonEmptyString,\n }))\n );\n}\n\nfunction validateStreetNumberRegex(streetNumber: string) {\n if (!streetNumberRegExp.test(streetNumber)) return option.none;\n return option.some(streetNumber);\n}\n\ntype Props = {\n initialValues: Option;\n onValidate: Validator;\n onSuggestionSubmit: (address: AddressWrite) => TaskEither;\n onSubmit: (address: AddressWrite) => TaskEither;\n onCancel?: () => unknown;\n submitInvalid?: boolean;\n hint: Option;\n lockCountryEdit?: boolean;\n optionalFields?: boolean;\n forceValidateForForeign: boolean;\n foreignSupport?: boolean;\n hasResidency?: () => boolean;\n lockCzSk: boolean;\n};\n\nexport function AddressFormEdit(props: Props) {\n const isInitialForeign = pipe(\n props.initialValues,\n option.fold(constFalse, values =>\n isForeign_(values.country as AllSupportedCitizenships)\n )\n );\n\n const formatMessage = useFormatMessage();\n const [skipValidation, setSkipValidation] = useState(\n isInitialForeign && !props.forceValidateForForeign\n );\n const validateConfirmation =\n props.hasResidency != undefined ? !props.hasResidency() : false;\n\n const [manualSkipValidation] = useState(false);\n const [suggestions, setSuggestions] = useState<\n Option>\n >(option.none);\n const addressValidate = useCommand(identificationApi.addressValidation);\n const ignoreAddressValidation = useCommand(\n identificationApi.ignoreAddressValidation\n );\n\n const formatError = (\n error: identificationApi.AddressValidationError | GenericError\n ): NonEmptyArray => {\n switch (error.id) {\n case \"GenericError\":\n case \"InvalidFlowId\":\n return fieldIssues.errors([\n formatMessage(\"Identification.validationAddress.genericError\"),\n ]);\n case \"InvalidAddress\":\n return fieldIssues.errors([\n props.submitInvalid\n ? formatMessage(\n \"Identification.validationAddress.probablyInvalidAddress\"\n )\n : formatMessage(\"Identification.validationAddress.invalidAddress\"),\n ]);\n }\n };\n\n const addressValidator: Validator = (address: AddressWrite) =>\n pipe(\n addressValidate({ address }),\n taskEither.bimap(\n error => {\n if (error.id) {\n if (props.submitInvalid && error.id === \"InvalidAddress\") {\n setSkipValidation(true);\n }\n return formatError({\n id: error.id,\n });\n }\n if (error.addresses) {\n setSuggestions(option.some(error.addresses));\n return formatError({\n id: \"InvalidAddress\",\n });\n }\n return formatError(genericError);\n },\n ({ zipCode }) => ({\n ...address,\n zipCode: option.isSome(zipCode)\n ? zipCode\n : pipe(\n address.zipCode,\n either.fromOption(constUndefined),\n either.map(zipCode => zipCode.trim()),\n either.chainW(NonEmptyString.decode),\n // either.orElse(() => NonEmptyString.decode(zipCode)),\n option.fromEither\n ),\n })\n )\n );\n\n const defaultCountryCode = useDefaultCountryCode();\n\n const initialValues: AddressFormState = useMemo(\n () =>\n pipe(\n props.initialValues,\n option.fold(\n constant({\n streetName: \"\",\n city: \"\",\n provinceName: \"\",\n country: defaultCountryCode,\n streetNumber: \"\",\n zipCode: \"\",\n confirmed: false as boolean,\n }),\n initialValues => {\n return {\n ...initialValues,\n city: getCitySuggestionLabel({\n cityName: unsafeLocalizedString(initialValues.city),\n provinceName: unsafeLocalizedString(initialValues.provinceName),\n }),\n confirmed: initialValues.confirmed,\n };\n }\n )\n ),\n [props.initialValues]\n );\n\n const { nonBlankString, latinCharactersOnly, digitsOnly } = useValidators();\n\n const checkOptionalityAndValidate = (validator: Validator) => {\n if (props.optionalFields) {\n return validators.validateIfNonEmpty(validator);\n } else return validators.inSequence(nonBlankString, validator);\n };\n const workAroundAlwaysRightValidator = () =>\n validators.fromPredicate(constTrue, formatMessage(\"GenericError\"));\n\n const {\n values: formState,\n setValues: setFormState,\n fieldProps,\n handleSubmit,\n formErrors,\n } = useForm(\n {\n initialValues,\n fieldValidators: ({ zipCode, city }) => ({\n streetName: skipValidation\n ? undefined\n : checkOptionalityAndValidate(latinCharactersOnly),\n streetNumber: skipValidation\n ? undefined\n : checkOptionalityAndValidate(\n validators.inSequence(\n nonBlankString,\n flow(\n validateStreetNumberRegex,\n validators.defined(\n formatMessage(\"Form.fieldError.invalidStreetNumber\")\n )\n )\n )\n ),\n city: skipValidation\n ? flow(\n city => splitSearchTerm(city ? city : \"\"),\n option.map(splits =>\n splits.provinceName\n ? splits\n : {\n city: splits.city,\n provinceName: \"\",\n }\n ),\n option.getOrElse(() => ({\n city: city,\n provinceName: \"\",\n })),\n workAroundAlwaysRightValidator<{\n city: string;\n provinceName: string;\n }>()\n )\n : checkOptionalityAndValidate(\n validators.inSequence(\n latinCharactersOnly,\n flow(\n splitSearchTerm,\n validators.defined(\n formatMessage(\n \"Identification.validationAddress.invalidCityFormatError\"\n )\n )\n )\n )\n ),\n zipCode: skipValidation\n ? undefined\n : zipCode\n ? validators.inSequence(\n validators.nonBlankString(\n formatMessage(\"Form.fieldError.digitsOnly\")\n ),\n digitsOnly\n )\n : undefined,\n confirmed: validateConfirmation\n ? validators.checked(\n formatMessage(\n \"Identification.permamentAddress.confirmation.needed\"\n )\n )\n : undefined,\n }),\n },\n {\n onSubmit: addressFields => {\n const address: AddressWrite = {\n ...addressFields,\n zipCode: pipe(\n addressFields.zipCode,\n NonEmptyString.decode,\n option.fromEither\n ),\n streetName: pipe(\n addressFields.streetName,\n NonEmptyString.decode,\n option.fromEither\n ),\n streetNumber: pipe(\n addressFields.streetNumber,\n NonEmptyString.decode,\n option.fromEither\n ),\n city: pipe(\n addressFields.city.city,\n NonEmptyString.decode,\n option.fromEither\n ),\n provinceName: pipe(\n addressFields.city.provinceName,\n NonEmptyString.decode,\n option.fromEither\n ),\n };\n return pipe(\n (!props.submitInvalid || !skipValidation) &&\n !manualSkipValidation &&\n !skipValidation,\n boolean.fold(\n () => taskEither.right(address),\n () => addressValidator(address)\n ),\n taskEither.mapLeft(err => {\n return err;\n }),\n taskEither.chain(props.onValidate),\n taskEither.chainFirst(\n flow(\n props.onSubmit,\n taskEither.mapLeft(constant(formatError(genericError)))\n )\n ),\n taskEither.chain(validatedAddress =>\n taskEither.fromIO((): unknown =>\n fieldProps(\"zipCode\").onChange(\n pipe(validatedAddress.zipCode, option.getOrElse(constant(\"\")))\n )\n )\n )\n );\n },\n }\n );\n\n const noSuggestions = taskEither.right(option.none);\n\n const fetchstreetSuggestions = useCommand(\n identificationApi.streetSuggestions,\n {\n skipTracking: true,\n }\n );\n\n const fetchCitySuggestions = useCommand(identificationApi.citySuggestions, {\n skipTracking: true,\n });\n const cityAndProvince = splitSearchTerm(formState.city);\n\n const streetQueryTerms = useDebounceState(formState.streetName, 500);\n const streetSuggestions = useRemoteData(\n useMemo(\n () =>\n !skipValidation && streetQueryTerms.length >= 2\n ? pipe(\n fetchstreetSuggestions(\n pipe(\n cityAndProvince,\n option.fold(\n () => ({\n streetName: streetQueryTerms,\n zipCode: formState.zipCode,\n cityName: formState.city,\n provinceName: \"\",\n country: formState.country,\n }),\n cityAndProvince => ({\n streetName: streetQueryTerms,\n zipCode: formState.zipCode,\n cityName: cityAndProvince.city,\n provinceName: cityAndProvince.provinceName,\n country: formState.country,\n })\n )\n )\n ),\n taskEither.map(option.some)\n )\n : noSuggestions,\n [streetQueryTerms]\n )\n );\n\n const cityQueryTerms = useDebounceState(formState.city, 500);\n const citySuggestions = useRemoteData(\n useMemo(\n () =>\n !skipValidation && cityQueryTerms.length >= 2\n ? pipe(\n fetchCitySuggestions({\n searchTerm: cityQueryTerms.replace(/^.*,\\s*/, \"\"),\n country: formState.country,\n }),\n taskEither.map(option.some)\n )\n : noSuggestions,\n [cityQueryTerms]\n )\n );\n\n useEffect(() => {\n const skipValidate =\n isForeign_(formState.country as AllSupportedCitizenships) &&\n !props.forceValidateForForeign;\n if (skipValidation !== skipValidate) {\n setSkipValidation(skipValidate);\n }\n }, [formState]);\n\n useEffect(() => {\n if (manualSkipValidation) {\n pipe(\n ignoreAddressValidation(),\n taskEither.map(() => {\n handleSubmit();\n })\n )();\n }\n }, [manualSkipValidation]);\n\n const readonlyFalse = false;\n return (\n <>\n {pipe(\n suggestions,\n option.fold(\n () => (\n (\n []\n )\n )\n )\n ),\n suggestion => ({\n value: suggestion,\n label: unsafeLocalizedString(suggestion.streetName),\n })\n ),\n onSelect: ({ value }) =>\n setFormState({\n streetName: value.streetName,\n }),\n }}\n citiesSuggestions={{\n status: autocompleteInputStatusFromRemoteData(\n pipe(\n citySuggestions,\n remoteData.map(\n option.getOrElse(\n constant([])\n )\n )\n ),\n suggestion => ({\n value: suggestion,\n label: getCitySuggestionLabel(suggestion),\n })\n ),\n onSelect: suggestion => {\n setFormState({\n city: getCitySuggestionLabel(suggestion.value),\n zipCode: \"\",\n });\n },\n }}\n hint={props.hint}\n errors={formErrors}\n cancelButton={\n props.onCancel && {\n action: props.onCancel,\n label: formatMessage(\"Identification.address.cancel\"),\n }\n }\n submitButton={{\n action: handleSubmit,\n label: skipValidation\n ? formatMessage(\"Identification.address.saveInvalid\")\n : formatMessage(\"Identification.address.save\"),\n }}\n lockCountryEdit={props.lockCountryEdit}\n />\n ),\n suggestions => (\n \n )\n )\n )}\n \n );\n}\n","import { ComputedFieldProps } from \"design-system\";\nimport { useFormatMessage } from \"../../intl\";\nimport { addressWriteToDropdownOption } from \"../addressFormUtils\";\nimport { pipe } from \"fp-ts/function\";\nimport { option } from \"fp-ts\";\nimport { DropdownField } from \"../../Common/DropdownField/DropdownField\";\nimport { AddressWrite } from \"../domain\";\nimport { Option } from \"fp-ts/Option\";\n\ntype Props = ComputedFieldProps> & {\n addresses: Array;\n};\n\nexport function AddressSuggestionsDropdown(props: Props) {\n const formatMessage = useFormatMessage();\n\n return (\n {\n if (option.isSome(value)) {\n props.onChange(option.some(value.value.value));\n }\n }}\n label={formatMessage(\"Identification.address.address\")}\n placeholder={formatMessage(\"Identification.address.address\")}\n options={props.addresses.map(addressWriteToDropdownOption)}\n searchable\n clearable={false}\n />\n );\n}\n","import { CountryCode } from \"../../globalDomain\";\nimport {\n ComputedFieldProps,\n InlineMessage,\n LocalizedString,\n ReadOnlyField,\n} from \"design-system\";\n\nimport { useFormatMessage } from \"../../intl\";\nimport { mapCountriesToOptions } from \"../addressFormUtils\";\nimport { pipe, constant, identity } from \"fp-ts/function\";\nimport { array, option } from \"fp-ts\";\nimport { useQuery } from \"../../useAPI\";\nimport * as remoteData from \"../../RemoteData\";\nimport * as identificationApi from \"../api\";\nimport { DropdownField } from \"../../Common/DropdownField/DropdownField\";\nimport { ComponentProps } from \"react\";\n\ntype Props =\n | ({\n readOnly: false;\n supportForeign: boolean;\n lockCzSk: boolean;\n } & ComputedFieldProps)\n | {\n readOnly: true;\n value: CountryCode;\n lockCzSk: boolean;\n feedback?: {\n type: ComponentProps[\"type\"];\n message: LocalizedString;\n };\n };\n\nexport function CountryDropdown(props: Props) {\n const formatMessage = useFormatMessage();\n\n const countries = pipe(\n useQuery(\n props.lockCzSk\n ? identificationApi.countries\n : props.readOnly\n ? identificationApi.allCountries\n : props.supportForeign\n ? identificationApi.allForeignSupportedCountries\n : identificationApi.countries\n ),\n ([result]) => result,\n remoteData.fold(constant([]), constant([]), identity)\n );\n\n const options = mapCountriesToOptions(countries);\n\n return props.readOnly ? (\n c.countryCode === props.value),\n option.map(c => c.label),\n option.getOrElse(constant(\"\"))\n )}\n label={formatMessage(\"Identification.address.country\")}\n feedback={props.feedback}\n />\n ) : (\n o.value === props.value)\n )}\n onChange={value => {\n if (option.isSome(value)) {\n props.onChange(value.value.value);\n }\n }}\n label={formatMessage(\"Identification.address.country\")}\n placeholder={formatMessage(\"Identification.address.country\")}\n options={options}\n searchable\n clearable={false}\n />\n );\n}\n","import { DropdownOption, unsafeLocalizedString } from \"design-system\";\nimport { pipe } from \"fp-ts/function\";\nimport { array, option } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport titlesAfterBefore from \"./titleAfterBefore.json\";\nimport { useAppContext } from \"../../../useAppContext\";\n\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport {\n DropdownField,\n DropdownFieldProps,\n} from \"../../../Common/DropdownField/DropdownField\";\n\ntype Props = Omit<\n DropdownFieldProps,\n \"options\" | \"value\" | \"onChange\" | \"searchable\"\n> & {\n type: \"After\" | \"Before\";\n value: Option;\n onChange: (titleAfter: Option) => unknown;\n};\n\nexport function TitleDropdown(props: Props) {\n const {\n apiParameters: { tenant },\n } = useAppContext();\n\n const titlesList = titlesAfterBefore[props.type][tenant];\n const options = titlesList.map(title => ({\n value: title as NonEmptyString,\n label: unsafeLocalizedString(title),\n }));\n\n const value = pipe(\n props.value,\n option.chain(value =>\n pipe(\n options,\n array.findFirst(o => o.value === value)\n )\n )\n );\n\n const onChange = (value: Option>) => {\n props.onChange(\n pipe(\n value,\n option.map(v => v.value)\n )\n );\n };\n\n return (\n \n );\n}\n","import { useState } from \"react\";\nimport { useFormatMessage } from \"../intl\";\nimport {\n Banner,\n Body,\n Box,\n FlowAccordion,\n Heading,\n NonNegativeInteger,\n Space,\n Stack,\n useIsMobileLayout,\n} from \"design-system\";\nimport { AdditionalAddresses } from \"./Addresses/AdditionalAddresses\";\nimport { PermanentAddress } from \"./PermanentAddress/PermanentAddress\";\nimport { UploadDocuments } from \"../UploadDocuments/UploadDocuments\";\nimport { array, boolean, nonEmptyArray, option, taskEither } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport { ConfirmClientData } from \"./ClientData/ConfirmClientData\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport {\n constant,\n constFalse,\n constNull,\n constTrue,\n constVoid,\n flow,\n pipe,\n} from \"fp-ts/function\";\nimport {\n CoApplicantInput,\n DocumentIdentificationFlow,\n foldTenant,\n genericError,\n GenericError,\n UploadDocumentFlowType,\n useCheckTenant,\n} from \"../globalDomain\";\nimport * as uploadDocumentApi from \"../UploadDocuments/api\";\nimport { useCommand } from \"../useAPI\";\nimport {\n ClientExistencyCheckData,\n ClientExistencyCheckDataPartial,\n ClientExistencyCommand,\n convertToCheckDataBn,\n} from \"../UploadDocuments/clientExistenceUtils\";\nimport { CheckClientDataResult } from \"../UploadDocuments/useCheckClientDataResult\";\nimport {\n ClientDataOutput,\n PersonalInfoEditError,\n PersonalInfoEditInput,\n PersonalInfoSubmitInput,\n ResidencySubmitInput,\n} from \"./api\";\nimport { useParentSharedReducer } from \"../BranchExperience/useSharedReducer\";\nimport {\n confirmAdditionalAddressessAction,\n confirmAdditionalDocumentsAction,\n confirmDataAction,\n confirmPermanentAddressAction,\n confirmSelfieAction,\n confirmUploadedDocumentsAction,\n foldState,\n reducerConfig,\n removeUploadedDocumentsAction,\n setActiveItemAction,\n setBiometricConsentAction,\n setConfirmDataStepAction,\n setShowGdprConsentAction,\n uploadAgainAction,\n} from \"./state\";\nimport { useAppContext } from \"../useAppContext\";\nimport { BankerOPUAndCEXCard } from \"./BankerOPUAndCEXCard/BankerOPUAndCEXCard\";\nimport { SelfieCheck } from \"./SelfieCheck/SelfieCheck\";\nimport { palette } from \"design-system/lib/styleConstants\";\nimport {\n AllSupportedCitizenships,\n PersonalInfoError,\n PersonalProfileDocUploadSubmitError,\n} from \"./domain\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { foldCitizenship } from \"../ClientProfile/utils\";\nimport {\n FlowAccordionItem,\n FlowAccordionMacro,\n} from \"../Common/Stepper/FlowAccordion/FlowAccordionMacro\";\nimport * as ukontoApi from \"../UKontoSecondPart/api\";\nimport { RestoreApplicationData } from \"../UKontoSecondPart/api\";\nimport { mergeExtractDataDocumentsOutput } from \"../UploadDocuments/utils\";\nimport { useScrollTopOnChange } from \"../Common/useScrollTopOnChange\";\nimport { selectedMainApplicant } from \"../MortgageDashboard/mortgageDashboardUtils\";\nimport { sequenceS } from \"fp-ts/Apply\";\nimport { AdditionalDocuments } from \"./AdditionalDocument/AdditionalDocuments\";\nimport { GDPR } from \"../GDPR/GDPR\";\nimport { useBranchExperienceContext } from \"../BranchExperience/BranchExperienceContext\";\nimport { DocumentDigitalId } from \"../UploadDocuments/DocumentDigitalId\";\nimport { BranchExperienceParentSwitch } from \"../BranchExperience/BranchExperienceParentSwitch\";\n\ntype Props = {\n onExit?: (action: Option<() => unknown>) => unknown;\n onComplete: (\n clientExistencyCheckData: Option\n ) => TaskEither;\n onFailure: (\n reason: \"GenericError\" | \"MaxAttemptsReached\" | \"ValidationError\"\n ) => unknown;\n onShouldClientContinue: Option<\n (\n clientExists: boolean,\n duplicateContacts: boolean,\n hasBlockingNotes: boolean,\n personalNumberMatch: boolean,\n userID: Option,\n clientNumber: Option\n ) => TaskEither\n >;\n documentIdentificationFlow: DocumentIdentificationFlow;\n excludeAdditionalAddress?: boolean;\n hideBiometricConsent?: boolean;\n extractData: TaskEither;\n rejectData: TaskEither;\n isExistingClient?: boolean;\n clientExistencyCommand: ClientExistencyCommand;\n checkOpuAndCex?: boolean;\n submitConfirmedDataCommand: ReaderTaskEither<\n PersonalInfoSubmitInput,\n PersonalProfileDocUploadSubmitError | PersonalInfoError | GenericError,\n unknown\n >;\n editPersonalInfoCommand: ReaderTaskEither<\n PersonalInfoEditInput,\n PersonalInfoEditError | GenericError,\n unknown\n >;\n submitResidencyCommand: ReaderTaskEither<\n ResidencySubmitInput,\n unknown,\n unknown\n >;\n documentsMismatch: boolean;\n onMismatchDialogDismiss: () => unknown;\n showMismatchDialog: () => unknown;\n noGoBack?: boolean;\n onReset: () => unknown;\n forceMobileRecipientSelection?: boolean;\n productType: Option;\n isThirdParty?: boolean;\n restoredData?: RestoreApplicationData;\n resetUpload?: TaskEither;\n foreignSupported?: boolean;\n isUkonto?: boolean;\n disableDigitalId?: boolean;\n} & CoApplicantInput;\n\nexport function IdUpload(props: Props) {\n const formatMessage = useFormatMessage();\n const uploadToServer = useCommand(uploadDocumentApi.uploadDocument);\n const saveApplication = useCommand(ukontoApi.saveWithParams);\n const resetAfterScannerCancel = useCommand(\n uploadDocumentApi.resetUploadDocument\n );\n\n const {\n apiParameters: { tenant, channel },\n config: {\n useNewMobileIdUploadUx: newMobileIdUpload,\n localBirthNumberEnabled,\n },\n } = useAppContext();\n\n const {\n config: { OPUCEXAssignmentEnabled, enableDigitalId },\n } = useAppContext();\n\n const checkTenant = useCheckTenant();\n\n useScrollTopOnChange(\"auto\");\n\n const [extractedData, setExtractedData] = useState<\n Option\n >(\n props.restoredData &&\n (props.restoredData.feStep === \"PERSONAL_DATA_CONFIRMATION\" ||\n props.restoredData.feStep === \"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\" ||\n props.restoredData.feStep === \"PERMANENT_ADDRESS\" ||\n props.restoredData.feStep === \"PROOF_OF_ADDRESS\" ||\n props.restoredData.feStep === \"ADDITIONAL_ADDRESS\")\n ? getRestoreData(props.restoredData.extractDataResult)\n : option.none\n );\n\n const [uploadIdKey, setUploadIdKey] = useState(0);\n\n const [uploadReset, setUploadReset] = useState(false);\n\n const [isSubmitResidency, setIsSubmitResidency] = useState(0);\n\n const [previousBiometricConsent, setPreviousBiometricConsent] = useState<\n Option\n >(option.none);\n const [clientExistencyCheckData, setClientExistencyCheckData] = useState<\n Option\n >(\n props.restoredData &&\n option.isSome(props.restoredData.extractDataResult) &&\n option.isSome(props.restoredData.extractDataResult.value.primary)\n ? option.some({\n name: (option.isSome(\n props.restoredData.extractDataResult.value.primary.value\n .personalData.name\n )\n ? props.restoredData.extractDataResult.value.primary.value\n .personalData.name.value\n : \"NA\") as NonEmptyString,\n surname: (option.isSome(\n props.restoredData.extractDataResult.value.primary.value\n .personalData.surname\n )\n ? props.restoredData.extractDataResult.value.primary.value\n .personalData.surname.value\n : \"NA\") as NonEmptyString,\n dateOfBirth: option.isSome(\n props.restoredData.extractDataResult.value.primary.value\n .personalData.dateOfBirth\n )\n ? props.restoredData.extractDataResult.value.primary.value\n .personalData.dateOfBirth.value\n : new Date(),\n birthNumber: option.some(\n (option.isSome(\n props.restoredData.extractDataResult.value.primary.value\n .personalData.birthNumber\n )\n ? props.restoredData.extractDataResult.value.primary.value\n .personalData.birthNumber.value\n : \"\") as NonEmptyString\n ),\n citizenship: (option.isSome(\n props.restoredData.extractDataResult.value.primary.value\n .personalData.citizenship\n )\n ? props.restoredData.extractDataResult.value.primary.value\n .personalData.citizenship.value\n : \"OTHER\") as AllSupportedCitizenships,\n applicantIndex: 0 as NonNegativeInteger,\n })\n : option.none\n );\n const [opuAndCexLoaded, setOpuAndCexLoaded] = useState(false);\n const [opuAndCexValid, setOpuAndCexValid] = useState(\n !(OPUCEXAssignmentEnabled && props.checkOpuAndCex)\n );\n const [showOpuAndCexError, setShowOpuAndCexError] = useState(false);\n const [disableAccordionNavigation, setDisableAccordionNavigation] = useState(\n false\n );\n\n const [showGdprDialog, setShowGdprDialog] = useState(false);\n const [type, setType] = useState<\"upload\" | \"digital\">(\"upload\");\n\n const isWaitingForOpuAndCex = !!(\n OPUCEXAssignmentEnabled &&\n props.checkOpuAndCex &&\n !opuAndCexLoaded\n );\n\n const hasResidency = pipe(\n props.restoredData,\n option.fromNullable,\n option.map(data => data.residency),\n option.flatten\n );\n\n const [isResident, setIsResident] = useState(\n pipe(\n hasResidency,\n option.fold(\n () => true,\n value => value\n )\n )\n );\n\n const resetUploadDocumentStep = () => setUploadIdKey(k => k + 1);\n\n const onComplete = (\n clientExistencyCheckData: Option\n ) => {\n if (opuAndCexValid) {\n return props.onComplete(clientExistencyCheckData);\n } else {\n return pipe(\n taskEither.left(\"OPU_CEX_INCOMPLETE\"),\n taskEither.mapLeft(() => {\n setShowOpuAndCexError(true);\n window.scrollTo({\n top: document.body.scrollHeight,\n behavior: \"smooth\",\n });\n })\n );\n }\n };\n\n const isPersonalProfile = pipe(\n props.productType,\n option.exists(item => item === \"PersonalProfile\")\n );\n\n const isLocalClient = (data: CheckClientDataResult) =>\n pipe(\n data.personalData.citizenship,\n option.map(\n foldCitizenship({\n CZE: () => checkTenant({ CZ: constTrue }),\n SVK: () => checkTenant({ SK: constTrue }),\n OTHER: constFalse,\n })\n ),\n option.getOrElse(constFalse)\n );\n\n const hasPermanentAddressStep = pipe(\n extractedData,\n option.fold(constFalse, data => {\n return (\n (!isPersonalProfile &&\n !props.isExistingClient &&\n option.isNone(data.permanentAddress) &&\n props.documentIdentificationFlow !== \"Secondary\") ||\n (!isPersonalProfile && !isLocalClient(data))\n );\n })\n );\n\n const hasAdditionalDocumentsStep = pipe(\n extractedData,\n option.fold(constFalse, data => {\n return !isLocalClient(data) && !isResident;\n })\n );\n\n const hasSelfieCheckStep = pipe(\n extractedData,\n option.fold(constFalse, data =>\n pipe(\n data.fraudCheck,\n option.exists(fraudCheck => fraudCheck === \"SelfieFraudCheck\")\n )\n )\n );\n\n const [state, dispatch] = useParentSharedReducer(\n reducerConfig,\n props.restoredData && !props.restoredData.restartDocumentsUpload\n ? props.restoredData.feStep === \"PERSONAL_DATA_CONFIRMATION\"\n ? {\n id: \"ConfirmData\",\n biometricConsent: props.restoredData.biometricConsent,\n activeIndex: option.some(1),\n }\n : props.restoredData.feStep === \"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\"\n ? {\n id: \"AdditionalDocuments\",\n biometricConsent: props.restoredData.biometricConsent,\n activeIndex: option.some(2),\n }\n : props.restoredData.feStep === \"PERMANENT_ADDRESS\" ||\n props.restoredData.feStep === \"PROOF_OF_ADDRESS\"\n ? {\n id: \"PermanentAddress\",\n biometricConsent: props.restoredData.biometricConsent,\n activeIndex: option.some(hasAdditionalDocumentsStep ? 3 : 2),\n }\n : props.restoredData.feStep === \"ADDITIONAL_ADDRESS\"\n ? {\n id: \"AdditionalAddresses\",\n biometricConsent: props.restoredData.biometricConsent,\n activeIndex: option.some(\n hasPermanentAddressStep && hasAdditionalDocumentsStep\n ? 4\n : hasPermanentAddressStep || hasAdditionalDocumentsStep\n ? 3\n : 2\n ),\n }\n : {\n id: \"UploadDocuments\",\n biometricConsent: props.restoredData.biometricConsent,\n activeIndex: option.some(0),\n }\n : {\n id: \"UploadDocuments\",\n biometricConsent: option.none,\n activeIndex: option.some(0),\n }\n );\n const { branchExperienceFeaturesActive } = useBranchExperienceContext();\n\n const onOpuAndCexComplete = (cexCodeOption: Option) => {\n setOpuAndCexLoaded(true);\n pipe(\n cexCodeOption,\n option.fold(\n () => {\n setOpuAndCexValid(false);\n },\n () => {\n setOpuAndCexValid(true);\n setShowOpuAndCexError(false);\n }\n )\n );\n };\n\n const digitalIdEnabled =\n checkTenant({ CZ: constTrue }) &&\n enableDigitalId &&\n !props.disableDigitalId &&\n channel === \"Branch_InPerson\";\n\n const isMobileLayout = useIsMobileLayout();\n const useNewMobileUx = isMobileLayout && newMobileIdUpload;\n const uploadDocumentsStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.UploadDocuments.step1.title\"),\n hideTitle: useNewMobileUx,\n content: ({ resetNextSteps }) => {\n return (\n \n {!isMobileLayout && (\n \n {formatMessage(\"Identification.upload.stepDescription\")}\n \n )}\n {type === \"upload\" && (\n {\n setExtractedData(option.some(data));\n dispatch(confirmUploadedDocumentsAction(hasSelfieCheckStep));\n }}\n onRemove={() => {\n setClientExistencyCheckData(option.none);\n dispatch(removeUploadedDocumentsAction);\n resetNextSteps();\n if (props.resetUpload) {\n props.resetUpload();\n }\n setUploadReset(true);\n }}\n onUploadAgain={props.rejectData}\n onFailure={props.onFailure}\n coApplicant={props.coApplicant}\n biometricConsent={{\n consent: state.biometricConsent,\n previousConsent: previousBiometricConsent,\n }}\n hideBiometricConsent={props.hideBiometricConsent}\n setBiometricConsent={biometricConsent => {\n pipe(\n biometricConsent.consent,\n option.map(flow(setBiometricConsentAction, dispatch))\n );\n setPreviousBiometricConsent(biometricConsent.previousConsent);\n }}\n documentIdentificationFlow={props.documentIdentificationFlow}\n uploadCommand={uploadToServer}\n resetAfterScannerCancel={resetAfterScannerCancel(\n pipe(\n props.coApplicant,\n option.map(coApplicant => ({\n applicantIndex: coApplicant.index,\n }))\n )\n )}\n extractCommand={props.extractData}\n forceMobileRecipientSelection={\n props.forceMobileRecipientSelection\n }\n allowCopyIdDocumentAgreementEdit={foldState(state, {\n whenUploadDocuments: constTrue,\n whenConfirmData: constFalse,\n whenAdditionalDocuments: constFalse,\n whenPermanentAddress: constFalse,\n whenAdditionalAddresses: constFalse,\n whenCompleted: constFalse,\n whenConfirmSelfie: constFalse,\n whenSelfieCheck: constFalse,\n })}\n restoredData={props.restoredData}\n supportForeign={props.foreignSupported}\n isUploadAgain={uploadIdKey > 0}\n />\n )}\n {type === \"digital\" && (\n \n {\n setExtractedData(option.some(data));\n dispatch(confirmUploadedDocumentsAction(hasSelfieCheckStep));\n }}\n key={uploadIdKey}\n coApplicant={props.coApplicant}\n biometricConsent={{\n consent: state.biometricConsent,\n previousConsent: previousBiometricConsent,\n }}\n setBiometricConsent={biometricConsent => {\n pipe(\n biometricConsent.consent,\n option.map(flow(setBiometricConsentAction, dispatch))\n );\n setPreviousBiometricConsent(biometricConsent.previousConsent);\n }}\n />\n \n )}\n \n );\n },\n };\n\n const confirmDataStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.personalData.completeAndConfirm\"),\n content: ({ move, resetNextSteps }) => {\n return pipe(\n extractedData,\n option.map(extractedData => (\n {\n if (state.id !== \"ConfirmData\") {\n dispatch(setConfirmDataStepAction);\n resetNextSteps();\n }\n }}\n onContinue={clientExistencyCheckData =>\n pipe(\n taskEither.fromIO(() => {\n setClientExistencyCheckData(clientExistencyCheckData);\n }),\n taskEither.chain(() => {\n if (\n !hasPermanentAddressStep &&\n !hasAdditionalDocumentsStep &&\n props.excludeAdditionalAddress\n ) {\n return pipe(\n clientExistencyCheckData,\n convertToCheckDataBn,\n onComplete\n );\n }\n return taskEither.right(undefined);\n }),\n taskEither.chain(() =>\n taskEither.fromIO(() =>\n dispatch(\n confirmDataAction(\n hasPermanentAddressStep,\n !props.excludeAdditionalAddress,\n hasAdditionalDocumentsStep\n )\n )\n )\n )\n )\n }\n onUploadAgain={pipe(\n props.rejectData,\n taskEither.chain(() =>\n taskEither.fromIO(() => {\n dispatch(uploadAgainAction);\n resetUploadDocumentStep();\n move(0, true);\n })\n )\n )}\n onAbort={props.onFailure}\n onShouldClientContinue={props.onShouldClientContinue}\n coApplicant={props.coApplicant}\n isWaitingForOpuAndCex={\n props.excludeAdditionalAddress &&\n checkIfInLastFlowStep() &&\n isWaitingForOpuAndCex\n }\n banner={(() => (\n <>\n {extractedData.showWarning ? (\n \n ) : undefined}\n {state.id === \"AdditionalAddresses\" ||\n state.id === \"PermanentAddress\" ? (\n \n ) : undefined}\n \n ))()}\n submitDataCommand={props.submitConfirmedDataCommand}\n documentsMismatch={props.documentsMismatch}\n onMismatchDialogDismiss={props.onMismatchDialogDismiss}\n showMismatchDialog={props.showMismatchDialog}\n noGoBack={props.noGoBack}\n onReset={props.onReset}\n editPersonalInfoCommand={props.editPersonalInfoCommand}\n hasParentPadding={!isPersonalProfile}\n supportForeign={props.foreignSupported === true}\n submitResidencyCommand={residency => {\n setIsSubmitResidency(residency.residency ? 2 : 1);\n return props.submitResidencyCommand(residency);\n }}\n hasResidency={hasResidency}\n onResidencyChange={value => {\n resetNextSteps();\n pipe(\n value,\n option.fold(\n () => setIsResident(false),\n value => setIsResident(value)\n )\n );\n }}\n />\n )),\n option.toNullable\n );\n },\n };\n\n const SelfieCheckStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.selfieCheck\"),\n content: ({ move }) =>\n pipe(\n extractedData,\n option.fold(constNull, document => (\n \n taskEither.fromIO(() => {\n dispatch(uploadAgainAction);\n resetUploadDocumentStep();\n move(0, true);\n })\n )\n )}\n resetProcess={() => move(0, true)}\n onContinue={() => {\n dispatch(confirmSelfieAction);\n }}\n onFailure={props.onFailure}\n />\n ))\n ),\n };\n\n const additionalDocumentsStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.additionalDocument.title\"),\n content: ({ resetNextSteps }) => (\n \n saveApplication({\n feStep: option.some(\n hasPermanentAddressStep\n ? \"PERMANENT_ADDRESS\"\n : \"ADDITIONAL_ADDRESS\"\n ),\n status: option.some(\"IN_PROGRESS\"),\n incomeInfo: option.none,\n transactionsInfo: option.none,\n })()\n ),\n taskEither.chain(() =>\n taskEither.fromIO(() =>\n dispatch(\n confirmAdditionalDocumentsAction(\n hasPermanentAddressStep,\n !props.excludeAdditionalAddress\n )\n )\n )\n )\n )}\n onFailure={() => props.onFailure(\"GenericError\")}\n coApplicant={props.coApplicant}\n disabled={false}\n onRemoveLastDoc={() => resetNextSteps()}\n restoredData={props.restoredData}\n />\n ),\n };\n\n const permanentAddressStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.permanentAddress.stepTitle\"),\n content: () => {\n return pipe(\n extractedData,\n option.fold(constNull, document => {\n const isNotCzSk = pipe(\n document.personalData.citizenship,\n option.fold(\n () => false,\n citizenship => citizenship !== \"SVK\" && citizenship !== \"CZE\"\n )\n );\n return (\n \n foldTenant(\n tenant,\n constant(localBirthNumberEnabled),\n constFalse\n ),\n SVK: () =>\n foldTenant(\n tenant,\n constFalse,\n constant(localBirthNumberEnabled)\n ),\n OTHER: () => true,\n })\n ),\n option.getOrElseW(() => false)\n )}\n isForeign={!isLocalClient(document)}\n next={personalNumber => {\n const bn = option.isSome(personalNumber)\n ? personalNumber.value\n : undefined;\n let clientExistency = clientExistencyCheckData;\n\n if (isNotCzSk) {\n return pipe(\n Boolean(props.excludeAdditionalAddress),\n boolean.fold(\n () => {\n if (bn && option.isSome(clientExistencyCheckData)) {\n clientExistency = option.some({\n ...clientExistencyCheckData.value,\n birthNumber: option.some(bn),\n });\n setClientExistencyCheckData(clientExistency);\n }\n return taskEither.right(undefined);\n },\n () =>\n pipe(\n personalNumber,\n option.fold(\n () =>\n onComplete(\n convertToCheckDataBn(clientExistencyCheckData)\n ),\n personalNumber =>\n onComplete(\n convertToCheckDataBn(\n clientExistencyCheckData,\n personalNumber\n )\n )\n )\n )\n ),\n taskEither.chain(() =>\n taskEither.fromIO(() =>\n dispatch(\n confirmPermanentAddressAction(\n !props.excludeAdditionalAddress\n )\n )\n )\n )\n );\n }\n\n if (bn) {\n if (option.isSome(clientExistencyCheckData)) {\n clientExistency = option.some({\n ...clientExistencyCheckData.value,\n birthNumber: option.some(bn),\n });\n setClientExistencyCheckData(clientExistency);\n } else if (option.isSome(extractedData)) {\n pipe(\n extractedData,\n option.fold(constVoid, extractedData => {\n clientExistency = pipe(\n {\n dateOfBirth: extractedData.personalData.dateOfBirth,\n name: extractedData.personalData.name,\n surname: extractedData.personalData.surname,\n citizenship: extractedData.personalData.citizenship,\n },\n sequenceS(option.option),\n option.map(data => ({\n dateOfBirth: data.dateOfBirth,\n name: data.name,\n surname: data.surname,\n citizenship: data.citizenship as AllSupportedCitizenships,\n birthNumber: option.some(bn),\n applicantIndex: pipe(\n props.coApplicant,\n option.fold(\n () => selectedMainApplicant.index,\n i => i.index\n )\n ),\n }))\n );\n })\n );\n setClientExistencyCheckData(clientExistency);\n }\n }\n\n if (option.isNone(clientExistency)) {\n //should never happen\n return taskEither.left(genericError);\n }\n\n return pipe(\n Boolean(props.excludeAdditionalAddress),\n boolean.fold(\n () => taskEither.right(undefined),\n () =>\n pipe(convertToCheckDataBn(clientExistency), onComplete)\n ),\n taskEither.chain(() =>\n taskEither.fromIO(() =>\n dispatch(\n confirmPermanentAddressAction(\n !props.excludeAdditionalAddress\n )\n )\n )\n )\n );\n }}\n coApplicant={props.coApplicant}\n productType={props.productType}\n isUkonto={props.isUkonto}\n restoredData={props.restoredData}\n isUploadAgain={uploadIdKey > 0 || uploadReset}\n isWithResidency={() => {\n return isSubmitResidency !== 0\n ? isSubmitResidency === 2\n : pipe(\n hasResidency,\n option.fold(\n () => true,\n value => value\n )\n );\n }}\n />\n );\n })\n );\n },\n };\n\n const onContinueAdditionalAddress = pipe(\n clientExistencyCheckData,\n convertToCheckDataBn,\n onComplete,\n taskEither.chain(() =>\n taskEither.fromIO(() => dispatch(confirmAdditionalAddressessAction))\n )\n );\n\n const onContinueAdditionalAddressWithGdpr = pipe(\n foldTenant(\n tenant,\n () =>\n !props.isExistingClient\n ? taskEither.fromIO(() => {\n setShowGdprDialog(true);\n })\n : onContinueAdditionalAddress,\n () => onContinueAdditionalAddress\n )\n );\n\n const additionalAddressStep: FlowAccordionItem = {\n title: formatMessage(\"Identification.additionalAddresses\"),\n content: () => (\n \n setDisableAccordionNavigation(isEditing)\n }\n foreignSupport={props.foreignSupported}\n />\n ),\n };\n\n const items: NonEmptyArray = nonEmptyArray.concat(\n [uploadDocumentsStep],\n array.compact([\n pipe(SelfieCheckStep, option.fromPredicate(constant(hasSelfieCheckStep))),\n option.some(confirmDataStep),\n pipe(\n additionalDocumentsStep,\n option.fromPredicate(constant(hasAdditionalDocumentsStep))\n ),\n pipe(\n permanentAddressStep,\n option.fromPredicate(constant(hasPermanentAddressStep))\n ),\n pipe(\n additionalAddressStep,\n option.fromPredicate(constant(!props.excludeAdditionalAddress))\n ),\n ])\n );\n\n const checkIfInLastFlowStep = () =>\n pipe(\n state.activeIndex,\n option.getOrElse(constant(0)),\n flowIdx => flowIdx === items.length - 1\n );\n\n const isFromPersonalProfile = pipe(\n props.productType,\n option.exists(v => v === \"PersonalProfile\")\n );\n const flowAccordion =\n useNewMobileUx && isFromPersonalProfile ? (\n \n ) : (\n \n );\n return (\n \n {!isMobileLayout && (\n <>\n \n {formatMessage(\"Identification.UploadDocuments.mainContentTitle\")}\n \n \n \n )}\n {flowAccordion}\n {showGdprDialog && (\n props.onExit!(option.none)\n : () => {\n setShowGdprDialog(false);\n dispatch(setShowGdprConsentAction(false));\n }\n }\n onContinue={onContinueAdditionalAddress}\n onShareWithClient={\n branchExperienceFeaturesActive\n ? gdprData => dispatch(setShowGdprConsentAction(true, gdprData))\n : undefined\n }\n accepted={state.gdprAccepted}\n />\n )}\n {OPUCEXAssignmentEnabled &&\n props.checkOpuAndCex &&\n checkIfInLastFlowStep() ? (\n <>\n \n \n \n ) : null}\n \n );\n}\n\nfunction getRestoreData(\n extractData: Option\n): Option {\n return pipe(\n extractData,\n option.fold(\n () => option.none,\n data => {\n const documentPayload = mergeExtractDataDocumentsOutput(\n data.primary,\n data.secondary\n );\n const canUploadAgain = data.canUploadAgain;\n return pipe(\n documentPayload,\n option.fold(\n () => option.none,\n document => {\n switch (data.result) {\n case \"EditData\":\n return option.some({\n ...document,\n canUploadAgain,\n canEdit: true,\n showWarning: false,\n fraudCheck: option.none,\n });\n case \"EditDataWithWarning\":\n return option.some({\n ...document,\n canUploadAgain,\n canEdit: true,\n showWarning: true,\n fraudCheck: option.none,\n });\n case \"ContinueWithWarning\":\n return option.some({\n ...document,\n canUploadAgain,\n canEdit: false,\n showWarning: true,\n fraudCheck: option.none,\n });\n case \"Continue\":\n return option.some({\n ...document,\n canUploadAgain,\n canEdit: false,\n showWarning: false,\n fraudCheck: option.none,\n });\n case \"HologramFraudCheck\":\n case \"SelfieFraudCheck\":\n case \"HologramAndSelfieFraudCheck\":\n return option.some({\n ...document,\n canUploadAgain,\n canEdit: false,\n showWarning: false,\n fraudCheck: option.some(data.result),\n });\n case \"UploadAgain\":\n case \"Abort\":\n return option.none;\n }\n }\n )\n );\n }\n )\n );\n}\n","import {\n Box,\n DateField,\n Form,\n FormErrors,\n FormRow,\n FormSection,\n LocalizedString,\n ReadOnlyField,\n Space,\n TextField,\n useForm,\n ValidableDate,\n validableDate,\n validators,\n} from \"design-system\";\n\nimport {\n constant,\n constFalse,\n constTrue,\n constVoid,\n pipe,\n} from \"fp-ts/function\";\nimport { useFormatMessage } from \"../../intl\";\nimport { array, nonEmptyArray, option, task, taskEither } from \"fp-ts\";\nimport { Task } from \"fp-ts/Task\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { PersonalDocumentProofOfAddress } from \"../domain\";\nimport { CoApplicantInput } from \"../../globalDomain\";\nimport { Option } from \"fp-ts/Option\";\nimport { DocumentUploadField } from \"../../UploadDocuments/DocumentUploadField\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\n\nimport * as uploadApi from \"../api\";\nimport { useCommand } from \"../../useAPI\";\nimport { DocumentType, ScannedDocument } from \"../../UploadDocuments/domain\";\nimport { useValidators } from \"../../Common/useValidators\";\nimport { useEffect, useState } from \"react\";\nimport { base64FileSize } from \"./base64FileSize\";\nimport { ShareWithClientButton } from \"../../Common/ShareWithClientButton/ShareWithClientButton\";\nimport { RestoreApplicationData } from \"../../UKontoSecondPart/api\";\n\ntype Error = \"SizeExceeding\" | \"FailureUpload\";\n\ntype Props = {\n documentType: DocumentType;\n onSave: (\n proofOfAddress: PersonalDocumentProofOfAddress\n ) => TaskEither;\n error: Option;\n isEditingForm: boolean;\n disabled: boolean;\n sharedWithClient: boolean;\n onFormChange?: () => unknown;\n showLocalPersonalNumber: boolean;\n isForeign?: boolean;\n restoredData?: RestoreApplicationData;\n isUploadAgain?: boolean;\n} & CoApplicantInput;\n\nfunction _foldDocumentType(documentType: DocumentType) {\n return function (match: {\n whenIDCard: () => T;\n whenPassport: () => T;\n whenDrivingLicense: () => T;\n whenLongTermResidencePermit: () => T;\n whenPermanentResidencePermit: () => T;\n whenTemporaryResidencePermit: () => T;\n }) {\n switch (documentType) {\n case \"IDCard\":\n return match.whenIDCard();\n case \"Passport\":\n return match.whenPassport();\n case \"DrivingLicense\":\n return match.whenDrivingLicense();\n case \"LongTermResidencePermit\":\n return match.whenLongTermResidencePermit();\n case \"PermanentResidencePermit\":\n return match.whenPermanentResidencePermit();\n case \"TemporaryResidencePermit\":\n return match.whenTemporaryResidencePermit();\n }\n };\n}\n\nexport function ProofOfAddressForm(props: Props) {\n const formatMessage = useFormatMessage();\n const foldDocumentType = _foldDocumentType(\n props.isForeign === true ? \"Passport\" : props.documentType\n ); //the flow is same as for passport in this case\n\n const [error, setError] = useState>(option.none);\n const uploadDocument = useCommand(uploadApi.proofOfAddressDocumentSubmit);\n const removeDocument = useCommand(uploadApi.proofOfAddressDocumentRemove);\n\n const documentHasTwoSides = foldDocumentType({\n whenIDCard: constFalse,\n whenPassport: constTrue,\n whenDrivingLicense: constFalse,\n whenLongTermResidencePermit: constFalse,\n whenPermanentResidencePermit: constFalse,\n whenTemporaryResidencePermit: constFalse,\n });\n\n const { defined, validDate, maxLength } = useValidators();\n\n const minimumDate = new Date(\"01-01-1900\");\n const maxMB = 20000000;\n const showLocalPersonalNumber = props.showLocalPersonalNumber;\n /* localBirthNumberEnabled will be off for a while,\n see https://jira.internal.unicredit.eu/browse/SBL-122824?focusedCommentId=781742&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-781742\n Vodrazkova Lucie (UniCredit CZ&SK) added a comment\n Hi Tica Alexandru Mihai (UniCredit Services - AT),\n\n Apologies. I´ve just discussed this field with my colleague and It seems that It´s more complex and the decision some\n time ago was to hide this field on both Banker and client side and not to validate till some other parts of the solution will be resolved.\n May I kindly ask you to reverse this fix and hide the field on both banker and client side?\n*/\n\n const { handleSubmit, fieldProps, values } = useForm(\n {\n initialValues:\n props.restoredData && !props.isUploadAgain\n ? option.isSome(props.restoredData.proofOfAddress)\n ? {\n idNumber: option.isSome(\n props.restoredData.proofOfAddress.value.idNumber\n )\n ? props.restoredData.proofOfAddress.value.idNumber.value\n : \"\",\n dateOfIssuing: option.some(\n validableDate.fromDate(\n props.restoredData.proofOfAddress.value.dateOfIssuing\n )\n ),\n validUntil: (option.isSome(\n props.restoredData.proofOfAddress.value.validUntil\n )\n ? option.some(\n validableDate.fromDate(\n props.restoredData.proofOfAddress.value.validUntil.value\n )\n )\n : option.none) as Option,\n issuer: option.isSome(\n props.restoredData.proofOfAddress.value.issuer\n )\n ? option.some(\n props.restoredData.proofOfAddress.value.issuer.value\n )\n : (option.none as Option),\n firstDocumentSide: (option.isSome(\n props.restoredData.proofOfAddressDocs\n ) &&\n option.isSome(props.restoredData.proofOfAddressDocs.value.first)\n ? option.some(\n props.restoredData.proofOfAddressDocs.value.first.value\n )\n : option.none) as Option,\n secondDocumentSide: (option.isSome(\n props.restoredData.proofOfAddressDocs\n ) &&\n option.isSome(\n props.restoredData.proofOfAddressDocs.value.second\n )\n ? option.some(\n props.restoredData.proofOfAddressDocs.value.second.value\n )\n : option.none) as Option,\n localPersonalNumber: option.isSome(\n props.restoredData.proofOfAddress.value.localPersonalNumber\n )\n ? props.restoredData.proofOfAddress.value.localPersonalNumber\n .value\n : \"\",\n }\n : {\n idNumber: \"\",\n dateOfIssuing: option.none as Option,\n validUntil: option.none as Option,\n issuer: option.none as Option,\n firstDocumentSide: (option.isSome(\n props.restoredData.proofOfAddressDocs\n ) &&\n option.isSome(props.restoredData.proofOfAddressDocs.value.first)\n ? option.some(\n props.restoredData.proofOfAddressDocs.value.first.value\n )\n : option.none) as Option,\n secondDocumentSide: (option.isSome(\n props.restoredData.proofOfAddressDocs\n ) &&\n option.isSome(\n props.restoredData.proofOfAddressDocs.value.second\n )\n ? option.some(\n props.restoredData.proofOfAddressDocs.value.second.value\n )\n : option.none) as Option,\n localPersonalNumber: \"\",\n }\n : {\n idNumber: \"\",\n dateOfIssuing: option.none as Option,\n validUntil: option.none as Option,\n issuer: option.none as Option,\n firstDocumentSide: option.none as Option,\n secondDocumentSide: option.none as Option,\n localPersonalNumber: \"\",\n },\n fieldValidators: ({ validUntil }) => ({\n idNumber: maxLength(99),\n dateOfIssuing: validators.inSequence(\n defined>(),\n validDate,\n validators.fromPredicate(\n p => p > minimumDate,\n formatMessage(\"Form.fieldError.issuingBeforeMinimumDate\")\n ),\n validators.fromPredicate(\n p => p <= new Date(),\n formatMessage(\"Form.fieldError.issuingAfterToday\")\n ),\n validators.fromPredicate(\n p =>\n option.isSome(validUntil) && option.isSome(validUntil.value)\n ? validUntil.value.value > p\n : true,\n formatMessage(\"Form.fieldError.validUntilBeforeIssuing\")\n )\n ),\n validUntil: validators.validateIfDefined(\n validators.inSequence(\n validators.validDate(\n formatMessage(\"Form.fieldError.invalidDateFormat\")\n ),\n validators.fromPredicate(\n p => p > new Date(),\n formatMessage(\"Form.fieldError.validDateExpired\")\n )\n )\n ),\n firstDocumentSide: validators.defined(\n formatMessage(\"Form.fieldError.required\")\n ),\n secondDocumentSide: documentHasTwoSides\n ? validators.definedNoExtract(\n formatMessage(\"Form.fieldError.required\")\n )\n : undefined,\n localPersonalNumber: showLocalPersonalNumber\n ? validators.inSequence(\n validators.nonBlankString(\n formatMessage(\"Form.fieldError.required\")\n ),\n validators.validBirthNumber(\n formatMessage(\n \"Identification.personalData.birthNumberFormatError\"\n )\n )\n )\n : undefined,\n }),\n },\n {\n onSubmit: ({ firstDocumentSide, secondDocumentSide, ...info }) =>\n props.onSave({\n ...info,\n idNumber: pipe(\n info.idNumber,\n NonEmptyString.decode,\n option.fromEither\n ),\n localPersonalNumber: showLocalPersonalNumber\n ? pipe(\n info.localPersonalNumber,\n NonEmptyString.decode,\n option.fromEither\n )\n : option.none,\n }),\n }\n );\n\n useEffect(() => {\n if (props.onFormChange) {\n props.onFormChange();\n }\n }, [values]);\n\n const formatError = (error: Error): LocalizedString => {\n switch (error) {\n case \"FailureUpload\":\n return formatMessage(\"Identification.UploadDocuments.failure.message\");\n case \"SizeExceeding\":\n return formatMessage(\n \"Identification.UploadDocuments.failure.sizeExceeding\"\n );\n }\n };\n const documentType: LocalizedString = foldDocumentType({\n whenIDCard: () =>\n formatMessage(\"Identification.personalData.confirmationOfAddress\"),\n whenDrivingLicense: () =>\n formatMessage(\"Identification.personalData.confirmationOfAddress\"),\n whenPassport: () =>\n formatMessage(\"Identification.personalData.residentPermit\"),\n whenLongTermResidencePermit: () =>\n formatMessage(\"Identification.personalData.residentPermit\"),\n whenPermanentResidencePermit: () =>\n formatMessage(\"Identification.personalData.residentPermit\"),\n whenTemporaryResidencePermit: () =>\n formatMessage(\"Identification.personalData.residentPermit\"),\n });\n\n const firstDocumentLabel: LocalizedString = foldDocumentType({\n whenIDCard: () => formatMessage(\"Identification.proofOfAddress.document\"),\n whenDrivingLicense: () =>\n formatMessage(\"Identification.proofOfAddress.document\"),\n whenPassport: () =>\n formatMessage(\"Identification.proofOfAddress.residentPermitFront\"),\n whenLongTermResidencePermit: () =>\n formatMessage(\"Identification.proofOfAddress.residentPermitFront\"),\n whenPermanentResidencePermit: () =>\n formatMessage(\"Identification.proofOfAddress.residentPermitFront\"),\n whenTemporaryResidencePermit: () =>\n formatMessage(\"Identification.proofOfAddress.residentPermitFront\"),\n });\n\n const secondDocumentLabel: LocalizedString = formatMessage(\n \"Identification.proofOfAddress.residentPermitBack\"\n );\n\n const onDocumentUpload = (\n side: \"First\" | \"Second\",\n fileContent: ScannedDocument\n ): Task => {\n const onChangeDocument = fieldProps(\n side === \"First\" ? \"firstDocumentSide\" : \"secondDocumentSide\"\n ).onChange;\n\n return pipe(\n fileContent,\n taskEither.fromPredicate(\n scannedDocument => base64FileSize(scannedDocument.base64) < maxMB,\n constant(\"SizeExceeding\")\n ),\n taskEither.chain(file =>\n pipe(\n uploadDocument({\n side,\n fileContent: file.base64,\n coApplicant: props.coApplicant,\n }),\n taskEither.mapLeft(constant(\"FailureUpload\"))\n )\n ),\n taskEither.fold(\n m => task.fromIO(() => setError(option.some(m))),\n () =>\n task.fromIO(() => {\n setError(option.none);\n onChangeDocument(option.some(fileContent));\n })\n )\n );\n };\n\n const onDocumentRemove = (side: \"First\" | \"Second\"): Task => {\n const onChangeDocument = fieldProps(\n side === \"First\" ? \"firstDocumentSide\" : \"secondDocumentSide\"\n ).onChange;\n\n return pipe(\n removeDocument({ side, coApplicant: props.coApplicant }),\n taskEither.fold(\n () => task.fromIO(constVoid),\n () =>\n task.fromIO(() => {\n setError(option.none);\n onChangeDocument(option.none);\n })\n )\n );\n };\n\n const onDocumentChange = (side: \"First\" | \"Second\") => (\n fileContent: Option\n ): unknown => {\n return pipe(\n fileContent,\n option.fold(\n () => onDocumentRemove(side),\n file => onDocumentUpload(side, file)\n )\n )();\n };\n\n return (\n
\n \n \n \n \n \n \n <>\n {showLocalPersonalNumber && (\n \n )}\n \n \n \n \n \n \n \n \n \n {documentHasTwoSides && (\n \n \n \n )}\n \n array.compact([e, props.error]),\n nonEmptyArray.fromArray\n )}\n />\n \n \n \n \n
\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { useFormatDocumentType, useFormatMessage } from \"../../intl\";\nimport {\n Banner,\n Body,\n Box,\n Button,\n ComputedFieldProps,\n Divider,\n fieldIssues,\n FormErrors,\n Heading,\n Issues,\n Space,\n Stack,\n useIsMobileLayout,\n useIsTouchScreen,\n ReadOnlyField,\n} from \"design-system\";\nimport { constNull, constTrue, constVoid, flow, pipe } from \"fp-ts/function\";\nimport { nonEmptyArray, option, taskEither } from \"fp-ts\";\nimport { AddressForm } from \"../AddressForm/AddressForm\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n Address,\n AddressWrite,\n AllCitizenships,\n ClientDataEdit,\n ClientDataOCR,\n PersonalData,\n PersonalDocument,\n PersonalDocumentOCR,\n} from \"../domain\";\nimport { PersonalDataFormEdit } from \"./PersonalDataForm/PersonalDataFormEdit\";\nimport { PersonalDocumentFormEdit } from \"./PersonalDocumentForm/PersonalDocumentFormEdit\";\nimport {\n FormState as PersonalDataFormState,\n formStateFromPersonalData,\n formStateFromPersonalDataOCR,\n PersonalDataForm,\n} from \"./PersonalDataForm/PersonalDataForm\";\nimport {\n FormState as PersonalDocumentFormState,\n formStateFromPersonalDocument,\n formStateFromPersonalDocumentOCR,\n PersonalDocumentForm,\n} from \"./PersonalDocumentForm/PersonalDocumentForm\";\nimport {\n AddressFormState,\n addressWriteToAddress,\n formStateFromAddress,\n formStateFromAddressOCR,\n useDefaultCountryCode,\n} from \"../addressFormUtils\";\nimport { AddressFormEdit } from \"../AddressForm/AddressFormEdit\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport {\n CountryCode,\n DocumentIdentificationFlow,\n DocumentPurpose,\n GenericError,\n UploadDocumentFlowType,\n} from \"../../globalDomain\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\n\nimport * as uploadIdApi from \"../api\";\nimport { ClientDataErrors } from \"./ConfirmClientData\";\nimport { AdditionalPersonalDataForm } from \"./AdditionalPersonalDataForm/AdditionalPersonalDataForm\";\n\nimport { DocumentType } from \"../../UploadDocuments/domain\";\nimport { ExtractedDataResult } from \"../../UploadDocuments/types\";\nimport { AddressSuggestionsForm } from \"./AddressSuggestionsForm\";\nimport { isForeign } from \"../utils\";\nimport { SecondCitizenshipField } from \"./PersonalDataForm/SecondCitizenshipField\";\nimport { useAppContext } from \"../../useAppContext\";\n\nexport type AdditionalPersonalDataProps =\n | {\n askAdditionalPersonalData: true;\n additionalPersonalData: {\n countryOfBirthFieldProps: ComputedFieldProps>;\n };\n }\n | {\n askAdditionalPersonalData: false;\n };\n\nexport type AddressSuggestionsProps =\n | {\n mustSelectAddressSuggestion: true;\n addressSuggestionProps: ComputedFieldProps>;\n addressSuggestions: NonEmptyArray;\n }\n | { mustSelectAddressSuggestion: false };\n\nexport type SecondCitizenshipProps =\n | {\n secondCitizenshipRadio: ComputedFieldProps>;\n secondCitizenshipField: ComputedFieldProps>;\n isChild?: false;\n }\n | {\n secondCitizenshipField: Option;\n isChild: true;\n };\n\ntype Props = {\n documentIdentificationFlow: Exclude<\n DocumentIdentificationFlow,\n \"PrimaryAndLivenessCheck\"\n >;\n extractedData: ExtractedDataResult;\n canEdit: boolean;\n onEdit: (\n newData: ClientDataEdit,\n idType: DocumentPurpose,\n subform: keyof ClientDataEdit\n ) => TaskEither;\n setIsEditing: (state: boolean) => unknown;\n errors: Option;\n onDataChange: () => unknown;\n productType: Option;\n supportForeign?: boolean;\n canAutoEdit: boolean;\n isChild?: boolean;\n hideConfirmDescription?: boolean;\n} & AdditionalPersonalDataProps &\n AddressSuggestionsProps &\n SecondCitizenshipProps;\n\ntype EditedData = {\n personalData: Option;\n documentDetails: Option;\n additionalDocumentDetails: Option;\n permanentAddress: Option
;\n};\n\ntype Form = keyof ClientDataOCR | \"additionalDocumentDetails\";\n\nexport function ClientDataForm(props: Props) {\n const {\n config: { r6NewSironMapping: newSironMapping },\n } = useAppContext();\n const formatMessage = useFormatMessage();\n const formatDocumentType = useFormatDocumentType();\n const isMobileLayout = useIsMobileLayout();\n\n const [formInEdit, setFormInEdit] = useState>(option.none);\n\n useEffect(() => {\n if (\n option.isSome(props.extractedData.addressSuggestions) &&\n props.canEdit\n ) {\n editForm(\"permanentAddress\")();\n }\n }, []);\n\n const [editedData, setEditedData] = useState({\n personalData: option.none,\n documentDetails: option.none,\n additionalDocumentDetails: option.none,\n permanentAddress: option.none,\n });\n const documentPurposeFromIdentificationFlow =\n props.documentIdentificationFlow === \"PrimaryAndSecondary\"\n ? \"Primary\"\n : props.documentIdentificationFlow;\n\n const editForm = (form: Form) => () => {\n if (option.isNone(formInEdit)) {\n setFormInEdit(option.some(form));\n props.setIsEditing(true);\n }\n };\n\n const onCancelEdit = () => {\n setFormInEdit(option.none);\n props.setIsEditing(false);\n };\n\n const isEditing = (form: Form) =>\n pipe(\n formInEdit,\n option.exists(f => f === form)\n );\n\n const personalDataFormState: PersonalDataFormState = pipe(\n editedData.personalData,\n option.fold(\n () => formStateFromPersonalDataOCR(props.extractedData.personalData),\n formStateFromPersonalData\n )\n );\n\n const getDocumentDetailsFormState = (\n document: PersonalDocumentOCR,\n isAdditional: boolean\n ): PersonalDocumentFormState => {\n const getFormState = option.fold(\n () => formStateFromPersonalDocumentOCR(document),\n formStateFromPersonalDocument\n );\n return getFormState(\n isAdditional\n ? editedData.additionalDocumentDetails\n : editedData.documentDetails\n );\n };\n\n const defaultCountry = useDefaultCountryCode();\n\n const isPersonalProfile = pipe(\n props.productType,\n option.exists(item => item === \"PersonalProfile\")\n );\n\n const permanentAddress: Option = pipe(\n props.extractedData.permanentAddress,\n option.map(permanentAddressFromOCR => {\n return pipe(\n editedData.permanentAddress,\n option.fold(\n () =>\n formStateFromAddressOCR(permanentAddressFromOCR, defaultCountry),\n formStateFromAddress\n )\n );\n })\n );\n\n const setPermanentAddress = (\n values: AddressWrite\n ): TaskEither =>\n pipe(\n values,\n addressWriteToAddress,\n onFormSave(\"permanentAddress\", documentPurposeFromIdentificationFlow),\n taskEither.bimap(formatEditErrors, () => values)\n );\n\n const formatEditErrors = (\n errors: uploadIdApi.PersonalInfoEditError | GenericError\n ): Issues => {\n if (GenericError.is(errors)) {\n return fieldIssues.errors([\n formatMessage(\"Identification.UploadDocuments.genericError\"),\n ]);\n }\n return fieldIssues.errors(errors);\n };\n\n function onFormSave(\n subform: T,\n idType: DocumentPurpose\n ): (\n newEditedData: NonNullable\n ) => TaskEither {\n return newEditedData => {\n if (!props.canEdit && !props.extractedData.extractedAddress)\n return taskEither.fromIO(constVoid);\n const newData: ClientDataEdit = { [subform]: newEditedData };\n const localSubForm =\n subform === \"documentDetails\"\n ? props.documentIdentificationFlow === \"PrimaryAndSecondary\"\n ? idType === \"Primary\"\n ? \"documentDetails\"\n : \"additionalDocumentDetails\"\n : \"documentDetails\"\n : subform;\n return pipe(\n props.onEdit(newData, idType, subform),\n taskEither.chain(() =>\n taskEither.fromIO(() => {\n props.onDataChange();\n setEditedData({\n ...editedData,\n [localSubForm]: option.some(newEditedData),\n });\n onCancelEdit();\n })\n )\n );\n };\n }\n\n const renderDocumentDetailsForm = (\n personalDocument: PersonalDocumentOCR,\n documentType: DocumentType,\n isAdditional: boolean\n ) => {\n const formKey = isAdditional\n ? \"additionalDocumentDetails\"\n : \"documentDetails\";\n\n const idType = isAdditional\n ? \"Secondary\"\n : documentPurposeFromIdentificationFlow;\n return (\n <>\n \n \n {formatDocumentType(documentType)}\n \n \n {props.canEdit && !isEditing(formKey) && (\n \n )}\n \n \n {/* // TODO(gabro): can we merge document title here? */}\n {isEditing(formKey) ? (\n \n pipe(\n values,\n onFormSave(\"documentDetails\", idType),\n taskEither.bimap(formatEditErrors, () => values)\n )\n }\n onSave={onCancelEdit}\n onCancel={onCancelEdit}\n authorityMandatory={personalDocument.authorityMandatory}\n issuerMandatory={personalDocument.issuerMandatory}\n />\n ) : (\n \n isAdditional ? e.additionalDocumentDetails : e.documentDetails\n ),\n option.map(fieldIssues.errors)\n )}\n issue={option.none}\n reworkDocumentDetails={option.none}\n reworkClientProfile={option.none}\n authorityMandatory={personalDocument.authorityMandatory}\n issuerMandatory={personalDocument.issuerMandatory}\n />\n )}\n \n );\n };\n\n const isTouchScreen = useIsTouchScreen();\n\n useEffect(() => {\n if (\n isForeign(personalDataFormState.citizenship) &&\n props.canAutoEdit &&\n (personalDataFormState.placeOfBirth.length === 0 ||\n option.isNone(personalDataFormState.sex))\n ) {\n editForm(\"personalData\")();\n }\n }, []);\n\n return (\n \n {!isTouchScreen && !props.hideConfirmDescription && (\n <>\n \n {formatMessage(\"Identification.personalData.confirmDescription\", {\n name: personalDataFormState.name,\n })}\n \n \n \n )}\n \n \n {formatMessage(\"Identification.personalData.personalData\")}\n \n \n {props.canEdit && !isEditing(\"personalData\") && (\n \n )}\n \n \n {isEditing(\"personalData\") ? (\n \n pipe(\n props.askAdditionalPersonalData\n ? {\n ...values,\n countryOfBirth:\n props.additionalPersonalData.countryOfBirthFieldProps\n .value,\n }\n : values,\n onFormSave(\"personalData\", documentPurposeFromIdentificationFlow),\n taskEither.bimap(formatEditErrors, () => values)\n )\n }\n onSave={onCancelEdit}\n onCancel={onCancelEdit}\n displayCountryOfBirth={!props.askAdditionalPersonalData}\n supportForeign={props.supportForeign === true}\n documentType={props.extractedData.documentType}\n />\n ) : (\n e.personalData),\n option.map(nonEmptyArray.map(fieldIssues.error))\n )}\n displayCountryOfBirth={!props.askAdditionalPersonalData}\n reworkPersonalData={option.none}\n documentType={props.extractedData.documentType}\n secondCitizenship={option.none}\n />\n )}\n {newSironMapping && (\n <>\n \n {pipe(\n props.productType,\n option.fold(constTrue, type => type !== \"PersonalProfile\")\n ) &&\n (!!props.isChild ? (\n \n ) : (\n \n ))}\n \n )}\n \n {props.askAdditionalPersonalData && (\n <>\n \n \n \n {formatMessage(\"Identification.additionalPersonalData.title\")}\n \n \n {\n props.onDataChange();\n props.additionalPersonalData.countryOfBirthFieldProps.onChange(\n value\n );\n },\n }}\n />\n \n \n )}\n \n \n \n {formatMessage(\"Identification.personalData.documents\")}\n \n \n \n {formatMessage(\"Identification.personalData.documentsDescription\")}\n \n \n \n {renderDocumentDetailsForm(\n props.extractedData.documentDetails,\n props.extractedData.documentType,\n false\n )}\n {pipe(\n props.extractedData.additionalDocumentDetails,\n option.fold(constNull, details =>\n pipe(\n props.extractedData.additionalDocumentType,\n option.fold(constNull, type =>\n renderDocumentDetailsForm(details, type, true)\n )\n )\n )\n )}\n \n \n {pipe(\n permanentAddress,\n option.fold(\n () => (\n <>\n {!isPersonalProfile && (\n \n \n \n \n \n )}\n \n ),\n permanentAddress => (\n <>\n \n \n \n \n {formatMessage(\n \"Identification.personalData.permanentAddress\"\n )}\n \n \n {(props.canEdit || !!props.extractedData.extractedAddress) &&\n !isEditing(\"permanentAddress\") && (\n \n )}\n \n \n {props.extractedData.extractedAddress && (\n \n )}\n \n {isEditing(\"permanentAddress\") ? (\n taskEither.fromIO(onCancelEdit))\n )}\n onSubmit={() => taskEither.fromIO(onCancelEdit)}\n onCancel={onCancelEdit}\n hint={option.none}\n lockCountryEdit\n forceValidateForForeign={false}\n lockCzSk={false}\n />\n ) : props.mustSelectAddressSuggestion ? (\n \n ) : (\n e.permanentAddress),\n option.map(nonEmptyArray.map(fieldIssues.error))\n )}\n reworkAddress={option.none}\n lockCzSk={false}\n />\n )}\n \n \n )\n )\n )}\n e.generalError)\n )}\n />\n \n );\n}\n","import { option, taskEither } from \"fp-ts\";\nimport { AddressWrite } from \"../domain\";\nimport {\n Box,\n Divider,\n ErrorBanner,\n Stack,\n Body,\n LoadingButton,\n Banner,\n} from \"design-system\";\nimport { AddressBlock } from \"./AddressBlock\";\nimport { useFormatMessage } from \"../../intl\";\nimport * as identificationApi from \"../api\";\nimport { useCommand } from \"../../useAPI\";\nimport { pipe, constNull, constant, flow } from \"fp-ts/function\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { PersonalDataProcessingDisclaimer } from \"../../Common/PersonalDataProcessingDisclaimer/PersonalDataProcessingDisclaimer\";\nimport { CoApplicantInput, genericError } from \"../../globalDomain\";\nimport { addressWriteToAddressOCR } from \"../addressFormUtils\";\nimport { palette } from \"design-system/lib/styleConstants\";\nimport { useParentSharedReducer } from \"../../BranchExperience/useSharedReducer\";\nimport {\n shareWithClientAction,\n reducerConfig,\n setErrorAction,\n setCurrentAddressAction,\n cancelEditingAction,\n editCurrentAddressAction,\n submitAddress,\n resetSubmitAddress,\n} from \"./state\";\nimport { useBranchExperienceContext } from \"../../BranchExperience/BranchExperienceContext\";\nimport { ShareWithClientButton } from \"../../Common/ShareWithClientButton/ShareWithClientButton\";\nimport { usePortalStatusContext } from \"../../PortalStatusContext\";\n\ntype Props = {\n isWaitingForOpuAndCex?: boolean;\n onContinue: TaskEither;\n onEditingChange: (isEditing: boolean) => void;\n foreignSupport?: boolean;\n} & CoApplicantInput;\n\nexport function AdditionalAddresses(props: Props) {\n const formatMessage = useFormatMessage();\n\n const addressSubmit = useCommand(identificationApi.addressSubmit);\n\n const { branchExperienceFeaturesActive } = useBranchExperienceContext();\n const { portalBlocked } = usePortalStatusContext();\n\n const [state, dispatch] = useParentSharedReducer(reducerConfig, {\n shared: false,\n formInEditing: false,\n error: option.none,\n currentAddress: option.none,\n submitting: false,\n });\n\n const hasAddresses = option.isSome(state.currentAddress);\n\n const onSubmit = (): TaskEither => {\n const currentAddressBody = pipe(\n state.currentAddress,\n option.map(\n address => ({\n addressType: \"Current\",\n address,\n coApplicant: props.coApplicant,\n })\n )\n );\n if (branchExperienceFeaturesActive && !state.shared && hasAddresses) {\n return taskEither.rightIO(() => dispatch(shareWithClientAction()));\n }\n\n return pipe(\n taskEither.bracket(\n taskEither.fromIO(() => dispatch(submitAddress())),\n () =>\n pipe(\n currentAddressBody,\n option.fold(\n constant(pipe(props.onContinue)),\n flow(\n addressSubmit,\n taskEither.chain(() => props.onContinue),\n taskEither.mapLeft(() => dispatch(setErrorAction(genericError)))\n )\n )\n ),\n () => taskEither.fromIO(() => dispatch(resetSubmitAddress()))\n )\n );\n };\n\n const CurrentAddressForm = (\n \n taskEither.fromIO(() => {\n props.onEditingChange(false);\n dispatch(setCurrentAddressAction(option.some(address)));\n })\n }\n onRemove={option.some(() =>\n dispatch(setCurrentAddressAction(option.none))\n )}\n onEdit={option.some(() => {\n props.onEditingChange(true);\n dispatch(editCurrentAddressAction());\n })}\n onCancel={() => {\n props.onEditingChange(false);\n dispatch(cancelEditingAction());\n }}\n title={formatMessage(\n \"Identification.additionalAddresses.currentAndContactAddress\"\n )}\n subtitle={option.none}\n addressDescription={formatMessage(\n \"Identification.additionalAddresses.currentAddressDescription\"\n )}\n addAddressLabel={formatMessage(\n \"Identification.additionalAddresses.addCurrentAddress\"\n )}\n hint={option.none}\n disabled={state.formInEditing || state.submitting || portalBlocked}\n tooltipContent={formatMessage(\n \"Identification.additionalAddresses.currentAddressTooltipContent\"\n )}\n reworkAddress={option.none}\n lockCzSk={true}\n />\n );\n\n return (\n \n \n \n {formatMessage(\"Identification.additionalAddresses.description\")}\n \n {CurrentAddressForm}\n \n \n {pipe(\n state.error,\n option.fold(constNull, () => (\n \n ))\n )}\n {/* The following fragment is a temporary workaround for: https://buildo.kaiten.io/space/29286/card/2311626 */}\n <>\n {state.shared && (\n \n )}\n \n \n {hasAddresses ? (\n \n ) : (\n \n )}\n \n \n \n );\n}\n","import {\n Box,\n Banner,\n Space,\n Heading,\n Divider,\n LocalizedString,\n} from \"design-system\";\nimport { useFormatMessage } from \"../../intl\";\nimport { pipe, constVoid, constant, flow } from \"fp-ts/function\";\nimport { option, taskEither, task, boolean } from \"fp-ts\";\nimport { useCommand } from \"../../useAPI\";\nimport * as identificationApi from \"../api\";\nimport { AddressWrite, PersonalDocumentProofOfAddress } from \"../domain\";\nimport { ProofOfAddressForm } from \"./ProofOfAddressForm\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\n\nimport {\n CoApplicantInput,\n GenericError,\n UploadDocumentFlowType,\n} from \"../../globalDomain\";\nimport { DocumentType } from \"../../UploadDocuments/domain\";\nimport { addressWriteToAddress } from \"../addressFormUtils\";\nimport { AddressBlock } from \"../Addresses/AddressBlock\";\nimport { useParentSharedReducer } from \"../../BranchExperience/useSharedReducer\";\nimport {\n setErrorAction,\n setPermanentAddressAction,\n setEditingAction,\n shareWithClientAction,\n proofOfAddressChangeAction,\n reducerConfig,\n} from \"./state\";\nimport { useBranchExperienceContext } from \"../../BranchExperience/BranchExperienceContext\";\nimport { ProofOfAddressSubmitError } from \"../api\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport { Option } from \"fp-ts/Option\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport * as ukontoApi from \"../../UKontoSecondPart/api\";\nimport { RestoreApplicationData } from \"../../UKontoSecondPart/api\";\nimport { ShareWithClientButton } from \"../../Common/ShareWithClientButton/ShareWithClientButton\";\n\ntype Props = {\n documentType: DocumentType;\n next: ReaderTaskEither, unknown, unknown>;\n showLocalPersonalNumber: boolean;\n isForeign: boolean;\n productType: Option;\n restoredData?: RestoreApplicationData;\n isUkonto?: boolean;\n isUploadAgain?: boolean;\n isWithResidency?: () => boolean;\n} & CoApplicantInput;\n\ntype Error =\n | \"MissingPermanentAddressError\"\n | \"GenericError\"\n | ProofOfAddressSubmitError;\n\nexport function PermanentAddress(props: Props) {\n const formatMessage = useFormatMessage();\n const permanentAddressSubmit = useCommand(\n identificationApi.permanentAddressSubmit\n );\n const proofOfAddressSubmit = useCommand(\n identificationApi.proofOfAddressSubmit\n );\n const permanentAddressUkontoSubmit = useCommand(\n ukontoApi.permanentAddressSubmit\n );\n const proofOfAddressUkontoSubmit = useCommand(ukontoApi.proofOfAddressSubmit);\n\n const isUkonto = props.isUkonto ? props.isUkonto : false;\n\n const [state, dispatch] = useParentSharedReducer(\n reducerConfig,\n props.restoredData && !props.isUploadAgain\n ? {\n shared: false,\n formInEditing: false,\n permanentAddress: option.isSome(props.restoredData.permanentAddress)\n ? option.some(props.restoredData.permanentAddress.value)\n : option.none,\n // proofOfAddress is actually in this state just for sharing data with client\n // it should not be used for other purposes\n proofOfAddress: {\n // documentType, in the same way, is used only for sharing, it is static as it never change\n // it comes from UploadDocuments extracted data\n // Child component should receive differently this kind of information\n // at the moment this is the cleanest solution to avoid putting a lot of useless informations into states\n documentType: props.documentType,\n isForeign: props.isForeign,\n document: option.isSome(props.restoredData.proofOfAddress)\n ? option.some(props.restoredData.proofOfAddress.value)\n : option.none,\n },\n error: option.none,\n }\n : {\n shared: false,\n formInEditing: false,\n permanentAddress: option.none,\n // proofOfAddress is actually in this state just for sharing data with client\n // it should not be used for other purposes\n proofOfAddress: {\n // documentType, in the same way, is used only for sharing, it is static as it never change\n // it comes from UploadDocuments extracted data\n // Child component should receive differently this kind of information\n // at the moment this is the cleanest solution to avoid putting a lot of useless informations into states\n documentType: props.documentType,\n document: option.none,\n isForeign: props.isForeign,\n },\n error: option.none,\n }\n );\n\n const { branchExperienceFeaturesActive } = useBranchExperienceContext();\n\n const setPermanentAddress = flow(setPermanentAddressAction, dispatch);\n const setError = flow(setErrorAction, dispatch);\n const setEditPermanentAddress = flow(setEditingAction, dispatch);\n\n const formatError = (error: Error): LocalizedString => {\n switch (error) {\n case \"MissingPermanentAddressError\":\n return formatMessage(\"Identification.permanentAddress.missingAddress\");\n case \"GenericError\":\n return formatMessage(\"Identification.permanentAddress.genericError\");\n default:\n return error.error;\n }\n };\n const submitPermanentAddress = (address: AddressWrite) => {\n pipe(\n pipe(\n isUkonto,\n boolean.fold(\n () =>\n permanentAddressSubmit({\n permanentAddress: address,\n coApplicant: props.coApplicant,\n }),\n () =>\n permanentAddressUkontoSubmit({\n permanentAddress: address,\n coApplicant: props.coApplicant,\n })\n )\n ),\n taskEither.fold(\n () => task.fromIO(constVoid),\n () =>\n task.fromIO(() =>\n setPermanentAddress(option.some(addressWriteToAddress(address)))\n )\n )\n )();\n };\n\n const onProofOfAddressChange = () => {\n if (state.shared) {\n dispatch(proofOfAddressChangeAction());\n }\n };\n\n const submitProofOfAddress = (\n proofOfAddress: Option\n ): TaskEither => {\n if (option.isSome(proofOfAddress)) {\n setError(option.none);\n }\n return pipe(\n state.permanentAddress,\n taskEither.fromOption(constant(\"MissingPermanentAddressError\")),\n taskEither.chain(() => {\n if (branchExperienceFeaturesActive && !state.shared) {\n return taskEither.rightIO(() =>\n dispatch(\n shareWithClientAction({\n ...state.proofOfAddress,\n document: proofOfAddress,\n })\n )\n );\n }\n return option.isSome(proofOfAddress)\n ? pipe(\n pipe(\n isUkonto,\n boolean.fold(\n () =>\n proofOfAddressSubmit({\n proofOfAddress: proofOfAddress.value,\n coApplicant: props.coApplicant,\n }),\n () =>\n proofOfAddressUkontoSubmit({\n proofOfAddress: proofOfAddress.value,\n coApplicant: props.coApplicant,\n })\n )\n ),\n taskEither.mapLeft(e =>\n GenericError.is(e)\n ? (\"GenericError\" as Error)\n : (e as ProofOfAddressSubmitError)\n ),\n taskEither.chain(() =>\n pipe(\n props.next(proofOfAddress.value.localPersonalNumber),\n taskEither.mapLeft(constant(\"GenericError\"))\n )\n )\n )\n : taskEither.fromIO(() => props.next(option.none)());\n }),\n taskEither.orElse(e => taskEither.leftIO(() => setError(option.some(e))))\n );\n };\n\n const displayProofOfAddress = props.isWithResidency\n ? props.isWithResidency()\n : false;\n\n return (\n \n \n ({\n ...value,\n country: option.some(value.country),\n city: value.city,\n streetNumber: value.streetNumber,\n streetName: value.streetName,\n }))\n )}\n isEditing={state.formInEditing}\n submitInvalid\n onSave={address =>\n taskEither.fromIO(() => submitPermanentAddress(address))\n }\n onRemove={option.some(() => setPermanentAddress(option.none))}\n onEdit={option.some(() => setEditPermanentAddress(true))}\n onCancel={() => setEditPermanentAddress(false)}\n title={formatMessage(\"Identification.permanentAddress.title\")}\n subtitle={option.none}\n hint={option.none}\n disabled={false}\n tooltipContent={formatMessage(\n \"Identification.permanentAddress.tooltipContent\"\n )}\n addNewContent={() => (\n setEditPermanentAddress(true),\n variant: \"secondary\",\n },\n ])}\n onDismiss={option.none}\n />\n )}\n lockCountryEdit\n reworkAddress={option.none}\n hasResidency={props.isWithResidency}\n />\n \n \n {displayProofOfAddress && (\n <>\n \n \n \n \n {formatMessage(\"Identification.proofOfAddress.title\")}\n \n \n \n submitProofOfAddress(option.some(proofOfAddress))\n }\n error={pipe(state.error, option.map(formatError))}\n isEditingForm={state.formInEditing}\n coApplicant={props.coApplicant}\n disabled={false}\n sharedWithClient={state.shared}\n onFormChange={onProofOfAddressChange}\n showLocalPersonalNumber={props.showLocalPersonalNumber}\n isForeign={props.isForeign}\n restoredData={props.restoredData}\n isUploadAgain={props.isUploadAgain}\n />\n \n )}\n \n {!displayProofOfAddress && (\n \n \n \n )}\n {state.shared && (\n \n )}\n \n \n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport { constant, constFalse, constNull, flow, pipe } from \"fp-ts/function\";\nimport { useFormatMessage } from \"../../intl\";\nimport { useCommand } from \"../../useAPI\";\nimport * as uploadIdApi from \"../api\";\nimport { PersonalInfoEditError, ResidencySubmitInput } from \"../api\";\nimport {\n array,\n boolean,\n eq,\n nonEmptyArray,\n option,\n record,\n semigroup,\n taskEither,\n} from \"fp-ts\";\nimport {\n AddressWrite,\n AllCitizenships,\n ClientDataEdit,\n PersonalInfoError,\n PersonalProfileDocUploadSubmitError,\n} from \"../domain\";\nimport {\n Action,\n ActionButtonGroup,\n Banner,\n Dialog,\n Divider,\n LocalizedString,\n Stack,\n unsafeLocalizedString,\n useForm,\n useIsMobileLayout,\n WarningIcon,\n} from \"design-system\";\nimport {\n AdditionalPersonalDataProps,\n AddressSuggestionsProps,\n ClientDataForm,\n} from \"./ClientDataForm\";\nimport {\n CoApplicantInput,\n CountryCode,\n DocumentIdentificationFlow,\n DocumentPurpose,\n foldTenant,\n GenericError,\n genericError,\n UploadDocumentFlowType,\n} from \"../../globalDomain\";\nimport { Option } from \"fp-ts/Option\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\n\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport {\n clientExistencyCheckDataFromClientData,\n clientExistencyCheckDataFromPersonalData,\n ClientExistencyCheckDataPartial,\n ClientExistencyCommand,\n convertToCheckDataBn,\n useClientExistencyCheck,\n} from \"../../UploadDocuments/clientExistenceUtils\";\nimport { useAppContext } from \"../../useAppContext\";\nimport { AdditionalChecks } from \"./AdditionalChecks\";\nimport { selectedMainApplicant } from \"../../MortgageDashboard/mortgageDashboardUtils\";\nimport { useValidators } from \"../../Common/useValidators\";\nimport { CheckClientDataResult } from \"../../UploadDocuments/useCheckClientDataResult\";\nimport { useParentSharedReducer } from \"../../BranchExperience/useSharedReducer\";\nimport { editDataAction, reducerConfig, shareWithClientAction } from \"./state\";\nimport { useBranchExperienceContext } from \"../../BranchExperience/BranchExperienceContext\";\n\nimport { useShareWithClientButtonProps } from \"../../Common/ShareWithClientButton/useShareWithClientButtonProps\";\nimport { useIsInPersonChannel } from \"../../useChannel\";\nimport { PersonalDataProcessingDisclaimer } from \"../../Common/PersonalDataProcessingDisclaimer/PersonalDataProcessingDisclaimer\";\nimport { usePortalStatusContext } from \"../../PortalStatusContext\";\nimport { YesNoRadioGroupField } from \"../../Common/YesNoRadioGroup/YesNoRadioGroupField\";\n\ntype Props = {\n extractedData: CheckClientDataResult;\n documentIdentificationFlow: DocumentIdentificationFlow;\n onContinue: (\n clientExistencyCheckData: Option\n ) => TaskEither;\n onUploadAgain: TaskEither;\n onAbort: (reason: \"GenericError\" | \"MaxAttemptsReached\") => unknown;\n onShouldClientContinue: Option<\n (\n clientExists: boolean,\n duplicateContacts: boolean,\n hasBlockingNotes: boolean,\n personalNumberMatch: boolean,\n userID: Option,\n clientNumber: Option\n ) => TaskEither\n >;\n banner?: JSX.Element;\n clientExistencyCommand: ClientExistencyCommand;\n submitDataCommand: ReaderTaskEither<\n uploadIdApi.PersonalInfoSubmitInput,\n PersonalProfileDocUploadSubmitError | PersonalInfoError | GenericError,\n unknown\n >;\n editPersonalInfoCommand: ReaderTaskEither<\n uploadIdApi.PersonalInfoEditInput,\n PersonalInfoEditError | GenericError,\n unknown\n >;\n submitResidencyCommand: ReaderTaskEither<\n ResidencySubmitInput,\n unknown,\n unknown\n >;\n documentsMismatch: boolean;\n onMismatchDialogDismiss: () => unknown;\n showMismatchDialog: () => unknown;\n noGoBack?: boolean;\n onReset: () => unknown;\n onDataChange: () => unknown;\n productType: Option;\n hasParentPadding?: boolean;\n supportForeign: boolean;\n hasResidency: Option;\n onResidencyChange: (isResident: Option) => unknown;\n isWaitingForOpuAndCex?: boolean;\n} & CoApplicantInput;\n\nexport type ClientDataErrors = Omit & {\n generalError: Option>;\n additionalDocumentDetails: Option>;\n};\n\nexport function ConfirmClientData(props: Props) {\n const formatMessage = useFormatMessage();\n const isMobileLayout = useIsMobileLayout();\n const [canceled, setCanceled] = useState(false);\n\n const { definedNoExtract } = useValidators();\n\n const editCountryOfBirth = useCommand(uploadIdApi.countryOfBirthSubmit);\n const editSecondCitizenship = useCommand(uploadIdApi.secondCitizenshipSubmit);\n const clientExistencyCheck = useClientExistencyCheck(\n props.clientExistencyCommand,\n () => genericError\n );\n\n const {\n apiParameters: { tenant },\n config: { r1EnableForeignNonResidentSupport: nonResidentSupported },\n } = useAppContext();\n const isInPerson = useIsInPersonChannel();\n const isPersonalProfile = pipe(\n props.productType,\n option.exists(item => item === \"PersonalProfile\")\n );\n\n const [state, dispatch] = useParentSharedReducer(reducerConfig, {\n id: \"notShared\",\n });\n\n const { branchExperienceFeaturesActive } = useBranchExperienceContext();\n const { portalBlocked } = usePortalStatusContext();\n\n const [sectionErrors, setSectionErrors] = useState>(\n option.none\n );\n\n const [isEditing, setIsEditing] = useState(false);\n const isForeign = pipe(\n props.extractedData.personalData.citizenship,\n option.fold(\n constFalse,\n citizenship => citizenship !== \"SVK\" && citizenship !== \"CZE\"\n )\n );\n\n const residencySupport =\n nonResidentSupported && isForeign && !isPersonalProfile;\n\n const showAdditionalChecks = foldTenant(\n tenant,\n constFalse,\n //SBL-170386 -> not only for SK\n constFalse\n );\n\n const askAdditionalPersonalData =\n isInPerson ||\n option.isNone(props.extractedData.personalData.countryOfBirth);\n\n const applicantIndex = pipe(\n props.coApplicant,\n option.fold(\n () => selectedMainApplicant.index,\n i => i.index\n )\n );\n\n const latestClientExistencyCheckData = useRef(\n clientExistencyCheckDataFromClientData({\n ...props.extractedData,\n applicantIndex,\n })\n );\n\n const genericClientDataErrors: ClientDataErrors = {\n personalData: option.none,\n permanentAddress: option.none,\n documentDetails: option.none,\n additionalDocumentDetails: option.none,\n generalError: option.some([\n formatMessage(\"Identification.UploadDocuments.genericError\"),\n ]),\n };\n\n const mapMainDocumentErrors = (\n errors:\n | PersonalProfileDocUploadSubmitError\n | PersonalInfoError\n | GenericError\n ): ClientDataErrors => {\n if (\n GenericError.is(errors) ||\n pipe(\n !PersonalProfileDocUploadSubmitError.is(errors)\n ? pipe(errors, record.every(option.isNone))\n : false\n )\n ) {\n return genericClientDataErrors;\n }\n\n return {\n ...errors,\n additionalDocumentDetails: option.none,\n generalError: pipe(\n errors.generalError,\n option.alt(() =>\n pipe(\n PersonalProfileDocUploadSubmitError.is(errors) &&\n errors.compareDocs,\n boolean.fold(\n () =>\n option.of>([\n formatMessage(\"Identification.UploadDocuments.wrongData\"),\n ]),\n () => option.none\n )\n )\n )\n ),\n };\n };\n\n const mapAdditionalDocumentErrors = (\n errors: PersonalInfoError | GenericError\n ): ClientDataErrors => {\n if (GenericError.is(errors) || pipe(errors, record.every(option.isNone))) {\n return genericClientDataErrors;\n }\n\n return {\n personalData: option.none,\n permanentAddress: option.none,\n documentDetails: option.none,\n additionalDocumentDetails: errors.documentDetails,\n generalError: pipe(\n errors.generalError,\n option.alt(() =>\n option.of>([\n formatMessage(\"Identification.UploadDocuments.wrongData\"),\n ])\n )\n ),\n };\n };\n\n function isSingleDocumentPurpose(\n flowType: DocumentIdentificationFlow\n ): flowType is DocumentPurpose {\n return flowType === \"Primary\" || flowType === \"Secondary\";\n }\n\n const submitCountryOfBirth = (\n countryOfBirth: Option\n ): TaskEither =>\n pipe(\n countryOfBirth,\n option.fold(\n () => taskEither.right(undefined),\n countryOfBirth =>\n pipe(\n editCountryOfBirth({\n applicantIndex,\n countryOfBirth,\n idType: pipe(\n props.documentIdentificationFlow,\n option.fromPredicate(isSingleDocumentPurpose)\n ),\n }),\n taskEither.mapLeft(() => genericClientDataErrors)\n )\n )\n );\n\n const selectAddressSuggestion = (\n suggestion: Option\n ): TaskEither =>\n pipe(\n suggestion,\n option.fold(\n () => taskEither.right(undefined),\n suggestion =>\n pipe(\n onEditData(\n {\n permanentAddress: {\n ...suggestion,\n },\n },\n props.documentIdentificationFlow === \"Secondary\"\n ? \"Secondary\"\n : \"Primary\",\n \"permanentAddress\"\n ),\n taskEither.mapLeft(() => genericClientDataErrors)\n )\n )\n );\n\n const submitSecondCitizenship = (\n secondCitizenship: Option\n ): TaskEither =>\n pipe(\n secondCitizenship,\n option.fold(\n () => taskEither.right(undefined),\n secondCitizenship =>\n pipe(\n editSecondCitizenship({\n applicantIndex,\n secondCitizenship,\n }),\n taskEither.mapLeft(() => genericClientDataErrors)\n )\n )\n );\n\n useEffect(() => {\n pipe(\n props.extractedData.validationErrors,\n option.map(errors =>\n pipe(errors, mapMainDocumentErrors, option.some, setSectionErrors)\n )\n );\n }, []);\n\n const validateData = (\n residency: Option\n ): TaskEither => {\n const mainSubmit = pipe(\n props.submitDataCommand({\n coApplicant: props.coApplicant,\n idType: pipe(\n props.documentIdentificationFlow,\n option.fromPredicate(isSingleDocumentPurpose),\n option.getOrElse(constant(\"Primary\"))\n ),\n }),\n taskEither.mapLeft(mapMainDocumentErrors)\n );\n\n const additionalSubmit =\n props.documentIdentificationFlow === \"PrimaryAndSecondary\"\n ? pipe(\n props.submitDataCommand({\n coApplicant: props.coApplicant,\n idType: \"Secondary\",\n }),\n taskEither.mapLeft(mapAdditionalDocumentErrors)\n )\n : taskEither.right(undefined);\n\n const residencySubmit = pipe(\n residency,\n option.fold(\n () => taskEither.right(undefined),\n residency =>\n pipe(\n props.submitResidencyCommand({ residency: residency }),\n taskEither.mapLeft(() => genericClientDataErrors)\n )\n )\n );\n\n const validator = taskEither.getTaskValidation(\n semigroup.getStructSemigroup({\n personalData: semigroup.getFirstSemigroup<\n Option>\n >(),\n permanentAddress: semigroup.getFirstSemigroup<\n Option>\n >(),\n documentDetails: semigroup.getFirstSemigroup<\n Option>\n >(),\n additionalDocumentDetails: semigroup.getLastSemigroup<\n Option>\n >(),\n generalError: semigroup.getLastSemigroup<\n Option>\n >(),\n })\n );\n\n return pipe(\n [mainSubmit, additionalSubmit, residencySubmit],\n array.sequence(validator),\n taskEither.mapLeft(e => ({\n ...e,\n generalError: pipe(\n e.generalError,\n option.chain(\n flow(\n array.uniq(eq.eqString),\n nonEmptyArray.fromArray\n )\n )\n ),\n }))\n );\n };\n\n const onContinue = (): TaskEither => {\n return isForeign\n ? taskEither.fromIO(() =>\n props.onContinue(latestClientExistencyCheckData.current)()\n )\n : pipe(\n props.onShouldClientContinue,\n option.fold(\n () => props.onContinue(latestClientExistencyCheckData.current),\n onShouldClientContinue =>\n pipe(\n latestClientExistencyCheckData.current,\n convertToCheckDataBn,\n taskEither.fromOption(constant(genericError)),\n taskEither.chain(clientExistencyCheck),\n taskEither.mapLeft(() => genericError),\n taskEither.chain(\n ({\n clientExists,\n duplicateContacts,\n hasBlockingNotes,\n personalNumberMatch,\n userID,\n clientNumber,\n }) =>\n pipe(\n onShouldClientContinue(\n clientExists,\n duplicateContacts,\n hasBlockingNotes,\n personalNumberMatch,\n userID,\n clientNumber\n ),\n taskEither.mapLeft(constant(genericError))\n )\n ),\n taskEither.chain(shouldContinue =>\n pipe(\n shouldContinue,\n boolean.fold(\n () => taskEither.left(genericError),\n () =>\n pipe(\n props.onContinue(\n latestClientExistencyCheckData.current\n ),\n taskEither.mapLeft(() => genericError)\n )\n )\n )\n )\n )\n ),\n taskEither.mapLeft(constant(genericClientDataErrors))\n );\n };\n\n const { fieldProps, handleSubmit } = useForm(\n {\n initialValues: {\n countryOfBirth: pipe(\n props.extractedData.personalData.countryOfBirth,\n option.filter(constant(askAdditionalPersonalData))\n ),\n addressSuggestion: option.none as Option,\n hasResidency: residencySupport ? props.hasResidency : option.none,\n secondCitizenshipField:\n props.extractedData.personalData.secondCitizenship,\n secondCitizenshipRadio: option.some(\n option.isSome(props.extractedData.personalData.secondCitizenship)\n ),\n },\n fieldValidators: values => ({\n countryOfBirth: askAdditionalPersonalData\n ? definedNoExtract()\n : undefined,\n addressSuggestion:\n option.isSome(props.extractedData.addressSuggestions) &&\n !props.extractedData.canEdit\n ? definedNoExtract()\n : undefined,\n hasResidency: residencySupport\n ? definedNoExtract()\n : undefined,\n secondCitizenshipRadio: definedNoExtract(),\n secondCitizenshipField: pipe(\n values.secondCitizenshipRadio,\n option.getOrElse(constFalse)\n )\n ? definedNoExtract()\n : undefined,\n }),\n },\n {\n onSubmit: ({\n countryOfBirth,\n addressSuggestion,\n hasResidency,\n secondCitizenshipRadio,\n secondCitizenshipField,\n }) => {\n const isCobSame = option\n .getEq(eq.eqString)\n .equals(\n countryOfBirth,\n props.extractedData.personalData.countryOfBirth\n );\n const hasSecondCitizenship = pipe(\n secondCitizenshipRadio,\n option.getOrElse(constFalse)\n );\n return pipe(\n state.id === \"notShared\" && !isCobSame\n ? pipe(countryOfBirth, submitCountryOfBirth)\n : taskEither.right(undefined),\n taskEither.chain(() => {\n return state.id === \"notShared\"\n ? selectAddressSuggestion(addressSuggestion)\n : taskEither.right(undefined);\n }),\n taskEither.chain(() => {\n return state.id === \"notShared\" && hasSecondCitizenship\n ? submitSecondCitizenship(secondCitizenshipField)\n : taskEither.right(undefined);\n }),\n taskEither.chain(() => {\n return pipe(\n sectionErrors,\n option.fold(\n () => taskEither.right(undefined),\n err => {\n if (canceled) {\n props.showMismatchDialog();\n }\n return taskEither.left(err);\n }\n )\n );\n }),\n taskEither.chain(() =>\n state.id === \"notShared\" && branchExperienceFeaturesActive\n ? taskEither.fromIO(() => dispatch(shareWithClientAction))\n : pipe(validateData(hasResidency), taskEither.chain(onContinue))\n ),\n taskEither.mapLeft(flow(option.some, setSectionErrors))\n );\n },\n }\n );\n\n const onEditData = (\n newClientData: ClientDataEdit,\n idType: DocumentPurpose,\n subform: keyof ClientDataEdit\n ) => {\n return pipe(\n props.editPersonalInfoCommand({\n clientData: newClientData,\n coApplicant: props.coApplicant,\n idType,\n }),\n taskEither.chain(() =>\n taskEither.fromIO(() => {\n pipe(\n sectionErrors,\n option.map(err => {\n const updatedSectionErrors = { ...err, [subform]: option.none };\n const { generalError, ...subformErrors } = updatedSectionErrors;\n const subformsHaveError = Object.values(subformErrors).some(\n option.isSome\n );\n if (subformsHaveError) {\n setSectionErrors(option.some(updatedSectionErrors));\n } else {\n setSectionErrors(option.none);\n }\n })\n );\n\n dispatch(editDataAction);\n if (newClientData.personalData) {\n latestClientExistencyCheckData.current = option.some(\n clientExistencyCheckDataFromPersonalData({\n ...newClientData.personalData,\n applicantIndex,\n })\n );\n }\n })\n )\n );\n };\n\n const documentsMismatchDialog = pipe(\n props.documentsMismatch,\n boolean.fold(constNull, () => {\n return (\n {\n setCanceled(true);\n return props.onMismatchDialogDismiss();\n }\n : () => flow(props.onReset, props.onMismatchDialogDismiss)(),\n },\n {\n variant: \"primary\",\n label: formatMessage(\n \"Identification.UploadDocuments.uploadedDocumentMismatchModal.uploadAgainButton.label\"\n ),\n action: flow(props.onUploadAgain, props.onMismatchDialogDismiss),\n },\n ]}\n />\n );\n })\n );\n\n const shareWithClientButtonProps = useShareWithClientButtonProps({\n branchExperienceState: state.id,\n action: handleSubmit,\n submitLabel: formatMessage(\"Identification.personalData.continue\"),\n disabled: isEditing || portalBlocked,\n });\n\n const actions = pipe(\n [\n option.fromPredicate(\n constant(props.extractedData.canUploadAgain)\n )({\n variant: \"secondary\",\n label: formatMessage(\"Identification.UploadDocuments.uploadAgain\"),\n action: props.onUploadAgain,\n }),\n option.some({\n variant: \"loading\",\n ...shareWithClientButtonProps,\n disabled: props.isWaitingForOpuAndCex,\n }),\n ],\n array.compact\n ) as [Action] | [Action, Action];\n\n const additionalPersonalDataProps: AdditionalPersonalDataProps = askAdditionalPersonalData\n ? {\n askAdditionalPersonalData: true,\n additionalPersonalData: {\n countryOfBirthFieldProps: {\n ...fieldProps(\"countryOfBirth\"),\n onChange: (value: Option) => {\n dispatch(editDataAction);\n fieldProps(\"countryOfBirth\").onChange(value);\n },\n },\n },\n }\n : { askAdditionalPersonalData: false };\n\n const addressSuggestionsProps: AddressSuggestionsProps = pipe(\n props.extractedData.addressSuggestions,\n option.filter(() => !props.extractedData.canEdit),\n option.fold(\n (): AddressSuggestionsProps => ({ mustSelectAddressSuggestion: false }),\n suggestions => ({\n mustSelectAddressSuggestion: true,\n addressSuggestionProps: {\n ...fieldProps(\"addressSuggestion\"),\n onChange: (value: Option) => {\n dispatch(editDataAction);\n fieldProps(\"addressSuggestion\").onChange(value);\n },\n },\n addressSuggestions: suggestions,\n })\n )\n );\n\n return (\n \n {props.banner}\n \n {showAdditionalChecks && }\n {showAdditionalChecks && (\n \n )}\n \n {/* The following fragment is a temporary workaround for: https://buildo.kaiten.io/space/29286/card/2311626 */}\n <>\n {state.id === \"sharedWithClient\" && (\n \n )}\n \n {residencySupport && (\n {\n fieldProps(\"hasResidency\").onChange(value);\n props.onResidencyChange(value);\n }}\n />\n )}\n\n \n {documentsMismatchDialog}\n \n );\n}\n","import { option, task } from \"fp-ts\";\nimport { constNull, constVoid, pipe } from \"fp-ts/function\";\nimport { Box, Button, Heading } from \"design-system\";\nimport { useFormatMessage } from \"../../intl\";\nimport { useState } from \"react\";\nimport { ClientDataCheck } from \"../../UploadDocuments/domain\";\nimport { Option } from \"fp-ts/Option\";\nimport { FraudCheckDialog } from \"../../UploadDocuments/FraudCheckDialog\";\nimport { CoApplicant, DocumentIdentificationFlow } from \"../../globalDomain\";\nimport { ChooseMobileDeviceDialog } from \"../../UploadDocuments/ChooseMobileDeviceDialog\";\nimport { MobileRecipientOptionType } from \"../../UploadDocuments/state\";\nimport { RemoteMobileDeviceDialog } from \"../../UploadDocuments/RemoteMobileDeviceDialog\";\nimport { useAppContext } from \"../../useAppContext\";\nimport { usePortalStatusContext } from \"../../PortalStatusContext\";\n\ntype DialogStatus =\n | {\n id: \"StartFraudCheck\";\n }\n | {\n id: \"FraudCheck\";\n fraudCheck: ClientDataCheck;\n recipient: MobileRecipientOptionType;\n }\n | {\n id: \"AdditionalFraudCheck\";\n fraudCheck: ClientDataCheck;\n };\n\ntype Props = {\n canUploadAgain: boolean;\n documentIdentificationFlow: DocumentIdentificationFlow;\n coApplicant: Option;\n onUploadAgain: () => unknown;\n onAbort: (reason: \"GenericError\" | \"MaxAttemptsReached\") => unknown;\n};\n\nexport function AdditionalChecks(props: Props) {\n const formatMessage = useFormatMessage();\n const [dialogStatus, setDialogStatus] = useState>(\n option.none\n );\n\n const {\n apiParameters: { channel },\n } = useAppContext();\n const { portalBlocked } = usePortalStatusContext();\n\n return (\n \n \n {formatMessage(\"Identification.UploadDocuments.additionalControls\")}\n \n \n setDialogStatus(option.some({ id: \"StartFraudCheck\" }))}\n disabled={portalBlocked}\n />\n {pipe(\n dialogStatus,\n option.fold(constNull, status => {\n switch (status.id) {\n case \"StartFraudCheck\":\n const fraudCheck = \"HologramFraudCheck\";\n return channel === \"3P_InPerson\" ? (\n setDialogStatus(option.none)}\n onSelectRecipient={recipient =>\n setDialogStatus(\n option.some({\n id: \"FraudCheck\",\n fraudCheck,\n recipient,\n })\n )\n }\n onUploadFromSameDevice={constVoid}\n onMockScannerUpload={option.none}\n mobileRecipientType=\"Banker\"\n type={fraudCheck}\n coApplicant={props.coApplicant}\n />\n ) : (\n setDialogStatus(option.none)}\n onSelect={recipient =>\n setDialogStatus(\n option.some({\n id: \"FraudCheck\",\n fraudCheck,\n recipient,\n })\n )\n }\n onMockScannerUpload={option.none}\n coApplicant={props.coApplicant}\n />\n );\n case \"FraudCheck\":\n return (\n setDialogStatus(option.none)}\n onError={props.onAbort}\n onFraudCheck={fraudCheck =>\n setDialogStatus(\n option.some({\n id: \"AdditionalFraudCheck\",\n fraudCheck,\n })\n )\n }\n onContinue={task.fromIO(() => setDialogStatus(option.none))}\n onUploadAgain={props.onUploadAgain}\n onAbort={() => props.onAbort(\"GenericError\")}\n />\n );\n case \"AdditionalFraudCheck\":\n return channel === \"3P_InPerson\" ? (\n \n setDialogStatus(\n option.some({\n id: \"FraudCheck\",\n fraudCheck: status.fraudCheck,\n recipient,\n })\n )\n }\n onUploadFromSameDevice={constVoid}\n onMockScannerUpload={option.none}\n mobileRecipientType=\"Banker\"\n type={status.fraudCheck}\n coApplicant={props.coApplicant}\n />\n ) : (\n \n setDialogStatus(\n option.some({\n id: \"FraudCheck\",\n fraudCheck: status.fraudCheck,\n recipient,\n })\n )\n }\n onMockScannerUpload={option.none}\n coApplicant={props.coApplicant}\n />\n );\n }\n })\n )}\n \n \n );\n}\n","import { useEffect, useState } from \"react\";\nimport { useFormatMessage } from \"../../intl\";\nimport {\n Box,\n Card,\n Stack,\n Heading,\n Button,\n Dialog,\n FormSection,\n FormRow,\n Form,\n ReadOnlyField,\n DropdownOption,\n Banner,\n ContentRow,\n useForm,\n} from \"design-system\";\nimport * as remoteData from \"../../RemoteData\";\n\nimport { option, taskEither } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { constNull, pipe, flow, constant } from \"fp-ts/function\";\nimport * as opuAndCexApi from \"./api\";\nimport { useValidators } from \"../../Common/useValidators\";\nimport { DropdownField } from \"../../Common/DropdownField/DropdownField\";\nimport { useCommand, useQuery } from \"../../useAPI\";\nimport { sequenceS } from \"fp-ts/Apply\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { usePortalStatusContext } from \"../../PortalStatusContext\";\n\ntype Props = {\n onOpuAndCexComplete: (success: Option) => void;\n showOpuAndCexError: boolean;\n isThirdParty?: boolean;\n disableEdit: boolean;\n};\n\nexport const BankerOPUAndCEXCard = (props: Props) => {\n const { defined } = useValidators();\n const [isDialogOpen, setIsDialogOpen] = useState(false);\n const { portalBlocked } = usePortalStatusContext();\n const formatMessage = useFormatMessage();\n const [branchInfo, refreshBranchInfo] = useQuery(\n props.isThirdParty\n ? opuAndCexApi.get3PBranchInfo\n : opuAndCexApi.getBankerBranchInfo\n );\n const [cexList, refreshCexList] = useQuery(opuAndCexApi.getCEXList);\n const [opuList, refreshOpuList] = useQuery(opuAndCexApi.getOPUList);\n const updateBranchInfo = useCommand(\n props.isThirdParty\n ? opuAndCexApi.edit3PBranchInfo\n : opuAndCexApi.editBankerBranchInfo\n );\n\n const refreshOPUAndCEXData = () => {\n refreshBranchInfo();\n refreshCexList();\n refreshOpuList();\n };\n\n const opuToLabel = (opu: opuAndCexApi.OPUType) =>\n formatMessage(\"Identification.OPUandCEX.OPU.info\", {\n branchCode: opu.branchCode,\n branchAddress: opu.branchAddress,\n });\n\n const opuToDropdownOption = (\n opu: opuAndCexApi.OPUType\n ): DropdownOption => ({\n value: opu.branchCode,\n label: opuToLabel(opu),\n });\n\n const cexToLabel = (cex: opuAndCexApi.CEXType) =>\n formatMessage(\"Identification.OPUandCEX.CEX.info\", {\n cexId: cex.id,\n cexName: cex.fullName,\n });\n\n const cexToDropdownOption = (\n cex: opuAndCexApi.CEXType\n ): DropdownOption => ({\n value: cex.id,\n label: cexToLabel(cex),\n });\n\n const { handleSubmit, fieldProps, setValues, values } = useForm(\n {\n initialValues: {\n opu: option.none as Option>,\n cex: option.none as Option>,\n },\n fieldValidators: _ => ({\n opu: defined(),\n cex: defined(),\n }),\n },\n {\n onSubmit: flow(\n data =>\n updateBranchInfo({\n branchCode: data.opu.value,\n cexCode: data.cex.value,\n }),\n taskEither.chain(() =>\n taskEither.fromIO(() => {\n refreshBranchInfo();\n setIsDialogOpen(false);\n })\n )\n ),\n }\n );\n const setFormValuesToFetchedValues = () => {\n pipe(\n sequenceS(remoteData.remoteData)({\n branchInfo,\n cexList,\n opuList,\n }),\n remoteData.fold(constNull, constNull, data => {\n const {\n branchInfo: { branchCode, cexCode: cexCodeOption },\n cexList,\n opuList,\n } = data;\n\n const fullCEX = pipe(\n cexCodeOption,\n option.fold(constNull, cexCode =>\n cexList.find(cexItem => cexItem.id === cexCode)\n )\n );\n const fullOPU = opuList.find(\n opuItem => opuItem.branchCode === branchCode\n );\n\n setValues({\n opu: !fullOPU\n ? values.opu\n : option.some(opuToDropdownOption(fullOPU)),\n cex: !fullCEX\n ? values.cex\n : option.some(cexToDropdownOption(fullCEX)),\n });\n })\n );\n };\n useEffect(() => {\n setFormValuesToFetchedValues();\n }, [branchInfo, cexList, opuList]);\n const dismissModal = () => {\n setFormValuesToFetchedValues();\n setIsDialogOpen(false);\n };\n\n const renderReadonlyForm = (data: { opuLabel: string; cexLabel: string }) => (\n \n \n \n \n \n \n );\n\n const opuOptions: Array> = pipe(\n opuList,\n remoteData.fold(constant([]), constant([]), list =>\n list.map(opuToDropdownOption)\n )\n );\n\n const cexOptions: Array> = pipe(\n cexList,\n remoteData.fold(constant([]), constant([]), list =>\n list.map(cexToDropdownOption)\n )\n );\n\n const opuFieldProps = fieldProps(\"opu\");\n const cexFieldProps = fieldProps(\"cex\");\n\n useEffect(() => {\n pipe(\n branchInfo,\n remoteData.fold(constNull, constNull, data => {\n const { cexCode: cexCodeOption } = data;\n props.onOpuAndCexComplete(cexCodeOption);\n })\n );\n }, [branchInfo]);\n\n return (\n <>\n {pipe(\n sequenceS(remoteData.remoteData)({\n branchInfo,\n cexList,\n opuList,\n }),\n remoteData.fold(\n constNull,\n () => (\n \n \n \n \n \n ),\n data => {\n const {\n branchInfo: { branchCode, cexCode: cexCodeOption },\n cexList,\n opuList,\n } = data;\n\n const fullCEX = pipe(\n cexCodeOption,\n option.fold(constNull, cexCode =>\n cexList.find(cexItem => cexItem.id === cexCode)\n )\n );\n\n const fullOPU =\n opuList.find(opuItem => opuItem.branchCode === branchCode) ||\n null;\n return (\n <>\n \n \n \n \n \n {formatMessage(\"Identification.OPUandCEX.title\")}\n \n {renderReadonlyForm({\n opuLabel: fullOPU ? opuToLabel(fullOPU) : \"-\",\n cexLabel: fullCEX ? cexToLabel(fullCEX) : \"-\",\n })}\n {props.showOpuAndCexError && (\n \n )}\n \n setIsDialogOpen(true)}\n disabled={props.disableEdit || portalBlocked}\n />\n \n \n \n \n );\n }\n )\n )}\n {isDialogOpen && (\n \n
\n \n \n \n
\n \n \n \n
\n \n \n \n \n )}\n \n );\n};\n","import {\n Body,\n Box,\n ContentRow,\n FormErrors,\n Space,\n Stack,\n useIsMobileLayout,\n LocalizedString,\n} from \"design-system\";\nimport { useFormatMessage } from \"../../intl\";\nimport * as idClasses from \"../../UploadDocuments/UploadId.treat\";\nimport OKExampleImage from \"./ok.png\";\nimport PartialExampleImage from \"./partial.png\";\nimport DarkExampleImage from \"./dark.png\";\nimport SunglassesExampleImage from \"./sunglasses.png\";\nimport { UploadImageButton } from \"../../UploadDocuments/UploadImageButton\";\nimport { boolean, option, taskEither } from \"fp-ts\";\nimport { lazy, Suspense, useState } from \"react\";\nimport { SelfieCheckStatus } from \"./types\";\nimport { MobileRecipientOptionType } from \"../../UploadDocuments/state\";\nimport { FraudCheckDialog } from \"../../UploadDocuments/FraudCheckDialog\";\nimport { constNull, pipe } from \"fp-ts/function\";\nimport { NextButton } from \"../../Common/NextButton\";\nimport {\n CoApplicantInput,\n DocumentIdentificationFlow,\n GenericError,\n genericError,\n UploadDocumentFlowType,\n} from \"../../globalDomain\";\nimport { Option } from \"fp-ts/Option\";\nimport { RemoteMobileDeviceDialog } from \"../../UploadDocuments/RemoteMobileDeviceDialog\";\nimport { SelfieCheckOverview } from \"./SelfieCheckOverview\";\nimport * as t from \"io-ts\";\n\nconst MobileCheckFlow = lazy(\n () => import(\"../../UploadDocuments/MobileIdUpload/MobileCheckFlow\")\n);\n\nconst MissingSelfieError = t.type({\n id: t.literal(\"Identification.selfiecheck.missingSelfieError\"),\n});\ntype MissingSelfieError = t.TypeOf;\nconst missingSelfieError: MissingSelfieError = {\n id: \"Identification.selfiecheck.missingSelfieError\",\n};\n\nconst ExampleImage = (props: {\n description: LocalizedString;\n image: string;\n isOk?: boolean;\n}) => (\n \n \n {props.description}\n \n \n \n {props.description}\n \n \n);\n\ntype Props = {\n resetProcess: () => unknown;\n onFailure: (reason: \"GenericError\" | \"MaxAttemptsReached\") => unknown;\n onContinue: () => unknown;\n canUploadAgain: boolean;\n onUploadAgain: () => unknown;\n documentIdentificationFlow: DocumentIdentificationFlow;\n productType: Option;\n} & CoApplicantInput;\n\nfunction foldStatus(\n status: SelfieCheckStatus,\n match: {\n whenReady: () => T;\n whenChooseRecipient: () => T;\n whenFraudCheck: (\n status: Extract\n ) => T;\n whenOverview: () => T;\n whenSelfieCheckOnSameDevice: () => T;\n }\n): T {\n switch (status.id) {\n case \"Ready\":\n return match.whenReady();\n case \"ChooseRecipient\":\n return match.whenChooseRecipient();\n case \"FraudCheck\":\n return match.whenFraudCheck(status);\n case \"Overview\":\n return match.whenOverview();\n case \"CheckOnSameDevice\":\n return match.whenSelfieCheckOnSameDevice();\n }\n}\n\nexport function SelfieCheck(props: Props) {\n const formatMessage = useFormatMessage();\n const isMobileLayout = useIsMobileLayout();\n\n const [status, setStatus] = useState({\n id: \"Ready\",\n });\n\n const [error, setError] = useState>(\n option.none\n );\n\n const toReady = () =>\n setStatus({\n id: \"Ready\",\n });\n\n const toChooseRecipient = () =>\n setStatus({\n id: \"ChooseRecipient\",\n });\n\n const toFraudCheck = (recipient: MobileRecipientOptionType) =>\n setStatus({\n id: \"FraudCheck\",\n recipient,\n });\n\n const toOverview = () =>\n setStatus({\n id: \"Overview\",\n });\n\n const toCheckOnSameDevice = () =>\n setStatus({\n id: \"CheckOnSameDevice\",\n });\n\n const Placeholder = (\n \n \n \n \n );\n const WrapInUI = (component: JSX.Element) => (\n \n \n {formatMessage(\"Identification.selfieCheck.description\")}\n \n \n \n \n \n {formatMessage(\"Identification.selfieCheck.howToTake\")}\n \n \n \n \n \n \n \n \n \n \n \n {component}\n \n [formatMessage(error.id)])\n )}\n />\n \n \n \n pipe(\n status.id === \"Overview\",\n boolean.fold(\n () => setError(option.some(missingSelfieError)),\n () => props.onContinue()\n )\n )\n )}\n />\n \n \n );\n return foldStatus(status, {\n whenReady: () => WrapInUI(Placeholder),\n whenChooseRecipient: () =>\n WrapInUI(\n \n ),\n whenFraudCheck: status =>\n WrapInUI(\n {\n switch (reason) {\n case \"GenericError\":\n return setError(option.some(genericError));\n case \"MaxAttemptsReached\":\n return props.onFailure(\"MaxAttemptsReached\");\n }\n }}\n onAbort={() => props.onFailure(\"GenericError\")}\n onUploadAgain={props.onUploadAgain}\n onFraudCheck={toChooseRecipient}\n onContinue={toOverview}\n />\n ),\n whenOverview: () => WrapInUI(),\n whenSelfieCheckOnSameDevice: () => (\n \n \n \n ),\n });\n}\n","export default __webpack_public_path__ + \"static/media/ok.f3629199.png\";","export default __webpack_public_path__ + \"static/media/partial.9215bac8.png\";","export default __webpack_public_path__ + \"static/media/dark.5c03c0ff.png\";","export default __webpack_public_path__ + \"static/media/sunglasses.77b702aa.png\";","import { useQuery } from \"../../useAPI\";\nimport * as api from \"../api\";\nimport { Box, ErrorBanner, Loader } from \"design-system\";\nimport { constant, constNull, pipe } from \"fp-ts/function\";\nimport { option } from \"fp-ts\";\nimport * as classes from \"../../UploadDocuments/UploadSummary.treat\";\nimport { srcFromBase64 } from \"../../UploadDocuments/utils\";\nimport * as remoteData from \"../../RemoteData\";\nimport { useFormatMessage } from \"../../intl\";\n\nexport function SelfieCheckOverview() {\n const [fraudCheckSelfie] = useQuery(api.fraudCheckSelfie);\n\n const formatMessage = useFormatMessage();\n return pipe(\n fraudCheckSelfie,\n remoteData.fold(\n () => ,\n () => ,\n ({ fileContent }) =>\n pipe(\n fileContent,\n option.fold(constNull, fileContent => (\n \n \n \n ))\n )\n )\n );\n}\n","import {\n Body,\n Box,\n Space,\n LocalizedString,\n ErrorBanner,\n Loader,\n} from \"design-system\";\nimport { array, option, task, taskEither } from \"fp-ts\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport {\n useFormatMessage,\n useFormatNonResidentsAdditionalDocumentsLabel,\n} from \"../../intl\";\nimport { constant, constNull, constVoid, pipe } from \"fp-ts/function\";\nimport { NextButton } from \"../../Common/NextButton\";\nimport { useCommand, useQuery } from \"../../useAPI\";\n\nimport { Option } from \"fp-ts/Option\";\nimport { ScannedDocument } from \"../../UploadDocuments/domain\";\nimport { CoApplicantInput } from \"../../globalDomain\";\nimport * as uploadApi from \"../api\";\nimport { DocumentUploadField } from \"./DocumentUploadField\";\nimport { NonResidentsAdditionalDocumentsType } from \"../../UKontoSecondPart/domain\";\nimport { Task } from \"fp-ts/Task\";\nimport { base64FileSize } from \"../PermanentAddress/base64FileSize\";\nimport { useState } from \"react\";\nimport * as ukontoApi from \"../../UKontoSecondPart/api\";\nimport * as remoteData from \"../../RemoteData\";\nimport { RestoreApplicationData } from \"../../UKontoSecondPart/api\";\nimport { MultipleDocumentsField } from \"./MultipleDocumentsField\";\n\ntype Error = \"SizeExceeding\" | \"FailureUpload\";\n\ntype Props = {\n onContinue: TaskEither;\n onFailure: () => unknown;\n disabled: boolean;\n onRemoveLastDoc: () => unknown;\n restoredData?: RestoreApplicationData;\n} & CoApplicantInput;\n\nexport function AdditionalDocuments(props: Props) {\n const formatMessage = useFormatMessage();\n const formatNonResidentsAdditionalDocumentsLabel = useFormatNonResidentsAdditionalDocumentsLabel();\n\n const [error, setError] = useState>(option.none);\n const saveApplication = useCommand(ukontoApi.saveWithParams);\n const uploadDocument = useCommand(uploadApi.additionalDocumentUpload);\n const removeDocument = useCommand(uploadApi.additionalDocumentRemove);\n const removeDocuments = useCommand(uploadApi.additionalDocumentsRemove);\n const [getAdditionalRequiredDocuments, refreshList] = useQuery(\n ukontoApi.getAdditionalRequiredDocuments,\n {\n requiredKeys: option.none,\n }\n );\n const [atLeastOneDocumentUploaded, setAtLeastOneDocumentUploaded] = useState(\n props.restoredData && props.restoredData.hasAdditionalDocuments\n ? props.restoredData.hasAdditionalDocuments\n : false\n );\n\n const maxMB = 20000000;\n\n const formatError = (error: Error): LocalizedString => {\n switch (error) {\n case \"FailureUpload\":\n return formatMessage(\"Identification.UploadDocuments.failure.message\");\n case \"SizeExceeding\":\n return formatMessage(\n \"Identification.UploadDocuments.failure.sizeExceeding\"\n );\n }\n };\n\n const onDocumentUpload = (\n documentKey: NonResidentsAdditionalDocumentsType,\n fileContent: ScannedDocument\n ): Task => {\n return pipe(\n fileContent,\n taskEither.fromPredicate(\n scannedDocument => base64FileSize(scannedDocument.base64) < maxMB,\n constant(\"SizeExceeding\")\n ),\n taskEither.chain(file =>\n pipe(\n uploadDocument({\n documentKey,\n fileContent: file.base64,\n coApplicant: props.coApplicant,\n }),\n taskEither.mapLeft(constant(\"FailureUpload\"))\n )\n ),\n taskEither.fold(\n m => task.fromIO(() => setError(option.some(m))),\n () =>\n pipe(\n task.fromIO(() => {\n setError(option.none);\n setAtLeastOneDocumentUploaded(true);\n refreshList();\n }),\n task.chain(() =>\n task.fromIO(() => {\n saveApplication({\n feStep: option.some(\"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\"),\n status: option.some(\"IN_PROGRESS\"),\n incomeInfo: option.none,\n transactionsInfo: option.none,\n })();\n return setError(option.none);\n })\n )\n )\n )\n );\n };\n\n const onDocumentRemove = (\n documentKey: NonResidentsAdditionalDocumentsType\n ): Task => {\n return pipe(\n removeDocument({ documentKey, coApplicant: props.coApplicant }),\n taskEither.fold(\n () => task.fromIO(constVoid),\n response =>\n pipe(\n task.fromIO(() => {\n setError(option.none);\n setAtLeastOneDocumentUploaded(response.atLeastOneDocUploaded);\n if (!response.atLeastOneDocUploaded) {\n props.onRemoveLastDoc();\n }\n refreshList();\n }),\n task.chain(() =>\n task.fromIO(() => {\n saveApplication({\n feStep: option.some(\"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\"),\n status: option.some(\"IN_PROGRESS\"),\n incomeInfo: option.none,\n transactionsInfo: option.none,\n })();\n return setError(option.none);\n })\n )\n )\n )\n );\n };\n\n const onRemoveDocuments = (\n documentKeys: Array\n ): Task => {\n return pipe(\n removeDocuments({ documentKeys, coApplicant: props.coApplicant }),\n taskEither.fold(\n () => task.fromIO(constVoid),\n response =>\n pipe(\n task.fromIO(() => {\n setError(option.none);\n setAtLeastOneDocumentUploaded(response.atLeastOneDocUploaded);\n refreshList();\n if (!response.atLeastOneDocUploaded) {\n props.onRemoveLastDoc();\n }\n }),\n task.chain(() =>\n task.fromIO(() => {\n saveApplication({\n feStep: option.some(\"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\"),\n status: option.some(\"IN_PROGRESS\"),\n incomeInfo: option.none,\n transactionsInfo: option.none,\n })();\n return setError(option.none);\n })\n )\n )\n )\n );\n };\n\n const onDocumentChange = (\n documentKey: NonResidentsAdditionalDocumentsType\n ) => (fileContent: Option): unknown => {\n return pipe(\n fileContent,\n option.fold(\n () => onDocumentRemove(documentKey),\n file => onDocumentUpload(documentKey, file)\n )\n )();\n };\n\n const loadingError = () => (\n \n {formatMessage(\"StandardLoan.UploadDocuments.loadingError\")}\n \n );\n\n const loader = () => (\n \n \n \n );\n\n const renderDocUploadField = (\n documentKey: NonResidentsAdditionalDocumentsType,\n uploaded: boolean\n ) => (\n \n \n \n \n \n \n );\n\n const renderMultipleDocUploadField = (\n documentKeys: Array,\n uploaded: boolean\n ) => (\n \n \n \n refreshList()),\n taskEither.chain(() =>\n taskEither.fromIO(() =>\n saveApplication({\n feStep: option.some(\"NON_RESIDENTS_ADDITIONAL_DOCUMENTS\"),\n status: option.some(\"IN_PROGRESS\"),\n incomeInfo: option.none,\n transactionsInfo: option.none,\n })()\n )\n )\n )}\n onRemove={onRemoveDocuments(documentKeys)}\n uploaded={uploaded}\n issues={option.none}\n disabled={props.disabled}\n disableMobileUpload\n coApplicant={props.coApplicant}\n />\n \n \n );\n\n const documentList = () => {\n return pipe(\n getAdditionalRequiredDocuments,\n remoteData.fold(loader, loadingError, response => {\n return pipe(\n response.additionalRequiredDocuments,\n option.fold(loadingError, documents => {\n return (\n \n {pipe(\n documents,\n array.map(document =>\n option.isSome(document.documentKey)\n ? renderDocUploadField(\n document.documentKey.value,\n document.uploaded\n )\n : option.isSome(document.documentKeys)\n ? renderMultipleDocUploadField(\n document.documentKeys.value,\n document.uploaded\n )\n : loadingError()\n )\n )}\n \n );\n })\n );\n })\n );\n };\n\n const content = pipe(\n \n \n \n {formatMessage(\n \"Identification.UploadDocuments.step1.otherDocument.description\"\n )}\n \n \n {documentList()}\n \n \n \n \n \n \n );\n\n return (\n \n {content}\n {pipe(\n error,\n option.fold(constNull, e => {formatError(e)})\n )}\n \n );\n}\n","import { useState } from \"react\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n Box,\n Button,\n FieldIssues,\n FileIcon,\n Heading,\n Issues,\n Launcher,\n LocalizedString,\n Stack,\n} from \"design-system\";\nimport { boolean, option, taskEither } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport { CoApplicantInput } from \"../../globalDomain\";\nimport { MultipleDocumentsDialog } from \"./MultipleDocumentsDialog\";\nimport { NonResidentsAdditionalDocumentsType } from \"../../UKontoSecondPart/domain\";\nimport {\n useFormatMessage,\n useFormatNonResidentsAdditionalDocumentsLabel,\n} from \"../../intl\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\n\ntype Props = {\n requiredDocuments: Array;\n onUploadComplete: TaskEither;\n onRemove: (\n requiredDocuments: Array\n ) => unknown;\n uploaded: boolean;\n disabled: boolean;\n issues: Option;\n id?: string;\n disableMobileUpload?: boolean;\n} & CoApplicantInput;\n\nexport function MultipleDocumentsField(props: Props) {\n const formatMessage = useFormatMessage();\n const formatNonResidentsAdditionalDocumentsLabel = useFormatNonResidentsAdditionalDocumentsLabel();\n\n const [isContentModalOpen, setIsContentModalOpen] = useState(false);\n\n const label = props.requiredDocuments\n .map(doc => formatNonResidentsAdditionalDocumentsLabel(doc))\n .join(\" + \");\n\n const launcherOrDocument = pipe(\n props.uploaded,\n boolean.fold(\n () => (\n setIsContentModalOpen(true)}\n icon={FileIcon}\n />\n ),\n () => (\n \n \n {label as LocalizedString}\n \n \n props.onRemove(props.requiredDocuments)}\n disabled={props.disabled}\n />\n \n \n )\n )\n );\n\n return (\n \n {launcherOrDocument}\n {isContentModalOpen && (\n {\n setIsContentModalOpen(false);\n props.onUploadComplete();\n })}\n title={label as LocalizedString}\n onDismiss={() => setIsContentModalOpen(false)}\n coApplicant={props.coApplicant}\n />\n )}\n {pipe(\n props.issues,\n option.map(issues => ),\n option.toNullable\n )}\n \n );\n}\n","import {\n Body,\n Box,\n Space,\n LocalizedString,\n ErrorBanner,\n Loader,\n Dialog,\n} from \"design-system\";\nimport { array, option, task, taskEither } from \"fp-ts\";\nimport {\n useFormatMessage,\n useFormatNonResidentsAdditionalDocumentsLabel,\n} from \"../../intl\";\nimport { constant, constNull, constVoid, pipe } from \"fp-ts/function\";\nimport { NextButton } from \"../../Common/NextButton\";\nimport { useCommand, useQuery } from \"../../useAPI\";\n\nimport { Option } from \"fp-ts/Option\";\nimport { ScannedDocument } from \"../../UploadDocuments/domain\";\nimport { CoApplicantInput } from \"../../globalDomain\";\nimport * as uploadApi from \"../api\";\nimport { DocumentUploadField } from \"./DocumentUploadField\";\nimport { NonResidentsAdditionalDocumentsType } from \"../../UKontoSecondPart/domain\";\nimport { Task } from \"fp-ts/Task\";\nimport { base64FileSize } from \"../PermanentAddress/base64FileSize\";\nimport { useState } from \"react\";\nimport * as ukontoApi from \"../../UKontoSecondPart/api\";\nimport * as remoteData from \"../../RemoteData\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\n\ntype Error = \"SizeExceeding\" | \"FailureUpload\";\n\ntype Props = {\n requiredDocuments: Array;\n onUploadComplete: TaskEither;\n onDismiss: () => unknown;\n title: LocalizedString;\n id?: string;\n} & CoApplicantInput;\n\nexport function MultipleDocumentsDialog(props: Props) {\n const formatMessage = useFormatMessage();\n const formatNonResidentsAdditionalDocumentsLabel = useFormatNonResidentsAdditionalDocumentsLabel();\n\n const [error, setError] = useState>(option.none);\n const uploadDocument = useCommand(uploadApi.additionalDocumentUpload);\n const removeDocument = useCommand(uploadApi.additionalDocumentRemove);\n const checkAllDocsUploaded = useCommand(ukontoApi.checkAllDocsUploaded);\n const [getAdditionalRequiredDocuments, refreshList] = useQuery(\n ukontoApi.getAdditionalRequiredDocuments,\n {\n requiredKeys: option.some(props.requiredDocuments),\n }\n );\n const [allDocumentsUploaded, setAllDocumentsUploaded] = useState(false);\n\n const maxMB = 20000000;\n\n const formatError = (error: Error): LocalizedString => {\n switch (error) {\n case \"FailureUpload\":\n return formatMessage(\"Identification.UploadDocuments.failure.message\");\n case \"SizeExceeding\":\n return formatMessage(\n \"Identification.UploadDocuments.failure.sizeExceeding\"\n );\n }\n };\n\n const onDocumentUpload = (\n documentKey: NonResidentsAdditionalDocumentsType,\n fileContent: ScannedDocument\n ): Task => {\n return pipe(\n fileContent,\n taskEither.fromPredicate(\n scannedDocument => base64FileSize(scannedDocument.base64) < maxMB,\n constant(\"SizeExceeding\")\n ),\n taskEither.chain(file =>\n pipe(\n uploadDocument({\n documentKey,\n fileContent: file.base64,\n coApplicant: props.coApplicant,\n }),\n taskEither.mapLeft(constant(\"FailureUpload\"))\n )\n ),\n taskEither.fold(\n m => taskEither.fromIO(() => setError(option.some(m))),\n () =>\n pipe(\n taskEither.fromIO(() => {\n setError(option.none);\n refreshList();\n }),\n taskEither.chain(() =>\n checkAllDocsUploaded({ requiredKeys: props.requiredDocuments })\n ),\n taskEither.chain(response =>\n taskEither.fromIO(() => {\n setAllDocumentsUploaded(response.allDocsUploaded);\n })\n )\n )\n )\n );\n };\n\n const onDocumentRemove = (\n documentKey: NonResidentsAdditionalDocumentsType\n ): Task => {\n return pipe(\n removeDocument({ documentKey, coApplicant: props.coApplicant }),\n taskEither.fold(\n () => task.fromIO(constVoid),\n () =>\n task.fromIO(() => {\n setError(option.none);\n setAllDocumentsUploaded(false);\n refreshList();\n })\n )\n );\n };\n\n const onDocumentChange = (\n documentKey: NonResidentsAdditionalDocumentsType\n ) => (fileContent: Option): unknown => {\n return pipe(\n fileContent,\n option.fold(\n () => onDocumentRemove(documentKey),\n file => onDocumentUpload(documentKey, file)\n )\n )();\n };\n\n const loadingError = () => (\n \n {formatMessage(\"StandardLoan.UploadDocuments.loadingError\")}\n \n );\n\n const loader = () => (\n \n \n \n );\n\n const renderDocUploadField = (\n documentKey: NonResidentsAdditionalDocumentsType,\n uploaded: boolean\n ) => (\n \n \n \n \n \n \n );\n\n const documentList = () => {\n return pipe(\n getAdditionalRequiredDocuments,\n remoteData.fold(loader, loadingError, response => {\n return pipe(\n response.additionalRequiredDocuments,\n option.fold(loadingError, documents => {\n return (\n \n {pipe(\n documents,\n array.map(document =>\n option.isSome(document.documentKey)\n ? renderDocUploadField(\n document.documentKey.value,\n document.uploaded\n )\n : loadingError()\n )\n )}\n \n );\n })\n );\n })\n );\n };\n\n const content = pipe(\n \n \n \n {formatMessage(\n \"Identification.UploadDocuments.step1.otherDocument.description\"\n )}\n \n \n {documentList()}\n \n \n \n \n \n \n );\n\n return (\n \n \n {content}\n {pipe(\n error,\n option.fold(constNull, e => (\n {formatError(e)}\n ))\n )}\n \n \n );\n}\n","import * as remoteData from \"../RemoteData\";\nimport { RemoteData } from \"../RemoteData\";\nimport {\n DropdownOption,\n LocalizedString,\n SuggestionsStatus,\n unsafeLocalizedString,\n} from \"design-system\";\nimport { constant, pipe } from \"fp-ts/function\";\nimport {\n Address,\n AddressCountries,\n AddressOCR,\n AddressWrite,\n CitySuggestion,\n} from \"./domain\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { option } from \"fp-ts\";\n\nimport { CountryCode } from \"../globalDomain\";\nimport { useAppContext } from \"../useAppContext\";\nimport { CountryFlag } from \"../Common/CountryFlag/CountryFlag\";\nimport { Option } from \"fp-ts/Option\";\n\nexport function autocompleteInputStatusFromRemoteData(\n query: RemoteData,\n suggestionsMap: (suggestion: I) => DropdownOption\n): SuggestionsStatus {\n return pipe(\n query,\n remoteData.fold(\n constant({\n status: \"loading\",\n } as SuggestionsStatus),\n constant({ status: \"ready\", suggestions: [] }),\n (suggestions, isLoading) =>\n isLoading\n ? {\n status: \"loading\",\n }\n : {\n status: \"ready\",\n suggestions: suggestions.map(suggestionsMap),\n }\n )\n );\n}\n\nexport type AddressFormState = {\n streetName: string;\n streetNumber: string;\n city: string;\n provinceName: string;\n zipCode: string;\n country: CountryCode;\n confirmed: boolean;\n};\n\nexport type AddressSuggestionFormState = {\n address: Option;\n};\n\nexport function formStateFromAddress(address: Address): AddressFormState {\n return {\n ...address,\n city: pipe(\n address.city,\n option.fold(constant(\"\"), () =>\n formatProvinceCity(address.provinceName, address.city)\n )\n ),\n zipCode: pipe(address.zipCode, option.getOrElse(constant(\"\"))),\n streetName: pipe(address.streetName, option.getOrElse(constant(\"\"))),\n streetNumber: pipe(address.streetNumber, option.getOrElse(constant(\"\"))),\n provinceName: pipe(address.provinceName, option.getOrElse(constant(\"\"))),\n confirmed: false,\n };\n}\n\nexport function formStateFromAddressOCR(\n address: AddressOCR,\n defaultCountry: CountryCode\n): AddressFormState {\n return {\n streetName: pipe(address.streetName, option.getOrElse(constant(\"\"))),\n streetNumber: pipe(address.streetNumber, option.getOrElse(constant(\"\"))),\n city: formatProvinceCity(address.provinceName, address.city),\n zipCode: pipe(address.zipCode, option.getOrElse(constant(\"\"))),\n country: pipe(address.country, option.getOrElse(constant(defaultCountry))),\n provinceName: pipe(address.provinceName, option.getOrElse(constant(\"\"))),\n confirmed: false,\n };\n}\n\nexport function countryToDropdownOption(\n country: AddressCountries[number]\n): DropdownOption {\n return {\n value: country.countryCode,\n label: country.label,\n icon: pipe(\n country.tenant,\n option.map(tenant => ),\n option.toUndefined\n ),\n };\n}\n\nexport function addressWriteToDropdownOption(\n address: AddressWrite\n): DropdownOption {\n const unwrapOptionalString = (value: Option) =>\n pipe(\n value,\n option.getOrElse(() => \"\")\n );\n\n return {\n value: address,\n label: unsafeLocalizedString(\n `${unwrapOptionalString(address.streetName)}, ${\n address.provinceName\n }, ${unwrapOptionalString(address.streetNumber)}, ${unwrapOptionalString(\n address.zipCode\n )} ${unwrapOptionalString(address.city)}`\n ),\n };\n}\n\nexport function mapCountriesToOptions(\n countries: AddressCountries\n): Array> {\n return countries.map(countryToDropdownOption);\n}\n\nexport function getCitySuggestionLabel({\n cityName,\n provinceName,\n}: CitySuggestion) {\n return unsafeLocalizedString(`${cityName}, ${provinceName}`);\n}\n\nexport function formatProvinceCity(\n provinceName: Option,\n cityName: Option\n): LocalizedString {\n return pipe(\n cityName,\n option.map(city =>\n pipe(provinceName, option.fold(constant(city), constant(city)))\n ),\n option.getOrElse(constant(\"\")),\n unsafeLocalizedString\n );\n}\n\nexport function useDefaultCountryCode(): CountryCode {\n const {\n apiParameters: { tenant },\n } = useAppContext();\n switch (tenant) {\n case \"CZ\":\n return \"CZE\" as CountryCode;\n case \"SK\":\n return \"SVK\" as CountryCode;\n }\n}\n\nexport function addressWriteToAddress(a: AddressWrite): Address {\n return { ...a };\n}\n\nexport function addressWriteToAddressOCR(a: AddressWrite): AddressOCR {\n return {\n ...a,\n streetName: a.streetName,\n streetNumber: a.streetNumber,\n city: a.city,\n country: option.some(a.country),\n provinceName: a.provinceName,\n };\n}\n","import { DropdownOption } from \"design-system\";\nimport { AllSupportedCitizenships, Citizenship } from \"../../domain\";\nimport { constant, identity, pipe } from \"fp-ts/function\";\nimport { record, nonEmptyArray, array, option } from \"fp-ts\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { useFormatCitizenship } from \"../../../intl\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n DropdownField,\n DropdownFieldProps,\n} from \"../../../Common/DropdownField/DropdownField\";\nimport { useQuery } from \"../../../useAPI\";\nimport * as idUploadApi from \"../../api\";\nimport * as remoteData from \"../../../RemoteData\";\n\ntype Props = Omit<\n DropdownFieldProps,\n \"options\" | \"value\" | \"onChange\" | \"searchable\"\n> & {\n value: Option;\n onChange: (citizenship: Option) => unknown;\n supportForeign: boolean;\n};\n\nexport function CitizenshipDropdown(props: Props) {\n const countries = pipe(\n useQuery(idUploadApi.allCountries),\n ([result]) => result,\n remoteData.fold(constant([]), constant([]), identity)\n );\n\n const formatCitizenship = useFormatCitizenship();\n\n const options = pipe(\n props.supportForeign ? AllSupportedCitizenships.keys : Citizenship.keys,\n rec => record.keys(rec) as NonEmptyArray,\n nonEmptyArray.map(citizenship => ({\n value: citizenship,\n label: formatCitizenship(citizenship, countries),\n }))\n );\n\n const value = pipe(\n props.value,\n option.chain(value =>\n pipe(\n options,\n array.findFirst(o => o.value === value)\n )\n )\n );\n\n const onChange = (\n value: Option>\n ) => {\n props.onChange(\n pipe(\n value,\n option.map(v => v.value)\n )\n );\n };\n\n return (\n \n );\n}\n","import {\n Form,\n FormRow,\n FormSection,\n useForm,\n LocalizedString,\n} from \"design-system\";\n\nimport { AddressWrite } from \"../domain\";\nimport { AddressSuggestionFormState } from \"../addressFormUtils\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { AddressSuggestionsDropdown } from \"./AddressSuggestionsDropdown\";\nimport { constant, pipe } from \"fp-ts/function\";\nimport { option, taskEither } from \"fp-ts\";\nimport { useFormatMessage } from \"../../intl\";\nimport { useValidators } from \"../../Common/useValidators\";\n\ntype Props = {\n onSubmit: (address: AddressWrite) => TaskEither;\n onCancel?: () => unknown;\n addressSuggestions: NonEmptyArray;\n errorMessage: LocalizedString;\n};\n\nexport function AddressSuggestionForm(props: Props) {\n const formatMessage = useFormatMessage();\n\n const { defined } = useValidators();\n\n const initialValues: AddressSuggestionFormState = {\n address: option.none,\n };\n const { fieldProps, handleSubmit } = useForm(\n {\n initialValues,\n fieldValidators: _ => ({\n address: defined(),\n }),\n },\n {\n onSubmit: ({ address }) =>\n pipe(\n props.onSubmit(address),\n taskEither.mapLeft(\n constant([\n formatMessage(\"Identification.validationAddress.genericError\"),\n ])\n )\n ),\n }\n );\n\n const cancelButton = props.onCancel && {\n action: props.onCancel,\n label: formatMessage(\"Identification.address.cancel\"),\n };\n\n return (\n \n \n \n \n \n \n \n );\n}\n","import { AllSupportedCitizenships, PersonalData } from \"../../domain\";\nimport { option, taskEither } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport {\n Box,\n Button,\n LocalizedString,\n Space,\n useForm,\n Validator,\n validators,\n} from \"design-system\";\nimport { useFormatMessage } from \"../../../intl\";\nimport { FormState, PersonalDataForm } from \"./PersonalDataForm\";\n\nimport { Option } from \"fp-ts/Option\";\nimport { CountryCode, Sex } from \"../../../globalDomain\";\nimport { useValidators } from \"../../../Common/useValidators\";\nimport { isForeign } from \"../../utils\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { DocumentType } from \"../../../UploadDocuments/domain\";\n\nconst nameForbiddenChars = /[\\^<>\\\\$#ß*%`˙~đĐ\\[\\]®™€×¤{}÷]/;\n\ntype Props = {\n initialValues: FormState;\n onValidate: Validator;\n onSave: (personalData: PersonalData) => unknown;\n onCancel: () => unknown;\n displayCountryOfBirth: boolean;\n supportForeign: boolean;\n documentType: DocumentType;\n};\n\nexport function PersonalDataFormEdit(props: Props) {\n const formatMessage = useFormatMessage();\n\n const {\n nonBlankString,\n defined,\n definedNoExtract,\n validBirthDate,\n validBirthNumber,\n maxLength,\n } = useValidators();\n\n const nameValidator = (\n errorMessage: LocalizedString\n ): Validator =>\n validators.fromPredicate(s => !nameForbiddenChars.test(s), errorMessage);\n\n const { fieldProps, handleSubmit, formErrors } = useForm(\n {\n initialValues: props.initialValues,\n fieldValidators: values => {\n return {\n name: validators.inSequence(\n nonBlankString,\n validators.maxLength(\n 25,\n formatMessage(\"Identification.personalData.nameLengthError\")\n ),\n nameValidator(\n formatMessage(\"Form.fieldError.disableSpecialCharacters\")\n )\n ),\n surname: validators.inSequence(\n nonBlankString,\n validators.maxLength(\n 25,\n formatMessage(\"Identification.personalData.surnameLengthError\")\n ),\n nameValidator(\n formatMessage(\"Form.fieldError.disableSpecialCharacters\")\n )\n ),\n sex: defined(),\n citizenship: defined(),\n dateOfBirth: validators.inSequence(\n defined>(),\n validBirthDate\n ),\n placeOfBirth: validators.inSequence(nonBlankString, maxLength(30)),\n countryOfBirth: props.displayCountryOfBirth\n ? definedNoExtract()\n : undefined,\n birthNumber: isForeign(values.citizenship)\n ? undefined\n : validators.inSequence(\n defined(),\n validBirthNumber\n ),\n };\n },\n },\n {\n onSubmit: values =>\n pipe(\n {\n ...values,\n birthNumber: NonEmptyString.is(values.birthNumber)\n ? option.some(values.birthNumber)\n : values.birthNumber,\n secondCitizenship: option.none,\n },\n props.onValidate,\n taskEither.chain(values =>\n taskEither.fromIO(() => props.onSave(values))\n )\n ),\n }\n );\n\n return (\n \n \n \n \n \n \n \n \n \n );\n}\n","import { PersonalDocument } from \"../../domain\";\nimport { option, taskEither, either } from \"fp-ts\";\nimport { useFormatMessage } from \"../../../intl\";\nimport { PersonalDocumentForm } from \"./PersonalDocumentForm\";\nimport {\n useForm,\n Box,\n Button,\n Space,\n Validator,\n validators,\n LocalizedString,\n} from \"design-system\";\nimport { FormState } from \"../PersonalDocumentForm/PersonalDocumentForm\";\nimport { Option } from \"fp-ts/Option\";\nimport { DocumentType } from \"../../../UploadDocuments/domain\";\nimport { useValidators } from \"../../../Common/useValidators\";\nimport { flow, pipe } from \"fp-ts/function\";\n\ntype Props = {\n documentType: DocumentType;\n initialValues: FormState;\n onValidate: Validator;\n onSave: (personalDocument: PersonalDocument) => unknown;\n onCancel: () => unknown;\n authorityMandatory: boolean;\n issuerMandatory: boolean;\n};\n\nexport function PersonalDocumentFormEdit(props: Props) {\n const formatMessage = useFormatMessage();\n\n const { nonBlankString, defined, validDate } = useValidators();\n\n const { fieldProps, handleSubmit, formErrors } = useForm(\n {\n initialValues: props.initialValues,\n fieldValidators: ({ validUntil }) => ({\n idNumber: nonBlankString,\n authority: props.authorityMandatory\n ? validators.inSequence(\n validators.definedNoExtract(\n formatMessage(\"Form.fieldError.required\")\n ),\n validators.validateIfDefined(nonBlankString)\n )\n : undefined,\n issuer: props.issuerMandatory\n ? validators.inSequence(\n validators.definedNoExtract(\n formatMessage(\"Form.fieldError.required\")\n ),\n validators.validateIfDefined(nonBlankString)\n )\n : undefined,\n dateOfIssuing: validators.inSequence(\n defined>(),\n validDate,\n validators.fromPredicate(\n p => p <= new Date(),\n formatMessage(\"Form.fieldError.issuingAfterToday\")\n ),\n validators.fromPredicate(p => {\n return option.isSome(validUntil) && option.isSome(validUntil.value)\n ? validUntil.value.value > p\n : true;\n }, formatMessage(\"Form.fieldError.validUntilBeforeIssuing\"))\n ),\n validUntil: pipe(\n props.initialValues.validUntil,\n option.fold(\n () =>\n validators.validator(\n option.fold(\n () =>\n either.right>(option.none),\n () => either.left(formatMessage(\"Form.fieldError.notBlank\"))\n )\n ),\n () =>\n validators.inSequence(\n defined(),\n validDate,\n validators.fromPredicate(\n p => p > new Date(),\n formatMessage(\"Form.fieldError.validDateExpired\")\n ),\n validDate => taskEither.of(option.some(validDate))\n )\n )\n ),\n }),\n },\n {\n onSubmit: flow(\n props.onValidate,\n taskEither.chain(values =>\n taskEither.fromIO(() => props.onSave(values))\n )\n ),\n }\n );\n\n return (\n \n \n \n \n \n \n \n \n \n );\n}\n","import { DropdownOption } from \"design-system\";\nimport { constant, pipe } from \"fp-ts/function\";\nimport { array, option } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { useQuery } from \"../../../useAPI\";\nimport * as api from \"../../api\";\nimport * as remoteData from \"../../../RemoteData\";\nimport {\n DropdownField,\n DropdownFieldProps,\n} from \"../../../Common/DropdownField/DropdownField\";\n\ntype Props = Omit<\n DropdownFieldProps,\n \"options\" | \"value\" | \"onChange\" | \"searchable\"\n> & {\n value: Option;\n onChange: (titleAfter: Option) => unknown;\n};\n\nexport function AuthorityDropdown(props: Props) {\n const [authorities] = useQuery(api.documentAuthorities);\n\n const options = pipe(\n authorities,\n remoteData.fold(constant([]), constant([]), authorities =>\n authorities.map(authority => ({\n value: authority,\n label: authority,\n }))\n )\n );\n\n const value = pipe(\n props.value,\n option.chain(value =>\n pipe(\n options,\n array.findFirst(o => o.value.toUpperCase() === value.toUpperCase())\n )\n )\n );\n\n const onChange = (value: Option>) => {\n props.onChange(\n pipe(\n value,\n option.map(v => v.value)\n )\n );\n };\n\n return (\n \n );\n}\n","import { Option } from \"fp-ts/Option\";\nimport {\n ComputedFieldProps,\n Box,\n Form,\n FormRow,\n FormSection,\n} from \"design-system\";\n\nimport { CountryCode } from \"../../../globalDomain\";\nimport { CountryOfBirthDropdown } from \"../CountryOfBirthDropdown\";\n\ntype Props = {\n countryOfBirthFieldProps: ComputedFieldProps>;\n};\n\nexport function AdditionalPersonalDataForm(props: Props) {\n return (\n \n
\n \n \n \n <>\n \n \n
\n
\n );\n}\n","import {\n Form,\n FormRow,\n FormSection,\n ComputedFieldProps,\n LocalizedString,\n} from \"design-system\";\n\nimport { AddressWrite } from \"../domain\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { AddressSuggestionsDropdown } from \"../AddressForm/AddressSuggestionsDropdown\";\nimport { option } from \"fp-ts\";\n\nimport { Option } from \"fp-ts/Option\";\n\ntype Props = {\n suggestionProps: ComputedFieldProps>;\n addressSuggestions: NonEmptyArray;\n errorMessage: LocalizedString;\n};\n\nexport function AddressSuggestionsForm(props: Props) {\n return (\n
\n \n \n \n \n \n
\n );\n}\n","import * as t from \"io-ts\";\nimport { apiCall } from \"../../APICall\";\nimport { Eq } from \"fp-ts/Eq\";\nimport { eq, option } from \"fp-ts\";\nimport {\n DateFromSQLString,\n DocumentPurpose,\n optionFromUndefined,\n} from \"../../globalDomain\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport {\n AddressOCR,\n AllCitizenships,\n AllSupportedCitizenships,\n PersonalDataOCR,\n PersonalDocumentOCR,\n} from \"../domain\";\nimport {\n ApplicationLimitError,\n eqWithApplicantIndex,\n withApplicantIndex,\n} from \"../../MortgageDashboard/domain\";\nimport { DocumentType } from \"../../UploadDocuments/domain\";\n\nexport const CheckExistingClientInput = withApplicantIndex(\n t.type(\n {\n dateOfBirth: DateFromSQLString,\n lastAndFirstName: NonEmptyString,\n personalNumber: NonEmptyString,\n citizenship: AllSupportedCitizenships,\n },\n \"CheckExistingClientInput\"\n )\n);\nexport type CheckExistingClientInput = t.TypeOf<\n typeof CheckExistingClientInput\n>;\nexport const eqCheckExistingClientInput: Eq = eqWithApplicantIndex(\n eq.getStructEq({\n dateOfBirth: eq.eqDate,\n lastAndFirstName: eq.eqString,\n personalNumber: eq.eqString,\n citizenship: eq.eqString,\n })\n);\n\nexport const CheckExistingClientOutput = t.type(\n {\n existingClient: t.boolean,\n duplicateContacts: t.boolean,\n hasBlockingNotes: t.boolean,\n multipleUsers: t.boolean,\n personalNumberMatch: t.boolean,\n clientNumber: optionFromUndefined(NonEmptyString),\n userID: optionFromUndefined(NonEmptyString),\n },\n \"CheckExistingClientOutput\"\n);\n\nexport type CheckExistingClientOutput = t.TypeOf<\n typeof CheckExistingClientOutput\n>;\n\nexport const checkExistingClient = apiCall({\n path: [\"clients\", \"checkExisting\"],\n inputCodec: CheckExistingClientInput,\n inputEq: eqCheckExistingClientInput,\n outputCodec: CheckExistingClientOutput,\n errorCodec: ApplicationLimitError,\n});\n\nconst GetClientDataForConfirmationInput = t.type(\n {\n idType: optionFromUndefined(DocumentPurpose),\n },\n \"GetClientDataForConfirmationInput\"\n);\n\nconst eqGetClientDataForConfirmationInput = eq.getStructEq({\n idType: option.getEq(eq.eqStrict),\n});\n\nconst GetClientDataForConfirmationOutput = t.type(\n {\n documentType: DocumentType,\n personalData: t.intersection([\n PersonalDataOCR,\n t.type({ secondCitizenship: optionFromUndefined(AllCitizenships) }),\n ]),\n documentDetails: PersonalDocumentOCR,\n secondaryDocumentType: optionFromUndefined(DocumentType),\n secondaryDocumentDetails: optionFromUndefined(PersonalDocumentOCR),\n permanentAddress: optionFromUndefined(AddressOCR),\n },\n \"GetClientDataForConfirmationInput\"\n);\n\nexport const getClientDataForConfirmation = apiCall({\n path: [\n \"packages\",\n \"uKonto\",\n \"identification\",\n \"potentialClient\",\n \"getClientDataForConfirmation\",\n ],\n inputCodec: GetClientDataForConfirmationInput,\n inputEq: eqGetClientDataForConfirmationInput,\n outputCodec: GetClientDataForConfirmationOutput,\n});\n"],"sourceRoot":""}