1import{x as D,V as M,H as O,O as G,N as z}from"./DLaXUcTx.js";import{u as j}from"./WpeE5Pnp.js";import{U as R}from"./BoaDv1c6.js";import{l as q,x as v,a3 as W,a4 as X,a5 as Y,s as w,k as H,o as i,c as d,a as t,a6 as $,f as Z,B as J,D as K,u as Q,a7 as A,_ as x,z as N,b as p,e as P,w as g,d as f,t as s,y as L,I as h,p as ee}from"./DEjM1lnO.js";import{u as te}from"./D9TsBIS3.js";import{r as oe}from"./Db6jigkF.js";import{_ as se}from"./B8hE-aWm.js";const ae=3e4;var F=(e=>(e[e.INITIAL=0]="INITIAL",e[e.CAMERA_GUIDE=1]="CAMERA_GUIDE",e[e.REVIEW=2]="REVIEW",e[e.UPLOADING=3]="UPLOADING",e[e.COMPLETED=4]="COMPLETED",e[e.ERROR=5]="ERROR",e))(F||{});function ne(e,o){const{getUploadError:b,getRequestId:E}=te(o),_=v(),U=v(),u=v(""),c=v(),n=v(),I=v(0),l=v(0);q(u,(a,y,V)=>{if(!a)return;const B=setTimeout(()=>{u.value=""},ae);V(()=>clearTimeout(B))});const k=w(()=>{if(c.value)return URL.createObjectURL(c.value)});function r(){n.value=1}function m(a){U.value=a,n.value=5}async function C(){try{const a=await R.getStatus(e);a.status===W.IN_PROGRESS?(_.value=a,n.value=0):m("customerIdentification.upload.errors.sessionNotFound")}catch{m("customerIdentification.upload.errors.sessionNotFound")}}function T(a){if(u.value="",a.length>0){const y=a.item(0);y.size<=Y?(c.value=y,n.value=2):m("customerIdentification.upload.errors.fileSize")}else c.value=void 0}async function S(){u.value="",n.value=3,I.value=0;try{await R.uploadFile(e,{file:c.value,attachmentType:X.IDENTIFICATION.toUpperCase()},{onUploadProgress({loaded:a,total:y}){I.value=Math.floor(a/y*100)}}),l.value+=1,n.value=4}catch(a){u.value=b(E(a)),n.value=2}}return C(),{uploadSession:_,error:U,failAlert:u,step:n,progress:I,objectUrl:k,uploadedCount:l,showCameraGuide:r,setFile:T,upload:S}}const ie=H({__name:"ProgressBar",props:{height:{},progress:{}},setup(e){return(o,b)=>(i(),d("div",{class:"progress",style:$({height:e.height+"px"})},[t("div",{class:"progress-bar",style:$({width:e.progress+"%"})},null,4)],4))}}),le=H({name:"UploadPage",components:{IAlert:z,IButton:G,ILanguageDropdown:O,ILoader:M,ILink:D,ProgressBar:ie},setup(){const{$t:e,$store:o}=Z(),b=J(),E=K(),{switchLanguage:_,localeSelection:U}=j(E,o),u=w(()=>{const r=b.query.documentType;return typeof r=="string"?r:""}),c=w(()=>oe(u.value)),n=ne(b.params.id,e),I=w(()=>{const r=c.value,m=n.uploadedCount.value,C=e("customerIdentification.customerUpload.buttons.continue"),T=e("customerIdentification.customerUpload.buttons.addMore");return!r||m>=r?m>0?T:C:r===1?C:`${C} ${m+1}/${r}`}),l=v();function k(){l.value?.click()}return Q({title:e("customerIdentification.customerUpload.title")}),{steps:F,localeSelection:U,switchLanguage:_,triggerUploadDialog:k,fileInput:l,requiredPhotoCount:c,addPhotoLabel:I,...n}}}),re=A("/images/logo/inbank-logo.svg"),de=A("/images/illustrations/paperless.png"),ue=A("/images/illustrations/error-upload.png"),ce={role:"main"},pe={class:"container my-3"},me={class:"row"},ge={class:"col-12 col-md-6 mx-auto"},fe={class:"d-flex justify-content-between align-items-center mb-4"},ve={"data-testid":"pp-upload-page-title"},Ie={class:"content-box"},be={class:"my-4"},he=["innerHTML"],_e={"data-testid":"pp-upload-page-title"},Ue={class:"content-box"},ke=["innerHTML"],Ce={"data-testid":"pp-upload-page-title"},ye={class:"content-box"},Ee=["src"],Le={class:"my-3"},we={"data-testid":"pp-upload-page-title"},Te={class:"content-box"},Ae=["src"],Re={class:"text-center my-5"},$e={class:"w-75 mx-auto my-5"},Ne={"data-testid":"pp-upload-page-title"},Pe={class:"content-box"},De=["innerHTML"],Me={key:0};function Oe(e,o,b,E,_,U){const u=O,c=z,n=D,I=N("i18n-t"),l=G,k=N("progress-bar"),r=M;return i(),d("main",ce,[t("div",pe,[t("div",me,[t("div",ge,[t("div",fe,[o[1]||(o[1]=t("div",null,[t("img",{src:re,alt:"Inbank"})],-1)),t("div",null,[p(u,{"dropdown-text":e.localeSelection.selectedLocale.toUpperCase(),languages:e.localeSelection.languages,size:"md",onClick:e.switchLanguage},null,8,["dropdown-text","languages","onClick"])])]),e.failAlert?(i(),P(c,{key:0,variant:"danger",show:"",class:"mb-3"},{default:g(()=>[f(s(e.failAlert),1)]),_:1})):L("",!0),t("input",{id:"attachment",ref:"fileInput",type:"file",name:"attachment",class:"d-none",accept:"image/*",capture:"",onChange:o[0]||(o[0]=m=>e.setFile(m.target.files))},null,544),e.step===e.steps.INITIAL?(i(),d(h,{key:1},[o[2]||(o[2]=t("div",{class:"illustration-container"},[t("img",{class:"illustration",src:de,alt:"Paperless"})],-1)),t("h2",ve,s(e.$t("customerIdentification.customerUpload.labels.initial")),1),t("div",Ie,[t("div",be,[t("div",{innerHTML:e.$t("customerIdentification.customerUpload.labels.guide")},null,8,he),p(I,{keypath:"customerIdentification.customerUpload.labels.cameraNote",tag:"div"},{cameraGuideLink:g(()=>[p(n,{onClick:e.showCameraGuide,"data-testid":{link:"pp-upload-page-link-camera-guide"}},{default:g(()=>[f(s(e.$t("customerIdentification.customerUpload.buttons.cameraGuide")),1)]),_:1},8,["onClick"])]),_:1})]),p(l,{"icon-size":"18","icon-stroke-width":"1",class:"w-100",variant:"primary","data-testid":{button:"pp-upload-page-button-continue"},onClick:e.triggerUploadDialog},{default:g(()=>[f(s(e.addPhotoLabel),1)]),_:1},8,["onClick"])])],64)):e.step===e.steps.CAMERA_GUIDE?(i(),d(h,{key:2},[t("h2",_e,s(e.$t("customerIdentification.customerUpload.labels.cameraAccess")),1),t("div",Ue,[t("p",{class:"my-4",innerHTML:e.$t("customerIdentification.customerUpload.labels.cameraGuide")},null,8,ke),p(l,{"icon-size":"18","icon-stroke-width":"1",class:"w-100",variant:"primary","data-testid":{button:"pp-upload-page-button-continue"},onClick:e.triggerUploadDialog},{default:g(()=>[f(s(e.addPhotoLabel),1)]),_:1},8,["onClick"])])],64)):e.step===e.steps.REVIEW?(i(),d(h,{key:3},[t("h2",Ce,s(e.$t("customerIdentification.customerUpload.labels.review")),1),t("div",ye,[t("div",null,[e.objectUrl?(i(),d("img",{key:0,src:e.objectUrl,alt:"Uploaded image",class:"w-100 rounded"},null,8,Ee)):L("",!0)]),t("div",Le,[p(l,{"icon-size":"18","icon-stroke-width":"1",class:"w-100",variant:"clear-primary","data-testid":{button:"pp-upload-page-button-retake"},onClick:e.triggerUploadDialog},{default:g(()=>[f(s(e.$t("customerIdentification.customerUpload.buttons.retake")),1)]),_:1},8,["onClick"])]),t("div",null,[p(l,{"icon-size":"18","icon-stroke-width":"1",class:"w-100",variant:"primary","data-testid":{button:"pp-upload-page-button-confirm"},onClick:e.upload},{default:g(()=>[f(s(e.$t("customerIdentification.customerUpload.buttons.confirm")),1)]),_:1},8,["onClick"])])])],64)):e.step===e.steps.UPLOADING?(i(),d(h,{key:4},[t("h2",we,s(e.$t("customerIdentification.customerUpload.labels.uploading")),1),t("div",Te,[t("div",null,[e.objectUrl?(i(),d("img",{key:0,src:e.objectUrl,alt:"Uploaded image",class:"w-100 rounded"},null,8,Ae)):L("",!0)]),t("div",Re,s(e.$t("customerIdentification.customerUpload.labels.uploadingTakesTime")),1),t("div",$e,[p(k,{progress:e.progress,height:4},null,8,["progress"])])])],64)):e.step===e.steps.COMPLETED?(i(),d(h,{key:5},[t("h2",Ne,s(e.$t("customerIdentification.customerUpload.labels.completed")),1),t("div",Pe,[o[3]||(o[3]=t("div",{class:"illustration-container mt-4"},[t("img",{class:"illustration",src:se,alt:"Completed"})],-1)),t("p",{"data-testid":"pp-upload-page-text-add-more",innerHTML:e.$t("customerIdentification.customerUpload.labels.addMore")},null,8,De),t("div",null,[p(l,{class:"w-100",variant:"primary","data-testid":{button:"pp-upload-page-button-add-more"},onClick:e.triggerUploadDialog},{default:g(()=>[f(s(e.addPhotoLabel),1)]),_:1},8,["onClick"])])])],64)):e.step===e.steps.ERROR?(i(),d(h,{key:6},[t("h2",null,s(e.$t(e.error)),1),t("div",{class:ee({"content-box":e.uploadSession})},[o[4]||(o[4]=t("div",{class:"illustration-container mt-4"},[t("img",{class:"illustration",src:ue,alt:"Error"})],-1)),e.uploadSession?(i(),d("div",Me,[p(l,{"icon-size":"18","icon-stroke-width":"1",class:"w-100",variant:"primary","data-testid":{button:"pp-upload-page-button-continue"},onClick:e.triggerUploadDialog},{default:g(()=>[f(s(e.$t("customerIdentification.customerUpload.buttons.continue")),1)]),_:1},8,["onClick"])])):L("",!0)],2)],64)):(i(),P(r,{key:7}))])])])])}const je=x(le,[["render",Oe],["__scopeId","data-v-d5425f7b"]]);export{je as default};
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.