1import{r,c as hs,ai as us,E as ms,an as xs,cp as js,v as l,j as e,B as d,w as ps,al as fs,Q as Y,R as vs,x as ss,D as _s}from"./index-eb9fe256.js";import{u as Ns}from"./useDocumentTitle-df276c07.js";import{B as ks}from"./BlacklistCustomer-8a91a346.js";import{C as Cs}from"./index-e61e4481.js";import{C as Is}from"./ConfirmationModal-19f9d9bd.js";import"./ReasonModal-7ec8c6d1.js";import"./TextArea-9b391920.js";import"./CloseIcon-87da086b.js";const As=()=>{var m,x,j,p,f,v,_,N,k,C,I,A,g,w,T,b,L,E,S,M,y,B,O,W,D,R,U,z,F,V,$,P,Z,G,H,Q,q,J;const[es,h]=r.useState(!1),u=hs(),as=us(),[ts,o]=r.useState(!1),[is,i]=r.useState(!1),ns=ms(t=>t.mode.mode),s=r.useMemo(()=>xs("customer",!0),[]),{data:a}=js({walletId:(x=(m=s==null?void 0:s.userInfo)==null?void 0:m.wallet)==null?void 0:x.id,mode:ns},{skip:!((p=(j=s==null?void 0:s.userInfo)==null?void 0:j.wallet)!=null&&p.id)}),rs=async()=>{var n,K,X;o(!0);const t=await as((X=fs.endpoints.unFreezeCustomerWallet)==null?void 0:X.initiate((K=(n=s==null?void 0:s.userInfo)==null?void 0:n.wallet)==null?void 0:K.id));if(Object.hasOwn(t,"error")){Y.error("Customer activation failed"),o(!1);return}o(!1),Y.success("Customer activated"),i(!1)},ls=()=>u(vs.CUSTOMER_TRANSACTIONS),c=(v=(f=s==null?void 0:s.userInfo)==null?void 0:f.wallet)==null?void 0:v.isFrozen,os=(T=(A=(k=(_=a==null?void 0:a.data)==null?void 0:_.walletTier)!=null?k:(N=a==null?void 0:a.data)==null?void 0:N.wallet_tier)!=null?A:(I=(C=a==null?void 0:a.data)==null?void 0:C.balance)==null?void 0:I.walletTier)!=null?T:(w=(g=a==null?void 0:a.data)==null?void 0:g.balance)==null?void 0:w.wallet_tier,cs=`${((L=(b=s==null?void 0:s.userInfo)==null?void 0:b.firstName)==null?void 0:L[0])||""}${((S=(E=s==null?void 0:s.userInfo)==null?void 0:E.lastName)==null?void 0:S[0])||""}`.toUpperCase(),ds=[["First name",l.capitalize(((M=s==null?void 0:s.userInfo)==null?void 0:M.firstName)||"â")],["Last name",l.capitalize(((y=s==null?void 0:s.userInfo)==null?void 0:y.lastName)||"â")],["Email address",(s==null?void 0:s.email)||"â"],["Phone number",((B=s==null?void 0:s.userInfo)==null?void 0:B.phoneNumber)||"â"],["Address",((O=s==null?void 0:s.userInfo)==null?void 0:O.address)||"â"],["BVN",((W=s==null?void 0:s.userInfo)==null?void 0:W.bvn)||"â"]];return e.jsxs("div",{className:"customer-details",children:[e.jsxs("button",{className:"customer-details__back",type:"button",onClick:()=>u(-1),children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"m15 5-7 7 7 7",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to customers"]}),e.jsxs("header",{className:"customer-details__hero",children:[e.jsxs("div",{className:"customer-details__identity",children:[e.jsx("div",{className:"avatar",children:cs||"CU"}),e.jsxs("div",{children:[e.jsx("div",{className:"customer-details__eyebrow",children:"CUSTOMER PROFILE"}),e.jsxs("h1",{children:[l.capitalize(((D=s==null?void 0:s.userInfo)==null?void 0:D.firstName)||"")," ",l.capitalize(((R=s==null?void 0:s.userInfo)==null?void 0:R.lastName)||"")]}),e.jsxs("div",{className:"customer-details__meta",children:[e.jsxs("span",{className:`customer-details__status ${c?"is-inactive":""}`,children:[e.jsx("span",{}),c?"Inactive":"Active"]}),e.jsx("span",{children:(s==null?void 0:s.email)||"No email address"})]})]})]}),e.jsxs("div",{className:"customer-details__hero-actions",children:[e.jsx(d,{className:"customer-details__transactions",onClick:ls,children:e.jsxs("span",{className:"customer-details__action-label",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M4 7h13m0 0-3-3m3 3-3 3M20 17H7m0 0 3 3m-3-3 3-3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),"View transactions"]})}),c?e.jsx(d,{className:"customer-details__activate",onClick:()=>i(!0),children:e.jsxs("span",{className:"customer-details__action-label",children:[e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M12 3 20 6v5c0 5-3.1 8.4-8 10-4.9-1.6-8-5-8-10V6l8-3Z",stroke:"currentColor",strokeWidth:"1.7"}),e.jsx("path",{d:"m8.5 12 2.2 2.2 4.8-5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Activate"]})}
1):e.jsx(d,{className:"customer-details__blacklist",onClick:()=>h(!0),children:e.jsxs("span",{className:"customer-details__action-label",children:[e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M12 3 20 6v5c0 5-3.1 8.4-8 10-4.9-1.6-8-5-8-10V6l8-3Z",stroke:"currentColor",strokeWidth:"1.7"}),e.jsx("path",{d:"m9 9 6 6m0-6-6 6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]}),"Blacklist"]})})]})]}),e.jsxs("div",{className:"customer-details__layout",children:[e.jsxs("section",{className:"customer-details__panel",children:[e.jsxs("div",{className:"customer-details__section-head",children:[e.jsxs("div",{children:[e.jsx("span",{children:"PERSONAL INFORMATION"}),e.jsx("h2",{children:"Customer details"})]}),e.jsx("p",{children:"Identity and contact information attached to this customer."})]}),e.jsx("div",{className:"customer-details__details-grid",children:ds.map(([t,n])=>e.jsxs("div",{className:"customer-details__detail",children:[e.jsx("span",{children:t}),e.jsx("strong",{children:n})]},t))})]}),e.jsxs("aside",{className:"customer-details__wallet",children:[e.jsxs("div",{className:"customer-details__wallet-top",children:[e.jsx("span",{children:"AVAILABLE BALANCE"}),e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M3 7.5h15a3 3 0 0 1 3 3v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-10Z",stroke:"currentColor",strokeWidth:"1.6"}),e.jsx("path",{d:"M3 8V6a2 2 0 0 1 2-2h12v3.5M16 13h5",stroke:"currentColor",strokeWidth:"1.6"})]})]}),e.jsxs("div",{className:"customer-details__amount",children:["â¦",ps(((z=(U=a==null?void 0:a.data)==null?void 0:U.balance)==null?void 0:z.availableBalance)||0)]}),e.jsxs("span",{className:"customer-details__funding",children:["Wallet tier: ",os||"â"]}),e.jsxs("div",{className:"customer-details__account",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Account name"}),e.jsx("strong",{children:((V=(F=s==null?void 0:s.userInfo)==null?void 0:F.wallet)==null?void 0:V.accountName)||`${(($=s==null?void 0:s.userInfo)==null?void 0:$.firstName)||""} ${((P=s==null?void 0:s.userInfo)==null?void 0:P.lastName)||""}`})]}),e.jsxs("div",{children:[e.jsx("span",{children:"Account number"}),e.jsx("strong",{children:((G=(Z=s==null?void 0:s.userInfo)==null?void 0:Z.wallet)==null?void 0:G.accountNumber)||"â"})]}),((Q=(H=s==null?void 0:s.userInfo)==null?void 0:H.wallet)==null?void 0:Q.accountNumber)&&e.jsx(Cs,{text:s.userInfo.wallet.accountNumber})]}),e.jsx("span",{className:"customer-details__funding",children:((J=(q=s==null?void 0:s.userInfo)==null?void 0:q.wallet)==null?void 0:J.fundMethod)==="STATIC_FUND"?"Static funding":"Dynamic funding"})]})]}),es&&e.jsx(ks,{customer:s,dismissBlackList:()=>h(!1)}),is&&e.jsx(Is,{handleDismiss:()=>i(!1),title:"Activate customer?",description:"This will restore access to the customer wallet and allow transactions again.",icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M12 3 20 6v5c0 5-3.1 8.4-8 10-4.9-1.6-8-5-8-10V6l8-3Z",stroke:"currentColor",strokeWidth:"1.7"}),e.jsx("path",{d:"m8.5 12 2.2 2.2 4.8-5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]}),noBtnText:"Cancel",yesBtnText:"Activate",yesAction:rs,noAction:()=>i(!1),loading:ts})]})},ys=()=>(Ns(ss.CUSTOMER_DETAILS),e.jsx(_s,{name:ss.CUSTOMER_DETAILS,isSubpage:!0,children:e.jsx(As,{})}));export{ys 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.