PageSourceSearch

https://myka.ng/assets/WalletPage-OZfkPJ1C.js

js myka.ng collected 2026-10-09 22:41:55 UTC 46,429 bytes, 1 lines download raw bytes

1import{j as e,r as h,d as y0,p as j0}from"./vendor-react-DfYGAhtm.js";import{e as v0,m as r,g as D,t as f,Y as s0,aX as S0,S as T}from"./index-DsBgCU7r.js";import{E as A0}from"./EmailVerificationModal-BxNiYJiq.js";import{h as Q}from"./userEmail-9DwyWHBc.js";import{W as i0,u as l0,g as c0,b as d0}from"./walletApi-DyFgHNVA.js";import{u as $}from"./walletMandateApi-Du1GplC_.js";import{W as p0,Q as k0,f as W0,w as R0,A as E0,a as u0,u as z0}from"./walletTransactionsApi-XVVIq8MJ.js";import{K as M0}from"./KycNinModal-HYhUNMVV.js";import{M as x0}from"./Modal-DS-VW05m.js";import{g as m0,h as H0}from"./vendor-state-BsBVN-fX.js";import{u as N0}from"./useAnalytics-HP01GbIH.js";import{g as K,c as V0,i as F0}from"./errors-BYKXB8DF.js";import{s as T0,b as q,d as X}from"./walletFundReturnUrls-DZ0AzM5T.js";import{B as I0}from"./bankLinking-CG6Z7VZS.js";import{h as m,T as l,F as x,a as p,o as k,I as B0,v as L0,n as g0,s as Y}from"./vendor-ui-DA_r9yXk.js";import{as as _0,g as P0,w as D0,aU as O0,E as U0,aY as Z0,A as K0,h as Y0}from"./vendor-icons-1odZwi-b.js";import{T as $0,a as Q0,b as G0}from"./TransactionsEmptyState-BLgcUNnO.js";import{a as q0}from"./currency-tq8RhIEU.js";import"./vendor-forms-BP-7CbAP.js";import"./walletMandateSession-B-c6J5GS.js";import"./NinVerificationPanel-Cl3L-HVS.js";const X0=async t=>{const n=await v0.post("/api/v1/wallets/fund",{email:t.email,url:t.url,channel:t.channel,reference:t.reference,phone:t.phone,amount:t.amount,currency:t.currency,accountNumber:t.accountNumber,...t.mandate?{mandate:t.mandate}:{}});if(!n.data.success||!n.data.data)throw new Error(n.data.message??"Failed to fund wallet");return n.data.data},J0=()=>{const t=m0();return H0({mutationFn:X0,onSuccess:()=>{t.invalidateQueries({queryKey:i0}),t.invalidateQueries({queryKey:p0})}})},e2=()=>e.jsxs(m,{gap:1,children:[e.jsxs(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:r.navy[500],letterSpacing:"-0.03em",children:["Add"," ",e.jsx(l,{as:"span",color:r.orange[500],children:"Money"})]}),e.jsx(l,{fontSize:"sm",color:r.text.gray,children:"Top up your wallet balance"})]}),t2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2016.9321%2016.9321'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Frame'%20clip-path='url(%23clip0_0_35)'%3e%3cpath%20id='Vector'%20d='M12.17%205.92304V5.55463C12.17%203.89581%209.66785%202.64442%206.34955%202.64442C3.03125%202.64442%200.529129%203.89581%200.529129%205.55463V8.20028C0.529129%209.58197%202.26533%2010.6799%204.76216%2011.0086V11.3751C4.76216%2013.0339%207.26428%2014.2853%2010.5826%2014.2853C13.9009%2014.2853%2016.403%2013.0339%2016.403%2011.3751V8.72941C16.403%207.36029%2014.7217%206.26102%2012.17%205.92304ZM15.3447%208.72941C15.3447%209.60379%2013.3083%2010.5814%2010.5826%2010.5814C10.3359%2010.5814%2010.0912%2010.5728%209.84974%2010.5569C11.2764%2010.037%2012.17%209.1924%2012.17%208.20028V6.99254C14.1456%207.28687%2015.3447%208.08586%2015.3447%208.72941ZM4.76216%209.93648V8.36299C5.2885%208.43157%205.81876%208.46559%206.34955%208.46484C6.88033%208.46559%207.4106%208.43157%207.93694%208.36299V9.93648C7.41138%2010.0141%206.88081%2010.0528%206.34955%2010.0522C5.81829%2010.0528%205.28772%2010.0141%204.76216%209.93648ZM11.1117%207.26967V8.20028C11.1117%208.7552%2010.2909%209.35113%208.99519%209.71293V8.16721C9.84908%207.96019%2010.572%207.65197%2011.1117%207.26967ZM6.34955%203.70268C9.07522%203.70268%2011.1117%204.68025%2011.1117%205.55463C11.1117%206.42902%209.07522%207.40659%206.34955%207.40659C3.62387%207.40659%201.58739%206.42902%201.58739%205.55463C1.58739%204.68025%203.62387%203.70268%206.34955%203.70268ZM1.58739%208.20028V7.26967C2.1271%207.65197%202.85002%207.96019%203.7039%208.16721V9.71293C2.4082%209.35113%201.58739%208.7552%201.58739%208.20028ZM5.82042%2011.3751V11.0992C5.99437%2011.1059%206.17031%2011.1105%206.34955%2011.1105C6.60618%2011.1105%206.85685%2011.1019%207.1029%2011.0873C7.37623%2011.1852%207.65465%2011.2682%207.93694%2011.336V12.8877C6.64123%2012.5259%205.82042%2011.93%205.82042%2011.3751ZM8.99519%2013.1113V11.5338C9.52136%2011.6045%2010.0517%2011.6399%2010.5826%2011.6396C11.1134%2011.6404%2011.6436%2011.6063%2012.17%2011.5378V13.1113C11.1173%2013.2656%2010.0478%2013.2656%208.99519%2013.1113ZM13.2282%2012.8877V11.342C14.0821%2011.135%2014.8
105%2010.8267%2015.3447%2010.4444V11.3751C15.3447%2011.93%2014.5239%2012.5259%2013.2282%2012.8877Z'%20fill='%23E46319'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_0_35'%3e%3crect%20width='16.9321'%20height='16.9321'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",G=t=>t.toLocaleString("en-NG",{maximumFractionDigits:0}),n2=t=>{const n=t.replace(/\D/g,"");return n?Number(n):0},J=t=>t>0?G(t):"",h0=({amount:t,onAmountChange:n})=>{const[o,a]=h.useState(!1),[d,s]=h.useState(""),c=o?d:J(t),u=g=>{const b=g.replace(/\D/g,"");if(!b){s(""),n(0);return}const w=n2(b);s(G(w)),n(w)};return e.jsxs(m,{gap:4,align:"center",w:"100%",bg:"#F5F9FF",borderWidth:"1px",borderStyle:"dashed",borderColor:"rgba(31, 54, 95, 0.2)",borderRadius:"16px",px:4,py:5,children:[e.jsxs(x,{align:"center",gap:2,children:[e.jsx(p,{boxSize:"18px",overflow:"hidden",children:e.jsx(k,{src:t2,alt:"",boxSize:"18px",objectFit:"contain"})}),e.jsx(l,{fontSize:"sm",color:r.text.primary,children:"Enter amount to Fund"})]}),e.jsxs(x,{align:"center",justify:"center",w:"100%",maxW:"280px",minH:"64px",bg:r.white.DEFAULT,borderWidth:"1.5px",borderStyle:"dashed",borderColor:o?r.orange[400]:r.gray[300],borderRadius:"12px",px:4,gap:1,transition:"border-color 0.15s ease, box-shadow 0.15s ease",boxShadow:o?"0px 0px 0px 3px rgba(228, 105, 33, 0.12)":"none",children:[e.jsx(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:r.orange[500],letterSpacing:"-0.03em",lineHeight:"1",userSelect:"none",children:"₦"}),e.jsx(B0,{value:c,onChange:g=>u(g.target.value),onFocus:()=>{a(!0),s(J(t))},onBlur:()=>{a(!1),s("")},inputMode:"numeric",pattern:"[0-9,]*",placeholder:"0","aria-label":"Amount to fund",variant:"flushed",border:"none",outline:"none",boxShadow:"none",textAlign:"center",fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:r.orange[500],letterSpacing:"-0.03em",p:0,h:"auto",minW:"0",flex:"1",_placeholder:{color:r.orange[200]},_focus:{border:"none",outline:"none",boxShadow:"none"},_focusVisible:{border:"none",outline:"none",boxShadow:"none"}})]}),e.jsx(x,{gap:2,flexWrap:"wrap",justify:"center",children:k0.map(g=>e.jsx(p,{as:"button",px:3.5,py:1.5,borderRadius:"full",bg:r.white.DEFAULT,borderWidth:"1px",borderColor:"rgba(31, 54, 95, 0.12)",onClick:()=>{const b=t+g;n(b),o&&s(G(b))},transition:"transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease",css:{WebkitTapHighlightColor:"transparent"},_hover:{borderColor:r.orange[300],bg:r.orange[50],transform:"translateY(-1px)",boxShadow:"0px 4px 10px rgba(228, 105, 33, 0.12)"},_active:{transform:"translateY(0) scale(0.96)",boxShadow:"none"},children:e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:r.navy[500],children:W0(g)})},g))})]})},r2=({options:t,selectedId:n,onSelect:o,addLabel:a,onAdd:d,showAddButton:s=!0})=>e.jsxs(m,{gap:3,w:"100%",children:[t.map(c=>{const u=c.id===n;return e.jsxs(x,{as:"button",align:"center",justify:"space-between",gap:3,w:"100%",p:3.5,borderRadius:"14px",borderWidth:"1px",borderColor:u?r.orange[400]:"rgba(31, 54, 95, 0.12)",bg:u?"rgba(228, 105, 33, 0.04)":r.white.DEFAULT,onClick:()=>o(c.id),textAlign:"left",transition:"transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease",css:{WebkitTapHighlightColor:"transparent"},_hover:{borderColor:u?r.orange[400]:r.orange[200],boxShadow:"0px 4px 12px rgba(31, 54, 95, 0.06)",transform:"translateY(-1px)"},_active:{transform:"translateY(0) scale(0.99)"},children:[e.jsxs(x,{align:"center",gap:3,minW:0,children:[e.jsx(x,{align:"center",justify:"center",boxSize:"40px",borderRadius:"10px",bg:r.orange[50],overflow:"hidden",flexShrink:0,children:e.jsx(k,{src:c.iconSrc,alt:"",boxSize:"40px",objectFit:"cover"})}),e.jsxs(m,{gap:.5,minW:0,children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:r.navy[500],truncate:!0,children:c.title}),e.jsx(l,{fontSize:"xs",color:r.text.gray,truncate:!0,children:c.subtitle})]})]}),e.jsx(p,{boxSize:"20px",borderRadius:"full",borderWidth:"2px",borderColor:u?r.orange[500]:r.gray[300],display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:u?e.jsx(p,{boxSize:"10px",borderRadius:"full",bg:r.orange[500]}):null})]},c.id)}),s?e.jsxs(x,{as:"button",align:"center",justify:"center",gap:2,w:"100%",py:4,borderRadius:"16px",borderWidth:"1px",borderStyle:"dashed",borderColor:r.orange[500],bg:"rgba(255, 246, 236, 0.5)",onClick:d,transition:"transform 0.15s ease, background 0.15s ease, border-color 0.15s ease",css:{WebkitTapHighlightColor:"transparent"},_hover:{bg:"rgba(255, 246, 236, 0.9)",borderColor:r.orange[600],transform:"translateY(-1px)"},_active:{transform:"translateY(0) scale(0.99)"},children:[e.jsx(l,{fontSize:"lg",color:r.orange[500],lineHeight:"1",children:"+"}),e.jsx(l,{fontSize:"15px",fontWeight:"medium",color:r.orange[500],children:a})]}):null]}),e0=({amount:t,onAmountChange:n,options:o,selectedId:a,onSelect:d,addLabel:s,onAdd:c,isFunding:u,onProceed:g,showAddButton:b=!0})=>e.jsxs(m,{gap:5,minH:0,children:[e.jsx(h0,{amount:t,onAmountChange:n}),e.jsx(p,{minH:0,children:e.jsx(r2,{options:o,selectedId:a,onSelect:d,addLabel:s,onAdd:c,showAddButton:b})}),e.jsx(D,{buttonType:"primary",text:u?"Processing…":"Proceed to checkout",size:"lg",borderRadius:"full",width:"100%",disabled:u,onClick:g})]}),t0=(t,n)=>t&&n.includes(t)?t:n[0]??"",o2=t=>t.replace(/\D/g,""),n0=t=>t.externalReference?.trim()||t.reference?.trim()||"",r0=({channel:t,link:n,externalReference:o,createReference:a,accountNumber:d,amount:s,markIntentionalRedirect:c}
1)=>{T0({channel:t,accountNumber:d,amount:s,startedAt:Date.now(),externalReference:o,...a?{createReference:a}:{}}),c(),window.location.assign(n)},a2=async({externalReference:t,queryClient:n})=>{try{await R0(t)==="successful"?f.success("Wallet funded successfully"):f.error("Wallet funding failed. Please try again.")}catch{f.message("Funding is still processing. Check Recent Transactions shortly.")}finally{n.invalidateQueries({queryKey:i0}),n.invalidateQueries({queryKey:p0})}},s2=({open:t,virtualAccount:n,onClose:o})=>{const a=s0(),d=m0(),{markIntentionalRedirect:s}=N0(),c=J0(),{error:u}=l0(),[g,b]=h.useState(0),[w,A]=h.useState(""),[j,I]=h.useState(""),[B,M]=h.useState(!1),L=h.useCallback(()=>{M(!1)},[]),v=c0(n)||void 0,{cards:H}=$({accountNumber:v,page:1,size:20,paymentMethod:"CARD",enabled:t}),{banks:R}=$({accountNumber:v,page:1,size:20,paymentMethod:"BANK",enabled:t}),E=h.useMemo(()=>H.map(i=>({id:i.id,title:i.label,subtitle:`Card ending in **** ${i.last4}`,iconSrc:i.iconSrc})),[H]),N=h.useMemo(()=>R.map(i=>({id:i.id,title:i.bankName,subtitle:`${i.accountNumber} • ${i.accountType}`,iconSrc:i.iconSrc})),[R]),_=t0(w,E.map(i=>i.id)),O=t0(j,N.map(i=>i.id)),V=()=>{if(!v)return f.error(K(u)??"Wallet account is not ready yet. Please try again."),null;if(!g||g<=0)return f.error("Enter an amount to fund your wallet"),null;const i=a?.email?.trim()??"";if(!Q(i))return f.error("Add and verify your email before funding your wallet"),null;const C=o2(a?.phoneNumber??"");return C?{accountNumber:v,email:i,phone:C,amount:g}:(f.error("Phone number is required to fund your wallet"),null)},U=i=>{o(),b(0),M(!0),a2({externalReference:i,queryClient:d})},z=async i=>{const C=V();if(!C)return;const y=i==="CARD"?_:O;if(!y){f.error(i==="CARD"?"Select or link a card first":"Select or link a bank account first");return}const S=q({channel:i});try{const W=await c.mutateAsync({email:C.email,url:{redirect:S.redirect,cancel:S.cancel},channel:i,reference:X(),phone:C.phone,amount:C.amount,currency:"NGN",accountNumber:C.accountNumber,mandate:y}),P=n0(W);if(!P){f.error("Funding started, but no transaction reference was returned");return}if(W.link){r0({channel:i,link:W.link,externalReference:P,createReference:W.reference,accountNumber:C.accountNumber,amount:C.amount,markIntentionalRedirect:s});return}U(P)}catch(W){f.error(K(W)??"Could not fund wallet. Please try again.")}},F=async()=>{const i=V();if(!i)return;const C=q({channel:"CHECKOUT"});try{const y=await c.mutateAsync({email:i.email,url:{redirect:C.redirect,cancel:C.cancel},channel:"CHECKOUT",reference:X(),phone:i.phone,amount:i.amount,currency:"NGN",accountNumber:i.accountNumber}),S=n0(y);if(!S){f.error("Funding started, but no transaction reference was returned");return}if(y.link){r0({channel:"CHECKOUT",link:y.link,externalReference:S,createReference:y.reference,accountNumber:i.accountNumber,amount:i.amount,markIntentionalRedirect:s});return}U(S)}catch(y){f.error(K(y)??"Could not start online funding. Please try again.")}};return{amount:g,setAmount:b,cardOptions:E,bankOptions:N,activeCardId:_,activeBankId:O,setSelectedCardId:A,setSelectedBankId:I,isFunding:c.isPending,isProcessingModalOpen:B,closeProcessingModal:L,fundWithMandate:z,fundCheckout:F}},i2=({amount:t,onAmountChange:n,isFunding:o,onProceed:a})=>e.jsxs(m,{gap:5,children:[e.jsx(h0,{amount:t,onAmountChange:n}),e.jsx(D,{buttonType:"primary",text:o?"Redirecting…":"Proceed to payment",size:"lg",borderRadius:"full",width:"100%",disabled:o,onClick:a})]}),l2=({activeTab:t,onChange:n})=>e.jsx(x,{bg:r.gray[100],borderRadius:"full",p:"4px",gap:1,w:"100%",overflowX:"auto",children:E0.map(o=>{const a=o.id===t;return e.jsx(p,{as:"button",flex:1,minW:"72px",py:2.5,px:3,borderRadius:"full",bg:a?r.white.DEFAULT:"transparent",boxShadow:a?"0px 2px 8px rgba(31, 54, 95, 0.08)":"none",onClick:()=>n(o.id),transition:"background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease",_hover:a?{}:{bg:"rgba(255, 255, 255, 0.55)"},_active:{transform:"scale(0.97)"},css:{WebkitTapHighlightColor:"transparent"},children:e.jsx(l,{fontSize:"sm",fontWeight:a?"semibold":"medium",color:a?r.navy[500]:r.text.primary,whiteSpace:"nowrap",transition:"color 0.15s ease",children:o.label})},o.id)})}),c2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2013.0014%2013.0014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M12.5951%2010.5632C12.5951%2010.6709%2012.5523%2010.7743%2012.4761%2010.8505C12.3999%2010.9267%2012.2966%2010.9695%2012.1888%2
1010.9695H0.812625C0.70487%2010.9695%200.601527%2010.9267%200.525332%2010.8505C0.449138%2010.7743%200.406332%2010.6709%200.406332%2010.5632C0.406332%2010.4554%200.449138%2010.3521%200.525332%2010.2759C0.601527%2010.1997%200.70487%2010.1569%200.812625%2010.1569H12.1888C12.2966%2010.1569%2012.3999%2010.1997%2012.4761%2010.2759C12.5523%2010.3521%2012.5951%2010.4554%2012.5951%2010.5632ZM0.827861%204.9858C0.803696%204.90059%200.808033%204.80983%200.840213%204.72731C0.872393%204.6448%200.930652%204.57506%201.00612%204.52872L6.28794%201.27837C6.35194%201.23902%206.4256%201.21819%206.50073%201.21819C6.57586%201.21819%206.64953%201.23902%206.71353%201.27837L11.9953%204.52872C12.0708%204.57501%2012.1291%204.64469%2012.1614%204.72717C12.1936%204.80965%2012.198%204.9004%2012.1739%204.98562C12.1498%205.07083%2012.0986%205.14584%2012.0279%205.19923C11.9573%205.25262%2011.8711%205.28147%2011.7825%205.28138H10.5637V8.53172H11.3763C11.484%208.53172%2011.5874%208.57453%2011.6635%208.65072C11.7397%208.72692%2011.7825%208.83026%2011.7825%208.93802C11.7825%209.04577%2011.7397%209.14911%2011.6635%209.22531C11.5874%209.3015%2011.484%209.34431%2011.3763%209.34431H1.62521C1.51746%209.34431%201.41411%209.3015%201.33792%209.22531C1.26172%209.14911%201.21892%209.04577%201.21892%208.93802C1.21892%208.83026%201.26172%208.72692%201.33792%208.65072C1.41411%208.57453%201.51746%208.53172%201.62521%208.53172H2.4378V5.28138H1.21892C1.13044%205.28141%201.04437%205.25255%200.973792%205.1992C0.90321%205.14586%200.851971%205.07092%200.827861%204.9858ZM7.31332%208.12543C7.31332%208.23318%207.35612%208.33653%207.43232%208.41272C7.50851%208.48892%207.61186%208.53172%207.71961%208.53172C7.82737%208.53172%207.93071%208.48892%208.00691%208.41272C8.0831%208.33653%208.12591%208.23318%208.12591%208.12543V5.68767C8.12591%205.57991%208.0831%205.47657%208.00691%205.40038C7.93071%205.32418%207.82737%205.28138%207.71961%205.28138C7.61186%205.28138%207.50851%205.32418%207.43232%205.40038C7.35612%205.47657%207.31332%205.57991%207.31332%205.68767V8.12543ZM4.87556%208.12543C4.87556%208.23318%204.91836%208.33653%204.99456%208.41272C5.07075%208.48892%205.1741%208.53172%205.28185%208.53172C5.38961%208.53172%205.49295%208.48892%205.56914%208.41272C5.64534%208.33653%205.68815%208.23318%205.68815%208.12543V5.68767C5.68815%205.57991%205.64534%205.47657%205.56914%205.40038C5.49295%205.32418%205.38961%205.28138%205.28185%205.28138C5.1741%205.28138%205.07075%205.32418%204.99456%205.40038C4.91836%205.47657%204.87556%205.57991%204.87556%205.68767V8.12543Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",d2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M10%201.875C8.39303%201.875%206.82214%202.35152%205.48599%203.24431C4.14984%204.1371%203.10844%205.40605%202.49348%206.8907C1.87852%208.37535%201.71761%2010.009%202.03112%2011.5851C2.34462%2013.1612%203.11846%2014.6089%204.25476%2015.7452C5.39106%2016.8815%206.8388%2017.6554%208.41489%2017.9689C9.99099%2018.2824%2011.6247%2018.1215%2013.1093%2017.5065C14.594%2016.8916%2015.8629%2015.8502%2016.7557%2014.514C17.6485%2013.1779%2018.125%2011.607%2018.125%2010C18.1227%207.84581%2017.266%205.78051%2015.7427%204.25727C14.2195%202.73403%2012.1542%201.87727%2010%201.875ZM9.6875%205.625C9.87292%205.625%2010.0542%205.67998%2010.2083%205.783C10.3625%205.88601%2010.4827%206.03243%2010.5536%206.20373C10.6246%206.37504%2010.6432%206.56354%2010.607%206.7454C10.5708%206.92725%2010.4815%207.0943%2010.3504%207.22541C10.2193%207.35652%2010.0523%207.44581%209.8704%207.48199C9.68854%207.51816%209.50004%207.49959%209.32873%207.42864C9.15743%207.35768%209.01101%207.23752%208.908%207.08335C8.80498%206.92918%208.75%206.74792%208.75%206.5625C8.75%206.31386%208.84877%206.0754%209.02459%205.89959C9.2004%205.72377%209.43886%205.625%209.6875%205.625ZM10.625%2014.375C10.2935%2014.375%209.97554%2014.2433%209.74112%2014.0089C9.5067%2013.7745%209.375%2013.4565%209.375%2013.125V10C9.20924%2010%209.05027%209.93415%208.93306%209.81694C8.81585%209.69973%208.75%209.54076%208.75%209.375C8.75%209.20924%208.81585%209.05027%208.93306%208.93306C9.05027%208.81585%209.20924%208.75%209.375%208.75C9.70652%208.75%2010.0245%208.8817%2010.2589%209.11612C10.4933%209.35054%2010.625%209.66848%2010.625%2010V13.125C10.7908%2013.125%2010.9497%2013.1908%2011.0669%2013.3081C11.1842%2013.4253%2011.25%2013.5842%2011.25%2013.75C11.25%2013.9158%2011.1842%2014.0747%2011.0669%2014.1919C10.9497%2014.3092%2010.7908%2014.375%2010.625%2014.375Z'%20fill='%23E46921'/%3e%3c/g%3e%3c/svg%3e",p2="/assets/card-edu-BrQjTfKf.jpeg",u2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M16.875%202.1875H6.875C6.62636%202.1875%206.3879%202.28627%206.21209%202.46209C6.03627%202.6379%205.9375%202.87636%205.9375%203.125V5.9375H3.125C2.87636%205.9375%202.6379%206.03627%202.46209%206.21209C2.28627%206.3879%202.1875%206.62636%202.1875%206.875V16.875C2.1875%2017.1236%202.28627%2017.3621%202.46209%2017.5379C2.6379%2017.7137%202.87636%2017.8125%203.125%2017.8125H13.125C13.3736%2017.8125%2013.6121%2017.7137%2013.7879%2017.5379C13.9637%201
17.3621%2014.0625%2017.1236%2014.0625%2016.875V14.0625H16.875C17.1236%2014.0625%2017.3621%2013.9637%2017.5379%2013.7879C17.7137%2013.6121%2017.8125%2013.3736%2017.8125%2013.125V3.125C17.8125%202.87636%2017.7137%202.6379%2017.5379%202.46209C17.3621%202.28627%2017.1236%202.1875%2016.875%202.1875ZM12.1875%2015.9375H4.0625V7.8125H12.1875V15.9375ZM15.9375%2012.1875H14.0625V6.875C14.0625%206.62636%2013.9637%206.3879%2013.7879%206.21209C13.6121%206.03627%2013.3736%205.9375%2013.125%205.9375H7.8125V4.0625H15.9375V12.1875Z'%20fill='%23324C7A'/%3e%3c/g%3e%3c/svg%3e",x2=({virtualAccount:t})=>{const[n,o]=h.useState(!1),a=d0(t),d=u0(a),s=async()=>{try{await navigator.clipboard.writeText(a),o(!0),f.success("Account number copied"),window.setTimeout(()=>o(!1),2e3)}catch{f.error("Unable to copy account number")}};return e.jsxs(m,{gap:4,w:"100%",children:[e.jsxs(x,{align:"flex-start",gap:2.5,bg:r.orange[50],borderRadius:"12px",px:3.5,py:3,children:[e.jsx(p,{boxSize:"18px",flexShrink:0,mt:"2px",overflow:"hidden",children:e.jsx(k,{src:d2,alt:"",boxSize:"18px",objectFit:"contain"})}),e.jsxs(l,{fontSize:"sm",color:r.navy[500],lineHeight:"1.5",children:["Transfer any amount to this account to fund your wallet"," ",e.jsx(l,{as:"span",fontWeight:"semibold",children:"instantly."})]})]}),e.jsxs(p,{position:"relative",borderRadius:"16px",overflow:"hidden",bg:r.navy[500],minH:"180px",children:[e.jsx(p,{position:"absolute",inset:0,bgImage:`url(${p2})`,bgSize:"cover",bgPos:"center",opacity:.35,pointerEvents:"none"}),e.jsxs(m,{position:"relative",zIndex:1,gap:5,p:5,children:[e.jsxs(x,{align:"center",gap:2,children:[e.jsx(p,{boxSize:"18px",overflow:"hidden",children:e.jsx(k,{src:u2,alt:"",boxSize:"18px",objectFit:"contain"})}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:"white",textTransform:"capitalize",children:t.bankName})]}),e.jsxs(m,{gap:1,children:[e.jsx(l,{fontSize:"xs",letterSpacing:"0.08em",color:"rgba(255,255,255,0.65)",textTransform:"uppercase",children:"Account Number"}),e.jsx(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:"white",children:d})]}),e.jsxs(m,{gap:1,children:[e.jsx(l,{fontSize:"xs",letterSpacing:"0.08em",color:"rgba(255,255,255,0.65)",textTransform:"uppercase",children:"Account Name"}),e.jsx(l,{fontSize:"md",fontWeight:"semibold",color:"white",children:t.accountName})]})]})]}),e.jsxs(x,{as:"button",align:"center",justify:"center",gap:2,w:"100%",py:3.5,borderRadius:"14px",borderWidth:"1px",borderColor:"rgba(31, 54, 95, 0.16)",bg:r.white.DEFAULT,onClick:s,transition:"transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease",css:{WebkitTapHighlightColor:"transparent"},_hover:{bg:r.gray[50],borderColor:r.orange[200],boxShadow:"0px 4px 12px rgba(31, 54, 95, 0.06)",transform:"translateY(-1px)"},_active:{transform:"translateY(0) scale(0.98)",boxShadow:"none"},children:[e.jsx(k,{src:c2,alt:"",boxSize:"18px",objectFit:"contain"}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:r.navy[500],children:n?"Copied!":"Copy Account Number"})]})]})},m2=({open:t,onClose:n})=>(h.useEffect(()=>{if(!t)return;const o=window.setTimeout(()=>{n()},3e3);return()=>{window.clearTimeout(o)}}
1,[t,n]),e.jsx(x0,{open:t,onClose:n,size:"md",maxW:"420px",bodyPadded:!1,showCloseButton:!1,closeOnInteractOutside:!1,closeOnEscape:!1,mobileBottomSheet:!0,contentProps:{borderRadius:{base:"24px 24px 0 0",md:"24px"},overflow:"hidden",w:{base:"100%",md:"420px"}},children:e.jsx(p,{px:{base:5,md:6},pt:{base:8,md:9},pb:{base:8,md:9},bgImage:"linear-gradient(180deg, rgba(255,246,236,0.9) 0%, rgba(255,255,255,1) 42%)",children:e.jsxs(m,{gap:4,align:"center",textAlign:"center",children:[e.jsx(x,{align:"center",justify:"center",boxSize:"88px",borderRadius:"full",bg:r.orange[50],borderWidth:"1px",borderColor:r.orange[100],children:e.jsx(p,{color:r.orange[500],lineHeight:0,children:e.jsx(_0,{size:40})})}),e.jsxs(m,{gap:2,children:[e.jsx(l,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:r.navy[500],letterSpacing:"-0.02em",children:"Payment is processing"}),e.jsx(l,{fontSize:"sm",color:r.text.gray,lineHeight:"1.55",maxW:"300px",mx:"auto",children:"We'll notify you when your wallet top-up completes."})]})]})})})),g2=({open:t,onClose:n,virtualAccount:o,initialTab:a="transfer",onAddCard:d,onAddBank:s,showAddPaymentSource:c=!0})=>{const[u,g]=h.useState(a),{amount:b,setAmount:w,cardOptions:A,bankOptions:j,activeCardId:I,activeBankId:B,setSelectedCardId:M,setSelectedBankId:L,isFunding:v,isProcessingModalOpen:H,closeProcessingModal:R,fundWithMandate:E,fundCheckout:N}=s2({open:t,virtualAccount:o,onClose:n});return e.jsxs(e.Fragment,{children:[e.jsx(x0,{open:t,onClose:n,size:"lg",maxW:"520px",bodyPadded:!1,showCloseButton:!0,mobileBottomSheet:!0,scrollBehavior:"inside",contentProps:{borderRadius:{base:"24px 24px 0 0",md:"28px"},overflow:"hidden",w:{base:"100%",md:"520px"},maxH:{base:"92dvh",md:"min(85vh, 640px)"},display:"flex",flexDirection:"column"},bodyProps:{display:"flex",flexDirection:"column",flex:"1",minH:0,overflow:"hidden",p:0},children:e.jsxs(p,{display:"flex",flexDirection:"column",flex:"1",minH:0,overflow:"hidden",bgImage:"linear-gradient(180deg, rgba(255,246,236,0.45) 0%, rgba(255,255,255,1) 28%)",children:[e.jsxs(m,{gap:4,flexShrink:0,px:{base:5,md:7},pt:{base:6,md:8},children:[e.jsx(e2,{}),e.jsx(l2,{activeTab:u,onChange:g})]}),e.jsxs(p,{flex:"1",minH:0,overflowY:"auto",px:{base:5,md:7},pt:5,pb:{base:6,md:7},children:[u==="transfer"?e.jsx(x2,{virtualAccount:o}):null,u==="online"?e.jsx(i2,{amount:b,onAmountChange:w,isFunding:v,onProceed:()=>{N()}}):null,u==="card"?e.jsx(e0,{amount:b,onAmountChange:w,options:A,selectedId:I,onSelect:M,addLabel:"Add New Card",showAddButton:c,onAdd:()=>
1{if(d){n(),d();return}f.message("Open Linked Cards to add a new card")},isFunding:v,onProceed:()=>{E("CARD")}}):null,u==="bank"?e.jsx(e0,{amount:b,onAmountChange:w,options:j,selectedId:B,onSelect:L,addLabel:"Add New Bank",showAddButton:c&&I0,onAdd:()=>{if(s){n(),s();return}f.message("Open Linked Banks to add a new bank account")},isFunding:v,onProceed:()=>{E("BANK")}}):null]})]})}),e.jsx(m2,{open:H,onClose:R})]})},h2={kyc:{title:"Complete KYC to unlock your wallet",icon:O0,primaryLabel:"Verify NIN"},email:{title:"Verify your email to unlock your wallet",icon:D0,primaryLabel:"Verify Email"},generic:{title:"Couldn't load wallet",icon:P0,primaryLabel:"Retry"}},b2=({reason:t,message:n,onVerifyKyc:o,onVerifyEmail:a,onRetry:d,onGoToKycPage:s})=>{const c=h2[t],u=c.icon,g=()=>{t==="kyc"?o():t==="email"?a():d()};return e.jsx(p,{w:"100%",bg:r.orange[50],borderWidth:"1px",borderColor:r.orange[200],borderRadius:"20px",p:{base:5,md:6},children:e.jsxs(m,{gap:5,children:[e.jsxs(x,{align:"flex-start",gap:3,children:[e.jsx(x,{align:"center",justify:"center",boxSize:"44px",borderRadius:"full",bg:r.orange[100],flexShrink:0,children:e.jsx(L0,{as:u,boxSize:5,color:r.orange[500]})}),e.jsxs(m,{gap:1.5,minW:0,children:[e.jsx(l,{fontSize:{base:"lg",md:"xl"},fontWeight:"bold",color:r.navy[500],letterSpacing:"-0.02em",children:c.title}),e.jsx(l,{fontSize:"sm",color:r.text.gray,lineHeight:"1.5",children:t==="email"||t==="kyc"?n:n||"Something went wrong while loading your wallet."})]})]}),e.jsxs(m,{gap:2,w:"100%",children:[e.jsx(D,{buttonType:"primary",text:c.primaryLabel,size:"md",borderRadius:"full",onClick:g,fullWidth:!0}),t==="kyc"&&s?e.jsx(D,{buttonType:"outline",text:"Go to KYC settings",size:"md",borderRadius:"full",onClick:s,fullWidth:!0}):null,t!=="generic"?e.jsx(D,{buttonType:"ghost",text:"Retry",size:"md",borderRadius:"full",onClick:d,fullWidth:!0}):null]})]})})},f2="/assets/wallet-card-bg-DQSf8cXY.png",C2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2020.2291%2020.6441'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Frame'%3e%3cg%20id='Vector'%20filter='url(%23filter0_i_0_4)'%3e%3cpath%20d='M15.8024%205.16232V13.549C15.8024%2013.7201%2015.7358%2013.8842%2015.6173%2014.0052C15.4987%2014.1262%2015.3379%2014.1941%2015.1703%2014.1941C15.0026%2014.1941%2014.8418%2014.1262%2014.7233%2014.0052C14.6047%2013.8842%2014.5381%2013.7201%2014.5381%2013.549V6.7195L5.50296%2015.9408C5.38435%2016.0619%205.22346%2016.1299%205.05571%2016.1299C4.88796%2016.1299%204.72708%2016.0619%204.60846%2015.9408C4.48984%2015.8198%204.4232%2015.6556%204.4232%2015.4844C4.4232%2015.3132%204.48984%2015.149%204.60846%2015.028L13.6444%205.80745H6.95219C6.78453%205.80745%206.62374%205.73948%206.50519%205.61849C6.38663%205.49751%206.32003%205.33342%206.32003%205.16232C6.32003%204.99122%206.38663%204.82713%206.50519%204.70614C6.62374%204.58516%206.78453%204.51719%206.95219%204.51719H15.1703C15.3379%204.51719%2015.4987%204.58516%2015.6173%204.70614C15.7358%204.82713%2015.8024%204.99122%2015.8024%205.16232Z'%20fill='%23E46921'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_i_0_4'%20x='4.4232'%20y='4.51719'%20width='11.3792'%20height='17.9006'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='6.28787'/%3e%3cfeGaussianBlur%20stdDeviation='3.14393'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='arithmetic'%20k2='-1'%20k3='1'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='shape'%20result='effect1_innerShadow_0_4'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",w2="/assets/pill-btn-pattern-BwGJNwM6.jpeg",y2=({label:t,iconSrc:n,width:o,iconWidth:a,iconHeight:d,iconCrop:s,onClick:c})=>e.jsxs(x,{as:"button",position:"relative",align:"center",justify:"center",overflow:"hidden",
1w:o,px:"7px",py:"10px",borderRadius:"24px",borderWidth:"0.5px",borderColor:"rgba(31, 54, 95, 0.24)",bg:r.white.DEFAULT,boxShadow:"0px 3.487px 11.246px 0px rgba(31, 54, 95, 0.06)",cursor:"pointer",transform:"translateY(0) scale(1)",transition:"transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.2s ease, border-color 0.2s ease",css:{WebkitTapHighlightColor:"transparent","& .wallet-pill-icon":{transition:"transform 0.2s cubic-bezier(0.32, 0.72, 0, 1)"},"& .wallet-pill-arrow":{transition:"transform 0.2s cubic-bezier(0.32, 0.72, 0, 1)"},"&:hover .wallet-pill-icon":{transform:"scale(1.08)"},"&:hover .wallet-pill-arrow":{transform:"translate(2px, -2px)"},"&:active .wallet-pill-icon":{transform:"scale(1)"},"&:active .wallet-pill-arrow":{transform:"translate(0, 0)"}},_hover:{transform:"translateY(-2px) scale(1.02)",borderColor:"rgba(228, 105, 33, 0.35)",boxShadow:"0px 8px 20px 0px rgba(31, 54, 95, 0.12), 0px 2px 6px 0px rgba(228, 105, 33, 0.12)"},_active:{transform:"translateY(0) scale(0.97)",boxShadow:"0px 2px 6px 0px rgba(31, 54, 95, 0.08)"},onClick:c,children:[e.jsx(p,{position:"absolute",inset:0,borderRadius:"24px",bg:r.white.DEFAULT,pointerEvents:"none"}),e.jsx(p,{position:"absolute",inset:0,borderRadius:"24px",bgImage:`url(${w2})`,bgSize:"cover",bgPos:"center",opacity:.2,pointerEvents:"none"}),e.jsxs(x,{position:"relative",zIndex:1,align:"center",justify:"space-between",w:"100%",px:"6px",children:[e.jsxs(x,{align:"center",gap:"16.7px",children:[e.jsx(p,{className:"wallet-pill-icon",w:a,h:d,flexShrink:0,overflow:"hidden",position:"relative",children:e.jsx(k,{src:n,alt:"",position:"absolute",pointerEvents:"none",...s?{w:s.width,h:s.height,left:s.left,top:s.top,maxW:"none"}:{inset:0,w:"100%",h:"100%",objectFit:"contain"}})}),e.jsx(l,{fontSize:"14.672px",fontWeight:"medium",lineHeight:"1.2",letterSpacing:"-0.5869px",color:r.text.primary,whiteSpace:"nowrap",fontFamily:"Inter, system-ui, sans-serif",children:t})]}),e.jsx(p,{className:"wallet-pill-arrow",w:"20.229px",h:"20.644px",flexShrink:0,overflow:"hidden",children:e.jsx(k,{src:C2,alt:"",w:"20.229px",h:"20.644px",objectFit:"contain"})})]})]}),j2=`url("data:image/svg+xml;utf8,<svg viewBox='0 0 798 215' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(0 -41.323 -41.323 0 399 107.5)'><stop stop-color='rgba(255,255,255,1)' offset='0.0012531'/><stop stop-color='rgba(191,191,191,0.75)' offset='0.00093985'/><stop stop-color='rgba(128,128,128,0.5)' offset='0.00062657'/><stop stop-color='rgba(64,64,64,0.25)' offset='0.00031328'/><stop stop-color='rgba(0,0,0,0)' offset='0'/></radialGradient></defs></svg>")`,v2={width:"130.66%",height:"119.91%",left:"-15.98%",top:"-9.22%"},S2="••••••",A2=({accountNumber:t,copied:n,onCopy:o})=>e.jsxs(x,{align:"center",gap:2,maxW:"100%",minW:0,children:[e.jsxs(l,{fontSize:{base:"20px",md:"18px"},lineHeight:{base:"28px",md:"28px"},fontWeight:"semibold",color:"white",fontFamily:"Inter, system-ui, sans-serif",letterSpacing:{base:"0.04em",md:"normal"},whiteSpace:"nowrap",children:[e.jsxs(l,{as:"span",display:{base:"none",md:"inline"},fontWeight:"normal",color:"rgba(255, 255, 255, 0.8)",children:["Account Number:"," "]}),t?u0(t):"—"]}),t?e.jsx(g0,{"aria-label":n?"Account number copied":"Copy account number",variant:"ghost",size:"sm",color:"white",minW:"auto",h:"auto",p:1,borderRadius:"full",flexShrink:0,_hover:{bg:"rgba(255, 255, 255, 0.16)"},_active:{bg:"rgba(255, 255, 255, 0.22)"},onClick:o,children:n?e.jsx(K0,{size:18}):e.jsx(Y0,{size:18})}):null]}),o0=({label:t,value:n,capitalize:o=!1})=>e.jsxs(l,{fontSize:{base:"20px",md:"18px"},lineHeight:{base:"28px",md:"28px"},fontWeight:"semibold",color:"white",fontFamily:"Inter, system-ui, sans-serif",letterSpacing:{base:"0.02em",md:"normal"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:[e.jsxs(l,{as:"span",display:{base:"none",md:"inline"},fontWeight:"normal",color:"rgba(255, 255, 255, 0.8)",children:[t,":"," "]}),o?n?.charAt(0).toUpperCase()+n?.slice(1):n||"—"]}
1),k2=({balance:t,accountNumber:n,accountName:o="",bankName:a="",onAddMoney:d})=>{const[s,c]=h.useState(!0),[u,g]=h.useState(!1),b=q0(t),w=`.${Math.abs(t).toFixed(2).split(".")[1]}`,A=async()=>{if(n)try{await navigator.clipboard.writeText(n),g(!0),f.success("Account number copied"),window.setTimeout(()=>g(!1),2e3)}catch{f.error("Could not copy to clipboard")}};return e.jsxs(p,{position:"relative",w:"100%",h:{base:"auto",md:"auto"},minH:{base:"200px",md:"215px"},borderRadius:"20px",overflow:"hidden",boxShadow:"0px 8px 30px 0px rgba(228, 105, 33, 0.25)",children:[e.jsx(p,{position:"absolute",inset:0,borderRadius:"20px",bg:"#E46921",pointerEvents:"none"}),e.jsx(p,{position:"absolute",inset:0,borderRadius:"20px",bgImage:`url(${f2})`,bgSize:"cover",bgPos:"center",opacity:.58,pointerEvents:"none"}),e.jsx(p,{position:"absolute",inset:0,borderRadius:"20px",opacity:.1,bgImage:j2,bgSize:"100% 100%",pointerEvents:"none"}),e.jsx(p,{position:"relative",zIndex:1,px:"24px",pt:"24px",pb:"24px",children:e.jsxs(m,{gap:0,align:"flex-start",w:"100%",children:[e.jsxs(x,{align:"center",gap:2,children:[e.jsx(l,{fontSize:"14px",lineHeight:"21px",fontWeight:"normal",color:"rgba(255, 255, 255, 0.8)",fontFamily:"Inter, system-ui, sans-serif",whiteSpace:"nowrap",children:"Available Balance"}),e.jsx(g0,{"aria-label":s?"Hide balance":"Show balance",variant:"ghost",size:"sm",color:"white",minW:"auto",h:"auto",p:1,borderRadius:"full",alignSelf:"center",_hover:{bg:"rgba(255, 255, 255, 0.16)"},_active:{bg:"rgba(255, 255, 255, 0.22)"},onClick:()=>c(j=>!j),children:s?e.jsx(U0,{size:22}):e.jsx(Z0,{size:22})})]}),e.jsx(x,{align:"center",gap:3,pt:"4px",color:"white",children:s?e.jsxs(x,{align:"baseline",children:[e.jsx(l,{as:"span",fontSize:{base:"32px",md:"40px"},lineHeight:{base:"36px",md:"40px"},fontWeight:"semibold",fontFamily:"heading",letterSpacing:"-1px",whiteSpace:"nowrap",children:b}),e.jsx(l,{as:"span",fontSize:{base:"18px",md:"24px"},lineHeight:{base:"22px",md:"24px"},fontWeight:"semibold",fontFamily:"heading",letterSpacing:"-1px",children:w})]}):e.jsx(l,{fontSize:{base:"32px",md:"40px"},lineHeight:{base:"36px",md:"40px"},fontWeight:"semibold",fontFamily:"heading",letterSpacing:"0.12em",whiteSpace:"nowrap",children:S2})}),e.jsxs(m,{gap:1,pt:"16px",w:"100%",maxW:"100%",children:[e.jsx(A2,{accountNumber:n,copied:u,onCopy:()=>{A()}}),e.jsx(o0,{label:"Account Name",value:o}),e.jsx(o0,{label:"Bank Name",capitalize:!0,value:a})]}),e.jsx(x,{align:"center",gap:"23px",pt:"24px",flexWrap:"wrap",w:"100%",children:e.jsx(y2,{label:"Add Money",iconSrc:S0,width:{base:"100%",sm:"207px"},iconWidth:"23.353px",iconHeight:"30.93px",iconCrop:v2,onClick:d})})]})})]})},W2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M21%204.5H3C2.60218%204.5%202.22064%204.65804%201.93934%204.93934C1.65804%205.22064%201.5%205.60218%201.5%206V18C1.5%2018.3978%201.65804%2018.7794%201.93934%2019.0607C2.22064%2019.342%202.60218%2019.5%203%2019.5H21C21.3978%2019.5%2021.7794%2019.342%2022.0607%2019.0607C22.342%2018.7794%2022.5%2018.3978%2022.5%2018V6C22.5%205.60218%2022.342%205.22064%2022.0607%204.93934C21.7794%204.65804%2021.3978%204.5%2021%204.5ZM12.75%2016.5H11.25C11.0511%2016.5%2010.8603%2016.421%2010.7197%2016.2803C10.579%2016.1397%2010.5%2015.9489%2010.5%2015.75C10.5%2015.5511%2010.579%2015.3603%2010.7197%2015.2197C10.8603%2015.079%2011.0511%2015%2011.25%2015H12.75C12.9489%2015%2013.1397%2015.079%2013.2803%2015.2197C13.421%2015.3603%2013.5%2015.5511%2013.5%2015.75C13.5%2015.9489%2013.421%2016.1397%2013.2803%2016.2803C13.1397%2016.421%2012.9489%2016.5%2012.75%2016.5ZM18.75%2016.5H15.75C15.5511%2016.5%2015.3603%2016.421%2015.2197%2016.2803C15.079%2016.1397%2015%2015.9489%2015%2015.75C15%2015.5511%2015.079%2015.3603%2015.2197%2015.2197C15.3603%2015.079%2015.5511%2015%2015.75%2015H18.75C18.9489%2015%2019.1397%2015.079%2019.2803%2015.2197C19.421%2015.3603%2019.5%2015.5511%2019.5%2015.75C19.5%2015.9489%2019.421%2016.1397%2019.2803%2016.2803C19.1397%2016.421%2018.9489%2016.5%2018.75%2016.5ZM3%208.25V6H21V8.25H3Z'%20fill='%23E46921'/%3e%3c/g%3e%3c/svg%3e",R2="data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20width='100%25'%20height='100%25'%20overflow='visible'%20style='display:%20block;'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M23.25%2019.5C23.25%2019.6989%2023.171%2019.8897%2023.0303%2020.0303C22.8897%2020.171%2022.6989%2020.25%2022.5%2020.25H1.5C1.30109%2020.25%201.11032%2020.171%200.96967%2020.0303C0.829018%2019.8897%200.75%2019.6989%200.75%2019.5C0.75%2019.3011%200.829018%2019.1103%200.96967%2018.9697C1.11032%2018.829%2
101.30109%2018.75%201.5%2018.75H22.5C22.6989%2018.75%2022.8897%2018.829%2023.0303%2018.9697C23.171%2019.1103%2023.25%2019.3011%2023.25%2019.5ZM1.52812%209.20438C1.48352%209.04709%201.49152%208.87954%201.55093%208.72723C1.61033%208.57491%201.71787%208.44618%201.85719%208.36063L11.6072%202.36062C11.7253%202.28799%2011.8613%202.24953%2012%202.24953C12.1387%202.24953%2012.2747%202.28799%2012.3928%202.36062L22.1428%208.36063C22.2822%208.44607%2022.3898%208.57471%2022.4493%208.72697C22.5088%208.87922%2022.517%209.04674%2022.4725%209.20405C22.428%209.36135%2022.3334%209.49981%2022.2029%209.59837C22.0725%209.69692%2021.9135%209.75017%2021.75%209.75H19.5V15.75H21C21.1989%2015.75%2021.3897%2015.829%2021.5303%2015.9697C21.671%2016.1103%2021.75%2016.3011%2021.75%2016.5C21.75%2016.6989%2021.671%2016.8897%2021.5303%2017.0303C21.3897%2017.171%2021.1989%2017.25%2021%2017.25H3C2.80109%2017.25%202.61032%2017.171%202.46967%2017.0303C2.32902%2016.8897%202.25%2016.6989%202.25%2016.5C2.25%2016.3011%202.32902%2016.1103%202.46967%2015.9697C2.61032%2015.829%202.80109%2015.75%203%2015.75H4.5V9.75H2.25C2.08668%209.75006%201.9278%209.6968%201.79751%209.59832C1.66721%209.49984%201.57263%209.36152%201.52812%209.20438ZM13.5%2015C13.5%2015.1989%2013.579%2015.3897%2013.7197%2015.5303C13.8603%2015.671%2014.0511%2015.75%2014.25%2015.75C14.4489%2015.75%2014.6397%2015.671%2014.7803%2015.5303C14.921%2015.3897%2015%2015.1989%2015%2015V10.5C15%2010.3011%2014.921%2010.1103%2014.7803%209.96967C14.6397%209.82902%2014.4489%209.75%2014.25%209.75C14.0511%209.75%2013.8603%209.82902%2013.7197%209.96967C13.579%2010.1103%2013.5%2010.3011%2013.5%2010.5V15ZM9%2015C9%2015.1989%209.07902%2015.3897%209.21967%2015.5303C9.36032%2015.671%209.55109%2015.75%209.75%2015.75C9.94891%2015.75%2010.1397%2015.671%2010.2803%2015.5303C10.421%2015.3897%2010.5%2015.1989%2010.5%2015V10.5C10.5%2010.3011%2010.421%2010.1103%2010.2803%209.96967C10.1397%209.82902%209.94891%209.75%209.75%209.75C9.55109%209.75%209.36032%209.82902%209.21967%209.96967C9.07902%2010.1103%209%2010.3011%209%2010.5V15Z'%20fill='%23E46921'/%3e%3c/g%3e%3c/svg%3e",a0=({children:t,onClick:n,flex:o})=>e.jsx(p,{as:n?"button":"div",...n?{onClick:n}:{},...o!==void 0?{flex:o}:{},w:"100%",textAlign:"left",bg:"#F9FBFF",borderWidth:"1px",borderColor:"rgba(94, 114, 151, 0.16)",borderRadius:"16px",p:"17px",cursor:n?"pointer":"default",transition:"border-color 0.15s",...n?{_hover:{borderColor:r.orange[300]}}:{},children:t}),E2=({linkedBanksCount:t,linkedCardsCount:n,onLinkedBanksClick:o,onLinkedCardsClick:a})=>e.jsx(x,{direction:{base:"column",lg:"row"},gap:4,align:"stretch",children:e.jsxs(x,{gap:4,flex:1,direction:{base:"column",sm:"row"},children:[e.jsx(a0,{flex:1,onClick:o,children:e.jsxs(m,{gap:3,children:[e.jsx(k,{src:R2,alt:"",boxSize:"24px",objectFit:"contain"}),e.jsxs(m,{gap:.5,children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:r.navy[500],children:"Linked Banks"}),e.jsx(l,{fontSize:"xs",fontWeight:"medium",color:"#98A2B3",children:t===0?"No bank linked":`${t} bank${t===1?"":"s"} linked`})]})]})}),e.jsx(a0,{flex:1,onClick:a,children:e.jsxs(m,{gap:3,children:[e.jsx(k,{src:W2,alt:"",boxSize:"24px",objectFit:"contain"}),e.jsxs(m,{gap:.5,children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:r.navy[500],children:"Linked Cards"}),e.jsx(l,{fontSize:"xs",fontWeight:"medium",color:"#98A2B3",children:n===0?"No card linked":`${n} card${n===1?"":"s"} linked`})]})]})})]})}),z2=({transactions:t,isLoading:n=!1,onViewAll:o,onTransactionClick:a})=>n?e.jsxs(p,{w:"100%",children:[e.jsxs(x,{align:"center",justify:"space-between",mb:4,children:[e.jsx(Y,{height:"20px",width:"160px",borderRadius:"md"}),e.jsx(Y,{height:"16px",width:"64px",borderRadius:"md"})]}),e.jsx(m,{gap:3,children:Array.from({length:3}).map((s,c)=>e.jsx(Y,{height:"78px",borderRadius:"16px"},c))})]}):t.length>0?e.jsxs(p,{w:"100%",children:[e.jsxs(x,{align:"center",justify:"space-between",mb:4,children:[e.jsx(l,{fontSize:"md",fontWeight:"semibold",color:r.text.primary,children:"Recent Transactions"}),e.jsx(l,{as:"button",fontSize:"sm",fontWeight:"semibold",color:r.orange[500],cursor:"pointer",onClick:o,_hover:{textDecoration:"underline"},children:"View all"})]}),e.jsx(m,{gap:3,pt:0,children:t.map(s=>e.jsx(Q0,{transaction:s,onClick:()=>a?.(s)},s.id))})]}):e.jsx(p,{w:"100%",children:e.jsx($0,{})}),b0="Something went wrong while loading your wallet. Please try again.",f0="Complete your NIN verification so we can create your wallet securely.",C0="Add and verify your email to create your wallet. We use it to secure your account and send receipts.",M2=t=>{const n=t.toLowerCase();return n.includes("null")||n.includes("empty")||n.includes("cannot be")||n==="email cannot be null or empty"},H2=t=>{const n=K(t)?.trim()||b0;return V0(t)?{reason:"kyc",message:n.toLowerCase().includes("kyc")||n.toLowerCase().includes("nin")||n.toLowerCase().includes("identity")?n:f0}:F0(t)?{reason:"email",message:M2(n)?C0:n}:{reason:"generic",message:n}},N2=({isError:t,error:n,hasEmail:o,kycApproved:a})=>{if(!t)return null;const d=H2(n);return d.reason==="kyc"||d.reason==="email"?d:a?o?d.message?d:{reason:"generic",message:b0}:{reason:"email",message:C0}:{reason:"kyc",message:f0}},te=()=>{const t=y0(),[n,o]=j0(),a=s0(),d=Q(a?.email),s=!!a?.kycApproved,{wallet:c,virtualAccount:u,isLoading:g,isError:b,error:w,refetch:A}=l0(),j=c0(u)||void 0,{transactions:I,isLoading:B}=z0({accountNo:j,page:1,size:10,transactionType:"GENERAL"}),M=g||!!j&&B,{totalElements:L}=$({accountNumber:j,page:1,size:1,paymentMethod:"CARD"}),{totalElements:v}=$({accountNumber:j,page:1,size:1,paymentMethod:"BANK"}),[H,R]=h.useState(()=>n.get("fund")==="1"),[E]=h.useState(()=>n.get("fund")==="1"?"online":"transfer"),[N,_]=h.useState(null),[O,V]=h.useState(!1),[U,z]=h.useState(!1);h.useEffect(()=>{if(n.get("fund")!=="1")return;const Z=new URLSearchParams(n);Z.delete("fund"),o(Z,{replace:!0})},[n,o]);const F=h.useMemo(()=>N2({isError:b,error:w,hasEmail:d,kycApproved:s}),[d,b,s,w]),i=F?.reason??null,[C,y]=h.useState(i);i!==C&&(y(i),i==="email"&&z(!0));const S=!!c&&!b,W=()=>{A()},P=()=>{V(!1),Q(a?.email)||z(!0),A()},w0=()=>{z(!1),A()};return e.jsxs(p,{w:"100%",borderWidth:{base:0,md:"1px"},borderColor:"rgba(120, 53, 13, 0.08)",borderRadius:{base:0,md:"20px"},p:{base:0,md:8},minH:{md:"400px"},children:[e.jsxs(m,{gap:8,maxW:"800px",children:[g?e.jsx(Y,{w:"100%",minH:{base:"200px",md:"215px"},borderRadius:"20px"}):null,F?e.jsx(b2,{reason:F.reason,message:F.message,onVerifyKyc:()=>V(!0),onVerifyEmail:()=>z(!0),onRetry:W,onGoToKycPage:()=>t(`/${T.Kyc}`)}):null,S?e.jsx(k2,{balance:c.availableBalance,accountNumber:d0(u),accountName:u.accountName,bankName:u.bankName,onAddMoney:()=>R(!0)}):null,S?e.jsx(E2,{linkedBanksCount:v,linkedCardsCount:L,onLinkedBanksClick:()=>t(`/${T.LinkedBanks}`),onLinkedCardsClick:()=>t(`/${T.LinkedCards}`)}):null,S?e.jsx(z2,{transactions:I,isLoading:M,onViewAll:()=>t(`/${T.WalletTransactions}`),onTransactionClick:Z=>_(Z.refNumber)}):null]}),e.jsx(g2,{open:H,onClose:()=>R(!1),virtualAccount:u,initialTab:E,onAddCard:()=>t(`/${T.LinkedCards}`),onAddBank:()=>t(`/${T.LinkedBanks}`)}),e.jsx(G0,{reference:N,onClose:()=>_(null)}),e.jsx(M0,{open:O,onClose:()=>V(!1),onVerified:P}),e.jsx(A0,{open:U,onClose:()=>z(!1),onVerified:w0,initialEmail:a?.email?.trim()??"",pendingEmail:a?.email?.trim()??"",title:"Verify your email",description:"Add and verify your email so we can create your wallet and send receipts."})]})};export{te 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.