1import{e as b,ad as N,aP as g,j as e,k as w,l as E,s as v,v as F,p as k}from"./index-D7Q1wY-x.js";import{r as i}from"./vendor-CBu0QuCz.js";import{D as I,p as y}from"./passport-example-sLe3uhDG.js";import{H as P}from"./HeaderTransactionPage-COElB9a8.js";import{M as A}from"./MenuModal-OqoLYtT-.js";import{B as C}from"./Button-XTQGSwkw.js";import{C as U}from"./Camera-DovhtVkl.js";import"./_rollupPluginBabelHelpers-3bc641ae-BvzpwIKU.js";import"./ArrowLeft-D5zIeGcK.js";/* empty css */import"./X-Brf8dUEL.js";const V=()=>{const c=b(),{index:m}=N(),{visaUmrohState:r,updateApplicantData:x}=g(),a=parseInt(m),[t,d]=i.useState(null),[h,p]=i.useState(!1);i.useEffect(()=>{var o,l;const s=(l=(o=r.applicants[a])==null?void 0:o.passportData)==null?void 0:l.passportImage;s&&d(s)},[a,r.applicants]);const u=async()=>{try{const s=document.createElement("input");s.type="file",s.accept="image/*",s.onchange=o=>{const l=o.target.files[0];if(l){const n=new FileReader;n.onloadend=()=>{d(n.result)},n.readAsDataURL(l)}},s.click()}catch(s){console.error("Error uploading file:",s)}},f=()=>{p(!0)},j=()=>
1{if(t){const s=r.applicants[a];x(a,{passportData:{...s==null?void 0:s.passportData,passportImage:t}}),c.push("/umroh-visa/user-data/".concat(a),"forward")}};return e.jsxs(e.Fragment,{children:[e.jsxs(w,{children:[e.jsxs(E,{className:"ui-container bg-white",children:[e.jsx(P,{handleBack:()=>c.goBack(),title:"Pemohon ".concat(a+1)}),e.jsxs("div",{className:"p-4 bg-white min-h-full flex flex-col",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-semibold font-poppins mb-2 text-[#0F172A]",children:"Upload Foto Passport"}),e.jsx("p",{className:"text-sm text-[#64748B] leading-relaxed",children:"Upload foto passport pada lembar yang menampilkan identitas Anda"})]}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-start",children:[t?e.jsxs("div",{className:"w-full mb-6",children:[e.jsx("div",{className:"border-2 border-dashed border-[#E2E8F0] rounded-xl p-4",children:e.jsx("img",{src:t,alt:"Uploaded Passport",className:"w-full h-auto rounded-lg"})}),e.jsx("p",{className:"text-sm text-[#EE204D] text-center mt-4",children:"Silahkan upload foto passport Anda terlebih dahulu"})]}):e.jsx("div",{onClick:u,className:"w-full mb-6 cursor-pointer",children:e.jsxs("div",{className:"min-h-[250px] border-2 border-dashed border-[#E2E8F0] rounded-xl p-12 flex flex-col items-center justify-center",children:[e.jsx("div",{className:"flex items-center justify-center mb-3",children:e.jsx(U,{size:20,className:"mr-2"})}),e.jsx("p",{className:"text-sm text-[#0F172A] font-medium",children:"Klik untuk upload foto"})]})}),e.jsxs(v,{expand:"block",shape:"round",fill:"outline",onClick:f,className:"w-full h-[48px] mb-4",style:{"--border-color":"#0F172A","--color":"#0F172A","--border-width":"1px"},children:[e.jsx(I,{size:20,className:"mr-2"}),e.jsx("span",{className:"text-[14px] font-medium",children:"Lihat Contoh"})]})]})]})]}),e.jsx(F,{className:"border-t border-[#E2E8F0] bg-white ion-no-border",children:e.jsx(k,{className:"bg-white",children:e.jsx("div",{className:"p-4",children:e.jsx(C,{label:"Selanjutnya",expand:"block",shape:"round",size:"large",onClick:j,disabled:!t,className:"!font-poppins !rounded-full"})})})})]}),e.jsx(A,{showModal:h,setShowModal:()=>p(!1),renderTitle:()=>e.jsx("p",{className:"!text-[18px] !font-medium font-poppins !text-[#0F172A]",children:"Contoh Passport"}),initialBreakpoint:1,breakpoints:[0,1],children:e.jsx("div",{className:"flex flex-col h-full",children:e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6",children:e.jsx("div",{className:"w-full mb-4",children:e.jsx("div",{className:"w-full aspect-[3/2] bg-[#F8FAFC] flex items-center justify-center",children:e.jsx("img",{src:y,alt:"Passport Example",className:"w-full h-auto"})})})})})})]})};export{V 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.