1"use strict";(self.webpackChunkfocus_markets_client_portal=self.webpackChunkfocus_markets_client_portal||[]).push([[5834],{38552:(b,O,a)=>{a.d(O,{BW:()=>h,Ue:()=>R,ai:()=>y,go:()=>D,kq:()=>B});var m=a(27583);const c=({observeBy:e,key:o,onHTMLElementExist:n})=>{if(!o)return;const d=document.querySelector("body"),l=new MutationObserver((t,r)=>{var u;for(const _ of t){const s=null===(u=_.addedNodes)||void 0===u?void 0:u[0];"id"===e&&s?.id===o&&(n(s),r.disconnect()),"className"===e&&s?.classList.contains(o)&&(n(s),r.disconnect())}});d&&l.observe(d,{childList:!0,subtree:!0})},y=e=>function(e,o,n,d){return new(n||(n=Promise))(function(t,r){function u(i){try{s(d.next(i))}catch(f){r(f)}}function _(i){try{s(d.throw(i))}catch(f){r(f)}}function s(i){i.done?t(i.value):function l(t){return t instanceof n?t:new n(function(r){r(t)})}(i.value).then(u,_)}s((d=d.apply(e,o||[])).next())})}(void 0,[e],void 0,function*({sdkVersion:o="12"}){const n=yield(0,m.loadAsyncAsset)(`https://sdk.onfido.com/v${o}`),d=R(o).number;return d<14&&(yield(0,m.loadAsyncAsset)(`https://sdk.onfid
1o.com/v${o}/style.css`,"style")),d>=14&&document.head.insertAdjacentHTML("beforeend","<style>\n #onfido-sdk {\n border: none !important;\n }\n #onfido-sdk.loading::after {\n left: 0 !important;\n right: 0 !important;\n top: 0 !important;\n bottom: 0 !important;\n }\n #onfido-sdk iframe {\n left: 0 !important;\n right: 0 !important;\n top: 0 !important;\n bottom: 0 !important;\n }\n @media only screen and (min-width: 768px) {\n #onfido-sdk {\n margin-top: 4rem;\n justify-self: center;\n }\n iframe {\n max-height: 80% !important;\n }\n }\n @media only screen and (min-width: 1366px) {\n iframe {\n max-height: 100% !important;\n }\n }\n </style>"),n}),h=(e,o)=>c({observeBy:"className",key:e,onHTMLElementExist:n=>{o.emit("ready",{domElement:n})}}),D=(e,o)=>c({observeBy:"id",key:e,onHTMLElementExist:n=>{o.emit("ready",{domElement:n})}}),R=e=>{const o=e??"12",n=Number(o.replace(/\D/g,"").slice(0,2));return{str:o,number:n}},B=e=>"onfido"===e?.name&&!!e.showExitButton},14729:(b,O,a)=>{a.d(O,{p:()=>v});var m=a(8680),E=a(27583);const v={[m.By.COMPLETE]:({ocrDocument:c,ocrClient:y,eventHub:h})=>h.emit("results",{document:c,entityId:y.entityId}),[m.By.WAITING_OCR_RUN]:({eventHub:c})=>{c.emit("error",new E.OneSDKError(`Two attempts to get OCR results failed with an unresolved "${m.By.WAITING_OCR_RUN}". This is a system failure.`,{payload:null}))},[m.By.PROVIDER_OFFLINE]:({eventHub:c})=>c.emit("error",new E.OneSDKError(`Provider is offline. Either switch providers and restart or skip OCR temporarily. Status ${m.By.PROVIDER_OFFLINE}`,{payload:null})),[m.By.FAILED]:({eventHub:c})=>c.emit("error",new E.OneSDKError("OCR process failed.",{payload:null})),default:({documentStatus:c,eventHub:y})=>y.emit("input_required",{documentType:null,side:"front"},c,()=>({}))}},42689:(b,O,a)=>{a.r(O),a.d(O,{initialise:()=>R});var m=a(27583),E=a(26699),v=a(38552),c=a(80409),y=a(85898),h=a(14729),D=function(e,o,n,d){return new(n||(n=Promise))(function(t,r){function u(i){try{s(d.next(i))}catch(f){r(f)}}function _(i){try{s(d.throw(i))}catch(f){r(f)}}function s(i){i.done?t(i.value):function l(t){return t instanceof n?t:new n(function(r){r(t)})}(i.value).then(u,_)}s((d=d.apply(e,o||[])).next())})};const R=(0,E.f)("dummy-ocr",(e,o)=>D(void 0,void 0,void 0,function*(){const{frankieClient:n,recipe:d}=e,{mountElement:l,eventHub:t}=o,r=new c.Ns(n),u=new y.UZ(n);try{const{entityId:_,vendorParameters:s}=yield r.getToken(),{ocr:{provider:i}={}}=d,f=(0,v.Ue)("onfido"===i?.name?i?.sdkVersion:void 0).number;t.emit("session_data_generated",{session:{entityId:_,vendorParameters:s}}),f<14?(0,v.BW)("dummy-ocr-modal",t):(0,v.go)("dummy-ocr-modal",t);const p=document.createElement("div");Object.assign(p.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center"}),f<14?p.className="dummy-ocr-modal":p.id="dummy-ocr-modal",l.appendChild(p);const C=document.createElement("div");C.style.backgroundColor="#fff",C.style.padding="200px",C.style.borderRadius="5px",p.appendChild(C);const I=document.createElement("button");I.id="run-ocr-button",I.textContent="Run OCR",I.addEventListener("click",()=>D(void 0,void 0,void 0,function*(){const{oneSdkInstance:T}=e;yield B(u,t,T),M(p,t)})),C.appendChild(I);const w=document.createElement("button");w.id="close-button",w.textContent="Close",w.addEventListener("click",()=>{t.emit("input_required",{documentType:null,side:"front"},y.By.INTERRUPTED,()=>({})),M(p,t)}),C.appendChild(w)}catch(_){const{code:s=null,message:i=""}=_;t.emit("session_data_failed_loading",{code:s,message:i})}return{}})),B=(e,o,n)=>D(void 0,void 0,void 0,function*(){var d,l;try{let t=yield e.attachNewOCRDocument();t.documentStatus===y.By.WAITING_OCR_RUN&&(t=yield e.rerun(null!==(d=t.ocrDocument.documentId)&&void 0!==d?d:"null"));const{ocrDocument:r,documentStatus:u}=t;(null!==(l=h.p[u])&&void 0!==l?l:h.p.default)({ocrDocument:r,documentStatus:u,ocrClient:e,eventHub:o}),yield n.individual().search()}catch(t){const{message:r=""}=t;o.emit("error",new m.OneSDKError("Error from OCR documents submission",{message:r}))}}),M=(e,o)=>{try{e.remove(),o.emit("session_closed")}catch(n){const{type:d=null,message:l=""}=n;
1o.emit("error",new m.OneSDKError("Error from vendor SDK 'Onfido'",{type:d,message:l}))}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.