PageSourceSearch

https://myka.ng/assets/PersonalInfoPage-Dg-3qwgA.js

js myka.ng collected 2026-10-09 22:44:00 UTC 5,550 bytes, 1 lines download raw bytes

1import{j as r,r as T,d as N,u as v,N as C}from"./vendor-react-DfYGAhtm.js";import{u as S,g as E}from"./vendor-state-BsBVN-fX.js";import{m as o,G as g,a_ as I,g as P,a0 as k,bG as F}from"./index-DsBgCU7r.js";import{C as c,o as B,f as w,s as x,b as D,c as L,d as z}from"./vendor-forms-BP-7CbAP.js";import{c2 as A}from"./vendor-icons-1odZwi-b.js";import{V as y,H as W,a as h,v as G,i as R,T as b,G as U,a5 as _,a6 as q,a7 as H,av as $,L as M,F as O}from"./vendor-ui-DA_r9yXk.js";import{u as V,T as K}from"./useTravelFlowGuard-BzKYpJZB.js";import{u as Q}from"./useTravelStepBreadcrumbs-D2HQAol8.js";import{T as j}from"./routes-SlierU_8.js";import{S as J}from"./StepPageLayout-DdZUweau.js";import"./stepBreadcrumbs-FCtSk5Kj.js";const X={readOnly:!0,bg:o.white.DEFAULT,border:`1px solid ${o.border.primary}`,_hover:{bg:o.white.DEFAULT},cursor:"default"},Y={bg:o.white.DEFAULT,border:`1px solid ${o.border.primary}`},Z=({control:n,errors:e,readOnly:s=!1})=>{const l=s?X:Y;return r.jsxs(y,{gap:6,align:"stretch",children:[r.jsx(y,{gap:1,align:"stretch",children:r.jsxs(W,{gap:3,align:"center",children:[r.jsx(h,{bg:o.orange[50],borderRadius:"lg",p:2,display:"inline-flex",children:r.jsx(G,{as:A,boxSize:8,color:o.orange[500]})}),r.jsxs(h,{children:[r.jsx(R,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:o.text.primary,children:"Personal Information"}),r.jsx(b,{fontSize:"md",color:o.text.gray,children:"We need a few details to get your quote ready."})]})]})}),r.jsxs(U,{templateColumns:{base:"1fr",md:"1fr 1fr"},gap:4,children:[r.jsx(c,{name:"fullName",control:n,render:({field:a})=>r.jsx(g,{size:"lg",label:"Full Name",placeholder:"Enter full name",value:a.value,onChange:a.onChange,onBlur:a.onBlur,error:e.fullName?.message,hasError:!!e.fullName,...l})}),r.jsx(c,{name:"nin",control:n,render:({field:a})=>r.jsx(g,{size:"lg",label:"NIN",placeholder:"Enter your 11-digit NIN",type:"tel",inputMode:"numeric",value:a.value,onChange:s?a.onChange:t=>a.onChange(t.target.value.replace(/\D/g,"").slice(0,11)),onBlur:a.onBlur,error:e.nin?.message,hasError:!!e.nin,...l})}),r.jsx(c,{name:"email",control:n,render:({field:a})=>r.jsx(g,{size:"lg",type:"email",label:"Email Address",placeholder:"Enter email",value:a.value,onChange:a.onChange,onBlur:a.onBlur,error:e.email?.message,hasError:!!e.email,...l})}),r.jsx(c,{name:"phoneNumber",control:n,render:({field:a})=>r.jsx(g,{size:"lg",type:"tel",label:"Phone Number",placeholder:"Enter phone number",value:a.value,onChange:s?a.onChange:t=>a.onChange(t.target.value.replace(/\D/g,"").slice(0,10)),onBlur:a.onBlur,error:e.phoneNumber?.message,hasError:!!e.phoneNumber,...l})})]}),r.jsxs(h,{bg:o.gray[50],borderRadius:"lg",p:4,borderColor:"gray.200",children:[r.jsx(c,{name:"agreeToTerms",control:n,rules:{required:"This field is required",validate:a=>a===!0||"This field is required"},render:({field:a})=>r.jsxs(_,{checked:a.value,onCheckedChange:t=>a.onChange(!!t.checked),colorPalette:"orange",alignItems:"flex-start",children:[r.jsx(q,{}),r.jsx(H,{}),r.jsx($,{children:r.jsxs(b,{fontSize:"sm",color:o.text.gray,lineHeight:"tall",maxW:"full",whiteSpace:"normal",children:["I confirm that the information provided is correct and matches my legal documentation. I have read and agree to the"," ",r.jsx(M,{href:"#",color:o.orange[500],fontWeight:"bold",_hover:{textDecoration:"underline"},children:"Terms & Conditions"}),"."]})})]})}),e.agreeToTerms&&r.jsx(b,{fontSize:"xs",color:o.error[500],mt:2,children:e.agreeToTerms.message})]})]})},ee=n=>{if(!n||typeof n!="object")return;const e=n;if(!(!e.nin||typeof e.nin!="string"))return{fullName:typeof e.fullName=="string"?e.fullName.trim():"",nin:e.nin,email:typeof e.email=="string"?e.email:"",phoneNumber:typeof e.phoneNumber=="string"?e.phoneNumber.replace(/^234/,"0"):"",agreeToTerms:!1}},re=B({fullName:x().min(2,"Enter your full name"),nin:x().length(11,"NIN must be 11 digits"),email:I,phoneNumber:x().min(10,"Enter a valid phone number").regex(/^[0-9]+$/,"Numbers only"),agreeToTerms:w().refine(n=>n===!0,{message:"Please accept the terms to continue"})}),ae={fullName:"",email:"",nin:"",phoneNumber:"",agreeToTerms:!1},ne=({onSubmit:n,initialValues:e,isSubmitting:s=!1})=>{const l=e??ae,{control:a,handleSubmit:t,formState:{errors:p},reset:d,getValues:m}=D({resolver:L(re),defaultValues:l,mode:"onChange"}),u=z({control:a,name:"agreeToTerms",defaultValue:!1});T.useEffect(()=>{e&&(e.fullName||e.nin||e.phoneNumber)&&d({...e,agreeToTerms:m("agreeToTerms")})},[e,d,m]);const f=async i=>{await n(i)};return r.jsx(h,{py:{base:4},children:r.jsx(h,{bg:"white",borderRadius:"2xl",border:"1px solid",borderColor:o.border.primary,p:{base:5,md:10},w:"100%",children:r.jsxs(y,{gap:6,align:"stretch",children:[r.jsx(Z,{control:a,errors:p,readOnly:!0}),r.jsx(O,{justify:"flex-end",w:"100%",children:r.jsx(P,{buttonType:"primary",text:"Continue",size:"lg",onClick:t(f),disabled:!u||s,loading:s,opacity:u&&!s?1:.5})})]})})})},oe=n=>{const e=n.replace(/\D/g,"");return e.startsWith("234")?e:e.startsWith("0")?"234"+e.slice(1):"234"+e},fe=()=>{const{isBlocked:n}=V(K.PersonalInfo),{items:e,onGoBack:s}=Q(),l=N(),a=v(),t=S(),p=E(),[d,m]=T.useState(!1),u=T.useMemo(()=>ee(a.state),[a.state]),f=async i=>{m(!0);try{await k(p)}finally{m(!1)}t(F({fullName:i.fullName.trim(),nin:i.nin,email:i.email.trim(),phone:oe(i.phoneNumber)})),l(`/${j.TripDetails}`)};return n?null:u?r.jsx(J,{items:e,onGoBack:s,contentMaxW:"800px",mobileContentOnly:!0,children:r.jsx(ne,{onSubmit:f,initialValues:u,isSubmitting:d})}):r.jsx(C,{to:`/${j.TripDetails}`,replace:!0})};export{fe 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.