UNPKG

local-id-scan-journey

Version:

A React component for GBG ID verification and document scanning with bundled SDK

3 lines 111 kB
/*! For license information please see idscan-jcs-89419957.ffffb2cf10c5a8b1202d.js.LICENSE.txt */
"use strict";(this.webpackChunkGBG_Idscan=this.webpackChunkGBG_Idscan||[]).push([[159],{135:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},357:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},792:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},936:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1149:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1192:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoginStep=void 0;const n=a(2538),i=a(7993),o=a(1216),r=a(7338),s=a(192),l=a(1431),d=a(642),c=a(4635),u=a(6871);class _{static render(){return s.default.renderToContainer(this._container,c.Templates.Login).then((e=>s.default.getElements(e,{password:'[data-jcs-element="login__password"]',form:'[data-jcs-element="login__form"]',submit:'[data-jcs-element="login__submit"]',username:'[data-jcs-element="login__username"]',errors:'[data-jcs-element="login__errors"]'}))).then((({submit:e,username:t,password:a,errors:n,form:o})=>o instanceof HTMLFormElement&&e instanceof HTMLInputElement&&t instanceof HTMLInputElement&&a instanceof HTMLInputElement?(o.addEventListener("submit",(i=>{i.preventDefault(),this.clearJourney().then((()=>r.default.setText(n))).then((()=>r.default.setEnabled(e,!1))).then((()=>l.default.login({area:"scanning",password:a.value,username:t.value}))).catch(_.renderErrors.bind(this)).then((()=>r.default.setEnabled(e,!0)))})),Promise.resolve()):Promise.reject(new i.ExceptionManager.TemplateException(u.TranslationKey.EXCEPTION_TEMPLATE_ELEMENTS_MISSING)))).then((()=>n.default.publish(d.JourneyEvent.DISPLAY_STEP,{step:c.Templates.Login})))}static renderErrors(e){s.default.getElements(this._container,{errors:'[data-jcs-element="login__errors"]'}).then((({errors:t})=>{r.default.setText(t,o.default.getTranslation(e.message))}))}}t.LoginStep=_},1599:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1779:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageProvider=void 0;const i=a(2538),o=a(885),r=a(1216),s=a(7338),l=a(192),d=a(2745),c=a(4145),u=a(642),_=a(4898),m=a(4635),h=a(6871),f=a(678),p=a(7749),E=a(2930),T=a(8740);class C{static render(e,t){return l.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>l.default.renderToContainer(e,m.Templates.View))).then((e=>l.default.getElements(e,{retry:'[data-jcs-element="view__retry"]',crop:'[data-jcs-element="view__begin__crop"]',image:'[data-jcs-element="view__preview"]',upload:'[data-jcs-element="view__upload"]',status:'[data-jcs-element="view__status"]',statusMessage:'[data-jcs-element="view__status__message"]',openPreviewInfoId:'[data-jcs-element="preview__page__open__info__id"]',previewInfoContainerId:'[data-jcs-element="preview__info__container__id"]',closePreviewInfoId:'[data-jcs-element="preview__page__close__info__id"]',openPreviewInfoFM:'[data-jcs-element="preview__page__open__info__fm"]',previewInfoContainerFM:'[data-jcs-element="preview__info__container__fm"]',closePreviewInfoFM:'[data-jcs-element="preview__page__close__info__fm"]',openPreviewInfoPOA:'[data-jcs-element="preview__page__open__info__poa"]',openPreviewInfoCovid:'[data-jcs-element="preview__page__open__info__covid"]',previewInfoContainerPOA:'[data-jcs-element="preview__info__container__poa"]',previewInfoContainerCovid:'[data-jcs-element="preview__info__container__covid"]',closePreviewInfoPOA:'[data-jcs-element="preview__page__close__info__poa"]',closePreviewInfoCovid:'[data-jcs-element="preview__page__close__info__covid"]',idDocumentContainer:'[data-jcs-element="identity__document__preview"]',facematchContainer:'[data-jcs-element="facematch__preview"]',addressContainer:'[data-jcs-element="address__preview"]',covidContainer:'[data-jcs-element="covid__preview"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',loadingAnimationContainer:'[data-jcs-element="loading-animation"]'}))).then((({image:a,retry:d,upload:m,crop:v,status:g,statusMessage:S,openPreviewInfoId:j,previewInfoContainerId:I,closePreviewInfoId:A,openPreviewInfoCovid:b,previewInfoContainerCovid:y,closePreviewInfoCovid:O,openPreviewInfoFM:w,previewInfoContainerFM:L,closePreviewInfoFM:R,openPreviewInfoPOA:P,previewInfoContainerPOA:N,closePreviewInfoPOA:D,idDocumentContainer:M,facematchContainer:k,addressContainer:F,covidContainer:x,attemptCountContainer:H,attemptCounter:K,loadingAnimationContainer:U})=>{if(s.default.hideObject(I),s.default.hideObject(L),s.default.hideObject(N),s.default.hideObject(y),s.default.hideObject(A),s.default.hideObject(R),s.default.hideObject(D),s.default.hideObject(y),s.default.hideObject(O),s.default.hideObject(M),s.default.hideObject(k),s.default.hideObject(F),s.default.hideObject(x),s.default.hideObject(U),s.default.setEnabled(m,!0),s.default.setEnabled(v,!0),s.default.setEnabled(d,!0),C.loadingAnimation=T.AnimationService.CreateAnimation(U,this.assetsFolder+"/animations/loading.json",!0,!0,{}),l.default.getElements(this._container,{uploadToggleButton:'[data-jcs-element="gateway__upload__toggle"]'}).then((({uploadToggleButton:e})=>{s.default.hideObject(e)})),this._journey){switch(this._journey.action){case p.FlowState.SELFIE:case p.FlowState.PASSIVE_LIVENESS:s.default.showObject(k);break;case p.FlowState.IDENTITY_BACK:case p.FlowState.IDENTITY_FRONT:s.default.showObject(M);break;case p.FlowState.ADDRESS:s.default.showObject(F);break;case p.FlowState.COVIDPASS:s.default.showObject(x)}switch(this._journey.actionAttempt){case 2:s.default.setText(K,"2");break;case 3:s.default.setText(K,"1");break;default:s.default.hideObject(H)}}v&&"SELFIE"===this._journey.action&&(v.style.display="none");const{type:G}=o.ImageService.getBase64Components(e);if(a)switch(a.setAttribute("data-type",G),G){case f.ImageFormat.Pdf:"SELFIE"===this._journey.action&&s.default.hideObject(m),a.setAttribute("src","data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMjMgMTMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnIGZpbGw9IiM5MjkyOTIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSJub25lIiA+PHBhdGggZD0iTTMsMGMtMS42NjEsMCwtMy4wMDcsMS4zNDIsLTMuMDA3LDIuOTk5bDAsNy4wMDJjMCwxLjY1NiwxLjMzNiwyLjk5OSwzLjAwNywyLjk5OWwxNi45ODYsMGMxLjY2MSwwLDMuMDA3LC0xLjM0MiwzLjAwNywtMi45OTlsMCwtNy4wMDJjMCwtMS42NTYsLTEuMzM2LC0yLjk5OSwtMy4wMDcsLTIuOTk5bC0xNi45ODYsMGwwLDB6bS0wLjAxMiwxYy0xLjEwMiwwLC0xLjk5NSwwLjksLTEuOTk1LDEuOTkybDAsNy4wMTZjMCwxLjEsMC45MDIsMS45OTIsMS45OTUsMS45OTJsMTcuMDExLDBjMS4xMDEsMCwxLjk5NCwtMC45LDEuOTk0LC0xLjk5MmwwLC03LjAxNmMwLC0xLjEsLTAuOTAyLC0xLjk5MiwtMS45OTQsLTEuOTkybC0xNy4wMTEsMGwwLDB6bTEzLjAwNSw1bDAsLTJsNCwwbDAsLTFsLTUsMGwwLDdsMSwwbDAsLTNsMywwbDAsLTFsLTMsMGwwLDB6bS0xMywtMWwwLDVsMSwwbDAsLTNsMS45OTUsMGMxLjEwNywwLDIuMDA1LC0wLjg4OCwyLjAwNSwtMmMwLC0xLjEwNSwtMC44OTQsLTIsLTIuMDA1LC0ybC0yLjk5NSwwbDAsMmwwLDB6bTEsLTFsMCwybDIuMDAxLDBjMC41NTIsMCwwLjk5OSwtMC40NDQsMC45OTksLTFjMCwtMC41NTIsLTAuNDQzLC0xLC0wLjk5OSwtMWwtMi4wMDEsMGwwLDB6bTUsLTFsMCw3bDIuOTk1LDBjMS4xMDcsMCwyLjAwNSwtMC44ODcsMi4wMDUsLTIuMDA2bDAsLTIuOTg4YzAsLTEuMTA4LC0wLjg5NCwtMi4wMDYsLTIuMDA1LC0yLjAwNmwtMi45OTUsMGwwLDB6bTEsMWwwLDVsMi4wMDEsMGMwLjU1MiwwLDAuOTk5LC0wLjQ0NCwwLjk5OSwtMWwwLC0zYzAsLTAuNTUyLC0wLjQ0MywtMSwtMC45OTksLTFsLTIuMDAxLDBsMCwweiIvPjwvZz48L3N2Zz4="),v&&(v.style.display="none");break;case f.ImageFormat.Bmp:case f.ImageFormat.Jpeg:case f.ImageFormat.Jpg:case f.ImageFormat.Png:a.setAttribute("src",e);break;default:a.removeAttribute("src")}j instanceof HTMLElement&&j.addEventListener("click",(()=>{s.default.showObject(I),s.default.showObject(A),s.default.hideObject(j)})),A instanceof HTMLElement&&A.addEventListener("click",(()=>{s.default.hideObject(I),s.default.hideObject(A),s.default.showObject(j)})),w instanceof HTMLElement&&w.addEventListener("click",(()=>{s.default.showObject(L),s.default.showObject(R),s.default.hideObject(w)})),R instanceof HTMLElement&&R.addEventListener("click",(()=>{s.default.hideObject(L),s.default.hideObject(R),s.default.showObject(w)})),P instanceof HTMLElement&&P.addEventListener("click",(()=>{s.default.showObject(N),s.default.showObject(D),s.default.hideObject(P)})),D instanceof HTMLElement&&D.addEventListener("click",(()=>{s.default.hideObject(N),s.default.hideObject(D),s.default.showObject(P)})),b instanceof HTMLElement&&b.addEventListener("click",(()=>{s.default.showObject(y),s.default.showObject(O),s.default.hideObject(b)})),O instanceof HTMLElement&&O.addEventListener("click",(()=>{s.default.hideObject(y),s.default.hideObject(O),s.default.showObject(b)})),d instanceof HTMLElement&&d.addEventListener("click",(()=>{s.default.setEnabled(v,!1),s.default.setEnabled(d,!1),s.default.setEnabled(m,!1),this._retry=!0,this.evaluate()})),v instanceof HTMLElement&&v.addEventListener("click",(()=>{s.default.setEnabled(v,!1),s.default.setEnabled(d,!1),s.default.setEnabled(m,!1),s.default.showObject(g),s.default.setText(S,r.default.getTranslation(h.TranslationKey.VIEW_CROPPING)),this._journey.crop({data:o.ImageService.getBase64Components(e).data,inputFormat:0}).then((e=>{this._cropResponse=e,this.evaluate()})).catch((e=>{s.default.showObject(g),s.default.setText(S,r.default.getTranslation(h.TranslationKey.EXCEPTION_NETWORK))})).then((()=>{s.default.setEnabled(v,!0),s.default.setEnabled(d,!0),s.default.setEnabled(m,!0)}))})),m instanceof HTMLElement&&m.addEventListener("click",(()=>n(this,void 0,void 0,(function*(){if(void 0!==this._journey&&this._journey.action===p.FlowState.PASSIVE_LIVENESS){s.default.setEnabled(v,!1),s.default.setEnabled(d,!1),s.default.setEnabled(m,!1),s.default.showObject(U);const t=yield E.default.post(E.default.endpoints.passiveLiveness,JSON.stringify({Base64Input:e,JourneyId:this._journey.id}),void 0,"passiveLiveness");return i.default.publish(u.JourneyEvent.PASSIVE_LIVENESS_FINISHED,t)}if(void 0!==this._journey&&this._journey.action===p.FlowState.COVIDPASS)return s.default.setEnabled(v,!1),s.default.setEnabled(d,!1),s.default.setEnabled(m,!1),s.default.showObject(g),s.default.showObject(U),this.assertImageExists(e).then((()=>this.getJourney())).then((t=>t.continueCovid(e,this._journey.id).then((e=>c.default.getDataStore(c.DataStoreType.ID_SCAN).update(C.parseResponseCovidData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields))).catch((e=>{s.default.showObject(g),s.default.setText(S,r.default.getTranslation(h.TranslationKey.EXCEPTION_NETWORK))})).then((()=>{s.default.setEnabled(v,!0),s.default.setEnabled(d,!0),s.default.setEnabled(m,!0)}));if(0===t.length){const e=[{name:"Capture Type",value:"File Upload",step:"",type:"Simple"}];t.push(...e)}return s.default.setEnabled(v,!1),s.default.setEnabled(d,!1),s.default.setEnabled(m,!1),s.default.showObject(g),s.default.showObject(U),this.assertImageExists(e).then((()=>this.getJourney())).then((a=>a.continue({imgList:[Object.assign(Object.assign({},o.ImageService.remapNames(o.ImageService.getBase64Components(e))),{name:"SELFIE"===a.action?_.RequiredInputImage.SelfiePhoto:_.RequiredInputImage.WhiteImage,inputFormat:"pdf"===G?1:0})],journeyDefinitionId:this._journeyDefinitionId},t).then((e=>c.default.getDataStore(c.DataStoreType.ID_SCAN).update(C.parseResponseData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields))).catch((e=>{s.default.showObject(g),s.default.setText(S,r.default.getTranslation(h.TranslationKey.EXCEPTION_NETWORK))})).then((()=>{s.default.setEnabled(v,!0),s.default.setEnabled(d,!0),s.default.setEnabled(m,!0)}))}))))})).then((()=>i.default.publish(u.JourneyEvent.DISPLAY_PROVIDER,{provider:m.Templates.View})))}}t.ImageProvider=C,C.parseResponseData=({entryData:e,entryDateTime:t,journeyId:a,requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})=>({journeyId:a,journeyReference:e.scanReference,blurCheck:e.glareCheck,glareCheck:e.blurCheck,lowResolutionCheck:e.lowResolutionCheck,fullDocumentInViewCheck:e.fullDocumentInViewCheck,tripleScanReason:e.tripleScanReason,documents:(e.documents||[]).map((a=>(0,d.removeNullOrUndefined)({expirationDate:a.expirationDate,issueDate:a.issueDate,issueNumber:a.issueNumber,number:a.number,type:a.type,blurCheck:"Good"===e.blurCheck,glareCheck:"Good"===e.glareCheck,lowResolutionCheck:"Good"===e.lowResolutionCheck,fullDocumentInViewCheck:"Good"===e.fullDocumentInViewCheck,scanReference:e.scanReference,tripleScanReason:e.tripleScanReason,scannerIp:e.scannerIp,dateTime:t?new Date(t):void 0}))),person:(0,d.removeNullOrUndefined)({address:{city:e.holder.address.city,full:e.holder.address.full,postCode:e.holder.address.postCode},birthDate:e.holder.birthDate,birthPlace:e.holder.birthPlace,firstName:e.holder.firstName,fullName:e.holder.fullName,middleName:e.holder.middleName,lastName:e.holder.lastName,gender:e.holder.gender}),requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s}),C.parseResponseCovidData=({entryData:e,entryDateTime:t,journeyId:a,requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})=>({journeyId:a,journeyReference:e.scanReference,blurCheck:e.glareCheck,glareCheck:e.blurCheck,lowResolutionCheck:e.lowResolutionCheck,fullDocumentInViewCheck:e.fullDocumentInViewCheck,tripleScanReason:e.tripleScanReason,documents:(e.documents||[]).map((a=>(0,d.removeNullOrUndefined)({expirationDate:a.expirationDate,issueDate:a.issueDate,issueNumber:a.issueNumber,number:a.number,type:a.type,blurCheck:"Good"===e.blurCheck,glareCheck:"Good"===e.glareCheck,lowResolutionCheck:"Good"===e.lowResolutionCheck,fullDocumentInViewCheck:"Good"===e.fullDocumentInViewCheck,scanReference:e.scanReference,tripleScanReason:e.tripleScanReason,scannerIp:e.scannerIp,dateTime:t?new Date(t):void 0}))),requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})},2224:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2571:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResultsStep=void 0;const n=a(2538),i=a(1216),o=a(192),r=a(1431),s=a(642),l=a(4635),d=a(6871),c=a(9609);class u{static render(){return o.default.renderToContainer(this._container,l.Templates.Result).then((()=>r.default.getResults(this._journey.id))).then((e=>{const t={result:i.default.getTranslation(`RESULTS_HIGH_LEVEL_${e.highLevelResult}`),resultMessage:"Expired"==e.highLevelResult?i.default.getTranslation(d.TranslationKey.RESULTS_HIGH_LEVEL_EXPIRED_MESSAGE_VALUE):null,referenceId:e.referenceNumber,journeyId:e.JourneyId,resultDetails:e.HighLevelResultDetails.filter((e=>!e.startsWith("DOCUMENTBACKSIDECHECK")&&!e.startsWith("DATACHECKS"))).map((e=>{const[t,a]=e.split(":");return{_name:t.toLowerCase(),name:i.default.getTranslation(`RESULTS_HIGH_LEVEL_DETAIL_${t}`),value:i.default.getTranslation(`RESULTS_HIGH_LEVEL_DETAIL_VALUE_${a}`)}})),dataLookBackCheckDetails:u.getLookBackCheckDetails(e.JourneySteps),trustScoreDetails:u.getTrustScoreDetails(e.additionalData),GBGScoreDetails:u.getGBGScoreDetails(e.additionalData),dataChecksDetails:u.getDataCheckDetails(e.JourneySteps.find((e=>"ADDITIONALDATA"===e.Type))),documents:e.processedDocuments.map((e=>({_type:e.documentType.toLowerCase(),_result:e.highLevelResult.toLowerCase(),type:i.default.getTranslation(`SUPPORTED_DOCUMENT_${e.documentType}`),result:i.default.getTranslation(`RESULTS_HIGH_LEVEL_${e.highLevelResult}`),extractedFields:e.extractedFields.map((e=>({_name:e.name.toLowerCase(),name:i.default.getTranslation(`EXTRACTED_FIELDS_${e.name}`),value:e.value}))),images:e.documentImages.filter((e=>e.role.includes("WhiteImage"))).map((e=>({_type:e.type,_role:e.role,_url:e.url})))})))};return o.default.renderToContainer(this._container,l.Templates.Result,t)})).catch((e=>o.default.renderToContainer(this._container,l.Templates.Result,{result:i.default.getTranslation(`RESULTS_HIGH_LEVEL_${this._journey.result}`),journeyId:this._journey.id}))).then((()=>o.default.getElements(this._container,{logout:'[data-jcs-element="result__logout"]',start:'[data-jcs-element="result__journey__restart"]'}))).then((({start:e,logout:t})=>{e&&e.addEventListener("click",(()=>this.clearJourney().then((()=>c.JourneySelectStep.render.call(this))))),t&&t.addEventListener("click",(()=>this.clearJourney().then((()=>this._journeyDefinitionId="")).then((()=>r.default.logout()))))})).then((()=>n.default.publish(s.JourneyEvent.DISPLAY_STEP,{step:l.Templates.Result})))}static getLookBackCheckDetails(e){const t=e.find((e=>"ADDITIONALDATA"===e.Type));if(t){const e=t.ValidationChecks.find((e=>e.startsWith("LOOKBACKCHECK")));if(e){const[t,a]=e.split(":");return{_name:"lookbackcheck",name:i.default.getTranslation("ADDITIONAL_CHECKS_DETAIL_LOOKBACKCHECK"),value:i.default.getTranslation(`RESULTS_HIGH_LEVEL_DETAIL_VALUE_${a}`)}}}return{_name:"lookbackcheck",name:i.default.getTranslation("ADDITIONAL_CHECKS_DETAIL_LOOKBACKCHECK"),value:i.default.getTranslation("ADDITIONAL_CHECKS_DETAIL_LOOKBACKCHECK_NA")}}static getTrustScoreDetails(e){const t=e.find((e=>"SipTrustScore"===e.name));if(t){const e=t.value;if(e)return{_name:"trustScore",name:i.default.getTranslation("GBG_TRUST_SCORE"),value:e}}}static getGBGScoreDetails(e){const t=e.find((e=>"GBGScore"===e.name));if(t){const e=t.value;if(e)return{_name:"GBGScore",name:i.default.getTranslation("GBG_SCORE"),value:e}}}static getDataCheckDetails(e){if(e){const t=e.ValidationChecks.find((e=>e.startsWith("DATACHECKS")));if(t){const[e,a]=t.split(":");return{_name:e.toLowerCase(),name:i.default.getTranslation("ADDITIONAL_CHECKS_DETAIL_DATACHECKS"),value:i.default.getTranslation(`RESULTS_HIGH_LEVEL_DETAIL_VALUE_${a}`)}}}}}t.ResultsStep=u},2651:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2676:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DataChecksStep=void 0;const i=a(8740),o=a(2538),r=a(7993),s=a(1216),l=a(7338),d=a(192),c=a(642),u=a(4635),_=a(6871);class m{static render(){return d.default.renderToContainer(this._container,u.Templates.DataChecks).then((e=>d.default.getElements(e,{form:'[data-jcs-element="user__input__form"]',houseNumber:'[data-jcs-element="user__input__house__name__number"]',streetName:'[data-jcs-element="user__input__street__name"]',town:'[data-jcs-element="user__input__town"]',postalCode:'[data-jcs-element="user__input__postal__code"]',errors:'[data-jcs-element="user__input__errors"]',submit:'[data-jcs-element="user__input__submit"]',loadingAnimationContainer:'[data-jcs-element="loading-animation"]'}))).then((({form:e,houseNumber:t,streetName:a,town:o,postalCode:s,errors:d,submit:c,loadingAnimationContainer:u})=>e instanceof HTMLFormElement&&t instanceof HTMLInputElement&&a instanceof HTMLInputElement&&o instanceof HTMLInputElement&&s instanceof HTMLInputElement&&c instanceof HTMLInputElement?(this._journey&&(l.default.setValue(o,this._journey.information.holder.address.city),l.default.setValue(s,this._journey.information.holder.address.postCode)),e.addEventListener("submit",(e=>n(this,void 0,void 0,(function*(){e.preventDefault(),l.default.setText(d),m.validateInputs(t,a,o,s).catch(m.renderErrors.bind(this)).then((e=>(l.default.setEnabled(c,!0),e))).then((e=>n(this,void 0,void 0,(function*(){var n;e&&(m.loadingAnimation=i.AnimationService.CreateAnimation(u,this.assetsFolder+"/animations/loading.json",!0,!0,{}),l.default.showObject(u),l.default.setEnabled(c,!1),yield null===(n=this._journey)||void 0===n?void 0:n.continueDataChecks({journeyId:this._journey.id,houseName:t.value,streetName:a.value,town:o.value,postCode:s.value}).then((()=>this.evaluate())))}))))})))),Promise.resolve()):Promise.reject(new r.ExceptionManager.TemplateException(_.TranslationKey.EXCEPTION_TEMPLATE_ELEMENTS_MISSING)))).then((()=>o.default.publish(c.JourneyEvent.DISPLAY_STEP,{step:u.Templates.DataChecks})))}static renderErrors(e){d.default.getElements(this._container,{errors:'[data-jcs-element="user__input__errors"]'}).then((({errors:t})=>{l.default.setText(t,s.default.getTranslation(e.message))}))}}t.DataChecksStep=m,m.validateInputs=(e,t,a,n)=>new Promise(((i,o)=>{var s=!0;return e.value?l.default.removeClass(e,"input_failure"):(l.default.addClass(e,"input_failure"),s=!1),t.value?l.default.removeClass(t,"input_failure"):(l.default.addClass(t,"input_failure"),s=!1),a.value?l.default.removeClass(a,"input_failure"):(l.default.addClass(a,"input_failure"),s=!1),n.value?l.default.removeClass(n,"input_failure"):(l.default.addClass(n,"input_failure"),s=!1),s?n.value.length<5||n.value.length>8||0===n.value.trim().length?(l.default.addClass(n,"input_failure"),o(r.ExceptionManager.process(new r.ExceptionManager.MissingParameterException(_.TranslationKey.EXCEPTION_POSTCODE_FORMAT_ERROR)))):e.value.length<1||0===e.value.trim().length?(l.default.addClass(e,"input_failure"),o(r.ExceptionManager.process(new r.ExceptionManager.MissingParameterException(_.TranslationKey.EXCEPTION_HOUSENUMBER_FORMAT_ERROR)))):t.value.length<1||t.value.length>30||0===t.value.trim().length?(l.default.addClass(t,"input_failure"),o(r.ExceptionManager.process(new r.ExceptionManager.MissingParameterException(_.TranslationKey.EXCEPTION_STREETNAME_FORMAT_ERROR)))):a.value.length<1||a.value.length>20||0===a.value.trim().length?(l.default.addClass(a,"input_failure"),o(r.ExceptionManager.process(new r.ExceptionManager.MissingParameterException(_.TranslationKey.EXCEPTION_TOWN_FORMAT_ERROR)))):i(s):o(r.ExceptionManager.process(new r.ExceptionManager.MissingParameterException(_.TranslationKey.EXCEPTION_MISSING_REQUIRED_FIELD_MISSING)))}))},2682:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2769:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3181:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PassiveLivenessStep=void 0;const i=a(3123),o=a(2538),r=a(192),s=a(4145),l=a(642),d=a(4635),c=a(2745),u=a(5862),_=a(7338),m=a(1216),h=a(8137),f=a(1779),p=a(2930),E=a(8740),T=a(8829);class C{static render(){return i.default.getVideoCameras().then((e=>e.map((e=>({name:e.label,value:e.deviceId}))))).then((e=>(C.cameras=e,i.default.getVideoCameras(),Promise.all([i.default.getCameraPermission(),i.default.hasDeviceCapableOfResolution()]).then((([e])=>{if(e===i.CameraPermissionState.DENIED)return r.default.renderToContainer(this._container,d.Templates.HasNoCamera).then((()=>{this.hookGlobalButtons(!1)}))})),r.default.renderToContainer(this._container,d.Templates.PassiveLiveness,{cameras:e})))).then((e=>this.changeCameraStream(void 0,h.ReticleType.PORTRAIT,!this._config.hideLogo,h.HintType.NONE,!0,i.CameraFacingMode.FRONT).catch((e=>{})).then((()=>e)))).then((e=>(r.default.getElements(e,{cameraClick:'[data-jcs-element="camera__capture"]',status:'[data-jcs-element="view__status"]',statusMessage:'[data-jcs-element="view__status__message"]',cameraSelect:'[data-jcs-element="camera__select"]',messages:'[data-jcs-element="passive__liveness__message"]',messagesTitle:'[data-jcs-element="passive__liveness__message__title"]',messagesContainer:'[data-jcs-element="passive__liveness__message__container"]',mobileHelp:'[data-jcs-element="mobile__help__container"]',desktopHelp:'[data-jcs-element="desktop__help__container"]',mobileCloseHelp:'[data-jcs-element="mobile__close__help"]',mobileOpenHelp:'[data-jcs-element="mobile__open__help"]',desktopCloseHelp:'[data-jcs-element="desktop__close__help"]',desktopOpenHelp:'[data-jcs-element="desktop__open__help"]',passiveLivenessContainer:'[data-jcs-element="passive__liveness__step__container"]',passiveLivenessProviderContainer:'[data-jcs-element="provider__container"]',loadingAnimationContainer:'[data-jcs-element="loading-animation"]'}).then((({cameraClick:e,cameraSelect:t,messages:a,status:c,statusMessage:u,messagesTitle:p,messagesContainer:T,mobileHelp:v,desktopHelp:g,mobileCloseHelp:S,mobileOpenHelp:j,desktopCloseHelp:I,desktopOpenHelp:A,passiveLivenessContainer:b,passiveLivenessProviderContainer:y,loadingAnimationContainer:O})=>{_.default.hideObject(y),_.default.setEnabled(e,!0),i.default.getCameraPermission().then((e=>{if(e===i.CameraPermissionState.DENIED)r.default.renderToContainer(this._container,d.Templates.HasNoCamera)})).catch((e=>{_.default.showObject(c),_.default.setText(u,e.message)})),t instanceof HTMLSelectElement&&(_.default.setEnabled(t,!0),C.loadingAnimation=E.AnimationService.CreateAnimation(O,this.assetsFolder+"/animations/loading.json",!0,!0,{}),this.renderAvailableCameras(t),t.addEventListener("change",(()=>{_.default.setEnabled(t,!1),this.changeCameraStream(t.value,h.ReticleType.PORTRAIT,void 0,void 0,!0),_.default.markSelected(t,t.value),_.default.setEnabled(t,!0)})),t instanceof HTMLSelectElement&&(_.default.updateSelect(t,C.cameras),C.cameras&&C.cameras.length>1?_.default.showObject(t):_.default.hideObject(t))),j instanceof HTMLElement&&j.addEventListener("click",(()=>{_.default.showObject(v),_.default.hideObject(j)})),S instanceof HTMLElement&&S.addEventListener("click",(()=>{_.default.hideObject(v),_.default.showObject(j)})),A instanceof HTMLElement&&A.addEventListener("click",(()=>{_.default.showObject(g),_.default.showObject(I),_.default.hideObject(A)})),I instanceof HTMLElement&&I.addEventListener("click",(()=>{_.default.hideObject(g),_.default.hideObject(I),_.default.showObject(A)})),o.default.unsubscribeTopic(l.JourneyEvent.PASSIVE_LIVENESS_FINISHED),o.default.subscribe(l.JourneyEvent.PASSIVE_LIVENESS_FINISHED,(t=>{if(_.default.hideObject(y),t.hasError&&"PASSIVE_LIVENESS"===t.NextAction)_.default.showObject(b),_.default.showObject(T),_.default.hideObject(O),_.default.setText(p,m.default.getTranslation(`PASSIVE_LIVENESS_ERROR_${t.ErrorCode}_TITLE`)),_.default.setText(a,m.default.getTranslation(`PASSIVE_LIVENESS_ERROR_${t.ErrorCode}`)),this.changeCameraStream(void 0,h.ReticleType.PORTRAIT,!this._config.hideLogo,h.HintType.NONE,!0,i.CameraFacingMode.FRONT),_.default.setEnabled(e,!0);else{const e=C.parseResponse(t.Workflow);s.default.getDataStore(s.DataStoreType.ID_SCAN).update(C.parseResponseData(t.Workflow)),i.default.stopStreaming(),this._journey.bindUpdate(e).then((()=>this.evaluate()))}})),e instanceof HTMLInputElement&&e.addEventListener("click",(()=>n(this,void 0,void 0,(function*(){const t=yield i.default.getImageFromCurrentStream();return _.default.showObject(O),this._previewPages.passiveLivenessStep.manualCapture?(_.default.hideObject(T),_.default.hideObject(b),_.default.showObject(y),f.ImageProvider.render.call(this,t,[])):(_.default.setEnabled(e,!1),this.freezeCameraStream(),_.default.showObject(O),C.continueJourneySkipPreview.call(this,t))}))))})),e))).then((()=>o.default.publish(l.JourneyEvent.DISPLAY_STEP,{step:d.Templates.PassiveLiveness,provider:T.InputProvider.LIVENESS})))}static continueJourneySkipPreview(e){return n(this,void 0,void 0,(function*(){const t=yield p.default.post(p.default.endpoints.passiveLiveness,JSON.stringify({Base64Input:e,JourneyId:this._journey.id}),void 0,"passiveLiveness");return o.default.publish(l.JourneyEvent.PASSIVE_LIVENESS_FINISHED,t)}))}}t.PassiveLivenessStep=C,C.parseResponse=e=>({currentResult:e.CurrentResult,documentSource:u.DocumentSource.IDENTITY,entryData:{scanReference:e.ScanReference,documents:[],holder:{address:{}}},entryDateTime:e.EntryDateTime,entryImages:e.EntryImages,hasError:e.HasError,highLevelResult:e.HighLevelResult,isFinished:e.IsFinished,journeyId:"",personEntryId:e.PersonEntryId,requiredAction:e.RequiredAction,resultDetails:e.ResultDetails}),C.parseResponseData=({EntryData:e,EntryDateTime:t,JourneyId:a,RequiredAction:n,HighLevelResult:i,CurrentResult:o,HasError:r,IsFinished:s,PersonEntryId:l})=>({journeyId:l,journeyReference:e.ScanReference,documents:(e.Documents||[]).map((a=>(0,c.removeNullOrUndefined)({expirationDate:a.expirationDate,issueDate:a.issueDate,issueNumber:a.issueNumber,number:a.number,type:a.type,blurCheck:"Good"===e.BlurCheck,glareCheck:"Good"===e.BlurCheck,lowResolutionCheck:"Good"===e.LowResolutionCheck,scanReference:e.ScanReference,scannerIp:e.ScannerIp,dateTime:e?new Date(t):void 0}))),requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})},3429:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4378:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4487:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CameraProvider=void 0;const n=a(3123),i=a(2538),o=a(1216),r=a(7338),s=a(192),l=a(8137),d=a(8829),c=a(642),u=a(4635),_=a(6871),m=a(1779),h=a(7749),f=a(885),p=a(4898),E=a(4145),T=a(8740),C=a(9387);class v{static render(e=!1,t=!1){return s.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>s.default.renderToContainer(e,u.Templates.Camera))).then((e=>s.default.getElements(e,{cameraStatus:'[data-jcs-element="camera__status"]',cameraCapture:'[data-jcs-element="camera__capture"]',cameraViewfinder:'[data-jcs-element="camera__viewfinder"]',cameraSelect:'[data-jcs-element="camera__select"]',smartCaptureToggle:'[data-jcs-element="camera__manual__capture"]',smartCaptureToggleInner:'[data-jcs-element="camera__manual__capture__inner"]',modalSmartCaptureButton:'[data-jcs-element="capture__modal__camera__manual__capture"]',modalManualCaptureText:'[data-jcs-element="capture__modal__manual__capture__text"]',manualCaptureCheck:'[data-jcs-element="camera__manual__capture__check"]',modalManualCaptureCheck:'[data-jcs-element="capture__modal__camera__manual__capture__check"]',closeHelp:'[data-jcs-element="capture__close__help"]',openHelp:'[data-jcs-element="capture__open__help"]',helpDocumentContainer:'[data-jcs-element="capture__help__container"]',helpSelfieContainer:'[data-jcs-element="capture__selfie__help__container"]',helpAddressContainer:'[data-jcs-element="capture__address__help__container"]',helpCovidContainer:'[data-jcs-element="capture__covid__help__container"]',modalDocumentClose:'[data-jcs-element="capture__modal__close__help"]',modalSelfieClose:'[data-jcs-element="capture__selfie__modal__close__help"]',modalAddressClose:'[data-jcs-element="capture__address__modal__close__help"]',modalCovidClose:'[data-jcs-element="capture__covid__modal__close__help"]',modalDocumentGlareContainer:'[data-jcs-element="capture__modal__glare__animation__container"]',modalDocumentLowResContainer:'[data-jcs-element="capture__modal__low__res__animation__container"]',modalDocumentBlurContainer:'[data-jcs-element="capture__modal__blur__animation__container"]',modalAddressGlareContainer:'[data-jcs-element="capture__address__modal__glare__animation__container"]',modalAddressLowResContainer:'[data-jcs-element="capture__address__modal__low__res__animation__container"]',modalAddressBlurContainer:'[data-jcs-element="capture__address__modal__blur__animation__container"]',modalCovidGlareContainer:'[data-jcs-element="capture__covid__modal__glare__animation__container"]',modalCovidLowResContainer:'[data-jcs-element="capture__covid__modal__low__res__animation__container"]',modalCovidBlurContainer:'[data-jcs-element="capture__covid__modal__blur__animation__container"]',actionDocumentContainer:'[data-jcs-element="info__journey__action__container"]',actionText:'[data-jcs-element="info__journey__action__text"]',actionSelfieContainer:'[data-jcs-element="info__journey__action__selfie__container"]',actionAddressContainer:'[data-jcs-element="info__journey__action__address__container"]',actionCovidContainer:'[data-jcs-element="info__journey__action__covid__container"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',loadingAnimationContainer:'[data-jcs-element="loading-animation"]'}))).then((({cameraStatus:a,cameraCapture:i,cameraViewfinder:s,cameraSelect:c,smartCaptureToggle:u,smartCaptureToggleInner:m,modalSmartCaptureButton:f,modalManualCaptureText:p,manualCaptureCheck:E,modalManualCaptureCheck:g,closeHelp:S,openHelp:j,helpDocumentContainer:I,helpSelfieContainer:A,helpAddressContainer:b,modalDocumentClose:y,modalSelfieClose:O,modalAddressClose:w,modalDocumentGlareContainer:L,modalDocumentLowResContainer:R,modalDocumentBlurContainer:P,modalAddressGlareContainer:N,modalAddressLowResContainer:D,modalAddressBlurContainer:M,actionDocumentContainer:k,actionText:F,actionSelfieContainer:x,actionAddressContainer:H,attemptCountContainer:K,attemptCounter:U,loadingAnimationContainer:G,actionCovidContainer:B,helpCovidContainer:V,modalCovidBlurContainer:J,modalCovidClose:Y,modalCovidGlareContainer:q,modalCovidLowResContainer:W})=>{if(r.default.hideObject(c),r.default.setEnabled(i,!1),r.default.setEnabled(c,!1),r.default.hideObject(S),v.loadingAnimation=T.AnimationService.CreateAnimation(G,this.assetsFolder+"/animations/loading.json",!0,!0,{}),this._journey){if(this._journey.actionAttempt>1&&this._config.tripleScanGuidancePage&&(this._journey.action===h.FlowState.IDENTITY_BACK||this._journey.action===h.FlowState.IDENTITY_FRONT)&&!e)C.TripleScanGuidanceProvider.render.call(this,d.InputProvider.CAMERA);else switch(e=!1,this._journey.action){case h.FlowState.SELFIE:r.default.showObject(x),r.default.hideObject(m),v.reticle=l.ReticleType.PORTRAIT,v.hint=l.HintType.NONE,v.helpModal=A,v.modalClose=O;break;case h.FlowState.IDENTITY_BACK:case h.FlowState.IDENTITY_FRONT:r.default.showObject(k),r.default.showObject(m),v.reticle=l.ReticleType.DOCUMENT,v.hint=l.HintType.AUTOCAPTUREOFF,v.helpModal=I,v.modalClose=y,v.modalBlurContainer=P,v.modalGlareContainer=L,v.modalLowResContainer=R;break;case h.FlowState.ADDRESS:r.default.showObject(H),r.default.hideObject(m),v.reticle=l.ReticleType.NONE,v.hint=l.HintType.NONE,v.helpModal=b,v.modalClose=w,v.modalBlurContainer=M,v.modalGlareContainer=N,v.modalLowResContainer=D;break;case h.FlowState.COVIDPASS:r.default.showObject(B),r.default.hideObject(m),v.reticle=l.ReticleType.NONE,v.hint=l.HintType.NONE,v.helpModal=V,v.modalClose=Y,v.modalBlurContainer=J,v.modalGlareContainer=q,v.modalLowResContainer=W}switch(this._config.hideAutoCaptureHints&&(v.hint=l.HintType.NONE),this._journey.actionAttempt){case 2:r.default.setText(U,"2");break;case 3:r.default.setText(U,"1");break;default:r.default.hideObject(K)}this._journey.action===h.FlowState.IDENTITY_FRONT&&r.default.setText(F,o.default.getTranslation(_.TranslationKey.CAMERA_MANUAL_CAPTURE_FRONT)),this._journey.action===h.FlowState.IDENTITY_BACK&&r.default.setText(F,o.default.getTranslation(_.TranslationKey.CAMERA_CAPTURE_BACK))}return n.default.getCameraPermission().then((e=>{switch(e){case n.CameraPermissionState.UNKNOWN:case n.CameraPermissionState.GRANTED:r.default.setText(a,o.default.getTranslation(_.TranslationKey.CAMERA_LOADING))}})).then((()=>{let e;if(this._journey&&(e=this._journey.action===h.FlowState.PASSIVE_LIVENESS||this._journey.action===h.FlowState.SELFIE),u instanceof HTMLElement&&u.addEventListener("change",(()=>{this.changeInputProvider(d.InputProvider.SMART_CAPTURE,d.ChangeMode.DEFAULT),this.evaluate(!0,t,d.InputProvider.SMART_CAPTURE)})),f instanceof HTMLElement&&f.addEventListener("change",(()=>{this.changeInputProvider(d.InputProvider.SMART_CAPTURE,d.ChangeMode.DEFAULT),this.evaluate(!0,t,d.InputProvider.SMART_CAPTURE)})),j instanceof HTMLElement&&j.addEventListener("click",(()=>{r.default.showObject(v.helpModal),r.default.showObject(S),r.default.hideObject(j),v.modalGlareContainer&&v.modalBlurContainer&&v.modalBlurContainer&&(v.glareAnimation=T.AnimationService.CreateAnimation(v.modalGlareContainer,this.assetsFolder+"/animations/glare.json",!0,!0,{}),v.blurAnimation=T.AnimationService.CreateAnimation(v.modalBlurContainer,this.assetsFolder+"/animations/blur.json",!0,!0,{}),v.lowResAnimation=T.AnimationService.CreateAnimation(v.modalLowResContainer,this.assetsFolder+"/animations/low-res.json",!0,!0,{}),v.glareAnimation.show(),v.glareAnimation.play(),v.blurAnimation.show(),v.blurAnimation.play(),v.lowResAnimation.show(),v.lowResAnimation.play())})),S instanceof HTMLElement&&S.addEventListener("click",(()=>{v.closeModal(v.helpModal,S,j)})),v.modalClose instanceof HTMLElement&&v.modalClose.addEventListener("click",(()=>{v.closeModal(v.helpModal,S,j)})),c instanceof HTMLSelectElement){if(c.addEventListener("change",(()=>{r.default.setText(a,o.default.getTranslation(_.TranslationKey.CAMERA_LOADING)),r.default.setEnabled(c,!1),r.default.setEnabled(i,!1),this.changeCameraStream(c.value,v.reticle,!this._config.hideLogo,v.hint,e).then((()=>this.renderAvailableCameras(c))).then((()=>{r.default.hideObject(a),r.default.setEnabled(c,!0),r.default.setEnabled(i,!0)})).catch((e=>{r.default.setEnabled(c,!0),r.default.showObject(a),r.default.setText(a,o.default.getTranslation(e.message))}))})),r.default.setEnabled(c,!1),!(i&&s instanceof HTMLCanvasElement))return Promise.resolve();{i.addEventListener("click",(()=>{const e=[{name:"Capture Type",value:"Manual Capture",step:"",type:"Simple"}];r.default.setEnabled(i,!1),r.default.showObject(G),n.default.getImageFromCurrentStream().then((e=>(this.freezeCameraStream(),e))).then((t=>v.continueJourney.call(this,t,e))).then((()=>this.updateJourneyFields()))}));let t=n.CameraFacingMode.BACK;n.default.getVideoCameras().then((e=>{var a;if((null===(a=this._journey)||void 0===a?void 0:a.action)===h.FlowState.SELFIE)return t=n.CameraFacingMode.FRONT,Promise.resolve(void 0);var i=e.find((e=>n.default.isBackDualWideCameraLabel(e.label)));let o=i?i.deviceId:"";return""!==o?(t=n.CameraFacingMode.ENVIRONMENT,r.default.markSelected(c,o),o):Promise.resolve(void 0)})).then((o=>this.changeCameraStream(o,v.reticle,!this._config.hideLogo,v.hint,e,t).then((()=>this.renderAvailableCameras(c))).then((()=>{r.default.hideObject(a),r.default.setEnabled(c,!0),r.default.setEnabled(i,!0),r.default.markSelected(c,c.value)})).catch((()=>this.changeInputProvider(d.InputProvider.FILESYSTEM,d.ChangeMode.FORCE).then((()=>n.default.stopStreaming())).then((()=>this.evaluate()))))))}}}),(()=>{}))})).then((()=>i.default.publish(c.JourneyEvent.DISPLAY_PROVIDER,{provider:u.Templates.Camera})))}static continueJourney(e,t){if(void 0!==this._journey)switch(this._journey.action){case h.FlowState.IDENTITY_BACK:case h.FlowState.IDENTITY_FRONT:return this._previewPages.documentStep.manualCapture?m.ImageProvider.render.call(this,e,t):v.continueJourneySkipPreview.call(this,e,t);case h.FlowState.ADDRESS:return this._previewPages.poaStep.manualCapture?m.ImageProvider.render.call(this,e,t):v.continueJourneySkipPreview.call(this,e,t);case h.FlowState.SELFIE:return this._previewPages.facematchStep.manualCapture?m.ImageProvider.render.call(this,e,t):v.continueJourneySkipPreview.call(this,e,t);case h.FlowState.COVIDPASS:return this._previewPages.covidStep.manualCapture?m.ImageProvider.render.call(this,e,t):v.continueJourneySkipPreviewCovid.call(this,e,t)}}static continueJourneySkipPreviewCovid(e,t){return this.assertImageExists(e).then((()=>this.getJourney())).then((t=>t.continueCovid(e,this._journey.id))).then((e=>E.default.getDataStore(E.DataStoreType.ID_SCAN).update(m.ImageProvider.parseResponseCovidData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields).then((()=>i.default.publish(c.JourneyEvent.DISPLAY_STEP,{step:u.Templates.Result})))}static continueJourneySkipPreview(e,t){const{type:a}=f.ImageService.getBase64Components(e);return this.assertImageExists(e).then((()=>this.getJourney())).then((n=>n.continue({imgList:[Object.assign(Object.assign({},f.ImageService.remapNames(f.ImageService.getBase64Components(e))),{name:"SELFIE"===n.action?p.RequiredInputImage.SelfiePhoto:p.RequiredInputImage.WhiteImage,inputFormat:"pdf"===a?1:0})],journeyDefinitionId:this._journeyDefinitionId},t).then((e=>E.default.getDataStore(E.DataStoreType.ID_SCAN).update(m.ImageProvider.parseResponseData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields)))}static closeModal(e,t,a){r.default.hideObject(e),r.default.hideObject(t),r.default.showObject(a),v.glareAnimation.stop(),v.glareAnimation.destroy(),v.blurAnimation.stop(),v.blurAnimation.destroy(),v.lowResAnimation.stop(),v.lowResAnimation.destroy()}}t.CameraProvider=v},4517:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4569:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5141:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5620:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessStep=void 0;const n=a(3123),i=a(2538),o=a(192),r=a(5828),s=a(3667),l=a(4145),d=a(1431),c=a(642),u=a(4635),_=a(2745),m=a(8137),h=a(1216),f=a(7338),p=a(6871),E=a(8740);class T{static render(){return n.default.getVideoCameras().then((e=>e.map((e=>({name:e.label,value:e.deviceId}))))).then((e=>(T.cameras=e,o.default.renderToContainer(this._container,u.Templates.Liveness,{cameras:e})))).then((e=>this.changeCameraStream(void 0,void 0,!this._config.hideLogo,m.HintType.NONE,void 0,n.CameraFacingMode.FRONT).then((()=>e)))).then((e=>r.default.getNewService(this._journey.id,e,d.default.getToken(),{autoRun:!1,cortexApiController:"LivenessStreamingSocket",cortexApiPath:this._config.backendUrl.split("//")[1]+"/idscanEnterpriseSVC/",frameSubmissionDelay:.001,grayscale:!0,imageQuality:75}).then((e=>{o.default.getElements(this._container,{cameraSelect:'[data-jcs-element="camera__select"]'}).then((({cameraSelect:e})=>{e instanceof HTMLSelectElement&&(f.default.updateSelect(e,T.cameras),T.cameras&&T.cameras.length>1?f.default.showObject(e):f.default.hideObject(e))})),e.emitter.on(s.CortixResponseAction.StopCapturing,(t=>{const a=d.default.caseDic(t.workflowState);l.default.getDataStore(l.DataStoreType.ID_SCAN).update(T.parseResponseData(a)),this._journey.update(a).then((()=>e.terminate())).then((()=>{void 0!==T.livenessAnimation&&null!==T.livenessAnimation&&(T.livenessAnimation.stop(),T.livenessAnimation.destroy(),T.livenessAnimation=void 0),void 0!==T.cameraPoseSubscription&&(T.cameraPoseSubscription.unsubscribe(),T.cameraPoseSubscription=void 0)})).then((()=>this.evaluate()))})),e.emitter.on(s.CortixResponseAction.FinishLivenessCapturing,(e=>{i.default.publish(c.JourneyEvent.LIVENESS_PROCESSING,{step:u.Templates.Liveness})})),e.emitter.on(s.CortixResponseAction.Error,(()=>{e.terminate().then((()=>{void 0!==T.livenessAnimation&&null!==T.livenessAnimation&&(T.livenessAnimation.stop(),T.livenessAnimation.destroy(),T.livenessAnimation=void 0),void 0!==T.cameraPoseSubscription&&(T.cameraPoseSubscription.unsubscribe(),T.cameraPoseSubscription=void 0)})).then((()=>this.evaluate()))})),e.emitter.on(s.CortixResponseAction.Close,(({code:t})=>{if(i.default.publish(c.JourneyEvent.LIVENESS_FINISHED,{step:u.Templates.Liveness}),1e3!==t)return e.terminate().then((()=>{void 0!==T.livenessAnimation&&null!==T.livenessAnimation&&(T.livenessAnimation.stop(),T.livenessAnimation.destroy(),T.livenessAnimation=void 0),void 0!==T.cameraPoseSubscription&&(T.cameraPoseSubscription.unsubscribe(),T.cameraPoseSubscription=void 0)})).then((()=>this.evaluate()))}))})))).then((()=>o.default.getElements(this._container,{cameraViewfinder:'[data-jcs-element="camera__viewfinder"]',hintAnimationContainer:'[data-jcs-element="animation__viewfinder"]',animationContainer:'[data-jcs-element="animation__container"]',animationTitle:'[data-jcs-element="animation__title"]',animationText:'[data-jcs-element="animation__text"]',livenessStart:'[data-jcs-element="retina__start"]',startContainerOverlay:'[data-jcs-element="liveness__start__button__container__overlay"]',startContainerButton:'[data-jcs-element="liveness__start__button__container__button"]'}))).then((({cameraViewfinder:e,hintAnimationContainer:t,animationContainer:a,animationTitle:n,animationText:o,livenessStart:r,startContainerOverlay:s,startContainerButton:l})=>{a instanceof HTMLDivElement&&n instanceof HTMLParagraphElement&&o instanceof HTMLParagraphElement&&(T.cameraPoseSubscription=i.default.subscribe(c.JourneyEvent.CAMERA_POSE,(e=>{T.updateAnimation.call(this,a,n,o,e)}))),s instanceof HTMLDivElement&&l instanceof HTMLDivElement&&t instanceof HTMLDivElement&&e instanceof HTMLCanvasElement&&i.default.subscribe(c.JourneyEvent.CAMERA_CANVAS_RESIZE,(()=>{T.handleCameraSelectedChange.call(this,t,s,l,e),f.default.showObject(s),f.default.showObject(l)})),r instanceof HTMLElement&&r.addEventListener("click",(()=>{f.default.hideObject(s),f.default.hideObject(l),f.default.showObject(t,"flex")}))})).then((()=>i.default.publish(c.JourneyEvent.DISPLAY_STEP,{step:u.Templates.Liveness})))}static handleCameraSelectedChange(e,t,a,n){try{e.style.height=`${n.clientHeight}px`,e.style.width=`${n.clientWidth}px`,t.style.height=`${n.clientHeight}px`,t.style.width=`${n.clientWidth}px`,a.style.height=`${n.clientHeight}px`,a.style.width=`${n.clientWidth}px`}catch(e){}}static updateAnimation(e,t,a,n){try{switch(void 0!==T.livenessAnimation&&null!==T.livenessAnimation&&(T.livenessAnimation.stop(),T.livenessAnimation.destroy(),T.livenessAnimation=void 0),n.pose){case"Look Straight":f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_STRAIGHT_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_STRAIGHT_TEXT));break;case"Smile":f.default.setText(e,""),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/smile.json",!0,!0,{}),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_SMILE_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_SMILE_TEXT));break;case"Frown":f.default.setText(e,""),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/frown.json",!0,!0,{}),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_FROWN_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_FROWN_TEXT));break;case"Tilt Left":f.default.setText(e,""),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/look-left.json",!0,!0,{}),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_LEFT_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_LEFT_TEXT));break;case"Tilt Right":f.default.setText(e,""),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_RIGHT_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_RIGHT_TEXT)),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/look-right.json",!0,!0,{});break;case"Tilt Up":f.default.setText(e,""),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_UP_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_UP_TEXT)),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/look-up.json",!0,!0,{});break;case"Tilt Down":f.default.setText(e,""),f.default.setText(t,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_DOWN_TITLE)),f.default.setText(a,h.default.getTranslation(p.TranslationKey.LIVENESS_ACTION_LOOK_DOWN_TEXT)),T.livenessAnimation=E.AnimationService.CreateAnimation(e,this.assetsFolder+"/animations/look-down.json",!0,!0,{})}}catch(e){}}}t.LivenessStep=T,T.parseResponseData=({entryData:e,entryDateTime:t,journeyId:a,requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})=>({journeyId:a,journeyReference:e.scanReference,documents:(e.documents||[]).map((a=>(0,_.removeNullOrUndefined)({expirationDate:a.expirationDate,issueDate:a.issueDate,issueNumber:a.issueNumber,number:a.number,type:a.type,blurCheck:"Good"===e.blurCheck,glareCheck:"Good"===e.blurCheck,lowResolutionCheck:"Good"===e.lowResolutionCheck,scanReference:e.scanReference,scannerIp:e.scannerIp,dateTime:t?new Date(t):void 0}))),requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})},5827:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TermsAndConditionsStep=void 0;const n=a(2538),i=a(7993),o=a(2930),r=a(7338),s=a(192),l=a(1371),d=a(642),c=a(4635),u=a(6871),_=a(6202);class m{static render(){return s.default.renderToContainer(this._container,c.Templates.TermsAndConditions).then((e=>s.default.getElements(e,{termsAndConditionsModal:'[data-jcs-element="terms__and__conditions__container"]',termsAndConditionsTickBox1:'[data-jcs-element="terms__and__conditions__tickbox1"]',termsAndConditionsTickBox1Text:'[data-jcs-element="terms__and__conditions__tickbox1text"]',termsAndConditionsTickBox2:'[data-jcs-element="terms__and__conditions__tickbox2"]',termsAndConditionsTickBox2Text:'[data-jcs-element="terms__and__conditions__tickbox2text"]',termsAndConditionsModalAgree:'[data-jcs-element="terms__and__conditions__modal__agree"',termsAndConditionsModalDisagree:'[data-jcs-element="terms__and__conditions__modal__disagree"',termsAndConditionsModalText:'[data-jcs-element="terms__and__conditions__text"]'}))).then((({termsAndConditionsModal:e,termsAndConditionsTickBox1:t,termsAndConditionsTickBox1Text:a,termsAndConditionsTickBox2:n,termsAndConditionsTickBox2Text:o,termsAndConditionsModalAgree:s,termsAndConditionsModalDisagree:d,termsAndConditionsModalText:c})=>{if(!(e instanceof HTMLElement&&t instanceof HTMLInputElement&&a instanceof HTMLLabelElement&&n instanceof HTMLInputElement&&o instanceof HTMLLabelElement&&s instanceof HTMLElement&&d instanceof HTMLElement&&c instanceof HTMLElement))throw i.ExceptionManager.process(new i.ExceptionManager.TemplateException(u.TranslationKey.EXCEPTION_TEMPLATE_ELEMENTS_MISSING));r.default.hideObject(e),this._isPredefinedJourney?(r.default.showObject(e),m.getTermsAndConditionsTextFromUrl(c),r.default.hideObject(t),r.default.hideObject(a),r.default.hideObject(n),r.default.hideObject(o)):m.getTermsAndConditionsConfigsFromBackend(this,e,c,t,a,n,o),s.addEventListener("click",(()=>{(this._isPredefinedJourney||t.checked&&n.checked)&&(r.default.hideObject(e),this._isTCCAccepted=!0,this.evaluate(!1,this._isPredefinedJourney))})),d.addEventListener("click",(()=>{r.default.hideObject(e),this._journey.cancel(l.HighLevelResult.TCCDisagree),this.evaluate()}))})).then((()=>n.default.publish(d.JourneyEvent.DISPLAY_STEP,{step:c.Templates.TermsAndConditions})))}static getTermsAndConditionsTextFromUrl(e){o.default.get("https://www.gbgplc.com/gbgidentifyappprivacypolicy.html",{headers:{Accept:"text/html"}}).then((t=>{e.innerHTML=t}))}static getTermsAndConditionsConfigsFromBackend(e,t,a,n,i,s,l){o.default.get(_.ENDPOINTS.getTCCConfigs).then((o=>{!1===o.ConsentCaptureEnabled?(r.default.hideObject(t),e._isTCCAccepted=!0,e.evaluate(void 0,!1,!0)):r.default.showObject(t),!1===o.TCCTickBox1Enabled&&(n.checked=!0,r.default.hideObject(n),r.default.hideObject(i)),!1===o.TCCTickBox2Enabled&&(s.checked=!0,r.default.hideObject(s),r.default.hideObject(l)),a.innerHTML=o.TCCText,i.innerHTML=o.TCCTickBox1Text,l.innerHTML=o.TCCTickBox2Text}))}}t.TermsAndConditionsStep=m},6260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6370:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6453:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6920:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7016:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GatewayStep=void 0;const n=a(3123),i=a(2538),o=a(7338),r=a(192),s=a(7749),l=a(8829),d=a(642),c=a(4635),u=a(4487),_=a(8784),m=a(7791),h=a(8723),f=a(7884),p=a(1216),E=a(6871),T=a(6489);class C{static render(e=!1,t=!1,a=l.InputProvider.NONE){return r.default.renderToContainer(this._container,c.Templates.Gateway).then((()=>C.getInputProvider.call(this,t,a))).then((e=>this.changeInputProvider(e))).then((a=>void 0!==this._cropResponse?m.CropperProvider.render.call(this):a===l.InputProvider.FILESYSTEM&&void 0===this._cropResponse?h.FileSystemProvider.render.call(this):a===l.InputProvider.SMART_CAPTURE&&void 0===this._cropResponse?T.isIOS&&(T.isSafari||T.isChrome)?navigator.mediaDevices.getUserMedia({video:!0}).then((a=>_.SmartCaptureProvider.render.call(this,e,t)),(e=>{if(!t)return this.changeInputProvider(l.InputProvider.FILESYSTEM,l.ChangeMode.FORCE).then((()=>C.getInputProvider.call(this,t).then((()=>h.FileSystemProvider.render.call(this)))))})):Promise.all([n.default.getCameraPermission(),n.default.hasDeviceCapableOfResolution()]).then((([a,i])=>{var o;return a!=n.CameraPermissionState.GRANTED&&a!=n.CameraPermissionState.UNKNOWN||!i?t?void r.default.renderToContainer(this._container,c.Templates.HasNoCamera):this.changeInputProvider(l.InputProvider.FILESYSTEM,l.ChangeMode.FORCE).then((()=>C.getInputProvider.call(this,t).then((()=>h.FileSystemProvider.render.call(this))))):(null===(o=this._config.defaultInputProvider)||void 0===o?void 0:o.toLowerCase())===l.InputProvider.CAMERA.toLowerCase()?u.CameraProvider.render.call(this,e,t):_.SmartCaptureProvider.render.call(this,e,t)})):a===l.InputProvider.CAMERA&&void 0===this._cropResponse?T.isIOS&&(T.isSafari||T.isChrome)?navigator.mediaDevices.getUserMedia({video:!0}).then((a=>u.CameraProvider.render.call(this,e,t)),(e=>{if(!t)return this.changeInputProvider(l.InputProvider.FILESYSTEM,l.ChangeMode.FORCE).then((()=>C.getInputProvider.call(this,t).then((()=>h.FileSystemProvider.render.call(this)))));r.default.renderToContainer(this._container,c.Templates.HasNoCamera)})):Promise.all([n.default.getCameraPermission()]).then((([a])=>a==n.CameraPermissionState.GRANTED||a==n.CameraPermissionState.UNKNOWN?u.CameraProvider.render.call(this,e,t):t?void r.default.renderToContainer(this._container,c.Templates.HasNoCamera):this.changeInputProvider(l.InputProvider.FILESYSTEM,l.ChangeMode.FORCE).then((()=>C.getInputProvider.call(this,t).then((()=>h.FileSystemProvider.render.call(this))))))):a===l.InputProvider.SCANNER&&void 0===this._cropResponse?f.ScannerProvider.render.call(this):Promise.resolve())).then((()=>i.default.publish(d.JourneyEvent.DISPLAY_STEP,{step:c.Templates.Gateway})))}static getInputProvider(e=!1,t=l.InputProvider.NONE){return r.default.getElements(this._container,{uploadToggleButton:'[data-jcs-element="gateway__upload__toggle"]',uploadLabel:'[data-jcs-element="gateway__upload__toggle__upload__label"]',cameraLabel:'[data-jcs-element="gateway__upload__toggle__camera__label"]',cameraStatus:'[data-jcs-element="gateway__camera__status"]'}).then((({uploadToggleButton:a,uploadLabel:i,cameraLabel:r,cameraStatus:d})=>(o.default.hideObject(a),this.requiresCamera()&&Promise.all([n.default.getCameraPermission(),n.default.hasDeviceCapableOfResolution()]).then((([e,t])=>{if(!t)return o.default.setText(d,p.default.getTranslation(E.TranslationKey.EXCEPTION_PLATFORM_CAMERA_NONE_SUITABLE));switch(e){case n.CameraPermissionState.GRANTED:return o.default.hideObject(d);case n.CameraPermissionState.DENIED:case n.CameraPermissionState.PROMPT:return o.default.setText(d,p.default.getTranslation(E.TranslationKey.EXCEPTION_PLATFORM_CAMERA_PERMISSION_DENIED));default:return o.default.setText(d,p.default.getTranslation(E.TranslationKey.EXCEPTION_PLATFORM_CAMERA_PERMISSION_UNAVAILABLE))}})),!0===this._ready&&this._journey?this._journey.action!==s.FlowState.SELFIE&&this._journey.action!==s.FlowState.ADDRESS&&this._journey.action!==s.FlowState.COVIDPASS||e?this._providers.indexOf(l.InputProvider.SCANNER)>=0&&(this._journey.action===s.FlowState.IDENTITY_FRONT||this._journey.action===s.FlowState.IDENTITY_BACK)?l.InputProvider.SCANNER:this._providers.indexOf(l.InputProvider.CAMERA)>=0||this._providers.indexOf(l.InputProvider.SMART_CAPTURE)>=0||e?this._journey.action===s.FlowState.NONE||e?this._inputProvider!==l.InputProvider.SMART_CAPTURE&&this._inputProvider!==l.InputProvider.CAMERA||!e||t===l.InputProvider.NONE?this._providers[0]:t:(o.default.showObject(a),a instanceof HTMLButtonElement&&i instanceof HTMLElement&&r instanceof HTMLElement?(void 0!==this._inputProvider&&this._inputProvider!==l.InputProvider.SCANNER||(this._inputProvider=l.InputProvider.FILESYSTEM),C.toggleFileUpload=this._inputProvider!==l.InputProvider.FILESYSTEM,C.toggleUploadLabel.call(this,C.toggleFileUpload,i,a,r),a.addEventListener("click",(()=>{C.toggleFileUpload=!C.toggleFileUpload,C.toggleUploadLabel.call(this,C.toggleFileUpload,i,a,r),this._inputProvider=C.toggleFileUpload?this._providers[0]:l.InputProvider.FILESYSTEM,this._inputProvider!==l.InputProvider.CAMERA&&this._inputProvider!==l.InputProvider.SMART_CAPTURE&&n.default.stopStreaming(),this.evaluate()})),C.toggleFileUpload?this._inputProvider:l.InputProvider.FILESYSTEM):this._inputProvider?this._inputProvider:l.InputProvider.FILESYSTEM):l.InputProvider.FILESYSTEM:(o.default.showObject(a),a instanceof HTMLButtonElement&&i instanceof HTMLElement&&r instanceof HTMLElement?(void 0===this._inputProvider?this._inputProvider=l.InputProvider.FILESYSTEM:this._inputProvider!==l.InputProvider.SMART_CAPTURE&&this._inputProvider!==l.InputProvider.SCANNER||(this._inputProvider=l.InputProvider.CAMERA),C.toggleFileUpload=this._inputProvider!==l.InputProvider.FILESYSTEM&&!e,C.toggleUploadLabel.call(this,C.toggleFileUpload,i,a,r),a.addEventListener("click",(()=>{C.toggleFileUpload=!C.toggleFileUpload,C.toggleUploadLabel.call(this,C.toggleFileUpload,i,a,r),this._inputProvider=C.toggleFileUpload?this._providers[0]:l.InputProvider.FILESYSTEM,this._inputProvider!==l.InputProvider.CAMERA&&this._inputProvider!==l.InputProvider.SMART_CAPTURE&&n.default.stopStreaming(),this.evaluate()})),C.toggleFileUpload?this._inputProvider:l.InputProvider.FILESYSTEM):void 0===this._inputProvider||this._inputProvider===l.InputProvider.SCANNER?l.InputProvider.FILESYSTEM:this._inputProvider===l.InputProvider.SMART_CAPTURE?l.InputProvider.CAMERA:this._inputProvider):l.InputProvider.NONE)))}static toggleUploadLabel(e,t,a,i){e?(o.default.hideObject(i),1==this._config.fileUploadOnCameraCaptureJourneys?(o.default.showObject(t),o.default.showObject(a)):(o.default.hideObject(t),o.default.hideObject(a))):(o.default.hideObject(t),n.default.getVideoCameras(),Promise.all([n.default.getCameraPermission(),n.default.hasDeviceCapableOfResolution()]).then((([e,t])=>{e&&t?o.default.showObject(i):o.default.hideObject(i)})))}}t.GatewayStep=C,C.toggleFileUpload=!1},7303:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7480:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7791:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CropperProvider=void 0;const n=a(1e3),i=a(2538),o=a(1216),r=a(7338),s=a(192),l=a(2745),d=a(4145),c=a(642),u=a(4898),_=a(4635),m=a(6871);class h{static render(){return s.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>s.default.renderToContainer(e,_.Templates.Cropper))).then((()=>s.default.getElements(this._container,{toggle:'[data-jcs-element="gateway__upload__toggle"]',toggleLabel:'[data-jcs-element="gateway__upload__toggle__label"]',cropper:'[data-jcs-element="cropper__canvas"]',cropperSubmit:'[data-jcs-element="cropper__submit"]',cropperReset:'[data-jcs-element="cropper__retry"]',status:'[data-jcs-element="cropper__status"]',statusMessage:'[data-jcs-element="cropper__status__message"]'}))).then((({cropper:e,cropperSubmit:t,cropperReset:a,status:i,statusMessage:s,toggle:l,toggleLabel:c})=>{if(e&&void 0!==this._cropResponse){e.id="jcs__cropper__canvas",r.default.hideObject(l),r.default.hideObject(c);const _=new n.Croppy({imageSrc:"data:image/jpeg;base64,"+this._cropResponse.outputImage,magnifierCanvasId:"magnifier",padding:20,showCornersAlways:!0,targetCanvasId:`${e.id}`});t instanceof HTMLElement&&t.addEventListener("click",(()=>{r.default.setEnabled(t,!1),r.default.setEnabled(a,!1),r.default.showObject(i),r.default.setText(s,o.default.getTranslation(m.TranslationKey.CROPPER_UPLOADING)),this.getJourney().then((e=>e.continue({imgId:this._cropResponse.id||"",imgList:[{data:this._cropResponse.outputImage,name:"SELFIE"===this._journey.action?u.RequiredInputImage.SelfiePhoto:u.RequiredInputImage.WhiteImage,inputFormat:0}],coordinates:_.getOriginalSelectionAreaPoints().points,journeyDefinitionId:this._journeyDefinitionId}))).then((e=>d.default.getDataStore(d.DataStoreType.ID_SCAN).update(h.parseResponseData(e)))).then((()=>{this._cropResponse=void 0,this.evaluate()})).catch((()=>{r.default.showObject(i),r.default.setText(s,o.default.getTranslation(m.TranslationKey.EXCEPTION_NETWORK))})).then((()=>{r.default.setEnabled(t,!0),r.default.setEnabled(a,!0)}))})),a instanceof HTMLElement&&a.addEventListener("click",(()=>{this._cropResponse=void 0,this.evaluate()})),_.init(this._cropResponse.isDetected?this._cropResponse.coordinates:[],!0)}})).then((()=>i.default.publish(c.JourneyEvent.DISPLAY_PROVIDER,{provider:_.Templates.Cropper})))}}t.CropperProvider=h,h.parseResponseData=({entryData:e,entryDateTime:t,journeyId:a,requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})=>({journeyId:a,documents:(e.documents||[]).map((a=>(0,l.removeNullOrUndefined)({expirationDate:a.expirationDate,issueDate:a.issueDate,issueNumber:a.issueNumber,number:a.number,type:a.type,blurCheck:"Good"===e.blurCheck,glareCheck:"Good"===e.blurCheck,lowResolutionCheck:"Good"===e.lowResolutionCheck,scanReference:e.scanReference,scannerIp:e.scannerIp,dateTime:t?new Date(t):void 0}))),person:(0,l.removeNullOrUndefined)({address:{city:e.holder.address.city,full:e.holder.address.full,postCode:e.holder.address.postCode},birthDate:e.holder.birthDate,birthPlace:e.holder.birthPlace,firstName:e.holder.firstName,fullName:e.holder.fullName,middleName:e.holder.middleName,lastName:e.holder.lastName,gender:e.holder.gender}),requiredAction:n,highLevelResult:i,currentResult:o,hasError:r,isFinished:s})},7884:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScannerProvider=void 0;const n=a(8414),i=a(2538),o=a(2930),r=a(1216),s=a(7338),l=a(577),d=a(192),c=a(4145),u=a(642),_=a(7918),m=a(4635),h=a(6871),f=a(8740),p=a(1371);class E{static render(){return d.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>d.default.renderToContainer(e,m.Templates.Scanner))).then((e=>d.default.getElements(e,{action:'[data-jcs-element="scanner__action"]',scannerAnimationContainer:'[data-jcs-element="scanner__animation"]',loadingAnimationContainer:'[data-jcs-element="image__processing"]',failureReasonContainer:'[data-jcs-element="failure__reason__section"]'}))).then((({action:e,scannerAnimationContainer:t,loadingAnimationContainer:a,failureReasonContainer:n})=>{void 0!==t&&void 0!==a&&(E.scannerAnimation=f.AnimationService.CreateAnimation(t,this.assetsFolder+"/animations/scan-green.json",!0,!1,{}),E.loadingAnimation=f.AnimationService.CreateAnimation(a,this.assetsFolder+"/animations/loading.json",!0,!1,{}),s.default.hideObject(n),E.loadingAnimation.play()),e instanceof HTMLButtonElement&&(s.default.setEnabled(e,!1),s.default.setText(e,r.default.getTranslation(h.TranslationKey.SCANNER_DESC_LOADING)))})).then((()=>!0!==o.default.auth&&!1!==this._config.auth||!1!==E._socketReady?Promise.resolve():E.startSocket.call(this))).then((()=>i.default.publish(u.JourneyEvent.DISPLAY_PROVIDER,{provider:m.Templates.Scanner})))}static startSocket(){return l.default.initialise().then((()=>{l.default.addListener(l.SocketEvents.UPDATE,E.onSocketUpdate.bind(this)),l.default.addListener(l.SocketEvents.RESULT,E.onSocketResult.bind(this))})).then((()=>l.default.start(this._journeyDefinitionId,void 0!==this._journey?this._journey.id:n.v4()))).then((e=>{E.processMessage.call(this,e),E._socketReady=!0})).catch(console.warn)}static processMessage(e){return!0!==e.connected?e.error===_.ScannerError.IS_LOCKED?E.updateScannerUI.call(this,{actionEvent:_.ScannerAction.REGISTER,actionText:h.TranslationKey.SCANNER_ACTION_REGISTER,titleText:h.TranslationKey.SCANNER_TITLE_BUSY,error:h.TranslationKey.SCANNER_DESC_BUSY}):e.error===_.ScannerError.IS_OFFLINE||e.error===_.ScannerError.IS_RELEASED?E.updateScannerUI.call(this,{actionEvent:_.ScannerAction.REGISTER,actionText:h.TranslationKey.SCANNER_ACTION_REGISTER,titleText:h.TranslationKey.SCANNER_TITLE_OFFLINE,error:h.TranslationKey.SCANNER_DESC_OFFLINE}):E.updateScannerUI.call(this,{actionEvent:_.ScannerAction.REGISTER,actionText:h.TranslationKey.SCANNER_ACTION_REGISTER,titleText:h.TranslationKey.SCANNER_TITLE_NOT_CONNECTED,error:h.TranslationKey.SCANNER_DESC_NOT_CONNECTED}):e.state===_.ScannerState.DISCONNECTED?E.updateScannerUI.call(this,{actionEvent:_.ScannerAction.RELEASE,actionText:h.TranslationKey.SCANNER_ACTION_RELEASE,titleText:h.TranslationKey.SCANNER_TITLE_DISCONNECTED}):e.state===_.ScannerState.CONNECTED?e.scanProcess===_.ScanProcess.SCANNING?E.updateScannerUI.call(this,{titleText:h.TranslationKey.SCANNER_TITLE_SCANNING}):e.scanProcess===_.ScanProcess.PROCESSING?E.updateScannerUI.call(this,{titleText:h.TranslationKey.SCANNER_TITLE_PROCESSING}):E.updateScannerUI.call(this,{actionEvent:_.ScannerAction.RELEASE,actionText:h.TranslationKey.SCANNER_ACTION_RELEASE,titleText:h.TranslationKey.SCANNER_TITLE_AVAILABLE}):Promise.resolve()}static updateScannerUI({titleText:e,actionText:t,actionEvent:a,error:n}){return d.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>d.default.getElements(e,{scannerContainer:'[data-jcs-element="scanner__container"]',action:'[data-jcs-element="scanner__action"]',title:'[data-jcs-element="scanner__box__title"]',errorContainer:'[data-jcs-element="scanner__error"]',errorBusy:'[data-jcs-element="scanner__error__busy"]',errorOffline:'[data-jcs-element="scanner__error__offline"]',scannerAnimation:'[data-jcs-element="scanner__animation"]',imageProcessing:'[data-jcs-element="image__processing"]',errorImage:'[data-jcs-element="error__image"]',successImage:'[data-jcs-element="success__image"]',failureReasonMessage:'[data-jcs-element="failure__reason__message"]',tryAgainMessage:'[data-jcs-element="try__again__message"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',failureReasonContainer:'[data-jcs-element="failure__reason__section"]'}))).then((({scannerContainer:i,title:o,action:d,errorContainer:c,errorBusy:u,errorOffline:m,scannerAnimation:f,imageProcessing:p,errorImage:T,successImage:C,failureReasonMessage:v,tryAgainMessage:g,attemptCountContainer:S,attemptCounter:j,failureReasonContainer:I})=>{if(s.default.setText(o,r.default.getTranslation(e)),s.default.hideObject(C),s.default.hideObject(T),E.scannerAnimation.stop(),n?(s.default.showObject(c),s.default.addClass(i,"error"),s.default.addClass(o,"scanner-error-text"),s.default.addClass(f,"animation-error"),s.default.removeClass(f,"animation-success"),s.default.removeClass(f,"animation-scanning"),s.default.removeClass(o,"scanner-success-text"),s.default.showObject(T),n===h.TranslationKey.SCANNER_DESC_BUSY?(s.default.hideObject(m),s.default.showObject(u)):(s.default.showObject(m),s.default.hideObject(u))):(s.default.hideObject(c),s.default.removeClass(i,"error"),s.default.removeClass(o,"scanner-error-text"),s.default.removeClass(f,"animation-error"),s.default.addClass(o,"scanner-success-text"),s.default.addClass(f,"animation-success"),e===h.TranslationKey.SCANNER_TITLE_SCANNING?E.scannerAnimation.play():E.scannerAnimation.stop()),e===h.TranslationKey.SCANNER_TITLE_AVAILABLE&&s.default.showObject(C),e===h.TranslationKey.SCANNER_TITLE_PROCESSING?(E.loadingAnimation.play(),s.default.hideObject(f),s.default.showObject(p)):(s.default.showObject(f),s.default.hideObject(p)),this._journey)switch(this._journey.actionAttempt){case 2:E.setTriplescanReasonMessages(this._journey.tripleScanReason,v,g,I),s.default.setText(j,"2");break;case 3:E.setTriplescanReasonMessages(this._journey.tripleScanReason,v,g,I),s.default.setText(j,"1");break;default:s.default.hideObject(I),s.default.hideObject(S)}d instanceof HTMLButtonElement&&(t&&a?(s.default.setText(d,r.default.getTranslation(t)),s.default.setEnabled(d,!0),d.removeEventListener("click",(()=>{})),d.addEventListener("click",(()=>{switch(s.default.setEnabled(d,!1),s.default.setText(d,r.default.getTranslation(h.TranslationKey.SCANNER_DESC_LOADING)),a){case _.ScannerAction.RELEASE:l.default.release();case _.ScannerAction.REGISTER:l.default.tryRegistering()}}))):(s.default.setEnabled(d,!1),s.default.setText(d,r.default.getTranslation(h.TranslationKey.SCANNER_DESC_LOADING))))})).catch((()=>{}))}static stopSocket(){return l.default.removeAllListeners(l.SocketEvents.UPDATE),l.default.removeAllListeners(l.SocketEvents.RESULT),l.default.stop().then((e=>{e&&(E._socketReady=!1)}))}static releaseTerminal(){return l.default.resetTerminal().then((e=>{e&&(E._socketReady=!1)}))}static onSocketUpdate(e){E.processMessage.call(this,e).then((()=>i.default.publish(u.JourneyEvent.SCANNER_UPDATE,{process:e.scanProcess,state:e.state}))).catch(console.error)}static onSocketResult(e){return e.entryData={scanReference:e.scanReference,blurCheck:e.entryData["qualityChecks.BlurCheck"],glareCheck:e.entryData["qualityChecks.GlareCheck"],lowResolutionCheck:e.entryData["qualityChecks.LowResolutionCheck"],fullDocumentInViewCheck:e.entryData["qualityChecks.FullDocumentInViewCheck"],tripleScanReason:e.entryData.tripleScanReason},c.default.getDataStore(c.DataStoreType.ID_SCAN).update(E.parseResponseData(e)),"ADDRESSDOCUMENT"!==e.requiredAction&&"SELFIE"!==e.requiredAction&&"LIVENESS"!==e.requiredAction&&"COVIDPASS"!==e.requiredAction&&"DATACHECKS"!==e.requiredAction||E.releaseTerminal.call(this),E.stopSocket.call(this).then((()=>this._journey.bindUpdate(e))).then((()=>i.default.publish(u.JourneyEvent.SCANNER_RESULT,{currentResult:e.currentResult}))).then((()=>this.evaluate())).then(this.updateJourneyFields).catch(console.error)}static setTriplescanReasonMessages(e,t,a,n){switch(s.default.showObject(n),e){case p.HighLevelResult.NotSupported:s.default.setText(t,r.default.getTranslation(h.TranslationKey.FAILURE_REASON_NOT_SUPPORTED)),s.default.setText(a,r.default.getTranslation(h.TranslationKey.PLEASE_TRY_AGAIN_NOT_SUPPORTED));break;case p.HighLevelResult.Refer:s.default.setText(t,r.default.getTranslation(h.TranslationKey.FAILURE_REASON_REFER)),s.default.setText(a,r.default.getTranslation(h.TranslationKey.PLEASE_TRY_AGAIN_REFER));break;case p.HighLevelResult.NotAccepted:s.default.setText(t,r.default.getTranslation(h.TranslationKey.FAILURE_REASON_NOT_ACCEPTED)),s.default.setText(a,r.default.getTranslation(h.TranslationKey.PLEASE_TRY_AGAIN_NOT_ACCEPTED));break;case p.HighLevelResult.Expired:s.default.setText(t,r.default.getTranslation(h.TranslationKey.FAILURE_REASON_EXPIRED)),s.default.setText(a,r.default.getTranslation(h.TranslationKey.PLEASE_TRY_AGAIN_EXPIRED));break;default:s.default.setText(t,r.default.getTranslation(h.TranslationKey.FAILURE_REASON_NOT_SUPPORTED)),s.default.setText(a,r.default.getTranslation(h.TranslationKey.PLEASE_TRY_AGAIN_NOT_SUPPORTED))}}}t.ScannerProvider=E,E._socketReady=!1,E.parseResponseData=({currentResult:e,highLevelResult:t,documentType:a,requiredAction:n,scanReference:i,entryData:o,isFinished:r})=>({documents:[{type:a,scanReference:i}],blurCheck:o.blurCheck,glareCheck:o.glareCheck,lowResolutionCheck:o.lowResolutionCheck,fullDocumentInViewCheck:o.fullDocumentInViewCheck,tripleScanReason:o.tripleScanReason,requiredAction:n,highLevelResult:t,currentResult:e,isFinished:r})},8163:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8304:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8321:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8538:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8723:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemProvider=void 0;const i=a(2538),o=a(7338),r=a(192),s=a(1431),l=a(642),d=a(4635),c=a(1779),u=a(7749),_=a(885),m=a(4898),h=a(4145),f=a(1216),p=a(3272),E=a(9387),T=a(8829);class C{static render(e=!1){return r.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>r.default.renderToContainer(e,d.Templates.Filesystem))).then((e=>r.default.getElements(e,{fileUploadButton:'[data-jcs-element="file__input__Button"]',fileInput:'[data-jcs-element="file__input"]',dropbox:'[data-jcs-element="file__drop__box"]',fileTooLargeError:'[data-jcs-element="file__too__large__error"]',invalidFileFormatError:'[data-jcs-element="invalid__format__error"]',openPreviewInfoId:'[data-jcs-element="preview__page__open__info__id"]',openPreviewInfoFM:'[data-jcs-element="preview__page__open__info__fm"]',openPreviewInfoPOA:'[data-jcs-element="preview__page__open__info__poa"]',openPreviewInfoCovid:'[data-jcs-element="preview__page__open__info__covid"]',previewInfoContainerId:'[data-jcs-element="preview__info__container__id"]',previewInfoContainerFM:'[data-jcs-element="preview__info__container__fm"]',previewInfoContainerPOA:'[data-jcs-element="preview__info__container__poa"]',previewInfoContainerCovid:'[data-jcs-element="preview__info__container__covid"]',closePreviewInfoId:'[data-jcs-element="preview__page__close__info__id"]',closePreviewInfoFM:'[data-jcs-element="preview__page__close__info__fm"]',closePreviewInfoPOA:'[data-jcs-element="preview__page__close__info__poa"]',closePreviewInfoCovid:'[data-jcs-element="preview__page__close__info__covid"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',idDocumentContainer:'[data-jcs-element="identity__document__file__upload"]',facematchContainer:'[data-jcs-element="facematch__file__upload"]',addressContainer:'[data-jcs-element="address__file__upload"]',covidContainer:'[data-jcs-element="covid__file__upload"]',uploading:'[data-jcs-element="uploading__file__without__preview"]',supportedTypes:'[data-jcs-element="supported__types"]',supportedTypesSelfie:'[data-jcs-element="supported__types__selfie"]',action:'[data-jcs-element="info__journey__action"]'}))).then((({fileUploadButton:t,fileInput:a,dropbox:n,fileTooLargeError:i,invalidFileFormatError:r,openPreviewInfoId:s,openPreviewInfoFM:l,openPreviewInfoPOA:d,openPreviewInfoCovid:c,previewInfoContainerId:_,previewInfoContainerFM:m,previewInfoContainerPOA:h,previewInfoContainerCovid:v,closePreviewInfoId:g,closePreviewInfoFM:S,closePreviewInfoPOA:j,closePreviewInfoCovid:I,attemptCountContainer:A,attemptCounter:b,idDocumentContainer:y,facematchContainer:O,addressContainer:w,covidContainer:L,uploading:R,supportedTypes:P,supportedTypesSelfie:N,action:D})=>{if(o.default.hideObject(_),o.default.hideObject(m),o.default.hideObject(h),o.default.hideObject(v),o.default.hideObject(g),o.default.hideObject(S),o.default.hideObject(j),o.default.hideObject(I),o.default.hideObject(y),o.default.hideObject(O),o.default.hideObject(w),o.default.hideObject(L),o.default.hideObject(R),o.default.hideObject(P),o.default.hideObject(N),o.default.hideObject(n),this._journey){if(!(this._journey.actionAttempt>1&&this._config.tripleScanGuidancePage)||this._journey.action!==u.FlowState.IDENTITY_BACK&&this._journey.action!==u.FlowState.IDENTITY_FRONT||e||this._retry)switch(e=!1,o.default.showObject(n),this._journey.action){case u.FlowState.SELFIE:o.default.showObject(O),o.default.showObject(N);break;case u.FlowState.IDENTITY_BACK:case u.FlowState.IDENTITY_FRONT:o.default.showObject(y),o.default.showObject(P),o.default.setText(D,f.default.getTranslation(`FLOW_STATE_${this._journey.action}`));break;case u.FlowState.ADDRESS:o.default.showObject(w),o.default.showObject(P);break;case u.FlowState.COVIDPASS:o.default.showObject(L),o.default.showObject(P)}else E.TripleScanGuidanceProvider.render.call(this,T.InputProvider.FILESYSTEM);switch(this._journey.actionAttempt){case 2:o.default.setText(b,"2");break;case 3:o.default.setText(b,"1");break;default:o.default.hideObject(A)}this._retry=!1}if(s instanceof HTMLElement&&s.addEventListener("click",(()=>{o.default.showObject(_),o.default.showObject(g),o.default.hideObject(s)})),l instanceof HTMLElement&&l.addEventListener("click",(()=>{o.default.showObject(m),o.default.showObject(S),o.default.hideObject(l)})),d instanceof HTMLElement&&d.addEventListener("click",(()=>{o.default.showObject(h),o.default.showObject(j),o.default.hideObject(d)})),c instanceof HTMLElement&&c.addEventListener("click",(()=>{o.default.showObject(v),o.default.showObject(I),o.default.hideObject(c)})),g instanceof HTMLElement&&g.addEventListener("click",(()=>{o.default.hideObject(_),o.default.hideObject(g),o.default.showObject(s)})),S instanceof HTMLElement&&S.addEventListener("click",(()=>{o.default.hideObject(m),o.default.hideObject(S),o.default.showObject(l)})),j instanceof HTMLElement&&j.addEventListener("click",(()=>{o.default.hideObject(h),o.default.hideObject(j),o.default.showObject(d)})),I instanceof HTMLElement&&I.addEventListener("click",(()=>{o.default.hideObject(v),o.default.hideObject(j),o.default.showObject(c)})),a instanceof HTMLInputElement){if(t instanceof HTMLElement&&t.addEventListener("click",(()=>{const e=new MouseEvent("click");a.dispatchEvent(e)})),this._journey.action===u.FlowState.SELFIE)a.accept=(0,p.removeItems)(this.getAllowedFileFormats(),"application/pdf").join(", ");else a.accept=this.getAllowedFileFormats().join(", ");a.addEventListener("change",C.fileSelectHandler.bind(this),!1)}o.default.hideObject(i),o.default.hideObject(r),n&&o.default.supportsDragDrop()&&(n.addEventListener("dragover",C.fileDragHover.bind(this),!1),n.addEventListener("dragleave",C.fileDragHover.bind(this),!1),n.addEventListener("drop",C.fileDropHandler.bind(this),!1))})).then((()=>i.default.publish(l.JourneyEvent.DISPLAY_PROVIDER,{provider:d.Templates.Filesystem})))}static continueJourney(e,t){if(void 0!==this._journey)switch(this._journey.action){case u.FlowState.IDENTITY_BACK:case u.FlowState.IDENTITY_FRONT:case u.FlowState.ADDRESS:case u.FlowState.SELFIE:case u.FlowState.COVIDPASS:return c.ImageProvider.render.call(this,e,t)}}static continueJourneySkipPreview(e,t){const{type:a}=_.ImageService.getBase64Components(e);return this.assertImageExists(e).then((()=>this.getJourney())).then((n=>n.continue({imgList:[Object.assign(Object.assign({},_.ImageService.remapNames(_.ImageService.getBase64Components(e))),{name:"SELFIE"===n.action?m.RequiredInputImage.SelfiePhoto:m.RequiredInputImage.WhiteImage,inputFormat:"pdf"===a?1:0})],journeyDefinitionId:this._journeyDefinitionId},t).then((e=>h.default.getDataStore(h.DataStoreType.ID_SCAN).update(c.ImageProvider.parseResponseData(e)))).then((()=>this.evaluate)).then(this.updateJourneyFields)))}static fileDragHover(e){e.stopPropagation(),e.preventDefault(),r.default.getElements(this._container,{fileDropBox:'[data-jcs-element="file__drop__box"]'}).then((({fileDropBox:t})=>{"dragover"===e.type?o.default.addClass(t,"dragover"):o.default.removeClass(t,"dragover")}))}static fileDropHandler(e){return n(this,void 0,void 0,(function*(){C.fileDragHover.call(this,e);const[t]=Array.from(e.dataTransfer?e.dataTransfer.files:[]),a=[];if(!(yield C.checkAndShowErrors(this,this._container,t)))return r.default.getElements(this._container,{uploading:'[data-jcs-element="uploading__file__without__preview"]'}).then((({uploading:e})=>{if("application/pdf"!==t.type||this._journey.action==u.FlowState.SELFIE)return s.default.toBase64(t).then((e=>C.continueJourney.call(this,e,a))).then((()=>this.updateJourneyFields()));o.default.showObject(e),C.skipPreviewAndUpload.call(this,t,a).then((()=>o.default.hideObject(e)))}))}))}static fileSelectHandler(e){return n(this,void 0,void 0,(function*(){const[t]=Array.from(e.currentTarget.files||[]),a=[];if(!(yield C.checkAndShowErrors(this,this._container,t)))return r.default.getElements(this._container,{uploading:'[data-jcs-element="uploading__file__without__preview"]'}).then((({uploading:e})=>{if("application/pdf"!==t.type||this._journey.action==u.FlowState.SELFIE)return i.default.publish(l.JourneyEvent.DISPLAY_INFO,{fileName:t.name,fileSize:t.size,fileType:t.type}),s.default.toBase64(t).then((e=>C.continueJourney.call(this,e,a))).then((()=>this.updateJourneyFields()));o.default.showObject(e),C.skipPreviewAndUpload.call(this,t,a).then((()=>o.default.hideObject(e)))}))}))}static skipPreviewAndUpload(e,t){return n(this,void 0,void 0,(function*(){const a=yield s.default.toBase64(e);return this.assertImageExists(a).then((()=>this.getJourney())).then((e=>e.continue({imgList:[Object.assign(Object.assign({},_.ImageService.remapNames(_.ImageService.getBase64Components(a))),{name:"SELFIE"===e.action?m.RequiredInputImage.SelfiePhoto:m.RequiredInputImage.WhiteImage,inputFormat:1})],journeyDefinitionId:this._journeyDefinitionId},t).then((e=>h.default.getDataStore(h.DataStoreType.ID_SCAN).update(c.ImageProvider.parseResponseData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields)))}))}static checkAndShowErrors(e,t,a){return r.default.getElements(t,{fileTooLargeError:'[data-jcs-element="file__too__large__error"]',invalidFileFormatError:'[data-jcs-element="invalid__format__error"]',dropbox:'[data-jcs-element="file__drop__box"]'}).then((({fileTooLargeError:t,invalidFileFormatError:n,dropbox:i})=>!a||(o.default.hideObject(n),o.default.hideObject(t),e.getAllowedFileFormats().indexOf(a.type)<0?(o.default.showObject(n),o.default.addClass(i,"error"),!0):a.size>7864320&&(o.default.showObject(t),o.default.addClass(i,"error"),!0))))}}t.FileSystemProvider=C},8784:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,s)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SmartCaptureProvider=void 0;const i=a(3123),o=a(2538),r=a(885),s=a(1216),l=a(7338),d=a(192),c=a(689),u=a(2072),_=a(8137),m=a(8829),h=a(642),f=a(4635),p=a(6871),E=a(1779),T=(a(9891),a(7749)),C=a(4820),v=a(7711),g=a(4898),S=a(4145),j=a(8740),I=a(9387);class A{static render(e=!1,t=!1){const{recaptureDelay:a=5,workerScriptUrl:r="./ides-micro.js",asmScriptUrl:E="./idesmicro_asm.js",timeout:C=6e4,timeLogsEnabled:g=!0,autoStart:S=!1}=this._config.smartCapture||{};return d.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>d.default.renderToContainer(e,f.Templates.SmartCapture))).then((()=>d.default.getElements(this._container,{cameraStatus:'[data-jcs-element="camera__status"]',cameraCapture:'[data-jcs-element="camera__capture"]',cameraViewfinder:'[data-jcs-element="camera__viewfinder"]',cameraViewfinderInnerContainer:'[data-jcs-element="camera__viewfinder__inner__container"]',cameraSelect:'[data-jcs-element="camera__select"]',errorImg:'[data-jcs-element="canvas__condition__error"]',alignment:'[data-jcs-element="camera__condition__alignment"]',blur:'[data-jcs-element="camera__condition__blur"]',uploading:'[data-jcs-element="camera__condition__uploading"]',glare:'[data-jcs-element="camera__condition__glare"]',lowResolution:'[data-jcs-element="camera__condition__low__resolution"]',actionContainer:'[data-jcs-element="info__journey__action__container"]',actionText:'[data-jcs-element="info__journey__action__text"]',hintAnimationContainer:'[data-jcs-element="animation__viewfinder"]',cameraOverlay:'[data-jcs-element="overlay_viewfinder"]',loadingAnimationContainer:'[data-jcs-element="loading-animation"]',verifyingAnimation:'[data-jcs-element="verifying__title"]',manualCaptureButton:'[data-jcs-element="camera__manual__capture"]',modalManualCaptureButton:'[data-jcs-element="capture__modal__camera__manual__capture"]',modalManualCaptureText:'[data-jcs-element="capture__modal__manual__capture__text"]',manualCaptureCheck:'[data-jcs-element="camera__manual__capture__check"]',modalManualCaptureCheck:'[data-jcs-element="capture__modal__camera__manual__capture__check"]',closeHelp:'[data-jcs-element="smart__capture__close__help"]',openHelp:'[data-jcs-element="smart__capture__open__help"]',helpContainer:'[data-jcs-element="capture__help__container"]',modalClose:'[data-jcs-element="smart__capture__modal__close__help"]',modalGlareContainer:'[data-jcs-element="modal__glare__animation__container"]',modalLowResContainer:'[data-jcs-element="modal__low__res__animation__container"]',modalBlurContainer:'[data-jcs-element="modal__blur__animation__container"]',cameraConditionsContainer:'[data-jcs-element="camera__conditions"]',conditionDetailContainer:'[data-jcs-element="camera__condition__detail"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',cameraCaptureHint:'[data-jcs-element="camera__capture__hint"]'}))).then((({cameraStatus:d,cameraCapture:f,cameraViewfinder:S,cameraViewfinderInnerContainer:b,cameraSelect:y,errorImg:O,alignment:w,blur:L,uploading:R,glare:P,lowResolution:N,actionContainer:D,actionText:M,hintAnimationContainer:k,cameraOverlay:F,loadingAnimationContainer:x,verifyingAnimation:H,manualCaptureButton:K,modalManualCaptureButton:U,modalManualCaptureText:G,manualCaptureCheck:B,modalManualCaptureCheck:V,closeHelp:J,openHelp:Y,helpContainer:q,modalClose:W,modalGlareContainer:X,modalLowResContainer:z,modalBlurContainer:$,cameraConditionsContainer:Q,conditionDetailContainer:Z,attemptCountContainer:ee,attemptCounter:te,cameraCaptureHint:ae})=>{var ne;if(l.default.hideObject(y),l.default.hideObject(O),l.default.hideObject(w),l.default.hideObject(L),l.default.hideObject(R),l.default.hideObject(P),l.default.hideObject(N),l.default.hideObject(D),l.default.hideObject(k),l.default.hideObject(K),l.default.hideObject(q),l.default.hideObject(J),l.default.hideObject(U),l.default.hideObject(G),l.default.hideObject(Q),l.default.hideObject(x),l.default.hideObject(H),(null===(ne=this._config.smartCapture)||void 0===ne?void 0:ne.autoStart)&&l.default.hideObject(f),A.loadingAnimation=j.AnimationService.CreateAnimation(x,this.assetsFolder+"/animations/loading.json",!0,!0,{}),l.default.setEnabled(f,!1),l.default.setEnabled(y,!1),this._journey)if(this._journey.actionAttempt>1&&this._config.tripleScanGuidancePage&&(this._journey.action===T.FlowState.IDENTITY_BACK||this._journey.action===T.FlowState.IDENTITY_FRONT)&&!e)I.TripleScanGuidanceProvider.render.call(this,m.InputProvider.SMART_CAPTURE);else{switch(e=!1,this._journey.actionAttempt){case 2:l.default.setText(te,"2");break;case 3:l.default.setText(te,"1");break;default:l.default.hideObject(ee)}this._journey.action===T.FlowState.IDENTITY_FRONT&&l.default.setText(M,s.default.getTranslation(p.TranslationKey.CAMERA_CAPTURE_FRONT)),this._journey.action===T.FlowState.IDENTITY_BACK&&l.default.setText(M,s.default.getTranslation(p.TranslationKey.CAMERA_CAPTURE_BACK))}return B instanceof HTMLInputElement&&B.addEventListener("change",(()=>n(this,void 0,void 0,(function*(){A.smartCaptureCancel(v.SmartCaptureFailingReasons.ManualInputProviderChange),this._inputProvider=B.checked?m.InputProvider.CAMERA:m.InputProvider.SMART_CAPTURE,yield i.default.stopStreaming(),yield this.evaluate(!0,t,this._inputProvider)})))),V instanceof HTMLInputElement&&V.addEventListener("change",(()=>n(this,void 0,void 0,(function*(){A.smartCaptureCancel(v.SmartCaptureFailingReasons.ManualInputProviderChange),this._inputProvider=V.checked?m.InputProvider.CAMERA:m.InputProvider.SMART_CAPTURE,yield i.default.stopStreaming(),yield this.evaluate(!0,t,this._inputProvider)})))),Y instanceof HTMLElement&&Y.addEventListener("click",(()=>{l.default.showObject(q),l.default.showObject(J),l.default.hideObject(Y),A.glareAnimation=j.AnimationService.CreateAnimation(X,this.assetsFolder+"/animations/glare.json",!0,!0,{}),A.blurAnimation=j.AnimationService.CreateAnimation($,this.assetsFolder+"/animations/blur.json",!0,!0,{}),A.lowResAnimation=j.AnimationService.CreateAnimation(z,this.assetsFolder+"/animations/low-res.json",!0,!0,{}),A.glareAnimation.show(),A.glareAnimation.play(),A.blurAnimation.show(),A.blurAnimation.play(),A.lowResAnimation.show(),A.lowResAnimation.play()})),J instanceof HTMLElement&&J.addEventListener("click",(()=>{A.closeModal(q,J,Y)})),W instanceof HTMLElement&&W.addEventListener("click",(()=>{A.closeModal(q,J,Y)})),i.default.getCameraPermission().then((e=>{switch(e){case i.CameraPermissionState.UNKNOWN:case i.CameraPermissionState.GRANTED:l.default.setText(d,s.default.getTranslation(p.TranslationKey.CAMERA_LOADING))}})).then((()=>{if(y instanceof HTMLSelectElement)return y.addEventListener("change",(()=>{l.default.hideObject(K),l.default.hideObject(U),l.default.setText(d,s.default.getTranslation(p.TranslationKey.CAMERA_LOADING)),l.default.setEnabled(y,!1),l.default.setEnabled(f,!1),A.isRunning&&null!=A.smartCaptureCancel&&A.smartCaptureCancel(v.SmartCaptureFailingReasons.CameraChanged),this.changeCameraStream(y.value,_.ReticleType.DOCUMENT,!this._config.hideLogo,!this._config.hideAutoCaptureHints&&A.isRunning?_.HintType.AUTOCAPTUREON:_.HintType.NONE,void 0).then((()=>this.renderAvailableCameras(y))).then((()=>{A.isRunning&&f&&S instanceof HTMLCanvasElement&&A.startCapturing.call(this,k,y,O,S,b,D,a,R,w,L,P,N,F,K,U,G,f,ae,Z,Q,x,H),l.default.hideObject(d),l.default.hideObject(H),l.default.setEnabled(y,!0),l.default.setEnabled(f,!0)})).catch((e=>{l.default.setEnabled(y,!0),l.default.setText(d,s.default.getTranslation(e.message))}))})),l.default.setText(d,s.default.getTranslation(p.TranslationKey.SMART_CAPTURE_INITIALIZING)),k instanceof HTMLDivElement&&S instanceof HTMLCanvasElement?o.default.subscribe(h.JourneyEvent.CAMERA_CANVAS_RESIZE,(({isPortrait:e})=>{A.handleCameraSelectedChange.call(this,k,S,e)})):A.animationCompleted=!0,Promise.all([u.default.createWorker(r,E,C,g),this.renderAvailableCameras(y)]).then((()=>{var e;if(f&&S instanceof HTMLCanvasElement){const t=e=>{A.isRunning=!0,l.default.hideObject(F),l.default.hideObject(H),l.default.hideObject(ae),l.default.setEnabled(f,!1),l.default.hideObject(f),l.default.showObject(D),this.changeCameraStream(y.value,_.ReticleType.DOCUMENT,!this._config.hideLogo,this._config.hideAutoCaptureHints?_.HintType.NONE:_.HintType.AUTOCAPTUREON,void 0,e).then((()=>{A.startCapturing.call(this,k,y,O,S,b,D,a,R,w,L,P,N,F,K,U,G,f,ae,Z,Q,x,H)}))},o=()=>n(this,void 0,void 0,(function*(){var e;let a=i.CameraFacingMode.BACK;if((null===(e=this._journey)||void 0===e?void 0:e.action)===T.FlowState.SELFIE&&(a=i.CameraFacingMode.FRONT),f&&S instanceof HTMLCanvasElement&&y instanceof HTMLSelectElement)try{const e=yield i.default.getVideoCameras();let t;t=a===i.CameraFacingMode.FRONT?e.find((e=>!i.default.isBackCameraLabel(e.label))):e.find((e=>i.default.isBackDualWideCameraLabel(e.label)));const n=t?t.deviceId:"";""!==n&&(a=a===i.CameraFacingMode.FRONT?i.CameraFacingMode.FRONT:i.CameraFacingMode.ENVIRONMENT,l.default.markSelected(y,n))}catch(e){}t(a)}));(null===(e=this._config.smartCapture)||void 0===e?void 0:e.autoStart)&&o(),f.addEventListener("click",o),l.default.hideObject(d),l.default.setEnabled(f,!0),l.default.setEnabled(y,!0)}})).catch((e=>(this._providers=this._providers.filter((e=>e!==m.InputProvider.SMART_CAPTURE)),this._inputProvider=m.InputProvider.CAMERA,i.default.stopStreaming().then((()=>u.default.destroyWorker())).then((()=>(0,c.wait)(250))).then((()=>this.evaluate())))))}))})).then((()=>o.default.publish(h.JourneyEvent.DISPLAY_PROVIDER,{provider:f.Templates.SmartCapture})))}static startCapturing(e,t,a,d,u,m,f,T,g,S,j,I,b,y,O,w,L,R,P,N,D,M){A.lastQualityCheckPriority=-1,l.default.showObject(e),this.renderAvailableCameras(t),o.default.publish(h.JourneyEvent.CAMERA_START),A.lengthStartTime=performance.now();const k=new Date;k.setMilliseconds(k.getMilliseconds()+6e4);const{cancel:F,token:x}=C.default.create();if(A.smartCaptureCancel=F,this._manualCapture.enabled)if(this._manualCapture.timeout<=60&&this._manualCapture.timeout>=0){const e=1e3*this._manualCapture.timeout;setTimeout((()=>{this._manualCapture.enabled&&(l.default.showObject(y),l.default.showObject(O),l.default.showObject(w))}),e)}else this._manualCapture.enabled=!1;(0,c.retryOperationWithTimeout)((()=>A.processFrame.call(this,a,d,u,e,m,M)),f,k,x).then((({image:e,result:t})=>r.ImageService.convert(e).then((e=>n(this,void 0,void 0,(function*(){l.default.showObject(D),this._previewPages.documentStep.smartCapture?l.default.setText(M,s.default.getTranslation(p.TranslationKey.PREPARING_PREVIEW_TITLE)):l.default.setText(M,s.default.getTranslation(p.TranslationKey.VERIFYING_TITLE)),l.default.showObject(M),A.isRunning=!1,A.setMetaData(),yield o.default.publish(h.JourneyEvent.CAMERA_FEEDBACK,{succeeded:!0}),yield i.default.stopStreaming(),i.default.clearCanvas(d),l.default.showObject(b),l.default.removeClass(u,"camera-viewfinder--inner-container-error"),l.default.addClass(u,"camera-viewfinder--inner-container-success"),A.removeIDAnimation(),l.default.hideObject(a),l.default.hideObject(g),l.default.hideObject(S),l.default.hideObject(j),l.default.hideObject(I),l.default.hideObject(P),setTimeout((()=>this._previewPages.documentStep.smartCapture?E.ImageProvider.render.call(this,e,A.metaData):A.continueJourneySkipPreview.call(this,e,A.metaData)),1e3)})))))).catch((e=>{e!==v.SmartCaptureFailingReasons.ManualInputProviderChange&&(l.default.removeClass(u,"camera-viewfinder--inner-container-error"),l.default.hideObject(a),l.default.hideObject(g),l.default.hideObject(S),l.default.hideObject(j),l.default.hideObject(I),l.default.hideObject(m),l.default.hideObject(T),l.default.hideObject(N),A.removeIDAnimation(),e!==v.SmartCaptureFailingReasons.CameraChanged&&(l.default.showObject(R),l.default.showObject(L),l.default.setEnabled(L,!0),l.default.setEnabled(t,!0),l.default.showObject(b),this.changeCameraStream(t.value,_.ReticleType.DOCUMENT,!this._config.hideLogo,_.HintType.NONE,void 0,i.CameraFacingMode.BACK),A.isRunning=!1,o.default.publish(h.JourneyEvent.CAMERA_FEEDBACK,{failed:!0})))}))}static continueJourneySkipPreview(e,t){const{type:a}=r.ImageService.getBase64Components(e);return this.assertImageExists(e).then((()=>this.getJourney())).then((n=>n.continue({imgList:[Object.assign(Object.assign({},r.ImageService.remapNames(r.ImageService.getBase64Components(e))),{name:"SELFIE"===n.action?g.RequiredInputImage.SelfiePhoto:g.RequiredInputImage.WhiteImage,inputFormat:"pdf"===a?1:0})],journeyDefinitionId:this._journeyDefinitionId},t).then((e=>S.default.getDataStore(S.DataStoreType.ID_SCAN).update(E.ImageProvider.parseResponseData(e)))).then((()=>this.evaluate())).then(this.updateJourneyFields)))}static removeIDAnimation(){A.captureAnimationComplete&&(A.captureAnimationComplete(),A.captureAnimationComplete=void 0),A.captureAnimation&&(A.captureAnimation.removeEventListener("complete"),A.captureAnimation.stop(),A.captureAnimation.destroy(),A.captureAnimation=void 0)}static closeModal(e,t,a){l.default.hideObject(e),l.default.hideObject(t),l.default.showObject(a),A.glareAnimation.stop(),A.glareAnimation.destroy(),A.blurAnimation.stop(),A.blurAnimation.destroy(),A.lowResAnimation.stop(),A.lowResAnimation.destroy()}static setConditionsFlags(e){A.setConditionChecks.call(this,e.blurCheck,e.glareCheck,e.resolutionCheck,e.coordinateCheck)}static setConditionChecks(e,t,a,n){return d.default.getElements(this._container,{blur:'[data-jcs-element="camera__condition__blur"]',glare:'[data-jcs-element="camera__condition__glare"]',lowResolution:'[data-jcs-element="camera__condition__low__resolution"]',alignment:'[data-jcs-element="camera__condition__alignment"]',cameraConditionsContainer:'[data-jcs-element="camera__conditions"]'}).then((({blur:i,glare:o,lowResolution:r,alignment:s,cameraConditionsContainer:d})=>{l.default[t?"hideObject":"showObject"](o),l.default[e?"hideObject":"showObject"](i),l.default[a?"hideObject":"showObject"](r),l.default[n?"hideObject":"showObject"](s),l.default[n&&e&&t&&a?"hideObject":"showObject"](d),A.setConditionChecksDetail.call(this,t,e,a,n)}))}static setConditionChecksDetail(e,t,a,n){return d.default.getElements(this._container,{detailContainer:'[data-jcs-element="camera__condition__detail"]'}).then((({detailContainer:i})=>{const o=(n?0:1)<<3|(a?0:1)<<2|(t?0:1)<<1|(e?0:1);o>A.lastQualityCheckPriority?(A.lastQualityCheckPriority=o,n?a?t?e?l.default.hideObject(i):A.showTitleHintAndAnimation.call(this,s.default.getTranslation(p.TranslationKey.CAMERA_CONDITION_GLARE),s.default.getTranslation(p.TranslationKey.CAMERA_PREVENT_GLARE_HINT),this.assetsFolder+"/animations/glare-white.json"):A.showTitleHintAndAnimation.call(this,s.default.getTranslation(p.TranslationKey.CAMERA_CONDITION_BLUR),s.default.getTranslation(p.TranslationKey.CAMERA_PREVENT_BLUR_HINT),this.assetsFolder+"/animations/blur-white.json"):A.showTitleHintAndAnimation.call(this,s.default.getTranslation(p.TranslationKey.CAMERA_CONDITION_LOW_RESOLUTION),s.default.getTranslation(p.TranslationKey.CAMERA_PREVENT_LOW_RES_HINT),this.assetsFolder+"/animations/low-res-white.json"):A.showTitleHintAndAnimation.call(this,s.default.getTranslation(p.TranslationKey.CAMERA_CONDITION_ALIGNMENT),s.default.getTranslation(p.TranslationKey.CAMERA_PREVENT_LOW_RES_HINT),this.assetsFolder+"/animations/low-res-white.json")):o===A.lastQualityCheckPriority&&o&&(A.qualityChecksTimeout&&clearTimeout(A.qualityChecksTimeout),A.qualityChecksTimeout=setTimeout((()=>{A.lastQualityCheckPriority=-1}),4e3))}))}static showTitleHintAndAnimation(e,t,a){return d.default.getElements(this._container,{detailContainer:'[data-jcs-element="camera__condition__detail"]',animation:'[data-jcs-element="camera__condition__detail__animation"]',title:'[data-jcs-element="camera__condition__detail__description__title"]',hint:'[data-jcs-element="camera__condition__detail__description__hint"]'}).then((({detailContainer:n,animation:i,title:o,hint:r})=>{l.default.showObject(n),l.default.setText(o,e),l.default.setText(r,t),i instanceof HTMLDivElement&&(A.RemoveHintImage(),A.hintAnimation=j.AnimationService.CreateAnimation(i,a,!0,!0,{}))}))}static RemoveHintImage(){void 0!==A.hintAnimation&&(A.hintAnimation.stop(),A.hintAnimation.destroy(),A.hintAnimation=void 0)}static processFrame(e,t,a,n,r,s){return A.lastStartFrameTime=performance.now(),new Promise(((t,d)=>{performance.now();if(i.default.hasActiveStream()){performance.now();var c=i.default.getBlobFromCurrentStream().then((e=>{var t=u.default.checkImage(e);performance.now();return this._config.isVerboseLogEnabled,t})).then((i=>{performance.now();if(A.animationCompleted){A.setConditionsFlags.call(this,Object.assign({},i.quality));const t=i.quality.blurCheck||i.quality.glareCheck||i.quality.resolutionCheck;l.default[t?"showObject":"hideObject"](e),l.default.addClass(a,"camera-viewfinder--inner-container-"+(t?"error":"success")),l.default.hideObject(n),l.default.hideObject(s),A.captureAnimation&&A.captureAnimation.hide()}else 0===A.lastQualityCheckPriority&&(l.default.removeClass(a,"camera-viewfinder--inner-container-error"),l.default.hideObject(e),l.default.showObject(r),l.default.showObject(n),l.default.showObject(s),A.RemoveHintImage(),A.setConditionChecks.call(this,!0,!0,!0,!0),A.captureAnimation&&(A.captureAnimation.show(),A.captureAnimation.play()));if(i&&i.quality)return i.quality.blurCheck&&A.counterImage.Blur++,i.quality.glareCheck&&A.counterImage.Glare++,i.quality.resolutionCheck&&A.counterImage.Resolution++,null==i.image?o.default.publish(h.JourneyEvent.CAMERA_FEEDBACK,Object.assign({},i.quality)).then((()=>d({result:i}))):o.default.publish(h.JourneyEvent.CAMERA_FEEDBACK,Object.assign({},i.quality)).then((()=>t({image:new Blob([i.image],{type:"image/png"}),result:i})));performance.now()}));performance.now();return this._config.isVerboseLogEnabled,c}return d(!1)}))}static handleCameraSelectedChange(e,t,a){try{if(A.isRunning){e.style.height=`${t.clientHeight}px`,e.style.width=`${t.clientWidth}px`;let n="";a?this._journey&&this._journey.action===T.FlowState.IDENTITY_FRONT?n=this.assetsFolder+"/animations/rotate-document-v3-1.json":this._journey&&this._journey.action===T.FlowState.IDENTITY_BACK&&(n=this.assetsFolder+"/animations/flip-document-mobile-v2.json"):this._journey&&this._journey.action===T.FlowState.IDENTITY_FRONT?n=this.assetsFolder+"/animations/position-document-v5.json":this._journey&&this._journey.action===T.FlowState.IDENTITY_BACK&&(n=this.assetsFolder+"/animations/flip-document-v2.json"),A.removeIDAnimation(),A.animationCompleted=!1,A.captureAnimation=j.AnimationService.CreateAnimation(e,n,!1,!0,{}),A.captureAnimationComplete=A.captureAnimation.addEventListener("complete",(e=>{A.animationCompleted=!0,A.removeIDAnimation()}))}}catch(e){}}}t.SmartCaptureProvider=A,A.counterImage={Blur:0,Glare:0,Resolution:0,Alignment:0},A.metaData=[],A.setMetaData=()=>{const e=performance.now()-A.lengthStartTime,t=performance.now()-A.lastStartFrameTime,a=A.counterImage.Blur+A.counterImage.Glare+A.counterImage.Resolution;A.metaData=[{name:"Capture Type",value:"Smart Capture",step:"",type:"Simple"},{name:"SC: Length of Smart Capture",value:e.toString(),step:"",type:"Simple"},{name:"SC: Number of Frames",value:a.toString(),step:"",type:"Simple"},{name:"SC: Last Processes Frame",value:t.toString(),step:"",type:"Simple"},{name:"SC: Number of Glary frames",value:A.counterImage.Glare.toString(),step:"",type:"Simple"},{name:"SC: Number of Blurry frames",value:A.counterImage.Blur.toString(),step:"",type:"Simple"},{name:"SC: Number of Low-Resolution frames",value:A.counterImage.Resolution.toString(),step:"",type:"Simple"}]}},8785:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8876:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9386:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9387:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TripleScanGuidanceProvider=void 0;const n=a(7338),i=a(192),o=a(4635),r=a(8723),s=a(8829),l=a(4487),d=a(8784),c=a(1216),u=a(6871),_=a(1371);class m{static render(e){return i.default.getElements(this._container,{providerContainer:'[data-jcs-element="provider__container"]'}).then((({providerContainer:e})=>i.default.renderToContainer(e,o.Templates.TripleScanGuidance))).then((e=>i.default.getElements(e,{tripleScanGuidanceContainer:'[data-jcs-element="identity__document__triple__scan__guidance"]',tripleScanRetry:'[data-jcs-element="triple__scan__retry__button"]',attemptCountContainer:'[data-jcs-element="attempt__count__container"]',attemptCounter:'[data-jcs-element="attempt__counter"]',failureReasonMessage:'[data-jcs-element="failure__reason__message"]',tryAgainMessage:'[data-jcs-element="try__again__message"]',blurCheck:'[data-jcs-element="blur-check-reason"]',glareCheck:'[data-jcs-element="glare-check-reason"]',resolutionCheck:'[data-jcs-element="resolution-check-reason"]',edgesCheck:'[data-jcs-element="edges-check-reason"]',qualityChecksContainer:'[data-jcs-element="quality-checks-container"]',validationFailedReason:'[data-jcs-element="validation-failed-reason"]',toggleUploadLabel:'[data-jcs-element="gateway__upload__toggle"]'}))).then((({tripleScanGuidanceContainer:t,tripleScanRetry:a,attemptCountContainer:o,attemptCounter:c,failureReasonMessage:u,tryAgainMessage:_,blurCheck:h,glareCheck:f,resolutionCheck:p,edgesCheck:E,qualityChecksContainer:T,validationFailedReason:C,toggleUploadLabel:v})=>{if(t instanceof HTMLElement&&(t.setAttribute("tabindex","-1"),t.focus()),n.default.hideObject(h),n.default.hideObject(f),n.default.hideObject(p),n.default.hideObject(E),n.default.hideObject(v),i.default.getElements(this._container,{uploadToggleButton:'[data-jcs-element="gateway__upload__toggle"]'}).then((({uploadToggleButton:e})=>{n.default.hideObject(e)})),this._journey){switch(this._journey.actionAttempt){case 2:n.default.setText(c,"2");break;case 3:n.default.setText(c,"1");break;default:n.default.hideObject(o)}m.setTriplescanReasonMessages(this._journey.tripleScanReason,u,_,C),m.setQualityChecks(this._journey,h,f,p,E,T)}a instanceof HTMLElement&&a.addEventListener("click",(()=>{switch(e){case s.InputProvider.CAMERA:return l.CameraProvider.render.call(this,!0);case s.InputProvider.FILESYSTEM:return r.FileSystemProvider.render.call(this,!0);case s.InputProvider.SMART_CAPTURE:return d.SmartCaptureProvider.render.call(this,!0);default:return r.FileSystemProvider.render.call(this,!0)}}))}))}static setTriplescanReasonMessages(e,t,a,i){switch(e){case _.HighLevelResult.NotSupported:n.default.setText(t,c.default.getTranslation(u.TranslationKey.FAILURE_REASON_NOT_SUPPORTED)),n.default.setText(a,c.default.getTranslation(u.TranslationKey.PLEASE_TRY_AGAIN_NOT_SUPPORTED)),n.default.setText(i,c.default.getTranslation(u.TranslationKey.VALIDATION_FAILED_REASON_DOC_UNKNOWN));break;case _.HighLevelResult.Refer:n.default.setText(t,c.default.getTranslation(u.TranslationKey.FAILURE_REASON_REFER)),n.default.setText(a,c.default.getTranslation(u.TranslationKey.PLEASE_TRY_AGAIN_REFER));break;case _.HighLevelResult.NotAccepted:n.default.setText(t,c.default.getTranslation(u.TranslationKey.FAILURE_REASON_NOT_ACCEPTED)),n.default.setText(a,c.default.getTranslation(u.TranslationKey.PLEASE_TRY_AGAIN_NOT_ACCEPTED)),n.default.setText(i,c.default.getTranslation(u.TranslationKey.VALIDATION_FAILED_REASON_DOC_NOT_ACCEPTED));break;case _.HighLevelResult.Expired:n.default.setText(t,c.default.getTranslation(u.TranslationKey.FAILURE_REASON_EXPIRED)),n.default.setText(a,c.default.getTranslation(u.TranslationKey.PLEASE_TRY_AGAIN_EXPIRED)),n.default.setText(i,c.default.getTranslation(u.TranslationKey.VALIDATION_FAILED_REASON_DOC_EXPIRED));break;default:n.default.setText(t,c.default.getTranslation(u.TranslationKey.FAILURE_REASON_NOT_SUPPORTED)),n.default.setText(a,c.default.getTranslation(u.TranslationKey.PLEASE_TRY_AGAIN_NOT_SUPPORTED)),n.default.setText(i,c.default.getTranslation(u.TranslationKey.VALIDATION_FAILED_REASON_DOC_UNKNOWN))}}static setQualityChecks(e,t,a,i,o,r){"Bad"==e.blurCheck&&n.default.showObject(t),"Bad"==e.glareCheck&&n.default.showObject(a),"Bad"==e.lowResolutionCheck&&n.default.showObject(i),"Bad"==e.fullDocumentInViewCheck&&n.default.showObject(o),"Bad"!=e.blurCheck&&"Bad"!=e.glareCheck&&"Bad"!=e.lowResolutionCheck&&"Bad"!=e.fullDocumentInViewCheck&&n.default.hideObject(r)}}t.TripleScanGuidanceProvider=m},9609:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JourneySelectStep=void 0;const n=a(3123),i=a(2538),o=a(7993),r=a(1216),s=a(7338),l=a(577),d=a(192),c=a(1431),u=a(8829),_=a(642),m=a(114),h=a(4635),f=a(6871),p=a(1329),E=a(7497);class T{static render(){return d.default.renderToContainer(this._container,h.Templates.Initializing).then((()=>c.default.getJourneyDefinitions())).then(((e=[])=>{T.journeyDefinitionsCount=e.length;const t=e.find((e=>e.JourneyDefinitionId===this._config.journeyDefinitionId)),a=e.find((e=>e.JourneyDefinitionId===E.default.get(p.STORAGE_KEYS.journeyDefinitionId)));t?T.chooseJourney.call(this,t):a?T.chooseJourney.call(this,a):d.default.renderToContainer(this._container,h.Templates.JourneySelect).then((()=>{const t={definitions:e.map((e=>({_definitionName:e.Name,entryDefinitions:e.EntryDefinitions.map((e=>({_type:T.getJourneyEntryDefinitionName(e.Type),_id:e.JourneyEntryDefinitionId})))})))};return d.default.renderToContainer(this._container,h.Templates.JourneySelect,t)})).then((e=>d.default.getElements(e,{choices:'[data-jcs-element="journey-select__choices"]',select:'[data-jcs-element="journey-select__continue"]'}))).then((({choices:t,select:a})=>{if(!(t instanceof HTMLSelectElement&&a instanceof HTMLInputElement))throw o.ExceptionManager.process(new o.ExceptionManager.TemplateException(f.TranslationKey.EXCEPTION_TEMPLATE_ELEMENTS_MISSING));if(0===e.length)throw s.default.updateSelect(t,[{name:r.default.getTranslation(f.TranslationKey.EXCEPTION_JOURNEY_DEFINITIONS_MISSING),value:"",disabled:!0}]),s.default.setEnabled(a,!1),o.ExceptionManager.process(new o.ExceptionManager.TemplateException(f.TranslationKey.EXCEPTION_JOURNEY_DEFINITIONS_MISSING));1===e.length?T.chooseJourney.call(this,e[0]):(a.addEventListener("click",(a=>T.chooseJourney.call(this,e.find((e=>e.JourneyDefinitionId===t.value))))),s.default.updateSelect(t,e.reduce(((e,t,a)=>[...e,{name:t.Name,value:t.JourneyDefinitionId,selected:0===a}]),[])))}))})).then((()=>i.default.publish(_.JourneyEvent.DISPLAY_STEP,{step:h.Templates.JourneySelect})))}static chooseJourney(e){if(e){let t=!1;e.EntryDefinitions.forEach((e=>{if(m.JourneyStep.LIVENESS===T.getJourneyEntryDefinitionName(e.Type))return t=!0})),t?n.default.getVideoCameras().then((t=>{0===t.length?d.default.renderToContainer(this._container,h.Templates.HasNoCamera).then((()=>{1===T.journeyDefinitionsCount&&this.hookGlobalButtons(!1)})):0!=t.length&&(n.default.getVideoCameras(),Promise.all([n.default.getCameraPermission(),n.default.hasDeviceCapableOfResolution()]).then((([t])=>{switch(t){case n.CameraPermissionState.DENIED:return d.default.renderToContainer(this._container,h.Templates.HasNoCamera).then((()=>{1===T.journeyDefinitionsCount&&this.hookGlobalButtons(!1)}));case n.CameraPermissionState.GRANTED:default:this._journeyDefinitionId=e.JourneyDefinitionId,d.default.renderToContainer(this._container,h.Templates.Initializing).then((()=>this.setProviders(e.CapturingMedia,e.IsPredefinedJourney))).then((()=>this.changeInputProvider(this._config.defaultInputProvider,u.ChangeMode.FALLBACK))).then((()=>this.evaluate(!1,e.IsPredefinedJourney)))}})))})):(1===e.CapturingMedia?this.getJourney().then((t=>{l.default.start(e.JourneyDefinitionId,t.id).catch((()=>{})).then((()=>l.default.release()))})):l.default.stop(),this._journeyDefinitionId=e.JourneyDefinitionId,d.default.renderToContainer(this._container,h.Templates.Initializing).then((()=>this.setProviders(e.CapturingMedia,e.IsPredefinedJourney))).then((()=>this.changeInputProvider(this._config.defaultInputProvider,u.ChangeMode.FALLBACK))).then((()=>this.evaluate(!1,e.IsPredefinedJourney))))}}static getJourneyEntryDefinitionName(e){switch(e){case 1:return m.JourneyStep.FRONTSIDE;case 2:return m.JourneyStep.BACKSIDE;case 3:return m.JourneyStep.SELFIE;case 4:return m.JourneyStep.ADDRESSDOCUMENT;case 6:return m.JourneyStep.LIVENESS;case 9:return m.JourneyStep.COVIDPASS;case 10:return m.JourneyStep.DATACHECKS}}}t.JourneySelectStep=T,T.journeyDefinitionsCount=0}}]);
//# sourceMappingURL=idscan-jcs-89419957.ffffb2cf10c5a8b1202d.js.map