{"version":3,"sources":["useAPI.ts","useAPIEndpoint.ts","index.tsx","VirtualCards/api.ts","authorizationApi.ts","useAppContext.ts","useSnackbar.ts","UploadDocuments/clientExistenceUtils.ts","UploadDocuments/UploadId.treat.ts","config.ts","UploadDocuments/idcard_cz.png","UploadDocuments/idcard_sk.png","UploadDocuments/RemoteMobileDeviceDialog.tsx","UploadDocuments/passport_cz.png","UploadDocuments/drivinglicense_cz.png","VersionCheck/Utils.ts","UploadDocuments/UploadModeDialog.tsx","UploadDocuments/passport_sk.png","UploadDocuments/drivinglicense_sk.png","logger.ts","fingerprint.ts","parseLocation.ts","UploadDocuments/UploadModeDialogWithMobile.tsx","UploadDocuments/UploadImageButton.treat.ts","UploadDocuments/UploadSummary.treat.ts","UploadDocuments/domain.ts","globalDomain.ts","useChannel.ts","UploadDocuments/ScanDocument.tsx","UploadDocuments/UploadImageButton.tsx","useRemoteData.ts","VirtualCards/CustomCard.tsx","internetRouter.ts","UploadDocuments/UploadDocuments.tsx","UploadDocuments/ScannerIdUpload/ScannerIdUpload.tsx","UploadDocuments/ScannerIdUpload/ScannerIdUpload.treat.ts","UploadDocuments/UploadAgainDialog.tsx","UploadDocuments/RedoFraudCheckDialog.tsx","UploadDocuments/useCheckClientDataResult.tsx","UploadDocuments/idcard_back_cz.png","UploadDocuments/idcard_back_sk.png","VirtualCards/VirtualCardsCommon.tsx","VirtualCards/VirtualCards.tsx","VersionCheck/NewVersionAlert.tsx","VersionCheck/useVersionCheck.ts","UploadDocuments/UploadSummary.tsx","intl.tsx","UploadDocuments/utils.ts","UploadDocuments/api.ts","VersionCheck/VersionChecker.tsx","VirtualCards/CustomCard.treat.ts","UploadDocuments/state.ts"],"names":["handleFailure","onUnauthorized","onBlockedPortal","e","pipe","UnauthorizedError","decode","either","fold","PortalBlocked","taskEither","left","fromIO","chain","genericError","useCommand","apiCall","config","apiEndpoint","useAPIEndpoint","apiParameters","useAppContext","trackSubmission","useLoadingStatusWrite","authInfo","refreshToken","logout","useAuthenticationContext","retrieveCurrentPortalStatus","checkPortalBlocked","setAlertModalVisible","usePortalStatusContext","onPortalBlocked","input","fetch","tokenInfo","flowId","option","map","d","chainFirst","newTokenInfo","output","orElse","skipTracking","identity","useAPI","inputEquality","refreshCall","useStableEquality","inputEq","useMemo","useQuery","task","refresh","useRemoteData","usePolling","remoteResult","useEffect","remoteData","constFalse","constTrue","shouldPollingContinue","timeout","window","setTimeout","intervalMS","clearTimeout","usePollingEffect","inProgress","setInProgress","useState","disabled","then","data","refinedData","constVoid","onError","onSuccess","reset","cancel","catch","useTimeoutFn","apiPort","ctx","useContext","BuildConfigContext","isNone","Error","value","useBuildConfigContext","constant","replace","getOrElse","location","protocol","hostname","port","setupLogging","addEventListener","console","log","ReactDOM","render","document","getElementById","PhysicalCardInput","t","checkboxValue","InitVirtualCardResponse","packageType","physicalCardSelected","optionFromNullable","saveCardTypeSelection","path","eq","fromEquals","inputCodec","outputCodec","anonymousToken","AuthenticationInfo","potentialClientRemoteToken","potentialClientToken","UUID","TokenInfo","SSOLoginInput","jwtReference","eqSSOLoginInput","getStructEq","eqString","ssoLogin","LoginOutput","GenerateIdentifiedClientTokenOutput","generateIdentifiedClientToken","AppContext","useSnackBar","SnackBarContext","personalNumberFromBirthNumber","flow","birthNumber","NonEmptyString","fromEither","convertToCheckDataBn","checkData","birthnumber","result","none","some","bn","trace","clientExistencyCheckDataFromClientData","clientData","name","personalData","surname","dateOfBirth","citizenship","filter","x","sequenceS","applicantIndex","clientExistencyCheckDataFromClientDataAuth","clientExistencyCheckDataFromPersonalData","inputFromClientExistencyCheckData","personalNumber","lastAndFirstName","useClientExistencyCheck","clientExistencyCommand","defaultError","fromOption","bimap","existingClient","duplicateContacts","hasBlockingNotes","multipleUsers","personalNumberMatch","userID","clientNumber","clientExists","clientExistencyCheckData","clientExistencyCheck","imageWrapper","divider","hintIcon","BuildConfigCodec","REACT_APP_API_ENDPOINT","REACT_APP_API_PORT","NumberFromString","PositiveInteger","buildConfig","process","errors","failure","join","env","foldType","type","match","RemoteMobileDeviceDialog","props","os","isIOS","isMobile","useDeviceUA","formatMessage","useFormatMessage","isMobileLayout","useIsMobileLayout","recipients","uploadApi","coApplicant","linkPurpose","foldMobileFlowType","ProofOfIncome","DocumentUpload","SelfieFraudCheck","HologramFraudCheck","HologramAndSelfieFraudCheck","isIOSNewerVersion","version","major","minor","showUploadFromSameDevice","mockScanner","title","description","sendLinkAction","recipient","variant","label","action","onSelectRecipient","actions","mobileRecipientType","phoneNumber","key","onUploadFromSameDevice","size","subtitle","onDismiss","icon","MobileUploadIDIcon","column","grow","shrink","units","hAlignContent","vAlignContent","constNull","text","onMockScannerUpload","unsafeLocalizedString","getCurrentBuildVersion","r","UploadModeDialog","portalBlocked","mode","setMode","options","mobileFeatureStatus","push","onConfirm","onChange","optionKey","isOptionDisabled","renderOption","uploadMode","renderOptionChildren","renderOptionIcon","issuesType","undefined","eShopLogs","logs","onerror","message","forEach","fn","originalFn","bind","ClientJS","windowClient","FingerprintInfoResponse","ip","getIP","tryCatch","method","headers","Accept","response","json","chainEitherKW","getClientFingerPrint","userAgent","navigator","screenPrint","getScreenPrint","pluginList","getPlugins","fontList","getFonts","localStorage","isLocalStorage","sessionStorage","isSessionStorage","timeZone","getTimeZone","language","getLanguage","systemLanguage","getSystemLanguage","cookies","isCookie","canvasPrint","getCanvasPrint","getCustomFingerprint","String","_fingerPrint","getFingerPrint","alt","computeFingerPrint","parseLocation","router","fallback","s","parse","Route","UploadModeDialogWithMobile","getMobileRecipients","idUploadApi","record","isSome","boolean","uploadImageButton","image","placeholder","DocumentType","IDCard","Passport","DrivingLicense","PermanentResidencePermit","LongTermResidencePermit","TemporaryResidencePermit","MobileRecipientType","Banker","Client","MobileRecipientNumber","MobileStatus","WaitingForConnection","MobileConnected","UploadInProgress","UploadCompleted","ConnectionLost","MustEditData","VerificationCompleted","DocumentPage","Front","Back","DocumentSlot","First","Second","ScannedDocument","fileContent","documentType","documentPage","base64","FileContent","fileName","ClientDataCheck","LinkPurpose","selfieFraudCheck","hologramFraudCheck","hologramAndSelfieFraudCheck","mobileIdUpload","proofOfIncome","SealingStatus","unsealed","sealing","sealed","Country","countryCode","inEuropeanUnion","country","optionFromUndefined","Tenant","CZ","SK","foldTenant","tenant","onSK","onCZ","eqStrict","useCheckTenant","partialPattern","pattern","Channel","TLS_Remote","PWS_Remote","SB_Remote","OB_Remote","Branch_InPerson","Franchise_InPerson","foldChannel","matches","channel","foldChannelLocation","InPerson","Remote","SupportedLocales","en","cs","sk","unsafeNonNegativeInteger","n","NonNegativeInteger","str","length","CompressedFileContent","is","u","c","validate","decompressed","ungzip","atob","to","a","btoa","gzip","Currency","CZK","EUR","foldCurrency","currency","codec","optionCodec","context","toUndefined","encode","optional","fields","optionFromArray","nonEmptyArrayCodec","nonEmptyArray","fromArray","MoneyAmount","amount","eqMoneyAmount","APIPrice","OneTime","PerMonth","moneyAmount","frequency","freePrice","priceFromAPIPrice","price","amountPrice","Price","_","v","Free","Amount","PercentageLikeFromNumber","Percentage","Month","m","MonthYear","year","month","GenericError","eqNumber","startDate","endDate","id","unauthorizedError","leadZero","toString","padStart","formattedDatePattern","DateFromFormattedDate","Date","test","day","split","parseInt","getDate","getMonth","getFullYear","sqlStringDatePattern","DateFromSQLString","date","moment","utc","toDate","CountryCode","CoApplicant","index","eqCoApplicant","CoApplicantInput","eqCoApplicantInput","getEq","withCoApplicant","eqWithCoApplicant","codecEq","coApplicantA","coApplicantB","b","equals","Sex","M","F","DocumentPurpose","Primary","Secondary","DocumentIdentificationFlow","PrimaryAndSecondary","PrimaryAndLivenessCheck","foldDocumentIdentificationFlow","documentIdentificationFlow","isSingleDocumentPurpose","flowType","UploadDocumentFlowType","PersonalProfile","MORTGAGE","CL","SL","TL","RPL","RL","InvalidFlowId","InvalidUUIDError","LinkExpiredError","VerifyLinkError","BaseMaritalStatus","Single","Married","Divorced","Widowed","MaritalStatusCZ","RegisteredPartnership","MaritalStatusSK","MaritalStatus","ExistingClientAuthenticationMethod","ID","QR","PUSH_NOTIFICATION","EXTERNAL_PUSH_NOTIFICATION","PIN","foldExistingClientAuthenticationMethod","DesktopAuthenticationMethod","foldPortalStatus","portalStatus","onInitial","onNone","onActive","onScheduled","ForeignCountries","BGD","BEL","BFA","BGR","BIH","BRB","WLF","BLM","BMU","BRN","BOL","BHR","BDI","BEN","BTN","JAM","BVT","BWA","WSM","BES","BRA","BHS","JEY","BLR","BLZ","RUS","RWA","SRB","TLS","REU","TKM","TJK","ROU","TKL","GNB","GUM","GTM","SGS","GRC","GNQ","GLP","JPN","GUY","GGY","GUF","GEO","GRD","GBR","GAB","SLV","GIN","GMB","GRL","GIB","GHA","OMN","TUN","JOR","HRV","HTI","HUN","HKG","HND","HMD","VEN","PRI","PSE","PLW","PRT","SJM","PRY","IRQ","PAN","PYF","PNG","PER","PAK","PHL","PCN","POL","SPM","ZMB","ESH","EST","EGY","ZAF","ECU","ITA","VNM","SLB","ETH","SOM","ZWE","SAU","ESP","ERI","MNE","MDA","MDG","MAF","MAR","MCO","UZB","MMR","MLI","MAC","MNG","MHL","MKD","MUS","MLT","MWI","MTQ","MNP","MSR","MRT","IMN","UGA","TZA","MYS","MEX","ISR","FRA","IOT","SHN","FIN","FJI","FLK","FSM","FRO","NIC","NLD","NOR","NAM","VUT","NCL","NER","NFK","NGA","NZL","NPL","NRU","NIU","COK","CIV","CHE","COL","CHN","CMR","CHL","CCK","CAN","COG","CAF","COD","CYP","CXR","CRI","CUW","CPV","CUB","SWZ","SYR","KGZ","KEN","SSD","SUR","KIR","KHM","KNA","COM","STP","KOR","SVN","PRK","KWT","SEN","SMR","SLE","SYC","KAZ","CYM","SGP","SWE","SDN","DOM","DMA","DJI","DNK","VGB","DEU","YEM","DZA","USA","URY","MYT","UMI","LBN","LCA","LAO","TUV","TWN","TTO","TUR","LKA","LIE","LVA","TON","LTU","LUX","LBR","LSO","THA","ATF","TGO","TCD","TCA","LBY","VAT","VCT","ARE","AND","ATG","AFG","AIA","VIR","ISL","IRN","ARM","ALB","AGO","ATA","ASM","ARG","AUS","AUT","ABW","IND","ALA","AZE","IRL","IDN","UKR","QAT","MOZ","useFoldChannelLocation","useIsRemoteChannel","foldChannelToRemoteOrInPerson","useIsInPersonChannel","useIsSBChannel","useIs3PChannel","MockedUpload","lazy","ScanDocument","scannerAppUrl","locale","iframeRef","useRef","signalUploadResult","success","current","fromNullable","chainNullableK","iframe","contentWindow","w","postMessage","getOrElseW","handleMessageReceived","onFailure","onDocumentAcquired","err","_mockScanner","renderMockedUpload","origin","messageHandler","documentPurpose","documentDetails","constUndefined","doc","idType","flatten","ref","src","i","onMessageReceived","width","height","UploadImageButton","isRemote","IdCardImagePlaceholder","IdCardImage_SK","IdCardImage_CZ","className","classes","data-test-id","imageProp","cx","onClick","weight","imageProps","FileIcon","uploadLabel","setData","isActive","CustomCard","showModal","setShowModal","isBranchExperienceTouchScreen","useIsTouchScreen","checkBoxValue","hoverHighlighted","fluid","checkBoxDisabled","checkBoxName","checkBoxOnChange","target","checked","bold","cardTitle","classnames","tooltipInfoContent","tooltipInfoTitle","content","color","palette","blue600","neutral500","align","cardDescription","showModalLabel","style","maxWidth","justifyContent","imageCardHorizontal","imgUrl","objectFit","boxShadow","raiseCard","borderRadius","dialogTitle","children","dialogContent","notFound","_tag","foldInternetLocation","emailVerificationMatch","lit","pendingApplicationMatch","query","applicationId","productType","ProductType","uploadDocumentsMatch","uploadDocumentsLinkWithBankerFlowMatch","linkId","mobileIdUploadMatch","mobileProofOfIncomeUploadMatch","mobileSelfieCheckMatch","mobileSelfieTestMatch","mobileHologramCheckMatch","mobileFullCheckMatch","mobileCreateProfileMatch","mobileCreateProfileAndSignMatch","clientRedirectMatch","function","DBNObjectId","step","source","userNotClientOwnerMatch","remoteOnboardingMatch","product","promo","openApplicationMatch","zero","parser","params","InternetRouter","pathname","search","MobileUploadFlow2","MobileUploadFlow","MobileCheckFlow","consentDialogClosed","open","UploadDocuments","biometricConsent","biometricConsentEnabled","useNewMobileIdUploadUx","useNewUploadId","externalCommunication","branchExperienceFeaturesActive","useBranchExperienceContext","selectedMainApplicant","sendBiometricConsentCommand","fraudCheckResult","sendBiometricConsent","consent","bracket","setPendingBiometricConsentCommand","useNewMobile","uploadStatus","dispatch","useParentSharedReducer","getReducerConfig","restoredData","documentsAlreadyUploaded","isUploadAgain","showUploadCompletedDialog","sharedWithClient","setErrors","selectedCountry","setSelectedCountry","countryDocSelection","foreignDocumentType","setForeignDocumentType","saveCurrentSelection","setSaveCurrentSelection","addErrorIfMissing","error","removeError","isInPerson","requiresConsent","forceHideCopyIdDocumentAgreement","updateConsentModal","setUpdateConsentModal","updateBiometricConsent","setBiometricConsent","previousConsent","isBiometricConsentLocked","exists","pendingBiometricConsentCommand","checkClientDataResult","useCheckClientDataResult","extractCommand","isPotentialClient","cancelUpload","cancelUploadAction","resetProcess","setDocumentDetails","scrollToBiometricError","biometricSectionRef","scrollIntoView","behavior","block","uploadAgain","onUploadAgain","checkBiometricConsent","hideBiometricConsent","right","updateBiometricConsentStatus","fieldProps","handleSubmit","isSubmitting","useForm","initialValues","copyIdDocumenConsent","fieldValidators","validators","onSubmit","chainW","rightIO","shareWithClientAction","fromTask","extractClientData","leftIO","localCountryCode","localCountry","defined","definedNoExtract","useValidators","fieldPropsCountry","handleSubmitCountry","handleReset","handleResetCountry","docType","values","uploadAgainAction","documentMismatch","onContinue","fraudCheck","startFraudCheckAction","canUploadAgain","Placeholder","minHeight","mapLeft","supportForeign","hasErrors","startUploadAction","onUploadModalConfirm","startUploadModeAction","DocumentCard","isPersonalProfile","primaryDocumentsImages","Passport_CZ","Passport_SK","secondaryDocumentsImages","DrivingLicense_SK","DrivingLicense_CZ","renderDocumentImage","formatDocumentType","hasPrimaryDocuments","hasSecondaryDocuments","renderIdentificationDocuments","documentTitle","documentsArray","showUploadStatus","foldState","whenReady","whenReadyMobile","mustGiveConsent","onBiometricConsent","given","startMobileUploadFromSameDeviceAction","whenChooseUploadMode","whenScannerUpload","mocked","resetAfterScannerCancel","goToSummaryAction","uploadCommand","whenChooseMobileRecipient","status","forceMobileRecipientSelection","onSelect","selectRecipientAction","fromPredicate","whenRemoteMobileRecipient","startMobileFraudCheckFromSameDeviceAction","whenMobileUpload","onMaxAttemptsReached","onUploadCompleted","documentToUploadDetails","whenMobileUploadSameDevice","isSameDevice","onComplete","uploadDocumentFlowType","documentCodes","whenMobileFraudCheckSameDevice","zenIdPurpose","foldFraudCheckType","check","whenUploadSummary","onRemove","MobileConnectionOKIcon","whenUploadAgain","whenFraudCheck","reason","onAbort","onFraudCheck","alertDialog","WarningIcon","onCancel","confirmLabel","cancelLabel","biometricSection","haveErrors","isRadioDisabled","digitalIdSwitch","setType","onNoCountries","onCountryChange","onDocTypeChange","allowCopyIdDocumentAgreementEdit","submitLabel","branchExperienceState","foldScannerState","state","whenScanDocument","whenConfirmScan","ScannerIdUpload","scannerState","setScannerState","slot","isCancelling","formatScannerError","formatDocumentPage","page","scannedDocument","val","uploadResponse","srcFromBase64","fileSrc","uploadDocument","uploadResult","onDocumentUploaded","setUploadError","singleSidedID","documentSrc","dialogActions","scanAgain","dataTestId","hasTwoSides","confirmScan","modalTitle","modalContent","toNullable","UploadAgainDialog","ChecklistIcon","RedoFraudCheckDialog","confirmAction","array","compact","KOIcon","extractData","isTestEnvironment","useTestEnvironment","primary","secondary","isDocumentMismatch","documentsHaveValidationErrors","hasValidationErrors","documentPayload","mergeExtractDataDocumentsOutput","canEdit","showWarning","VirtualCardsCommon","setPhysicalCardSelected","isFromChild","isCf","contentRowType","monochromatic","blue800","showMastercard","onBack","alignItems","foldPackageType","whenBasic","whenMiddle","whenUpper","VirtualCards","initVirtualCard","cfApi","ukontoApi","loading","setLoading","setPackageType","virtualCardTopImgURL","virtualCardMcTopImgURL","virtualCardMcMiddleImgURL","virtualCardOpenImgURL","virtualCardMcOpenImgURL","physicalCardTopImgURL","physicalCardMcTopImgURL","physicalCardMcMiddleImgURL","physicalCardOpenImgURL","physicalCardMcOpenImgURL","bannerInfo","dangerouslySetInnerHTML","__html","physicalCard","NewVersionAlert","reload","useVersionCheck","buildVersion","runningVersion","inPersonChannel","showAlert","setShowAlert","dismissed","setDismissed","updateState","forceUpdate","useCallback","onBuildVersionReceived","currentAvailableVersion","trim","shouldShowNewVersionAlert","onCancelAlert","RetrievedDocument","documents","basis","onOpenPreview","RetrievedDocuments","previewOpened","setPreviewOpened","selfieLivenessCheck","saveCountryDocSelection","uKontoAPI","SelfieBlock","previewSlot","fraudCheckSelfie","RetrievedSelfie","UploadSummary","retrieveDocuments","uploadDocumentsApi","translationsActive","includes","RuntimeLocaleKey","intl","useIntl","Object","useFormatRichMessage2","translation","keys","keyItem","RegExp","fillPlaceholders","whiteSpace","useWhitespacePreWrap","useFormatRichMessage","br","chunks","ReactChildren","toArray","isValidElement","linebreak","Array","isArray","useFormatMoneyAmountParts","fractionDigits","formatCurrency","useFormatCurrency","formatNumberToParts","minimumFractionDigits","maximumFractionDigits","el","useFormatMoneyAmountValue","formatMoneyAmountParts","useFormatPhoneNumber","parsePhoneNumber","phone","isValid","formatInternational","useFormatMoneyAmount","useFormatPercentageLike","percentage","opts","Intl","NumberFormat","format","useFormatMessagePercentage","FormattedMessage","IntlProvider","browserLocale","languages","l","defaultBrowserLocale","defaultLocaleFromTenant","localeFromUrl","exec","lang","decodeURIComponent","QuerystringLanguage","querystringLanguageToSupportedLocale","EN","GB","US","CS","importMessages","fromIOEither","importMessages_","useFormatIncomeCurrency","code","useFormatMonthYearValue","monthYear","useFormatYearValue","useFormatMonth","toLocaleString","months","range","formatDuration","timeSeconds","formattedTime","Math","floor","component","useFormatSex","sex","useFormatCitizenship","countries","findFirst","useFormatCitizenshipOrOther","formatCitizenship","useFormatMaritalStatus","maritalStatus","useFormatEducation","education","useFormatPortalStatusDate","weekday","hour","minute","useFormatDate","dateFormatter","DateTimeFormat","dateFormat","useFormatDocumentType","useFormatIncomeSource","incomeSource","useFormatCarOwnership","carOwnership","useFormatSelectedInsurance","insuranceType","package","useFormatCPIFeature","feature","useFormatHousingType","housingType","useFormatOtherDocumentLabel","useFormatNonResidentsAdditionalDocumentsLabel","base64Content","imageType","head","isThereAnAdditionalDocument","additionalDocumentType","permanentAddress","addressSuggestions","additionalDocumentDetails","validationErrors","documentHasErrors","item","BiometricConsentInput","withApplicantIndex","eqBiometricConsentInput","eqWithApplicantIndex","eqBoolean","UploadDocumentInput","eqUploadDocumentInput","UploadDocumentOutput","UploadDocumentError","errorCodec","MobileUploadDocumentInput","documentCode","pageCode","async","eqMobileUploadDocumentInput","mobileUploadDocument","mobileUploadDocument2","DocumentRetrieveContentInput","eqDocumentRetrieveContentInput","compressed","subType","DocumentRetrieveContentOutput","retrieveUploadedDocument","MobileRecipientsInput","eqMobileRecipientsInput","MobileRecipientsOutput","mobileRecipients","SendMobileLinkInput","parameters","SendMobileLinkInputPOI","docTypeId","applicationElementID","eqSendMobileLinkInput","SendMobileLinkOutput","attemptsLeft","SendMobileLinkError","sendMobileLink","sendMobileLinkPOI","MobileStatusInput","eqMobileStatusInput","MobileStatusOutput","mobileStatus","CancelProcessInput","eqCancelProcessInput","cancelProcess","VerifyLinkInput","eqVerifyLinkInput","verifyLink","StartProcessInput","token","eqStartProcessInput","StartProcessError","StartProcessOutput","startProcess","startProofOfIncomeProcess","MobileFlowStatusInput","MobileFlowStatusError","mobileFlowStatus","MobileClientDataOutput","ClientDataOCR","MobileClientDataInput","eqMobileClientDataInput","mobileClientData","ConfirmDataInput","eqConfirmDataInput","mobileConfirmData","MobileRejectDataInput","eqMobileRejectDataInput","MobileRejectDataOutput","canRetry","mobileRejectData","MobileUploadHologramInput","eqMobileUploadHologramInput","mobileUploadHologram","bodyType","MobileUploadSelfieInput","signature","eqMobileUploadSelfieInput","mobileUploadSelfie","MobileUploadParametersOutput","withFallback","mobileUploadParameters","DocumentIdCodeOutput","primaryIdCodes","mobileUploadIdCodes","iso3country","InvestigationStatus","MobileDocumentError","Moire","DisplayOrPaper","Expired","WrongFront","WrongBack","WrongBothSides","DocumentComplete","MobileInvestigationError","errorPrimary","errorSecondary","MobileInvestigateStatusOutput","investigationStatus","mobileInvestigateStatus","CountriesOutput","allCountries","DocumentTypesOutput","documentTypes","resetUploadDocument","VersionChecker","customCard","MobileFlowType","MobileRecipientOptionType","UploadMode","Scanner","Mobile","_MockScanner","ReadyState","ReadyMobileState","ChooseUploadModeState","ScannerUploadState","ChooseMobileRecipientState","ChooseRemoteMobileRecipientState","MobileUploadState","MobileUploadSameDeviceState","MobileFraudCheckSameDeviceState","UploadSummaryState","FraudCheckState","UploadAgainState","State","StartUploadAction","StartUploadModeAction","payload","StartMobileUploadFromSameDeviceAction","StartMobileFraudCheckFromSameDeviceAction","CancelUploadAction","newMobileFlow","GoToSummaryAction","UploadAgainAction","StartFraudCheckAction","SelectRecipientAction","ShareWithClientAction","Action","sharedReducerConfig","reducer"],"mappings":"4FAAA,mQA6CA,SAASA,EACPC,EACAC,GAEA,OAAQC,GACNC,YACED,EACAE,IAAkBC,OAClBC,IAAOC,KACL,IACEJ,YACED,EACAM,IAAcH,OACdC,IAAOC,KACL,IAAME,IAAWC,KAA4BR,GAC7C,IACEC,YACEM,IAAWE,OAAoC,IAC7CV,KAEFQ,IAAWG,MAAM,IACfH,IAAWC,KAA4BG,SAMnD,IACEV,YACEM,IAAWE,OAAoCX,GAC/CS,IAAWG,MAAM,IACfH,IAAWC,KAA4BG,SAmB9C,SAASC,EACdC,GAE6C,IAD7CC,EAC4C,uDADjB,GAE3B,MAAMC,EAAcC,eACd,cAAEC,GAAkBC,eACpB,gBAAEC,GAAoBC,mCAEtB,SAAEC,EAAF,aAAYC,EAAZ,OAA0BC,GAAWC,sCAGzCC,4BAA6BC,EADzB,qBAEJC,GACEC,cAEEC,EAAkB,KACtBH,IACAC,GAAqB,IAGvB,OAAQG,GACN7B,YACEY,EAAQkB,MAAM,CACZhB,cACAe,QACAb,gBACAe,UAAWX,EACXY,OAAQhC,YACNoB,EACAa,IAAOC,IAAIC,GAAKA,EAAEH,WAGtB1B,IAAW8B,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IvC,IAAK,kBACH,MAAiB,0BAAboF,EAAM1oB,GAEa,mBAAnB0oB,EAAM3lB,UACa,kBAAnB2lB,EAAM3lB,SAEC,CACL/C,GAAI,eACJrP,UAAWG,EAAOivC,SAGb,CACL//B,GAAI,aACJgnB,MAAO0B,EAAM3lB,SACbpS,UAAWG,EAAOivC,QAClBzc,eAAgBoF,EAAMpF,gBAGJ,gCAAboF,EAAM1oB,GAEM,mBAAnB0oB,EAAM3lB,UACa,kBAAnB2lB,EAAM3lB,SAEC,CACL/C,GAAI,eACJrP,UAAWG,EAAOivC,SAGb,CACL//B,GAAI,aACJgnB,MAAO0B,EAAM3lB,SACbpS,UAAWG,EAAOivC,QAClBzc,gBAAgB,GAGRoF,EAChB,IAAK,kCACH,MAAO,CAAE1oB,GAAI,0BACf,IAAK,sCACH,MACe,gCAAb0oB,EAAM1oB,IACa,mBAAnB0oB,EAAM3lB,UACa,kBAAnB2lB,EAAM3lB,SAEC,CAAE/C,GAAI,6BAA8BgnB,MAAO0B,EAAM3lB,UAC5C2lB,EAChB,IAAK,cACH,MAAO,CACL1oB,GAAI,cACJkjB,iBAAkBpyB,EAAOs6B,oBAE7B,IAAK,cACH,MAAO,CACLprB,GAAI,gBACJ4e,0BAA2B9tB,EAAOivC,QAAQnhB,0BAC1CC,kBAAkB,GAEtB,IAAK,kBACH,MAAiB,kBAAb6J,EAAM1oB,IAA2B0oB,EAAM7J,iBAE7B6J,EADL,IAAKA,EAAO7J,kBAAkB,KAW3C8hB,CAAQhlC","file":"static/js/index~2892facf.2d1816cf.chunk.js","sourcesContent":["import { useRemoteData } from \"./useRemoteData\";\nimport { useAPIEndpoint } from \"./useAPIEndpoint\";\nimport { either, option, taskEither } from \"fp-ts\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport {\n constFalse,\n constTrue,\n constVoid,\n identity,\n pipe,\n} from \"fp-ts/function\";\nimport { APICallImplementation } from \"./APICall\";\nimport * as remoteData from \"./RemoteData\";\nimport { RemoteData } from \"./RemoteData\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport {\n GenericError,\n genericError,\n PortalBlocked,\n UnauthorizedError,\n} from \"./globalDomain\";\nimport { useAppContext } from \"./useAppContext\";\nimport {\n LocalizedString,\n useAuthenticationContext,\n useLoadingStatusWrite,\n useStableEquality,\n} from \"design-system\";\n\nimport { usePortalStatusContext } from \"./PortalStatusContext\";\nimport { useTimeoutFn } from \"react-use\";\n\ntype APIError =\n | E\n | GenericError\n | UnauthorizedError\n | PortalBlocked\n | LocalizedString;\n\ntype RefinedAPIError = Exclude<\n APIError,\n UnauthorizedError | PortalBlocked | LocalizedString\n>;\n\nfunction handleFailure(\n onUnauthorized: () => unknown,\n onBlockedPortal: () => unknown\n) {\n return (e: APIError) =>\n pipe(\n e,\n UnauthorizedError.decode,\n either.fold(\n () =>\n pipe(\n e,\n PortalBlocked.decode,\n either.fold(\n () => taskEither.left, A>(e as any),\n () =>\n pipe(\n taskEither.fromIO, unknown>(() =>\n onBlockedPortal()\n ),\n taskEither.chain(() =>\n taskEither.left, A>(genericError)\n )\n )\n )\n ),\n\n () =>\n pipe(\n taskEither.fromIO, unknown>(onUnauthorized),\n taskEither.chain(() =>\n taskEither.left, A>(genericError)\n )\n )\n )\n );\n}\n\ninterface UseCommandConfig {\n skipTracking?: boolean;\n}\n\nexport function useCommand(\n apiCall: APICallImplementation,\n config?: UseCommandConfig\n): ReaderTaskEither, A>;\nexport function useCommand(\n apiCall: APICallImplementation,\n config?: UseCommandConfig\n): ReaderTaskEither, A>;\nexport function useCommand(\n apiCall: APICallImplementation,\n config: UseCommandConfig = {}\n): ReaderTaskEither, A> {\n const apiEndpoint = useAPIEndpoint();\n const { apiParameters } = useAppContext();\n const { trackSubmission } = useLoadingStatusWrite();\n\n const { authInfo, refreshToken, logout } = useAuthenticationContext();\n\n const {\n retrieveCurrentPortalStatus: checkPortalBlocked,\n setAlertModalVisible,\n } = usePortalStatusContext();\n\n const onPortalBlocked = () => {\n checkPortalBlocked();\n setAlertModalVisible(true);\n };\n\n return (input: R) =>\n pipe(\n apiCall.fetch({\n apiEndpoint,\n input,\n apiParameters,\n tokenInfo: authInfo,\n flowId: pipe(\n authInfo,\n option.map(d => d.flowId)\n ),\n }),\n taskEither.chainFirst(({ newTokenInfo }) =>\n taskEither.fromIO(() => pipe(newTokenInfo, option.map(refreshToken)))\n ),\n taskEither.map(({ output }) => output),\n taskEither.orElse(handleFailure(logout, onPortalBlocked)),\n config.skipTracking ? identity : trackSubmission\n );\n}\n\ntype UseAPIResult = [TaskEither, A>, () => void];\nexport function useAPI(\n apiCall: APICallImplementation,\n input?: void\n): UseAPIResult;\nexport function useAPI(\n apiCall: APICallImplementation,\n input: R\n): UseAPIResult;\nexport function useAPI(\n apiCall: APICallImplementation,\n input: R\n): UseAPIResult {\n const apiEndpoint = useAPIEndpoint();\n const { apiParameters } = useAppContext();\n const { authInfo, refreshToken, logout } = useAuthenticationContext();\n const [inputEquality, refreshCall] = useStableEquality(\n apiCall.inputEq,\n input\n );\n\n const {\n retrieveCurrentPortalStatus: checkPortalBlocked,\n setAlertModalVisible,\n } = usePortalStatusContext();\n\n const onPortalBlocked = () => {\n checkPortalBlocked();\n setAlertModalVisible(true);\n };\n\n const task = useMemo(\n () =>\n pipe(\n apiCall.fetch({\n apiEndpoint,\n input,\n apiParameters,\n tokenInfo: authInfo,\n flowId: pipe(\n authInfo,\n option.map(d => d.flowId)\n ),\n }),\n taskEither.chainFirst(({ newTokenInfo }) =>\n taskEither.fromIO(() => pipe(newTokenInfo, option.map(refreshToken)))\n ),\n taskEither.map(({ output }) => output),\n taskEither.orElse(handleFailure(logout, onPortalBlocked))\n ),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apiCall, inputEquality, apiEndpoint]\n );\n\n return [task, refreshCall];\n}\n\nexport type UseQueryResult = [\n RemoteData, A>,\n () => void\n];\n\nexport function useQuery(\n apiCall: APICallImplementation,\n input?: void\n): UseQueryResult;\nexport function useQuery(\n apiCall: APICallImplementation,\n input: R\n): UseQueryResult;\nexport function useQuery(\n apiCall: APICallImplementation,\n input: R\n): UseQueryResult {\n const [task, refresh] = useAPI(apiCall, input);\n\n return [useRemoteData(task), refresh];\n}\n\ntype PollingConfig = {\n intervalMS: number;\n shouldPollingContinue: (a: A) => boolean;\n};\n\ntype UsePollingResult = UseQueryResult;\nexport function usePolling(\n apiCall: APICallImplementation,\n config: PollingConfig,\n input?: void\n): UsePollingResult;\nexport function usePolling(\n apiCall: APICallImplementation,\n config: PollingConfig,\n input: R\n): UsePollingResult;\nexport function usePolling(\n apiCall: APICallImplementation,\n config: PollingConfig,\n input: R\n): UsePollingResult {\n const [remoteResult, refresh] = useQuery(apiCall, input);\n useEffect(() => {\n if (\n pipe(\n remoteResult,\n remoteData.fold(constFalse, constTrue, config.shouldPollingContinue)\n )\n ) {\n const timeout = window.setTimeout(refresh, config.intervalMS);\n return () => window.clearTimeout(timeout);\n }\n return () => {};\n }, [remoteResult]);\n return [remoteResult, refresh];\n}\n\ntype PollingEffectConfig = PollingConfig & {\n disabled?: boolean;\n onError: (error: E) => void;\n onSuccess: (result: A) => void;\n};\n\ntype UsePollingEffectResult = () => void;\nexport function usePollingEffect(\n apiCall: APICallImplementation,\n config: PollingEffectConfig, A>,\n input?: void\n): UsePollingEffectResult;\nexport function usePollingEffect(\n apiCall: APICallImplementation,\n config: PollingEffectConfig, A>,\n input: R\n): UsePollingEffectResult;\nexport function usePollingEffect(\n apiCall: APICallImplementation,\n config: PollingEffectConfig, A>,\n input: R\n): UsePollingEffectResult {\n const task = useCommand(apiCall, { skipTracking: true });\n const [inProgress, setInProgress] = useState(false);\n\n const refresh = () => {\n if (!config.disabled && !inProgress) {\n setInProgress(() => true);\n task(input)()\n .then(data => {\n setInProgress(() => false);\n const refinedData = remoteData.fromEither(data);\n pipe(\n refinedData,\n remoteData.fold(constVoid, config.onError, config.onSuccess)\n );\n\n if (\n pipe(\n refinedData,\n remoteData.fold(\n constFalse,\n constTrue,\n config.shouldPollingContinue\n )\n )\n ) {\n reset();\n } else {\n cancel();\n }\n })\n .catch(() => setInProgress(() => false));\n }\n };\n\n const [, cancel, reset] = useTimeoutFn(refresh, config.intervalMS);\n\n useEffect(() => {\n if (!config.disabled) {\n refresh();\n }\n }, []);\n return refresh;\n}\n","import { useContext } from \"react\";\nimport { BuildConfigContext } from \"./BuildConfigContext\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { constant, pipe } from \"fp-ts/function\";\nimport { option } from \"fp-ts\";\n\nfunction useBuildConfigContext() {\n const ctx = useContext(BuildConfigContext);\n\n if (option.isNone(ctx)) {\n throw new Error(\"BuildConfigContext not provided\");\n }\n\n return ctx.value;\n}\n\nexport function useAPIEndpoint(): NonEmptyString {\n const { apiEndpoint, apiPort } = useBuildConfigContext();\n const endpoint = pipe(\n apiEndpoint,\n option.map(e =>\n pipe(\n apiPort,\n option.fold(constant(e), constant(e.replace(/(:\\d+)?\\/?$/, \"\")))\n )\n ),\n option.getOrElse(\n () => `${window.location.protocol}//${window.location.hostname}`\n )\n );\n const port = pipe(\n apiPort,\n option.fold(\n () => \"\",\n port => `:${port}`\n )\n );\n return `${endpoint}${port}` as NonEmptyString;\n}\n","import { setupLogging } from \"./logger\";\nimport { StrictMode } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport \"design-system/lib/index.css\";\nimport { InternetApp } from \"./InternetApp\";\nimport { FixAndroidScrollInput } from \"./Common/FixAndroidScrollInput/FixAndroidScrollInput\";\n\nsetupLogging();\n\nwindow.addEventListener(\"load\", e => console.log(e));\nwindow.addEventListener(\"unload\", e => console.log(e));\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById(\"root\")\n);\n","import * as t from \"io-ts\";\nimport { eq } from \"fp-ts\";\nimport { constFalse } from \"fp-ts/function\";\nimport { apiCall } from \"../APICall\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\n// import {LocalizedString} from \"design-system\";\n\nexport const PhysicalCardInput = t.type(\n {\n checkboxValue: t.boolean,\n },\n \"PhysicalCardInput\"\n);\n\nexport type PhysicalCardInput = t.TypeOf;\n\nexport const GetCurrentPackageTypeResponse = t.type(\n {\n packageType: t.string,\n },\n \"GetCurrentPackageTypeResponse\"\n);\n\nexport type GetCurrentPackageTypeResponse = t.TypeOf<\n typeof GetCurrentPackageTypeResponse\n>;\n\nexport const InitVirtualCardResponse = t.type(\n {\n packageType: t.string,\n physicalCardSelected: optionFromNullable(t.boolean),\n },\n \"InitVirtualCardResponse\"\n);\n\nexport type InitVirtualCardResponse = t.TypeOf;\n\nexport const saveCardTypeSelection = apiCall({\n path: [\"packages\", \"uKonto\", \"cardTypeSelection\"],\n inputEq: eq.fromEquals(constFalse),\n inputCodec: t.void,\n outputCodec: t.unknown,\n});\n","import * as t from \"io-ts\";\nimport { apiCall } from \"./APICall\";\nimport { TokenInfo, AuthenticationInfo } from \"design-system\";\nimport { eq } from \"fp-ts\";\nimport { constFalse, constTrue } from \"fp-ts/function\";\nimport { UUID } from \"io-ts-types/lib/UUID\";\nimport { LoginOutput } from \"./Login/api\";\n\nexport const anonymousToken = apiCall({\n inputEq: eq.fromEquals(constTrue),\n path: [\"authorization\", \"anonymous\", \"token\"],\n inputCodec: t.void,\n outputCodec: AuthenticationInfo,\n});\n\nexport const potentialClientRemoteToken = apiCall({\n inputEq: eq.fromEquals(constTrue),\n path: [\"authorization\", \"potentialClient\", \"remote\", \"noauth\", \"token\"],\n inputCodec: t.void,\n outputCodec: AuthenticationInfo,\n});\n\nexport const potentialClientToken = apiCall({\n inputEq: eq.fromEquals(constFalse),\n path: [\"authorization\", \"potentialClient\", \"noauth\", \"token\"],\n inputCodec: t.type({\n flowId: UUID,\n }),\n outputCodec: TokenInfo,\n});\n\nconst SSOLoginInput = t.type(\n {\n jwtReference: UUID,\n },\n \"SSOLoginInput\"\n);\nconst eqSSOLoginInput = eq.getStructEq({ jwtReference: eq.eqString });\n\nexport const ssoLogin = apiCall({\n path: [\"authorization\", \"client\", \"sso\", \"token\"],\n inputCodec: SSOLoginInput,\n inputEq: eqSSOLoginInput,\n outputCodec: LoginOutput,\n});\n\nconst GenerateIdentifiedClientTokenOutput = t.type(\n {\n flowId: UUID,\n },\n \"GenerateIdentifiedClientTokenOutput\"\n);\n\nexport const generateIdentifiedClientToken = apiCall({\n path: [\"authorization\", \"client\", \"sso\", \"generateIdentifiedClientToken\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: GenerateIdentifiedClientTokenOutput,\n});\n","import { useContext } from \"react\";\nimport { AppContext } from \"./AppContext\";\nimport { option } from \"fp-ts\";\n\nexport function useAppContext() {\n const ctx = useContext(AppContext);\n\n if (option.isNone(ctx)) {\n throw new Error(\"AppContext not provided\");\n }\n\n return ctx.value;\n}\n","import { useContext } from \"react\";\nimport { SnackBarContext } from \"design-system\";\n\nexport const useSnackBar = () => {\n const ctx = useContext(SnackBarContext);\n if (!ctx) {\n throw new Error(\"Snackbar context is not provided\");\n }\n return ctx;\n};\n","import { option, taskEither } from \"fp-ts\";\nimport { flow, identity, pipe } from \"fp-ts/function\";\nimport { sequenceS } from \"fp-ts/Apply\";\nimport { Option } from \"fp-ts/Option\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { AllSupportedCitizenships, PersonalData } from \"../IdUpload/domain\";\nimport * as clientDataApi from \"../IdUpload/ClientData/api\";\nimport { ApplicantIndex } from \"../MortgageDashboard/domain\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport { ExtractedDataResult } from \"./types\";\n\nexport type ClientExistencyCheckDataPartial = {\n name: NonEmptyString;\n surname: NonEmptyString;\n dateOfBirth: Date;\n birthNumber: Option;\n citizenship: AllSupportedCitizenships;\n} & ApplicantIndex;\n\nexport type ClientExistencyCheckData = {\n name: NonEmptyString;\n surname: NonEmptyString;\n dateOfBirth: Date;\n birthNumber: NonEmptyString;\n citizenship: AllSupportedCitizenships;\n} & ApplicantIndex;\n\nexport type ExistencyCheckResult = {\n clientExists: boolean;\n duplicateContacts: boolean;\n hasBlockingNotes: boolean;\n clientExistencyCheckData: ClientExistencyCheckData;\n multipleUsers: boolean;\n personalNumberMatch: boolean;\n userID: Option;\n clientNumber: Option;\n};\n\nexport const personalNumberFromBirthNumber = flow(\n (birthNumber: NonEmptyString) => birthNumber.replace(/\\//g, \"\"),\n NonEmptyString.decode,\n option.fromEither\n);\n\nexport function convertToCheckDataBn(\n checkData: Option,\n birthnumber?: NonEmptyString\n): Option {\n const result = pipe(\n checkData,\n option.fold(\n () => option.none,\n data =>\n pipe(\n data.birthNumber,\n option.fold(\n () =>\n birthnumber\n ? option.some({\n ...data,\n birthNumber: birthnumber,\n })\n : option.none,\n bn =>\n option.some({\n ...data,\n birthNumber: birthnumber ? birthnumber : bn,\n })\n )\n )\n )\n );\n if (option.isNone(result)) {\n console.trace(\">>> no BN....\");\n }\n return result;\n}\n\nexport function clientExistencyCheckDataFromClientData( //partial, BN not mandatory\n clientData: ExtractedDataResult & ApplicantIndex\n): Option {\n return pipe(\n {\n name: clientData.personalData.name,\n surname: clientData.personalData.surname,\n dateOfBirth: clientData.personalData.dateOfBirth,\n // birthNumber: clientData.personalData.birthNumber,\n citizenship: pipe(\n clientData.personalData.citizenship,\n option.filter((x): x is AllSupportedCitizenships => x !== \"OTHER\")\n ),\n },\n sequenceS(option.option),\n option.map(data => ({\n ...data,\n birthNumber: clientData.personalData.birthNumber,\n applicantIndex: clientData.applicantIndex,\n }))\n );\n}\n\nexport function clientExistencyCheckDataFromClientDataAuth(\n clientData: ExtractedDataResult & ApplicantIndex\n): Option {\n return pipe(\n {\n name: clientData.personalData.name,\n surname: clientData.personalData.surname,\n dateOfBirth: clientData.personalData.dateOfBirth,\n birthNumber: clientData.personalData.birthNumber,\n citizenship: pipe(\n clientData.personalData.citizenship,\n option.filter((x): x is AllSupportedCitizenships => x !== \"OTHER\")\n ),\n },\n sequenceS(option.option),\n option.map(data => ({\n ...data,\n birthNumber: data.birthNumber,\n applicantIndex: clientData.applicantIndex,\n }))\n );\n}\n\nexport function clientExistencyCheckDataFromPersonalData(\n personalData: PersonalData & ApplicantIndex\n): ClientExistencyCheckDataPartial {\n return {\n name: personalData.name,\n surname: personalData.surname,\n birthNumber: personalData.birthNumber,\n dateOfBirth: personalData.dateOfBirth,\n citizenship: personalData.citizenship,\n applicantIndex: personalData.applicantIndex,\n };\n}\n\nexport function inputFromClientExistencyCheckData(\n data: ClientExistencyCheckData & ApplicantIndex\n): Option {\n return pipe(\n data.birthNumber,\n personalNumberFromBirthNumber,\n option.map(personalNumber => ({\n dateOfBirth: data.dateOfBirth,\n lastAndFirstName: `${data.surname} ${data.name}` as NonEmptyString,\n personalNumber: personalNumber,\n citizenship: data.citizenship,\n applicantIndex: data.applicantIndex,\n }))\n );\n}\n\nexport function clientExistencyCheck(\n clientExistencyCommand: ClientExistencyCommand,\n defaultError: () => E\n) {\n return (\n data: ClientExistencyCheckData\n ): TaskEither =>\n pipe(\n data,\n inputFromClientExistencyCheckData,\n taskEither.fromOption(defaultError),\n taskEither.chain(clientExistencyCommand),\n taskEither.bimap(\n identity,\n ({\n existingClient,\n duplicateContacts,\n hasBlockingNotes,\n multipleUsers,\n personalNumberMatch,\n userID,\n clientNumber,\n }) => ({\n clientExists: existingClient,\n duplicateContacts,\n hasBlockingNotes,\n clientExistencyCheckData: data,\n multipleUsers,\n personalNumberMatch,\n userID,\n clientNumber,\n })\n )\n );\n}\n\nexport type ClientExistencyCommand = ReaderTaskEither<\n clientDataApi.CheckExistingClientInput,\n E,\n clientDataApi.CheckExistingClientOutput\n>;\n\nexport function useClientExistencyCheck(\n clientExistencyCommand: ClientExistencyCommand,\n defaultError: () => E\n) {\n return (\n data: ClientExistencyCheckData\n ): TaskEither =>\n clientExistencyCheck(clientExistencyCommand, defaultError)(data);\n}\n","import \"!../../../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js!css-loader?{\\\"modules\\\":false,\\\"url\\\":false}!./UploadId.treat.32y0FaF.css\";\nexport var imageWrapper = '_1v26f';\nexport var divider = '_3TqYA';\nexport var hintIcon = 'WjodX';","import * as t from \"io-ts\";\nimport { failure } from \"io-ts/lib/PathReporter\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { either } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport { BuildConfig } from \"./ConfigBlocks\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\nimport { PositiveInteger } from \"design-system\";\nimport { NumberFromString } from \"io-ts-types/lib/NumberFromString\";\n\nconst BuildConfigCodec = t.type(\n {\n REACT_APP_API_ENDPOINT: optionFromNullable(NonEmptyString),\n REACT_APP_API_PORT: optionFromNullable(\n NumberFromString.pipe(PositiveInteger)\n ),\n },\n \"BuildConfig\"\n);\n\nexport const buildConfig: BuildConfig = pipe(\n BuildConfigCodec.decode(process.env),\n either.fold(\n errors => {\n throw new Error(failure(errors).join(\"\\n\"));\n },\n (env): BuildConfig => ({\n apiEndpoint: env.REACT_APP_API_ENDPOINT,\n apiPort: env.REACT_APP_API_PORT,\n })\n )\n);\n","export default __webpack_public_path__ + \"static/media/idcard_cz.ec6e364a.png\";","export default __webpack_public_path__ + \"static/media/idcard_sk.2c410f31.png\";","import {\n Dialog,\n Loader,\n Box,\n MobileUploadIDIcon,\n ErrorBanner,\n Button,\n Stack,\n unsafeLocalizedString,\n Action,\n useDeviceUA,\n Space,\n useIsMobileLayout,\n} from \"design-system\";\nimport { useQuery } from \"../useAPI\";\nimport * as uploadApi from \"./api\";\nimport { useFormatMessage } from \"../intl\";\nimport { option } from \"fp-ts\";\nimport { pipe, constNull, constant, constTrue } from \"fp-ts/function\";\nimport * as remoteData from \"../RemoteData\";\nimport MobileDeviceText from \"./MobileDeviceText\";\nimport { LinkPurpose, MobileRecipientType } from \"./domain\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { useAppContext } from \"../useAppContext\";\nimport { MobileFlowType, MobileRecipientOptionType } from \"./state\";\nimport { Option } from \"fp-ts/Option\";\nimport { CoApplicantInput } from \"../globalDomain\";\nimport { foldMobileFlowType } from \"./utils\";\nimport { HelpLineSupportDocumentId } from \"../Common/HelplineSupportDocumentId/HelplineSupportDocumentId\";\n\ntype Props = {\n onDismiss: () => unknown;\n onSelectRecipient: (recipient: MobileRecipientOptionType) => unknown;\n onMockScannerUpload: Option<() => unknown>;\n onUploadFromSameDevice: () => unknown;\n mobileRecipientType: MobileRecipientType;\n type: MobileFlowType;\n} & CoApplicantInput;\n\nfunction foldType(\n type: Props[\"type\"],\n match: {\n [k in Props[\"type\"]]: () => T;\n }\n) {\n return match[type]();\n}\n\nexport function RemoteMobileDeviceDialog(props: Props) {\n const { os, isIOS, isMobile } = useDeviceUA();\n const formatMessage = useFormatMessage();\n const isMobileLayout = useIsMobileLayout();\n const [recipients] = useQuery(uploadApi.mobileRecipients, {\n coApplicant: props.coApplicant,\n linkPurpose: foldMobileFlowType(props.type, {\n ProofOfIncome: constant(\"proofOfIncome\"),\n DocumentUpload: constant(\"mobileIdUpload\"),\n SelfieFraudCheck: constant(\"selfieFraudCheck\"),\n HologramFraudCheck: constant(\"hologramFraudCheck\"),\n HologramAndSelfieFraudCheck: constant(\"hologramAndSelfieFraudCheck\"),\n }),\n });\n\n const isIOSNewerVersion =\n isIOS &&\n pipe(\n os.version,\n option.fold(\n constTrue,\n version => version.major <= 14 && version.minor < 3\n )\n );\n\n const showUploadFromSameDevice = isMobile && !isIOSNewerVersion;\n\n const {\n config: { mockScanner },\n } = useAppContext();\n\n const title = foldType(props.type, {\n DocumentUpload: constant(\n formatMessage(\"Identification.UploadDocuments.chooseMobileRecipientTitle\")\n ),\n ProofOfIncome: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseProofOfIncomeMobileRecipientTitle\"\n )\n ),\n SelfieFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseSelfieMobileRecipientTitle\"\n )\n ),\n HologramFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseHologramMobileRecipientTitle\"\n )\n ),\n HologramAndSelfieFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseSelfieAndHologramMobileRecipientTitle\"\n )\n ),\n });\n\n const description = foldType(props.type, {\n DocumentUpload: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseMobileRecipientDescription\"\n )\n ),\n ProofOfIncome: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseProofOfIncomeMobileRecipientDescription\"\n )\n ),\n SelfieFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseFraudCheckMobileRecipientDescription\"\n )\n ),\n HologramFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseFraudCheckMobileRecipientDescription\"\n )\n ),\n HologramAndSelfieFraudCheck: constant(\n formatMessage(\n \"Identification.UploadDocuments.chooseFraudCheckMobileRecipientDescription\"\n )\n ),\n });\n\n const sendLinkAction = (recipient: MobileRecipientOptionType): Action => ({\n variant: showUploadFromSameDevice ? \"text\" : \"primary\",\n label: formatMessage(\"Identification.UploadDocuments.sendLink\"),\n action: () => props.onSelectRecipient(recipient),\n });\n\n const actions: React.ComponentProps[\"actions\"] = pipe(\n recipients,\n remoteData.fold(constant([]), constant([]), recipients =>\n pipe(\n recipients[props.mobileRecipientType].phoneNumber,\n option.fold(\n constant([]),\n phoneNumber =>\n showUploadFromSameDevice\n ? [\n sendLinkAction({\n key: props.mobileRecipientType,\n phoneNumber,\n disabled: false,\n }),\n {\n variant: \"primary\",\n label: formatMessage(\n \"Identification.UploadDocuments.uploadFromThisDevice\"\n ),\n action: props.onUploadFromSameDevice,\n },\n ]\n : [\n sendLinkAction({\n key: props.mobileRecipientType,\n phoneNumber,\n disabled: false,\n }),\n ]\n )\n )\n )\n );\n return (\n \n \n {pipe(\n recipients,\n remoteData.fold(\n () => (\n \n \n \n ),\n constNull,\n recipients =>\n pipe(\n recipients[props.mobileRecipientType].phoneNumber,\n option.fold(\n () => (\n \n {formatMessage(\n \"Identification.UploadDocuments.errorPhoneNumber\"\n )}\n \n ),\n phoneNumber => (\n \n \n {isMobileLayout && (\n <>\n \n \n \n )}\n \n )\n )\n )\n )\n )}\n {mockScanner &&\n pipe(\n props.onMockScannerUpload,\n option.fold(constNull, onMockScannerUpload => (\n \n ))\n )}\n \n \n );\n}\n","export default __webpack_public_path__ + \"static/media/passport_cz.7dc0a6ea.png\";","export default __webpack_public_path__ + \"static/media/drivinglicense_cz.2847a741.png\";","export const getCurrentBuildVersion = () =>\n fetch(process.env.PUBLIC_URL + \"/build.txt\").then(r => r.text());\n","import { useState } from \"react\";\nimport {\n RadioGroup,\n FileIcon,\n SmartphoneIcon,\n Dialog,\n Children,\n LocalizedString,\n unsafeLocalizedString,\n} from \"design-system\";\nimport { useFormatMessage } from \"../intl\";\nimport { option } from \"fp-ts\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { identity, flow } from \"fp-ts/function\";\nimport { useAppContext } from \"../useAppContext\";\nimport { UploadMode } from \"./state\";\nimport { usePortalStatusContext } from \"../PortalStatusContext\";\n\ntype Props = {\n onConfirm: ({ mode }: { mode: UploadMode }) => unknown;\n onDismiss: () => unknown;\n mobileFeatureStatus: \"hidden\" | \"disabled\" | \"enabled\";\n};\n\nexport function UploadModeDialog(props: Props) {\n const formatMessage = useFormatMessage();\n const {\n config: { mockScanner },\n } = useAppContext();\n const { portalBlocked } = usePortalStatusContext();\n\n const formatUploadModeTitle = (uploadMode: UploadMode): LocalizedString => {\n switch (uploadMode) {\n case \"Scanner\":\n return formatMessage(\"Identification.UploadDocuments.scannerModeTitle\");\n case \"Mobile\":\n return formatMessage(\"Identification.UploadDocuments.mobileModeTitle\");\n case \"_MockScanner\":\n return unsafeLocalizedString(\"Do you want to use the Fake Scanner?\");\n }\n };\n\n const formatUploadModeDescription = (\n uploadMode: UploadMode\n ): LocalizedString => {\n switch (uploadMode) {\n case \"Scanner\":\n return formatMessage(\n \"Identification.UploadDocuments.scannerModeDescription\"\n );\n case \"Mobile\":\n return formatMessage(\n \"Identification.UploadDocuments.mobileModeDescription\"\n );\n case \"_MockScanner\":\n return unsafeLocalizedString(\n \"(temporary) You'll be able to upload the predefined mock documents only\"\n );\n }\n };\n\n const formatUploadModeIcon = (uploadMode: UploadMode): Children => {\n switch (uploadMode) {\n case \"Scanner\":\n return ;\n case \"Mobile\":\n return ;\n case \"_MockScanner\":\n return ;\n }\n };\n\n const [mode, setMode] = useState(\"Scanner\");\n\n const options: NonEmptyArray = [\"Scanner\"];\n\n if (props.mobileFeatureStatus !== \"hidden\") {\n options.push(\"Mobile\");\n }\n\n if (mockScanner) {\n options.push(\"_MockScanner\");\n }\n\n return (\n props.onConfirm({ mode }),\n label: formatMessage(\n \"Identification.UploadDocuments.modeModalConfirmLabel\"\n ),\n },\n ]\n : []\n }\n >\n \n option === \"Mobile\" && props.mobileFeatureStatus === \"disabled\"\n }\n renderOption={formatUploadModeTitle}\n renderOptionChildren={flow(formatUploadModeDescription, option.some)}\n renderOptionIcon={flow(formatUploadModeIcon, option.some)}\n issuesType={option.none}\n disabled={portalBlocked}\n />\n \n );\n}\n","export default __webpack_public_path__ + \"static/media/passport_sk.983fcb9f.png\";","export default __webpack_public_path__ + \"static/media/drivinglicense_sk.39d8b891.png\";","export function setupLogging() {\n if (typeof window === undefined || typeof console === undefined) return;\n\n (window as any).eShopLogs = [];\n const logs: Array = (window as any).eShopLogs;\n\n window.onerror = message => {\n logs.push(\"onerror:\");\n logs.push(message);\n };\n [\"log\", \"debug\", \"info\", \"warn\", \"error\"].forEach(fn => {\n const originalFn =\n typeof (console as any)[fn] === \"function\"\n ? (console as any)[fn].bind(console)\n : () => {};\n (console as any)[fn] = (...args: Array) => {\n logs.push(`${fn}:`);\n logs.push(...args);\n return originalFn(...args);\n };\n });\n}\n","import ClientJS from \"clientjs\";\nimport { pipe } from \"fp-ts/function\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { taskEither } from \"fp-ts\";\nimport * as t from \"io-ts\";\n\nnew ClientJS();\nconst windowClient = new window.ClientJS();\n\nconst FingerprintInfoResponse = t.type(\n {\n ip: t.string,\n },\n \"FingerprintInfoResponse\"\n);\n\nfunction getIP(apiEndpoint: string): TaskEither {\n return pipe(\n taskEither.tryCatch(\n () =>\n fetch(\n `${apiEndpoint.replace(\n /\\/+$/,\n \"\"\n )}/utilities/fingerprint/noauth/info`,\n {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n },\n }\n ).then(response => response.json()),\n () => null\n ),\n taskEither.chainEitherKW(FingerprintInfoResponse.decode),\n taskEither.map(r => r.ip)\n );\n}\n\nfunction getClientFingerPrint(ip: string): number {\n const userAgent =\n typeof window !== \"undefined\" ? window.navigator.userAgent : \"\";\n const screenPrint = windowClient.getScreenPrint();\n const pluginList = windowClient.getPlugins();\n const fontList = windowClient.getFonts();\n const localStorage = windowClient.isLocalStorage();\n const sessionStorage = windowClient.isSessionStorage();\n const timeZone = windowClient.getTimeZone();\n const language = windowClient.getLanguage();\n const systemLanguage = windowClient.getSystemLanguage();\n const cookies = windowClient.isCookie();\n const canvasPrint = windowClient.getCanvasPrint();\n\n return windowClient.getCustomFingerprint(\n userAgent,\n screenPrint,\n pluginList,\n fontList,\n String(localStorage),\n String(sessionStorage),\n timeZone,\n language,\n systemLanguage,\n String(cookies),\n canvasPrint,\n ip\n );\n}\n\ntype FingerPrintState =\n | { type: \"none\" }\n | { type: \"computing\" }\n | { type: \"computed\"; value: number };\n\nlet _fingerPrint: FingerPrintState = { type: \"none\" };\n\nfunction computeFingerPrint(apiEndpoint: string): void {\n _fingerPrint = { type: \"computing\" };\n pipe(\n apiEndpoint,\n getIP,\n taskEither.map(getClientFingerPrint),\n taskEither.chain(value =>\n taskEither.fromIO(() => {\n _fingerPrint = { type: \"computed\", value };\n })\n ),\n taskEither.alt(() =>\n taskEither.fromIO(() => {\n _fingerPrint = { type: \"none\" };\n })\n )\n )();\n}\n\nexport function getFingerPrint(apiEndpoint: string): number | null {\n switch (_fingerPrint.type) {\n case \"none\":\n computeFingerPrint(apiEndpoint);\n return null;\n case \"computing\":\n return null;\n case \"computed\":\n return _fingerPrint.value;\n }\n}\n","import { parse, Parser, Route } from \"fp-ts-routing\";\n\nexport function parseLocation(\n path: string,\n router: Parser,\n fallback: T\n): T {\n const s = path\n .replace(/^.+\\.html/, \"\") // this is to support local dev (no virtual host internet/intranet)\n .replace(/\\+/g, \"&\"); // see SBL-20671\n return parse(router, Route.parse(s), fallback);\n}\n","import { Loader, Box } from \"design-system\";\nimport { boolean, option, record } from \"fp-ts\";\nimport { constant, constNull, pipe } from \"fp-ts/function\";\nimport * as idUploadApi from \"./api\";\nimport { useQuery } from \"../useAPI\";\nimport * as remoteData from \"../RemoteData\";\nimport { UploadModeDialog } from \"./UploadModeDialog\";\nimport { MobileFlowType, UploadMode } from \"./state\";\nimport { CoApplicantInput } from \"../globalDomain\";\nimport { foldMobileFlowType } from \"./utils\";\nimport { LinkPurpose } from \"./domain\";\n\ntype Props = {\n onConfirm: ({ mode }: { mode: UploadMode }) => unknown;\n onDismiss: () => unknown;\n type: MobileFlowType;\n} & CoApplicantInput;\n\nexport function UploadModeDialogWithMobile(props: Props) {\n const [getMobileRecipients] = useQuery(idUploadApi.mobileRecipients, {\n coApplicant: props.coApplicant,\n linkPurpose: foldMobileFlowType(props.type, {\n DocumentUpload: constant(\"mobileIdUpload\"),\n SelfieFraudCheck: constant(\"selfieFraudCheck\"),\n HologramFraudCheck: constant(\"hologramFraudCheck\"),\n HologramAndSelfieFraudCheck: constant(\"hologramAndSelfieFraudCheck\"),\n ProofOfIncome: constant(\"proofOfIncome\"),\n }),\n });\n\n return pipe(\n getMobileRecipients,\n remoteData.fold(\n () => (\n \n \n \n ),\n constNull,\n recipients => (\n option.isSome(r.phoneNumber) && !r.disabled),\n boolean.fold(constant(\"disabled\"), constant(\"enabled\"))\n )}\n />\n )\n )\n );\n}\n","import \"!../../../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js!css-loader?{\\\"modules\\\":false,\\\"url\\\":false}!./UploadImageButton.treat.2zd3FOt.css\";\nexport var uploadImageButton = '_3kOgR';\nexport var imageWrapper = 'lPXq8';\nexport var image = '_2tCXv';\nexport var placeholder = '_3fYzM';","import \"!../../../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js!css-loader?{\\\"modules\\\":false,\\\"url\\\":false}!./UploadSummary.treat.2ZRaf_z.css\";\nexport var image = '_3yaq_';","import * as t from \"io-ts\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { FileContent } from \"design-system\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\nimport { optionFromUndefined } from \"../globalDomain\";\n\nexport const DocumentType = t.keyof(\n {\n IDCard: true,\n Passport: true,\n DrivingLicense: true,\n PermanentResidencePermit: true,\n LongTermResidencePermit: true,\n TemporaryResidencePermit: true,\n },\n \"DocumentType\"\n);\nexport type DocumentType = t.TypeOf;\n\nexport type DocumentTypeUpload =\n | Exclude\n | \"DrivingLicenseCZ\"\n | \"DrivingLicenseSK\";\n\nexport type DocumentObject = {\n src: string;\n type: DocumentTypeUpload;\n};\n\nexport const MobileRecipientType = t.keyof({\n Banker: true,\n Client: true,\n});\nexport type MobileRecipientType = t.TypeOf;\n\nexport const MobileRecipientNumber = t.type({\n phoneNumber: optionFromNullable(NonEmptyString),\n disabled: t.boolean,\n});\nexport type MobileRecipientNumber = t.TypeOf;\n\nexport const MobileStatus = t.keyof({\n WaitingForConnection: true,\n MobileConnected: true,\n UploadInProgress: true,\n UploadCompleted: true,\n ConnectionLost: true,\n MustEditData: true,\n VerificationCompleted: true,\n});\nexport type MobileStatus = t.TypeOf;\n\nexport const DocumentPage = t.keyof(\n { Front: true, Back: true },\n \"DocumentPage\"\n);\nexport type DocumentPage = t.TypeOf;\n\nexport const DocumentSlot = t.keyof(\n { First: true, Second: true },\n \"DocumentSlot\"\n);\nexport type DocumentSlot = t.TypeOf;\n\nexport const IdDocument = t.type(\n {\n fileContent: NonEmptyString,\n documentType: DocumentType,\n documentPage: DocumentPage,\n },\n \"IdDocument\"\n);\nexport type IdDocument = t.TypeOf;\n\nexport const ScannedDocument = t.type(\n {\n base64: FileContent,\n fileName: NonEmptyString,\n },\n \"ScannedDocument\"\n);\nexport type ScannedDocument = t.TypeOf;\n\nexport const ClientDataCheck = t.keyof({\n SelfieFraudCheck: true,\n HologramFraudCheck: true,\n HologramAndSelfieFraudCheck: true,\n});\nexport type ClientDataCheck = t.TypeOf;\n\nexport const LinkPurpose = t.keyof({\n selfieFraudCheck: true,\n hologramFraudCheck: true,\n hologramAndSelfieFraudCheck: true,\n mobileIdUpload: true,\n proofOfIncome: true,\n});\nexport type LinkPurpose = t.TypeOf;\n\nexport const SealingStatus = t.keyof({\n unsealed: true,\n sealing: true,\n sealed: true,\n});\n\nexport const Country = t.type({\n label: t.string,\n countryCode: NonEmptyString,\n inEuropeanUnion: t.boolean,\n});\nexport type Country = t.TypeOf;\n\nexport const DocumentToUploadDetail = t.type({\n country: Country,\n type: optionFromUndefined(DocumentType),\n});\nexport type DocumentToUploadDetail = t.TypeOf;\n","import * as t from \"io-ts\";\nimport { Eq } from \"fp-ts/Eq\";\nimport { Option } from \"fp-ts/Option\";\nimport { boolean, either, eq, nonEmptyArray, option } from \"fp-ts\";\nimport { option as optionCodec } from \"io-ts-types/lib/option\";\nimport { failure } from \"io-ts/lib/PathReporter\";\nimport { constFalse, identity, Lazy, pipe } from \"fp-ts/function\";\nimport {\n FileContent,\n LocalizedString,\n NonNegative,\n NonNegativeInteger,\n Percentage,\n Positive,\n PositiveInteger,\n} from \"design-system\";\nimport { gzip, ungzip } from \"pako\";\nimport { nonEmptyArray as nonEmptyArrayCodec } from \"io-ts-types/lib/nonEmptyArray\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport { PortalStatus } from \"./PortalStatusContext\";\nimport { Reader } from \"fp-ts/Reader\";\nimport { IO } from \"fp-ts/IO\";\nimport { useAppContext } from \"./useAppContext\";\nimport moment from \"moment\";\n\nexport const Tenant = t.keyof({ CZ: true, SK: true }, \"Tenant\");\nexport type Tenant = t.TypeOf;\n\nexport function foldTenant(tenant: Tenant, onSK: () => R, onCZ: () => R): R {\n switch (tenant) {\n case \"CZ\":\n return onCZ();\n case \"SK\":\n return onSK();\n }\n}\n\nexport const eqTenant: Eq = eq.eqStrict;\n\nexport function useCheckTenant() {\n const {\n apiParameters: { tenant },\n } = useAppContext();\n\n type Pattern = { [k in Tenant]: Lazy };\n\n return function checkTenant(partialPattern: Partial) {\n const defaultPattern: Pattern = {\n CZ: constFalse,\n SK: constFalse,\n };\n\n const pattern = { ...defaultPattern, ...partialPattern };\n\n return foldTenant(tenant, pattern[\"SK\"], pattern[\"CZ\"]);\n };\n}\n\nexport const Channel = t.keyof(\n {\n TLS_Remote: true,\n PWS_Remote: true,\n SB_Remote: true,\n OB_Remote: true,\n Branch_InPerson: true,\n \"3P_InPerson\": true,\n Franchise_InPerson: true,\n },\n \"Channel\"\n);\nexport type Channel = t.TypeOf;\n\nexport function foldChannel(\n matches: { [C in Channel]: () => R }\n): (channel: Channel) => R {\n return channel => matches[channel]();\n}\n\nexport function foldChannelLocation(matches: {\n Remote: () => R;\n InPerson: () => R;\n}) {\n return foldChannel({\n Branch_InPerson: matches.InPerson,\n \"3P_InPerson\": matches.InPerson,\n Franchise_InPerson: matches.InPerson,\n OB_Remote: matches.Remote,\n PWS_Remote: matches.Remote,\n SB_Remote: matches.Remote,\n TLS_Remote: matches.InPerson,\n });\n}\n\nexport const eqChannel: Eq = eq.eqStrict;\n\nexport const SupportedLocales = t.keyof({ en: null, cs: null, sk: null });\nexport type SupportedLocales = t.TypeOf;\n\nexport const APIParameters = t.type(\n {\n tenant: Tenant,\n channel: Channel,\n language: SupportedLocales,\n },\n \"APIParameters\"\n);\n\nexport type APIParameters = t.TypeOf;\n\nexport { Positive, NonNegative, PositiveInteger };\n\nexport function unsafeNonNegativeInteger(n: number): NonNegativeInteger {\n return pipe(\n NonNegativeInteger.decode(n),\n either.fold(errors => {\n throw new Error(\n `Invalid non negative integer provided: ${failure(errors).join(\"\\n\")}`\n );\n }, identity)\n );\n}\n\nexport type HTMLContentBrand = string & {\n readonly HTMLContent: unique symbol;\n};\n\nexport const HTMLContent = t.brand(\n t.string,\n (str): str is t.Branded => str.length > 0,\n \"HTMLContent\"\n);\n\nexport type HTMLContent = t.TypeOf;\n\nexport const CompressedFileContent = new t.Type(\n \"CompressedFileContent\",\n FileContent.is,\n (u, c) =>\n pipe(\n t.string.validate(u, c),\n either.chain(s => {\n try {\n const decompressed = ungzip(atob(s), { to: \"string\" });\n return decompressed\n ? t.success(decompressed)\n : t.failure(u, c, \"Unable to decompress.\");\n } catch (e) {\n return t.failure(u, c, \"Unable to decompress.\");\n }\n }),\n either.chain(FileContent.decode)\n ),\n a => btoa(gzip(a, { to: \"string\" }))\n);\n\nexport type CompressedFileContent = t.TypeOf;\n\nexport const Currency = t.keyof(\n {\n CZK: true,\n EUR: true,\n },\n \"Currency\"\n);\n\nexport function foldCurrency(\n matches: { [k in Currency]: IO }\n): Reader {\n return currency => matches[currency]();\n}\n\nexport type Currency = t.TypeOf;\nexport const eqCurrency: Eq = eq.eqStrict;\n\nexport interface OptionFromUndefined\n extends t.Type>, t.OutputOf | undefined, unknown> {}\n\nexport function optionFromUndefined(\n codec: C,\n name: string = `Option<${codec.name}>`\n): OptionFromUndefined {\n return new t.Type(\n name,\n optionCodec(codec).is,\n (value, context) =>\n value == null\n ? t.success(option.none)\n : pipe(codec.validate(value, context), either.map(option.some)),\n value => option.toUndefined(option.option.map(value, codec.encode))\n );\n}\n\ntype Optional

= t.TypeC<\n {\n [K in keyof P]: OptionFromUndefined;\n }\n>;\n\nexport function optional

(\n props: P,\n name?: string\n): Optional

{\n const fields = {} as { [K in keyof P]: OptionFromUndefined };\n\n for (const key in props) {\n fields[key] = optionFromUndefined(props[key]);\n }\n\n return t.type(fields, name);\n}\n\nexport interface OptionFromArray\n extends t.Type<\n Option>>,\n t.OutputOf[] | undefined,\n unknown\n > {}\n\nexport function optionFromArray(\n codec: C,\n name: string = `OptionArray<${codec.name}>`\n): OptionFromArray {\n return new t.Type(\n name,\n optionCodec(nonEmptyArrayCodec(codec)).is,\n (value, context) =>\n value == null\n ? t.success(option.none)\n : pipe(\n t.array(codec).validate(value, context),\n either.map(nonEmptyArray.fromArray)\n ),\n value =>\n option.toUndefined(\n option.option.map(value, nonEmptyArrayCodec(codec).encode)\n )\n );\n}\n\nexport const MoneyAmount = t.type({\n amount: t.number,\n currency: Currency,\n});\n\nexport type MoneyAmount = t.TypeOf;\n\nexport const eqMoneyAmount: Eq = eq.getStructEq({\n amount: eq.eqStrict,\n currency: eq.eqStrict,\n});\n\nconst PriceFrequency = t.keyof({\n OneTime: true,\n PerMonth: true,\n});\nexport type PriceFrequency = t.TypeOf;\n\nconst APIPrice = t.type(\n {\n moneyAmount: MoneyAmount,\n frequency: t.keyof({ PerMonth: true, OneTime: true }, \"Frequency\"),\n },\n \"Price\"\n);\ntype APIPrice = t.TypeOf;\n\ntype FreePrice = { type: \"free\" };\ntype AmountPrice = {\n type: \"amount\";\n moneyAmount: MoneyAmount;\n frequency: PriceFrequency;\n};\nexport type Price = FreePrice | AmountPrice;\n\nexport const freePrice: Price = {\n type: \"free\",\n};\n\nexport function amountPrice(\n moneyAmount: MoneyAmount,\n frequency: PriceFrequency\n): Price {\n return { type: \"amount\", moneyAmount, frequency };\n}\n\nexport function foldPrice(match: {\n Free: () => R;\n Amount: (moneyAmount: MoneyAmount, frequency: PriceFrequency) => R;\n}): (price: Price) => R {\n return price => {\n switch (price.type) {\n case \"free\":\n return match.Free();\n case \"amount\":\n return match.Amount(price.moneyAmount, price.frequency);\n }\n };\n}\n\nfunction priceFromAPIPrice(price: APIPrice): Price {\n return pipe(\n price.moneyAmount.amount > 0,\n boolean.fold(\n () => freePrice,\n () => amountPrice(price.moneyAmount, price.frequency)\n )\n );\n}\n\nexport const Price = new t.Type(\n \"PriceFromAPIPrice\",\n (_): _ is Price => true, // unused in practice\n (v, c) => pipe(APIPrice.validate(v, c), either.map(priceFromAPIPrice)),\n foldPrice({\n Free: () =>\n APIPrice.encode({\n moneyAmount: { amount: unsafeNonNegativeInteger(0), currency: \"EUR\" },\n frequency: \"OneTime\",\n }),\n Amount: ({ amount, currency }, frequency) =>\n APIPrice.encode({ moneyAmount: { amount, currency }, frequency }),\n })\n);\n\nexport interface PercentageLikeFromNumberC\n extends t.Type {}\n\nexport const PercentageLikeFromNumber: PercentageLikeFromNumberC = new t.Type<\n number,\n number,\n unknown\n>(\n \"PercentageLikeFromNumber\",\n Percentage.is,\n (u, c) =>\n pipe(\n t.number.validate(u, c),\n either.map(n => n / 100)\n ),\n n => n * 100\n);\n\nexport type MonthBrand = {\n readonly Month: unique symbol;\n};\nexport const Month = t.brand(\n PositiveInteger,\n (m): m is t.Branded => m <= 12,\n \"Month\"\n);\nexport type Month = t.TypeOf;\n\nexport const MonthYear = t.type(\n {\n year: PositiveInteger,\n month: Month,\n },\n \"MonthYear\"\n);\nexport type MonthYear = t.TypeOf;\n\nexport const eqMonthYear = eq.getStructEq({\n year: eq.eqNumber,\n month: eq.eqNumber,\n});\n\nexport const MoneyAmountDateInterval = t.type(\n {\n amount: MoneyAmount,\n startDate: MonthYear,\n endDate: MonthYear,\n },\n \"MoneyAmountDateInterval\"\n);\nexport type MoneyAmountDateInterval = t.TypeOf;\n\nexport const GenericError = t.type({\n id: t.literal(\"GenericError\"),\n});\nexport type GenericError = t.TypeOf;\nexport const genericError: GenericError = { id: \"GenericError\" };\n\nexport const PortalBlocked = t.type({\n id: t.literal(\"PortalBlocked\"),\n});\nexport type PortalBlocked = t.TypeOf;\nexport const portalBlocked: PortalBlocked = { id: \"PortalBlocked\" };\n\nexport const UnauthorizedError = t.type(\n { id: t.literal(\"Unauthorized\") },\n \"UnauthorizedError\"\n);\nexport type UnauthorizedError = t.TypeOf;\nexport const unauthorizedError: UnauthorizedError = { id: \"Unauthorized\" };\n\nconst leadZero = (n: number): string => n.toString().padStart(2, \"0\");\n\nconst formattedDatePattern = /^\\d{2}\\.\\d{2}\\.\\d{4}$/;\n\nexport interface DateFromFormattedDateC extends t.Type {}\n\nexport const DateFromFormattedDate: DateFromFormattedDateC = new t.Type<\n Date,\n string,\n unknown\n>(\n \"DateFromFormattedDate\",\n (u): u is Date => u instanceof Date,\n (u, c) =>\n pipe(\n t.string.validate(u, c),\n either.chain(s => {\n if (!formattedDatePattern.test(s)) {\n return t.failure(u, c);\n }\n\n const [day, month, year] = s\n .split(\".\")\n .map((v: string) => parseInt(v, 10));\n\n return t.success(new Date(year, month - 1, day));\n })\n ),\n d => {\n return [\n leadZero(d.getDate()),\n leadZero(d.getMonth() + 1),\n d.getFullYear(),\n ].join(\".\");\n }\n);\n\nconst sqlStringDatePattern = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport interface DateFromSQLStringC extends t.Type {}\n\nexport const DateFromSQLString: DateFromSQLStringC = new t.Type<\n Date,\n string,\n unknown\n>(\n \"DateFromSQLString\",\n (u): u is Date => u instanceof Date,\n (u, c) =>\n pipe(\n t.string.validate(u, c),\n either.chain(s => {\n if (!sqlStringDatePattern.test(s)) {\n return t.failure(u, c);\n }\n\n const date = moment.utc(s, \"YYYY-MM-DD\");\n\n return t.success(date.toDate());\n })\n ),\n d => {\n return [\n d.getFullYear(),\n leadZero(d.getMonth() + 1),\n leadZero(d.getDate()),\n ].join(\"-\");\n }\n);\n\nexport type CountryCodeBrand = string & {\n readonly CountryCode: unique symbol;\n};\n\nexport const CountryCode = t.brand(\n t.string,\n (str): str is t.Branded => str.length === 3,\n \"CountryCode\"\n);\nexport type CountryCode = t.TypeOf;\n\nexport const CoApplicant = t.type({\n index: PositiveInteger,\n});\nexport type CoApplicant = t.TypeOf;\nexport const eqCoApplicant = eq.getStructEq({\n index: eq.eqNumber,\n});\n\nexport const CoApplicantInput = t.type({\n coApplicant: optionFromUndefined(CoApplicant),\n});\nexport type CoApplicantInput = t.TypeOf;\nexport const eqCoApplicantInput = eq.getStructEq({\n coApplicant: option.getEq(eqCoApplicant),\n});\n\nexport function withCoApplicant(type: t.TypeC) {\n return t.type(\n {\n ...type.props,\n ...CoApplicantInput.props,\n },\n `WithCoapplicant(${type.name})`\n );\n}\n\nexport function eqWithCoApplicant(codecEq: Eq): Eq {\n return eq.fromEquals(\n (\n { coApplicant: coApplicantA, ...a },\n { coApplicant: coApplicantB, ...b }\n ) =>\n codecEq.equals(a as any, b as any) &&\n option.getEq(eqCoApplicant).equals(coApplicantA, coApplicantB)\n );\n}\n\nexport const Sex = t.keyof({\n M: true,\n F: true,\n});\nexport type Sex = t.TypeOf;\n\nexport const DocumentPurpose = t.keyof({\n Primary: true,\n Secondary: true,\n});\nexport type DocumentPurpose = t.TypeOf;\n\nexport const DocumentIdentificationFlow = t.keyof({\n Primary: true,\n Secondary: true,\n PrimaryAndSecondary: true,\n PrimaryAndLivenessCheck: true,\n});\nexport type DocumentIdentificationFlow = t.TypeOf<\n typeof DocumentIdentificationFlow\n>;\n\nexport function foldDocumentIdentificationFlow(\n documentIdentificationFlow: DocumentIdentificationFlow,\n match: { [k in DocumentIdentificationFlow]: () => T }\n): T {\n return match[documentIdentificationFlow]();\n}\n\nexport function isSingleDocumentPurpose(\n flowType: DocumentIdentificationFlow\n): flowType is DocumentPurpose {\n return flowType === \"Primary\" || flowType === \"Secondary\";\n}\n\nexport const UploadDocumentFlowType = t.keyof({\n PersonalProfile: true,\n MORTGAGE: true,\n CL: true,\n SL: true,\n TL: true,\n RPL: true,\n RL: true,\n});\n\nexport type UploadDocumentFlowType = t.TypeOf;\n\nconst InvalidFlowId = t.type({\n id: t.literal(\"InvalidFlowId\"),\n});\nconst InvalidUUIDError = t.type({\n id: t.literal(\"InvalidLink\"),\n});\nconst LinkExpiredError = t.type({\n id: t.literal(\"ExpiredLink\"),\n});\nexport const VerifyLinkError = t.union([\n GenericError,\n InvalidUUIDError,\n LinkExpiredError,\n InvalidFlowId,\n]);\nexport type VerifyLinkError = t.TypeOf;\n\nconst BaseMaritalStatus = {\n Single: true,\n Married: true,\n Divorced: true,\n Widowed: true,\n};\n\nexport const MaritalStatusCZ = t.keyof({\n ...BaseMaritalStatus,\n RegisteredPartnership: true,\n});\nexport type MaritalStatusCZ = t.TypeOf;\n\nexport const MaritalStatusSK = t.keyof(BaseMaritalStatus);\nexport type MaritalStatusSK = t.TypeOf;\nexport const MaritalStatus = t.union([MaritalStatusCZ, MaritalStatusSK]);\nexport type MaritalStatus = t.TypeOf;\n\nexport const ExistingClientAuthenticationMethod = t.keyof({\n ID: true,\n QR: true,\n PUSH_NOTIFICATION: true,\n EXTERNAL_PUSH_NOTIFICATION: true,\n PIN: true,\n});\nexport type ExistingClientAuthenticationMethod = t.TypeOf<\n typeof ExistingClientAuthenticationMethod\n>;\n\nexport function foldExistingClientAuthenticationMethod(\n method: ExistingClientAuthenticationMethod,\n matches: {\n [K in ExistingClientAuthenticationMethod]: () => R;\n }\n): R {\n return matches[method]();\n}\n\nexport const DesktopAuthenticationMethod = t.keyof({\n ID: true,\n QR: true,\n PUSH_NOTIFICATION: true,\n EXTERNAL_PUSH_NOTIFICATION: true,\n});\nexport type DesktopAuthenticationMethod = t.TypeOf<\n typeof DesktopAuthenticationMethod\n>;\n\nexport function foldDesktopAuthenticationMethod(\n matches: {\n [k in DesktopAuthenticationMethod]: IO;\n }\n): Reader {\n return method => matches[method]();\n}\n\nexport function foldPortalStatus(\n portalStatus: PortalStatus,\n match: {\n onInitial: () => T;\n onNone: () => T;\n onActive: (message: LocalizedString) => T;\n onScheduled: (message: LocalizedString) => T;\n }\n) {\n switch (portalStatus.type) {\n case \"initial\":\n return match.onInitial();\n case \"none\":\n return match.onNone();\n case \"current\":\n return match.onActive(portalStatus.message);\n case \"scheduled\":\n return match.onScheduled(portalStatus.message);\n }\n}\n\nexport const ForeignCountries = t.keyof({\n BGD: true,\n BEL: true,\n BFA: true,\n BGR: true,\n BIH: true,\n BRB: true,\n WLF: true,\n BLM: true,\n BMU: true,\n BRN: true,\n BOL: true,\n BHR: true,\n BDI: true,\n BEN: true,\n BTN: true,\n JAM: true,\n BVT: true,\n BWA: true,\n WSM: true,\n BES: true,\n BRA: true,\n BHS: true,\n JEY: true,\n BLR: true,\n BLZ: true,\n RUS: true,\n RWA: true,\n SRB: true,\n TLS: true,\n REU: true,\n TKM: true,\n TJK: true,\n ROU: true,\n TKL: true,\n GNB: true,\n GUM: true,\n GTM: true,\n SGS: true,\n GRC: true,\n GNQ: true,\n GLP: true,\n JPN: true,\n GUY: true,\n GGY: true,\n GUF: true,\n GEO: true,\n GRD: true,\n GBR: true,\n GAB: true,\n SLV: true,\n GIN: true,\n GMB: true,\n GRL: true,\n GIB: true,\n GHA: true,\n OMN: true,\n TUN: true,\n JOR: true,\n HRV: true,\n HTI: true,\n HUN: true,\n HKG: true,\n HND: true,\n HMD: true,\n VEN: true,\n PRI: true,\n PSE: true,\n PLW: true,\n PRT: true,\n SJM: true,\n PRY: true,\n IRQ: true,\n PAN: true,\n PYF: true,\n PNG: true,\n PER: true,\n PAK: true,\n PHL: true,\n PCN: true,\n POL: true,\n SPM: true,\n ZMB: true,\n ESH: true,\n EST: true,\n EGY: true,\n ZAF: true,\n ECU: true,\n ITA: true,\n VNM: true,\n SLB: true,\n ETH: true,\n SOM: true,\n ZWE: true,\n SAU: true,\n ESP: true,\n ERI: true,\n MNE: true,\n MDA: true,\n MDG: true,\n MAF: true,\n MAR: true,\n MCO: true,\n UZB: true,\n MMR: true,\n MLI: true,\n MAC: true,\n MNG: true,\n MHL: true,\n MKD: true,\n MUS: true,\n MLT: true,\n MWI: true,\n MTQ: true,\n MNP: true,\n MSR: true,\n MRT: true,\n IMN: true,\n UGA: true,\n TZA: true,\n MYS: true,\n MEX: true,\n ISR: true,\n FRA: true,\n IOT: true,\n SHN: true,\n FIN: true,\n FJI: true,\n FLK: true,\n FSM: true,\n FRO: true,\n NIC: true,\n NLD: true,\n NOR: true,\n NAM: true,\n VUT: true,\n NCL: true,\n NER: true,\n NFK: true,\n NGA: true,\n NZL: true,\n NPL: true,\n NRU: true,\n NIU: true,\n COK: true,\n CIV: true,\n CHE: true,\n COL: true,\n CHN: true,\n CMR: true,\n CHL: true,\n CCK: true,\n CAN: true,\n COG: true,\n CAF: true,\n COD: true,\n CYP: true,\n CXR: true,\n CRI: true,\n CUW: true,\n CPV: true,\n CUB: true,\n SWZ: true,\n SYR: true,\n KGZ: true,\n KEN: true,\n SSD: true,\n SUR: true,\n KIR: true,\n KHM: true,\n KNA: true,\n COM: true,\n STP: true,\n KOR: true,\n SVN: true,\n PRK: true,\n KWT: true,\n SEN: true,\n SMR: true,\n SLE: true,\n SYC: true,\n KAZ: true,\n CYM: true,\n SGP: true,\n SWE: true,\n SDN: true,\n DOM: true,\n DMA: true,\n DJI: true,\n DNK: true,\n VGB: true,\n DEU: true,\n YEM: true,\n DZA: true,\n USA: true,\n URY: true,\n MYT: true,\n UMI: true,\n LBN: true,\n LCA: true,\n LAO: true,\n TUV: true,\n TWN: true,\n TTO: true,\n TUR: true,\n LKA: true,\n LIE: true,\n LVA: true,\n TON: true,\n LTU: true,\n LUX: true,\n LBR: true,\n LSO: true,\n THA: true,\n ATF: true,\n TGO: true,\n TCD: true,\n TCA: true,\n LBY: true,\n VAT: true,\n VCT: true,\n ARE: true,\n AND: true,\n ATG: true,\n AFG: true,\n AIA: true,\n VIR: true,\n ISL: true,\n IRN: true,\n ARM: true,\n ALB: true,\n AGO: true,\n ATA: true,\n ASM: true,\n ARG: true,\n AUS: true,\n AUT: true,\n ABW: true,\n IND: true,\n ALA: true,\n AZE: true,\n IRL: true,\n IDN: true,\n UKR: true,\n QAT: true,\n MOZ: true,\n});\n","import { constFalse, constTrue, pipe } from \"fp-ts/function\";\nimport { foldChannel, foldChannelLocation } from \"./globalDomain\";\nimport { useAppContext } from \"./useAppContext\";\nexport function useFoldChannelLocation(): (matches: {\n Remote: () => R;\n InPerson: () => R;\n}) => R {\n const {\n apiParameters: { channel },\n } = useAppContext();\n return matches => pipe(channel, foldChannelLocation(matches));\n}\n\nexport function useIsRemoteChannel(): boolean {\n const foldChannelToRemoteOrInPerson = useFoldChannelLocation();\n return foldChannelToRemoteOrInPerson({\n Remote: constTrue,\n InPerson: constFalse,\n });\n}\n\nexport function useIsInPersonChannel(): boolean {\n const foldChannelToRemoteOrInPerson = useFoldChannelLocation();\n return foldChannelToRemoteOrInPerson({\n Remote: constFalse,\n InPerson: constTrue,\n });\n}\n\nexport const useIsSBChannel: () => boolean = () => {\n const {\n apiParameters: { channel },\n } = useAppContext();\n return pipe(\n channel,\n foldChannel({\n Branch_InPerson: constFalse,\n \"3P_InPerson\": constFalse,\n Franchise_InPerson: constFalse,\n OB_Remote: constFalse,\n PWS_Remote: constFalse,\n SB_Remote: constTrue,\n TLS_Remote: constFalse,\n })\n );\n};\n\nexport const useIs3PChannel: () => boolean = () => {\n const {\n apiParameters: { channel },\n } = useAppContext();\n return pipe(\n channel,\n foldChannel({\n Branch_InPerson: constFalse,\n \"3P_InPerson\": constTrue,\n Franchise_InPerson: constFalse,\n OB_Remote: constFalse,\n PWS_Remote: constFalse,\n SB_Remote: constFalse,\n TLS_Remote: constFalse,\n })\n );\n};\n","import { lazy, Suspense, useRef } from \"react\";\nimport { either, option, taskEither } from \"fp-ts\";\nimport {\n constant,\n constNull,\n constUndefined,\n constVoid,\n flow,\n pipe,\n} from \"fp-ts/function\";\nimport { useAppContext } from \"../useAppContext\";\nimport { IframePortal } from \"../Common/IframePortal/IframePortal\";\nimport {\n DocumentToUploadDetail,\n DocumentType,\n ScannedDocument,\n} from \"./domain\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { useAuthenticationContext } from \"design-system\";\nimport { DocumentPurpose } from \"../globalDomain\";\nimport { Option } from \"fp-ts/Option\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\n\ntype Props = {\n _mockScanner: boolean;\n onDocumentAcquired: (\n scannedDocument: ScannedDocument\n ) => TaskEither;\n onFailure: () => unknown;\n documentPurpose: Option;\n documentDetails: Option;\n};\n\nconst MockedUpload = lazy(() => import(\"./mock/UploadImageMock\"));\n\nfunction renderMockedUpload(props: {\n origin: string;\n messageHandler: (message: unknown) => TaskEither;\n documentPurpose: Option;\n countryCode?: NonEmptyString;\n idType?: DocumentType;\n}) {\n return (\n \n \n \n );\n}\n\nexport function ScanDocument(props: Props) {\n const {\n config: { scannerAppUrl },\n apiParameters: { tenant },\n locale,\n } = useAppContext();\n const { authInfo } = useAuthenticationContext();\n\n const iframeRef = useRef(null);\n\n function signalUploadResult(success: boolean): TaskEither {\n return taskEither.fromIO(() =>\n pipe(\n iframeRef.current,\n option.fromNullable,\n option.chainNullableK(iframe => iframe.contentWindow),\n option.map(w => () =>\n w.postMessage(\n {\n type: \"UploadComplete\",\n success,\n },\n \"*\"\n )\n ),\n option.getOrElseW(constant(constVoid))\n )()\n );\n }\n\n const handleMessageReceived = (\n message: unknown\n ): TaskEither => {\n return pipe(\n message,\n ScannedDocument.decode,\n either.fold(\n flow(\n () => signalUploadResult(false),\n taskEither.chain(() => taskEither.fromIO(props.onFailure))\n ),\n flow(\n props.onDocumentAcquired,\n taskEither.chainFirst(() => signalUploadResult(true)),\n taskEither.orElse(err =>\n pipe(\n signalUploadResult(false),\n taskEither.chain(() => taskEither.left(err))\n )\n )\n )\n )\n );\n };\n\n return props._mockScanner ? (\n renderMockedUpload({\n origin: scannerAppUrl,\n messageHandler: handleMessageReceived,\n documentPurpose: props.documentPurpose,\n countryCode: pipe(\n props.documentDetails,\n option.fold(constUndefined, doc => doc.country.countryCode)\n ),\n idType: pipe(\n props.documentDetails,\n option.map(doc => doc.type),\n option.flatten,\n option.getOrElseW(constUndefined)\n ),\n })\n ) : (\n i.flowId),\n option.getOrElse(() => \"missing\")\n )\n )}\n onMessageReceived={message => handleMessageReceived(message)()}\n width={760}\n height={350}\n />\n );\n}\n","import { Option } from \"fp-ts/Option\";\nimport {\n Body,\n Box,\n Button,\n Space,\n FileIcon,\n UploadButton,\n useIsMobileLayout,\n LocalizedString,\n} from \"design-system\";\nimport { constant, constVoid, pipe } from \"fp-ts/function\";\nimport { option } from \"fp-ts\";\nimport * as classes from \"./UploadImageButton.treat\";\nimport cx from \"classnames\";\nimport { useFormatMessage } from \"../intl\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { useAppContext } from \"../useAppContext\";\nimport { foldTenant } from \"../globalDomain\";\n\nimport IdCardImage_CZ from \"./idcard_cz.png\";\nimport IdCardImage_SK from \"./idcard_sk.png\";\nimport { HelpLineSupportDocumentId } from \"../Common/HelplineSupportDocumentId/HelplineSupportDocumentId\";\nimport { useIsRemoteChannel } from \"../useChannel\";\n\ntype Props = {\n label: LocalizedString;\n onClick: () => unknown;\n image: Option<{\n src: NonEmptyString;\n onClick: () => unknown;\n }>;\n disabled?: boolean;\n};\n\nexport function UploadImageButton(props: Props) {\n const formatMessage = useFormatMessage();\n\n const {\n apiParameters: { tenant },\n } = useAppContext();\n\n const isRemote = useIsRemoteChannel();\n\n const IdCardImagePlaceholder = foldTenant(\n tenant,\n () => IdCardImage_SK,\n () => IdCardImage_CZ\n );\n\n const isMobileLayout = useIsMobileLayout();\n\n return option.isSome(props.image) ? (\n \n \n imageProp.src\n )\n )}\n alt={props.label}\n className={cx(classes.image, {\n [classes.placeholder]: option.isNone(props.image),\n })}\n />\n \n\n \n constVoid,\n imageProp => imageProp.onClick\n )\n )}\n >\n {pipe(\n props.image,\n option.fold(\n () => (\n \n {props.label}\n \n ),\n imageProps => (\n \n )\n )\n )}\n \n \n \n \n \n ) : (\n \n \n {!isMobileLayout && (\n <>\n \n \n {props.label}\n \n \n \n )}\n {isRemote && (\n <>\n \n \n \n )}\n \n );\n}\n","import * as remoteData from \"./RemoteData\";\nimport { RemoteData } from \"./RemoteData\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { useState, useEffect } from \"react\";\nimport { pipe } from \"fp-ts/function\";\n\nexport function useRemoteData(task: TaskEither): RemoteData {\n const [data, setData] = useState>(remoteData.remoteLoading);\n useEffect(() => {\n let isActive = true;\n setData(data =>\n pipe(\n data,\n remoteData.fold(\n () => remoteData.remoteLoading,\n () => remoteData.remoteLoading,\n data => remoteData.remoteSuccess(data, true)\n )\n )\n );\n task().then(data => {\n if (isActive) {\n setData(remoteData.fromEither(data));\n }\n });\n return () => {\n isActive = false;\n };\n }, [task]);\n return data;\n}\n","import {\n Body,\n bold,\n Box,\n Button,\n Card,\n Children,\n InfoIcon,\n LocalizedString,\n Space,\n Stack,\n Tooltip,\n useIsMobileLayout,\n useIsTouchScreen,\n} from \"design-system\";\n// eslint-disable-next-line no-restricted-imports\nimport { CheckboxField, Dialog } from \"design-system/lib/vanilla\";\nimport { palette } from \"design-system/lib/styleConstants\";\nimport { useState } from \"react\";\nimport { option } from \"fp-ts\";\nimport { VirtualCardsDialogChild } from \"../Common/Dialogs/VirtualCardsDialog/VirtualCardsDialogChild\";\nimport { Option } from \"fp-ts/Option\";\nimport * as classnames from \"./CustomCard.treat\";\n\ntype Props = {\n checkBoxValue?: Option;\n checkBoxOnChange: (data: {\n physicalCardSelected: Option;\n }) => unknown;\n checkBoxName: string;\n checkBoxDisabled?: boolean;\n cardTitle: LocalizedString;\n cardDescription: LocalizedString;\n showModalLabel: LocalizedString;\n imgUrl: string;\n dialogTitle: LocalizedString;\n dialogContent: Children;\n tooltipInfoTitle?: LocalizedString;\n tooltipInfoContent?: LocalizedString;\n physicalCard: boolean;\n imageCardHorizontal: boolean;\n raiseCard: boolean;\n};\n\nexport const CustomCard = (props: Props) => {\n const [showModal, setShowModal] = useState(false);\n const isBranchExperienceTouchScreen = useIsTouchScreen();\n const isMobileLayout = useIsMobileLayout();\n\n const checkBoxValue =\n props.checkBoxValue && option.isSome(props.checkBoxValue)\n ? props.checkBoxValue.value\n : false;\n\n return (\n \n \n \n \n \n \n props.checkBoxOnChange({\n physicalCardSelected: option.some(data.target.checked),\n })\n }\n label={bold(props.cardTitle)}\n className={classnames.customCard}\n />\n <>\n {!!props.tooltipInfoContent && !!props.tooltipInfoTitle && (\n \n \n \n )}\n \n \n \n \n \n {props.cardDescription}\n \n {!isMobileLayout && }\n \n \n {\n setShowModal(true);\n }}\n label={props.showModalLabel}\n />\n \n \n \n \n \n <>{!isMobileLayout && }\n \n \n {showModal && (\n <>\n {\n setShowModal(false);\n }}\n actions={[]}\n children={props.dialogContent}\n />\n {isBranchExperienceTouchScreen && }\n \n )}\n \n );\n};\n","import { ProductType } from \"./PendingApplicationEmailLink/PendingApplicationEmailLinkContent/api\";\nimport { UUID } from \"io-ts-types/lib/UUID\";\nimport { lit, type, zero, query } from \"fp-ts-routing\";\nimport * as t from \"io-ts\";\nimport { optionFromUndefined } from \"./globalDomain\";\nimport { Option } from \"fp-ts/Option\";\nimport { NonEmptyString } from \"io-ts-types/NonEmptyString\";\nimport { parseLocation } from \"./parseLocation\";\n\ninterface NotFound {\n readonly _tag: \"NotFound\";\n}\n\ninterface EmailVerification {\n readonly _tag: \"EmailVerification\";\n readonly id: UUID;\n}\n\ninterface UploadDocumentsLink {\n readonly _tag: \"UploadDocumentsLink\";\n readonly applicationId: NonEmptyString;\n readonly productType: ProductType;\n}\n\ninterface UploadDocumentsLinkWithBankerFlow {\n readonly _tag: \"UploadDocumentsLinkWithBankerFlow\";\n readonly linkId: NonEmptyString;\n readonly productType: ProductType;\n}\n\ninterface PendingApplicationLink {\n readonly _tag: \"PendingApplicationLink\";\n readonly applicationId: NonEmptyString;\n readonly productType: ProductType;\n}\n\ninterface MobileIdUpload {\n readonly _tag: \"MobileIdUpload\";\n readonly id: UUID;\n}\n\ninterface MobileProofOfIncomeUpload {\n readonly _tag: \"MobileProofOfIncomeUpload\";\n readonly id: UUID;\n}\n\ninterface MobileSelfieCheck {\n readonly _tag: \"MobileSelfieCheck\";\n readonly id: UUID;\n}\n\ninterface MobileSelfieTest {\n readonly _tag: \"MobileSelfieTest\";\n}\n\ninterface MobileHologramCheck {\n readonly _tag: \"MobileHologramCheck\";\n readonly id: UUID;\n}\n\ninterface MobileFullCheck {\n readonly _tag: \"MobileFullCheck\";\n readonly id: UUID;\n}\n\ninterface ClientRedirect {\n readonly _tag: \"ClientRedirect\";\n readonly jwtReference: UUID;\n readonly function: Option;\n readonly step: Option;\n readonly DBNObjectId: Option;\n readonly source: Option;\n}\n\ninterface UserNotClientOwner {\n readonly _tag: \"UserNotClientOwner\";\n readonly source: Option;\n}\n\ninterface RemoteOnboarding {\n readonly _tag: \"RemoteOnboarding\";\n readonly product: string;\n readonly promo: Option;\n readonly \"calculator-data\": Option;\n}\n\ninterface MobileCreateProfile {\n readonly _tag: \"MobileCreateProfile\";\n readonly id: UUID;\n}\n\ninterface MobileCreateProfileAndSign {\n readonly _tag: \"MobileCreateProfileAndSign\";\n readonly id: UUID;\n}\n\ninterface OpenApplication {\n readonly _tag: \"OpenApplication\";\n readonly encryptedApplicationId: NonEmptyString;\n}\n\nexport type InternetLocation =\n | NotFound\n | EmailVerification\n | PendingApplicationLink\n | UploadDocumentsLink\n | UploadDocumentsLinkWithBankerFlow\n | MobileCreateProfile\n | MobileCreateProfileAndSign\n | MobileIdUpload\n | MobileProofOfIncomeUpload\n | MobileSelfieCheck\n | MobileSelfieTest\n | MobileHologramCheck\n | MobileFullCheck\n | ClientRedirect\n | RemoteOnboarding\n | OpenApplication\n | UserNotClientOwner;\n\nexport const notFound: InternetLocation = { _tag: \"NotFound\" };\n\nexport const emailVerification = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"EmailVerification\",\n});\n\nexport const pendingApplicationLink = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"PendingApplicationLink\",\n});\n\nexport const uploadDocumentsLink = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"UploadDocumentsLink\",\n});\n\nexport const uploadDocumentsLinkWithBankerFlowLink = (\n params: Omit\n): InternetLocation => ({\n ...params,\n linkId: params.linkId,\n _tag: \"UploadDocumentsLinkWithBankerFlow\",\n});\n\nexport const mobileIdUpload = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileIdUpload\",\n});\n\nexport const mobileProofOfIncomeUpload = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileProofOfIncomeUpload\",\n});\n\nexport const mobileSelfieCheck = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileSelfieCheck\",\n});\nexport const mobileSelfieTest = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileSelfieTest\",\n});\n\nexport const mobileHologramCheck = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileHologramCheck\",\n});\n\nexport const mobileFullCheck = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileFullCheck\",\n});\n\nexport const mobileCreateProfile = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileCreateProfile\",\n});\n\nexport const mobileCreateProfileAndSign = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"MobileCreateProfileAndSign\",\n});\n\nexport const clientRedirect = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"ClientRedirect\",\n});\n\nexport const userNotClientOwner = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"UserNotClientOwner\",\n});\n\nexport const remoteOnboarding = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"RemoteOnboarding\",\n});\n\nexport const openApplication = (\n params: Omit\n): InternetLocation => ({\n ...params,\n _tag: \"OpenApplication\",\n});\n\nexport function foldInternetLocation(\n matches: {\n [L in InternetLocation[\"_tag\"]]: (\n args: Omit, \"_tag\">\n ) => R;\n }\n): (location: InternetLocation) => R {\n return location => matches[location._tag](location as any);\n}\n\nconst emailVerificationMatch = lit(\"emailverification\").then(type(\"id\", UUID));\nconst pendingApplicationMatch = lit(\"pendingapplication\").then(\n query(\n t.type({\n applicationId: NonEmptyString,\n productType: ProductType,\n })\n )\n);\n\nconst uploadDocumentsMatch = lit(\"uploaddocumentsclient\").then(\n query(\n t.type({\n applicationId: NonEmptyString,\n productType: ProductType,\n })\n )\n);\n\nconst uploadDocumentsLinkWithBankerFlowMatch = lit(\n \"uploaddocumentsclient\"\n).then(\n query(\n t.type({\n linkId: NonEmptyString,\n productType: ProductType,\n })\n )\n);\n\nconst mobileIdUploadMatch = lit(\"mobileidupload\").then(type(\"id\", UUID));\nconst mobileProofOfIncomeUploadMatch = lit(\"mobileproofofincomeupload\").then(\n type(\"id\", UUID)\n);\nconst mobileSelfieCheckMatch = lit(\"mobileselfiecheck\").then(type(\"id\", UUID));\nconst mobileSelfieTestMatch = lit(\"mobileselfietest\");\nconst mobileHologramCheckMatch = lit(\"mobilehologramcheck\").then(\n type(\"id\", UUID)\n);\nconst mobileFullCheckMatch = lit(\"mobilefullcheck\").then(type(\"id\", UUID));\nconst mobileCreateProfileMatch = lit(\"mobilecreateprofile\").then(\n type(\"id\", UUID)\n);\nconst mobileCreateProfileAndSignMatch = lit(\"mobilecreateprofileandsign\").then(\n type(\"id\", UUID)\n);\nconst clientRedirectMatch = lit(\"clientRedirect\").then(\n query(\n t.type({\n jwtReference: UUID,\n function: optionFromUndefined(NonEmptyString),\n DBNObjectId: optionFromUndefined(NonEmptyString),\n step: optionFromUndefined(NonEmptyString),\n source: optionFromUndefined(NonEmptyString),\n })\n )\n);\nconst userNotClientOwnerMatch = lit(\"userNotClientOwner\").then(\n query(\n t.type({\n source: optionFromUndefined(NonEmptyString),\n })\n )\n);\nconst remoteOnboardingMatch = lit(\"onboarding\").then(\n query(\n t.type({\n product: t.string,\n promo: optionFromUndefined(NonEmptyString),\n \"calculator-data\": optionFromUndefined(NonEmptyString),\n })\n )\n);\nconst openApplicationMatch = lit(\"openapplication\").then(\n type(\"encryptedApplicationId\", NonEmptyString)\n);\n\nconst router = zero()\n .alt(emailVerificationMatch.parser.map(emailVerification))\n .alt(pendingApplicationMatch.parser.map(pendingApplicationLink))\n .alt(uploadDocumentsMatch.parser.map(uploadDocumentsLink))\n .alt(\n uploadDocumentsLinkWithBankerFlowMatch.parser.map(\n uploadDocumentsLinkWithBankerFlowLink\n )\n )\n .alt(mobileCreateProfileMatch.parser.map(mobileCreateProfile))\n .alt(mobileCreateProfileAndSignMatch.parser.map(mobileCreateProfileAndSign))\n .alt(mobileIdUploadMatch.parser.map(mobileIdUpload))\n .alt(mobileProofOfIncomeUploadMatch.parser.map(mobileProofOfIncomeUpload))\n .alt(mobileSelfieCheckMatch.parser.map(mobileSelfieCheck))\n .alt(mobileSelfieTestMatch.parser.map(mobileSelfieTest))\n .alt(mobileHologramCheckMatch.parser.map(mobileHologramCheck))\n .alt(mobileFullCheckMatch.parser.map(mobileFullCheck))\n .alt(clientRedirectMatch.parser.map(clientRedirect))\n .alt(remoteOnboardingMatch.parser.map(remoteOnboarding))\n .alt(openApplicationMatch.parser.map(openApplication))\n .alt(userNotClientOwnerMatch.parser.map(userNotClientOwner));\ntype Props = {\n render: (location: InternetLocation) => JSX.Element;\n};\n\nexport function InternetRouter(props: Props) {\n const location = parseLocation(\n window.location.pathname + window.location.search,\n router,\n notFound\n );\n\n return props.render(location);\n}\n","import { lazy, Suspense, useRef, useState } from \"react\";\nimport {\n AlertDialog,\n Banner,\n Body,\n Box,\n Card,\n CheckboxField,\n ContentRow,\n Dialog,\n Divider,\n FormErrors,\n FormSubSectionTitle,\n Heading,\n InlineLoader,\n LocalizedString,\n MobileConnectionOKIcon,\n Space,\n Stack,\n useForm,\n useIsMobileLayout,\n validators,\n WarningIcon,\n} from \"design-system\";\nimport {\n boolean,\n either,\n nonEmptyArray,\n option,\n task,\n taskEither,\n} from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { LocaleKey, useFormatMessage } from \"../intl\";\nimport { UploadImageButton } from \"./UploadImageButton\";\nimport { UploadSummary } from \"./UploadSummary\";\nimport {\n constant,\n constFalse,\n constNull,\n constTrue,\n constVoid,\n flow,\n identity,\n pipe,\n} from \"fp-ts/function\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { Task } from \"fp-ts/Task\";\nimport { ScannerIdUpload } from \"./ScannerIdUpload/ScannerIdUpload\";\nimport { useAppContext } from \"../useAppContext\";\nimport {\n CoApplicantInput,\n DocumentIdentificationFlow,\n foldTenant,\n genericError,\n UploadDocumentFlowType,\n} from \"../globalDomain\";\nimport { Country, DocumentObject, DocumentToUploadDetail } from \"./domain\";\nimport * as classes from \"./UploadId.treat\";\nimport IdCardImage_CZ from \"./idcard_cz.png\";\nimport IdCardImage_SK from \"./idcard_sk.png\";\nimport Passport_CZ from \"./passport_cz.png\";\nimport Passport_SK from \"./passport_sk.png\";\nimport DrivingLicense_CZ from \"./drivinglicense_cz.png\";\nimport DrivingLicense_SK from \"./drivinglicense_sk.png\";\nimport { UploadAgainDialog } from \"./UploadAgainDialog\";\nimport { useCommand } from \"../useAPI\";\nimport * as uploadApi from \"./api\";\nimport { UploadDocumentCommand } from \"./api\";\nimport * as idUploadApi from \"../IdUpload/api\";\nimport { ClientDataOutput } from \"../IdUpload/api\";\nimport { UploadError } from \"./types\";\nimport { BiometricConsentStatus } from \"../IdUpload/types\";\nimport { BiometricConsent } from \"./BiometricConsent\";\nimport { foldFraudCheckType, FraudCheckDialog } from \"./FraudCheckDialog\";\nimport {\n cancelUploadAction,\n foldState,\n getReducerConfig,\n goToSummaryAction,\n selectRecipientAction,\n shareWithClientAction,\n startFraudCheckAction,\n startMobileFraudCheckFromSameDeviceAction,\n startMobileUploadFromSameDeviceAction,\n startUploadAction,\n startUploadModeAction,\n uploadAgainAction,\n UploadMode,\n} from \"./state\";\nimport { ChooseMobileDeviceDialog } from \"./ChooseMobileDeviceDialog\";\nimport { MobileUploadStatusDialog } from \"./MobileUploadStatusDialog\";\nimport { selectedMainApplicant } from \"../MortgageDashboard/mortgageDashboardUtils\";\nimport { UploadModeDialogWithMobile } from \"./UploadModeDialogWithMobile\";\nimport { UploadModeDialog } from \"./UploadModeDialog\";\nimport { RemoteMobileDeviceDialog } from \"./RemoteMobileDeviceDialog\";\nimport {\n CheckClientDataResult,\n useCheckClientDataResult,\n} from \"./useCheckClientDataResult\";\nimport { useParentSharedReducer } from \"../BranchExperience/useSharedReducer\";\nimport { ShareWithClientButton } from \"../Common/ShareWithClientButton/ShareWithClientButton\";\nimport { useBranchExperienceContext } from \"../BranchExperience/BranchExperienceContext\";\nimport { NextButton } from \"../Common/NextButton\";\nimport { useIsInPersonChannel, useIsRemoteChannel } from \"../useChannel\";\nimport { formatDocumentType } from \"./utils\";\nimport WhatToUpload from \"./MobileIdUpload/UploadIdSteps/WhatToUpload\";\nimport { usePortalStatusContext } from \"../PortalStatusContext\";\nimport { RestoreApplicationData } from \"../UKontoSecondPart/api\";\nimport { MobileRequiredDocuments } from \"./MobileIdUpload/common/MobileRequiredDocuments\";\nimport { ChooseDocumentToUpload } from \"./DocumentToUpload/ChooseDocumentToUpload\";\nimport { useValidators } from \"../Common/useValidators\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { DocumentDigitalIdSwitch } from \"./DocumentDigitalIdSwitch\";\n\nconst MobileUploadFlow2 = lazy(\n () => import(\"./MobileIdUpload/MobileUploadFlow2\")\n);\nconst MobileUploadFlow = lazy(\n () => import(\"./MobileIdUpload/MobileUploadFlow\")\n);\n\nconst MobileCheckFlow = lazy(() => import(\"./MobileIdUpload/MobileCheckFlow\"));\n\ntype CopyIdDocumentConsent =\n | {\n allowCopyIdDocumentAgreementEdit: boolean;\n forceHideCopyIdDocumentAgreement?: never;\n }\n | {\n allowCopyIdDocumentAgreementEdit?: never;\n forceHideCopyIdDocumentAgreement: true;\n };\n\ntype Props = {\n onContinue: (data: CheckClientDataResult) => unknown;\n onUploadAgain: TaskEither;\n onRemove: () => unknown;\n onFailure: (\n reason: \"GenericError\" | \"MaxAttemptsReached\" | \"ValidationError\"\n ) => unknown;\n biometricConsent: BiometricConsentStatus;\n hideBiometricConsent?: boolean;\n setBiometricConsent: (consent: BiometricConsentStatus) => void;\n uploadCommand: UploadDocumentCommand;\n resetAfterScannerCancel: TaskEither;\n documentIdentificationFlow: DocumentIdentificationFlow;\n extractCommand: TaskEither;\n forceMobileRecipientSelection?: boolean;\n productType: Option;\n isPotentialClient?: boolean;\n restoredData?: RestoreApplicationData;\n supportForeign?: boolean;\n isUploadAgain?: boolean;\n digitalIdSwitch?: {\n type: \"upload\" | \"digital\";\n setType: (type: \"upload\" | \"digital\") => unknown;\n };\n} & CoApplicantInput &\n CopyIdDocumentConsent;\n\ntype UpdateConsent =\n | {\n open: false;\n }\n | {\n open: true;\n value: Option;\n };\n\nconst consentDialogClosed: UpdateConsent = { open: false };\n\nexport type CountryFormState = {\n country: Option;\n docType: Option<\"IDCard\" | \"Passport\">;\n};\n\nexport function UploadDocuments(props: Props) {\n const {\n apiParameters: { tenant, channel },\n config: {\n biometricConsent: biometricConsentEnabled,\n useNewMobileIdUploadUx: useNewUploadId,\n externalCommunication,\n },\n } = useAppContext();\n\n const { branchExperienceFeaturesActive } = useBranchExperienceContext();\n const { portalBlocked } = usePortalStatusContext();\n\n const formatMessage = useFormatMessage();\n const applicantIndex = pipe(\n props.coApplicant,\n option.fold(constant(selectedMainApplicant.index), c => c.index)\n );\n\n const sendBiometricConsentCommand = useCommand(\n uploadApi.sendBiometricConsent\n );\n const fraudCheckResult = useCommand(idUploadApi.fraudCheckResult);\n\n const sendBiometricConsent = (consent: boolean) =>\n taskEither.bracket(\n taskEither.fromIO(() => setPendingBiometricConsentCommand(true)),\n () => sendBiometricConsentCommand({ consent, applicantIndex }),\n () => taskEither.fromIO(() => setPendingBiometricConsentCommand(false))\n );\n\n const isMobileLayout = useIsMobileLayout();\n const useNewMobile = isMobileLayout && useNewUploadId;\n\n const [uploadStatus, dispatch] = useParentSharedReducer(\n getReducerConfig(channel),\n props.restoredData &&\n props.restoredData.documentsAlreadyUploaded &&\n !props.isUploadAgain\n ? {\n id: \"UploadSummary\",\n showUploadCompletedDialog: false,\n sharedWithClient: false,\n }\n : {\n id: useNewMobile ? \"ReadyMobile\" : \"Ready\",\n }\n );\n\n const [errors, setErrors] = useState([]);\n\n const [selectedCountry, setSelectedCountry] = useState>(\n props.restoredData &&\n props.restoredData.documentsAlreadyUploaded &&\n !props.isUploadAgain &&\n option.isSome(props.restoredData.countryDocSelection) &&\n option.isSome(props.restoredData.countryDocSelection.value.country)\n ? option.some(props.restoredData.countryDocSelection.value.country.value)\n : option.none\n );\n\n const [foreignDocumentType, setForeignDocumentType] = useState<\n Option<\"IDCard\" | \"Passport\">\n >(\n props.restoredData &&\n props.restoredData.documentsAlreadyUploaded &&\n !props.isUploadAgain &&\n option.isSome(props.restoredData.countryDocSelection) &&\n option.isSome(\n props.restoredData.countryDocSelection.value.foreignDocumentType\n )\n ? (option.some(\n props.restoredData.countryDocSelection.value.foreignDocumentType.value\n ) as Option<\"IDCard\" | \"Passport\">)\n : option.none\n );\n\n const [saveCurrentSelection, setSaveCurrentSelection] = useState(false);\n\n const addErrorIfMissing = (error: UploadError) => {\n if (!errors.some(e => e.id === error.id)) {\n setErrors(errors => [...errors, error]);\n }\n };\n\n const removeError = (error: UploadError) => {\n if (errors.some(e => e.id === error.id)) {\n setErrors(errors.filter(e => e.id !== error.id));\n }\n };\n\n const isRemote = useIsRemoteChannel();\n\n const isInPerson = useIsInPersonChannel();\n const requiresConsent =\n foldTenant(tenant, constFalse, constTrue) &&\n isInPerson &&\n !props.forceHideCopyIdDocumentAgreement;\n\n const [updateConsentModal, setUpdateConsentModal] = useState(\n consentDialogClosed\n );\n\n const updateBiometricConsent = (consent: Option) => {\n props.setBiometricConsent({\n consent,\n previousConsent: option.none,\n });\n removeError({ id: \"MissingBiometricConsentError\" });\n };\n\n const updateBiometricConsentMobile = (consent: Option) => {\n pipe(\n sendBiometricConsent(option.isSome(consent) ? consent.value : false),\n taskEither.chain(() =>\n taskEither.fromIO(() => {\n props.setBiometricConsent({\n consent,\n previousConsent: option.none,\n });\n removeError({ id: \"MissingBiometricConsentError\" });\n })\n )\n )();\n };\n\n const onConsentConfirm = () => {\n if (updateConsentModal.open) {\n resetProcess();\n props.onRemove();\n updateBiometricConsent(updateConsentModal.value);\n setUpdateConsentModal(consentDialogClosed);\n }\n };\n\n const handleBiometricConsent = (consent: Option) => {\n const lastConsentValue = pipe(\n props.biometricConsent.consent,\n option.getOrElse(constFalse)\n );\n const currentConsentValue = pipe(consent, option.getOrElse(constFalse));\n\n if (\n lastConsentValue !== currentConsentValue &&\n uploadStatus.id === \"UploadSummary\"\n ) {\n return setUpdateConsentModal({\n open: true,\n value: consent,\n });\n }\n updateBiometricConsent(consent);\n };\n\n const isBiometricConsentLocked = branchExperienceFeaturesActive\n ? false\n : pipe(props.biometricConsent.previousConsent, option.exists(identity)) ||\n uploadStatus.id === \"UploadSummary\";\n\n const [\n pendingBiometricConsentCommand,\n setPendingBiometricConsentCommand,\n ] = useState(false);\n\n const checkClientDataResult = useCheckClientDataResult(\n props.extractCommand,\n props.isPotentialClient\n );\n\n const formatErrors = (errors: UploadError[]): Array => {\n return errors.map(e => {\n switch (e.id) {\n case \"MissingBiometricConsentError\":\n return formatMessage(\n \"Identification.UploadDocuments.biometricData.missing\"\n );\n case \"GenericError\":\n return formatMessage(\"GenericError\");\n case \"MissingDocumentError\":\n return formatMessage(\n \"Identification.UploadDocuments.missingDocumentError\"\n );\n case \"BiometricConsentMustBeTrueError\":\n return formatMessage(\n \"Identification.UploadDocuments.biometricData.mustConsent\"\n );\n case \"ForeignMissingCountryError\":\n return formatMessage(\n \"Identification.UploadDocuments.foreignCountry.missing\"\n );\n case \"ForeignMissingDocTypeError\":\n return formatMessage(\n \"Identification.UploadDocuments.foreignCountry.docType.missing\"\n );\n }\n });\n };\n\n const cancelUpload = () => {\n dispatch(cancelUploadAction(useNewMobile));\n props.setBiometricConsent({\n consent: props.biometricConsent.consent,\n previousConsent: option.none,\n });\n };\n\n const resetProcess = () => {\n setErrors([]);\n setDocumentDetails(option.none);\n dispatch(cancelUploadAction(useNewMobile));\n props.setBiometricConsent({\n consent: props.biometricConsent.consent,\n previousConsent: props.biometricConsent.consent,\n });\n };\n\n const scrollToBiometricError = () => {\n if (!biometricSectionRef.current) {\n return;\n }\n biometricSectionRef.current.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n });\n };\n\n const onTryUpload = () => {\n if (uploadStatus.id !== \"Ready\") {\n return;\n }\n\n pipe(\n biometricConsentEnabled && !props.hideBiometricConsent,\n boolean.fold(\n () => taskEither.rightIO(constVoid),\n () =>\n pipe(\n props.biometricConsent.consent,\n option.fold(\n () =>\n taskEither.left({\n id: \"MissingBiometricConsentError\",\n }),\n consent =>\n pipe(\n !consent && tenant === \"SK\" && isRemote,\n boolean.fold(\n () =>\n pipe(\n consent,\n sendBiometricConsent,\n taskEither.mapLeft(\n (): UploadError => ({ id: \"GenericError\" })\n )\n ),\n () =>\n taskEither.left({\n id: \"BiometricConsentMustBeTrueError\",\n })\n )\n )\n )\n )\n ),\n taskEither.bimap(\n (error: UploadError) => {\n if (error.id === \"MissingBiometricConsentError\") {\n scrollToBiometricError();\n }\n addErrorIfMissing(error);\n if (isInPerson && props.supportForeign === true) {\n const country = fieldPropsCountry(\"country\").value;\n if (option.isNone(country)) {\n removeError({ id: \"ForeignMissingDocTypeError\" });\n addErrorIfMissing({ id: \"ForeignMissingCountryError\" });\n } else {\n removeError({ id: \"ForeignMissingCountryError\" });\n if (\n localCountryCode !== country.value.countryCode &&\n option.isNone(fieldPropsCountry(\"docType\").value)\n ) {\n addErrorIfMissing({ id: \"ForeignMissingDocTypeError\" });\n } else {\n removeError({ id: \"ForeignMissingDocTypeError\" });\n }\n }\n }\n handleSubmitCountry();\n },\n () => {\n let hasErrors = false;\n if (isInPerson && props.supportForeign === true) {\n const country = fieldPropsCountry(\"country\").value;\n if (option.isNone(country)) {\n removeError({ id: \"ForeignMissingDocTypeError\" });\n addErrorIfMissing({ id: \"ForeignMissingCountryError\" });\n hasErrors = true;\n } else {\n removeError({ id: \"ForeignMissingCountryError\" });\n if (\n localCountryCode !== country.value.countryCode &&\n option.isNone(fieldPropsCountry(\"docType\").value)\n ) {\n addErrorIfMissing({ id: \"ForeignMissingDocTypeError\" });\n hasErrors = true;\n } else {\n removeError({ id: \"ForeignMissingDocTypeError\" });\n }\n }\n }\n handleSubmitCountry();\n if (!hasErrors) {\n dispatch(startUploadAction());\n }\n }\n )\n )();\n };\n\n const uploadAgain: TaskEither = pipe(\n props.onUploadAgain,\n taskEither.chain(() => taskEither.fromIO(resetProcess))\n );\n\n const biometricSectionRef = useRef(null);\n\n const checkBiometricConsent =\n biometricConsentEnabled && !props.hideBiometricConsent\n ? taskEither.fromEither(\n pipe(\n props.biometricConsent.consent,\n option.fold(\n () =>\n either.left({\n id: \"MissingBiometricConsentError\",\n } as const),\n () => either.right(null)\n )\n )\n )\n : taskEither.fromEither(either.right(null));\n\n const updateBiometricConsentStatus = () => {\n if (biometricConsentEnabled && !props.hideBiometricConsent) {\n props.setBiometricConsent({\n consent: props.biometricConsent.consent,\n previousConsent: props.biometricConsent.consent,\n });\n }\n };\n const { fieldProps, handleSubmit, isSubmitting } = useForm(\n {\n initialValues: {\n copyIdDocumenConsent: !!(\n props.restoredData && props.restoredData.documentsAlreadyUploaded\n ),\n },\n fieldValidators: () => ({\n copyIdDocumenConsent: requiresConsent\n ? validators.checked(\n formatMessage(\"Identification.client.missing.confirmation\")\n )\n : undefined,\n }),\n },\n {\n onSubmit: () =>\n pipe(\n checkBiometricConsent,\n taskEither.chainW(() => {\n if (uploadStatus.id !== \"UploadSummary\") {\n return taskEither.left({ id: \"MissingDocumentError\" as const });\n }\n if (\n branchExperienceFeaturesActive &&\n !uploadStatus.sharedWithClient\n ) {\n return taskEither.rightIO(() => dispatch(shareWithClientAction));\n }\n return taskEither.fromTask(extractClientData);\n }),\n taskEither.orElse(error => {\n if (error.id === \"MissingBiometricConsentError\")\n scrollToBiometricError();\n\n return taskEither.leftIO(() => {\n addErrorIfMissing(error);\n return error;\n });\n })\n ),\n }\n );\n\n const localCountryCode = foldTenant(\n tenant,\n () => \"SVK\" as NonEmptyString,\n () => \"CZE\" as NonEmptyString\n );\n\n const localCountry = foldTenant(\n tenant,\n () => {\n return { countryCode: \"SVK\" as NonEmptyString } as Country;\n },\n () => {\n return { countryCode: \"CZE\" as NonEmptyString } as Country;\n }\n );\n\n const { defined, definedNoExtract } = useValidators();\n\n const {\n fieldProps: fieldPropsCountry,\n handleSubmit: handleSubmitCountry,\n handleReset: handleResetCountry,\n } = useForm(\n {\n initialValues:\n props.restoredData &&\n option.isSome(props.restoredData.countryDocSelection)\n ? {\n country: props.restoredData.countryDocSelection.value.country,\n docType: props.restoredData.countryDocSelection.value\n .foreignDocumentType as Option<\"IDCard\" | \"Passport\">,\n }\n : {\n country: option.some(localCountry) as Option,\n docType: option.none as Option<\"IDCard\" | \"Passport\">,\n },\n fieldValidators: values => ({\n country: defined(),\n docType: pipe(\n values.country,\n option.fold(\n () => definedNoExtract<\"IDCard\" | \"Passport\">(),\n country =>\n country.countryCode === localCountryCode\n ? undefined\n : definedNoExtract<\"IDCard\" | \"Passport\">()\n )\n ),\n }),\n },\n {\n onSubmit: ({ country, docType }) =>\n taskEither.fromIO(() =>\n setDocumentDetails(\n option.some({\n country: country,\n type: docType,\n })\n )\n ),\n }\n );\n\n const extractClientData: Task = pipe(\n checkClientDataResult,\n taskEither.fold(\n response => {\n switch (response.id) {\n case \"Abort\":\n return task.fromIO(() => props.onFailure(\"GenericError\"));\n case \"ValidationError\":\n return task.fromIO(() => props.onFailure(\"ValidationError\"));\n case \"GenericError\":\n return task.fromIO(() => addErrorIfMissing(genericError));\n case \"UploadAgain\":\n return task.fromIO(() =>\n dispatch(uploadAgainAction(response.documentMismatch))\n );\n case \"FraudCheck\":\n return task.fromIO(() => {\n if (props.documentIdentificationFlow === \"PrimaryAndSecondary\") {\n updateBiometricConsentStatus();\n props.onContinue(response.data);\n } else {\n pipe(\n response.data.fraudCheck,\n option.map(fraudCheck =>\n dispatch(\n startFraudCheckAction(\n fraudCheck,\n response.data.canUploadAgain\n )\n )\n )\n );\n }\n });\n }\n },\n data =>\n task.fromIO(() => {\n updateBiometricConsentStatus();\n props.onContinue(data);\n })\n )\n );\n\n const Placeholder = (\n \n {pendingBiometricConsentCommand ? (\n \n \n \n \n \n \n \n ) : (\n \n )}\n \n \n );\n\n const onUploadModalConfirm = ({ mode }: { mode: UploadMode }) => {\n dispatch(startUploadModeAction(mode));\n };\n\n const DocumentCard = ({\n src,\n message,\n }: {\n src: string;\n message: LocaleKey;\n }) => {\n const isMobileLayout = useIsMobileLayout();\n\n return (\n \n \n \n \n \n \n {formatMessage(message)}\n \n \n );\n };\n\n const isPersonalProfile = pipe(\n props.productType,\n option.exists(value => value === \"PersonalProfile\")\n );\n\n const primaryDocumentsImages: DocumentObject[] = foldTenant(\n tenant,\n () =>\n isRemote && !isPersonalProfile\n ? [{ src: IdCardImage_SK, type: \"IDCard\" }]\n : [\n { src: IdCardImage_SK, type: \"IDCard\" },\n { src: Passport_CZ, type: \"Passport\" },\n ],\n () =>\n (isRemote || channel === \"TLS_Remote\") && !isPersonalProfile\n ? [{ src: IdCardImage_CZ, type: \"IDCard\" }]\n : [\n { src: IdCardImage_CZ, type: \"IDCard\" },\n { src: Passport_SK, type: \"Passport\" },\n ]\n );\n\n const secondaryDocumentsImages: DocumentObject[] = foldTenant(\n tenant,\n () =>\n !isPersonalProfile\n ? []\n : [\n { src: Passport_SK, type: \"Passport\" },\n { src: DrivingLicense_SK, type: \"DrivingLicenseSK\" },\n { src: DrivingLicense_CZ, type: \"DrivingLicenseCZ\" },\n ],\n () =>\n isPersonalProfile\n ? [\n { src: Passport_CZ, type: \"Passport\" },\n { src: DrivingLicense_CZ, type: \"DrivingLicenseCZ\" },\n { src: DrivingLicense_SK, type: \"DrivingLicenseSK\" },\n ]\n : isRemote || channel === \"TLS_Remote\"\n ? [\n { src: Passport_CZ, type: \"Passport\" },\n { src: DrivingLicense_CZ, type: \"DrivingLicenseCZ\" },\n ]\n : []\n );\n\n const renderDocumentImage = (doc: DocumentObject) => {\n return (\n \n );\n };\n\n const hasPrimaryDocuments =\n props.documentIdentificationFlow === \"Primary\" ||\n props.documentIdentificationFlow === \"PrimaryAndSecondary\" ||\n props.documentIdentificationFlow === \"PrimaryAndLivenessCheck\";\n\n const hasSecondaryDocuments =\n props.documentIdentificationFlow === \"Secondary\" ||\n props.documentIdentificationFlow === \"PrimaryAndSecondary\";\n\n const renderIdentificationDocuments = (\n documentTitle: LocalizedString,\n documentsArray: DocumentObject[]\n ) => (\n \n \n \n \n {documentsArray.map(renderDocumentImage)}\n \n \n );\n\n const [documentDetails, setDocumentDetails] = useState<\n Option\n >(option.none);\n\n const showUploadStatus = foldState(uploadStatus, {\n whenReady: () => Placeholder,\n whenReadyMobile: () => (\n {\n updateBiometricConsentMobile(option.some(given));\n dispatch(\n mockScanner\n ? startUploadModeAction(\"_MockScanner\")\n : startMobileUploadFromSameDeviceAction\n );\n }}\n />\n ),\n whenChooseUploadMode: () => (\n <>\n {Placeholder}\n {externalCommunication ? (\n \n ) : (\n \n )}\n \n ),\n whenScannerUpload: ({ mocked }) => (\n {\n setErrors([]);\n dispatch(goToSummaryAction(false));\n }}\n coApplicant={props.coApplicant}\n documentIdentificationFlow={props.documentIdentificationFlow}\n uploadCommand={props.uploadCommand}\n documentDetails={documentDetails}\n />\n ),\n whenChooseMobileRecipient: status =>\n channel === \"3P_InPerson\" && !props.forceMobileRecipientSelection ? (\n \n dispatch(startMobileUploadFromSameDeviceAction)\n }\n onMockScannerUpload={option.some(() =>\n dispatch(startUploadModeAction(\"_MockScanner\"))\n )}\n mobileRecipientType=\"Banker\"\n type={status.flowType}\n coApplicant={props.coApplicant}\n />\n ) : (\n \n status.canUploadAgain && status.flowType !== \"DocumentUpload\"\n )\n )}\n onMockScannerUpload={\n channel === \"3P_InPerson\" && props.forceMobileRecipientSelection\n ? option.some(() =>\n dispatch(startUploadModeAction(\"_MockScanner\"))\n )\n : option.none\n }\n coApplicant={props.coApplicant}\n />\n ),\n whenRemoteMobileRecipient: status => (\n \n status.flowType === \"DocumentUpload\"\n ? dispatch(startMobileUploadFromSameDeviceAction)\n : dispatch(startMobileFraudCheckFromSameDeviceAction)\n }\n onMockScannerUpload={option.some(() =>\n dispatch(startUploadModeAction(\"_MockScanner\"))\n )}\n mobileRecipientType=\"Client\"\n type={status.flowType}\n coApplicant={props.coApplicant}\n />\n ),\n whenMobileUpload: status => (\n <>\n {Placeholder}\n props.onFailure(\"MaxAttemptsReached\")}\n onUploadCompleted={task.fromIO(() => {\n setErrors([]);\n dispatch(goToSummaryAction(true));\n })}\n coApplicant={props.coApplicant}\n documentToUploadDetails={documentDetails}\n />\n \n ),\n whenMobileUploadSameDevice: () => (\n \n {useNewMobile ? (\n {\n setErrors([]);\n dispatch(goToSummaryAction(false));\n })}\n coApplicant={props.coApplicant}\n uploadDocumentFlowType={props.productType}\n documentCodes={option.none}\n countryCode={option.none}\n documentType={option.none}\n />\n ) : (\n {\n setErrors([]);\n dispatch(goToSummaryAction(false));\n })}\n coApplicant={props.coApplicant}\n uploadDocumentFlowType={props.productType}\n />\n )}\n \n ),\n whenMobileFraudCheckSameDevice: status => (\n \n \n pipe(\n fraudCheckResult({\n zenIdPurpose: foldFraudCheckType(status.check, {\n SelfieFraudCheck: constant(\"FRAUD_CHECK_SELFIE\"),\n HologramFraudCheck: constant(\"FRAUD_CHECK_HOLOGRAM\"),\n HologramAndSelfieFraudCheck: constant(\n \"FRAUD_CHECK_SELFIE_AND_HOLOGRAM\"\n ),\n }),\n }),\n taskEither.fold(\n () => task.fromIO(() => addErrorIfMissing(genericError)),\n () =>\n task.fromIO(() => {\n setErrors([]);\n dispatch(goToSummaryAction(false));\n })\n )\n )()\n )}\n coApplicant={props.coApplicant}\n uploadDocumentFlowType={props.productType}\n />\n \n ),\n whenUploadSummary: status => (\n <>\n \n {status.showUploadCompletedDialog && (\n dispatch(goToSummaryAction(false)))}\n title={formatMessage(\n \"Identification.UploadDocuments.successModalTitle\"\n )}\n subtitle={formatMessage(\n \"Identification.UploadDocuments.successModalDescription\"\n )}\n icon={MobileConnectionOKIcon}\n actions={[\n {\n variant: \"primary\",\n action: () => dispatch(goToSummaryAction(false)),\n label: formatMessage(\"Next\"),\n },\n ]}\n />\n )}\n \n ),\n whenUploadAgain: status => (\n \n ),\n whenFraudCheck: status => (\n dispatch(goToSummaryAction(false))}\n onError={reason => {\n switch (reason) {\n case \"GenericError\":\n return addErrorIfMissing(genericError);\n case \"MaxAttemptsReached\":\n return props.onFailure(\"MaxAttemptsReached\");\n }\n }}\n onAbort={() => props.onFailure(\"GenericError\")}\n onUploadAgain={uploadAgain}\n onFraudCheck={flow(startFraudCheckAction, dispatch)}\n onContinue={pipe(\n task.fromIO(() => dispatch(goToSummaryAction(false))),\n task.chain(() => extractClientData)\n )}\n />\n ),\n });\n\n const alertDialog = updateConsentModal.open && (\n setUpdateConsentModal(consentDialogClosed)}\n onDismiss={() => setUpdateConsentModal(consentDialogClosed)}\n confirmLabel={formatMessage(\n \"Identification.UploadDocuments.biometricData.changeDialog.continue\"\n )}\n cancelLabel={formatMessage(\"Cancel\")}\n message={formatMessage(\n \"Identification.UploadDocuments.biometricData.changeDialog.message\"\n )}\n title={formatMessage(\n \"Identification.UploadDocuments.biometricData.changeDialog.title\"\n )}\n />\n );\n\n const biometricSection = (\n <>\n e.id === \"MissingBiometricConsentError\")}\n biometricConsent={props.biometricConsent.consent}\n onBiometricConsent={handleBiometricConsent}\n isRadioDisabled={isBiometricConsentLocked || portalBlocked}\n mustGiveConsent={tenant === \"SK\" && isRemote}\n />\n {alertDialog}\n \n \n \n );\n\n const desktopRequiredDocuments = () => (\n <>\n {hasPrimaryDocuments &&\n renderIdentificationDocuments(\n formatMessage(\n \"Identification.UploadDocuments.step1.validPrimaryDocuments\"\n ),\n primaryDocumentsImages\n )}\n {hasSecondaryDocuments &&\n renderIdentificationDocuments(\n formatMessage(\n \"Identification.UploadDocuments.step1.validSecondaryDocuments\"\n ),\n secondaryDocumentsImages\n )}\n \n );\n\n return (uploadStatus.id === \"MobileUploadSameDevice\" ||\n uploadStatus.id === \"ReadyMobile\" ||\n uploadStatus.id === \"MobileFraudCheckSameDevice\") &&\n isMobileLayout ? (\n showUploadStatus\n ) : (\n \n {biometricConsentEnabled &&\n !props.hideBiometricConsent &&\n biometricSection}\n {!props.digitalIdSwitch && (\n \n {formatMessage(\"Identification.UploadDocuments.title\")}\n \n )}\n {props.digitalIdSwitch && (\n \n )}\n {isInPerson && props.supportForeign === true && (\n {\n handleResetCountry();\n removeError({ id: \"ForeignMissingCountryError\" });\n removeError({ id: \"ForeignMissingDocTypeError\" });\n }}\n onNoCountries={() => {\n setDocumentDetails(option.none);\n dispatch(startUploadAction());\n }}\n onCountryChange={country => {\n setSaveCurrentSelection(true);\n setSelectedCountry(country);\n }}\n onDocTypeChange={docType => {\n setSaveCurrentSelection(true);\n setForeignDocumentType(docType);\n }}\n restoredData={props.restoredData}\n disabled={uploadStatus.id === \"UploadSummary\"}\n />\n )}\n {useNewMobile ? (\n \n ) : (\n desktopRequiredDocuments()\n )}\n {showUploadStatus}\n {requiresConsent && (\n \n )}\n \n \n {/* The following fragment is a temporary workaround for: https://buildo.kaiten.io/space/29286/card/2311626 */}\n <>\n {uploadStatus.id === \"UploadSummary\" &&\n uploadStatus.sharedWithClient && (\n \n )}\n \n \n {isMobileLayout ? (\n \n ) : (\n \n \n \n )}\n \n );\n}\n","import { useState } from \"react\";\nimport { option, task, taskEither, either } from \"fp-ts\";\nimport { Option } from \"fp-ts/Option\";\nimport { useFormatMessage } from \"../../intl\";\nimport { constant, constVoid, pipe } from \"fp-ts/function\";\nimport {\n DocumentType,\n DocumentPage,\n ScannedDocument,\n DocumentSlot,\n DocumentToUploadDetail,\n} from \"../domain\";\nimport {\n Body,\n Box,\n ErrorBanner,\n Space,\n AlertDialog,\n Dialog,\n LocalizedString,\n} from \"design-system\";\n\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport {\n CoApplicantInput,\n genericError,\n DocumentPurpose,\n foldDocumentIdentificationFlow,\n DocumentIdentificationFlow,\n} from \"../../globalDomain\";\nimport * as uploadDocumentsApi from \"../api\";\nimport { srcFromBase64 } from \"../utils\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport * as classes from \"./ScannerIdUpload.treat\";\nimport { ScanDocument } from \"../ScanDocument\";\nimport { UploadDocumentCommand } from \"../api\";\nimport { usePortalStatusContext } from \"../../PortalStatusContext\";\n\ntype Props = {\n _mockScanner: boolean;\n onContinue: () => unknown;\n onDismiss: () => unknown;\n documentIdentificationFlow: DocumentIdentificationFlow;\n uploadCommand: UploadDocumentCommand;\n documentDetails: Option;\n} & CoApplicantInput;\n\nexport type ScannerUploadError = uploadDocumentsApi.UploadDocumentError;\n\ntype ScanDocumentState = {\n id: \"ScanDocument\";\n error: Option;\n} & (\n | {\n documentPurpose: DocumentPurpose;\n slot: \"First\";\n documentType?: never;\n documentPage?: never;\n }\n | {\n documentPurpose: DocumentPurpose;\n slot: \"Second\";\n documentType: DocumentType;\n documentPage: DocumentPage;\n }\n);\ntype ConfirmScanState = {\n id: \"ConfirmScan\";\n documentPurpose: DocumentPurpose;\n slot: \"First\" | \"Second\";\n documentType: DocumentType;\n documentPage: DocumentPage;\n documentSrc: NonEmptyString;\n singleSidedID: boolean;\n};\ntype ScannerState = (ScanDocumentState | ConfirmScanState) & {\n isCancelling: boolean;\n};\n\ntype UploadedFileResult = {\n fileSrc: NonEmptyString;\n documentType: DocumentType;\n documentPage: DocumentPage;\n singleSidedID: boolean;\n};\n\nfunction foldScannerState(\n state: ScannerState,\n match: {\n whenScanDocument: (state: ScanDocumentState) => T;\n whenConfirmScan: (state: ConfirmScanState) => T;\n }\n) {\n switch (state.id) {\n case \"ScanDocument\":\n return match.whenScanDocument(state);\n case \"ConfirmScan\":\n return match.whenConfirmScan(state);\n }\n}\n\nexport function ScannerIdUpload(props: Props) {\n const formatMessage = useFormatMessage();\n const { portalBlocked } = usePortalStatusContext();\n\n const [scannerState, setScannerState] = useState({\n id: \"ScanDocument\",\n documentPurpose: foldDocumentIdentificationFlow(\n props.documentIdentificationFlow,\n {\n Primary: constant(\"Primary\"),\n Secondary: constant(\"Secondary\"),\n PrimaryAndSecondary: constant(\"Primary\"),\n PrimaryAndLivenessCheck: constant(\"Primary\"),\n }\n ),\n slot: \"First\",\n error: option.none,\n isCancelling: false,\n });\n\n const formatScannerError = (\n error: ScannerUploadError\n ): NonEmptyArray => {\n switch (error.id) {\n case \"GenericError\":\n return [\n formatMessage(\"Identification.UploadDocuments.scannerError.generic\"),\n ];\n case \"LowQualityError\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.lowQuality\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n case \"InvalidDocument\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.invalidDocument\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n case \"InvalidDocumentCountry\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.invalidDocumentCountry\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n case \"InvalidDocumentRemoteIdentification\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.invalidDocumentRemoteIdentification\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n case \"InvalidPage\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.invalidPage\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n case \"WrongDocumentType\":\n return [\n formatMessage(\n \"Identification.UploadDocuments.scannerError.wrongDocumentType\"\n ),\n formatMessage(\n \"Identification.UploadDocuments.scannerError.scanAgain\"\n ),\n ];\n }\n };\n\n const formatDocumentPage = (page: DocumentPage): LocalizedString => {\n switch (page) {\n case \"Front\":\n return formatMessage(\n \"Identification.UploadDocuments.documentPage.front\"\n );\n case \"Back\":\n return formatMessage(\n \"Identification.UploadDocuments.documentPage.back\"\n );\n }\n };\n\n const formatDocumentType = (type: DocumentType): LocalizedString => {\n switch (type) {\n case \"IDCard\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.idCard\"\n );\n case \"Passport\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.passport\"\n );\n case \"DrivingLicense\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.drivingLicense\"\n );\n case \"LongTermResidencePermit\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.longTermResidecePermit\"\n );\n case \"PermanentResidencePermit\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.permanentResidencePermit\"\n );\n case \"TemporaryResidencePermit\":\n return formatMessage(\n \"Identification.UploadDocuments.documentType.temporaryResidencePermit\"\n );\n }\n };\n\n const uploadDocument = (\n scannedDocument: ScannedDocument,\n documentPurpose: DocumentPurpose,\n slot: DocumentSlot\n ): TaskEither =>\n pipe(\n props.uploadCommand({\n fileContent: scannedDocument.base64,\n slot: slot,\n coApplicant: props.coApplicant,\n idType: documentPurpose,\n countryCode: pipe(\n props.documentDetails,\n option.fold(\n () => option.none,\n val => option.some(val.country.countryCode)\n )\n ),\n documentType: pipe(\n props.documentDetails,\n option.fold(\n () => option.none,\n val => val.type\n )\n ),\n }),\n taskEither.chain(uploadResponse =>\n pipe(\n srcFromBase64(scannedDocument.base64, scannedDocument.fileName),\n taskEither.fromOption(constant(genericError)),\n taskEither.map(fileSrc => ({ ...uploadResponse, fileSrc }))\n )\n )\n );\n\n const onDocumentAcquired = (\n scannedDocument: ScannedDocument\n ): TaskEither => {\n if (scannerState.id === \"ScanDocument\") {\n return pipe(\n uploadDocument(\n scannedDocument,\n scannerState.documentPurpose,\n scannerState.slot\n ),\n taskEither.chain(uploadResult =>\n taskEither.fromIO(() => onDocumentUploaded(uploadResult))\n ),\n taskEither.orElse(err =>\n pipe(\n task.fromIO(() => setUploadError(err)),\n task.map(() => either.left(err))\n )\n )\n );\n } else {\n return taskEither.fromIO(constVoid);\n }\n };\n\n const setUploadError = (error: ScannerUploadError) => {\n if (scannerState.id === \"ScanDocument\") {\n setScannerState({\n ...scannerState,\n error: option.some(error),\n });\n }\n };\n\n const onDocumentUploaded = ({\n documentType,\n documentPage,\n fileSrc,\n singleSidedID,\n }: UploadedFileResult) => {\n return setScannerState(state => ({\n id: \"ConfirmScan\",\n documentPurpose: state.documentPurpose,\n slot: scannerState.slot,\n documentType,\n documentPage,\n documentSrc: fileSrc,\n isCancelling: state.isCancelling,\n singleSidedID,\n }));\n };\n\n const scanAgain = (state: ConfirmScanState) => {\n setScannerState(\n state.slot === \"Second\"\n ? {\n id: \"ScanDocument\",\n documentPurpose: state.documentPurpose,\n slot: \"Second\",\n documentType: state.documentType,\n documentPage: state.documentPage,\n error: option.none,\n isCancelling: false,\n }\n : {\n id: \"ScanDocument\",\n documentPurpose: state.documentPurpose,\n slot: \"First\",\n error: option.none,\n isCancelling: false,\n }\n );\n };\n\n const confirmScan = (state: ConfirmScanState) => {\n const hasTwoSides = state.documentType === \"IDCard\" && !state.singleSidedID;\n if (state.slot === \"First\" && hasTwoSides) {\n setScannerState({\n id: \"ScanDocument\",\n documentPurpose: state.documentPurpose,\n slot: \"Second\",\n documentType: state.documentType,\n documentPage: state.documentPage === \"Front\" ? \"Back\" : \"Front\",\n error: option.none,\n isCancelling: false,\n });\n } else if (\n state.documentPurpose === \"Primary\" &&\n props.documentIdentificationFlow === \"PrimaryAndSecondary\"\n ) {\n setScannerState({\n id: \"ScanDocument\",\n documentPurpose: \"Secondary\",\n slot: \"First\",\n error: option.none,\n isCancelling: false,\n });\n } else {\n props.onContinue();\n }\n };\n\n type DialogActions = React.ComponentProps[\"actions\"];\n\n const dialogActions: DialogActions = foldScannerState(scannerState, {\n whenScanDocument: constant([]),\n whenConfirmScan: state =>\n !portalBlocked\n ? [\n {\n label: formatMessage(\n \"Identification.UploadDocuments.scanner.scanAgain\"\n ),\n variant: \"secondary\",\n action: () => scanAgain(state),\n dataTestId: \"scan_again_button\",\n },\n {\n label: formatMessage(\n \"Identification.UploadDocuments.scanner.proceed\"\n ),\n variant: \"primary\",\n action: () => confirmScan(state),\n dataTestId: \"proceed_button\",\n },\n ]\n : [],\n });\n\n const modalTitle = foldScannerState(scannerState, {\n whenScanDocument: state =>\n state.slot === \"First\"\n ? formatMessage(\n \"Identification.UploadDocuments.scanner.scanDocumentTitle\"\n )\n : formatMessage(\n \"Identification.UploadDocuments.scanner.scanSecondPageTitle\",\n {\n documentType: formatDocumentType(state.documentType),\n page: formatDocumentPage(state.documentPage),\n }\n ),\n whenConfirmScan: state =>\n formatMessage(\"Identification.UploadDocuments.scanner.confirmScanTitle\", {\n page: formatDocumentPage(state.documentPage),\n document: formatDocumentType(state.documentType),\n }),\n });\n\n const modalContent = foldScannerState(scannerState, {\n whenScanDocument: state => (\n <>\n \n {formatMessage(\n \"Identification.UploadDocuments.scanner.scanDocumentDescription\"\n )}\n \n \n \n setUploadError(genericError)}\n documentPurpose={option.some(state.documentPurpose)}\n documentDetails={props.documentDetails}\n />\n \n {pipe(\n state.error,\n option.map(e => (\n \n \n {formatScannerError(e)}\n \n )),\n option.toNullable\n )}\n \n ),\n whenConfirmScan: ({ documentSrc, documentType, documentPage }) => {\n return (\n <>\n \n {formatMessage(\n \"Identification.UploadDocuments.scanner.confirmScanDescription\",\n {\n document: formatDocumentType(documentType),\n page: formatDocumentPage(documentPage),\n }\n )}\n \n \n \n \n \n \n );\n },\n });\n\n return scannerState.isCancelling ? (\n \n setScannerState({\n ...scannerState,\n isCancelling: false,\n error: option.none,\n } as ScannerState)\n }\n onDismiss={() =>\n setScannerState({ ...scannerState, isCancelling: false })\n }\n />\n ) : (\n \n setScannerState({ ...scannerState, isCancelling: true })\n )}\n >\n {modalContent}\n \n );\n}\n","import \"!../../../../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js!css-loader?{\\\"modules\\\":false,\\\"url\\\":false}!./ScannerIdUpload.treat.2BPVmQJ.css\";\nexport var image = '_3POuK';","import { ChecklistIcon, Dialog, Space } from \"design-system\";\nimport { useFormatMessage } from \"../intl\";\nimport { option } from \"fp-ts\";\nimport { HelpLineSupportDocumentId } from \"../Common/HelplineSupportDocumentId/HelplineSupportDocumentId\";\nimport { useIsRemoteChannel } from \"../useChannel\";\n\ntype Props = {\n onDismiss: () => unknown;\n documentMismatch: boolean;\n};\n\nexport function UploadAgainDialog(props: Props) {\n const formatMessage = useFormatMessage();\n const isRemote = useIsRemoteChannel();\n\n return (\n \n {isRemote && (\n <>\n \n \n \n )}\n \n );\n}\n","import { Dialog, KOIcon } from \"design-system\";\nimport { option, array } from \"fp-ts\";\nimport { pipe } from \"fp-ts/function\";\nimport { Option } from \"fp-ts/Option\";\nimport { Task } from \"fp-ts/Task\";\nimport { ComponentProps } from \"react\";\nimport { useFormatMessage } from \"../intl\";\n\ntype Props = {\n onUploadAgain: Option>;\n onContinue: Task;\n};\n\nexport function RedoFraudCheckDialog(props: Props) {\n const formatMessage = useFormatMessage();\n\n type Actions = ComponentProps[\"actions\"];\n\n const uploadAgainAction = pipe(\n props.onUploadAgain,\n option.map(\n action =>\n ({\n variant: \"secondary\",\n label: formatMessage(\"Identification.UploadDocuments.uploadAgain\"),\n action,\n } as Actions[0])\n )\n );\n\n const confirmAction = option.some({\n variant: \"primary\",\n label: formatMessage(\n \"Identification.UploadDocuments.MobileUploadStatusModal.redoFraudCheckConfirm\"\n ),\n action: props.onContinue,\n } as Actions[0]);\n\n const actions = array.compact([uploadAgainAction, confirmAction]) as Actions;\n\n return (\n \n );\n}\n","import { option, taskEither } from \"fp-ts\";\nimport { constant, constFalse, pipe } from \"fp-ts/function\";\nimport { ClientDataCheck } from \"../UploadDocuments/domain\";\nimport { genericError, GenericError } from \"../globalDomain\";\nimport { ExtractClientDataCommand } from \"../IdUpload/api\";\nimport { hasValidationErrors, mergeExtractDataDocumentsOutput } from \"./utils\";\nimport { ExtractedDataResult } from \"./types\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { Option } from \"fp-ts/Option\";\nimport { useTestEnvironment } from \"../Common/useTestEnvironment\";\n\nexport type CheckClientDataResult = ExtractedDataResult & {\n canUploadAgain: boolean;\n canEdit: boolean;\n showWarning: boolean;\n fraudCheck: Option;\n};\n\ntype CheckClientDataError =\n | {\n id: \"FraudCheck\";\n data: CheckClientDataResult;\n }\n | {\n id: \"Abort\";\n }\n | {\n id: \"UploadAgain\";\n documentMismatch: boolean;\n }\n | {\n id: \"ValidationError\";\n }\n | GenericError;\n\nexport function useCheckClientDataResult(\n extractData: ExtractClientDataCommand,\n isPotentialClient?: boolean\n): TaskEither {\n const isTestEnvironment = useTestEnvironment();\n\n return pipe(\n extractData,\n taskEither.mapLeft(constant(genericError)),\n taskEither.chain(\n ({\n primary,\n secondary,\n result,\n canUploadAgain,\n documentMismatch: isDocumentMismatch,\n }) => {\n const documentMismatch = pipe(\n isDocumentMismatch,\n option.getOrElse(constFalse)\n );\n const documentsHaveValidationErrors = hasValidationErrors(\n primary,\n secondary\n );\n const documentPayload = mergeExtractDataDocumentsOutput(\n primary,\n secondary\n );\n return pipe(\n documentPayload,\n option.fold(\n () =>\n taskEither.left({\n id: \"GenericError\",\n }),\n document => {\n switch (result) {\n case \"Abort\":\n return taskEither.left({\n id: \"Abort\",\n });\n case \"UploadAgain\":\n return taskEither.left({\n id: \"UploadAgain\",\n documentMismatch,\n });\n case \"SelfieFraudCheck\":\n case \"HologramFraudCheck\":\n case \"HologramAndSelfieFraudCheck\":\n if (isPotentialClient) {\n return taskEither.left({\n id: \"UploadAgain\",\n documentMismatch,\n });\n } else {\n return taskEither.left({\n id: \"FraudCheck\",\n data: {\n ...document,\n canUploadAgain,\n canEdit: false, // what's the right value for this, in this case?\n showWarning: false, // what's the right value for this, in this case?\n fraudCheck: option.some(result),\n },\n });\n }\n case \"EditData\":\n if (isPotentialClient) {\n return taskEither.left({\n id: \"UploadAgain\",\n documentMismatch,\n });\n } else {\n return taskEither.right<\n CheckClientDataError,\n CheckClientDataResult\n >({\n ...document,\n canUploadAgain,\n canEdit: true,\n showWarning: false,\n fraudCheck: option.none,\n });\n }\n case \"Continue\":\n if (documentsHaveValidationErrors && !canUploadAgain) {\n return taskEither.left({\n id: \"ValidationError\",\n });\n }\n\n return taskEither.right<\n CheckClientDataError,\n CheckClientDataResult\n >({\n ...document,\n canUploadAgain,\n canEdit: isTestEnvironment,\n showWarning: false,\n fraudCheck: option.none,\n });\n case \"ContinueWithWarning\":\n if (documentsHaveValidationErrors && !canUploadAgain) {\n return taskEither.left({\n id: \"ValidationError\",\n });\n }\n\n if (isPotentialClient) {\n return taskEither.left({\n id: \"UploadAgain\",\n documentMismatch,\n });\n } else {\n return taskEither.right<\n CheckClientDataError,\n CheckClientDataResult\n >({\n ...document,\n canUploadAgain,\n canEdit: false,\n showWarning: true,\n fraudCheck: option.none,\n });\n }\n case \"EditDataWithWarning\":\n if (isPotentialClient) {\n return taskEither.left({\n id: \"UploadAgain\",\n documentMismatch,\n });\n } else {\n return taskEither.right<\n CheckClientDataError,\n CheckClientDataResult\n >({\n ...document,\n canUploadAgain,\n canEdit: true,\n showWarning: true,\n fraudCheck: option.none,\n });\n }\n }\n }\n )\n );\n }\n )\n );\n}\n","export default __webpack_public_path__ + \"static/media/idcard_back_cz.5f3ada22.png\";","export default __webpack_public_path__ + \"static/media/idcard_back_sk.8cae9428.png\";","import {\n Body,\n Box,\n Button,\n Card,\n CardIcon,\n ContentRow,\n Heading,\n PageHeading,\n Space,\n Stack,\n useIsMobileLayout,\n} from \"design-system\";\nimport { VirtualCards } from \"./VirtualCards\";\nimport { useFormatMessage } from \"../intl\";\nimport * as classes from \"../Common/OverdraftCard/OverdraftCardDesktop.treat\";\nimport { palette } from \"design-system/lib/styleConstants\";\nimport { Option } from \"fp-ts/Option\";\nimport { useEffect, useState } from \"react\";\nimport { BackButton } from \"../Common/BackButton/BackButton\";\nimport { IO } from \"fp-ts/IO\";\n\ntype Props = {\n onSubmit?: (physicalCardSelected: Option) => void;\n physicalCardSelected: Option;\n onChange?: (data: any) => void;\n isFromChild?: boolean;\n isCf?: boolean;\n onBack?: IO;\n showMastercard: boolean;\n};\n\nexport const VirtualCardsCommon = (props: Props) => {\n const formatMessage = useFormatMessage();\n const isMobileLayout = useIsMobileLayout();\n\n const [physicalCardSelected, setPhysicalCardSelected] = useState(\n props.physicalCardSelected\n );\n\n useEffect(() => {\n if (props.isFromChild) {\n setPhysicalCardSelected(props.physicalCardSelected);\n }\n }, [props.physicalCardSelected]);\n\n return (\n <>\n {!props.isCf && (\n \n \n \n \n \n )}\n\n \n \n \n \n \n \n \n {formatMessage(\n props.isCf\n ? \"CF.MainContent.virtualCardStep.selectCard\"\n : \"UKonto.MainContent.virtualCardStep.selectCard\"\n )}\n \n \n \n \n \n {formatMessage(\n \"UKonto.MainContent.virtualCardStep.selectCardSubtitle\"\n )}\n \n \n {\n setPhysicalCardSelected(data.physicalCardSelected);\n props.onChange && props.onChange(data);\n }}\n />\n \n \n \n \n \n\n {props.isCf && (\n \n \n \n \n \n props.onBack && props.onBack()} />\n \n \n \n props.onSubmit && props.onSubmit(physicalCardSelected)\n }\n label={formatMessage(\"Next\")}\n />\n \n \n \n \n )}\n \n );\n};\n","import { ContentRow, Space, Loader } from \"design-system\";\n// eslint-disable-next-line no-restricted-imports\nimport { useEffect, useState } from \"react\";\nimport { CustomCard } from \"./CustomCard\";\n// eslint-disable-next-line no-restricted-imports\nimport { Banner } from \"design-system/lib/vanilla\";\nimport { useFormatMessage } from \"../intl\";\nimport { useCommand } from \"../useAPI\";\nimport * as ukontoApi from \"../UKontoSecondPart/api\";\nimport * as cfApi from \"../StandardLoan/api\";\nimport { pipe } from \"fp-ts/function\";\nimport { option, taskEither } from \"fp-ts\";\nimport { useAppContext } from \"../useAppContext\";\nimport { Option } from \"fp-ts/Option\";\n\nconst foldPackageType: (match: {\n whenBasic: () => T;\n whenMiddle: () => T;\n whenUpper: () => T;\n}) => (type: string) => T = match => type => {\n switch (type) {\n case \"BASIC\":\n return match.whenBasic();\n case \"MIDDLE\":\n return match.whenMiddle();\n case \"UPPER\":\n return match.whenUpper();\n default:\n return match.whenBasic();\n }\n};\n\ntype Props = {\n isFromChild?: boolean;\n physicalCardSelected: Option;\n onChange: (data: any) => void;\n isCf?: boolean;\n showMastercard: boolean;\n};\n\nexport const VirtualCards = (props: Props) => {\n const formatMessage = useFormatMessage();\n const initVirtualCard = useCommand(\n props.isCf ? cfApi.initVirtualCard : ukontoApi.getPackageType\n );\n\n const [loading, setLoading] = useState(true);\n const [packageType, setPackageType] = useState(\"\");\n const [physicalCardSelected, setPhysicalCardSelected] = useState(\n option.some(false)\n );\n\n const {\n config: {\n virtualCardTopImgURL,\n virtualCardMcTopImgURL,\n virtualCardMcMiddleImgURL,\n virtualCardOpenImgURL,\n virtualCardMcOpenImgURL,\n physicalCardTopImgURL,\n physicalCardMcTopImgURL,\n // physicalCardMiddleImgURL,\n physicalCardMcMiddleImgURL,\n physicalCardOpenImgURL,\n physicalCardMcOpenImgURL,\n },\n } = useAppContext();\n\n const showMastercard = props.showMastercard;\n\n useEffect(() => {\n pipe(\n initVirtualCard(),\n taskEither.chain(\n (response: {\n packageType: string;\n physicalCardSelected: Option;\n }) =>\n taskEither.fromIO(() => {\n setLoading(false);\n\n response &&\n response?.packageType &&\n setPackageType(response?.packageType);\n\n response &&\n response?.physicalCardSelected &&\n setPhysicalCardSelected(response?.physicalCardSelected);\n })\n )\n )();\n }, []);\n\n const bannerInfo = (\n \n }\n />\n );\n\n if (loading) {\n return ;\n }\n\n return (\n <>\n \n {}}\n checkBoxName=\"virtualCard\"\n checkBoxDisabled={true}\n cardTitle={formatMessage(\n \"UKonto.MainContent.virtualCardCheckboxTitle\"\n )}\n cardDescription={formatMessage(\n \"UKonto.MainContent.virtualCardBoxContent\"\n )}\n showModalLabel={formatMessage(\"MoreInfo\")}\n physicalCard={false}\n imageCardHorizontal={showMastercard}\n raiseCard={false}\n imgUrl={pipe(\n packageType,\n foldPackageType({\n whenBasic: () =>\n showMastercard\n ? virtualCardMcOpenImgURL\n : virtualCardOpenImgURL,\n whenMiddle: () =>\n showMastercard\n ? virtualCardMcMiddleImgURL\n : virtualCardOpenImgURL,\n whenUpper: () =>\n showMastercard ? virtualCardMcTopImgURL : virtualCardTopImgURL,\n })\n )}\n dialogTitle={formatMessage(\n \"UKonto.MainContent.VirtualCardPopupTitle\"\n )}\n dialogContent={\n <>\n \n {bannerInfo}\n \n }\n tooltipInfoTitle={formatMessage(\n \"UKonto.MainContent.VirtualCardTooltipDescriptionTitle\"\n )}\n tooltipInfoContent={formatMessage(\n \"UKonto.MainContent.VirtualCardTooltipDescription\"\n )}\n />\n \n \n \n {\n setPhysicalCardSelected(data.physicalCardSelected);\n props.onChange(data);\n }}\n checkBoxName=\"physicalCard\"\n checkBoxDisabled={props.isFromChild}\n cardTitle={formatMessage(\n \"UKonto.MainContent.physicalCardCheckboxTitle\"\n )}\n cardDescription={formatMessage(\n \"UKonto.MainContent.physicalCardBoxContent\"\n )}\n showModalLabel={formatMessage(\"MoreInfo\")}\n physicalCard={true}\n imageCardHorizontal={showMastercard}\n raiseCard={showMastercard}\n imgUrl={pipe(\n packageType,\n foldPackageType({\n whenBasic: () =>\n showMastercard\n ? physicalCardMcOpenImgURL\n : physicalCardOpenImgURL,\n whenMiddle: () =>\n showMastercard\n ? physicalCardMcMiddleImgURL\n : physicalCardOpenImgURL,\n whenUpper: () =>\n showMastercard\n ? physicalCardMcTopImgURL\n : physicalCardTopImgURL,\n })\n )}\n dialogTitle={formatMessage(\n \"UKonto.MainContent.PhysicalCardPopupTitle\"\n )}\n dialogContent={\n <>\n \n {bannerInfo}\n \n }\n />\n \n \n );\n};\n","import { AlertDialog, unsafeLocalizedString, WarningIcon } from \"design-system\";\n\ntype Props = {\n onCancel: () => unknown;\n onDismiss: () => unknown;\n};\n\nexport function NewVersionAlert(props: Props) {\n return (\n window.location.reload()}\n onCancel={props.onCancel}\n icon={WarningIcon}\n />\n );\n}\n","import { useCallback, useEffect, useState } from \"react\";\nimport { pipe } from \"fp-ts/function\";\nimport { taskEither } from \"fp-ts\";\nimport { getCurrentBuildVersion } from \"./Utils\";\nimport { useAppContext } from \"../useAppContext\";\nimport { useIsInPersonChannel } from \"../useChannel\";\nimport { useTestEnvironment } from \"../Common/useTestEnvironment\";\n\nexport function useVersionCheck() {\n const { buildVersion: runningVersion } = useAppContext();\n\n const inPersonChannel = useIsInPersonChannel();\n\n const [showAlert, setShowAlert] = useState(false);\n const [dismissed, setDismissed] = useState(false);\n\n const [state, updateState] = useState();\n const forceUpdate = useCallback(() => updateState({}), []);\n\n const onBuildVersionReceived = (currentAvailableVersion: string) => {\n const areVersionsDifferent =\n currentAvailableVersion.length > 0 &&\n runningVersion !== currentAvailableVersion;\n\n if (areVersionsDifferent) {\n setShowAlert(true);\n console.log(\n \"VersionChecker different UI version detected, using: \" +\n runningVersion.trim() +\n \" new: \" +\n currentAvailableVersion.trim()\n );\n }\n };\n\n useEffect(() => {\n pipe(\n taskEither.tryCatch(getCurrentBuildVersion, () => {\n console.log(\"Rejected retrieving build version\");\n return \"\";\n }),\n taskEither.bimap(() => onBuildVersionReceived(\"\"), onBuildVersionReceived)\n )();\n }, [state]);\n\n const isTestEnvironment = useTestEnvironment();\n\n const shouldShowNewVersionAlert =\n isTestEnvironment && inPersonChannel && showAlert && !dismissed;\n const onCancelAlert = () => {\n setShowAlert(false);\n setDismissed(true);\n };\n const reset = () => {\n setShowAlert(false);\n forceUpdate();\n };\n\n return { shouldShowNewVersionAlert, onCancelAlert, reset };\n}\n","import { useEffect, useState } from \"react\";\nimport {\n constant,\n constNull,\n constUndefined,\n constVoid,\n pipe,\n} from \"fp-ts/function\";\nimport { useCommand, useQuery } from \"../useAPI\";\nimport * as uploadDocumentsApi from \"./api\";\nimport * as remoteData from \"../RemoteData\";\nimport { option, boolean, either } from \"fp-ts\";\nimport {\n Body,\n Box,\n Button,\n Loader,\n Stack,\n useIsTouchScreen,\n} from \"design-system\";\nimport { useFormatMessage } from \"../intl\";\nimport { srcFromBase64 } from \"./utils\";\nimport { Option } from \"fp-ts/Option\";\nimport {\n DocumentPreviewDialog,\n DocumentPreview,\n} from \"./DocumentPreviewDialog\";\nimport * as classes from \"./UploadSummary.treat\";\nimport {\n CoApplicantInput,\n CompressedFileContent,\n DocumentIdentificationFlow,\n isSingleDocumentPurpose,\n} from \"../globalDomain\";\nimport { DocumentReviewDialogChild } from \"../Common/Dialogs/DocumentReviewDialog/DocumentReviewDialogChild\";\nimport * as idUploadApi from \"../IdUpload/api\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { Country } from \"./domain\";\nimport { ForeignDocumentType } from \"../UKontoSecondPart/api\";\nimport * as uKontoAPI from \"../UKontoSecondPart/api\";\n\ntype Props = {\n documentIdentificationFlow: DocumentIdentificationFlow;\n onRemove: Option<() => unknown>;\n country?: Option;\n foreignDocumentType?: Option;\n saveCurrentSelection?: boolean;\n} & CoApplicantInput;\n\ntype RetrievedDocumentProps = {\n documents: Array;\n onOpenPreview: (value: DocumentPreview) => unknown;\n};\nfunction RetrievedDocument(props: RetrievedDocumentProps) {\n return (\n \n \n {props.documents.map(\n ({ fileName, fileContent, documentType, documentPurpose }, index) => (\n \n \n props.onOpenPreview({\n fileName,\n fileContent,\n })\n }\n />\n \n )\n )}\n \n \n );\n}\n\ntype RetrievedDocumentsProps = Props & {\n primary: Array;\n secondary: Array;\n};\nfunction RetrievedDocuments(props: RetrievedDocumentsProps) {\n const formatMessage = useFormatMessage();\n const isBranchExperienceTouchScreen = useIsTouchScreen();\n\n const [previewOpened, setPreviewOpened] = useState>(\n option.none\n );\n\n const selfieLivenessCheck =\n props.documentIdentificationFlow === \"PrimaryAndLivenessCheck\";\n\n const saveCountryDocSelection = useCommand(uKontoAPI.saveCountryDocSelection);\n\n useEffect(() => {\n if (\n props.country &&\n props.foreignDocumentType &&\n props.saveCurrentSelection\n ) {\n saveCountryDocSelection({\n country: props.country,\n foreignDocumentType: props.foreignDocumentType,\n })();\n }\n }, [props.country, props.foreignDocumentType]);\n\n return (\n \n \n {pipe(\n props.onRemove,\n option.fold(constNull, onRemove => (\n \n \n \n ))\n )}\n {pipe(\n !!props.primary.length,\n boolean.fold(constUndefined, () => (\n \n \n {formatMessage(\n \"ClientProfile.clientData.IDDocument.primaryDocumentTitle\"\n )}\n \n setPreviewOpened(option.some(image))}\n />\n \n ))\n )}\n {pipe(\n !!props.secondary.length,\n boolean.fold(constUndefined, () => (\n \n \n {formatMessage(\n \"ClientProfile.clientData.IDDocument.secondaryDocumentTitle\"\n )}\n \n setPreviewOpened(option.some(image))}\n />\n \n ))\n )}\n {selfieLivenessCheck && (\n setPreviewOpened(option.some(image))}\n />\n )}\n \n {pipe(\n previewOpened,\n option.map(previewSlot => (\n <>\n setPreviewOpened(option.none)}\n />\n {isBranchExperienceTouchScreen && }\n \n )),\n option.toUndefined\n )}\n \n );\n}\n\nfunction SelfieBlock({\n onOpenPreview,\n}: {\n onOpenPreview: (value: DocumentPreview) => unknown;\n}) {\n const [fraudCheckSelfie] = useQuery(idUploadApi.fraudCheckSelfie);\n const formatMessage = useFormatMessage();\n return pipe(\n fraudCheckSelfie,\n remoteData.fold(\n () => ,\n constNull,\n ({ fileContent }) =>\n pipe(\n fileContent,\n option.fold(constNull, fileContent => (\n \n \n {formatMessage(\"Identification.selfieCheck\")}\n \n \n \n ))\n )\n )\n );\n}\n\nfunction RetrievedSelfie(props: {\n onOpenPreview: (value: DocumentPreview) => unknown;\n fileContent: CompressedFileContent;\n}) {\n return (\n \n \n \n pipe(\n NonEmptyString.decode(\"selfie\"),\n either.fold(constVoid, fileName =>\n props.onOpenPreview({\n fileName: fileName,\n fileContent: props.fileContent,\n })\n )\n )\n }\n />\n \n \n );\n}\n\nexport function UploadSummary(props: Props) {\n const [retrieveDocuments] = useQuery(\n uploadDocumentsApi.retrieveUploadedDocument,\n {\n idType: pipe(\n props.documentIdentificationFlow,\n option.fromPredicate(isSingleDocumentPurpose)\n ),\n slot: option.none,\n coApplicant: props.coApplicant,\n }\n );\n\n return pipe(\n retrieveDocuments,\n remoteData.fold(\n () => ,\n constNull,\n ({ primary, secondary }) => (\n \n )\n )\n );\n}\n","import {\n FormatNumberOptions,\n FormattedMessage as FormattedMessage_,\n IntlProvider as IntlProvider_,\n useIntl,\n} from \"react-intl\";\nimport { PrimitiveType } from \"intl-messageformat\";\nimport type enMessages from \"./messages/en.json\";\nimport * as t from \"io-ts\";\nimport { array, either, nonEmptyArray, option, taskEither } from \"fp-ts\";\nimport { TaskEither } from \"fp-ts/TaskEither\";\nimport { NonEmptyArray } from \"fp-ts/NonEmptyArray\";\nimport {\n bold,\n Children,\n Day,\n linebreak,\n LocalizedString,\n NonNegativeInteger,\n Percentage,\n TextChildren,\n unsafeLocalizedString,\n} from \"design-system\";\nimport {\n Channel,\n Currency,\n foldTenant,\n MaritalStatus,\n MoneyAmount,\n Month,\n MonthYear,\n Price,\n PriceFrequency,\n Sex,\n SupportedLocales,\n Tenant,\n unsafeNonNegativeInteger,\n} from \"./globalDomain\";\nimport { constant, flow, identity, pipe } from \"fp-ts/function\";\nimport {\n AllCountries,\n AllCitizenships,\n CitizenshipOrOther,\n} from \"./IdUpload/domain\";\nimport { DocumentType } from \"./UploadDocuments/domain\";\nimport {\n CarOwnershipType,\n IncomeSourceExtended,\n OtherDocumentType,\n} from \"./ClientProfile/domain\";\nimport { Education, HousingType } from \"./MortgageDashboard/domain\";\nimport { CPIFeature, InsuranceType } from \"./MortgageDashboard/Offer/domain\";\nimport { useAppContext } from \"./useAppContext\";\nimport { Option } from \"fp-ts/Option\";\nimport { parsePhoneNumber } from \"libphonenumber-js\";\nimport {\n Children as ReactChildren,\n HTMLAttributes,\n isValidElement,\n ReactNode,\n} from \"react\";\nimport { NonResidentsAdditionalDocumentsType } from \"./UKontoSecondPart/domain\";\n\nexport const translationsActive = !window.location\n .toString()\n .includes(\"translations=false\");\n\nexport type LocaleMessages = typeof enMessages;\n\n// Represents LocaleKeys coming from BFF. Messages are inside the file \"runtime.en.json\"\nexport interface RuntimeLocaleKeyBrand {\n readonly RuntimeLocaleKey: unique symbol;\n}\n\nexport const RuntimeLocaleKey = t.brand(\n t.string,\n (_): _ is t.Branded => true,\n \"RuntimeLocaleKey\"\n);\n\nexport type RuntimeLocaleKey = t.TypeOf;\nexport type LocaleKey = keyof LocaleMessages | RuntimeLocaleKey;\n\nexport function useFormatMessage(): (\n id: LocaleKey,\n values?: Record\n) => LocalizedString {\n const intl = useIntl();\n\n return (id, values) => {\n if (!translationsActive && values) {\n return unsafeLocalizedString(`${id}-${Object.values(values).join(\"-\")}`);\n }\n return unsafeLocalizedString(intl.formatMessage({ id }, values));\n };\n}\n\nexport function useFormatRichMessage2(): (\n id: LocaleKey,\n values?: Record,\n options?: { useWhitespacePreWrap?: boolean }\n) => any {\n const intl = useIntl();\n const translationsActive = !window.location\n .toString()\n .includes(\"translations=false\");\n\n return (id, values, options) => {\n if (!translationsActive && values) {\n return `${id}-${Object.values(values).join(\"-\")}`;\n }\n\n const fillPlaceholders = (\n translation: string,\n values: Record\n ) => {\n const keys = Object.keys(values);\n keys.forEach(keyItem => {\n let value = values[keyItem];\n translation = translation.replace(\n new RegExp(`{${keyItem}}`, \"g\"),\n `${value}`\n );\n });\n\n return translation;\n };\n\n const message = values\n ? fillPlaceholders(intl.formatMessage({ id }), values)\n : intl.formatMessage({ id });\n\n return (\n \n );\n };\n}\n\nexport function useFormatRichMessage(): (\n id: LocaleKey,\n values?: Record\n) => TextChildren {\n const intl = useIntl();\n\n return (id, values) => {\n if (!translationsActive && values) {\n return unsafeLocalizedString(`${id}-${Object.values(values).join(\"-\")}`);\n }\n const message = intl.formatMessage(\n { id },\n { ...values, br:
, b: (...chunks) => {chunks} }\n );\n return pipe(\n ReactChildren.toArray(message) as NonEmptyArray,\n nonEmptyArray.map(c => {\n if (typeof c === \"string\") {\n return unsafeLocalizedString(c);\n }\n if (isValidElement(c) && c.type === \"br\") {\n return linebreak;\n }\n if (\n isValidElement>(c) &&\n c.type === \"b\" &&\n Array.isArray(c.props.children) &&\n Array.isArray(c.props.children[0]) &&\n typeof c.props.children[0][0] === \"string\"\n ) {\n return bold(unsafeLocalizedString(c.props.children[0][0]));\n }\n console.log(c);\n throw new Error(`Not a valid TextChildren element`);\n })\n );\n };\n}\n\nexport function useFormatPriceFrequency(): (\n frequency: PriceFrequency\n) => LocalizedString {\n const formatMessage = useFormatMessage();\n\n return frequency => {\n switch (frequency) {\n case \"OneTime\":\n return formatMessage(\"PriceFrequency.oneTime\");\n case \"PerMonth\":\n return formatMessage(\"PriceFrequency.perMonth\");\n }\n };\n}\n\ntype LocalizedMoneyAmountParts = {\n amount: LocalizedString;\n currency: LocalizedString;\n};\n\nexport function useFormatMoneyAmountParts(\n fractionDigits?: NonNegativeInteger\n): (moneyAmount: MoneyAmount) => LocalizedMoneyAmountParts {\n const intl = useIntl();\n const formatCurrency = useFormatCurrency();\n return moneyAmount => {\n const amount = intl\n .formatNumberToParts(moneyAmount.amount, {\n style: \"currency\",\n currency: moneyAmount.currency,\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n })\n .filter(el => el.type !== \"currency\")\n .map(el => el.value)\n .join(\"\")\n .trim();\n\n return {\n amount: unsafeLocalizedString(amount),\n currency: formatCurrency(moneyAmount.currency),\n };\n };\n}\n\nexport function useFormatMoneyAmountValue(\n fractionDigits?: NonNegativeInteger\n): (moneyAmount: MoneyAmount) => LocalizedString {\n const {\n apiParameters: { tenant },\n } = useAppContext();\n\n const formatMoneyAmountParts = useFormatMoneyAmountParts(\n foldTenant(tenant, constant(fractionDigits), () =>\n unsafeNonNegativeInteger(0)\n )\n );\n const formatMessage = useFormatMessage();\n\n return moneyAmount =>\n formatMessage(\"MoneyAmount\", formatMoneyAmountParts(moneyAmount));\n}\n\nexport function useFormatPhoneNumber(): (input: string) => string {\n return input => {\n const phoneNumber = option.fromNullable(parsePhoneNumber(input));\n\n return pipe(\n phoneNumber,\n option.map(phone => {\n if (!phone.isValid()) {\n return input;\n }\n return phone.formatInternational();\n }),\n option.getOrElse(constant(input))\n );\n };\n}\n\nexport function useFormatMoneyAmount(\n fractionDigits?: NonNegativeInteger\n):
(\n moneyAmount: MoneyAmount,\n render: (localizedMoneyAmount: LocalizedMoneyAmountParts) => A\n) => A {\n const {\n apiParameters: { tenant },\n } = useAppContext();\n\n const formatMoneyAmountParts = useFormatMoneyAmountParts(\n foldTenant(tenant, constant(fractionDigits), () =>\n unsafeNonNegativeInteger(0)\n )\n );\n\n return (moneyAmount, render) => render(formatMoneyAmountParts(moneyAmount));\n}\n\nexport function useFormatPrice(): (\n price: Price,\n whenFree: (localizedPrice: LocalizedString) => A,\n whenNonFree: (localizedPrice: {\n amount: LocalizedString;\n currency: LocalizedString;\n frequency: LocalizedString;\n }) => A\n) => A {\n const formatMessage = useFormatMessage();\n const formatFrequency = useFormatPriceFrequency();\n const formatMoneyAmount = useFormatMoneyAmount();\n\n return (price, whenFree, whenNonFree) => {\n switch (price.type) {\n case \"free\":\n return whenFree(formatMessage(\"Price.free\"));\n case \"amount\":\n return whenNonFree({\n ...formatMoneyAmount(price.moneyAmount, identity),\n frequency: formatFrequency(price.frequency),\n });\n }\n };\n}\n\nexport function useFormatPriceValue(): (price: Price) => LocalizedString {\n const formatPrice = useFormatPrice();\n const formatMessage = useFormatMessage();\n\n return price =>\n formatPrice(price, identity, ({ amount, currency }) =>\n formatMessage(\"MoneyAmount\", { amount, currency })\n );\n}\n\nexport function useFormatPercentage(\n locale?: string\n): (percentage: Percentage) => LocalizedString {\n const formatMessage = useFormatMessage();\n return percentage =>\n formatMessage(\"Percentage\", {\n value: new Intl.NumberFormat(\n locale !== undefined ? locale : navigator.language\n ).format(percentage * 100),\n });\n}\n\n// Like formatPercentage, but can be used with any percentage-like number\n// Use it when you may have to yield \"101%\" or \"-25%\"\nexport function useFormatPercentageLike(\n locale?: string\n): (percentage: number, opts?: FormatNumberOptions) => LocalizedString {\n const formatMessage = useFormatMessage();\n return (percentage, opts) =>\n formatMessage(\"Percentage\", {\n value: new Intl.NumberFormat(\n locale !== undefined ? locale : navigator.language,\n opts\n ).format(percentage * 100),\n });\n}\n\n// Like formatPercentage, but can be used with any percentage-like number\n// Use it when you may have to yield \"101%\" or \"-25%\"\nexport function useFormatMessagePercentage(\n locale?: string\n): (percentage: number, opts?: FormatNumberOptions) => LocalizedString {\n const formatMessage = useFormatMessage();\n return (percentage, opts) =>\n formatMessage(\"Percentage\", {\n value: new Intl.NumberFormat(\n locale !== undefined ? locale : navigator.language,\n opts\n ).format(percentage),\n });\n}\n\nexport function FormattedMessage(props: {\n id: LocaleKey;\n values?: Record;\n}) {\n return ;\n}\n\nexport function IntlProvider(\n props: Omit, \"messages\"> & {\n messages: LocaleMessages;\n children: Children;\n }\n) {\n return ;\n}\n\nconst browserLocale = pipe(\n navigator.languages[0],\n option.fromNullable,\n option.map(l => l.split(\"-\")[0]),\n option.chain(flow(SupportedLocales.decode, option.fromEither))\n);\n\nexport const defaultBrowserLocale = () =>\n pipe(browserLocale, option.getOrElse(constant(\"en\")));\n\nexport const defaultLocaleFromTenant = (tenant: Tenant): SupportedLocales => {\n switch (tenant) {\n case \"CZ\":\n return \"cs\";\n case \"SK\":\n return \"sk\";\n }\n};\n\nexport function localeFromUrl(): Option {\n const match = RegExp(\"[?&]lang=([^&]*)\").exec(window.location.search);\n const lang = match && decodeURIComponent(match[1].replace(/\\+/g, \" \"));\n\n return pipe(\n QuerystringLanguage.decode(lang),\n either.fold(\n () => option.none,\n v => option.some(querystringLanguageToSupportedLocale(v))\n )\n );\n}\n\nexport function defaultLocale(tenant: Tenant): SupportedLocales {\n return pipe(\n browserLocale,\n option.filter(l => l === defaultLocaleFromTenant(tenant)),\n option.getOrElse(constant(\"en\"))\n );\n}\n\nexport const QuerystringLanguage = t.keyof(\n { EN: true, GB: true, US: true, CZ: true, CS: true, SK: true },\n \"QuerystringLanguage\"\n);\n\nexport type QuerystringLanguage = t.TypeOf;\n\nexport function querystringLanguageToSupportedLocale(\n lang: QuerystringLanguage\n): SupportedLocales {\n switch (lang) {\n case \"EN\":\n case \"GB\":\n case \"US\":\n return \"en\";\n case \"CZ\":\n case \"CS\":\n return \"cs\";\n case \"SK\":\n return \"sk\";\n }\n}\n\nfunction importMessages_(\n apiEndpoint: string,\n tenant: Tenant,\n locale: SupportedLocales,\n channel: Channel\n): Promise {\n return fetch(\n `${apiEndpoint.replace(\n /\\/+$/,\n \"\"\n )}/translations/noauth?component=eShopFE&channel=${channel}`,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/json\",\n Tenant: tenant,\n \"Accept-Language\": locale,\n },\n }\n ).then(response => response.json());\n}\n\nexport function importMessages(\n apiEndpoint: string,\n tenant: Tenant,\n locale: SupportedLocales,\n channel: Channel\n): TaskEither {\n return pipe(\n taskEither.fromIOEither(() =>\n window.location.toString().includes(\"translations=false\")\n ? either.right({} as LocaleMessages)\n : either.left(undefined)\n ),\n taskEither.orElse(() =>\n taskEither.tryCatch(\n () => importMessages_(apiEndpoint, tenant, locale, channel),\n () => `Failed to import locale \"${locale}\" for tenant \"${tenant}\"`\n )\n )\n );\n}\n\nexport function useFormatCurrency(): (\n currency: Currency,\n format?: \"long\"\n) => LocalizedString {\n const formatMessage = useFormatMessage();\n\n return (currency, format) => {\n switch (currency) {\n case \"CZK\":\n return formatMessage(\n format === \"long\" ? \"Currency.CZK.long\" : \"Currency.CZK.short\"\n );\n case \"EUR\":\n return formatMessage(\n format === \"long\" ? \"Currency.EUR.long\" : \"Currency.EUR.short\"\n );\n }\n };\n}\n\nexport function useFormatIncomeCurrency(): (\n currency: string,\n format?: \"long\"\n) => LocalizedString {\n const formatMessage = useFormatMessage();\n\n return (code, format) => {\n const currencyTranslation =\n format === \"long\" ? `Currency.${code}.long` : `Currency.${code}.short`;\n return formatMessage(currencyTranslation as LocaleKey);\n };\n}\n\nexport function useFormatMonthYearValue() {\n const formatMessage = useFormatMessage();\n // TODO: use proper localized date formatting\n return (monthYear: MonthYear) => formatMessage(\"MonthYear\", monthYear);\n}\n\nexport function useFormatYearValue() {\n return (monthYear: MonthYear) => (monthYear.year + \"\") as LocalizedString;\n}\n\nexport function useFormatMonth() {\n const { locale } = useIntl();\n return (month: Month): LocalizedString => {\n return unsafeLocalizedString(\n new Date(2020, month - 1, 2).toLocaleString(locale, { month: \"long\" })\n );\n };\n}\n\nexport const months = pipe(\n array.range(1, 12),\n array.map((n): Month => n as any)\n);\n\nexport function useFormatDay() {\n return (day: Day): LocalizedString => {\n return unsafeLocalizedString(day);\n };\n}\n\nexport const days = pipe(\n array.range(1, 31),\n array.map((n): Day => n as any)\n);\n\nexport function formatDuration(timeSeconds: number) {\n const minutes = Math.floor(timeSeconds / 60);\n const seconds = timeSeconds % 60;\n\n const formattedTime = [minutes, seconds]\n .map(component => component.toString().padStart(2, \"0\"))\n .join(\":\");\n\n return unsafeLocalizedString(formattedTime);\n}\n\nexport function useFormatSex() {\n const formatMessage = useFormatMessage();\n return (sex: Sex): LocalizedString => {\n switch (sex) {\n case \"M\":\n return formatMessage(\"Identification.personalData.sex.M\");\n case \"F\":\n return formatMessage(\"Identification.personalData.sex.F\");\n }\n };\n}\n\nexport function useFormatCitizenship() {\n const formatMessage = useFormatMessage();\n\n return (\n citizenship: AllCitizenships,\n countries?: AllCountries\n ): LocalizedString => {\n switch (citizenship) {\n case \"CZE\":\n return formatMessage(\"Identification.personalData.citizenship.CZ\");\n case \"SVK\":\n return formatMessage(\"Identification.personalData.citizenship.SK\");\n default:\n return countries !== undefined\n ? unsafeLocalizedString(\n pipe(\n countries,\n array.findFirst(c => c.countryCode === citizenship),\n option.map(c => c.label),\n option.getOrElse(constant(\"\"))\n )\n )\n : unsafeLocalizedString(citizenship);\n }\n };\n}\n\nexport function useFormatCitizenshipOrOther() {\n const formatMessage = useFormatMessage();\n const formatCitizenship = useFormatCitizenship();\n return (citizenship: CitizenshipOrOther): LocalizedString => {\n if (citizenship !== \"CZE\" && citizenship !== \"SVK\") {\n return formatMessage(\"Identification.personalData.citizenship.OTHER\");\n }\n\n return formatCitizenship(citizenship);\n };\n}\n\nexport function useFormatMaritalStatus() {\n const formatMessage = useFormatMessage();\n\n return (maritalStatus: MaritalStatus): LocalizedString => {\n switch (maritalStatus) {\n case \"Single\":\n return formatMessage(\n \"Identification.personalData.maritalStatus.Single\"\n );\n case \"Married\":\n return formatMessage(\n \"Identification.personalData.maritalStatus.Married\"\n );\n case \"Divorced\":\n return formatMessage(\n \"Identification.personalData.maritalStatus.Divorced\"\n );\n case \"Widowed\":\n return formatMessage(\n \"Identification.personalData.maritalStatus.Widowed\"\n );\n case \"RegisteredPartnership\":\n return formatMessage(\n \"Identification.personalData.maritalStatus.RegisteredPartnership\"\n );\n }\n };\n}\n\nexport function useFormatEducation() {\n const formatMessage = useFormatMessage();\n return (education: Education): LocalizedString => {\n switch (education) {\n case \"Elementary\":\n return formatMessage(\"Mortgage.AdditionalDetails.Education.elementary\");\n case \"ElementarySchool\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.elementarySchool\"\n );\n case \"Apprenticed\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.apprenticed\"\n );\n case \"ApprenticedWithLeavingExam\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.apprenticedWithLeavingExams\"\n );\n case \"SecondaryWithLeavingExam\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.secondaryWithLeavingExams\"\n );\n case \"College\":\n return formatMessage(\"Mortgage.AdditionalDetails.Education.college\");\n case \"University\":\n return formatMessage(\"Mortgage.AdditionalDetails.Education.university\");\n case \"SecondaryWithoutLeavingExam\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.secondaryWithoutLeavingExams\"\n );\n case \"UniversityAbroad\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.universityAbroad\"\n );\n case \"UniversityInSlovakRepublik\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.Education.universityInSlovakRepublik\"\n );\n }\n };\n}\n\nexport function useFormatPortalStatusDate() {\n const { locale } = useIntl();\n const dateFormat = (): Intl.DateTimeFormatOptions => {\n return {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n };\n };\n return (date: Date): LocalizedString => {\n return unsafeLocalizedString(\n date.toLocaleString(locale === \"en\" ? \"en-GB\" : locale, dateFormat())\n );\n };\n}\n\nexport function useFormatDate(output: \"mm-yyyy\" | \"dd-mm-yyyy\" | \"dd-mm-yy\") {\n const { locale } = useIntl();\n\n const dateFormat = (): Intl.DateTimeFormatOptions => {\n switch (output) {\n case \"mm-yyyy\":\n return { month: \"numeric\", year: \"numeric\", timeZone: \"GMT\" };\n case \"dd-mm-yy\":\n return {\n month: \"numeric\",\n day: \"numeric\",\n year: \"2-digit\",\n timeZone: \"GMT\",\n };\n case \"dd-mm-yyyy\":\n return {\n month: \"numeric\",\n day: \"numeric\",\n year: \"numeric\",\n timeZone: \"GMT\",\n };\n }\n };\n const dateFormatter = new Intl.DateTimeFormat(\n locale === \"en\" ? \"en-GB\" : locale,\n dateFormat()\n );\n\n return (date: Date): LocalizedString => {\n return unsafeLocalizedString(dateFormatter.format(date));\n };\n}\n\nexport function useFormatDocumentType() {\n const formatMessage = useFormatMessage();\n\n return (documentType: DocumentType): LocalizedString => {\n switch (documentType) {\n case \"IDCard\":\n return formatMessage(\"Identification.personalData.nationalId\");\n case \"Passport\":\n return formatMessage(\"Identification.personalData.passport\");\n case \"DrivingLicense\":\n return formatMessage(\"Identification.personalData.drivingLicense\");\n case \"LongTermResidencePermit\":\n return formatMessage(\n \"Identification.personalData.longTermResidencePermit\"\n );\n case \"PermanentResidencePermit\":\n return formatMessage(\n \"Identification.personalData.permanentTermResidencePermit\"\n );\n case \"TemporaryResidencePermit\":\n return formatMessage(\n \"Identification.personalData.temporaryTermResidencePermit\"\n );\n }\n };\n}\n\nexport function useFormatIncomeSource() {\n const formatMessage = useFormatMessage();\n\n return (incomeSource: IncomeSourceExtended) => {\n switch (incomeSource) {\n case \"Employed\":\n return formatMessage(\"KYC.Income.IncomeSource.Employed\");\n case \"Entrepreneur\":\n return formatMessage(\"KYC.Income.IncomeSource.Entrepreneur\");\n case \"Freelancer\":\n return formatMessage(\"KYC.Income.IncomeSource.Freelancer\");\n case \"Pensioner\":\n return formatMessage(\"KYC.Income.IncomeSource.Pensioner\");\n case \"Unemployed\":\n return formatMessage(\"KYC.Income.IncomeSource.Unemployed\");\n case \"MaternityLeave\":\n return formatMessage(\"KYC.Income.IncomeSource.MaternityLeave\");\n case \"CompanyOwner\":\n return formatMessage(\"KYC.Income.IncomeSource.CompanyOwner\");\n case \"Student\":\n return formatMessage(\"KYC.Income.IncomeSource.Student\");\n case \"HomeDuties\":\n return formatMessage(\"KYC.Income.IncomeSource.HomeDuties\");\n case \"Other\":\n return formatMessage(\"KYC.Income.IncomeSource.Other\");\n default:\n return formatMessage(\n `KYC.Transactions.sourceOfIncome.${incomeSource}` as LocaleKey\n );\n }\n };\n}\n\nexport function useFormatCarOwnership() {\n const formatMessage = useFormatMessage();\n\n return (carOwnership: CarOwnershipType): LocalizedString => {\n switch (carOwnership) {\n case \"DONT_OWN\":\n return formatMessage(\n \"ClientProfile.clientData.CarOwnershipType.DONT_OWN\"\n );\n case \"OWN\":\n return formatMessage(\"ClientProfile.clientData.CarOwnershipType.OWN\");\n case \"OWN_WITH_LEASING_OR_LOAN\":\n return formatMessage(\n \"ClientProfile.clientData.CarOwnershipType.OWN_WITH_LEASING_OR_LOAN\"\n );\n case \"COMPANY_CAR\":\n return formatMessage(\n \"ClientProfile.clientData.CarOwnershipType.COMPANY_CAR\"\n );\n }\n };\n}\n\nexport function useFormatSelectedInsurance() {\n const formatMessage = useFormatMessage();\n\n return (insuranceType: InsuranceType): LocalizedString => {\n switch (insuranceType) {\n case \"A\":\n case \"B\":\n case \"C\":\n return formatMessage(\"Mortgage.Offer.Insurance.package\", {\n package: insuranceType,\n });\n default:\n return formatMessage(\"Mortgage.Offer.Insurance.NoPackage\");\n }\n };\n}\n\nexport function useFormatCPIFeature() {\n const formatMessage = useFormatMessage();\n\n return (feature: CPIFeature): LocalizedString => {\n switch (feature) {\n case \"DEATH\":\n return formatMessage(\"CPI.DEATH\");\n case \"PERMANENT_DISABILITY\":\n return formatMessage(\"CPI.PERMANENT_DISABILITY\");\n case \"TEMPORARY_DISABILITY\":\n return formatMessage(\"CPI.TEMPORARY_DISABILITY\");\n case \"LOSS_OF_INCOME\":\n return formatMessage(\"CPI.LOSS_OF_INCOME\");\n case \"INSURANCE_OF_SERIOUS_DISEASES\":\n return formatMessage(\"CPI.INSURANCE_OF_SERIOUS_DISEASES\");\n }\n };\n}\n\nexport function useFormatHousingType() {\n const formatMessage = useFormatMessage();\n\n return (housingType: HousingType): LocalizedString => {\n switch (housingType) {\n case \"Cooperative\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.HousingType.cooperative\"\n );\n case \"Other\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.other\");\n case \"Own\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.own\");\n case \"OwnFlat\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.ownFlat\");\n case \"OwnHouse\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.ownHouse\");\n case \"Parents\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.parents\");\n case \"ProvidedByEmployer\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.HousingType.providedByEmployer\"\n );\n case \"RentFromHousingAssociation\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.HousingType.rentFromHousingAssociation\"\n );\n case \"RentFromIndividual\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.HousingType.rentFromIndividual\"\n );\n case \"RentFromState\":\n return formatMessage(\n \"Mortgage.AdditionalDetails.HousingType.rentFromState\"\n );\n case \"Rental\":\n return formatMessage(\"Mortgage.AdditionalDetails.HousingType.rental\");\n }\n };\n}\n\nexport function useFormatOtherDocumentLabel() {\n const formatMessage = useFormatMessage();\n return (label: OtherDocumentType) => {\n switch (label) {\n case \"PERMANENT_RESIDENCE_PERMIT\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.PERMANENT_RESIDENCE_PERMIT\"\n );\n case \"TEMPORARY_RESIDENCE_PERMIT\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.TEMPORARY_RESIDENCE_PERMIT\"\n );\n case \"LONG_TERM_RESIDENCE_PERMIT\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.LONG_TERM_RESIDENCE_PERMIT\"\n );\n case \"CONFIRMATION_FROM_MATRIKA\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.CONFIRMATION_FROM_MATRIKA\"\n );\n case \"BIRTH_CERTIFICATE\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.BIRTH_CERTIFICATE\"\n );\n case \"SCANNED_ID_CARD\":\n return formatMessage(\n \"ClientProfile.clientData.IDDocument.otherDocument.SCANNED_ID_CARD\"\n );\n }\n };\n}\n\nexport function useFormatNonResidentsAdditionalDocumentsLabel() {\n const formatMessage = useFormatMessage();\n return (label: NonResidentsAdditionalDocumentsType) => {\n switch (label) {\n case \"TEMPORARY_RESIDENCE_PERMIT\":\n return formatMessage(\n \"Identification.additionalDocuments.eu.nonResidents.TEMPORARY_RESIDENCE_PERMIT\"\n );\n case \"PERMISSION_TO_STUDY\":\n return formatMessage(\n \"Identification.additionalDocuments.eu.nonResidents.PERMISSION_TO_STUDY\"\n );\n case \"EMPLOYMENT_CONTRACT_WITH_CLIENT_DATA\":\n return formatMessage(\n \"Identification.additionalDocuments.eu.nonResidents.EMPLOYMENT_CONTRACT_WITH_CLIENT_DATA\"\n );\n case \"LEASE_AGREEMENT_SIGNED_ON_CLIENT_NAME\":\n return formatMessage(\n \"Identification.additionalDocuments.eu.nonResidents.LEASE_AGREEMENT_SIGNED_ON_CLIENT_NAME\"\n );\n case \"REAL_ESTATE_LAND_REGISTER_EXTRACT\":\n return formatMessage(\n \"Identification.additionalDocuments.eu.nonResidents.REAL_ESTATE_LAND_REGISTER_EXTRACT\"\n );\n case \"LONG_TERM_RESIDENCE_PERMIT\":\n return formatMessage(\n \"Identification.additionalDocuments.nonEu.nonResidents.LONG_TERM_RESIDENCE_PERMIT\"\n );\n case \"STUDENT_VISA\":\n return formatMessage(\n \"Identification.additionalDocuments.nonEu.nonResidents.STUDENT_VISA\"\n );\n case \"LONG_TERM_VISA_90_PLUS\":\n return formatMessage(\n \"Identification.additionalDocuments.nonEu.nonResidents.LONG_TERM_VISA_90_PLUS\"\n );\n case \"MARRIAGE_CERTIFICATE\":\n return formatMessage(\n \"Identification.additionalDocuments.nonResidents.MARRIAGE_CERTIFICATE\"\n );\n case \"BUSINESS_CERTIFICATE_AUTHORITY\":\n return formatMessage(\n \"Identification.additionalDocuments.nonResidents.BUSINESS_CERTIFICATE_AUTHORITY\"\n );\n }\n };\n}\n","import { option, nonEmptyArray, record } from \"fp-ts\";\nimport { constant, constFalse, pipe } from \"fp-ts/function\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { Option } from \"fp-ts/Option\";\nimport { FileContent } from \"design-system\";\nimport { ClientDataOCR } from \"../IdUpload/domain\";\nimport { ExtractedDataResult } from \"./types\";\nimport { MobileFlowType } from \"./state\";\nimport { LocaleKey } from \"../intl\";\nimport { DocumentTypeUpload } from \"./domain\";\n\nexport const srcFromBase64 = (\n base64Content: FileContent,\n fileName: NonEmptyString = \".jpeg\" as NonEmptyString\n): Option =>\n pipe(\n fileName.match(/\\w+.(\\w+)$/),\n option.fromNullable,\n option.chain(nonEmptyArray.fromArray),\n option.map(matches => {\n const imageType = nonEmptyArray.head(matches);\n return `data:image/${\n imageType === \"jpg\" ? \"jpeg\" : imageType\n };base64,${base64Content}` as NonEmptyString;\n })\n );\n\nexport const mergeExtractDataDocumentsOutput = (\n primary: Option,\n secondary: Option\n): Option => {\n const isThereAnAdditionalDocument =\n option.isSome(primary) && option.isSome(secondary);\n return pipe(\n primary,\n option.alt(constant(secondary)),\n option.map(document => ({\n documentType: document.documentType,\n additionalDocumentType: pipe(\n secondary,\n option.map(document => document.documentType),\n option.filter(constant(isThereAnAdditionalDocument))\n ),\n personalData: document.personalData,\n permanentAddress: document.permanentAddress,\n documentDetails: document.documentDetails,\n addressSuggestions: document.addressSuggestions,\n additionalDocumentDetails: pipe(\n secondary,\n option.map(document => document.documentDetails),\n option.filter(constant(isThereAnAdditionalDocument))\n ),\n validationErrors: document.validationErrors,\n }))\n );\n};\n\nexport function foldMobileFlowType(\n type: MobileFlowType,\n match: {\n [k in MobileFlowType]: () => T;\n }\n) {\n return match[type]();\n}\n\nexport function hasValidationErrors(\n primary: Option,\n secondary: Option\n): boolean {\n const documentHasErrors = (document: Option) =>\n pipe(\n document,\n option.fold(constFalse, item =>\n pipe(\n item.validationErrors,\n option.fold(constFalse, record.some(option.isSome))\n )\n )\n );\n return documentHasErrors(primary) || documentHasErrors(secondary);\n}\n\nexport function formatDocumentType(\n documentType: DocumentTypeUpload\n): LocaleKey {\n switch (documentType) {\n case \"IDCard\":\n return `Identification.UploadDocuments.step1.validDocuments.IDCard`;\n case \"Passport\":\n return `Identification.UploadDocuments.step1.validDocuments.Passport`;\n case \"DrivingLicenseCZ\":\n return `Identification.UploadDocuments.step1.validDocuments.DrivingLicenseCZ`;\n case \"DrivingLicenseSK\":\n return `Identification.UploadDocuments.step1.validDocuments.DrivingLicenseSK`;\n case \"LongTermResidencePermit\":\n return `Identification.UploadDocuments.step1.validDocuments.LongTermResidencePermit`;\n case \"PermanentResidencePermit\":\n return `Identification.UploadDocuments.step1.validDocuments.PermanentResidencePermit`;\n case \"TemporaryResidencePermit\":\n return `Identification.UploadDocuments.step1.validDocuments.TemporaryResidencePermit`;\n }\n}\n","import {\n Channel,\n CoApplicantInput,\n CompressedFileContent,\n DocumentIdentificationFlow,\n DocumentPurpose,\n eqCoApplicantInput,\n eqWithCoApplicant,\n GenericError,\n optionFromUndefined,\n UploadDocumentFlowType,\n VerifyLinkError,\n withCoApplicant,\n} from \"../globalDomain\";\nimport * as t from \"io-ts\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { eq, option } from \"fp-ts\";\nimport { Eq } from \"fp-ts/Eq\";\nimport { constFalse } from \"fp-ts/function\";\nimport {\n Country,\n DocumentPage,\n DocumentSlot,\n DocumentType,\n LinkPurpose,\n MobileRecipientNumber,\n MobileRecipientType,\n MobileStatus,\n} from \"./domain\";\nimport { ClientDataOCR } from \"../IdUpload/domain\";\nimport { apiCall } from \"../APICall\";\nimport { NonNegativeInteger } from \"design-system\";\nimport { UUID } from \"io-ts-types/lib/UUID\";\nimport {\n eqWithApplicantIndex,\n withApplicantIndex,\n} from \"../MortgageDashboard/domain\";\nimport { ReaderTaskEither } from \"fp-ts/ReaderTaskEither\";\nimport { withFallback } from \"io-ts-types/lib/withFallback\";\nimport { optionFromNullable } from \"io-ts-types/lib/optionFromNullable\";\n\nconst BiometricConsentInput = withApplicantIndex(\n t.type(\n {\n consent: t.boolean,\n },\n \"BiometricConsentInput\"\n )\n);\n\nexport interface BiometricConsentInput\n extends t.TypeOf {}\n\nconst eqBiometricConsentInput: Eq = eqWithApplicantIndex(\n eq.getStructEq({\n consent: eq.eqBoolean,\n })\n);\n\nexport const sendBiometricConsent = apiCall({\n inputCodec: BiometricConsentInput,\n inputEq: eqBiometricConsentInput,\n outputCodec: t.unknown,\n path: [\"clients\", \"identification\", \"biometricConsent\"],\n});\n\nexport const UploadDocumentInput = withCoApplicant(\n t.type({\n fileContent: CompressedFileContent,\n slot: DocumentSlot,\n idType: DocumentPurpose,\n countryCode: optionFromUndefined(NonEmptyString),\n documentType: optionFromUndefined(DocumentType),\n })\n);\nexport type UploadDocumentInput = t.TypeOf;\n\nexport const eqUploadDocumentInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n fileContent: eq.eqString,\n slot: eq.eqStrict,\n idType: eq.eqString,\n })\n);\n\nexport const UploadDocumentOutput = t.type({\n documentType: DocumentType,\n documentPage: DocumentPage,\n singleSidedID: t.boolean,\n});\n\nexport type UploadDocumentOutput = t.TypeOf;\n\nexport const UploadDocumentError = t.union([\n GenericError,\n t.type({ id: t.literal(\"LowQualityError\") }),\n t.type({ id: t.literal(\"InvalidDocumentCountry\") }),\n t.type({ id: t.literal(\"InvalidDocument\") }),\n t.type({ id: t.literal(\"InvalidDocumentRemoteIdentification\") }),\n t.type({ id: t.literal(\"InvalidPage\") }),\n t.type({ id: t.literal(\"WrongDocumentType\") }),\n]);\n\nexport type UploadDocumentError = t.TypeOf;\n\nexport type UploadDocumentCommand = ReaderTaskEither<\n UploadDocumentInput,\n UploadDocumentError | GenericError,\n UploadDocumentOutput\n>;\n\nexport const uploadDocument = apiCall({\n inputEq: eqUploadDocumentInput,\n path: [\"clients\", \"identification\", \"upload\"],\n inputCodec: UploadDocumentInput,\n outputCodec: UploadDocumentOutput,\n errorCodec: UploadDocumentError,\n});\n\nconst MobileUploadDocumentInput = withCoApplicant(\n t.type({\n documentCode: NonNegativeInteger,\n pageCode: NonNegativeInteger,\n fileContent: CompressedFileContent,\n slot: DocumentSlot,\n idType: DocumentPurpose,\n async: t.boolean,\n countryCode: optionFromUndefined(NonEmptyString),\n })\n);\n\ntype MobileUploadDocumentInput = t.TypeOf;\n\nconst eqMobileUploadDocumentInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n documentCode: eq.eqNumber,\n pageCode: eq.eqNumber,\n fileContent: eq.eqString,\n slot: eq.eqStrict,\n idType: eq.eqString,\n })\n);\n\nexport const mobileUploadDocument = apiCall({\n inputEq: eqMobileUploadDocumentInput,\n path: [\"clients\", \"identification\", \"mobileUpload\"],\n inputCodec: MobileUploadDocumentInput,\n outputCodec: UploadDocumentOutput,\n});\n\nexport const mobileUploadDocument2 = apiCall({\n inputEq: eqMobileUploadDocumentInput,\n path: [\"clients\", \"identification\", \"mobileUpload\"],\n inputCodec: MobileUploadDocumentInput,\n outputCodec: t.unknown,\n});\n\nexport const DocumentRetrieveContentInput = withCoApplicant(\n t.type(\n {\n idType: optionFromUndefined(DocumentPurpose),\n slot: optionFromUndefined(DocumentSlot),\n },\n \"DocumentRetrieveContentInput\"\n )\n);\n\ninterface DocumentRetrieveContentInput\n extends t.TypeOf {}\n\nexport const eqDocumentRetrieveContentInput = eqWithCoApplicant(\n eq.getStructEq({\n slot: option.getEq(eq.eqString),\n idType: option.getEq(eq.eqString),\n })\n);\n\nconst RetrievedDocument = t.type({\n fileName: NonEmptyString,\n compressed: t.boolean,\n documentPurpose: DocumentPurpose,\n documentType: DocumentType,\n subType: DocumentPage,\n fileContent: CompressedFileContent,\n});\n\nexport type RetrievedDocument = t.TypeOf;\n\nconst DocumentRetrieveContentOutput = t.type(\n {\n primary: t.array(RetrievedDocument),\n secondary: t.array(RetrievedDocument),\n },\n \"DocumentContentOutput\"\n);\n\ninterface DocumentRetrieveContentOutput\n extends t.TypeOf {}\n\nexport const retrieveUploadedDocument = apiCall({\n inputEq: eqDocumentRetrieveContentInput,\n path: [\"clients\", \"identification\", \"retrieveUploadedDocument\"],\n inputCodec: DocumentRetrieveContentInput,\n outputCodec: DocumentRetrieveContentOutput,\n});\n\n// UploadId - mobile flow\nconst MobileRecipientsInput = withCoApplicant(\n t.type({\n linkPurpose: LinkPurpose,\n })\n);\nexport type MobileRecipientsInput = t.TypeOf;\nconst eqMobileRecipientsInput: Eq = eqCoApplicantInput;\nconst MobileRecipientsOutput = t.record(\n MobileRecipientType,\n MobileRecipientNumber\n);\nexport type MobileRecipientsOutput = t.TypeOf;\nexport const mobileRecipients = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"recipients\"],\n inputCodec: MobileRecipientsInput,\n inputEq: eqMobileRecipientsInput,\n outputCodec: MobileRecipientsOutput,\n});\n\nconst SendMobileLinkInput = withCoApplicant(\n t.type({\n recipient: MobileRecipientType,\n linkPurpose: LinkPurpose,\n idType: DocumentIdentificationFlow,\n parameters: t.type({\n countryCode: optionFromUndefined(NonEmptyString),\n documentType: optionFromUndefined(DocumentType),\n }),\n })\n);\nconst SendMobileLinkInputPOI = withCoApplicant(\n t.type({\n recipient: MobileRecipientType,\n linkPurpose: LinkPurpose,\n idType: DocumentIdentificationFlow,\n parameters: t.type({\n docTypeId: optionFromNullable(NonEmptyString),\n applicationElementID: optionFromNullable(NonEmptyString),\n }),\n })\n);\n\nconst eqSendMobileLinkInput: Eq = eq.fromEquals(constFalse);\nconst SendMobileLinkOutput = t.type({ attemptsLeft: NonNegativeInteger });\nconst SendMobileLinkError = t.union([\n t.type({ id: t.literal(\"InvalidFlowId\") }),\n t.type({ id: t.literal(\"MaxLinksAttemptsReached\") }),\n]);\nexport type SendMobileLinkError = t.TypeOf;\nexport const sendMobileLink = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"link\"],\n inputCodec: SendMobileLinkInput,\n inputEq: eqSendMobileLinkInput,\n outputCodec: SendMobileLinkOutput,\n errorCodec: SendMobileLinkError,\n});\nexport const sendMobileLinkPOI = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"link\"],\n inputCodec: SendMobileLinkInputPOI,\n inputEq: eqSendMobileLinkInput,\n outputCodec: SendMobileLinkOutput,\n errorCodec: SendMobileLinkError,\n});\n\nconst MobileStatusInput = CoApplicantInput;\ntype MobileStatusInput = t.TypeOf;\nconst eqMobileStatusInput: Eq = eq.fromEquals(constFalse);\nconst MobileStatusOutput = t.type({ status: MobileStatus });\nexport type MobileStatusOutput = t.TypeOf;\nexport const mobileStatus = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"status\"],\n inputCodec: MobileStatusInput,\n inputEq: eqMobileStatusInput,\n outputCodec: MobileStatusOutput,\n});\n\nconst CancelProcessInput = t.void;\ntype CancelProcessInput = t.TypeOf;\nconst eqCancelProcessInput: Eq = eq.fromEquals(constFalse);\nexport const cancelProcess = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"cancel\"],\n inputCodec: CancelProcessInput,\n inputEq: eqCancelProcessInput,\n});\n\nexport const VerifyLinkInput = t.type({\n id: UUID,\n});\nexport type VerifyLinkInput = t.TypeOf;\n\nexport const eqVerifyLinkInput = eq.getStructEq({\n id: eq.eqStrict,\n});\n\nexport const verifyLink = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"link\", \"verify\"],\n inputCodec: VerifyLinkInput,\n inputEq: eqVerifyLinkInput,\n errorCodec: VerifyLinkError,\n});\n\nconst StartProcessInput = t.type({\n token: NonEmptyString,\n});\ntype StartProcessInput = t.TypeOf;\nconst eqStartProcessInput: Eq = eq.fromEquals(constFalse);\nconst StartProcessError = t.union([\n t.type({ id: t.literal(\"InvalidFlowId\") }),\n t.type({ id: t.literal(\"InvalidToken\") }),\n]);\nexport type StartProcessError = t.TypeOf;\nconst StartProcessOutput = t.type({\n token: NonEmptyString,\n});\nexport const startProcess = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"start\"],\n inputCodec: StartProcessInput,\n inputEq: eqStartProcessInput,\n errorCodec: StartProcessError,\n outputCodec: StartProcessOutput,\n});\n\nexport const startProofOfIncomeProcess = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"documents\", \"start\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: t.unknown,\n});\n\nexport type MobileUploadStatusError = t.TypeOf<\n typeof MobileFlowStatusError\n>[\"id\"];\n\nconst MobileFlowStatusInput = t.void;\nexport const MobileFlowStatusError = t.union([\n GenericError,\n t.type({ id: t.literal(\"InvalidDocument\") }),\n t.type({ id: t.literal(\"InvalidDocumentCountry\") }),\n t.type({ id: t.literal(\"InvalidPage\") }),\n]);\nexport const mobileFlowStatus = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"mobileStatus\"],\n inputEq: eq.fromEquals(constFalse),\n inputCodec: MobileFlowStatusInput,\n outputCodec: MobileStatusOutput,\n errorCodec: MobileFlowStatusError,\n});\n\nexport const MobileClientDataOutput = t.type({\n primary: optionFromUndefined(ClientDataOCR),\n secondary: optionFromUndefined(ClientDataOCR),\n});\nexport type MobileClientDataOutput = t.TypeOf;\nconst MobileClientDataInput = withCoApplicant(\n t.type({\n idType: DocumentIdentificationFlow,\n })\n);\nexport type MobileClientDataInput = t.TypeOf;\nconst eqMobileClientDataInput = eqWithCoApplicant(\n eq.getStructEq({\n idType: eq.eqString,\n })\n);\nexport const mobileClientData = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"extractData\"],\n inputCodec: MobileClientDataInput,\n inputEq: eqMobileClientDataInput,\n outputCodec: MobileClientDataOutput,\n});\nconst ConfirmDataInput = withCoApplicant(\n t.type({\n idType: DocumentIdentificationFlow,\n })\n);\nexport type ConfirmDataInput = t.TypeOf;\nconst eqConfirmDataInput = eqWithCoApplicant(\n eq.getStructEq({\n idType: eq.eqString,\n })\n);\nexport const mobileConfirmData = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"extractData\", \"confirm\"],\n inputCodec: ConfirmDataInput,\n inputEq: eqConfirmDataInput,\n});\n\nconst MobileRejectDataInput = withCoApplicant(\n t.type({\n idType: DocumentIdentificationFlow,\n })\n);\nexport type MobileRejectDataInput = t.TypeOf;\nconst eqMobileRejectDataInput = eqWithCoApplicant(\n eq.getStructEq({\n idType: eq.eqString,\n })\n);\nconst MobileRejectDataOutput = t.type({\n canRetry: t.boolean,\n});\nexport type MobileRejectDataOutput = t.TypeOf;\nexport const mobileRejectData = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"extractData\", \"reject\"],\n inputCodec: MobileRejectDataInput,\n inputEq: eqMobileRejectDataInput,\n outputCodec: MobileRejectDataOutput,\n});\n\nconst MobileUploadHologramInput = withCoApplicant(\n t.type({\n documentCode: NonNegativeInteger,\n pageCode: NonNegativeInteger,\n fileContent: t.unknown, // TODO(pedrodim): it should be Blob\n })\n);\nexport type MobileUploadHologramInput = t.TypeOf<\n typeof MobileUploadHologramInput\n>;\n\nconst eqMobileUploadHologramInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n documentCode: eq.eqNumber,\n pageCode: eq.eqNumber,\n fileContent: eq.eqStrict,\n })\n);\n\nexport const mobileUploadHologram = apiCall({\n inputEq: eqMobileUploadHologramInput,\n path: [\n \"clients\",\n \"identification\",\n \"mobileUpload\",\n \"uploadHologramVideoForFraudCheck\",\n ],\n inputCodec: MobileUploadHologramInput,\n bodyType: \"Binary\",\n});\n\nconst MobileUploadSelfieInput = withCoApplicant(\n t.type({\n fileContent: CompressedFileContent,\n signature: t.string,\n async: t.boolean,\n })\n);\nexport type MobileUploadSelfieInput = t.TypeOf;\n\nconst eqMobileUploadSelfieInput: Eq = eqWithCoApplicant(\n eq.getStructEq({\n fileContent: eq.eqString,\n signature: eq.eqString,\n })\n);\n\nexport const mobileUploadSelfie = apiCall({\n inputEq: eqMobileUploadSelfieInput,\n path: [\n \"clients\",\n \"identification\",\n \"mobileUpload\",\n \"uploadSelfiePictureForFraudCheck\",\n ],\n inputCodec: MobileUploadSelfieInput,\n});\n\nconst MobileUploadParametersOutput = withCoApplicant(\n t.type(\n {\n idType: DocumentIdentificationFlow,\n channel: Channel,\n productType: withFallback(\n optionFromUndefined(UploadDocumentFlowType),\n option.none\n ),\n parameters: optionFromNullable(\n t.type({\n docTypeId: optionFromNullable(NonEmptyString),\n applicationElementID: optionFromNullable(NonEmptyString),\n countryCode: optionFromUndefined(NonEmptyString),\n documentType: optionFromUndefined(DocumentType),\n })\n ),\n },\n \"MobileUploadParametersOutput\"\n )\n);\nexport type MobileUploadParametersOutput = t.TypeOf<\n typeof MobileUploadParametersOutput\n>;\n\nexport const mobileUploadParameters = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"parameters\"],\n inputCodec: VerifyLinkInput,\n inputEq: eqVerifyLinkInput,\n outputCodec: MobileUploadParametersOutput,\n});\n\nexport const DocumentIdCodeOutput = t.type({\n primaryIdCodes: t.array(NonEmptyString),\n});\nexport type DocumentIdCodeOutput = t.TypeOf;\nexport const mobileUploadIdCodes = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"documentIdCodes\"],\n inputCodec: t.type({\n iso3country: NonEmptyString,\n documentType: DocumentType,\n }),\n inputEq: eq.getStructEq({\n iso3country: eq.eqString,\n }),\n outputCodec: DocumentIdCodeOutput,\n});\n\nexport const mobileUploadSelfieVideo = apiCall({\n inputEq: eqWithCoApplicant(eq.getStructEq({ fileContent: eq.eqStrict })),\n path: [\n \"clients\",\n \"identification\",\n \"mobileUpload\",\n \"uploadSelfieVideoForFraudCheck\",\n ],\n inputCodec: withCoApplicant(t.type({ fileContent: t.unknown })),\n bodyType: \"Binary\",\n});\n\nexport const InvestigationStatus = t.union([\n t.literal(\"Error\"),\n t.literal(\"InProgress\"),\n t.literal(\"Complete\"),\n]);\n\nexport type MobileDocumentError = t.TypeOf;\nexport const MobileDocumentError = t.keyof(\n {\n Moire: true,\n DisplayOrPaper: true,\n Expired: true,\n WrongFront: true,\n WrongBack: true,\n WrongBothSides: true,\n DocumentComplete: true,\n },\n \"MobileDocumentError\"\n);\n\nexport type MobileInvestigationError = t.TypeOf<\n typeof MobileInvestigationError\n>;\nexport const MobileInvestigationError = t.type(\n {\n errorPrimary: optionFromUndefined(MobileDocumentError),\n errorSecondary: optionFromUndefined(MobileDocumentError),\n },\n \"MobileInvestigationError\"\n);\n\nexport const MobileInvestigateStatusOutput = t.type({\n investigationStatus: InvestigationStatus,\n error: optionFromUndefined(MobileInvestigationError),\n});\nexport type MobileInvestigateStatusOutput = t.TypeOf<\n typeof MobileInvestigateStatusOutput\n>;\nexport const mobileInvestigateStatus = apiCall({\n path: [\"clients\", \"identification\", \"mobileUpload\", \"investigateStatus\"],\n inputCodec: MobileClientDataInput,\n inputEq: eqMobileClientDataInput,\n outputCodec: MobileInvestigateStatusOutput,\n});\n\nconst CountriesOutput = t.array(Country);\nexport const allCountries = apiCall({\n path: [\"clients\", \"foreign\", \"noauth\", \"supportedCountries\"],\n inputCodec: t.void,\n inputEq: eq.fromEquals(constFalse),\n outputCodec: CountriesOutput,\n});\n\nconst DocumentTypesOutput = t.array(DocumentType);\nexport const documentTypes = apiCall({\n path: [\"clients\", \"foreign\", \"noauth\", \"supportedPrimaryDocumentTypes\"],\n inputCodec: t.type({ iso3country: NonEmptyString }),\n inputEq: eq.getStructEq({\n iso3country: eq.eqString,\n }),\n outputCodec: DocumentTypesOutput,\n});\n\nexport const resetUploadDocument = apiCall({\n inputEq: eq.fromEquals(constFalse),\n path: [\"clients\", \"identification\", \"resetUpload\"],\n inputCodec: optionFromUndefined(withApplicantIndex(t.unknown)),\n outputCodec: t.void,\n});\n","import { NewVersionAlert } from \"./NewVersionAlert\";\nimport { useVersionCheck } from \"./useVersionCheck\";\n\ntype Props = {\n children: JSX.Element;\n};\n\nexport function VersionChecker(props: Props) {\n const { shouldShowNewVersionAlert, onCancelAlert } = useVersionCheck();\n\n return (\n <>\n {shouldShowNewVersionAlert && (\n \n )}\n {props.children}\n \n );\n}\n","import \"!../../../node_modules/extract-css-chunks-webpack-plugin/dist/loader.js!css-loader?{\\\"modules\\\":false,\\\"url\\\":false}!./CustomCard.treat.10P3wBI.css\";\nexport var customCard = '_2F_0i';","import { constant, pipe } from \"fp-ts/function\";\nimport * as t from \"io-ts\";\nimport { NonEmptyString } from \"io-ts-types/lib/NonEmptyString\";\nimport { Channel, foldChannelLocation } from \"../globalDomain\";\nimport { sharedReducerConfig } from \"../BranchExperience/useSharedReducer\";\nimport { ClientDataCheck, MobileRecipientType } from \"./domain\";\n\nexport const MobileFlowType = t.union([\n t.literal(\"ProofOfIncome\"),\n t.literal(\"DocumentUpload\"),\n ClientDataCheck,\n]);\nexport type MobileFlowType = t.TypeOf;\n\nexport const MobileRecipientOptionType = t.type({\n key: MobileRecipientType,\n disabled: t.boolean,\n phoneNumber: NonEmptyString,\n});\nexport type MobileRecipientOptionType = t.TypeOf<\n typeof MobileRecipientOptionType\n>;\n\nconst UploadMode = t.keyof({\n Scanner: true,\n Mobile: true,\n _MockScanner: true,\n});\nexport type UploadMode = t.TypeOf;\n\nconst ReadyState = t.type({ id: t.literal(\"Ready\") });\nconst ReadyMobileState = t.type({ id: t.literal(\"ReadyMobile\") });\nconst ChooseUploadModeState = t.type({ id: t.literal(\"ChooseUploadMode\") });\nconst ScannerUploadState = t.type({\n id: t.literal(\"ScannerUpload\"),\n mocked: t.boolean,\n});\nconst ChooseMobileRecipientState = t.type({\n id: t.literal(\"ChooseMobileRecipient\"),\n flowType: MobileFlowType,\n canUploadAgain: t.boolean,\n});\nconst ChooseRemoteMobileRecipientState = t.type({\n id: t.literal(\"ChooseRemoteMobileRecipient\"),\n flowType: MobileFlowType,\n});\nconst MobileUploadState = t.type({\n id: t.literal(\"MobileUpload\"),\n recipient: MobileRecipientOptionType,\n});\nconst MobileUploadSameDeviceState = t.type({\n id: t.literal(\"MobileUploadSameDevice\"),\n});\nconst MobileFraudCheckSameDeviceState = t.type({\n id: t.literal(\"MobileFraudCheckSameDevice\"),\n check: ClientDataCheck,\n});\nconst UploadSummaryState = t.type({\n id: t.literal(\"UploadSummary\"),\n showUploadCompletedDialog: t.boolean,\n sharedWithClient: t.boolean,\n});\nconst FraudCheckState = t.type({\n id: t.literal(\"FraudCheck\"),\n check: ClientDataCheck,\n recipient: MobileRecipientOptionType,\n canUploadAgain: t.boolean,\n});\nconst UploadAgainState = t.type({\n id: t.literal(\"UploadAgain\"),\n documentMismatch: t.boolean,\n});\n\nconst State = t.union([\n ReadyState,\n ReadyMobileState,\n ChooseUploadModeState,\n ScannerUploadState,\n ChooseMobileRecipientState,\n ChooseRemoteMobileRecipientState,\n MobileUploadState,\n MobileUploadSameDeviceState,\n MobileFraudCheckSameDeviceState,\n UploadSummaryState,\n FraudCheckState,\n UploadAgainState,\n]);\ntype State = t.TypeOf;\n\nexport function foldState(\n state: State,\n match: {\n whenReady: () => T;\n whenReadyMobile: () => T;\n whenChooseUploadMode: () => T;\n whenScannerUpload: (state: Extract) => T;\n whenChooseMobileRecipient: (\n state: Extract\n ) => T;\n whenRemoteMobileRecipient: (\n state: Extract\n ) => T;\n whenMobileUpload: (state: Extract) => T;\n whenMobileUploadSameDevice: () => T;\n whenMobileFraudCheckSameDevice: (\n state: Extract\n ) => T;\n whenUploadSummary: (state: Extract) => T;\n whenFraudCheck: (state: Extract) => T;\n whenUploadAgain: (state: Extract) => T;\n }\n): T {\n switch (state.id) {\n case \"Ready\":\n return match.whenReady();\n case \"ReadyMobile\":\n return match.whenReadyMobile();\n case \"ChooseUploadMode\":\n return match.whenChooseUploadMode();\n case \"ScannerUpload\":\n return match.whenScannerUpload(state);\n case \"ChooseMobileRecipient\":\n return match.whenChooseMobileRecipient(state);\n case \"ChooseRemoteMobileRecipient\":\n return match.whenRemoteMobileRecipient(state);\n case \"MobileUpload\":\n return match.whenMobileUpload(state);\n case \"MobileUploadSameDevice\":\n return match.whenMobileUploadSameDevice();\n case \"MobileFraudCheckSameDevice\":\n return match.whenMobileFraudCheckSameDevice(state);\n case \"UploadSummary\":\n return match.whenUploadSummary(state);\n case \"FraudCheck\":\n return match.whenFraudCheck(state);\n case \"UploadAgain\":\n return match.whenUploadAgain(state);\n }\n}\n\nconst StartUploadAction = t.type({\n id: t.literal(\"StartUpload\"),\n});\nexport function startUploadAction(): Action {\n return {\n id: \"StartUpload\",\n };\n}\n\nconst StartUploadModeAction = t.type({\n id: t.literal(\"StartUploadMode\"),\n payload: UploadMode,\n});\nexport function startUploadModeAction(mode: UploadMode): Action {\n return {\n id: \"StartUploadMode\",\n payload: mode,\n };\n}\n\nconst StartMobileUploadFromSameDeviceAction = t.type({\n id: t.literal(\"StartMobileUploadFromSameDevice\"),\n});\nexport const startMobileUploadFromSameDeviceAction: Action = {\n id: \"StartMobileUploadFromSameDevice\",\n};\n\nconst StartMobileFraudCheckFromSameDeviceAction = t.type({\n id: t.literal(\"StartMobileFraudCheckFromSameDevice\"),\n});\nexport const startMobileFraudCheckFromSameDeviceAction: Action = {\n id: \"StartMobileFraudCheckFromSameDevice\",\n};\n\nconst CancelUploadAction = t.type({\n id: t.literal(\"CancelUpload\"),\n newMobileFlow: t.boolean,\n});\n\nexport function cancelUploadAction(newMobileFlow: boolean): Action {\n return {\n id: \"CancelUpload\",\n newMobileFlow,\n };\n}\n\nconst GoToSummaryAction = t.type({\n id: t.literal(\"GoToSummary\"),\n payload: t.type({\n showUploadCompletedDialog: t.boolean,\n }),\n});\nexport function goToSummaryAction(showUploadCompletedDialog: boolean): Action {\n return {\n id: \"GoToSummary\",\n payload: { showUploadCompletedDialog },\n };\n}\n\nconst UploadAgainAction = t.type({\n id: t.literal(\"UploadAgain\"),\n isDocumentMismatch: t.boolean,\n});\nexport function uploadAgainAction(isDocumentMismatch: boolean): Action {\n return {\n id: \"UploadAgain\",\n isDocumentMismatch: isDocumentMismatch,\n };\n}\n\nconst StartFraudCheckAction = t.type({\n id: t.literal(\"StartFraudCheck\"),\n payload: t.type({\n fraudCheck: ClientDataCheck,\n canUploadAgain: t.boolean,\n }),\n});\nexport function startFraudCheckAction(\n fraudCheck: ClientDataCheck,\n canUploadAgain: boolean\n): Action {\n return {\n id: \"StartFraudCheck\",\n payload: { fraudCheck, canUploadAgain },\n };\n}\n\nconst SelectRecipientAction = t.type({\n id: t.literal(\"SelectRecipient\"),\n payload: MobileRecipientOptionType,\n});\nexport function selectRecipientAction(\n recipient: MobileRecipientOptionType\n): Action {\n return {\n id: \"SelectRecipient\",\n payload: recipient,\n };\n}\n\nconst ShareWithClientAction = t.type({\n id: t.literal(\"ShareWithClient\"),\n});\nexport const shareWithClientAction: Action = {\n id: \"ShareWithClient\",\n};\n\nconst Action = t.union([\n StartUploadAction,\n StartUploadModeAction,\n StartMobileUploadFromSameDeviceAction,\n StartMobileFraudCheckFromSameDeviceAction,\n CancelUploadAction,\n GoToSummaryAction,\n UploadAgainAction,\n StartFraudCheckAction,\n SelectRecipientAction,\n ShareWithClientAction,\n]);\ntype Action = t.TypeOf;\n\nfunction reducer(channel: Channel) {\n return (state: State, action: Action): State => {\n switch (action.id) {\n case \"StartUpload\":\n return pipe(\n channel,\n foldChannelLocation({\n Remote: constant({\n id: \"ChooseRemoteMobileRecipient\",\n flowType: \"DocumentUpload\",\n }),\n InPerson: () => {\n if (channel === \"3P_InPerson\") {\n return {\n id: \"ChooseMobileRecipient\",\n flowType: \"DocumentUpload\",\n canUploadAgain: false,\n };\n }\n return {\n id: \"ChooseUploadMode\",\n };\n },\n })\n );\n case \"StartUploadMode\":\n switch (action.payload) {\n case \"Mobile\":\n return {\n id: \"ChooseMobileRecipient\",\n flowType: \"DocumentUpload\",\n canUploadAgain: false,\n };\n case \"Scanner\":\n return { id: \"ScannerUpload\", mocked: false };\n case \"_MockScanner\":\n return { id: \"ScannerUpload\", mocked: true };\n }\n case \"CancelUpload\":\n return { id: action.newMobileFlow ? \"ReadyMobile\" : \"Ready\" };\n case \"StartFraudCheck\":\n return pipe(\n channel,\n foldChannelLocation({\n Remote: constant({\n id: \"ChooseRemoteMobileRecipient\",\n flowType: action.payload.fraudCheck,\n canUploadAgain: action.payload.canUploadAgain,\n }),\n InPerson: constant({\n id: \"ChooseMobileRecipient\",\n flowType: action.payload.fraudCheck,\n canUploadAgain: action.payload.canUploadAgain,\n }),\n })\n );\n case \"SelectRecipient\":\n if (state.id === \"ChooseMobileRecipient\") {\n if (\n state.flowType === \"DocumentUpload\" ||\n state.flowType === \"ProofOfIncome\"\n ) {\n return {\n id: \"MobileUpload\",\n recipient: action.payload,\n };\n } else {\n return {\n id: \"FraudCheck\",\n check: state.flowType,\n recipient: action.payload,\n canUploadAgain: state.canUploadAgain,\n };\n }\n } else if (state.id === \"ChooseRemoteMobileRecipient\") {\n if (\n state.flowType === \"DocumentUpload\" ||\n state.flowType === \"ProofOfIncome\"\n ) {\n return {\n id: \"MobileUpload\",\n recipient: action.payload,\n };\n } else {\n return {\n id: \"FraudCheck\",\n check: state.flowType,\n recipient: action.payload,\n canUploadAgain: false,\n };\n }\n } else return state;\n case \"StartMobileUploadFromSameDevice\":\n return { id: \"MobileUploadSameDevice\" };\n case \"StartMobileFraudCheckFromSameDevice\":\n if (\n state.id === \"ChooseRemoteMobileRecipient\" &&\n state.flowType !== \"DocumentUpload\" &&\n state.flowType !== \"ProofOfIncome\"\n ) {\n return { id: \"MobileFraudCheckSameDevice\", check: state.flowType };\n } else return state;\n case \"UploadAgain\":\n return {\n id: \"UploadAgain\",\n documentMismatch: action.isDocumentMismatch,\n };\n case \"GoToSummary\":\n return {\n id: \"UploadSummary\",\n showUploadCompletedDialog: action.payload.showUploadCompletedDialog,\n sharedWithClient: false,\n };\n case \"ShareWithClient\":\n if (state.id === \"UploadSummary\" && !state.sharedWithClient) {\n return { ...state, sharedWithClient: true };\n } else return state;\n }\n };\n}\n\nexport function getReducerConfig(channel: Channel) {\n return sharedReducerConfig(\n \"UploadDocuments\",\n State,\n Action,\n reducer(channel)\n );\n}\n"],"sourceRoot":""}