(this.webpackJsonpnolt=this.webpackJsonpnolt||[]).push([[0],{10:function(e,t,a){"use strict";let n,s,l,c,i;a.d(t,"eb",(function(){return d})),a.d(t,"ob",(function(){return b})),a.d(t,"db",(function(){return u})),a.d(t,"qb",(function(){return j})),a.d(t,"rb",(function(){return p})),a.d(t,"Qb",(function(){return m})),a.d(t,"Pb",(function(){return h})),a.d(t,"Ob",(function(){return O})),a.d(t,"d",(function(){return v})),a.d(t,"gb",(function(){return x})),a.d(t,"Rb",(function(){return f})),a.d(t,"bb",(function(){return g})),a.d(t,"cb",(function(){return w})),a.d(t,"h",(function(){return _})),a.d(t,"Bb",(function(){return y})),a.d(t,"Fb",(function(){return N})),a.d(t,"Kb",(function(){return C})),a.d(t,"Jb",(function(){return k})),a.d(t,"lb",(function(){return S})),a.d(t,"Eb",(function(){return E})),a.d(t,"Db",(function(){return T})),a.d(t,"Cb",(function(){return A})),a.d(t,"Yb",(function(){return L})),a.d(t,"Ib",(function(){return M})),a.d(t,"Tb",(function(){return D})),a.d(t,"s",(function(){return F})),a.d(t,"O",(function(){return I})),a.d(t,"I",(function(){return R})),a.d(t,"a",(function(){return P})),a.d(t,"p",(function(){return q})),a.d(t,"ib",(function(){return U})),a.d(t,"Wb",(function(){return B})),a.d(t,"Y",(function(){return V})),a.d(t,"ec",(function(){return H})),a.d(t,"R",(function(){return Y})),a.d(t,"C",(function(){return W})),a.d(t,"Xb",(function(){return G})),a.d(t,"D",(function(){return Z})),a.d(t,"i",(function(){return K})),a.d(t,"e",(function(){return z})),a.d(t,"f",(function(){return J})),a.d(t,"j",(function(){return Q})),a.d(t,"ab",(function(){return X})),a.d(t,"wb",(function(){return $})),a.d(t,"Sb",(function(){return ee})),a.d(t,"w",(function(){return te})),a.d(t,"t",(function(){return ae})),a.d(t,"q",(function(){return ne})),a.d(t,"kb",(function(){return se})),a.d(t,"Q",(function(){return le})),a.d(t,"ac",(function(){return ce})),a.d(t,"v",(function(){return ie})),a.d(t,"yb",(function(){return re})),a.d(t,"zb",(function(){return oe})),a.d(t,"mb",(function(){return de})),a.d(t,"nb",(function(){return be})),a.d(t,"hb",(function(){return ue})),a.d(t,"Ab",(function(){return je})),a.d(t,"pb",(function(){return pe})),a.d(t,"P",(function(){return me})),a.d(t,"vb",(function(){return he})),a.d(t,"k",(function(){return Oe})),a.d(t,"fb",(function(){return ve})),a.d(t,"l",(function(){return xe})),a.d(t,"c",(function(){return fe})),a.d(t,"xb",(function(){return ge})),a.d(t,"V",(function(){return we})),a.d(t,"gc",(function(){return _e})),a.d(t,"bc",(function(){return ye})),a.d(t,"ub",(function(){return Ne})),a.d(t,"z",(function(){return Ce})),a.d(t,"dc",(function(){return ke})),a.d(t,"X",(function(){return Se})),a.d(t,"g",(function(){return Ee})),a.d(t,"Gb",(function(){return Te})),a.d(t,"Hb",(function(){return Ae})),a.d(t,"N",(function(){return Le})),a.d(t,"K",(function(){return Me})),a.d(t,"S",(function(){return De})),a.d(t,"L",(function(){return Fe})),a.d(t,"B",(function(){return Ie})),a.d(t,"u",(function(){return Re})),a.d(t,"sb",(function(){return Pe})),a.d(t,"E",(function(){return qe})),a.d(t,"Lb",(function(){return Ue})),a.d(t,"G",(function(){return Be})),a.d(t,"H",(function(){return Ve})),a.d(t,"F",(function(){return He})),a.d(t,"Nb",(function(){return Ye})),a.d(t,"Vb",(function(){return We})),a.d(t,"Zb",(function(){return Ge})),a.d(t,"b",(function(){return Ze})),a.d(t,"cc",(function(){return Ke})),a.d(t,"U",(function(){return ze})),a.d(t,"tb",(function(){return Je})),a.d(t,"Ub",(function(){return Qe})),a.d(t,"A",(function(){return Xe})),a.d(t,"r",(function(){return $e})),a.d(t,"W",(function(){return et})),a.d(t,"fc",(function(){return tt})),a.d(t,"x",(function(){return at})),a.d(t,"y",(function(){return nt})),a.d(t,"J",(function(){return st})),a.d(t,"T",(function(){return lt})),a.d(t,"hc",(function(){return ct})),a.d(t,"jb",(function(){return it})),a.d(t,"m",(function(){return rt})),a.d(t,"o",(function(){return ot})),a.d(t,"n",(function(){return dt})),a.d(t,"Z",(function(){return bt})),a.d(t,"M",(function(){return ut})),a.d(t,"Mb",(function(){return jt}));const r="https://vigil.lendsqr.com/pecunia/api",o="https://vigil.lendsqr.com/util";n="".concat(r,"/v1"),s="".concat(r,"/v2"),l="".concat(o,"/v1"),i="".concat(o,"/v2"),c="".concat(r,"/v1");const d=n+"/auth/onboard",b=n+"/auth/onboard/otp",u=n+"/auth/onboard/pin",j=n+"/auth/onboard/password",p=n+"/auth/reset/create-password",m=i+"/verify/bvn",h=e=>l+"/upload/photo?tenant=".concat(e),O=e=>l+"/upload/file?tenant=".concat(e),v=n+"/auth/onboard/bvn",x=n+"/auth/onboard/bank",f=l+"/verify/bank",g=n+"/auth/onboard/email",w=n+"/auth/onboard/photo",_=l+"/codes/fetch/bank",y=n+"/auth/login",N=n+"/auth/refresh-token",C=n+"/auth/reset/password/otp",k=n+"/auth/reset/password",S=n+"/settings/password",E=n+"/settings/reset/pin/otp",T=n+"/settings/reset/pin",A=n+"/settings/pin",L=n+"/settings/profile",M=n+"/settings/profile/verify-email",D=n+"/settings/profile/verify-email/otp",F=s+"/settings/document/types",I=s+"/settings/document",R=n+"/settings/profile/options",P=s+"/settings/document",q=s+"/business-profile",U=s+"/business-profile",B=e=>s+"/business-profile/".concat(e),V=e=>n+"/settings/document/".concat(e),H=n+"/settings/notification/token",Y=n+"/settings/notification/device",W=n+"/settings/profile",G=n+"/settings/profile/next-of-kin",Z=n+"/settings/referrals"+"/activities",K=n+"/settings/banks",z=e=>n+"/settings/banks/".concat(e),J=e=>n+"/settings/card/".concat(e),Q=n+"/settings/cards",X=n+"/settings/banks",$=n+"/settings/card/init?channel=web",ee=n+"/settings/card",te=s+"/loans?channel=web",ae=s+"/loans/drafts",ne=e=>n+"/loan/".concat(e,"/cancel"),se=s+"/loans/cancel",le=e=>n+"/loan/".concat(e),ce=e=>n+"/loan/".concat(e,"/payments"),ie=n+"/loan/score/options",re=n+"/loan/score",oe=n+"/loan/score/loci",de=n+"/loan/score/check",be=n+"/loan/validate",ue=s+"/loans/score/business",je=n+"/loan/payment-schedules",pe=n+"/loan",me=n+"/loan/guarantor",he=s+"/loans/guarantor",Oe=n+"/loan/products",ve=n+"/client/data",xe=n+"/client/data/",fe=e=>n+"/loan/charge/".concat(e),ge=n+"/loan/breakdown",we=n+"/settings/mandates",_e=n+"/settings/mandates/validate-otp",ye=n+"/settings/mandates/request-otp",Ne=r+"/v1/settings/mandates/generate",Ce=function(){return n+"/loan/offer-letters?format=base64&token=".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},ke=s+"/loans/offer-letters",Se=n+"/settings/mandates/details",Ee=e=>n+"/settings/mandates/".concat(e,"/status"),Te=e=>{let{loan_id:t}=e;return n+"/loan/request-extension/".concat(t)},Ae=e=>{let{loan_id:t,schedule_id:a}=e;return n+"/loan/request-extension/".concat(t,"/").concat(a)},Le=()=>s+"/transaction",Me=e=>s+"/transaction/".concat(encodeURIComponent(e)),De=e=>n+"/transaction/ussd?transaction_type=".concat(e),Fe=n+"/transaction/fees",Ie=n+"/savings/products",Re=n+"/savings/frequency",Pe=n+"/savings",qe=n+"/savings/dashboard",Ue=e=>n+"/savings/".concat(e,"/rollover"),Be=e=>n+"/savings/".concat(e),Ve=e=>n+"/savings/".concat(e,"/transactions"),He=e=>n+"/savings/".concat(e,"/balance"),Ye=e=>n+"/savings/".concat(e,"/topup"),We=e=>n+"/savings/".concat(e,"/withdraw"),Ge=e=>n+"/savings/".concat(e),Ze=e=>n+"/savings/".concat(e,"/archive"),Ke=e=>n+"/savings/".concat(e,"/restore"),ze=c+"/wallet",Je=c+"/wallet/fund",Qe=n+"/wallet/withdraw",Xe=n+"/auth/preference?channel=web",$e=n+"/auth/onboard/form",et=n+"/transaction/initialize",tt=n+"/transaction/validate-tier",at=e=>n+"/meta/codes?code_description=".concat(e),nt=(e,t)=>n+"/meta/codes/link?code_description=".concat(e,"&ref_code=").concat(t),st=e=>n+"/meta/codes/link?code_description=state&ref_code=".concat(e),lt=l+"/verify/document",ct=l+"/verify/document/status",it=n+"/bills/buy-airtime",rt=n+"/bills/categories",ot=e=>n+"/bills/category/".concat(e),dt=e=>n+"/bills/biller-items/".concat(e),bt=n+"/bills/pay",ut="https://vigil.lendsqr.com/media-generator/pdf/transaction-receipt",jt=i+"/util/event"},101:function(e,t,a){"use strict";var n=a(10),s=a(9),l=a(53),c=a(33),i=a(11),r=a(2);Object(c.b)();const o={status:"idle",fetchStatus:"idle",screen:"initiate",pin:"",modalDescription:"",categories:[],filteredCategories:[],billers:[],customer_id:"",biller_id:"",payment_code:"",amount:void 0,filteredBillers:[],biller:[],billerStatus:"idle",item:null,itemStatus:"idle"},d=Object(l.create)()(((e,t)=>({...o,reset:()=>{e(o)},setIdle:async()=>{e({status:"idle"})},setData:async t=>{e({...t})},searchCategories:a=>{const{categories:n}=t();let s=n;a&&(s=null===n||void 0===n?void 0:n.filter((e=>e.name.toLowerCase().includes(a.toLowerCase())))),e({filteredCategories:s})},searchBillers:a=>{const{billers:n}=t();let s=n;a&&(s=null===n||void 0===n?void 0:n.filter((e=>e.name.toLowerCase().includes(a.toLowerCase())))),e({filteredBillers:s})},getBillCategories:async()=>{const{categories:a}=t();e({fetchStatus:a.length?"success":"loading"});try{const t=await Object(i.a)(n.m,"get");return e({fetchStatus:"success",categories:t.data,filteredCategories:t.data}),t}catch(c){var l;s.toast.error(null!==(l=null===c||void 0===c?void 0:c.message)&&void 0!==l?l:await Object(r.translate)("lender-web-app-default-error")),e({fetchStatus:"error",categories:[],filteredCategories:[]})}},getBillers:async t=>{e({billerStatus:"loading",screen:"biller"});try{const a=await Object(i.a)(Object(n.o)(t),"get");return e({billerStatus:"success",billers:a.data,filteredBillers:a.data}),a}catch(l){var a;s.toast.error(null!==(a=null===l||void 0===l?void 0:l.message)&&void 0!==a?a:await Object(r.translate)("lender-web-app-default-error")),e({billerStatus:"error",billers:[],filteredBillers:[]})}},getItemsForBillers:async a=>{const{billers:l}=t();e({itemStatus:"loading",screen:"item"});try{const t=await Object(i.a)(Object(n.n)(a),"get");return e({itemStatus:"success",biller:null===l||void 0===l?void 0:l.find((e=>e.id==a)),item:t.data}),t}catch(o){var c;if(e({itemStatus:"error",biller:null,item:null}),""===(null===o||void 0===o?void 0:o.message))s.toast.error(await Object(r.translate)("lender-web-app-default-error"));else s.toast.error(null!==(c=null===o||void 0===o?void 0:o.message)&&void 0!==c?c:await Object(r.translate)("lender-web-app-default-error"))}},makeBillPayment:async a=>{e({status:"loading"});const{customer_id:l,biller_id:c,payment_code:o,amount:d,pin:b}=t();try{const t=await Object(i.a)(n.Z,"post",a?{customer_id:l,biller_id:c,payment_code:o&&JSON.parse(o).paymentCode,amount:d,pin:b,otp:a}:{customer_id:l,biller_id:c,payment_code:o&&JSON.parse(o).paymentCode,amount:d,pin:b});return e({status:"success",screen:"success"}),t}catch(j){var u;s.toast.error(null!==(u=null===j||void 0===j?void 0:j.message)&&void 0!==u?u:await Object(r.translate)("lender-web-app-default-error")),e({status:"idle"})}}})));t.a=d},104:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(2),s=a(0);function l(){const{translate:e}=Object(n.useTranslation)();return Object(s.jsxs)("div",{className:"card default-card",children:[Object(s.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(s.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(s.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"100%"},children:Object(s.jsx)("div",{className:"spinner-border text-primary",role:"status",children:Object(s.jsxs)("span",{className:"visually-hidden",children:[e("lender-web-app-loading"),"..."]})})})})}),Object(s.jsx)("div",{style:{height:"72px"},children:""})]})}},105:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n,s,l,c=a(1);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},i.apply(this,arguments)}function r(e,t){let{title:a,titleId:r,...o}=e;return c.createElement("svg",i({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),a?c.createElement("title",{id:r},a):null,n||(n=c.createElement("path",{d:"M11.3848 4.48923L19.0002 1",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),s||(s=c.createElement("path",{d:"M11.3848 4.48926L19.0002 6.53849",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),l||(l=c.createElement("path",{d:"M9.30769 18.9998C14.1538 18.9998 17.6154 17.2829 17.6154 13.4614C17.6154 9.30751 15.5385 6.53828 11.3846 4.46135L13.0185 2.34289C13.089 2.20743 13.1239 2.05624 13.1199 1.90357C13.1159 1.7509 13.0731 1.60175 12.9955 1.47018C12.918 1.33861 12.8082 1.22895 12.6766 1.1515C12.5449 1.07406 12.3958 1.03139 12.2431 1.02751H6.37231C6.20945 1.02441 6.04881 1.06557 5.9075 1.1466C5.7662 1.22763 5.64954 1.34548 5.56995 1.4876C5.49036 1.62972 5.45084 1.79077 5.45559 1.95359C5.46034 2.11641 5.50919 2.27488 5.59692 2.41212L7.23077 4.46135C3.07692 6.56597 1 9.3352 1 13.489C1 17.2829 4.46154 18.9998 9.30769 18.9998Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}const o=c.forwardRef(r);a.p},11:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(161),s=a.n(n),l=a(45),c=a(15),i=a(41),r=a(197),o=a.n(r),d=a(265),b=a.n(d),u=a(9);b.a.configure({showSpinner:!1,easing:"ease-in-out",minimum:.3});function j(e){return new Promise((t=>setTimeout(t,e)))}const p=async function(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"get";const l=await(async e=>{var t;for(console.log(i.a.getState().tokenStatus,":::",e);"refreshing"===i.a.getState().tokenStatus&&(null===e||void 0===e||!e.includes("refresh-token"));)await j(1e3);null!==e&&void 0!==e&&e.includes("refresh-token")||i.a.getState().addUsage(e);const a={Accept:"application/json","Content-type":"application/json","x-mobile-os":"web","x-api-key":null!==(t="eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi")?t:"","x-timezone":o.a.tz.guess()},n=i.a.getState().access_token;return a.Authorization="Bearer ".concat(n),a["x-locale"]=c.a.getState().language,s.a.create({headers:a})})(e);switch(n=n.toLowerCase(),n){case"post":case"put":case"patch":return l[n](e,t,a);case"get":return l[n](e,{...t,data:""});default:return l[n](e)}},m=()=>{var e;u.toast.remove(),null===l.a||void 0===l.a||null===(e=l.a.getState())||void 0===e||e.logout()};let h=0;const O=async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise(((l,c)=>{++h,1===h&&b.a.start(),p(e,a,n,t).then((a=>{if(401!==a.data.status||e.endsWith("/auth/biometric")&&"post"===t.toLowerCase())return a.status<400?l(s?a:a.data):c(a.data);m()})).catch((a=>{((e,t,a,n)=>{var s,l,c,i,r,o;401!==(null===e||void 0===e||null===(s=e.response)||void 0===s?void 0:s.status)||a.endsWith("/auth/biometric")&&"post"===n.toLowerCase()||m(),null!==e&&void 0!==e&&null!==(l=e.response)&&void 0!==l&&null!==(c=l.data)&&void 0!==c&&c.message?(null!==e&&void 0!==e&&null!==(i=e.response)&&void 0!==i&&null!==(r=i.data)&&void 0!==r&&null!==(o=r.data)&&void 0!==o&&o.failed_reason,t(e.response.data)):null!==e&&void 0!==e&&e.message?t(new Error(null===e||void 0===e?void 0:e.message)):t(e)})(a,c,e,t)})).finally((()=>{--h,0===h&&b.a.done(),null!==e&&void 0!==e&&e.includes("refresh-token")||i.a.getState().removeUsage(e)}))}))}},114:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));a(1);var n=a(0);function s(e){let{card:t,...a}=e;return Object(n.jsxs)("label",{className:"payment-card custom_checkbox",children:[Object(n.jsx)("input",{type:"radio",...a}),Object(n.jsxs)("div",{className:"content no-border",children:[Object(n.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(n.jsxs)("div",{className:"position-relative",children:[Object(n.jsx)("svg",{className:"unchecked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"})}),Object(n.jsxs)("svg",{className:"checked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(n.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"}),Object(n.jsx)("path",{d:"M6 1.3125C8.59059 1.3125 10.6875 3.40901 10.6875 6C10.6875 8.59059 8.59099 10.6875 6 10.6875C3.40941 10.6875 1.3125 8.59099 1.3125 6C1.3125 3.40941 3.40901 1.3125 6 1.3125ZM6 0.1875C2.78984 0.1875 0.1875 2.78984 0.1875 6C0.1875 9.21016 2.78984 11.8125 6 11.8125C9.21016 11.8125 11.8125 9.21016 11.8125 6C11.8125 2.78984 9.21016 0.1875 6 0.1875ZM6 4.125C4.96446 4.125 4.125 4.96446 4.125 6C4.125 7.03554 4.96446 7.875 6 7.875C7.03554 7.875 7.875 7.03554 7.875 6C7.875 4.96446 7.03554 4.125 6 4.125Z",fill:"currentColor"})]})]}),Object(n.jsx)("div",{className:"",children:Object(n.jsx)("div",{className:"col logo-wrapper",children:Object(n.jsx)("div",{className:"bank-logo",style:{width:"25px"},children:Object(n.jsx)("img",{src:t.logo_url,alt:"bank logo"})})})})]}),Object(n.jsx)("div",{className:"",children:Object(n.jsx)("div",{className:"",children:Object(n.jsxs)("div",{className:"",children:[Object(n.jsx)("p",{className:"text-small",children:"".concat("X".repeat(4),"  ").concat("X".repeat(4)," ").concat("X".repeat(4)," ").concat(t.card_last4)}),Object(n.jsx)("p",{className:"text-small",children:t.card_owner_name||"-"}),Object(n.jsxs)("p",{className:"text-x-small text-app-gray",children:[t.card_exp_month||"-"," / ",t.card_exp_year||"-"]})]})})})]})]})}},124:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0);function s(e){let{title:t,count:a}=e;return Object(n.jsx)("div",{className:"col-12 col-md-4 statsgroup__stat",children:Object(n.jsxs)("div",{className:"statsgroup__stat--content",children:[Object(n.jsx)("p",{className:"text-capitalize",children:t}),Object(n.jsx)("h3",{children:a})]})})}},127:function(e,t,a){"use strict";var n=a(10),s=a(9),l=a(53),c=a(33),i=a(11),r=a(2);Object(c.b)();const o={status:"idle",screen:"initiate",pin:"",network_type:"",phone_number:"",amount:void 0},d=Object(l.create)()(((e,t)=>({...o,reset:()=>{e(o)},setIdle:async()=>{e({status:"idle"})},setData:async t=>{e({...t})},initiateTransfer:async t=>{e({status:"loading"});try{const a=await Object(i.a)(n.W,"post",{pin:t});return e({status:"idle",screen:"otp"}),a}catch(d){var a,l,c,o;s.toast.error(null!==(a=null!==(l=null===(c=d.response)||void 0===c||null===(o=c.data)||void 0===o?void 0:o.message)&&void 0!==l?l:null===d||void 0===d?void 0:d.message)&&void 0!==a?a:await Object(r.translate)("lender-web-app-default-error")),e({status:"error"})}},buyAirtime:async a=>{e({status:"loading"});const{network_type:l,phone_number:c,amount:o,pin:d}=t();try{const t=await Object(i.a)(n.jb,"post",a?{network_type:l,phone_number:c,amount:o,pin:d,otp:a}:{network_type:l,phone_number:c,amount:o,pin:d});return e({status:"success",screen:"success"}),t}catch(u){var b;s.toast.error(null!==(b=u.message)&&void 0!==b?b:await Object(r.translate)("lender-web-app-default-error")),e({status:"idle"})}}})));t.a=d},13:function(e,t,a){"use strict";var n=a(10),s=a(53),l=a(61),c=a(33),i=a(11),r=a(9),o=a.n(r),d=a(60),b=a(32),u=a(2);Object(c.b)();const j={appName:"irorun",cards:[],cardsStatus:"idle",banks:[],banksStatus:"idle",wallet:void 0,walletStatus:"idle",profile:null,profileStatus:"idle",verifyEmailStatus:"idle",nextOfKin:{},nextOfKinStatus:"idle",guarantors:[],guarantorsStatus:"idle",referrals:[],referralStatus:"idle",documentTypes:[],documentTypesStatus:"idle",options:[],optionsStatus:"idle",documents:[],documentsStatus:"idle",docUploadStatus:"idle",cardInitStatus:"idle",cardInitData:"",downloadModalApp:!1,additionalDocuments:[],additionalDocUploadStatus:"idle",cardCharge:null,mandateCharge:null,transactionStatus:"idle",showLanguageDrop:!1,transanction_not_allowed:!1},p=Object(s.create)()(Object(l.devtools)(Object(l.persist)(((e,t)=>({...j,setDownloadAppModal:t=>{e({downloadModalApp:t})},setInitStatus:t=>{e({cardInitStatus:t})},setInitData:t=>{e({cardInitData:t})},setShowLanguageDrop:t=>{e({showLanguageDrop:t})},initCard:async()=>new Promise(((a,n)=>{const{cardInitData:s,cardInitStatus:l}=t();(s||["loading","confirm","error"].includes(l))&&a();try{e({cardInitStatus:"loading"}),e({cardInitStatus:"confirm"}),a()}catch(c){e({cardInitStatus:"error"}),n(c)}})),setNotAllowed:t=>{e({transanction_not_allowed:t})},checkNotAllowed:()=>{const{profile:e,setNotAllowed:a}=t();return("Pending"===(null===e||void 0===e?void 0:e.selfie_bvn_check)||"Failed"===(null===e||void 0===e?void 0:e.selfie_bvn_check))&&(a(!0),!0)},fetchTransactions:async()=>{e({transactionStatus:"loading"});try{var t;const r=await Object(i.a)(n.L,"get"),o=null===(t=r.data.find((e=>"card-tokenization"===e.slug)))||void 0===t?void 0:t.id,d=r.data.find((e=>"mandate-activation"===e.slug));if(o)try{var a,s;const t=await Object(i.a)(n.L,"post",{amount:50,type_id:(null===(a=r.data.find((e=>"card-tokenization"===e.slug)))||void 0===a?void 0:a.id)||0});e({cardCharge:null===t||void 0===t||null===(s=t.data)||void 0===s?void 0:s.amount})}catch(c){console.log(c)}if(d)try{var l;const t=await Object(i.a)(n.L,"post",{amount:50,type_id:r.data.find((e=>"mandate-activation"===e.slug)).id||0});e({mandateCharge:null===t||void 0===t||null===(l=t.data)||void 0===l?void 0:l.amount})}catch(c){console.log(c)}}catch(c){e({transactionStatus:"failed"}),console.log(c)}e({transactionStatus:"success"})},fetchCards:async function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading";const{cards:s}=t();if(!(s.length>0&&"loading"===a))try{e({cardsStatus:a});const t=await Object(i.a)(n.j,"get");e({cardsStatus:"success",cards:t.data})}catch(l){e({cardsStatus:"empty",cards:[]})}},fetchWallet:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading";try{e({walletStatus:t});const a=await Object(i.a)(n.U,"get");e({walletStatus:"success",wallet:a.data})}catch(a){e({walletStatus:"error"})}},fetchUserAccounts:async function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading";const{banks:s}=t();if(!(s.length>0&&"loading"===a)){e({banksStatus:a});try{const t=await Object(i.a)(n.i,"get");e({banksStatus:"success",banks:t.data})}catch(l){e({banksStatus:"error"})}}},postRequestVerifyUserEmail:async a=>{const{profile:s}=t();e(a?{verifyEmailStatus:"resending-code"}:{verifyEmailStatus:"sending-code"});try{await Object(i.a)(n.Ib,"post",{email:null===s||void 0===s?void 0:s.email}),e({verifyEmailStatus:"sent-code"})}catch(l){o.a.error(null===l||void 0===l?void 0:l.message),e({verifyEmailStatus:"error"})}},fetchUserProfile:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading";const{options:a,fetchOptions:s,getOptionsByKey:l,fetchLgaOptionsFor:c}=d.a.getState();e({profileStatus:t});try{var r,o,b,u;Object.keys(a).length||await s();const t=(await Object(i.a)(n.C,"get")).data;var j;if(e({profile:t,profileStatus:"success"}),t.kin&&(null===(r=t.kin)||void 0===r||!r.relationship_id))t.kin.relationship_id=null===(j=m(l("relationship"),t.kin.relationship))||void 0===j?void 0:j.id;let d;for(const e of["gender","marital-status","state"]){const a=e.replace(/-/g,"_"),n=m(l(e),t[a]);t["".concat(a,"_id")]=null===n||void 0===n?void 0:n.id,"state"===e&&(d=n)}await c(null===(o=d)||void 0===o?void 0:o.id);const p=l("".concat(null===(b=d)||void 0===b?void 0:b.ref_code,"-lga"));t.lga_id=null===(u=m(p,null===t||void 0===t?void 0:t.lga))||void 0===u?void 0:u.id,e({profile:t,nextOfKin:t.kin,profileStatus:"success"})}catch(p){e({profileStatus:"error"})}},fetchUserGuarantors:async()=>{e({guarantorsStatus:"loading"});try{const t=await Object(i.a)(n.P,"get");e({guarantorsStatus:"success"}),e({guarantors:t.data})}catch(t){e({guarantorsStatus:"error"})}},fetchReferralActivities:async()=>{e({referralStatus:"loading"});try{const t=await Object(i.a)(n.D,"get");e({referralStatus:"success"}),e({referrals:t.data})}catch(t){e({referralStatus:"error"})}},fetchDocumentTypes:async()=>{const{documentTypes:a}=t();if(!(a.length>0)){e({documentTypesStatus:"loading"});try{const t=(await Object(i.a)(n.s,"get")).data.documents.filter((e=>1===e.id||"Identification Documents"!==e.name));e({documentTypesStatus:"success"}),e({documentTypes:t})}catch(s){e({documentTypesStatus:"error"})}}},fetchUserDocs:async function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading";const{documents:s}=t();let l=a;s.length>0&&(l="updating"),e({documentsStatus:l});try{const t=await Object(i.a)(n.O,"get");e({documentsStatus:"success"}),e({documents:t.data})}catch(c){e({documentsStatus:"error"})}},fetchDocs:async()=>{const e=t();await e.fetchDocumentTypes(),await e.fetchUserDocs()},updateUserDoc:async(a,s,l,r)=>{const d=new FormData;d.set("file",a);const j=t();try{e({docUploadStatus:"loading"});const t=await Object(i.a)("application/pdf"===a.type?Object(n.Ob)(j.appName):Object(n.Pb)(j.appName),"post",d),o=await Object(i.a)(Object(n.Y)(l),"put",{url:t.data.url,type_id:s}),u=Object(c.a)(j,(e=>{var t;e.docUploadStatus="success";const a=null===(t=e.documents)||void 0===t?void 0:t.findIndex((e=>e.type_id===s));e.documents[a]=o.data}));e(u),"function"===typeof r&&r(),Object(b.a)({event_name:b.b.USER_UPDATE_DOCUMENT,document_id:l})}catch(m){var p;o.a.error(null!==(p=null===m||void 0===m?void 0:m.message)&&void 0!==p?p:await Object(u.translate)("lender-web-app-problem-uploading-file")),e({docUploadStatus:"error"})}},uploadUserDoc:async(a,s,l,r)=>{const d=new FormData;d.set("file",a);const j=t();try{e({docUploadStatus:"loading"});const t=await Object(i.a)("application/pdf"===a.type?Object(n.Ob)(j.appName):Object(n.Pb)(j.appName),"post",d),o=await Object(i.a)(n.a,"post",{url:t.data.url,type_id:null!==l&&void 0!==l?l:s}),u=Object(c.a)(j,(e=>{e.docUploadStatus="success",e.documents.push(o.data)}));e(u),"function"===typeof r&&r(),Object(b.a)({event_name:b.b.USER_ADD_DOCUMENT,document_id:s})}catch(m){var p;o.a.error(null!==(p=null===m||void 0===m?void 0:m.message)&&void 0!==p?p:await Object(u.translate)("lender-web-app-problem-uploading-file")),e({docUploadStatus:"error"})}},updateUserProfile:async a=>{const{fetchUserProfile:s}=t();e({profileStatus:"updating"});try{await Object(i.a)(n.Yb,"put",a),e({profileStatus:"success"}),await s("updating")}catch(l){return e({profileStatus:"error"}),Promise.reject(new Error(l.message))}},postVerifyUserEmail:async a=>{const{fetchUserProfile:s}=t();e({verifyEmailStatus:"verifying"});try{await Object(i.a)(n.Tb,"post",a),e({verifyEmailStatus:"success"}),await s("updating")}catch(l){return Promise.reject(l.message)}},updateNextOfKin:async a=>{const{fetchUserProfile:s}=t();e({nextOfKinStatus:"updating"});try{await Object(i.a)(n.Xb,"put",a),e({nextOfKinStatus:"success"}),await s("refetching")}catch(l){return e({nextOfKinStatus:"error"}),Promise.reject(new Error(null===l||void 0===l?void 0:l.message))}},uploadAdditionalDoc:async(a,s,l,r)=>{const d=new FormData;if(d.set("file",a),r){const e=r.split(",");for(const t of e)d.append("mimetypes",t)}const j=t();try{e({additionalDocUploadStatus:"loading"});const t=await Object(i.a)("application/pdf"===a.type?Object(n.Ob)(j.appName):Object(n.Pb)(j.appName),"post",d),r=Object(c.a)(j,(e=>{e.additionalDocUploadStatus="success",e.additionalDocuments.push({id:s,data:{...t.data,name:a.name,type:a.type},status:"success"})}));return e(r),"function"===typeof l&&l(),Object(b.a)({event_name:b.b.USER_ADD_DOCUMENT,document_id:s}),o.a.success(await Object(u.translate)("lender-web-app-file-uploaded-successfully")),{id:s,...t.data,status:"success"}}catch(m){var p;return o.a.error(null!==(p=null===m||void 0===m?void 0:m.message)&&void 0!==p?p:await Object(u.translate)("lender-web-app-problem-uploading-file")),e({additionalDocUploadStatus:"error"}),{id:s,data:null,status:"error"}}},clearAdditionalDoc:a=>{const n=t(),s=Object(c.a)(n,(e=>{var t;e.additionalDocuments.splice(null===(t=e.additionalDocuments)||void 0===t?void 0:t.findIndex((e=>e.id===a)),1)}));e(s)},updateAdditionalDoc:async(a,s,l)=>{const r=new FormData;r.set("file",a);const d=t();try{e({additionalDocUploadStatus:"loading"});const t=await Object(i.a)("application/pdf"===a.type?Object(n.Ob)(d.appName):Object(n.Pb)(d.appName),"post",r),o=Object(c.a)(d,(e=>{e.additionalDocUploadStatus="success",e.additionalDocuments.push({id:s,data:t.data,status:"success"})}));e(o),"function"===typeof l&&l(),Object(b.a)({event_name:b.b.USER_ADD_DOCUMENT,document_id:s})}catch(p){var j;o.a.error(null!==(j=null===p||void 0===p?void 0:p.message)&&void 0!==j?j:await Object(u.translate)("lender-web-app-problem-uploading-file")),e({additionalDocUploadStatus:"error"})}},resetEmailVerification:()=>{e({verifyEmailStatus:j.verifyEmailStatus})},reset:()=>{e(j)}})),{name:"app.accounts"})));function m(e,t){return null===e||void 0===e?void 0:e.find((e=>e.code_description===t))}t.a=p},130:function(e,t,a){"use strict";a.d(t,"c",(function(){return le})),a.d(t,"d",(function(){return ce})),a.d(t,"b",(function(){return ie})),a.d(t,"a",(function(){return re}));var n,s=a(19),l=a(21),c=a(20),i=a(1),r=a(16),o=a(4),d=a(198),b=a(67),u=a(75),j=a(3),p=a(18),m=a(13),h=a(2);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},O.apply(this,arguments)}function v(e,t){let{title:a,titleId:s,...l}=e;return i.createElement("svg",O({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 256 256",ref:t,"aria-labelledby":s},l),a?i.createElement("title",{id:s},a):null,n||(n=i.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"})))}const x=i.forwardRef(v);a.p;var f=a(25),g=a(0);function w(e){var t,a,n,l,c,r,d,b,O,v,w,_,y,N,C,k,S,E,T,A,L,M,D;let{loan:F,expired:I}=e;const R=null!==(t=null===F||void 0===F||null===(a=F.status)||void 0===a?void 0:a.status)&&void 0!==t?t:"ABANDONED",[P,q]=Object(s.a)((e=>[e.mandates,e.fetchMandates]),o.shallow),[U,B]=Object(m.a)((e=>[e.cards,e.fetchCards]),o.shallow),[V,H]=Object(i.useState)(null),[Y,W]=Object(i.useState)(!1),[G,Z]=Object(i.useState)({value:"",key:""});Object(i.useEffect)((()=>{q(),B()}),[]);const K=Object(i.useMemo)((()=>U.find((e=>e.id===F.card_id))),[U]),z=Object(i.useMemo)((()=>P.find((e=>e.id===F.mandate_id))),[P]);Object(i.useEffect)((()=>{var e;const t=null===F||void 0===F||null===(e=F.loan_profile)||void 0===e?void 0:e.decision_data;if(t)try{var a;const e=null===(a=JSON.parse(t))||void 0===a?void 0:a.attributes;if(e){const t=Object.keys(e);H(e[t[0]])}}catch(n){console.error("Error parsing decision_data:",n)}}),[F]);const J=(e,t)=>{let a;return a=e?Array.isArray(e)?null===e||void 0===e?void 0:e.join(", "):"string"===typeof e&&(null!==e&&void 0!==e&&e.startsWith("http://")||null!==e&&void 0!==e&&e.startsWith("https://"))?e.endsWith(".pdf")?Object(g.jsxs)("a",{className:"d-flex align-items-center text-primary",href:e,target:"_blank",rel:"noopener noreferrer",children:[Object(g.jsx)("span",{children:"Preview"}),Object(g.jsx)(x,{})]}):Object(g.jsxs)("div",{className:"d-flex align-items-center text-primary cursor-pointer",onClick:()=>((e,t)=>{Z({value:e,key:t}),W(!0)})(e,t),children:[Object(g.jsx)("span",{children:"Preview"}),Object(g.jsx)(x,{})]}):e:"N/A",a},{translate:Q}=Object(h.useTranslation)();return Object(g.jsx)("div",{className:"tab-content loanDetails__tab-content",id:"myTabContent",children:Object(g.jsxs)("div",{className:"tab-pane fade show active general-tab",id:"general",role:"tabpanel","aria-labelledby":"generalDetails-tab",children:[Object(g.jsxs)("div",{className:"info",children:[Object(g.jsxs)("div",{className:"row info-nav align-items-center",children:[Object(g.jsx)("div",{className:"info-nav-title col-8",children:Object(g.jsx)("h3",{className:"info--heading",children:Q("lender-web-app-loan-details")})}),Object(g.jsx)("div",{className:"info-nav-btn text-right col-4"})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-principal")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(F.loan_amount,null===F||void 0===F?void 0:F.currency)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-interest")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(F.interest_due,null===F||void 0===F?void 0:F.currency)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-application-date")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.u)(F.created_on)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-purpose-of-loan")}),Object(g.jsx)("p",{className:"info--value",children:null!==(n=null===(l=F.loan_profile)||void 0===l?void 0:l.purpose)&&void 0!==n?n:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-status")}),Object(g.jsx)("p",{className:"info--value co-".concat(R.split(" ").join("-").toLowerCase()),children:Object(u.capitalize)(I?"Expired":R||"-")})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-total-amount-due")}),Object(g.jsx)("p",{className:"info--value",children:"running"==(null===F||void 0===F||null===(c=F.status)||void 0===c||null===(r=c.status)||void 0===r?void 0:r.toLowerCase())||"past due"==(null===F||void 0===F||null===(d=F.status)||void 0===d||null===(b=d.status)||void 0===b?void 0:b.toLowerCase())?Object(j.q)(F.schedules.reduce(((e,t)=>e+t.amount_due),0),null===F||void 0===F?void 0:F.currency):Object(j.q)(0,null===F||void 0===F?void 0:F.currency)})]})]})]}),Object(g.jsxs)("div",{className:"info",children:[Object(g.jsx)("h3",{className:"info--heading",children:Q("lender-web-app-personal-details")}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-gender")}),Object(g.jsx)("p",{className:"info--value",children:null!==(O=null===(v=F.loan_profile)||void 0===v?void 0:v.gender)&&void 0!==O?O:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-marital-status")}),Object(g.jsx)("p",{className:"info--value",children:null!==(w=null===(_=F.loan_profile)||void 0===_?void 0:_.marital_status)&&void 0!==w?w:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-children")}),Object(g.jsx)("p",{className:"info--value",children:null!==(y=null===(N=F.loan_profile)||void 0===N?void 0:N.no_of_dependent)&&void 0!==y?y:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-level-education")}),Object(g.jsx)("p",{className:"info--value",children:null!==(C=null===(k=F.loan_profile)||void 0===k?void 0:k.educational_attainment)&&void 0!==C?C:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-employment-status")}),Object(g.jsx)("p",{className:"info--value",children:null!==(S=null===(E=F.loan_profile)||void 0===E?void 0:E.employment_status)&&void 0!==S?S:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-sector-employment")}),Object(g.jsx)("p",{className:"info--value",children:null!==(T=null===(A=F.loan_profile)||void 0===A?void 0:A.sector_of_employment)&&void 0!==T?T:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-working-since")}),Object(g.jsx)("p",{className:"info--value",children:F.loan_profile?Object(j.u)(null===(L=F.loan_profile)||void 0===L?void 0:L.work_start_date):"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsxs)("p",{className:"info--title",children:[Q("lender-web-app-monthly-income")," (",Object(j.k)(null===F||void 0===F?void 0:F.currency),")"]}),Object(g.jsx)("p",{className:"info--value",children:null!==(M=null===(D=F.loan_profile)||void 0===D?void 0:D.monthly_net_income)&&void 0!==M?M:"-"})]})]})]}),void 0!=K&&Object(g.jsxs)("div",{className:"info",children:[Object(g.jsx)("h3",{className:"info--heading",children:Q("lender-web-app-card-details")}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-bank-name")}),Object(g.jsx)("p",{className:"info--value",children:null===K||void 0===K?void 0:K.bank_name})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-card-last-four")}),Object(g.jsx)("p",{className:"info--value",children:null===K||void 0===K?void 0:K.card_last4})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-card-type")}),Object(g.jsx)("p",{className:"info--value",children:null===K||void 0===K?void 0:K.card_type})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-expiry")}),Object(g.jsx)("p",{className:"info--value",children:"".concat(null===K||void 0===K?void 0:K.card_exp_month,"/").concat(null===K||void 0===K?void 0:K.card_exp_year.slice(2,4))})]})]})]}),void 0!=z&&Object(g.jsxs)("div",{className:"info",children:[Object(g.jsx)("h3",{className:"info--heading",children:Q("lender-web-app-mandate-details")}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-mandate-id")}),Object(g.jsx)("p",{className:"info--value",children:null===z||void 0===z?void 0:z.mandate_id})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-payer-name")}),Object(g.jsx)("p",{className:"info--value",children:null===z||void 0===z?void 0:z.payer_name})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-bank-name")}),Object(g.jsx)("p",{className:"info--value",children:null===z||void 0===z?void 0:z.bank_name})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-start")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.u)(null===z||void 0===z?void 0:z.start_date)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-end")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.u)(null===z||void 0===z?void 0:z.end_date)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-amount")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(null===z||void 0===z?void 0:z.amount,null===F||void 0===F?void 0:F.currency)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:Q("lender-web-app-status")}),Object(g.jsx)("p",{className:"info--value",children:Object(p.b)(null===z||void 0===z?void 0:z.status)})]})]})]}),V&&Object(g.jsxs)("div",{className:"info",children:[Object(g.jsx)("h3",{className:"info--heading",children:"Additional Loan Data"}),Object(g.jsx)("div",{className:"row",children:Object.entries(V).map((e=>{let[t,a]=e;return"clf_api_error"===t?"":Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:t.replace(/_/g," ")}),Object(g.jsx)("p",{className:"info--value",children:J(a,t)})]},t)}))}),Object(g.jsx)(f.a,{close:()=>W(!1),description:G.key.replace(/_/g," "),show:Y,isUpload:!1,children:Object(g.jsx)("div",{className:"modal-body fixed-modal d-flex align-items-center justify-content-center my-4",children:Object(g.jsx)("img",{width:"320px",src:G.value,alt:G.key})})})]})]})})}var _=a(239);function y(e){var t,a,n,s;let{guarantors:l,product:c,productOffer:r}=e;const o=Object(i.useCallback)((()=>null===l||void 0===l?void 0:l.filter((e=>"success"===e.status))),[]),{translate:d}=Object(h.useTranslation)();return Object(g.jsx)("div",{className:"tab-content loanDetails__tab-content",id:"myTabContent",children:Object(g.jsx)("div",{className:"tab-pane fade show active general-tab",id:"general",role:"tabpanel","aria-labelledby":"generalDetails-tab",children:Object(g.jsxs)("div",{className:"info",children:[(null===r||void 0===r||null===(t=r.attributes)||void 0===t?void 0:t.no_of_guarantors)>(null===(a=o())||void 0===a?void 0:a.length)&&Object(g.jsxs)("div",{className:"pb-6",style:{maxWidth:"442px"},children:[Object(g.jsxs)("div",{className:"input-group input-group-lg mt-3",children:[Object(g.jsx)("input",{type:"text",disabled:!0,className:"form-control text-base",value:null===c||void 0===c?void 0:c.guarantor_link}),Object(g.jsxs)("button",{disabled:!(null!==c&&void 0!==c&&c.guarantor_link),onClick:()=>Object(p.d)(null===c||void 0===c?void 0:c.guarantor_link),className:"btn text-base btn-primary input-group-append",type:"button",children:[Object(g.jsx)("img",{className:"px-2",src:_.a,alt:"copy"}),d("lender-web-app-copy")]})]}),Object(g.jsx)("div",{className:"col mt-4",children:Object(g.jsxs)("div",{className:"rounded-3 text-small p-3 bg-light-blue text-black",role:"alert",children:[Object(g.jsx)("div",{className:"d-inline-block",children:Object(g.jsx)("svg",{width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(g.jsx)("path",{className:"text-primary",fillRule:"evenodd",clipRule:"evenodd",d:"M9.0126 17C13.8219 17 17.7251 13.192 17.7251 8.5C17.7251 3.808 13.8219 0 9.0126 0C4.2033 0 0.300097 3.808 0.300097 8.5C0.300097 13.192 4.2033 17 9.0126 17ZM8.14133 4.2502H9.88383L9.88383 5.9502H8.14133V4.2502ZM9.88383 7.65H8.14133L8.14133 12.75H9.88383V7.65Z",fill:"currentColor"})})}),Object(g.jsx)("div",{className:"d-inline-block",style:{paddingLeft:"0.5rem"},children:d("lender-web-app-loan-requires-guarantor",{no_of_guarantors:null===r||void 0===r||null===(n=r.attributes)||void 0===n?void 0:n.no_of_guarantors,guarntor_text:(null===r||void 0===r||null===(s=r.attributes)||void 0===s?void 0:s.no_of_guarantors)>1?"guarantors":"guarantor"})})]})})]}),Object(g.jsx)("div",{className:"row info-nav align-items-center",children:Object(g.jsx)("div",{className:"info-nav-title col-8",children:Object(g.jsx)("h3",{className:"info--heading",children:d("lender-web-app-guarantor-details")})})}),null!==l&&void 0!==l&&l.length?l.map((e=>{let{guarantor:{first_name:t,last_name:a,relationship:n,email:s,id:l,phone_number:c},status:i}=e;return Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-xl-3 d-flex",children:[Object(g.jsx)("div",{className:"rounded-circle d-inline-block ".concat(("success"===(null===i||void 0===i?void 0:i.toLowerCase())?"bg-success":"pending"===(null===i||void 0===i?void 0:i.toLowerCase())&&"bg-warning")||"bg-danger"),style:{width:"0.5rem",height:"0.5rem",marginTop:"1rem",marginRight:"1rem"}}),Object(g.jsxs)("div",{className:"info-group",children:[Object(g.jsx)("p",{className:"info--title",children:d("lender-web-app-guarantor-name")}),Object(g.jsxs)("p",{className:"info--value",children:[t," ",a]})]})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-xl-3 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:d("lender-web-app-relationship")}),Object(g.jsx)("p",{className:"info--value",children:n})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-xl-3 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:d("lender-web-app-guarantor-email")}),Object(g.jsx)("p",{className:"info--value",children:s})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-xl-3 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:d("lender-web-app-guarantor-phone")}),Object(g.jsx)("p",{className:"info--value",children:c})]})]},l)})):Object(g.jsx)("div",{className:"info-group",children:d("lender-web-app-no-guarantor")})]})})})}function N(e){let{schedules:t,loan:a}=e;const{translate:n}=Object(h.useTranslation)(),s=Object(i.useMemo)((()=>[{field:n("lender-web-app-due-date"),transform:e=>Object(j.u)(new Date(e)),key:"due_date"},{field:n("lender-web-app-principal"),transform:j.q,key:"principal"},{field:n("lender-web-app-interest-paid"),render:e=>{const{interest_paid:t}=e;return Object(g.jsx)("td",{children:Object(j.q)(t,null===a||void 0===a?void 0:a.currency)})},key:"interest_paid"},{field:n("lender-web-app-fees"),transform:j.q,key:"fees"},{field:n("lender-web-app-balance-due"),render:e=>{const{amount_due:t}=e;return Object(g.jsx)("td",{children:Object(j.q)(t,null===a||void 0===a?void 0:a.currency)})},key:"balance_due"},{field:n("lender-web-app-status"),render:e=>{const{status:t}=e;return Object(g.jsx)("td",{children:Object(g.jsx)("div",{className:"status-pill ".concat(b.a.statusPill(t.toUpperCase())),children:Object(g.jsx)("p",{children:t.toLowerCase()})})})},key:"status"}]),[]);return Object(g.jsxs)("div",{className:"mx-5 mt-3 mb-5",children:[Object(g.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(g.jsx)("thead",{children:Object(g.jsx)("tr",{children:s.map((e=>Object(g.jsx)("th",{className:"",children:Object(j.i)(e.field)},e.key)))})}),Object(g.jsx)("tbody",{children:null===t||void 0===t?void 0:t.map((e=>Object(g.jsx)("tr",{children:s.map((t=>{const{transform:n,render:s,field:l,key:c}=t;if(s)return s(e);const i="function"===typeof n?n(e[c],null===a||void 0===a?void 0:a.currency):e[c];return Object(g.jsx)("td",{children:i},l)}))},e.id)))})]}),Object(g.jsx)("div",{className:"mobileListTable d-lg-none",children:null===t||void 0===t?void 0:t.map((e=>Object(g.jsxs)("div",{className:"list",children:[Object(g.jsx)("div",{className:"row listData",children:Object(g.jsx)("div",{className:"col",children:Object(g.jsx)("p",{className:"date",children:Object(j.u)(e.due_date)})})}),Object(g.jsxs)("div",{className:"row listData",children:[Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("p",{className:"text-black-50"}),Object(j.q)(e.principal_paid,null===a||void 0===a?void 0:a.currency)]}),Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("p",{className:"text-black-50",children:n("lender-web-app-interest-paid")}),Object(g.jsx)("p",{className:"tenor",children:Object(j.q)(e.interest_paid,null===a||void 0===a?void 0:a.currency)})]})]}),Object(g.jsxs)("div",{className:"row listData mt-3",children:[Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("p",{className:"text-black-50",children:n("lender-web-app-fees-paid")}),Object(g.jsx)("p",{className:"interest",children:Object(j.q)(e.fees_paid,null===a||void 0===a?void 0:a.currency)})]}),Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)("p",{className:"text-black-50",children:n("lender-web-app-balance")}),Object(g.jsx)("p",{className:"interest",children:Object(j.q)(e.amount_due,null===a||void 0===a?void 0:a.currency)})]})]}),Object(g.jsx)("div",{className:"row listData mt-3",children:Object(g.jsxs)("div",{className:"col d-flex align-center",children:[Object(g.jsx)("p",{className:"text-black-50",children:n("lender-web-app-status")}),Object(g.jsx)("div",{className:"status-wrapper ms-auto",children:"success"===e.status?Object(g.jsx)("svg",{width:"15",height:"15",children:Object(g.jsx)("use",{xlinkHref:"/icon-sprite.svg#done"})}):Object(g.jsx)("div",{className:"status-pill ".concat(b.a.statusPill(e.status.toUpperCase())),children:Object(g.jsx)("p",{children:e.status.toLowerCase()})})})]})})]},e.id)))})]})}var C=a(32);a(173);function k(e){var t,a,n,s,l,c,i,r,o,d,b,u,p;let{loan:m}=e;const O=m.offer_data[0],{translate:v}=Object(h.useTranslation)();return Object(g.jsx)("div",{className:"tab-content loanDetails__tab-content",id:"myTabContent",children:Object(g.jsxs)("div",{className:"tab-pane fade show active general-tab",id:"general",role:"tabpanel","aria-labelledby":"generalDetails-tab",children:[Object(g.jsxs)("div",{className:"info",children:[Object(g.jsxs)("div",{className:"row info-nav align-items-center",children:[Object(g.jsx)("div",{className:"info-nav-title col-8",children:Object(g.jsx)("h3",{className:"info--heading",children:v("lender-web-app-loan-details")})}),Object(g.jsx)("div",{className:"info-nav-btn text-right col-4"})]}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-principal")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(O.loan_amount,null===m||void 0===m||null===(t=m.product)||void 0===t?void 0:t.currency)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-interest")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(O.interest_due,null===m||void 0===m||null===(a=m.product)||void 0===a?void 0:a.currency)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-application-date")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.u)(m.created_on)})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-purpose-of-loan")}),Object(g.jsx)("p",{className:"info--value",children:null!==(n=m.purpose)&&void 0!==n?n:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-status")}),Object(g.jsx)("p",{className:"info--value co-".concat("ABANDONED".split(" ").join("-").toLowerCase()),children:v("lender-web-app-abandoned")})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-total-amount-due")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.q)(O.amount_due,null===m||void 0===m||null===(s=m.product)||void 0===s?void 0:s.currency)})]})]})]}),Object(g.jsxs)("div",{className:"info",children:[Object(g.jsx)("h3",{className:"info--heading",children:v("lender-web-app-personal-details")}),Object(g.jsxs)("div",{className:"row",children:[Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-gender")}),Object(g.jsx)("p",{className:"info--value",children:null!==(l=m.gender)&&void 0!==l?l:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-marital-status")}),Object(g.jsx)("p",{className:"info--value",children:null!==(c=m.marital_status)&&void 0!==c?c:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-children")}),Object(g.jsx)("p",{className:"info--value",children:null!==(i=m.no_of_dependent)&&void 0!==i?i:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-level-education")}),Object(g.jsx)("p",{className:"info--value",children:null!==(r=m.educational_attainment)&&void 0!==r?r:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-employment-status")}),Object(g.jsx)("p",{className:"info--value",children:null!==(o=m.employment_status)&&void 0!==o?o:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-sector-employment")}),Object(g.jsx)("p",{className:"info--value",children:null!==(d=m.sector_of_employment)&&void 0!==d?d:"-"})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsx)("p",{className:"info--title",children:v("lender-web-app-working-since")}),Object(g.jsx)("p",{className:"info--value",children:Object(j.u)(null!==(b=m.work_start_date)&&void 0!==b?b:"-")})]}),Object(g.jsxs)("div",{className:"col-6 col-md-4 col-lg-15 info-group",children:[Object(g.jsxs)("p",{className:"info--title",children:[v("lender-web-app-monthly-income")," (",Object(j.k)(null===m||void 0===m||null===(u=m.product)||void 0===u?void 0:u.currency),")"]}),Object(g.jsx)("p",{className:"info--value",children:null!==(p=m.monthly_net_income)&&void 0!==p?p:"-"})]})]})]})]})})}var S=a(147),E=a(114),T=a(6),A=a(90),L=a(11),M=a(10),D=a(9),F=a(49),I=a(7);function R(e){var t;let{bank:a,...n}=e;return Object(g.jsxs)("label",{className:"payment-card custom_checkbox",children:[Object(g.jsx)("input",{type:"radio",...n}),Object(g.jsxs)("div",{className:"content no-border",children:[Object(g.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(g.jsxs)("div",{className:"position-relative",children:[Object(g.jsx)("svg",{className:"unchecked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(g.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"})}),Object(g.jsxs)("svg",{className:"checked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(g.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"}),Object(g.jsx)("path",{d:"M6 1.3125C8.59059 1.3125 10.6875 3.40901 10.6875 6C10.6875 8.59059 8.59099 10.6875 6 10.6875C3.40941 10.6875 1.3125 8.59099 1.3125 6C1.3125 3.40941 3.40901 1.3125 6 1.3125ZM6 0.1875C2.78984 0.1875 0.1875 2.78984 0.1875 6C0.1875 9.21016 2.78984 11.8125 6 11.8125C9.21016 11.8125 11.8125 9.21016 11.8125 6C11.8125 2.78984 9.21016 0.1875 6 0.1875ZM6 4.125C4.96446 4.125 4.125 4.96446 4.125 6C4.125 7.03554 4.96446 7.875 6 7.875C7.03554 7.875 7.875 7.03554 7.875 6C7.875 4.96446 7.03554 4.125 6 4.125Z",fill:"currentColor"})]})]}),Object(g.jsx)("div",{className:"",children:Object(g.jsx)("div",{className:"col logo-wrapper",children:Object(g.jsx)("div",{className:"bank-logo",style:{width:"25px"},children:Object(g.jsx)("img",{src:null!==(t=a.url)&&void 0!==t?t:"https://documents.lendsqr.com/lsq-lendstack-files/logos/default_bank.png",alt:"bank logo"})})})})]}),Object(g.jsx)("div",{className:"",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"",children:[Object(g.jsx)("p",{className:"text-small",children:"".concat("X".repeat(4),"  ").concat("X".repeat(4)," ").concat("X".repeat(4)," ").concat(a.account_number.substring(a.account_number.length-4))}),Object(g.jsx)("p",{className:"text-small",children:a.account_name||"-"}),Object(g.jsx)("p",{className:"text-x-small text-app-gray",children:a.bank_code})]})})})]})]})}var P=a(15);function q(e){var t,a,n;let{mandate:s,...l}=e;return Object(g.jsxs)("label",{className:"payment-card custom_checkbox",children:[Object(g.jsx)("input",{type:"radio",...l}),Object(g.jsxs)("div",{className:"content no-border",children:[Object(g.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(g.jsxs)("div",{className:"position-relative",children:[Object(g.jsx)("svg",{className:"unchecked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(g.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"})}),Object(g.jsxs)("svg",{className:"checked-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(g.jsx)("path",{d:"M6 0.1875C2.78906 0.1875 0.1875 2.78906 0.1875 6C0.1875 9.21094 2.78906 11.8125 6 11.8125C9.21094 11.8125 11.8125 9.21094 11.8125 6C11.8125 2.78906 9.21094 0.1875 6 0.1875ZM6 10.6875C3.41016 10.6875 1.3125 8.58984 1.3125 6C1.3125 3.41016 3.41016 1.3125 6 1.3125C8.58984 1.3125 10.6875 3.41016 10.6875 6C10.6875 8.58984 8.58984 10.6875 6 10.6875Z",fill:"currentColor"}),Object(g.jsx)("path",{d:"M6 1.3125C8.59059 1.3125 10.6875 3.40901 10.6875 6C10.6875 8.59059 8.59099 10.6875 6 10.6875C3.40941 10.6875 1.3125 8.59099 1.3125 6C1.3125 3.40941 3.40901 1.3125 6 1.3125ZM6 0.1875C2.78984 0.1875 0.1875 2.78984 0.1875 6C0.1875 9.21016 2.78984 11.8125 6 11.8125C9.21016 11.8125 11.8125 9.21016 11.8125 6C11.8125 2.78984 9.21016 0.1875 6 0.1875ZM6 4.125C4.96446 4.125 4.125 4.96446 4.125 6C4.125 7.03554 4.96446 7.875 6 7.875C7.03554 7.875 7.875 7.03554 7.875 6C7.875 4.96446 7.03554 4.125 6 4.125Z",fill:"currentColor"})]})]}),Object(g.jsx)("div",{className:"",children:Object(g.jsx)("div",{className:"col logo-wrapper",children:Object(g.jsx)("div",{className:"bank-logo",style:{width:"25px"},children:Object(g.jsx)("img",{src:null!==(t=null===(a=s.details)||void 0===a?void 0:a.url)&&void 0!==t?t:"https://documents.lendsqr.com/lsq-lendstack-files/logos/default_bank.png",alt:"bank logo"})})})})]}),Object(g.jsx)("div",{className:"",children:Object(g.jsx)("div",{className:"",children:Object(g.jsxs)("div",{className:"",children:[Object(g.jsxs)("p",{className:"text-small",children:[null===s||void 0===s?void 0:s.payer_account," / ",s.payer_name||"-"]}),Object(g.jsx)("p",{className:"text-x-small text-app-gray",children:null===(n=s.details)||void 0===n?void 0:n.code_description})]})})})]})]})}function U(e){let{productId:t,callBack:a,screen:n,setScreen:l,card_id:c,mandate_id:r,setBankToUse:d,setCardToUse:b,setMandateToUse:u,bank_id:j,repaymentAmount:p}=e;const[O,v]=Object(i.useState)("Debit Card"),[x,f]=Object(i.useState)(p),[w,_]=Object(i.useState)(""),[y,N]=Object(i.useState)(!1),[k,S]=Object(i.useState)(""),{translate:E}=Object(h.useTranslation)(),[A,F]=Object(P.a)(Object(i.useCallback)((e=>[e.direct_debit_provider,e.mobile_money_provider]),[])),[R,q,U]=Object(s.a)((e=>[e.fetchUssd,e.ussd,e.fetchLoans]),o.shallow),[Y,W]=Object(m.a)((e=>[e.wallet,e.fetchWallet]),o.shallow);Object(i.useEffect)((()=>{W()}),[]);Object(i.useEffect)((()=>{_(""),"USSD"===O&&R(x)}),[O]);const G=Object(i.useMemo)((()=>"none"!==F?["Debit Card","Mobile Money"]:"none"!==A?["Wallet","Debit Card","Mandate"]:["Wallet","Debit Card"]),[F,A]);return Object(g.jsx)("div",{className:"col-12 scroll-modal",children:Object(g.jsxs)("div",{className:"card default-card",children:[Object(g.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(g.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(g.jsx)("div",{children:Object(g.jsx)("div",{className:"row ",children:Object(g.jsx)("div",{className:"pl-4 col-12 repayment-form loan-form ",children:"repay"===n?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("p",{className:"mb-2 text-black fs-5 fw-bold",children:E("lender-web-app-how-much-repay")}),Object(g.jsx)("div",{className:"form-group",children:Object(g.jsx)(I.e,{currency:null===Y||void 0===Y?void 0:Y.currency,placeholder:E("lender-web-app-enter-an-amount"),label:E("lender-web-app-amount"),onChange:e=>f(e),defaultValue:x})}),Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("p",{className:"text-black fs-5 fw-bold",children:E("lender-web-app-how-to-repay")}),Object(g.jsx)("small",{className:"text-black-50",children:E("lender-web-app-select-repayment-method")}),Object(g.jsx)("div",{className:"justify-between row type repayment-method",children:G.map((e=>{let t="";return"Wallet"===e?t=E("lender-web-app-wallet"):"Debit Card"===e?t=E("lender-web-app-debit-card"):"Mandate"===e?t="Mandate":"Mobile Money"===e&&(t="Mobile Money"),Object(g.jsx)("div",{className:"col-6 col-sm-4",children:Object(g.jsx)(I.g,{disabled:"USSD"===e&&!x,label:t,checked:O===e,onChange:()=>v(e)})},e)}))}),"Debit Card"===O&&Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)(V,{chosen:c,onChange:b}),Object(g.jsx)("div",{className:"mt-4"})]}),"Mandate"===O&&Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)(H,{chosen:r,onChange:u}),Object(g.jsx)("div",{className:"mt-4"})]}),"Mobile Money"===O&&Object(g.jsxs)("div",{className:"col",children:[Object(g.jsx)(B,{chosen:j,onChange:d}),Object(g.jsx)("div",{className:"mt-4"})]})]})]}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("p",{className:"text-black fs-5 fw-bold",children:E("lender-web-app-authorize-transaction")}),Object(g.jsx)("p",{className:"mt-5 ",children:E("lender-web-app-enter-pin")}),Object(g.jsx)(I.o,{length:4,onChange:e=>{S(e)},password:!0})]})})})})})}),Object(g.jsxs)("div",{className:"d-flex justify-content-between modal-footer control ",children:[Object(g.jsx)("button",{type:"button",onClick:()=>{"pin"===n?l("repay"):a(!1)},className:"pl-0 btn btn-ghost btn-lg",children:E("lender-web-app-back")}),Object(g.jsx)(T.a,{isLoading:y,onClick:()=>"repay"===n?l("pin"):(async()=>{N(!0);const e={amount:Number(x),pin:k};"Debit Card"===O?e.card_id=c:"Mandate"===O?e.mandate_id=r:"Wallet"===O?e.use_wallet=!0:"Mobile Money"===O&&(e.bank_account_id=j);try{if(U(),"USSD"===O)await Object(L.a)(Object(M.K)(q.id),"get");else{const a=await Object(L.a)(Object(M.ac)(t),"post",e);D.toast.success(null===a||void 0===a?void 0:a.message),N(!1)}a(!0),Object(C.a)({event_name:C.b.LOAN_REPAYMENT,loan_id:t})}catch(n){D.toast.error(n.message),N(!1)}})(),isDisabled:!x||"Debit Card"===O&&!c||"Mandate"===O&&!r||"USSD"===O&&!w||"Mobile Money"===O&&!j,className:"px-5 btn btn-primary btn-lg",children:E("lender-web-app-continue")})]})]})})}function B(e){var t;let{onChange:a,chosen:n}=e;const s=Object(m.a)((e=>e.banks)),l=Object(m.a)((e=>e.fetchUserAccounts)),c=Object(m.a)((e=>e.banksStatus));Object(i.useEffect)((()=>{l()}),[]);const{translate:r}=Object(h.useTranslation)();return Object(g.jsxs)("div",{className:"small",children:[Object(g.jsx)(F.c,{children:null===(t=s.filter((e=>"mobile"===e.account_type)))||void 0===t?void 0:t.map((e=>Object(g.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(g.jsx)(R,{bank:e,value:e.id,checked:+n===e.id,onChange:e=>a(e.target.value)})},e.id)))}),Object(g.jsx)(A.a,{allowBank:!0,isMobile:!0,renderButton:e=>Object(g.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(g.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{e()},children:"loading"===c?Object(g.jsx)("div",{className:"spinner-border",children:Object(g.jsxs)("span",{className:"visually-hidden",children:[r("loading"),"..."]})}):Object(g.jsx)("p",{className:"mt-2",children:r("lender-web-app-add-new-bank")})})})})]})}function V(e){let{onChange:t,chosen:a}=e;const[n,s]=Object(m.a)((e=>[e.initCard,e.cardInitStatus]),o.shallow),[l,c]=Object(m.a)((e=>[e.cards,e.fetchCards]),o.shallow);Object(i.useEffect)((()=>{c()}),[]);const{translate:r}=Object(h.useTranslation)();return Object(g.jsxs)("div",{className:"small",children:[Object(g.jsx)(F.c,{children:null===l||void 0===l?void 0:l.map((e=>Object(g.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(g.jsx)(E.a,{card:e,value:e.id,defaultChecked:+a===e.id,onChange:e=>t(e.target.value)})},e.id)))}),Object(g.jsx)(A.a,{allowCard:!0,allowBank:!1,renderButton:e=>Object(g.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(g.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{"idle"===s?n().then((()=>e())).catch((e=>{console.log(e,"error initiating card")})):e()},children:"loading"===s?Object(g.jsx)("div",{className:"spinner-border",children:Object(g.jsxs)("span",{className:"visually-hidden",children:[r("loading"),"..."]})}):Object(g.jsx)("p",{className:"mt-2",children:r("lender-web-app-add-new-card")})})})})]})}function H(e){var t;let{onChange:a,chosen:n}=e;const l=Object(s.a)((e=>e.mandateStatus)),[c,r]=Object(s.a)((e=>[e.mandates,e.fetchMandates]),o.shallow);Object(i.useEffect)((()=>{r()}),[]);const{translate:d}=Object(h.useTranslation)();return Object(g.jsxs)("div",{className:"small",children:[Object(g.jsx)(F.c,{children:null===c||void 0===c||null===(t=c.filter((e=>"successful"===e.status)))||void 0===t?void 0:t.map((e=>Object(g.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(g.jsx)(q,{mandate:e,value:e.id,defaultChecked:+n===e.id,onChange:e=>a(e.target.value)})},e.id)))}),Object(g.jsx)(A.a,{allowBank:!0,isMandate:!0,renderButton:e=>Object(g.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(g.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{e()},children:"loading"===l?Object(g.jsx)("div",{className:"spinner-border",children:Object(g.jsxs)("span",{className:"visually-hidden",children:[d("loading"),"..."]})}):Object(g.jsx)("p",{className:"mt-2",children:d("lender-web-app-add-new-mandate")})})})})]})}var Y,W,G=a(12),Z=a(8);function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},K.apply(this,arguments)}function z(e,t){let{title:a,titleId:n,...s}=e;return i.createElement("svg",K({width:60,height:60,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":n},s),a?i.createElement("title",{id:n},a):null,Y||(Y=i.createElement("g",{id:"gateway 1",clipPath:"url(#clip0_2919_29598)"},i.createElement("path",{id:"Vector",d:"M54.4067 35.5928L58.549 40.5628C59.1578 41.2937 59.4915 42.2154 59.4915 43.1673V59.9996H54.4067V35.5928Z",fill:"#FEC9A3"}),i.createElement("path",{id:"Vector_2",d:"M54.4068 22.983C54.4068 21.5227 53.223 20.3389 51.7626 20.3389H34.6781C33.2177 20.3389 32.0339 21.5227 32.0339 22.983V25.4236H54.4068V22.983Z",fill:"#E0E0DE"}),i.createElement("path",{id:"Vector_3",opacity:.3,d:"M32.0339 25.4238H54.4068V53.8984H32.0339V25.4238Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_4",d:"M32.0339 53.8984V56.339C32.0339 57.7994 33.2177 58.9832 34.6781 58.9832H51.7626C53.223 58.9832 54.4068 57.7994 54.4068 56.339V53.8984H32.0339Z",fill:"#E0E0DE"}),i.createElement("path",{id:"Vector_5",d:"M49.3221 38.6442C48.1989 37.521 46.3775 37.521 45.2543 38.6442C44.1311 39.7674 44.1311 41.5888 45.2543 42.712L51.356 48.8137L51.2646 48.9671C49.4482 51.9931 49.4835 55.7823 51.356 58.7736V60.0001H56.4407V45.7628L49.3221 38.6442Z",fill:"#FEC9A3"}),i.createElement("path",{id:"Vector_6",d:"M24.9153 8.13559H0.508545V4.0678L12.7119 0L24.9153 4.0678V8.13559Z",fill:"#FFB531"}),i.createElement("path",{id:"Vector_7",d:"M11.6948 3.05078H13.7287V5.08468H11.6948V3.05078Z",fill:"#E8770C"}),i.createElement("path",{id:"Vector_8",d:"M0.508545 17.2881H24.9153V21.3559H0.508545V17.2881Z",fill:"#FFB531"}),i.createElement("path",{id:"Vector_9",d:"M2.54248 8.13574H6.61028V17.2883H2.54248V8.13574Z",fill:"#FFA912"}),i.createElement("path",{id:"Vector_10",d:"M10.678 8.13574H14.7458V17.2883H10.678V8.13574Z",fill:"#FFA912"}),i.createElement("path",{id:"Vector_11",d:"M18.8135 8.13574H22.8813V17.2883H18.8135V8.13574Z",fill:"#FFA912"}),i.createElement("path",{id:"Vector_12",d:"M2.54248 8.13574H6.61028V10.1696H2.54248V8.13574Z",fill:"#E8770C"}),i.createElement("path",{id:"Vector_13",d:"M10.678 8.13574H14.7458V10.1696H10.678V8.13574Z",fill:"#E8770C"}),i.createElement("path",{id:"Vector_14",d:"M18.8135 8.13574H22.8813V10.1696H18.8135V8.13574Z",fill:"#E8770C"}),i.createElement("g",{id:"Group"},i.createElement("path",{id:"Vector_15",d:"M11.6948 24.4072H13.7287V26.4411H11.6948V24.4072Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_16",d:"M11.6948 36.6104H13.7287V38.6443H11.6948V36.6104Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_17",d:"M17.7966 44.7461V46.78H15.7627V44.7461H17.7966Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_18",d:"M11.6948 28.4746H13.7287V30.5085H11.6948V28.4746Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_19",d:"M11.6948 40.6777H13.7287V42.7116H11.6948V40.6777Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_20",d:"M21.864 44.7461V46.78H19.8301V44.7461H21.864Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_21",d:"M11.6948 32.542H13.7287V34.5759H11.6948V32.542Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_22",d:"M11.6948 44.7461H13.7287V46.78H11.6948V44.7461Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_23",d:"M25.9316 44.7461V46.78H23.8977V44.7461H25.9316Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_24",d:"M29.9995 44.7461V46.78H27.9656V44.7461H29.9995Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_25",d:"M30 11.1865H32.0339V13.2204H30V11.1865Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_26",d:"M25.9321 11.1865H27.966V13.2204H25.9321V11.1865Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_27",d:"M34.0676 11.1865H36.1015V13.2204H34.0676V11.1865Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_28",d:"M38.1355 11.1865H40.1694V13.2204H38.1355V11.1865Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_29",d:"M42.2034 11.1865H44.2373V13.2204H42.2034V11.1865Z",fill:"#B0FCF8"}),i.createElement("path",{id:"Vector_30",d:"M42.2034 15.2539H44.2373V17.2878H42.2034V15.2539Z",fill:"#B0FCF8"})))),W||(W=i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_2919_29598"},i.createElement("rect",{width:60,height:60,fill:"white"})))))}const J=i.forwardRef(z);a.p;var Q=a(253);const X=e=>{let{offers:t,type:a,onChange:n}=e;const{translate:s}=Object(h.useTranslation)();return Object(g.jsxs)("div",{children:[Object(g.jsx)("label",{className:"h5 text-primary text-medium mb-35",children:s("lender-web-app-loan-offers-eligible")}),null===t||void 0===t?void 0:t.map((e=>Object(g.jsx)("div",{className:"w-100",children:Object(g.jsx)(I.g,{label:"",name:"extension_offers",checked:a===e.type,onChange:()=>n(e.type),value:e.type,children:Object(g.jsx)("div",{className:"w-100 mw-400 text-medium pt-4 pb-2",style:{color:"#000000"},children:e.text})},e.id)},e.id)))]})},$=e=>{var t,a,n,s,l,c,i,r,o;let{loan:d,offer:b,loanProfile:u,schedule:p,currency:m}=e;const{translate:O}=Object(h.useTranslation)();return Object(g.jsxs)("div",{children:[Object(g.jsx)("label",{className:"h5 text-primary text-medium mb-35",children:O("lender-web-app-how-long-extend")}),Object(g.jsxs)("div",{children:[Object(g.jsx)(G.c,{initialValues:{tenor:""},validationSchema:Z.g().shape({tenor:Z.f().required(O("lender-web-app-select-extention-tenor")).min(1,O("lender-web-app-tenor-min-1")).max(null===b||void 0===b||null===(t=b.attributes)||void 0===t||null===(a=t.loan_extension_features)||void 0===a?void 0:a.max_extension_period,O("lender-web-app-tenor-cannot-greater",{max:null===b||void 0===b||null===(n=b.attributes)||void 0===n||null===(s=n.loan_extension_features)||void 0===s?void 0:s.max_extension_period}))}),onSubmit:async e=>console.log("loan extension",e),children:e=>Object(g.jsx)(G.b,{method:"post",id:"extension_tenor_submit",onSubmit:e.handleSubmit,children:Object(g.jsxs)("div",{className:"w-100 d-flex gap-3",children:[Object(g.jsx)("div",{className:"w-100",children:Object(g.jsx)(I.s,{name:"tenor",label:O("lender-web-app-how-long"),type:"number"})}),Object(g.jsx)("div",{className:"w-100",children:Object(g.jsx)(I.q,{disabled:!0,name:"period",label:"Period",valueField:"tenor_period_value",labelField:"tenor_period",keyField:"tenor_period_value",options:[{tenor_period_value:"daily",tenor_period:"Days"}]})})]})})}),Object(g.jsxs)("div",{className:"mt-5 bg-light-blue rounded-3 p-4",children:[Object(g.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(g.jsxs)("div",{children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-loan-amount")}),Object(g.jsx)("p",{className:"text-medium",children:Object(j.q)(null===u||void 0===u?void 0:u.loan_amount,m)})]}),Object(g.jsxs)("div",{children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-interest")}),Object(g.jsx)("p",{className:"text-medium",children:Object(j.q)(null===u||void 0===u?void 0:u.interest_due,m)})]})]}),Object(g.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(g.jsxs)("div",{className:"",children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-total-amount-due")}),Object(g.jsx)("p",{className:"text-medium",children:(()=>{var e,t;if("running"==(null===d||void 0===d||null===(e=d.status)||void 0===e||null===(t=e.status)||void 0===t?void 0:t.toLowerCase())){const e=null!==d&&void 0!==d&&d.schedules.length?null===d||void 0===d?void 0:d.schedules.reduce(((e,t)=>e+parseFloat(t.amount_due)),0):null===u||void 0===u?void 0:u.amount_due;return Object(j.q)(e,m)}return Object(j.q)(0,m)})()})]}),Object(g.jsxs)("div",{className:"text-right",children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-due-date")}),Object(g.jsx)("p",{className:"text-medium",children:Object(j.u)(null===(l=p[(null===p||void 0===p?void 0:p.length)-1])||void 0===l?void 0:l.due_date)})]})]}),Object(g.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(g.jsxs)("div",{className:"",children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-frequency")}),Object(g.jsx)("p",{className:"text-capitalize text-medium",children:null===u||void 0===u?void 0:u.frequency})]}),Object(g.jsxs)("div",{className:"text-right",children:[Object(g.jsx)("p",{className:"text-app-gray",children:O("lender-web-app-period")}),Object(g.jsx)("p",{className:"text-medium",children:null===u||void 0===u?void 0:u.tenor})]})]})]}),null!==d&&void 0!==d&&null!==(c=d.schedules)&&void 0!==c&&null!==(i=c.filter((e=>"success"===e.status)))&&void 0!==i&&i.length?Object(g.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-4",children:[Object(g.jsxs)("div",{className:"d-flex justify-content-between align-items-center",children:[Object(g.jsx)("p",{className:"text-app-gray flex-1",children:O("lender-web-app-date")}),Object(g.jsx)("p",{className:"text-app-gray flex-2",children:O("lender-web-app-amount-due")}),Object(g.jsx)("p",{className:"text-app-gray flex-1 text-right",children:O("lender-web-app-balance")})]}),null===d||void 0===d||null===(r=d.schedules)||void 0===r||null===(o=r.filter((e=>"success"===e.status||"partial"===e.status)).sort(((e,t)=>new Date(e.due_date).getTime()-new Date(t.due_date).getTime())))||void 0===o?void 0:o.map((e=>Object(g.jsxs)("div",{className:"mt-4 py-2 d-flex justify-content-between align-items-center",children:[Object(g.jsx)("p",{className:"text-medium flex-1",children:Object(j.u)(null===e||void 0===e?void 0:e.due_date)}),Object(g.jsx)("p",{className:"text-medium flex-2",children:Object(j.q)(null===e||void 0===e?void 0:e.schedule_amount_due,m)}),Object(g.jsx)("p",{className:"text-medium flex-1 text-right",children:Object(j.q)(null===e||void 0===e?void 0:e.amount_due,m)})]},null===e||void 0===e?void 0:e.id)))]}):Object(g.jsx)(g.Fragment,{})]})]})},ee=e=>{let{paymentStatus:t,tenor:a,fee:n,currency:s}=e;const{translate:l}=Object(h.useTranslation)(),c=1===Number(a)?"day":"days";return Object(g.jsxs)("div",{className:"w-sm-100 w-75 mx-auto py-5 px-4 text-center",children:[Object(g.jsx)(J,{}),Object(g.jsx)("h5",{className:"my-4 text-semibold",children:l("lender-web-app-pay-extend-loan")}),Object(g.jsx)("p",{className:"small px-3",style:{color:"#595959"},children:t?"You are about to extend your loan schedule by ".concat(a," ").concat(c," for ").concat(Object(j.q)(n,s)):"You do not have enough funds in your wallet to extend this loan"})]})},te=e=>{let{setPin:t}=e;const{translate:a}=Object(h.useTranslation)();return Object(g.jsxs)("div",{className:"py-5",children:[Object(g.jsx)("p",{className:"mb-2",children:a("lender-web-app-enter-your-pin")}),Object(g.jsx)(I.o,{length:4,onChange:e=>{t(e)},password:!0})]})},ae=()=>{const{translate:e}=Object(h.useTranslation)();return Object(g.jsxs)("div",{className:"d-flex py-5 flex-column align-items-center",children:[Object(g.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(g.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(g.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(g.jsxs)("defs",{className:"text-primary",children:[Object(g.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(g.jsx)("stop",{stopColor:"currentColor"}),Object(g.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(g.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(g.jsx)("stop",{stopColor:"currentColor"}),Object(g.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(g.jsxs)("h6",{className:"mt-35 mb-3 text-medium text-primary",style:{fontSize:"1.125rem"},children:[e("lender-web-app-success"),"!"]}),Object(g.jsx)("p",{className:"small",style:{color:"#595959"},children:e("lender-web-app-successful-loan-extention")})]})};var ne=e=>{let{setShowModal:t,showModal:a,loan:n,product:l,updateLoans:c}=e;const[r,d]=Object(i.useState)("offers"),[b,u]=Object(i.useState)(!1),[p,O]=Object(i.useState)(!1),[v,x]=Object(i.useState)(!1),[w,_]=Object(i.useState)(""),[y,N]=Object(i.useState)(0),[C,k]=Object(i.useState)(),[S,E]=Object(i.useState)({}),[A,L]=Object(i.useState)(),M="",[D,F]=Object(i.useState)(""),I=Object(i.useMemo)((()=>{var e,t,a,n;if(A)return[{id:null===(e=A[0])||void 0===e?void 0:e.id,type:"single",text:"Extend upcoming loan schedule due on ".concat(Object(j.u)(null===(t=A[0])||void 0===t?void 0:t.due_date)," for ").concat(Object(j.q)(y,null===l||void 0===l?void 0:l.currency))},{id:null===(a=A[(null===A||void 0===A?void 0:A.length)-1])||void 0===a?void 0:a.id,type:"all",text:"Extend full loan (all schedules) due on ".concat(Object(j.u)(null===(n=A[(null===A||void 0===A?void 0:A.length)-1])||void 0===n?void 0:n.due_date)," for ").concat(Object(j.q)(y*(null===A||void 0===A?void 0:A.length),null===l||void 0===l?void 0:l.currency))}]}),[A,l]),[R,P]=Object(m.a)((e=>[e.fetchWallet,e.wallet]),o.shallow),[q,U,B]=Object(s.a)((e=>[e.requestLoanExtension,e.requestLoanScheduleExtension,e.loanExtensionStatus]),o.shallow);Object(i.useEffect)((()=>{"success"===B&&d("success")}),[B]);const{translate:V}=Object(h.useTranslation)();Object(i.useEffect)((()=>{O(!1),R()}),[a]),Object(i.useEffect)((()=>{A&&(1===(null===n||void 0===n?void 0:n.multi_tenor)&&(null===A||void 0===A?void 0:A.length)>1?d("offers"):d("tenor"))}),[a,n,A]),Object(i.useEffect)((()=>{P&&"single"===w&&(null===P||void 0===P?void 0:P.availableBalance)<y||P&&A&&"all"===w&&(null===P||void 0===P?void 0:P.availableBalance)<y*(null===A||void 0===A?void 0:A.length)?u(!1):u(!0)}),[w,P,y,A]),Object(i.useEffect)((()=>{(x(!1),"offers"===r&&x(!w||""===w),"tenor"===r)&&x(!0);"pin"===r&&x(4!==D.length)}),[r,w,M,D,a]),Object(i.useEffect)((()=>{var e,t,a,s;(k(l),null!==n&&void 0!==n&&null!==(e=n.schedules)&&void 0!==e&&e.length)&&L(null===n||void 0===n||null===(s=n.schedules)||void 0===s?void 0:s.filter((e=>"success"!==e.status)).sort(((e,t)=>new Date(e.due_date).getTime()-new Date(t.due_date).getTime())));if(null!==C&&void 0!==C&&null!==(t=C.fees)&&void 0!==t&&t.length){var c;const e=null===C||void 0===C||null===(c=C.fees)||void 0===c?void 0:c.reduce(((e,t)=>"Loan Extension"===t.category?e+t.amount:e),0);N(e)}const i=JSON.parse((null===n||void 0===n||null===(a=n.loan_profile)||void 0===a?void 0:a.offer_data)||"[{}]")[0];E(i)}),[n,l]);const H=()=>{switch(r){case"offers":return Object(g.jsx)(X,{offers:I,type:w,onChange:_});case"tenor":return Object(g.jsx)($,{loan:n,offer:C,loanProfile:S,schedule:A,currency:null===l||void 0===l?void 0:l.currency});case"payment":return Object(g.jsx)(ee,{paymentStatus:b,tenor:M,fee:"single"===w?y:A&&y*(null===A||void 0===A?void 0:A.length),currency:null===l||void 0===l?void 0:l.currency});case"pin":return Object(g.jsx)(te,{setPin:F});case"success":return Object(g.jsx)(ae,{});default:return Object(g.jsx)(g.Fragment,{})}},Y=e=>{switch(r){case"offers":"next"===e?d("tenor"):t(!1);break;case"tenor":(e=>{"next"===e?d("payment"):A&&1===(null===n||void 0===n?void 0:n.multi_tenor)&&(null===A||void 0===A?void 0:A.length)>1?d("offers"):t(!1)})(e);break;case"payment":(e=>{"next"===e&&b?d("pin"):"next"!==e||b?d("tenor"):O(!0)})(e);break;case"pin":"next"===e&&b?(()=>{var e;"single"===w?U({loan_id:null===n||void 0===n?void 0:n.id,schedule_id:null===A||void 0===A||null===(e=A[0])||void 0===e?void 0:e.id},{pin:D,no_of_days:Number(M)}):q({loan_id:null===n||void 0===n?void 0:n.id},{pin:D,no_of_days:Number(M)})})():d("payment");break;case"success":"next"===e&&(c(),t(!1))}},W=()=>{let e="Continue";return"payment"!==r||b?"success"===r&&(e="View loan status"):e="Fund Wallet",e};return p?Object(g.jsx)(Q.a,{setShowModal:t,showModal:a}):Object(g.jsxs)(f.a,{close:()=>t(!1),description:"success"===r?"":"Extend Loan",show:a,isUpload:!1,children:[Object(g.jsx)("div",{className:"modal-body",style:{height:"22rem"},children:H()}),Object(g.jsxs)("div",{className:"modal-footer ".concat("success"===r?"justify-content-end align-items-end":"justify-content-between align-items-center"),children:["success"!==r&&Object(g.jsx)(T.a,{className:"ms-1",style:{width:"auto"},onClick:()=>Y("back"),children:V("lender-web-app-back")}),Object(g.jsx)(T.a,{className:"py-2 btn-primary",isLoading:"pin"===r&&"loading"===B,isDisabled:v||"loading"===B,onClick:()=>Y("next"),children:W()})]})]})},se=a(261);function le(e){return"proposed_tenor"in e&&"proposed_tenor_period"in e&&"requested_amount"in e&&"purpose"in e}function ce(e){return"loan_amount"in e&&"interest_due"in e&&"status"in e&&"loan_profile"in e}function ie(e){return ce(e)?"UserLoanProduct":"DraftLoanProduct"}function re(){var e,t,a,n,u,j,p,m,O,v,x,_,E,A;const{url:L,params:M}=Object(l.k)(),[D,F]=Object(i.useState)(!1),[I,R]=Object(i.useState)(!1),[P,q]=Object(i.useState)(!1),[B,V]=Object(i.useState)(!1),[H,Y]=Object(i.useState)(!1),[W,G]=Object(i.useState)("repay"),[Z,K]=Object(i.useState)(""),[z,J]=Object(i.useState)(""),[Q,X]=Object(i.useState)(""),[$,ee]=Object(i.useState)(!1),[te,ae]=Object(i.useState)({show:!1,bottom:!1}),re=Object(i.useRef)(te),oe=Object(l.i)(),[de,be]=Object(i.useState)(),[ue,je]=Object(i.useState)(!1),[pe,me]=Object(i.useState)(),{translate:he}=Object(h.useTranslation)(),[Oe,ve,xe,fe,ge,we,_e]=Object(s.a)((e=>[e.myDraftLoans,e.fetchLoans,e.loanCompletionStatus,e.fetchDraftLoans,e.myLoans,e.products,e.fetchSingleLoan]),o.shallow);Object(i.useEffect)((()=>{ye()}),[M.id]);const ye=async()=>{let e;const t=null===ge||void 0===ge?void 0:ge.find((e=>e.id===+M.id));if(t){await _e(M.id);const{singleLoan:a}=s.a.getState();e={...t,...a}}else e=Oe.find((e=>e.id===+M.id));if(!e)return oe.goBack(),null;me(e)},Ne=Object(i.useMemo)((()=>{var e;return null===pe||void 0===pe||null===(e=pe.schedule)||void 0===e?void 0:e.amount_due}),[pe]),Ce=Object(i.useMemo)((()=>{if(pe&&"loan_profile"in pe)return null===we||void 0===we?void 0:we.find((e=>{var t;return(null===e||void 0===e?void 0:e.id)===(null===pe||void 0===pe||null===(t=pe.loan_profile)||void 0===t?void 0:t.product_id)}))}),[we,pe]);Object(i.useEffect)((()=>{ve()}),[H]);const ke=Object(i.useCallback)((()=>{je(!0)}),[]),Se=()=>{const{show:e,bottom:t}=re.current,a=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight);!e&&window.scrollY>=80?ae((e=>({...e,show:!0}))):e&&window.scrollY<=75?ae((e=>({...e,show:!1}))):e&&!t&&window.scrollY+window.innerHeight==a?ae((e=>({...e,bottom:!0}))):t&&window.scrollY+window.innerHeight<a-80&&ae((e=>({...e,bottom:!1})))};Object(i.useEffect)((()=>{Object(C.a)({event_name:C.b.LOAN_VIEW_EXISTING,loan_id:+M.id})}),[]),Object(i.useEffect)((()=>{const e=null===ge||void 0===ge?void 0:ge.find((e=>{var t;return["running","pending","past_due"].includes(b.a.statusPill(null===e||void 0===e||null===(t=e.status)||void 0===t?void 0:t.status))}));be(e)}),[ge]),Object(i.useEffect)((()=>(window.addEventListener("scroll",Se),()=>{ae({show:!1,bottom:!1}),window.removeEventListener("scroll",Se)})),[]),Object(i.useEffect)((()=>{re.current=te}),[te]);const Ee=Object(i.useMemo)((()=>{var e;return pe&&"loan_profile"in pe?JSON.parse(null===pe||void 0===pe||null===(e=pe.loan_profile)||void 0===e?void 0:e.offer_data):JSON.parse("[{}]")}),[pe]);if(!pe)return null;return Object(g.jsxs)("div",{className:"row",children:[Object(g.jsx)("div",{className:"col",children:Object(g.jsx)("div",{className:"row position-relative",children:Object(g.jsxs)("div",{className:"col-12 ",children:[Object(g.jsxs)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center loan-button-container ",children:[Object(g.jsxs)(c.b,{to:null===(e=r.a.loans)||void 0===e?void 0:e.base,className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center back-to-loan-link",children:[Object(g.jsx)("div",{className:"icon d-flex align-items-center",children:Object(g.jsx)("svg",{width:"20",height:"20",children:Object(g.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(g.jsx)("p",{children:he("lender-web-app-back-loans")})]}),Object(g.jsxs)("div",{className:"btn-with-navig_btns",children:["UserLoanProduct"===ie(pe)&&ce(pe)&&!(null===pe||void 0===pe||null===(t=pe.status)||void 0===t||!t.can_cancel)&&!ue&&b.a.statusPill("PENDING")&&Object(g.jsx)(d.b,{onSuccess:ke,id:null===pe||void 0===pe?void 0:pe.id}),"UserLoanProduct"===ie(pe)&&ce(pe)&&"SETTLED"===(null===pe||void 0===pe||null===(a=pe.status)||void 0===a?void 0:a.status)&&!de&&Ce&&Object(g.jsx)(T.a,{className:"btn-outline-primary btn take-btn",onClick:()=>{var e;V(!0),oe.push({search:"?id=".concat(null===pe||void 0===pe||null===(e=pe.loan_profile)||void 0===e?void 0:e.product_id)})},children:he("lender-web-app-take-loan-again")}),"UserLoanProduct"===ie(pe)&&ce(pe)&&("RUNNING"===(null===pe||void 0===pe||null===(n=pe.status)||void 0===n?void 0:n.status)||"PAST DUE"===(null===pe||void 0===pe||null===(u=pe.status)||void 0===u?void 0:u.status))&&Object(g.jsxs)("div",{className:"button-holder",children:[(null===Ce||void 0===Ce||null===(j=Ce.attributes)||void 0===j||null===(p=j.loan_extension_features)||void 0===p?void 0:p.active)&&Number(null===pe||void 0===pe?void 0:pe.extension_limit)!==Number(null===Ce||void 0===Ce||null===(m=Ce.attributes)||void 0===m||null===(O=m.loan_extension_features)||void 0===O?void 0:O.extension_limit)&&!(null===Ce||void 0===Ce||null===(v=Ce.fees)||void 0===v||null===(x=v.filter((e=>"Loan Extension"===e.category)))||void 0===x||!x.length)&&Object(g.jsx)(T.a,{className:"my-btn py-2 btn-primary",onClick:()=>ee(!0),children:he("lender-web-app-extend-loan")}),Object(g.jsx)("button",{className:"my-btn btn-outline-primary",onClick:()=>Y(!0),children:he("lender-web-app-repay-now")})]}),"DraftLoanProduct"===ie(pe)&&Object(g.jsxs)("div",{className:"btn-container-details",children:[Object(g.jsx)("button",{className:"btn btn-outline-primary decline-offer",onClick:()=>{R(!0)},children:he("lender-web-app-decline-offer")}),Object(g.jsx)("button",{className:"btn btn-outline-primary",onClick:()=>{F(!0)},children:he("lender-web-app-accept-offer")})]})]})]}),Object(g.jsx)("div",{className:"pageTitle",children:Object(g.jsx)("p",{children:he("lender-web-app-loan-details")})}),Object(g.jsxs)("div",{className:"card default-card",children:[Object(g.jsx)("ul",{className:"nav nav-tabs loanDetails-tab",role:"tablist",children:null===(_=[{text:he("lender-web-app-general-details"),path:"general"},(null===Ee||void 0===Ee||null===(E=Ee.attributes)||void 0===E?void 0:E.require_guarantor)&&{text:he("lender-web-app-guarantor-details"),path:"guarantor"},"status"in pe&&void 0!==(null===pe||void 0===pe||null===(A=pe.status)||void 0===A?void 0:A.status)&&{text:he("lender-web-app-repayment-schedule"),path:"repayment"}])||void 0===_?void 0:_.filter(Boolean).map((e=>Object(g.jsx)("li",{className:"nav-item",role:"presentation",children:Object(g.jsx)(c.b,{to:[L,e.path].join("/"),className:"nav-link ".concat(oe.location.pathname.includes(e.path)?"active":""),role:"tab",children:e.text})},e.path)))}),Object(g.jsxs)(l.e,{children:[Object(g.jsx)(l.c,{path:[L,"general"].join("/"),children:"UserLoanProduct"===ie(pe)?Object(g.jsx)(w,{loan:pe,expired:!1}):Object(g.jsx)(k,{loan:pe})}),"loan_profile"in pe&&Object(g.jsx)(l.c,{path:[L,"guarantor"].join("/"),children:Object(g.jsx)(y,{product:null===pe||void 0===pe?void 0:pe.loan_profile,productOffer:Ee,guarantors:pe.guarantors})}),"schedules"in pe&&Object(g.jsx)(l.c,{path:[L,"repayment"].join("/"),children:Object(g.jsx)(N,{schedules:pe.schedules,loan:pe})}),Object(g.jsx)(l.b,{to:[L,"general"].join("/")})]})]})]})})}),Object(g.jsx)(f.a,{close:()=>{Y(!1),G("repay"),K(""),J("")},description:he("lender-web-app-loan-repayment"),show:H,isUpload:!1,children:Object(g.jsx)(U,{productId:pe.id,callBack:e=>{e&&ve(),G("repay"),Y(!1)},screen:W,setScreen:G,card_id:Z,mandate_id:z,bank_id:Q,setBankToUse:X,setCardToUse:K,setMandateToUse:J,repaymentAmount:Ne})}),Object(g.jsx)(f.a,{close:async()=>{"success"===xe&&ve(),V(!1)},description:he("lender-web-app-loan-application"),show:B,className:"",isUpload:!1,children:B&&Object(g.jsx)(S.a,{})}),Object(g.jsx)(f.a,{close:()=>{F(!1),"success"===xe&&oe.push("/loans")},description:he("lender-web-app-loan-application"),show:D,className:"",isUpload:!1,children:D&&Object(g.jsx)(se.a,{loan:pe,onDecline:()=>{R(!0),q(!0),F(!1)}})}),Object(g.jsx)(d.a,{id:pe.id,show:I,close:()=>{P&&F(!0),R(!1)},abandoned:le(pe),onSuccess:()=>{oe.push("/loans")}}),Object(g.jsx)(ne,{showModal:$,setShowModal:ee,loan:pe,product:Ce,updateLoans:()=>{ve(),fe()}})]})}},132:function(e,t,a){"use strict";var n=a(10),s=a(9),l=a(53),c=a(33),i=a(11),r=a(2);Object(c.b)();const o={status:"idle",bank_data:{},method:"",amount:void 0,card:null,transaction_amount:void 0},d=Object(l.create)()(((e,t)=>({...o,reset:()=>{e(o)},setIdle:async()=>{e({status:"idle"})},setSuccess:async()=>{e({status:"success"})},setCard:async t=>{e({card:t})},setMethod:async t=>{e({method:t})},setAmount:async t=>{e({amount:t})},fetchUssd:async a=>{e({status:"loading"});const{amount:l}=t();try{const t=await Object(i.a)(n.L,"get");let s;if("card"===a){var c;const a=await Object(i.a)(n.j,"get");s=null===(c=t.data)||void 0===c?void 0:c.find((e=>"card_payment"===e.slug)),e({bank_data:{cards:a.data}})}else{var o;const{data:a}=await Object(i.a)(Object(n.S)("wallet"),"post",{amount:l});s=null===(o=t.data)||void 0===o?void 0:o.find((e=>"interbank_transfer"===e.slug)),e({bank_data:{...a}})}const r=await Object(i.a)(n.L,"post",{amount:l,type_id:s.id});e({status:"success",transaction_amount:r.data.amount})}catch(b){var d;s.toast.error(null!==(d=b.message)&&void 0!==d?d:await Object(r.translate)("lender-web-app-default-error")),b.message.includes("does not exist on your profile")?e({status:"adding"}):e({status:"idle"})}},fundCard:async a=>{e({status:"loading"});const{amount:l,card:c}=t();try{const t=await Object(i.a)(n.tb,"post",{amount:l,pin:a,card_id:null===c||void 0===c?void 0:c.id});return e({status:"success"}),t}catch(d){var o;s.toast.error(null!==(o=d.message)&&void 0!==o?o:await Object(r.translate)("lender-web-app-default-error")),e({status:"idle"})}}})));t.a=d},144:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(1),s=a(260),l=a(9),c=a(2),i=a(0);function r(e){let{onFileSelect:t,status:a}=e;const{translate:r}=Object(c.useTranslation)(),[o,d]=Object(n.useState)(null),b=Object(n.useCallback)((e=>{e.length&&(d(e[0]),t(e[0],(()=>d(null))))}),[t]),{getRootProps:u,getInputProps:j}=Object(s.a)({accept:"image/jpeg, .pdf",onDrop:b,maxSize:52428800,maxFiles:1,onDropRejected:()=>{l.toast.error(r("lender-web-app-file-too-large"))}});return Object(i.jsx)("div",{className:"form-group upload-btn btn",...u(),children:o?Object(i.jsxs)("label",{className:"filelabel successUpload",children:["success"===a&&Object(i.jsx)("div",{className:"btn-wrapper",children:Object(i.jsx)("button",{className:"btn btn-link text-danger",children:r("lender-web-app-remove")})}),Object(i.jsxs)("div",{className:"file",children:[Object(i.jsxs)("div",{className:"file--wrapper",children:[Object(i.jsx)("div",{className:"file-icon",children:Object(i.jsx)("svg",{width:"32",height:"32",children:Object(i.jsx)("use",{xlinkHref:"/icon-sprite.svg#file"})})}),Object(i.jsxs)("div",{children:[Object(i.jsx)("p",{className:"name",children:o.name}),Object(i.jsxs)("p",{className:"size",children:[(o.size/1e6).toFixed(2),"MB"]})]})]}),Object(i.jsx)("div",{className:"file-status",children:"loading"===a&&Object(i.jsx)("div",{className:"spinner-border text-primary",children:Object(i.jsxs)("span",{className:"visually-hidden",children:[r("lender-web-app-loading"),"..."]})})||"success"===a&&Object(i.jsx)("svg",{width:"24",height:"24",children:Object(i.jsx)("use",{xlinkHref:"/icon-sprite.svg#done"})})})]})]}):Object(i.jsxs)(i.Fragment,{children:[Object(i.jsx)("input",{...j()}),Object(i.jsxs)("div",{className:"filelabel d-flex align-items-center justify-content-center flex-column",children:[Object(i.jsx)("svg",{width:"48",height:"48",children:Object(i.jsx)("use",{xlinkHref:"/icon-sprite.svg#image"})}),Object(i.jsxs)("div",{className:"upload-text",children:[Object(i.jsxs)("div",{className:"top",children:[Object(i.jsx)("h3",{children:r("lender-web-app-drag-file")}),Object(i.jsxs)("p",{children:[r("lender-web-app-or")," ",Object(i.jsx)("span",{className:"text-primary",children:Object(i.jsxs)("u",{children:[r("lender-web-app-browse")," "]})})," ",r("lender-web-app-to-choose")]})]}),Object(i.jsx)("div",{className:"down",children:Object(i.jsxs)("p",{children:["(",r("lender-web-app-max-50"),")"]})})]})]})]})})}},145:function(e,t,a){"use strict";var n=a(1),s=a.n(n),l=a(421),c=a.n(l),i=a(25),r=a(9),o=a(15),d=a(2),b=a(6),u=a(0);const j={width:250,height:250,facingMode:"user"},p=e=>{let{showWebCamModal:t,setShowWebCamModal:a,webcamRef:n}=e;const{translate:s}=Object(d.useTranslation)(),l=Object(o.a)((e=>e.camera_error_explainer_url));return!0===t?Object(u.jsx)(c.a,{audio:!1,height:j.height,ref:n,screenshotFormat:"image/png",width:j.width,videoConstraints:j,className:"mx-auto rounded-circle",screenshotQuality:1,onUserMediaError:()=>{a(!1);const e=Object(u.jsxs)("div",{children:[s("lender-web-app-access-camera"),Object(u.jsxs)("a",{href:l,rel:"noreferrer",target:"_blank",children:[" ",s("lender-web-app-click-here")]}),s("lender-web-app-why-camera")]});r.toast.error(e,{id:"camera-error"})}}):Object(u.jsx)("div",{children:s("lender-web-app-allow-camera")})};t.a=e=>{let{setCapturedImage:t,showWebCamModal:a,setShowWebCamModal:l,capturedImage:c,description:r,handleSave:o}=e;const m=s.a.useRef(null),h=Object(n.useCallback)((()=>{if(m.current){const e=m.current.getScreenshot();t(e)}}),[m]),{translate:O}=Object(d.useTranslation)();return Object(u.jsx)(i.a,{show:a,close:async()=>{l(!1),t(null)},description:r,isUpload:!1,children:Object(u.jsxs)("div",{className:"modal-body d-flex text-center align-items-center justify-content-center flex-column",style:{minHeight:"".concat(j.height)},children:[c?Object(u.jsx)("div",{className:"rounded-circle",style:{width:"".concat(j.width),height:"".concat(j.height)},children:Object(u.jsx)("img",{src:c,alt:"",className:"rounded-circle"})}):Object(u.jsx)(p,{showWebCamModal:a,setShowWebCamModal:l,webcamRef:m}),Object(u.jsxs)("div",{className:"d-flex gap-2",children:[Object(u.jsx)(b.a,{className:"btn btn-primary p-2 mt-2",style:{width:"fit-content",minWidth:"80px"},onClick:()=>{c?o():h()},children:O(c?"lender-web-app-upload":"lender-web-app-capture")}),c&&Object(u.jsx)("button",{className:"text-primary p-2 mt-2 bg-transparent border-0",onClick:()=>{t(null)},children:O("lender-web-app-retake")})]})]})})}},147:function(e,t,a){"use strict";a.d(t,"a",(function(){return ze}));var n=a(13),s=a(45),l=a(12),c=a(19),i=a(231),r=a(9),o=a.n(r),d=a(1),b=a.n(d),u=a(18),j=a(16),p=a(4),m=a(75),h=a(3),O=a(5),v=a(6),x=a(24),f=a.n(x),g=a(2),w=a(0);const _={OFFERS:"OFFERS",BREAKDOWN:"BREAKDOWN"};function y(e){let{setCurrentStep:t,product:a,showConfigurableForm:n}=e;const{translate:s}=Object(g.useTranslation)(),[l,i,r,o,b,u]=Object(c.a)((e=>[e.offers,e.chooseOffer,e.getLoanPaymentSchedules,e.loansRepayment,e.loansRepaymentData,e.signOfferLetterStatus]),p.shallow),[j,m]=Object(d.useState)(_.OFFERS),x=Object(d.useCallback)((async e=>{await r(e)&&(i(e),m(_.BREAKDOWN))}),[i]);return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header",children:[Object(w.jsx)("p",{className:"text-primary fs-5  fw-bold",children:j===_.BREAKDOWN?s("lender-web-app-loan-repayment-breakdown"):s("lender-web-app-loan-offers")}),Object(w.jsx)("small",{className:"text-app-gray",children:j===_.BREAKDOWN?s("lender-web-app-repayment-breakdown-schedule"):s("lender-web-app-what-eligible-for")})]}),j===_.OFFERS&&Object(w.jsx)("div",{className:"row",children:Object(w.jsx)("div",{className:"col-12",children:Object(w.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-3",children:[Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-12 col-sm-6",children:[Object(w.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-loan-amount")}),Object(w.jsx)("p",{children:Object(h.q)(l[0].loan_amount,null===a||void 0===a?void 0:a.currency)})]}),Object(w.jsxs)("div",{className:"col-12 col-sm-6 ms-auto text-sm-end mt-3 mt-md-0",children:[Object(w.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-interest")}),Object(w.jsxs)("p",{children:[l[0].interest_rate,"%"]})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-12 col-sm-6 mt-3",children:[Object(w.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-repayment-amount")}),Object(w.jsx)("p",{children:Object(h.q)(l[0].amount_due,null===a||void 0===a?void 0:a.currency)})]}),Object(w.jsxs)("div",{className:"col-12 col-sm-6 ms-auto text-sm-end mt-3",children:[Object(w.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-due-date")}),Object(w.jsx)("p",{children:f()(l[0].due_date).format("MMM DD, YYYY")})]})]})]})},l[0].loan_token)}),j===_.BREAKDOWN&&Object(w.jsxs)("div",{className:"mt-3",children:[Object(w.jsx)(N,{product:a}),Object(w.jsx)(C,{schedule:b,product:a})]})]})}),Object(w.jsxs)("div",{className:"d-flex  justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>j===_.OFFERS&&t(n?O.b.ADDITIONAL_DATA:O.b.CONFIRM)||m(_.OFFERS),style:{maxWidth:"270px"},className:"btn py-3 pl-0 btn-ghost btn-lg",children:s("lender-web-app-back")}),j===_.BREAKDOWN?Object(w.jsx)("button",{onClick:()=>{const e=null===a||void 0===a?void 0:a.attributes["repayment-methods"];null!==a&&void 0!==a&&a.attributes["upfront-fee-payment"]||null!==a&&void 0!==a&&a.attributes["upfront-interest-payment"]?t(O.b.FEE_CHARGE_WARNING):1===a.require_loan_offer&&"success"!==u?t(O.b.OFFER_LETTER):"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])?t(O.b.AUTHORIZE):!0===e["debit-card"]?t(O.b.REPAYMENT_METHOD):!0===e["remita-inflight"]||!0===e.none?t(O.b.AUTHORIZE):!0===e["direct-debit"]?t(O.b.INFO_MANDATE):!0===e["mobile-money"]?t(O.b.MOBILE_MONEY):t(O.b.CHOOSE_PAYMENT_METHOD)},className:"btn py-3 btn-primary btn-lg px-5",children:s("lender-web-app-continue")}):Object(w.jsx)(v.a,{isLoading:"loading"===o,onClick:()=>x(l[0].loan_token),className:"btn py-3 btn-primary btn-lg px-5",children:s("lender-web-app-take-offer")})]})]})}function N(e){var t,a;let{product:n}=e;const s=Object(c.a)((e=>e.selectedOffer)),{translate:l}=Object(g.useTranslation)(),i=Object(d.useMemo)((()=>{var e;const t=null===(e=n.fees)||void 0===e?void 0:e.filter((function(e){var t,a;return"penal"!==(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())&&"management"!==(null===(a=e.category)||void 0===a?void 0:a.toLowerCase())}));return t.reduce(((e,t)=>{var a,n;let l=0;switch((null===(a=t.type)||void 0===a||null===(n=a.trim())||void 0===n?void 0:n.toLowerCase())||"flat"){case"percentage":l=Object(u.t)(t,null===s||void 0===s?void 0:s.loan_amount,null===s||void 0===s?void 0:s.interest_due);break;case"hybrid":l+=Object(u.r)(t,null===s||void 0===s?void 0:s.loan_amount,null===s||void 0===s?void 0:s.interest_due);break;default:l=t.amount||0}return e+l}),0)}),[s]),r=Object(d.useMemo)((()=>{var e;const t=null===n||void 0===n||null===(e=n.fees)||void 0===e?void 0:e.filter((function(e){var t;return"management"===(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())}));return Object(u.i)(t,null===s||void 0===s?void 0:s.loan_amount,null===s||void 0===s?void 0:s.interest_due)}),[s]),o=(null===s||void 0===s?void 0:s.loan_amount)-i;return Object(w.jsx)("div",{className:"loan-form",children:Object(w.jsxs)("div",{className:"bg-light-blue rounded-3 py-4 px-3 px-md-35",children:[Object(w.jsxs)("div",{className:"d-block d-sm-none",children:[Object(w.jsx)("h6",{className:"text-app-gray",children:l("lender-web-app-loan-amount")}),Object(w.jsx)("p",{children:Object(h.q)(s.loan_amount,null===n||void 0===n?void 0:n.currency)}),Object(w.jsxs)("h6",{className:"mt-3 text-app-gray",children:["Interest(",s.interest_rate,"%)"]}),Object(w.jsx)("p",{children:Object(h.q)(s.interest_due,null===n||void 0===n?void 0:n.currency)}),Object(w.jsx)("h6",{className:"mt-3  text-app-gray",children:l("lender-web-app-origination-fee")}),Object(w.jsx)("p",{children:Object(h.q)(i,null===n||void 0===n?void 0:n.currency)}),(null===n||void 0===n||null===(t=n.attributes)||void 0===t?void 0:t["upfront-fee-payment"])&&Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("h6",{className:"mt-3  text-app-gray fw-normal f-12px",children:"Management Fee"}),Object(w.jsx)("p",{className:"f-14px primary-color",children:Object(h.q)(r,null===n||void 0===n?void 0:n.currency)})]}),Object(w.jsx)("h6",{className:"mt-3 text-app-gray",children:l("lender-web-app-disbursement-amount")}),Object(w.jsx)("p",{children:Object(h.q)(o,null===n||void 0===n?void 0:n.currency)}),Object(w.jsx)("h6",{className:"mt-3  text-app-gray",children:l("lender-web-app-repayment")}),Object(w.jsx)("p",{children:Object(h.q)(s.amount_due,null===n||void 0===n?void 0:n.currency)}),0!=n.allow_multi_tenor?Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("h6",{className:"mt-3  text-app-gray",children:l("lender-web-app-repayment-frequency")}),Object(w.jsxs)("p",{children:[" ",Object(m.capitalize)(Object(h.s)(s.tenor_period))]})]}):"",Object(w.jsx)("h6",{className:"mt-3  text-app-gray",children:l("lender-web-app-repayment-date")}),Object(w.jsx)("p",{children:Object(h.u)(new Date(s.due_date))}),Object(w.jsx)("h6",{className:"mt-3  text-app-gray",children:l("lender-web-app-loan-duration")}),Object(w.jsxs)("p",{children:[" ",s.tenor," ",s.tenor_period]})]}),Object(w.jsx)("div",{className:"d-none d-sm-block",children:Object(w.jsxs)("div",{className:"repayment-breakdown-desktop",children:[Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-loan-amount")}),Object(w.jsx)("p",{children:Object(h.q)(s.loan_amount,null===n||void 0===n?void 0:n.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsxs)("h6",{className:"fw-normal f-14px ms-auto",children:[l("lender-web-app-interest"),"(",s.interest_rate,"%)"]}),Object(w.jsx)("p",{className:" ms-auto",children:Object(h.q)(s.interest_due,null===n||void 0===n?void 0:n.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-origination-fee")}),Object(w.jsx)("p",{children:Object(h.q)(i,null===n||void 0===n?void 0:n.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-disbursement-amount")}),Object(w.jsx)("p",{className:" ms-auto",children:Object(h.q)(o,null===n||void 0===n?void 0:n.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-repayment")}),Object(w.jsx)("p",{children:Object(h.q)(s.amount_due,null===n||void 0===n?void 0:n.currency)})]}),0!=n.allow_multi_tenor?Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-repayment-frequency")}),Object(w.jsx)("p",{className:" ms-auto",children:Object(m.capitalize)(Object(h.s)(s.tenor_period))})]}):"",Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-repayment-date")}),Object(w.jsx)("p",{children:Object(h.u)(new Date(s.due_date))})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-loan-duration")}),Object(w.jsxs)("p",{className:" ms-auto",children:[s.tenor," ",s.tenor_period]})]}),(null===n||void 0===n||null===(a=n.attributes)||void 0===a?void 0:a["upfront-fee-payment"])&&Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:"Management Fee"}),Object(w.jsx)("p",{children:Object(h.q)(r,null===n||void 0===n?void 0:n.currency)})]})]})})]})})}function C(e){let{schedule:t,product:a}=e;const{translate:n}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"bg-light-blue loan-form mt-35 rounded-3 py-4  px-3 px-md-35",children:[Object(w.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(w.jsx)("thead",{children:Object(w.jsxs)("tr",{children:[Object(w.jsx)("th",{className:"date pb-0",children:n("lender-web-app-date")}),Object(w.jsx)("th",{className:"principal pb-0",children:n("lender-web-app-amount-due")}),Object(w.jsx)("th",{className:"status pb-0",children:n("lender-web-app-balance")})]})}),Object(w.jsx)("tbody",{children:null===t||void 0===t?void 0:t.schedules.map((e=>Object(w.jsxs)("tr",{children:[Object(w.jsx)("td",{className:"date fw-normal",children:Object(h.u)(e.due_date)}),Object(w.jsx)("td",{className:"amount",children:Object(h.q)(e.amount_due,null===a||void 0===a?void 0:a.currency)}),Object(w.jsx)("td",{className:"interest",children:Object(h.q)(e.balance,null===a||void 0===a?void 0:a.currency)})]},e.label)))})]}),Object(w.jsx)("div",{className:"mobileListTable d-lg-none",children:null===t||void 0===t?void 0:t.schedules.map((e=>Object(w.jsxs)("div",{className:"list",children:[Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsxs)("p",{className:"text-black-50 mb-0",children:[n("lender-web-app-date"),":"]}),Object(w.jsx)("p",{className:"date",children:e.due_date})]})}),e.amount_due&&Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsxs)("p",{className:"text-black-50 mb-0",children:[n("lender-web-app-amount-due"),":"]}),Object(w.jsx)("p",{children:Object(h.q)(null===e||void 0===e?void 0:e.amount_due,null===a||void 0===a?void 0:a.currency)})]})}),e.balance&&Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsxs)("p",{className:"text-black-50 mb-0",children:[n("lender-web-app-balane"),":"]}),Object(w.jsx)("p",{className:"interest",children:Object(h.q)(null===e||void 0===e?void 0:e.balance,null===a||void 0===a?void 0:a.currency)})]})})]},e.label)))})]})}var k=a(60),S=a(442),E=a(29);function T(e){let{setCurrentStep:t}=e;const{translate:a}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"mx-0 modal-body py-4 row",children:Object(w.jsxs)("div",{className:"col-12",children:[Object(w.jsx)("div",{className:"tab-content__header",children:Object(w.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:a("lender-web-app-need-information")})}),Object(w.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(w.jsx)("div",{className:"d-inline-block",children:Object(w.jsxs)("ul",{children:[Object(w.jsx)("li",{children:a("lender-web-app-need-access-sms")}),Object(w.jsx)("br",{}),Object(w.jsx)("li",{children:a("lender-web-app-information-calculate-eligibilty")}),Object(w.jsx)("br",{}),Object(w.jsx)("li",{children:a("lender-web-app-no-proceed-information")}),Object(w.jsx)("br",{}),Object(w.jsx)("li",{children:a("lender-web-app-data-safe-sell")})]})})})]})}),Object(w.jsx)("div",{className:"w-full d-flex justify-content-end modal-footer control",children:Object(w.jsx)(v.a,{onClick:()=>(async()=>{t(O.a.ORACULLI_DATA_CONSENT)})(),className:"px-5 btn btn-primary btn-lg",children:a("lender-web-app-continue")})})]})}function A(e){let{setCurrentStep:t,submitForm:a}=e;const{links:n,assets:s,dictionary:l}=Object(d.useContext)(E.a),{translate:c}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"mx-0 modal-body py-4 row",children:Object(w.jsxs)("div",{className:"col-12",children:[Object(w.jsx)("div",{className:"tab-content__header",children:Object(w.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:c("lender-web-app-access-eligibility")})}),Object(w.jsxs)("div",{className:"p-3 rounded-4 bg-light-blue",children:[Object(w.jsxs)("div",{children:[Object(w.jsx)("p",{children:c("lender-web-app-data-help")}),Object(w.jsx)("p",{children:c("lender-web-app-no-sell-parties")}),Object(w.jsx)("p",{children:c("lender-web-app-data-protected-strict")})]}),Object(w.jsxs)("div",{className:"mt-3",children:[Object(w.jsx)("h6",{children:c("lender-web-app-what-is-collected")}),Object(w.jsx)("p",{children:c("lender-web-app-collected-data-explained")})]}),Object(w.jsxs)("div",{className:"mt-3",children:[Object(w.jsx)("h6",{children:c("lender-web-app-data-collected-processed")}),Object(w.jsx)("p",{children:c("lender-web-app-our-credit-decision")})]}),Object(w.jsxs)("div",{className:"mt-3",children:[Object(w.jsx)("h6",{children:c("lender-web-app-why-we-collect")}),Object(w.jsx)("p",{children:c("lender-web-app-data-asses-credit")})]}),Object(w.jsxs)("div",{className:"mt-3",children:[Object(w.jsxs)("h6",{children:[c("lender-web-app-click-continue-agree"),":"]}),Object(w.jsx)("div",{className:"d-inline-block",children:Object(w.jsxs)("ul",{children:[Object(w.jsxs)("li",{children:[c("lender-web-app-page-terms",{page_title:null===l||void 0===l?void 0:l.page_title})," ",Object(w.jsx)("span",{className:"text-decoration-underline",children:null===n||void 0===n?void 0:n.terms_conditions}),c("lender-web-app-and-privacy")," ",Object(w.jsx)("span",{className:"text-decoration-underline",children:null===s||void 0===s?void 0:s.privacy_policy})]}),Object(w.jsx)("br",{}),Object(w.jsx)("li",{children:c("lender-web-app-colleciton-processing-sms")})]})})]})]})]})}),Object(w.jsxs)("div",{className:"w-full d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>t(O.a.ORACULLI_PRIVACY_POLICY),className:"pl-0 btn btn-ghost btn-lg",children:c("lender-web-app-back")}),Object(w.jsx)(v.a,{onClick:()=>(async()=>{a()})(),className:"px-5 btn btn-primary btn-lg",children:c("lender-web-app-continue")})]})]})}var L=a(15),M=a(7);function D(e){var t,a,s,c,i;let{product:r,setCurrentStep:o}=e;const b=Object(u.z)("requested_amount","proposed_tenor","proposed_tenor_period","proposed_payday","purpose"),{setFieldValue:j,values:p,errors:m}=Object(l.f)(),v=Object(k.a)((e=>e.getOptionsByKey)),x=Object(n.a)((e=>e.profile)),[f,_]=Object(L.a)(Object(d.useCallback)((e=>[e.adjutor_public_key,e.oraculi_sdk_options]),[])),[y,N]=Object(d.useState)(window.ReactNativeWebView&&null!==r&&void 0!==r&&null!==(t=r.attributes)&&void 0!==t&&null!==(a=t.data_provider)&&void 0!==a&&a.toLowerCase().includes("oraculi")?O.a.ORACULLI_PRIVACY_POLICY:O.a.AMOUNT_SELECTION),C=()=>{var e;window.ReactNativeWebView&&(null===(e=window.ReactNativeWebView)||void 0===e||e.postMessage(JSON.stringify({method:"initOraculiSDK",arguments:{bvn:null===x||void 0===x?void 0:x.hashed_bvn,key:f,oraculi_sdk_options:_||"sms"},callback:""})));N(O.a.AMOUNT_SELECTION)},E=Object(d.useMemo)((()=>Object(u.q)(r).map((e=>({value:e})))),[r]),{translate:D}=Object(g.useTranslation)();return y===O.a.ORACULLI_DATA_CONSENT?Object(w.jsx)(A,{setCurrentStep:N,submitForm:C}):y===O.a.ORACULLI_PRIVACY_POLICY?Object(w.jsx)(T,{setCurrentStep:N}):Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"fs-5 mb-1 text-primary fw-bold",children:null===r||void 0===r?void 0:r.name}),Object(w.jsx)("small",{className:"text-app-gray",children:null===r||void 0===r?void 0:r.description})]}),Object(w.jsx)(M.e,{label:D("lender-web-app-how-much-want"),onChange:e=>{j("requested_amount",e)},defaultValue:p.requested_amount,error:!!m.requested_amount,errorMessage:m.requested_amount,onFocus:e=>{"0"===e.target.value&&j("requested_amount","",!1)},info:Object(w.jsx)("small",{className:"form-text text-primary p-2 rounded-3 bg-light-blue d-block mt-2",children:D("lender-web-app-minimum-maximum",{minimum:Object(h.q)(null===r||void 0===r?void 0:r.min_amount,null===r||void 0===r?void 0:r.currency),maximum:Object(h.q)(null===r||void 0===r?void 0:r.max_amount,null===r||void 0===r?void 0:r.currency)})}),currency:null===r||void 0===r?void 0:r.currency}),Object(w.jsxs)("div",{className:"row form-flex",children:[Object(w.jsx)("div",{className:"col-sm",children:Object(w.jsx)(M.s,{name:"proposed_tenor",type:"number",label:D("lender-web-app-select-duration"),onKeyDown:e=>Object(h.b)(e),onKeyUp:e=>Object(h.t)(e)})}),Object(w.jsx)("div",{className:"col-sm",children:Object(w.jsx)(M.q,{name:"proposed_tenor_period",label:"Period",options:E,labelField:"value",valueField:"value",keyField:"value",disabled:1===E.length})})]}),Object(w.jsx)(M.i,{minDate:Object(S.a)(),label:D("lender-web-app-when-want"),className:"top",name:"proposed_payday"}),void 0==(null===r||void 0===r||null===(s=r.attributes)||void 0===s?void 0:s.additional_loan_data)&&Object(w.jsx)("div",{className:"row form-flex",children:Object(w.jsx)("div",{className:"col-sm",children:Object(w.jsx)(M.q,{name:"purpose",label:D("lender-web-app-loan-purpose"),labelField:"code_description",valueField:"code_description",keyField:"code_description",loading:!(null!==(c=v("purpose-of-loan"))&&void 0!==c&&c.length),options:null!==(i=v("purpose-of-loan"))&&void 0!==i?i:[]})})})]})}),Object(w.jsx)("div",{className:"col-12 modal-footer control ",children:Object(w.jsx)("button",{disabled:!p.proposed_payday||!b.isValid,type:"button",onClick:()=>o(O.b.BREAKDOWN),className:"btn btn-primary py-3 btn-lg px-6",children:D("lender-web-app-next")})})]})}var F=a(232),I=a(784),R=a(10),P=a(11);const q=e=>Object(P.a)(R.ib,"post",e).catch(console.error),U=(e,t)=>Object(P.a)(Object(R.Wb)(e),"put",t).catch(console.error);function B(e){var t,a,n,s;let{setCurrentStep:c,profileId:i}=e;const{values:r,setFieldValue:b,submitForm:j}=Object(l.f)(),m=Object(u.z)(...Object.keys(u.w)),[h]=Object(k.a)(Object(d.useCallback)((e=>[e.getOptionsByKey]),[]),p.shallow),[x,f]=Object(d.useState)("idle"),_=Object(d.useCallback)((async()=>{const{business_name:e,business_type:t,office_rented:a,date_of_incorporation:n,rc_number:s,tin:l,business_registered:c,...r}=m.values,d={...c&&{date_of_incorporation:n,rc_number:s,tin:l},registered:Boolean(c),office_rented:Boolean(a),name:e,type:t,...r},b=i?()=>U(i,d):()=>q(d);try{f("loading"),await b(),j(),f("success")}catch(u){f("error"),o.a.error((null===u||void 0===u?void 0:u.message)||y("lender-web-app-error-updating-profile"))}}),[m,i,j]),{translate:y}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"my-4 mx-0 modal-body loan-modal-body row",children:Object(w.jsxs)("div",{className:"pl-4 col-12 loan-form",children:[Object(w.jsxs)("div",{className:"mb-4 tab-content__header",children:[Object(w.jsx)("p",{className:"text-primary fs-5 fw-bold",children:y("lender-web-app-business-information")}),Object(w.jsx)("small",{className:"text-app-gray",children:y("lender-web-app-tell-about-business")})]}),Object(w.jsx)("div",{className:"mb-2 form-text",children:y("lender-web-app-what-business-name")}),Object(w.jsx)(M.s,{name:"business_name",label:y("lender-web-app-business-name")}),Object(w.jsx)("div",{className:"mb-2 form-text",children:y("lender-web-app-type-business")}),Object(w.jsx)(M.q,{name:"business_type",label:y("lender-web-app-business-type"),labelField:"code_description",keyField:"code_description",valueField:"code_description",loading:!(null!==(t=h("business-type"))&&void 0!==t&&t.length),options:null!==(a=h("business-type"))&&void 0!==a?a:[]}),Object(w.jsx)("div",{className:"mb-2 form-text",children:y("lender-web-app-business-industry")}),Object(w.jsx)(M.q,{name:"industry",label:y("lender-web-app-industry"),keyField:"code_description",labelField:"code_description",valueField:"code_description",loading:!(null!==(n=h("employment-sector"))&&void 0!==n&&n.length),options:null!==(s=h("employment-sector"))&&void 0!==s?s:[]}),Object(w.jsx)("div",{className:"mb-2 form-text",children:y("lender-web-app-business-registered")}),Object(w.jsxs)("div",{className:"row col-sm-10",children:[Object(w.jsx)("div",{className:"col",children:Object(w.jsx)(l.a,{as:M.g,type:"radio",name:"business_registered",checked:[!0,"true",1].includes(r.business_registered),onChange:()=>b("business_registered",!r.business_registered),value:"true",label:y("lender-web-app-yes")})}),Object(w.jsx)("div",{className:"col",children:Object(w.jsx)(l.a,{as:M.g,type:"radio",name:"business_registered",checked:[!1,"false",0].includes(r.business_registered),onChange:()=>b("business_registered",!r.business_registered),value:"false",label:y("lender-web-app-no")})})]}),Object(w.jsx)("div",{className:"mt-4"}),r.business_registered&&Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)(M.s,{inputProps:{maxLength:9},type:"text",name:"rc_number",label:y("lender-web-app-rc-bc-number")}),Object(w.jsx)(M.s,{inputProps:{maxLength:13},type:"text",name:"tin",label:"TIN"}),Object(w.jsx)("div",{className:"mb-2 form-text",children:y("lender-web-app-business-incorporated")}),Object(w.jsx)(M.i,{maxDate:Object(I.a)(),label:y("lender-web-app-date-of-incorporation"),name:"date_of_incorporation"})]}),Object(w.jsx)(M.s,{type:"tel",name:"no_of_outlets",label:y("lender-web-app-no-outlets")}),Object(w.jsx)(M.s,{type:"tel",name:"no_of_employees",label:y("lender-web-app-no-employees")}),Object(w.jsx)("div",{className:"mt-2 mb-2 form-text",children:y("lender-web-app-offices-owned")}),Object(w.jsxs)("div",{className:"row col-sm-10",children:[Object(w.jsx)("div",{className:"col",children:Object(w.jsx)(M.g,{name:"office_rented",checked:[!1,"false",0].includes(r.office_rented),onChange:()=>b("registered",!r.office_rented),value:"false",label:y("lender-web-app-owned")})}),Object(w.jsx)("div",{className:"col",children:Object(w.jsx)(M.g,{name:"office_rented",checked:[!0,"true",1].includes(r.office_rented),onChange:()=>b("registered",!r.office_rented),value:"true",label:y("lender-web-app-rented")})})]}),Object(w.jsx)("div",{className:"mt-3"}),Object(w.jsx)(M.s,{name:"address",label:y("lender-web-app-business-address")}),Object(w.jsx)(M.s,{name:"country",disabled:!0,label:y("lender-web-app-country")}),Object(w.jsx)(M.q,{name:"state",label:y("lender-web-app-state"),valueField:"code_description",labelField:"code_description",keyField:"code_description",options:h("state")||[]}),Object(w.jsx)(M.s,{name:"city",label:y("lender-web-app-city")})]})}),Object(w.jsxs)("div",{className:"gap-2 modal-footer d-flex justify-content-between control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>c(O.b.PROFESSIONAL_INFO),className:"py-3 pl-0 mt-4 btn me-3 btn-ghost btn-lg",children:y("lender-web-app-back")}),Object(w.jsx)(v.a,{isDisabled:!m.isValid,isLoading:"loading"===x,onClick:_,className:"px-5 py-3 mt-4 btn btn-primary btn-lg",children:y("lender-web-app-continue")})]})]})}var V=a(233);function H(e){let{setCurrentStep:t}=e;const[a,s]=Object(n.a)((e=>[e.documentTypes,e.documents]),p.shallow),l=Object(d.useCallback)((e=>{const t=null===s||void 0===s?void 0:s.find((t=>t.type_id===e));if(t)return[t,t.status]}),[s]),i=Object(c.a)(Object(d.useCallback)((e=>e.selectedOffer),[]),p.shallow),r=Object(d.useMemo)((()=>{var e;return null!==i&&void 0!==i&&null!==(e=i.attributes)&&void 0!==e&&e.require_guarantor?O.b.GUARANTOR:O.b.AUTHORIZE}),[i]),o=Object(d.useMemo)((()=>{const e=null===a||void 0===a?void 0:a.filter((e=>["id"].includes(e.additional_code))).map((e=>e.id)),t=s.map((e=>e.type_id));return e.every((e=>t.includes(e)))}),[a,s]),{translate:b}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12  pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-black fs-5  fw-bold",children:b("lender-web-app-add-document")}),Object(w.jsx)("small",{className:"text-black-50",children:b("lender-web-app-need-documents")})]}),Object(w.jsx)("div",{className:"card-btns ",children:a.map((e=>{const t=l(e.id);if(!t)return;const[a,n]=t;return"approved"===(null===n||void 0===n?void 0:n.toLowerCase())?null:Object(w.jsx)(V.a,{status:n,fileName:e.code_description,currentDoc:a},e.id)}))})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>t(O.b.REPAYMENT_METHOD),className:"btn py-3 me-3 pl-0 btn-ghost btn-lg",children:b("lender-web-app-back")}),Object(w.jsx)(v.a,{onClick:()=>t(r),isDisabled:!o,className:"btn py-3 btn-primary btn-lg px-5",children:b("lender-web-app-continue")})]})]})}var Y=a(21),W=a(20);function G(){const e=Object(Y.i)(),{translate:t}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row pt-4 pb-2 mx-4 loan-modal-body",children:Object(w.jsxs)("div",{className:"col-12 col-md-6 pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-black fw-bold",children:t("lender-web-app-application-pending")}),Object(w.jsx)("small",{className:"text-black-50",children:t("lender-web-app-application-submitted")})]}),Object(w.jsxs)("ul",{className:"bg-light-blue rounded-3 py-4 ps-5",children:[Object(w.jsx)("li",{children:t("lender-web-app-driver-license")}),Object(w.jsx)("li",{className:"mt-2",children:t("lender-web-app-utility-bill")}),Object(w.jsx)("li",{className:"mt-2",children:t("lender-web-app-cac")})]}),Object(w.jsx)("p",{className:"text-black-50 mt-4",children:t("lender-web-app-not-all-documents")}),Object(w.jsx)("small",{className:"text-black-50",children:t("lender-web-app-save-application")})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between control modal-footer gap-2",children:[Object(w.jsx)("button",{type:"button",onClick:()=>e.goBack(),className:"btn pl-0 btn-ghost btn-lg",children:t("lender-web-app-back")}),Object(w.jsx)(W.b,{to:j.a.loans.base,className:"btn btn-primary btn-lg px-5",children:t("lender-web-app-continue")})]})]})}function Z(e){let{setCurrentStep:t,profile:a,formikProps:n}=e;const[s,l,i]=Object(c.a)((e=>[e.getOptionsByKey,e.fetchLoanOptions,e.updateSavedLoanDetails]),p.shallow);Object(d.useEffect)((()=>{l()}),[]);const{translate:r}=Object(g.useTranslation)(),[o,b]=Object(d.useMemo)((()=>{var e;const t=!!a.gender;return[t,null===(e=[t?null:"gender","marital_status","no_of_dependent","type_of_residence","address"])||void 0===e?void 0:e.filter(Boolean)]}),[a]),j=Object(u.z)(b);return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-primary fs-5 fw-bold",children:r("lender-web-app-personal-information")}),Object(w.jsx)("small",{className:"text-app-gray",children:r("lender-web-app-details-ease-loan")})]}),Object(w.jsx)(M.s,{disabled:!0,name:"first_name",label:r("lender-web-app-first-name")}),Object(w.jsx)(M.s,{disabled:!0,name:"last_name",label:r("lender-web-app-last-name")}),Object(w.jsx)(M.q,{name:"gender",label:r("lender-web-app-gender"),disabled:o,options:s("gender"),keyField:"value"}),Object(w.jsx)(M.q,{name:"marital_status",label:r("lender-web-app-marital-status"),options:s("marital_status"),keyField:"value"}),Object(w.jsx)(M.q,{name:"no_of_dependent",label:r("lender-web-app-no-children"),options:s("no_of_dependent"),keyField:"value"}),Object(w.jsx)(M.q,{name:"type_of_residence",label:r("lender-web-app-type-residence"),options:s("type_of_residence"),keyField:"value"}),Object(w.jsx)(M.s,{name:"address",placeholder:"Place of residence",label:r("lender-web-app-place-residence")})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control ",children:[Object(w.jsx)("button",{type:"button",onClick:()=>t(O.b.BREAKDOWN),className:"btn py-3 pl-0 btn-ghost btn-lg",children:r("lender-web-app-back")}),Object(w.jsx)("button",{disabled:!j.isValid,onClick:()=>(()=>{var e,a,s,l,c;i({gender:null===(e=n.values)||void 0===e?void 0:e.gender,marital_status:null===(a=n.values)||void 0===a?void 0:a.marital_status,no_of_dependent:null===(s=n.values)||void 0===s?void 0:s.no_of_dependent,type_of_residence:null===(l=n.values)||void 0===l?void 0:l.type_of_residence,address:null===(c=n.values)||void 0===c?void 0:c.address}),t(O.b.PROFESSIONAL_INFO)})(),className:"btn py-3 btn-primary btn-lg px-5",children:r("lender-web-app-continue")})]})]})}var K=a(118),z=a(59);const J=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://lendsqr.com";switch(null===e||void 0===e?void 0:e.code){case 1:return'\n        <div>\n          We need access to your location to compute your loan eligibility. <a href="'.concat(t,'" rel="noreferrer" target="_blank"> Click here</a> to know more about how why we need access to your location and how to fix this error.\n        </div>\n      ');case 2:return"We could not determine your location to process your loan.";case 3:return"We could not determine your location to process your loan. Service timeout.";case 4:return"An error occurred on the application. Kindly reload your browser. Should the issue persist, please contact support";default:return e.message}},Q=e=>Object(K.a)(["proposed_payday","proposed_tenor","proposed_tenor_period","requested_amount","gender","marital_status","no_of_dependent","type_of_residence","educational_attainment","employment_status","employment_category","sector_of_employment","monthly_net_income","current_employer","purpose","work_email","address","work_start_date","longitude","latitude","product_id"],e);function X(e){let{formikProps:t,personalLoanDetails:a,setCurrentStep:n,isBusinessLoan:s,product:i,setWhitelisted:r,showConfigurableForm:o,setStaticFormValues:b}=e;const{values:j}=Object(l.f)(),m=Object(z.a)(),[x,f,_,y,N,C]=Object(c.a)((e=>[e.getOptionsByKey,"loading"===e.offersRequestStatus,e.setOfferLoading,e.setErrorMessage,e.setCurrentPage,e.updateSavedLoanDetails]),p.shallow),[k]=Object(L.a)(Object(d.useCallback)((e=>[e.location_error_explainer_url]),[])),{translate:E}=Object(g.useTranslation)();Object(d.useEffect)((()=>{var e;"unemployed"==t.values.employment_status.toLowerCase()?(t.setFieldValue("sector_of_employment"," "),t.setFieldValue("employment_category"," "),t.setFieldValue("monthly_net_income"," "),t.setFieldValue("current_employer"," "),t.setFieldValue("work_start_date",new Date(Date.now()-905e6)),t.setFieldValue("work_email",null),null===(e=document.getElementById("blurButton"))||void 0===e||e.blur()):(t.setFieldValue("sector_of_employment",(null===a||void 0===a?void 0:a.sector_of_employment)||""),t.setFieldValue("employment_category",(null===a||void 0===a?void 0:a.employment_category)||""),t.setFieldValue("monthly_net_income",(null===a||void 0===a?void 0:a.monthly_net_income)||""),t.setFieldValue("current_employer",(null===a||void 0===a?void 0:a.current_employer)||""),t.setFieldValue("work_start_date",(null===a||void 0===a?void 0:a.work_start_date)||""),t.setFieldValue("work_email",null===a||void 0===a?void 0:a.work_email))}),[t.values.employment_status]);const T=Object(u.z)("educational_attainment","employment_status","sector_of_employment","employment_category","monthly_net_income","current_employer","work_start_date","work_email"),A=Object(d.useCallback)((()=>{const e=i.attributes["repayment-methods"];"after-loan-request"===(null===i||void 0===i?void 0:i.attributes["request-payment-method"])?n(O.b.CONFIRM):!0===e.none?n(O.b.AUTHORIZE):!0===e["debit-card"]?n(O.b.REPAYMENT_METHOD):!0===e["direct-debit"]?n(O.b.INFO_MANDATE):n(O.b.CHOOSE_PAYMENT_METHOD)}),[]);return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-primary  fs-5 fw-bold",children:E("lender-web-app-education-employment")}),Object(w.jsx)("small",{className:"text-app-gray",children:E("lender-web-app-professional-information")})]}),Object(w.jsx)(M.q,{name:"educational_attainment",label:E("lender-web-app-highest-education"),options:x("education_attainment"),keyField:"value"}),Object(w.jsx)(M.q,{name:"employment_status",label:E("lender-web-app-employment-status"),options:x("employment_status"),keyField:"value"}),"unemployed"==t.values.employment_status.toLowerCase()?null:Object(w.jsxs)(w.Fragment,{children:[" ",Object(w.jsx)(M.q,{name:"sector_of_employment",label:E("lender-web-app-work-sector"),options:x("sector_of_employment"),keyField:"value"}),Object(w.jsx)(M.q,{name:"employment_category",label:E("lender-web-app-employment-category"),options:x("employment_category"),keyField:"value"}),Object(w.jsx)(M.q,{name:"monthly_net_income",label:"".concat(E("lender-web-app-range-monthly-salary")," (").concat(Object(h.k)(null===i||void 0===i?void 0:i.currency),")"),options:x("monthly_net_income"),keyField:"value"}),Object(w.jsx)(M.s,{name:"current_employer",label:E("lender-web-app-current-employer"),placeholder:E("lender-web-app-current-employer-short")}),Object(w.jsx)(M.i,{maxDate:Object(S.a)(),label:E("lender-web-app-work-start"),name:"work_start_date"}),Object(w.jsx)(M.s,{name:"work_email",label:E("lender-web-app-work-email"),placeholder:E("lender-web-app-work-email-short")})]}),"unemployed"==t.values.employment_status.toLowerCase()?null:Object(w.jsxs)("div",{className:"rounded-3 text-small p-3 bg-light-blue text-black row",role:"alert",children:[Object(w.jsx)("div",{className:"col-1 p-0",children:Object(w.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(w.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 0C3.808 0 0 3.808 0 8.5C0 13.192 3.808 17 8.5 17C13.192 17 17 13.192 17 8.5C17 3.808 13.192 0 8.5 0ZM9.34998 12.7499H7.64998V11.0499H9.34998V12.7499ZM7.64998 9.35H9.34998V4.25H7.64998V9.35Z",fill:"#41A1CE"})})}),Object(w.jsxs)("div",{className:"col-10",children:[E("lender-web-app-ensure-email-accessible")," "]})]})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{id:"blurButton",type:"button",onClick:()=>n(O.b.PERSONAL_INFO),className:"btn py-3 pl-0 btn-ghost btn-lg",children:E("lender-web-app-back")}),Object(w.jsx)(v.a,{isDisabled:!T.isValid,type:"button",onClick:async()=>{var e,a,l,c,d,p,h,v;C({educational_attainment:null===(e=t.values)||void 0===e?void 0:e.educational_attainment,employment_status:null===(a=t.values)||void 0===a?void 0:a.employment_status,sector_of_employment:null===(l=t.values)||void 0===l?void 0:l.sector_of_employment,employment_category:null===(c=t.values)||void 0===c?void 0:c.employment_category,monthly_net_income:null===(d=t.values)||void 0===d?void 0:d.monthly_net_income,current_employer:null===(p=t.values)||void 0===p?void 0:p.current_employer,work_start_date:null===(h=t.values)||void 0===h?void 0:h.work_start_date,work_email:null===(v=t.values)||void 0===v?void 0:v.work_email});try{if(s)n(O.b.BUSINESS_INFO);else{_("loading");let e={longitude:0,latitude:0};null!==i&&void 0!==i&&i.attributes["require-location"]&&(e=await Object(u.m)());const t=Q(j),{data:{ok:a,whitelisted:s}}=await Object(P.a)(R.mb,"post",{...t,product_id:m.get("id"),longitude:e.longitude,latitude:e.latitude});if(r(!!s),a&&s)_("success"),o?(b(j),N(0),n(O.b.ADDITIONAL_DATA)):A();else if(a)_("success"),(e=>{const t=null===i||void 0===i?void 0:i.attributes.minimum_amount_before_statement;o?(b(j),N(0),n(O.b.ADDITIONAL_DATA)):+e>=+t&&null!==i&&void 0!==i&&i.attributes.data_provider.includes("mono")?n(O.b.MONO):A()})(j.requested_amount);else{if(o)return b(j),N(0),_("success"),void n(O.b.ADDITIONAL_DATA);await Object(P.a)(R.yb,"post",{...t,product_id:m.get("id"),longitude:e.longitude,latitude:e.latitude}),_("success"),n(O.b.NOT_ELIGIBLE)}}}catch(x){n(O.b.NOT_ELIGIBLE),_("error"),y(J(x,k))}},className:"btn py-3 btn-primary btn-lg px-5",isLoading:f,children:E("lender-web-app-continue")})]})]})}var $=a(25),ee=(a(173),a(144)),te=a(104);const ae=e=>+e?parseFloat(e).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"):"0.00",ne=(e,t)=>"years"===e?t/360:"months"===e?t/30:"weeks"===e?t/7:t;function se(e){let{setCurrentStep:t,product:a,setStaticFormValues:s}=e;const{translate:i}=Object(g.useTranslation)(),{values:r}=Object(l.f)(),[o,b]=Object(d.useState)([]),[j,m,x]=Object(c.a)((e=>[e.setLoanInterest,e.getLoanRepaymentBreakdown,e.loanBreakdownStatus]),p.shallow);console.log(((e,t,a,n,s,l,c)=>{const i=[];if(e.allow_multi_tenor)for(let r=0;r<n;r++){const e=r+1,t=a-Number(s)*e;r===n-1&&0!=t?i.push({due_date:f()(l,"YYYY/MM/DD").add(e*c,"days").format("YYYY/MM/DD"),amount_due:ae(Number(s)+t),balance:ae(0)}):i.push({due_date:f()(l,"YYYY/MM/DD").add(e*c,"days").format("YYYY/MM/DD"),amount_due:ae(s),balance:ae(t.toFixed(2))})}else i.push({due_date:f()(t,"Do MMM, yyyy").format("YYYY/MM/DD"),amount_due:ae(a),balance:ae(0)});return i}));const _=Object(d.useMemo)((()=>{var e,t,n,s;const l=+r.requested_amount,c=+r.proposed_tenor,i=r.proposed_payday,d=null===u.h||void 0===u.h?void 0:u.h.find((e=>e.value===r.proposed_tenor_period)),p=a,h=a,O=Number(l),v=null===d||void 0===d?void 0:d.value,x=c*Object(u.l)(v),g=null!==(e=null===h||void 0===h?void 0:h.interest_rate)&&void 0!==e?e:0;let w=null!==(t=null===h||void 0===h?void 0:h.interest_period)&&void 0!==t?t:"days";w=w.endsWith("s")?w:"".concat(w,"s"),w=w.toLowerCase();const _=f()(i,"YYYY/MM/DD").add(x,"days").format("Do MMM, yyyy"),y=ne(w,g)/100*O;let N="flat"===(null===h||void 0===h?void 0:h.interest_period)?g/100*O:y*x;p.min_interest_amount&&!Number.isNaN(p.min_interest_amount)&&p.min_interest_amount>N&&(N=p.min_interest_amount);const C=null===(n=p.fees)||void 0===n?void 0:n.filter((function(e){var t,a;return"penal"!==(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())&&"management"!==(null===(a=e.category)||void 0===a?void 0:a.toLowerCase())})),k=null===a||void 0===a||null===(s=a.fees)||void 0===s?void 0:s.filter((function(e){var t;return"management"===(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())})),S=C.reduce(((e,t)=>{var a,n;let s=0;switch((null===(a=t.type)||void 0===a||null===(n=a.trim())||void 0===n?void 0:n.toLowerCase())||"flat"){case"percentage":s=Object(u.t)(t,O,N);break;case"hybrid":s+=Object(u.r)(t,O,N);break;default:s=t.amount||0}return e+s}),0),E=Object(u.i)(k,O,g);0===o.length&&m({product_id:a.id,principal:O,tenor:c,tenor_period:null!==v&&void 0!==v?v:"days",start_date:i}).then((e=>{b(e.schedules)}));const T={loan_amount:ae(O),interest_rate:g,interest_period:w,interest_value:ae(Object(u.j)(o)),origination_fee:ae(S),disbursed_amount:ae(O-S),repayment_amount:ae(Object(u.k)(o)),management_fee:ae(E),repayment_frequency:null===d||void 0===d?void 0:d.frequency,repayment_date:_,loan_duration:"".concat(c," ").concat(null===d||void 0===d?void 0:d.label),purpose:r.purpose};return j(N),T}),[r,a,o]),[y,N]=Object(d.useState)("default"),[C,k]=Object(d.useState)(!1),[S,E]=Object(d.useState)({instructionHeader:i("lender-web-app-upload-your-id"),instructionDescription:i("lender-web-app-add-id"),doc:null}),[T,A]=Object(d.useState)((new Date).getTime()),[L,M,D]=Object(n.a)((e=>[e.documentTypes,e.documents,e.fetchDocs]),p.shallow);Object(d.useEffect)((()=>{D()}),[T]);const[F,I,R]=Object(n.a)((e=>[e.docUploadStatus,e.uploadUserDoc,e.updateUserDoc]),p.shallow),P=Object(d.useCallback)((async(e,t)=>{var a;const n=null===M||void 0===M?void 0:M.find((e=>{var t;return e.type_id===(null===S||void 0===S||null===(t=S.doc)||void 0===t?void 0:t.id)})),s=n?R:I;await s(e,null===S||void 0===S||null===(a=S.doc)||void 0===a?void 0:a.id,null===n||void 0===n?void 0:n.id,(()=>{k(!1),A((new Date).getTime())})),"function"===typeof t&&t()}),[I,R,S]);return"loading"===x?Object(w.jsx)(te.a,{}):Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-primary fs-5 mb-1 fw-bold",children:i("lender-web-app-repayment-breakdown")}),Object(w.jsx)("small",{className:"text-app-gray",children:i("lender-web-app-breakdown-repayment-schedule")})]}),Object(w.jsx)(ce,{breakdown:_,product:a}),Object(w.jsx)("div",{className:"mt-4"}),Object(w.jsx)(le,{schedule:o,currency:a.currency})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>t(O.b.AMOUNT_SELECTION),className:"btn py-3 pl-0 btn-ghost btn-lg",children:i("lender-web-app-back")}),Object(w.jsx)("button",{type:"button",onClick:()=>{const e=L.map((e=>a.documents.includes(e.id)||e.required?{...e,userData:null===M||void 0===M?void 0:M.find((t=>t.type_id===e.id))}:null)).filter(Boolean),n=null===e||void 0===e?void 0:e.find((e=>{var t;return 1===Number(null===e||void 0===e?void 0:e.id)||"identification documents"===(null===e||void 0===e||null===(t=e.description)||void 0===t?void 0:t.toLowerCase())})),l=Object(u.o)(a,e);!n||n.userData&&"rejected"!==n.userData.status.toLowerCase()?l.missing?(k(!0),N("default"),E({...S,instructionHeader:l.header,instructionDescription:l.description,doc:l.doc})):Object(h.o)(a)?(s(r),t(O.b.ADDITIONAL_DATA)):t(O.b.PERSONAL_INFO):(k(!0),N("default"),E({...S,doc:n}))},className:"btn py-3 btn-primary btn-lg px-5",children:i("lender-web-app-continue")})]}),Object(w.jsxs)($.a,{show:C,close:()=>k(!1),description:S.instructionHeader,isUpload:!1,children:["default"===y?Object(w.jsxs)("div",{className:"modal-body py-5 d-flex text-center align-items-center flex-column",children:[Object(w.jsx)("img",{className:"mb-4",width:"60px",src:"/svgs/id.svg",alt:""}),Object(w.jsx)("h6",{children:S.instructionHeader}),Object(w.jsx)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-app-gray",children:S.instructionDescription})]}):Object(w.jsx)("div",{className:"modal-body",children:Object(w.jsxs)("div",{className:"modal-form",children:[Object(w.jsx)(ee.a,{onFileSelect:P,status:F}),Object(w.jsx)("div",{className:"tips",children:Object(w.jsxs)("p",{children:["**",i("lender-web-app-pdf-jpeg")]})})]})}),"default"===y&&Object(w.jsx)("div",{className:"modal-footer",children:Object(w.jsx)(v.a,{onClick:()=>N("upload"),type:"submit",className:"btn btn-primary",children:i("lender-web-app-continue")})})]})]})}function le(e){let{schedule:t,currency:a}=e;const{translate:n}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"bg-light-blue rounded-3 py-4  px-3 px-md-35",children:[Object(w.jsxs)("table",{className:"table d-none d-md-table",children:[Object(w.jsx)("thead",{children:Object(w.jsxs)("tr",{children:[Object(w.jsx)("th",{className:"date pb-0",children:n("lender-web-app-date")}),Object(w.jsx)("th",{className:"principal pb-0",children:n("lender-web-app-amount-due")}),Object(w.jsx)("th",{className:"status pb-0",children:n("lender-web-app-balance")})]})}),Object(w.jsx)("tbody",{children:t.map((e=>Object(w.jsxs)("tr",{children:[Object(w.jsx)("td",{className:"date fw-normal",children:f()(e.due_date,"YYYY-MM-DD").format("MMM DD, yyyy")}),Object(w.jsx)("td",{className:"amount ",children:Object(h.q)(Object(h.d)(e.amount_due),a)}),Object(w.jsx)("td",{className:"interest",children:Object(h.q)(Object(h.d)(e.balance),a)})]},e.due_date)))})]}),Object(w.jsx)("div",{className:"mobileListTable d-md-none",children:t.map((e=>Object(w.jsxs)("div",{className:"list",children:[Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-date")}),Object(w.jsx)("p",{className:"date",children:e.due_date})]})}),Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-amount-due")}),Object(w.jsx)("p",{children:Object(h.q)(+e.amount_due,a)})]})}),Object(w.jsx)("div",{className:"row listData",children:Object(w.jsxs)("div",{className:"col",children:[Object(w.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-balance")}),Object(w.jsx)("p",{className:"interest",children:Object(h.q)(+e.balance,a)})]})})]},e.due_date)))})]})}function ce(e){var t,a;let{breakdown:n,product:s}=e;const{translate:l}=Object(g.useTranslation)();return Object(w.jsxs)("div",{className:"bg-light-blue rounded-3 py-4 px-3 px-md-35",children:[Object(w.jsxs)("div",{className:"d-block d-md-none",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px text-app-gray",children:l("lender-web-app-loan-amount")}),Object(w.jsx)("p",{children:Object(h.q)(n.loan_amount,null===s||void 0===s?void 0:s.currency)}),Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-interest-payable")}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(n.interest_value),null===s||void 0===s?void 0:s.currency)}),Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-origination-fee")}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(n.origination_fee),null===s||void 0===s?void 0:s.currency)}),(null===s||void 0===s||null===(t=s.attributes)||void 0===t?void 0:t["upfront-fee-payment"])&&Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:"Management Fee"}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(null===n||void 0===n?void 0:n.management_fee),null===s||void 0===s?void 0:s.currency)})]}),Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-disbursement-amount")}),Object(w.jsx)("p",{children:Object(h.q)(n.disbursed_amount,null===s||void 0===s?void 0:s.currency)}),Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-repayment")}),Object(w.jsx)("p",{children:Object(h.q)(n.repayment_amount,null===s||void 0===s?void 0:s.currency)}),0!=s.allow_multi_tenor?Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-repayment-frequency")}),Object(w.jsx)("p",{children:Object(m.capitalize)(n.repayment_frequency)})]}):"",Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-repayment-frequency")}),Object(w.jsx)("p",{children:n.repayment_date}),Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-loan-duration")}),Object(w.jsx)("p",{children:n.loan_duration}),void 0==(null===s||void 0===s?void 0:s.attributes.additional_loan_data)&&Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:l("lender-web-app-loan-purpose")}),Object(w.jsx)("p",{children:n.purpose})]})]}),Object(w.jsx)("div",{className:"d-none d-md-block",children:Object(w.jsxs)("div",{className:"repayment-breakdown-desktop",children:[Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-loan-amount")}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(n.loan_amount),null===s||void 0===s?void 0:s.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-interest-payable")}),Object(w.jsx)("p",{className:" ms-auto",children:Object(h.q)(Object(h.d)(n.interest_value),null===s||void 0===s?void 0:s.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-origination-fee")}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(n.origination_fee),null===s||void 0===s?void 0:s.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-disbursement-amount")}),Object(w.jsx)("p",{className:" ms-auto",children:Object(h.q)(Object(h.d)(n.disbursed_amount),null===s||void 0===s?void 0:s.currency)})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-repayment")}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(n.repayment_amount),null===s||void 0===s?void 0:s.currency)})]}),0!=s.allow_multi_tenor?Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-repayment-frequency")}),Object(w.jsx)("p",{className:" ms-auto",children:Object(m.capitalize)(n.repayment_frequency)})]}):"",Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:l("lender-web-app-repayment-date")}),Object(w.jsx)("p",{children:n.repayment_date})]}),Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-loan-duration")}),Object(w.jsx)("p",{className:" ms-auto",children:n.loan_duration})]}),(null===s||void 0===s||null===(a=s.attributes)||void 0===a?void 0:a["upfront-fee-payment"])&&Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px",children:"Management Fee"}),Object(w.jsx)("p",{children:Object(h.q)(Object(h.d)(null===n||void 0===n?void 0:n.management_fee),null===s||void 0===s?void 0:s.currency)})]}),void 0==(null===s||void 0===s?void 0:s.attributes.additional_loan_data)&&Object(w.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(w.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:l("lender-web-app-loan-purpose")}),Object(w.jsx)("p",{className:" ms-auto",children:n.purpose})]})]})})]})}var ie=a(234),re=a(8),oe=a(767),de=a(165),be=a(67),ue=a(236),je=a(237);function pe(e){let{showLoanChargePrompt:t,close:a,setCurrentStep:n,amount:s}=e;const{translate:l}=Object(g.useTranslation)();return Object(w.jsxs)($.a,{show:t,close:a,description:l("lender-web-app-loan-processing-payment"),isUpload:!1,className:"small-modal",children:[Object(w.jsxs)("div",{className:"modal-body py-5 mt-4 d-flex text-center align-items-center flex-column",children:[Object(w.jsx)("img",{width:"60px",className:"mb-3",src:"/svgs/home.svg",alt:""}),Object(w.jsxs)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-black-50",children:["".concat(l("lender-web-app-processing-charge",{amount:s})," \n"),l("lender-web-app-determine-eligibilty")]})]}),Object(w.jsxs)("div",{className:"modal-footer justify-content-between align-items-center",children:[Object(w.jsx)(v.a,{type:"button",onClick:a,className:"btn text-primary ",children:l("lender-web-app-back")}),Object(w.jsx)(v.a,{isLoading:!1,onClick:()=>{n(O.b.SHOW_CARDS),a()},className:"btn btn-primary",children:l("lender-web-app-pay-money",{money:Object(h.q)(s)})})]})]},t)}function me(e){var t;let{setCurrentStep:a,product:n,whitelisted:s}=e;const[i,r]=Object(d.useState)(!1),{submitForm:o,values:b}=Object(l.f)(),[u]=Object(c.a)(Object(d.useCallback)((e=>["loading"===e.offersRequestStatus]),[]),p.shallow),{translate:j}=Object(g.useTranslation)();return Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)(pe,{showLoanChargePrompt:i,setCurrentStep:a,amount:null===n||void 0===n||null===(t=n.charge_settings)||void 0===t?void 0:t.amount_to_charge,close:()=>r(!1)}),Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-1",children:[Object(w.jsx)("p",{className:"text-primary fs-5 fw-bold",children:j("lender-web-app-account-information")}),Object(w.jsx)("p",{className:"text-app-gray",children:j("lender-web-app-confirm-information")})]}),Object(w.jsxs)("div",{className:"loan-section",children:[Object(w.jsx)("div",{className:"row align-flex-start",children:Object(w.jsx)(v.a,{onClick:()=>a(O.b.PERSONAL_INFO),style:{maxWidth:"100px"},className:"d-flex btn-nofill pe-0",children:j("lender-web-app-edit-information")})}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-first-name")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.first_name||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-last-name")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.last_name||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-gender")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.gender||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-marital-status")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.marital_status||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-no-of-children")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.no_of_dependent||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-type-residence")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.type_of_residence||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-address")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.address||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-level-education")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.educational_attainment||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group ",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-employment-status")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.employment_status||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-sector-employment")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.sector_of_employment||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"".concat(j("lender-web-app-monthly-income")," (").concat(Object(h.k)(null===n||void 0===n?void 0:n.currency),")")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.monthly_net_income||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:j("lender-web-app-employer")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:b.current_employer||"-"})]})]})]})]})}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>a(O.b.BREAKDOWN),className:"btn py-3 pl-0 btn-ghost btn-lg",children:j("lender-web-app-back")}),Object(w.jsx)(v.a,{type:"button",onClick:()=>{const e=n.require_loan_charge;s||!e?o():r(!0)},className:"btn py-3 btn-primary btn-lg px-5",isLoading:u,children:j("lender-web-app-continue")})]})]})]})}var he=a(238),Oe=a(240),ve=a(176),xe=a(241),fe=a(242),ge=a(243),we=a(244),_e=a(245),ye=a(246),Ne=a(247),Ce=a(259),ke=function(e){var t;let{section:a,props:n}=e;return Object(w.jsx)("div",{className:"mt-2",children:null===a||void 0===a||null===(t=a.fields)||void 0===t?void 0:t.map((e=>Object(w.jsx)(Ce.a,{field:e,props:n},e.id)))})};const Se="continue",Ee="submit",Te=e=>{var t;let{action:a,onContinue:n,isDisabled:s,onPrevious:l}=e;const{translate:c}=Object(g.useTranslation)();switch(null===(t=a.type)||void 0===t?void 0:t.toLowerCase()){case Se:case Ee:return Object(w.jsx)(v.a,{isDisabled:s,type:"button",onClick:n,className:"btn py-3 btn-primary btn-lg px-5",children:a.label});default:return Object(w.jsx)("button",{type:"button",onClick:l,className:"btn py-3 pl-0 btn-ghost btn-lg",children:c("lender-web-app-back")})}};var Ae=function(e){let{action:t,page:a,onContinue:n,onPrevious:s}=e;const c=Object(l.f)(),[i,r]=Object(d.useState)(!1);return Object(d.useEffect)((()=>{var e;const{values:t}=c;if(console.log(t,"===============prop values"),void 0!=(null===t||void 0===t?void 0:t.remita_inflight))return void(null!==t&&void 0!==t&&t.clf_api_error||void 0==(null===t||void 0===t?void 0:t.clf_api_error)?r(!1):r(!0));const n=[];null===a||void 0===a||null===(e=a.sections)||void 0===e||e.forEach((e=>{var t;null===e||void 0===e||null===(t=e.fields)||void 0===t||t.forEach((e=>{n.push(e.id)}))}));const s=null===n||void 0===n?void 0:n.find((e=>!!c.getFieldMeta(e).error));r(!s)}),[a,c]),Object(w.jsx)(Te,{isDisabled:!i,action:t,onPrevious:s,onContinue:n})};const Le={FORM:"FORM",MONO:"MONO",CONFIRM_FORM:"CONFRIM_FORM"};var Me=a(181),De=function(e){var t;let{docsUploaded:a,setCurrentStep:n,setCurrentPage:s,setCurrentConfigFormScreen:c,staticFormValues:i,product:r,onSubmit:o,isSubmitting:b,loanProduct:u,isRemita:j}=e;const[p,m]=Object(d.useState)(!1),{values:x}=Object(l.f)(),f=()=>{s(0),c(Le.FORM)},_=a.reduce(((e,t)=>{var a;return{...e,[t.id]:null===(a=t.data)||void 0===a?void 0:a.name}}),{}),[y,N]=Object(d.useState)([]),{translate:C}=Object(g.useTranslation)();return Object(d.useEffect)((()=>{const e=[];u&&(null===u||void 0===u||u.pages.forEach((t=>{var a;null===t||void 0===t||null===(a=t.sections)||void 0===a||a.forEach((t=>{var a;null===t||void 0===t||null===(a=t.fields)||void 0===a||a.forEach((t=>{"label"!==t.type&&e.push(t)}))}))})),N(e)),console.log(e,"temp=====================product")}),[u]),Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)(pe,{showLoanChargePrompt:p,setCurrentStep:n,amount:null===r||void 0===r||null===(t=r.charge_settings)||void 0===t?void 0:t.amount_to_charge,close:()=>m(!1)}),Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsxs)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:[Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-1",children:[Object(w.jsx)("p",{className:"text-primary fs-5 fw-bold",children:C("lender-web-app-account-information")}),Object(w.jsx)("p",{className:"text-app-gray",children:C("lender-web-app-confirm-information")})]}),!Object(h.o)(r)&&Object(w.jsxs)("div",{className:"loan-section",children:[Object(w.jsx)("div",{className:"row align-flex-start",children:Object(w.jsx)(v.a,{onClick:()=>n(O.b.PERSONAL_INFO),style:{maxWidth:"100px"},className:"d-flex btn-nofill pe-0",children:C("lender-web-app-edit-information")})}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-first-name")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.first_name)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsxs)("p",{className:"info--title",children:[C("lender-web-app-last-name")," "]}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.last_name)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-gender")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.gender)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-marital-status")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.marital_status)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-no-of-children")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.no_of_dependent)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-type-residence")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.type_of_residence)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-address")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.address)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-level-education")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.educational_attainment)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group ",children:[Object(w.jsx)("p",{className:"info--title",children:C("employment-status")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.employment_status)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-sector-employment")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.sector_of_employment)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-monthly-income")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.monthly_net_income)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:C("lender-web-app-employer")}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===i||void 0===i?void 0:i.current_employer)||"-"})]})]})]})]}),void 0!=(null===x||void 0===x?void 0:x.remita_inflight)&&Object(w.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(w.jsxs)("div",{className:"loan-section",children:[Object(w.jsx)("div",{className:"row align-flex-start",children:Object(w.jsx)(v.a,{onClick:f,style:{maxWidth:"100px"},className:"d-flex btn-nofill pe-0",children:C("lender-web-app-edit-information")})}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"Account Number"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.account_number)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:"Authorization Code"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.authorization_code)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"Bank Code"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.bank_code)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:"Company Name"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.company_name)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"Customer ID"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.customer_id)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:"Customer Name"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.customer_name)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"First Payment Date"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.first_payment_date)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:"Last Disbursement Date"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.last_disbursement_date)||"-"})]})]}),Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group ",children:[Object(w.jsx)("p",{className:"info--title",children:"Loan History"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.loan_history)||"-"})]}),Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:"Outstanding Loan Amount"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.outstanding_loan_amount)||"-"})]})]}),Object(w.jsx)("div",{className:"row",children:Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:"Salary Amount"}),Object(w.jsx)("p",{className:"info--value fw-bold",children:(null===x||void 0===x?void 0:x.salary_amount)||"-"})]})})]})}),!j&&Object(w.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(w.jsxs)("div",{className:"loan-section",children:[Object(w.jsx)("div",{className:"row align-flex-start",children:Object(w.jsx)(v.a,{onClick:f,style:{maxWidth:"100px"},className:"d-flex btn-nofill pe-0",children:C("lender-web-app-edit-information")})}),(null===y||void 0===y?void 0:y.length)&&y.reduce(((e,t,a)=>{if(a%2===0)return[...e,[t]];const n=e.pop();return[...e,[...n,t]]}),[]).map((e=>{var t;return Object(w.jsxs)("div",{className:"row",children:[Object(w.jsxs)("div",{className:"col-6 info-group",children:[Object(w.jsx)("p",{className:"info--title",children:e[0].name}),Object(w.jsx)("p",{className:"info--value fw-bold",children:Fe(e[0],_,x)})]}),e[1]&&Object(w.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(w.jsx)("p",{className:"info--title",children:null===(t=e[1])||void 0===t?void 0:t.name}),Object(w.jsx)("p",{className:"info--value fw-bold",children:Ie(e[1],_,x)})]})]},e.id)}))]})})]}),Object(w.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>{c(Le.FORM)},className:"btn py-3 pl-0 btn-ghost btn-lg",children:C("lender-web-app-back")}),Object(w.jsx)(v.a,{type:"button",onClick:o,className:"btn py-3 btn-primary btn-lg px-5",isLoading:b,children:C("lender-web-app-submit")})]})]})]})};const Fe=(e,t,a)=>{var n;return["upload","file","image","video","audio"].includes(e.type)?(null===(n=t[e.id])||void 0===n?void 0:n.length)>0?t[e.id]:"-":["checkbox"].includes(e.type)&&a[e.id].length>0?e.options.filter((t=>a[e.id].includes(t.value))).map((e=>e.label)).join(", "):Object(Me.b)(a[e.id])||"-"},Ie=(e,t,a)=>{var n;const s=null!==(n=e[1])&&void 0!==n?n:e;return console.log(s,"==================this is values"),["upload","file","image","video","audio"].includes(null===s||void 0===s?void 0:s.type)?null!==s&&void 0!==s&&s.id?t[s.id]:"-":["checkbox"].includes(null===s||void 0===s?void 0:s.type)?(null===(l=a[null===s||void 0===s?void 0:s.id])||void 0===l?void 0:l.join(", "))||"-":Object(Me.b)(a[null===s||void 0===s?void 0:s.id])||"-";var l};var Re=a(781);var Pe=e=>{let{text:t}=e;const a=t.split("\n").map((e=>{var t;const a=/(?:^|\s)((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/gi,n=null===(t=e.match(a))||void 0===t?void 0:t.map((e=>e.trim()));if(n){const t=e.split(a).filter((e=>e)).filter((e=>!e.startsWith("."))).map((e=>n.includes(e)?Object(w.jsxs)("a",{href:"https://".concat(e),target:"_blank",rel:"noreferrer",children:[" ",e," "]},Object(Re.a)()):Object(w.jsx)(b.a.Fragment,{children:e},Object(Re.a)())));return Object(w.jsx)("p",{children:t},Object(Re.a)())}return Object(w.jsx)("p",{children:e},Object(Re.a)())}));return Object(w.jsx)("div",{children:a})},qe=a(264);function Ue(e){var t;let{setCurrentStep:a,product:s,query:i,staticFormValues:r}=e;const[b,j]=Object(L.a)((e=>[e.location_error_explainer_url,e.language])),[m,v]=Object(d.useState)(Le.FORM),[x,f,g,_,y,N,C,k,S]=Object(c.a)((e=>[e.getLoanOffers,"loading"===e.offersRequestStatus,e.setErrorMessage,e.addPageData,e.additionalPagesData,e.currentPage,e.setCurrentPage,e.isRemita,e.setIsRemita]),p.shallow),E=Object(n.a)((e=>e.additionalDocuments),p.shallow),T=null===s||void 0===s||null===(t=s.attributes)||void 0===t?void 0:t.additional_loan_data,[A,M]=Object(d.useState)(null),[D,F]=Object(d.useState)(),I=Object(d.useRef)(!1);Object(d.useEffect)((()=>{(async()=>{if(T){const e=await Object(qe.a)(T);A||M((e=>{const t={};var a,n;return Object.keys(y).length>0?null===e||void 0===e||null===(a=e.pages)||void 0===a||a.forEach((e=>{var a;null===e||void 0===e||null===(a=e.sections)||void 0===a||a.forEach((e=>{var a;null===e||void 0===e||null===(a=e.fields)||void 0===a||a.forEach((e=>{var a;t[e.id]=null!==(a=y[e.id])&&void 0!==a?a:"",["image","upload","video","file","audio"].includes(e.type)&&(t[e.id]="")}))}))})):null===e||void 0===e||null===(n=e.pages)||void 0===n||n.forEach((e=>{var a;null===e||void 0===e||null===(a=e.sections)||void 0===a||a.forEach((e=>{var a;null===e||void 0===e||null===(a=e.fields)||void 0===a||a.forEach((e=>{t[e.id]=""}))}))})),E.forEach((e=>{t[e.id]=e.data.url})),console.log(t,"==============initial values"),t})(T)),F(e)}})()}),[j,T]);Object(d.useEffect)((()=>{null!==s&&void 0!==s&&s.attributes["repayment-methods"]["remita-inflight"]&&S(!0)}));const R=async e=>{if(!I.current){I.current=!0;try{let t={longitude:0,latitude:0};null!==s&&void 0!==s&&s.attributes["require-location"]&&(t=await Object(u.m)());const n={...r,product_id:i.get("id"),longitude:t.longitude,latitude:t.latitude,attributes:JSON.stringify({[null===s||void 0===s?void 0:s.attributes.additional_loan_data.meta.name]:e})||""},{message:l,status:c}=await x(n,"Non-Individual"===s.customer_type);if("success"===c){(e=>{"after-loan-request"===(null===s||void 0===s?void 0:s.attributes["request-payment-method"])?a(O.b.OFFER_SELECTION):!0===e.none?a(O.b.AUTHORIZE):!0===e["debit-card"]?a(O.b.REPAYMENT_METHOD):!0===e["remita-inflight"]?a(O.b.OFFER_SELECTION):!0===e["direct-debit"]?a(O.b.INFO_MANDATE):a(O.b.CHOOSE_PAYMENT_METHOD)})(null===s||void 0===s?void 0:s.attributes["repayment-methods"])}else o.a.error(l),g(l),a(O.b.NOT_ELIGIBLE);I.current=!1}catch(t){"ALREADY SCORING"!==(null===t||void 0===t?void 0:t.message)&&(console.dir(t),g(J(t,b)),I.current=!1)}}};return Object(w.jsx)(w.Fragment,{children:A&&D?Object(w.jsx)("div",{className:"",children:Object(w.jsx)(l.c,{initialValues:A,onSubmit:async()=>{console.log("submit")},validateOnMount:!0,validationSchema:D,children:e=>{return Object(w.jsxs)("div",{children:[Object(w.jsxs)(l.b,{onSubmit:e.handleSubmit,children:[Object(w.jsx)(Y.a,{when:e.dirty&&e.submitCount<1,message:"Are you sure you want to abandon application?"}),m===Le.FORM&&T&&(t=T.pages[N],Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(w.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(w.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(w.jsx)("p",{className:"text-primary  fs-5 fw-bold",children:null===t||void 0===t?void 0:t.title}),Object(w.jsx)("small",{className:"text-app-gray",children:Object(w.jsx)(Pe,{text:null===t||void 0===t?void 0:t.description})})]}),null===t||void 0===t?void 0:t.sections.map((t=>Object(w.jsxs)("div",{className:"mt-5 text-app-gray ",children:[Object(w.jsx)("p",{className:"fw-bold",children:t.name}),Object(w.jsx)("small",{children:t.description}),Object(w.jsx)(ke,{section:t,props:e},t.name)]},t.name)))]})}),Object(w.jsx)("div",{className:"d-flex justify-content-between modal-footer control ",children:null===t||void 0===t?void 0:t.actions.map((n=>Object(w.jsx)(Ae,{page:t,action:n,onContinue:()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=null===s||void 0===s?void 0:s.attributes.minimum_amount_before_statement;N<(null===T||void 0===T?void 0:T.pages.length)-1?(C(N+1),_(e)):+r.requested_amount>=+t?v(Le.MONO):v(Le.CONFIRM_FORM)}(e.values),onPrevious:()=>{N<=0?a(Object(h.o)(s)?O.b.BREAKDOWN:O.b.PROFESSIONAL_INFO):C(N-1)}},n.label))).reverse()})]})),m===Le.MONO&&Object(w.jsx)(ue.a,{setCurrentStep:v,prevStep:Le.FORM,nextStep:Le.CONFIRM_FORM})]}),m===Le.CONFIRM_FORM&&T&&Object(w.jsx)(De,{docsUploaded:E,setCurrentStep:a,setCurrentPage:C,setCurrentConfigFormScreen:v,staticFormValues:r,product:s,loanProduct:T,onSubmit:()=>R(e.values),isSubmitting:f,isRemita:k})]});var t}})}):Object(w.jsx)(te.a,{})})}var Be=a(248),Ve=a(249),He=a(175),Ye=a(250),We=a(251),Ge=a(252),Ze=a(177);function Ke(e){let{setCurrentStep:t,product:a}=e;const[n,s]=Object(d.useState)(!1),[l]=Object(c.a)((e=>[e.offers,e.chooseOffer,e.getLoanPaymentSchedules,e.loansRepayment,e.loansRepaymentData,e.signOfferLetterStatus]),p.shallow),{translate:i}=Object(g.useTranslation)(),r=Object(c.a)((e=>e.selectedOffer)),o=Object(d.useMemo)((()=>{var e;const t=null===(e=a.fees)||void 0===e?void 0:e.filter((function(e){var t;return"management"===(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())}));return Object(u.i)(t,null===r||void 0===r?void 0:r.loan_amount,null===r||void 0===r?void 0:r.interest_rate)}),[r]);return Object(w.jsxs)("div",{className:"card default-card",children:[Object(w.jsx)("div",{className:"mx-0 modal-body py-4 row",children:Object(w.jsxs)("div",{className:"col-12",children:[Object(w.jsx)("div",{className:"tab-content__header",children:Object(w.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:"Upfront Fee Deduction"})}),Object(w.jsxs)("div",{className:"p-3 rounded-4 bg-light-blue",children:[Object(w.jsxs)("div",{className:"d-inline-block",children:[Object(w.jsx)("p",{children:"To proceed, please confirm by checking the box below:"}),Object(w.jsx)("br",{}),Object(w.jsx)("p",{children:"Upon loan approval, the full loan amount is credited to your wallet, and the following is immediately debited. Only the remaining balance will be available for your use. Please confirm by checking the box below:"}),Object(w.jsx)("br",{}),Object(w.jsxs)("ul",{children:[(null===a||void 0===a?void 0:a.attributes["upfront-interest-payment"])&&Object(w.jsxs)("li",{children:["The interest for this loan,"," ",Object(w.jsx)("strong",{children:Object(h.q)(Object(h.d)(r.interest_due),a.currency)})," ","is charged immediately after the loan is disbursed."]}),(null===a||void 0===a?void 0:a.attributes["upfront-fee-payment"])&&Object(w.jsxs)(w.Fragment,{children:[Object(w.jsx)("br",{}),Object(w.jsxs)("li",{children:["The management fee for this loan,"," ",Object(w.jsx)("strong",{children:Object(h.q)(o,a.currency)})," ","is charged immediately after the loan is disbursed."]})]})]})]}),Object(w.jsxs)("div",{className:"mt-4 mb-2 form-check",children:[Object(w.jsx)("input",{className:"form-check-input",type:"checkbox",id:"flexCheckChecked1",required:!0,onChange:()=>{s(!n)},checked:n}),Object(w.jsxs)("label",{className:"form-check-label small",htmlFor:"flexCheckChecked1",children:["Click here to accept deduction of"," ",Object(h.q)((()=>{let e=0;return null!==a&&void 0!==a&&a.attributes["upfront-fee-payment"]&&(e+=o),null!==a&&void 0!==a&&a.attributes["upfront-interest-payment"]&&(e+=null===r||void 0===r?void 0:r.interest_due),e})(),a.currency)," from disbursed amount"]})]})]})]})}),Object(w.jsxs)("div",{className:"w-full d-flex justify-content-between modal-footer control",children:[Object(w.jsx)("button",{type:"button",onClick:()=>t(O.b.OFFER_SELECTION),className:"pl-0 btn btn-ghost btn-lg",children:i("lender-web-app-back")}),Object(w.jsx)(v.a,{isDisabled:!n,onClick:()=>(async()=>{const e=null===a||void 0===a?void 0:a.attributes["repayment-methods"];1===a.require_loan_offer&&"success"!==l?t(O.b.OFFER_LETTER):"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])?t(O.b.AUTHORIZE):!0===e["debit-card"]?t(O.b.REPAYMENT_METHOD):!0===e["remita-inflight"]||!0===e.none?t(O.b.AUTHORIZE):!0===e["direct-debit"]?t(O.b.INFO_MANDATE):!0===e["mobile-money"]?t(O.b.MOBILE_MONEY):t(O.b.CHOOSE_PAYMENT_METHOD)})(),className:"px-5 btn btn-primary btn-lg",children:i("lender-web-app-continue")})]})]})}function ze(){var e,t;const a=Object(z.a)(),s=Object(Y.i)(),l=Object(L.a)((e=>e.slug)),i=Object(n.a)((e=>e.profile)),[r]=Object(n.a)((e=>[e.documents]),p.shallow),b=null===r||void 0===r?void 0:r.filter((e=>{var t,a;return"identification documents"===(null===e||void 0===e||null===(t=e.doc_type)||void 0===t||null===(a=t.name)||void 0===a?void 0:a.toLowerCase())})),[u,m,h,O,v]=Object(c.a)((e=>[e.products,e.myLoans,e.resetLoan,e.productLociEligibilityStatus,e.postProductEligibilityCheck]),p.shallow);Object(d.useEffect)((()=>{h()}),[]);const x=Object(d.useMemo)((()=>{const e=a.get("id");if(e)return u.find((t=>t.id===+e))}),[a,u]);Object(d.useEffect)((()=>{(async()=>{try{await Object(P.a)(R.nb,"post",{product_id:a.get("id")})}catch(t){var e;null!==t&&void 0!==t&&null!==(e=t.data)&&void 0!==e&&e.mobile&&(o.a.error((null===t||void 0===t?void 0:t.message)||""),s?s.push(j.a.settings.wallet):window.location.href=j.a.settings.wallet)}})()}),[]),Object(d.useEffect)((()=>{const e=Number(a.get("id"));e&&!Number.isNaN(e)&&v({product_id:e})}),[]);const f=Object(d.useMemo)((()=>{let e=0;if(x){for(const n of m){var t,a;["running","pending","past_due"].includes(be.a.statusPill(null===n||void 0===n||null===(t=n.status)||void 0===t?void 0:t.status))&&x.id===(null===n||void 0===n||null===(a=n.loan_profile)||void 0===a?void 0:a.product_id)&&e++}return e>=(null===x||void 0===x?void 0:x.max_active_loans)}}),[m,x]);return"rejected"!==(null===(e=b[0])||void 0===e?void 0:e.status)&&"Failed"!==(null===i||void 0===i?void 0:i.selfie_id_check)||"standard-life"!==l?"pending"===(null===(t=b[0])||void 0===t?void 0:t.status)&&"standard-life"===l?Object(w.jsx)(de.a,{hide:!0,customMessage:"Your ID is pending approval"}):f?Object(w.jsx)(Ye.a,{customMessage:"You have reached the max loans allowed for this loan product: ".concat(null===x||void 0===x?void 0:x.max_active_loans)}):"loading"===O?Object(w.jsx)(te.a,{}):"failed"===O?Object(w.jsx)(de.a,{}):Object(w.jsx)(Je,{product:x}):Object(w.jsx)(de.a,{toLink:j.a.settings.documents,buttonText:"Continue",customMessage:"Your ID is rejected. Upload a valid ID to your account to continue this transaction."})}function Je(e){var t,a;let{product:r}=e;const{translate:b}=Object(g.useTranslation)(),m=Object(d.useRef)(!1),v=Object(z.a)(),x=Object(Y.i)(),f=Object(s.a)((e=>e.user)),{profile:_,profileStatus:N,fetchUserProfile:C,fetchCards:k,fetchDocs:E}=n.a.getState(),[T]=Object(L.a)((e=>[e.require_email_verification]),p.shallow),[A,M,I,R,P,q,U,V]=Object(c.a)(Object(d.useCallback)((e=>[e.fetchLoanOptions,e.getLoanOffers,e.fetchBusinessProfiles,e.loanProfiles["Non-Individual"]||e.businessProfiles[0],e.businessProfiles[0],e.loanProfiles,e.setErrorMessage,e.setCurrentPage]),[]),p.shallow);Object(d.useEffect)((()=>{C()}),[]);const[W,K]=Object(L.a)(Object(d.useCallback)((e=>[e.location_error_explainer_url,e.account_type]),[]));Object(d.useEffect)((()=>{I(),A(),k(),E()}),[A,k,E,I]);const J=Object(d.useMemo)((()=>Object(u.s)(r)),[r]),Q=Object(d.useMemo)((()=>{var e,t;const a={proposed_payday:"",proposed_tenor:null===r||void 0===r?void 0:r.min_tenor_value,proposed_tenor_period:null===r||void 0===r?void 0:r.min_tenor_period,requested_amount:null===r||void 0===r?void 0:r.min_amount,data_provider_record_id:""},n={...{first_name:null===f||void 0===f?void 0:f.first_name,last_name:null===f||void 0===f?void 0:f.last_name,gender:null!==(e=null===_||void 0===_?void 0:_.gender)&&void 0!==e?e:"",marital_status:null!==(t=null===_||void 0===_?void 0:_.marital_status)&&void 0!==t?t:"Single",no_of_dependent:"0",type_of_residence:"",educational_attainment:"",employment_status:"",employment_category:"",sector_of_employment:"",monthly_net_income:"",work_start_date:new Date(Date.now()-905e6),current_employer:"",purpose:"Individual"===(null===r||void 0===r?void 0:r.customer_type)?"Personal":"Business",work_email:"",city:"",state:"",country:"Nigeria"},...q,...a,address:[null===_||void 0===_?void 0:_.address,null===_||void 0===_?void 0:_.city,null===_||void 0===_?void 0:_.state].filter(Boolean).join(", ")};return n.type_of_residence=(null===n||void 0===n?void 0:n.type_of_residence)||"",n.work_email=(null===n||void 0===n?void 0:n.work_email)||"",n}),[J,q,null===f||void 0===f?void 0:f.first_name,null===f||void 0===f?void 0:f.last_name,null===_||void 0===_?void 0:_.gender,r,R,null===_||void 0===_?void 0:_.address,null===_||void 0===_?void 0:_.city,null===_||void 0===_?void 0:_.state]),{additional_loan_data:$}=(null===r||void 0===r?void 0:r.attributes)||{additional_loan_data:{}},ee="active"===(null===$||void 0===$||null===(t=$.meta)||void 0===t?void 0:t.status.toLowerCase()),ae=Object(h.o)(r),ne=Object(d.useMemo)((()=>{const e=b("lender-web-app-amount-range",{min_amount:Object(h.q)(null===r||void 0===r?void 0:r.min_amount,null===r||void 0===r?void 0:r.currency),max_amount:Object(h.q)(null===r||void 0===r?void 0:r.max_amount,null===r||void 0===r?void 0:r.currency)}),t=Object(S.a)(),a=Object(oe.a)(new Date,14),n=b("lender-web-app-select-date-range",{min:Object(h.u)(t),max:Object(h.u)(a)}),s=Object(u.q)(r),l=b("lender-web-app-provide-valid-address"),c=b("lender-web-app-provide-numeric-value"),i=re.g().shape({business_name:re.h().required(b("lender-web-app-provide-business-name")),business_type:re.h().required(b("lender-web-app-select-business-type")),industry:re.h().required(b("lender-web-app-select-industry")),business_registered:re.c(),state:re.h().required(b("lender-web-app-please-provide-state")),city:re.h().required(b("lender-web-app-select-your-city")),office_rented:re.c(),no_of_outlets:re.f().typeError(c).required(b("lender-web-app-please-input-value")),no_of_employees:re.f().typeError(c).required(b("lender-web-app-please-input-value")),date_of_incorporation:re.e().when("business_registered",{is:e=>["true",1,!0].includes(e),then:re.d().max(Object(S.a)(),b("lender-web-app-select-valid-date")).required(b("lender-web-app-select-valid-date")),otherwise:re.e().nullable()}),rc_number:re.e().when("business_registered",{is:e=>["true",1,!0].includes(e),then:re.h().typeError(b("lender-web-app-enter-rcbn-number")).min(9,b("lender-web-app-use-rcbn-format")).max(9,b("lender-web-app-use-rcbn-format")).required(b("lender-web-app-enter-rc-number")),otherwise:re.e().nullable()}),tin:re.e().when("business_registered",{is:e=>["true",1,!0].includes(e),then:re.h().typeError(b("lender-web-app-enter-your-tin")).min(13,b("lender-web-app-tin-format")).max(13,b("lender-web-app-tin-format")).required(b("lender-web-app-enter-your-tin")),otherwise:re.e().nullable()})}),o=re.g().shape({requested_amount:re.f().typeError(c).min(null===r||void 0===r?void 0:r.min_amount,e).max(null===r||void 0===r?void 0:r.max_amount,e).required(b("lender-web-app-enter-an-amount")),proposed_tenor:re.f().typeError(c).min(null===r||void 0===r?void 0:r.min_tenor_value,b("lender-web-app-min-tenor",{min_tenor_value:"".concat(null===r||void 0===r?void 0:r.min_tenor_value),max_tenor_period:"".concat(null===r||void 0===r?void 0:r.min_tenor_period)})).max(null===r||void 0===r?void 0:r.max_tenor_value,b("lender-web-app-max-tenor",{max_tenor_value:"".concat(null===r||void 0===r?void 0:r.max_tenor_value),max_tenor_period:"".concat(null===r||void 0===r?void 0:r.max_tenor_period)})).required(b("lender-web-app-provide-numeric-value")),proposed_tenor_period:re.h().oneOf(s,b("lender-web-app-select-valid-tenor")).required(b("lender-web-app-select-tenor-period")),proposed_payday:re.d().min(t,n).max(a,n).required(n),data_provider_record_id:re.h().optional(),gender:re.h().required(b("lender-web-app-please-select-gender")),marital_status:re.h().required(b("lender-web-app-select-marital-status")),no_of_dependent:re.h().required(b("lender-web-app-please-select-dependents")),type_of_residence:re.h().required(b("lender-web-app-select-type-residence")),address:re.h().min(5,l).max(255,l).required(l),educational_attainment:re.h().required(b("lender-web-app-select-education-attainment")),employment_status:re.h().required(b("lender-web-app-select-employment-status")),sector_of_employment:re.h().required(b("lender-web-app-select-your-sector-employment")),employment_category:re.h().required(b("lender-web-app-select-employment-category")),monthly_net_income:re.h().required(b("lender-web-app-select-monthly-income")),current_employer:re.h().required(b("lender-web-app-provide-your-employer")),work_start_date:re.d().max(Object(S.a)(),b(b("lender-web-app-select-valid-date"))).nullable(!0),work_email:re.h().email(b("lender-web-app-provide-valid-email")).nullable(!0).required(b("lender-web-app-provide-valid-email")),purpose:re.h().required(b("lender-web-app-indicate-loan-purpose"))});return J?o.concat(i):o}),[r,b]),[le,ce]=Object(d.useState)({...Q,gender:null===_||void 0===_?void 0:_.gender}),[be,pe]=Object(d.useState)(O.b.AMOUNT_SELECTION),[Ce,ke]=Object(d.useState)(!1);Object(d.useEffect)((()=>{window.scrollTo(0,0)}),[be]);const Se=Object(d.useRef)(!1);return Object(d.useEffect)((()=>{null!==_&&void 0!==_&&_.address&&null!==_&&void 0!==_&&_.gender||"success"!==N||!1!==m.current||(m.current=!0,o.a.error(b("lender-web-app-update-address")),x?x.push(j.a.settings.profile):window.location.href=j.a.settings.profile),null!==_&&void 0!==_&&_.kin||"success"!==N||!1!==m.current||(m.current=!0,o.a.error(b("lender-web-app-update-nok")),x?x.push(j.a.settings.nextOfKin):window.location.href=j.a.settings.nextOfKin)}),[N,b]),Object(d.useEffect)((()=>{!T||null!==_&&void 0!==_&&_.email_verified||"success"!==N||!1!==m.current||(m.current=!0,o.a.error(b("lender-web-app-verify-email")),x?x.push(j.a.settings.profile):window.location.href=j.a.settings.profile)}),[N,b]),"loading"===N?Object(w.jsx)(te.a,{}):Object(w.jsxs)("div",{className:"col-12 scroll-modal",children:[Object(w.jsx)(l.c,{initialValues:{...Q,gender:null!==(a=null===_||void 0===_?void 0:_.gender)&&void 0!==a?a:Q.gender,work_start_date:Q.work_start_date,current_employer:Q.current_employer||""},onSubmit:async e=>{if(ee)ce(e),V(0),pe(O.b.ADDITIONAL_DATA);else if(!Se.current){Se.current=!0;try{let t={longitude:0,latitude:0};null!==r&&void 0!==r&&r.attributes["require-location"]&&(t=await Object(u.m)());const a={...e,product_id:v.get("id"),longitude:t.longitude,latitude:t.latitude,currency:"rwf"},{message:n,status:s}=await M({...a,debit_id:5},"Non-Individual"===(null===r||void 0===r?void 0:r.customer_type));"success"===s?pe(O.b.OFFER_SELECTION):(o.a.error(n),U(n),pe(O.b.NOT_ELIGIBLE)),Se.current=!1}catch(t){if("ALREADY SCORING"!==(null===t||void 0===t?void 0:t.message)){console.dir(t);const e=Object(w.jsxs)("div",{children:[b("lender-web-app-need-access-location")," ",Object(w.jsxs)("a",{href:W,rel:"noreferrer",target:"_blank",children:[" ",b("lender-web-app-click-here")]})," ",b("lender-web-app-know-why-access")]});o.a.error(e),Se.current=!1}}}},validateOnBlur:!0,validationSchema:ne,children:e=>Object(w.jsxs)(l.b,{onSubmit:e.handleSubmit,children:[be===O.b.AMOUNT_SELECTION&&Object(w.jsx)(D,{product:r,setCurrentStep:pe}),be===O.b.BREAKDOWN&&Object(w.jsx)(se,{setCurrentStep:pe,product:r,setStaticFormValues:ce}),be===O.b.BUSINESS_INFO&&Object(w.jsx)(B,{setCurrentStep:pe,profileId:null===P||void 0===P?void 0:P.id}),be===O.b.PERSONAL_INFO&&!ae&&Object(w.jsx)(Z,{profile:_,setCurrentStep:pe,formikProps:e}),be===O.b.PROFESSIONAL_INFO&&!ae&&Object(w.jsx)(X,{formikProps:e,personalLoanDetails:Q,isBusinessLoan:J,setCurrentStep:pe,product:r,setWhitelisted:ke,showConfigurableForm:ee,setStaticFormValues:ce}),be===O.b.CONFIRM&&Object(w.jsx)(me,{setCurrentStep:pe,product:r,whitelisted:Ce}),be===O.b.SHOW_CARDS&&Object(w.jsx)(je.a,{setCurrentStep:pe,product:r}),be===O.b.MONO&&Object(w.jsx)(ue.a,{setCurrentStep:pe,prevStep:O.b.PROFESSIONAL_INFO,nextStep:O.b.CONFIRM}),be===O.b.OFFER_SELECTION&&Object(w.jsx)(y,{product:r,setCurrentStep:pe,showConfigurableForm:ee}),be===O.b.FEE_CHARGE_WARNING&&Object(w.jsx)(Ke,{product:r,setCurrentStep:pe}),be===O.b.SUCCESSFUL&&Object(w.jsx)(ie.a,{}),be===O.b.NOT_ELIGIBLE&&Object(w.jsx)(de.a,{}),be===O.b.PENDING&&Object(w.jsx)(G,{}),be===O.b.CHOOSE_PAYMENT_METHOD&&Object(w.jsx)(Ve.a,{product:r,setCurrentStep:pe}),be===O.b.MOBILE_MONEY&&Object(w.jsx)(We.a,{product:r,setCurrentStep:pe,showConfigurableForm:ee}),be===O.b.ADD_MOBILE_MONEY&&Object(w.jsx)(Ge.a,{product:r,setCurrentStep:pe}),be===O.b.MANDATES&&Object(w.jsx)(Oe.a,{product:r,setCurrentStep:pe,showConfigurableForm:ee}),be===O.b.REPAYMENT_METHOD&&Object(w.jsx)(i.a,{product:r,setCurrentStep:pe,showConfigurableForm:ee}),be===O.b.GUARANTOR&&Object(w.jsx)(he.a,{setCurrentStep:pe}),be===O.b.DOCUMENTS&&Object(w.jsx)(H,{setCurrentStep:pe}),be===O.b.MANDATE_ACCOUNT&&Object(w.jsx)(fe.a,{product:r,setCurrentStep:pe}),be===O.b.MANDATE_SIGNATURE&&Object(w.jsx)(He.a,{product:r,setCurrentStep:pe,type:"loan",showConfigurableForm:ee}),be===O.b.EMANDATE_INFO&&Object(w.jsx)(Ze.a,{product:r,setCurrentStep:pe,type:"loan",showConfigurableForm:ee})]})}),be===O.b.AUTHORIZE&&Object(w.jsx)(F.a,{setCurrentStep:pe}),be===O.b.ADD_BANK&&Object(w.jsx)(Be.a,{accountType:K,setCurrentStep:pe}),be===O.b.DOWNLOAD_MANDATE&&Object(w.jsx)(_e.a,{product:r,setCurrentStep:pe}),be===O.b.ADD_MANDATE&&Object(w.jsx)(xe.a,{setCurrentStep:pe}),be===O.b.INFO_MANDATE&&Object(w.jsx)(ve.a,{onBack:()=>{(null===r||void 0===r?void 0:r.attributes["repayment-methods"])["debit-card"]?pe(O.b.REPAYMENT_METHOD):"before-loan-request"===(null===r||void 0===r?void 0:r.attributes["request-payment-method"])?pe(O.b.PROFESSIONAL_INFO):pe(O.b.OFFER_SELECTION)},onContinue:()=>pe(O.b.MANDATES),type:"loan"}),be===O.b.SUCCESS_MANDATE&&Object(w.jsx)(we.a,{}),be===O.b.OTP_MANDATE&&Object(w.jsx)(ge.a,{setCurrentStep:pe}),be===O.b.OFFER_LETTER&&Object(w.jsx)(ye.a,{setCurrentStep:pe}),be===O.b.SIGN_OFFER&&Object(w.jsx)(Ne.a,{setCurrentStep:pe,product:r}),ee&&be===O.b.ADDITIONAL_DATA&&Object(w.jsx)(Ue,{product:r,setCurrentStep:pe,query:v,staticFormValues:le})]})}},148:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return b}));var n=a(3),s=a(21),l=a(20),c=a(6),i=a(19),r=a(2),o=a(0);function d(e){let{productId:t,productTypeId:a,name:d,interestRate:b,interestPeriod:u,minAmount:j,maxAmount:p,type:m,lockedInvestment:h,onClick:O,currency:v}=e;const x=Object(i.a)((e=>e.openLoanModal)),{translate:f}=Object(r.useTranslation)(),g=Object(s.i)();return Object(o.jsxs)("div",{className:"card mb-0 default-card cardProduct",style:{minHeight:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[("investment"===m||"investment-plans"===m)&&Object(o.jsx)("div",{className:"me-1 text-primary",children:Object(o.jsx)("svg",{width:"20",height:"20",children:h?Object(o.jsx)("use",{xlinkHref:"/icon-sprite.svg#lock-icon"}):Object(o.jsx)("use",{xlinkHref:"/icon-sprite.svg#piggy-bank-icon"})})}),Object(o.jsxs)("div",{className:"w-100",children:[Object(o.jsxs)("div",{className:"row cardProduct__data",children:[Object(o.jsxs)("div",{className:"col-12 col-sm-6",children:[Object(o.jsx)("p",{className:"cardProduct__name",children:d}),Object(o.jsxs)("p",{className:"cardProduct__interest mb-0",children:[b,"% per"," ",Object(n.f)("year"===u?"annum":u)]})]}),Object(o.jsx)("div",{className:"col-12 col-sm-6 d-none d-md-block",children:"investment"===m&&Object(o.jsx)(l.b,{className:"btn cardProduct__btn",to:{state:{productId:JSON.stringify({productTypeId:a,productId:t})},search:"?savingId=".concat(t,"&id=").concat(a)},onClick:O,children:f("lender-web-app-take-offer")})||"investment-plans"===m&&Object(o.jsx)(l.b,{className:"btn cardProduct__btn",to:{state:{productId:JSON.stringify({productTypeId:a})},search:"?id=".concat(a)},children:f("lender-web-app-view-offers")})||Object(o.jsx)(c.a,{className:"btn cardProduct__btn",onClick:()=>{g.push({search:"?id=".concat(t)}),x(t)},children:f("lender-web-app-take-offer")})})]}),Object(o.jsxs)("div",{className:"row cardProduct__data",children:[Object(o.jsx)("div",{className:"col-12",children:Object(o.jsxs)("p",{className:"cardProduct__amount",children:[Object(n.q)(j,v)," - ",Object(n.q)(p,v)," "]})}),Object(o.jsx)("div",{className:"col-12 col-sm-6 mt-2 d-block d-md-none",children:"investment"===m&&Object(o.jsx)(l.b,{className:"btn cardProduct__btn",to:{state:{productId:JSON.stringify({productTypeId:a,productId:t})},search:"?savingId=".concat(t,"&id=").concat(a)},onClick:O,children:f("lender-web-app-take-offer")})||"investment-plans"===m&&Object(o.jsx)(l.b,{className:"btn cardProduct__btn",to:{state:{productId:JSON.stringify({productTypeId:a})},search:"?id=".concat(a)},children:f("lender-web-app-view-offers")})||Object(o.jsx)(c.a,{className:"btn cardProduct__btn",onClick:()=>{g.push({search:"?id=".concat(t)}),x(t)},children:f("lender-web-app-take-offer")})})]})]})]})}a(124);function b(e){let{title:t,amount:a,currency:s}=e;return Object(o.jsxs)("div",{className:"cardstat__active statsgroup mb-4 mt-lg-0",children:[Object(o.jsx)("p",{className:"text-capitalize",children:t}),Object(o.jsx)("h3",{children:Object(n.q)(a,s)})]})}},15:function(e,t,a){"use strict";var n=a(86),s=a(11),l=a(10),c=a(9),i=a(53),r=a(61),o=a(33),d=a(3),b=a(117),u=a(270),j=a(163),p=(a(263),a(18)),m=a(54),h=a(41),O=a(45);const v=async(e,t)=>{const{org_id:a,lsq_ref:n,user_id:c}=H.getState(),{session_id:i}=O.a.getState(),r={org_id:a,description:t,event_name:e,session_id:i,user_id:c,app_name:"".concat(window.ORG_NAME," WebApp"),time:Object(d.j)(new Date)};Object(s.a)(l.Mb,"post",r,{headers:{ref:n}}).catch(console.error)},x="start_onboarding",f="onboarding_otp_verification",g="onboarding_password_creation",w="start_bvn_validation",_="complete_bvn_validation",y="onboarding_email_confirmation",N="google_onboarding_email_confirmation",C="facebook_onboarding_email_confirmation",k="open_onboarding_selfie_camera",S="capture_onboarding_selfie_image",E="upload_onboarding_selfie_image",T="submit_onboarding_selfie_image",A="onboarding_bank_account_verification",L="onboarding_bank_account_submission",M="onboarding_create_pin",D="complete_onboarding",F=e=>{const{user_id:t}=H.getState();switch(e){case x:v(x,"User".concat(t," clicked on get started"));break;case f:v(f,"User".concat(t," clicked to verify OTP"));break;case g:v(g,"User".concat(t," clicked to create password"));break;case w:v(w,"User".concat(t," clicked to submit BVN number"));break;case _:v(_,"User".concat(t," clicked to verify that provided BVN details match"));break;case y:v(y,"User".concat(t," clicked to submit manually provided email address"));break;case N:v(N,"User".concat(t," clicked to confirm email address via Google login"));break;case C:v(C,"User".concat(t," clicked to confirm email address via Facebook login"));break;case k:v(k,"User".concat(t," opened selfie camera"));break;case S:v(S,"User".concat(t," clicked to capture selfie image"));break;case E:v(E,"User".concat(t," clicked to upload selfie image"));break;case T:v(T,"User".concat(t," clicked to submit selfie image"));break;case A:v(A,"User".concat(t," clicked to verify bank account details"));break;case L:v(L,"User".concat(t," clicked to submit bank account details"));break;case M:v(M,"User".concat(t," clicked to create PIN"));break;case D:v(D,"User".concat(t," completed signup"))}};var I=a(781);Object(o.b)();const R="0.7.2",P={screen:1,bvnScreen:1,maxScreens:-1,phone_number:"",loading:!1,confirmation_id:"",token:"",refresh_token:"",bvn_phone_number:"",dob:"",done:!1,approved_domain_email:"",firebase_web_api_key:"",firebase_web_auth_domain:"",firebase_web_sender_id:"",firebase_web_project_id:"",firebase_web_app_id:"",email_provider:"legacy",customer_support_address:"",customer_support_phone:"",customer_support_email:"",customer_support_website:"",social_media_facebook:"",social_media_twitter:"",social_media_instagram:"",customer_support_whatsapp:"",loan_cancelation_reason:[],loan_offer_expiry:0,organization:"",direct_debit_provider:"",currency:"",onboarding_stages:null,onboarding_status:"idle",onboarding_form:null,language:"en-GB",languageName:"English",session_idle_timeout:null,logo_url:"",privacy_url:"",terms_url:"",country:"",allowed_phone_code:"",allowed_domain_error:"",camera_error_explainer_url:"",location_error_explainer_url:"",mono_public_key:"",adjutor_public_key:"",oraculi_sdk_options:"",account_type:"",mandate_activation_type:"",emandate_activation_details:{},bvn:"",disbursement_provider:"",activateCerte:!0,org_id:null,user_id:null,lsq_ref:null,mobile_money_provider:"",kyc_status_allowed_for_loans:"",accept_verve_cards:!1,require_mandate_on_onboard:{},require_email_verification:!1,slug:""},q=b.b,U={getItem:async e=>{const t=sessionStorage.getItem(e);return null!==t&&JSON.parse(t).state.done&&sessionStorage.clear(),sessionStorage.getItem(e)},setItem:async(e,t)=>{const a=JSON.parse(t);sessionStorage.setItem(e,JSON.stringify({...a,state:{...a.state,loading:!1}}))},removeItem:async e=>{sessionStorage.removeItem(e)}};function B(e){"Unauthorized access"===(null===e||void 0===e?void 0:e.message)&&setTimeout((()=>{window.location.href="/login"}),1e3)}const V=Object(i.create)()(Object(r.persist)(((e,t)=>({...P,setScreen:t=>{e({screen:t})},setBvnScreen:t=>{e({bvnScreen:t})},setMaxScreen:t=>{e({maxScreens:t})},resetLogin:()=>{e({onboarding_status:"idle",screen:1,maxScreens:-1})},validateAllowedDomainOnboarding:async t=>await q("content").then((a=>{const{dictionary:n}=a;return n["allowed-domains"].includes(t.split("@")[1])?(e({approved_domain_email:t}),!0):(e({screen:"ONBOARDING_ERROR",allowed_domain_error:" You can only sign up to this account if you are part of the ".concat(n.page_title," organization. Please contact your administrator")}),!1)})).catch((e=>console.log("It failed!",e))),checkError:t=>{var a,n;null!==t&&void 0!==t&&t.isAxiosError?c.toast.error(null===(a=t.response)||void 0===a||null===(n=a.data)||void 0===n?void 0:n.message):c.toast.error(null===t||void 0===t?void 0:t.message);e({loading:!1}),B(t)},getHeaders:()=>{const{language:e}=t(),{access_token:a}=h.a.getState();return{Authorization:"bearer ".concat(a),"x-locale":e}},initCerte:()=>{const{lsq_ref:a}=t();if(null===a){const t=Object(I.a)(),a="LSQREF-".concat(t);e({lsq_ref:a})}},resetCerte:()=>{F(D),e({lsq_ref:null,activateCerte:!1})},tagOnboardEvent:e=>{const{initCerte:a}=t();a(),F(e)},onboard:async a=>{var s;e({loading:!0,phone_number:a.phone_number});const c=await Object(p.m)().catch((()=>({longitude:void 0,latitude:void 0}))),i={phone_number:a.phone_number,referral_code:a.referral_code,longitude:c.longitude?String(c.longitude):void 0,latitude:c.latitude?String(c.latitude):void 0,version_id:R,mobile_os:null!==(s=null===m.osName||void 0===m.osName?void 0:m.osName.toLowerCase())&&void 0!==s?s:void 0,device_name:"".concat("none"===m.mobileVendor?"":m.mobileVendor||""," ").concat(m.mobileModel).trim()||"".concat(m.deviceType||""," ").concat(m.browserName||""," ").concat(m.browserVersion||"").trim()||void 0,os_version:null!==m.osVersion&&void 0!==m.osVersion?m.osVersion:void 0};try{await n.a.post(l.eb,i),e({loading:!1,screen:2})}catch(r){t().checkError(r)}e({loading:!1})},setLanguage:(t,a)=>{e({language:t,languageName:a})},getLendersPreferences:async()=>{e({loading:!0});try{const t=(await n.a.get(l.A)).data.data,{id:a,firebase_web_api_key:s,firebase_web_sender_id:c,firebase_web_auth_domain:i,firebase_web_project_id:r,firebase_web_app_id:o,email_provider:d,website_url:b,privacy_url:u,terms_url:j,support_phone:p,support_email:m,instagram_url:h,twitter_url:O,facebook_url:v,address:x,mono_public_key:f,adjutor_public_key:g,oraculi_sdk_options:w,organization:_,direct_debit_provider:y,currency:N,onboarding_stages:C,session_idle_timeout:k,logo_url:S,country:E,disbursement_provider:T,accept_verve_cards:A}=t,L=t["loan-cancelation-reasons"].split(",").map((e=>e.replaceAll('"',"").trim()));e({firebase_web_api_key:s,firebase_web_auth_domain:i,firebase_web_sender_id:c,firebase_web_app_id:o,firebase_web_project_id:r,privacy_url:u,terms_url:j,org_id:a,camera_error_explainer_url:t["camera-error-explainer-url"],location_error_explainer_url:t["location-error-explainer-url"],email_provider:d,customer_support_address:x||t["customer-support-address"],customer_support_phone:p||t["customer-support-phone"],customer_support_email:m||t["customer-support-email"],customer_support_website:b||t["customer-support-website"],social_media_facebook:v||t["social-media-facebook"],social_media_twitter:O||t["social-media-twitter"],social_media_instagram:h||t["social-media-instagram"],mono_public_key:f,adjutor_public_key:g,oraculi_sdk_options:w,loan_cancelation_reason:[...L],loan_offer_expiry:t["loan-offer-expiry"],account_type:t["account-type"],mandate_activation_type:t["mandate-activation-type"],emandate_activation_details:JSON.parse((null===t||void 0===t?void 0:t["emandate-activation-details"])||"{}"),organization:_,direct_debit_provider:y,currency:N,onboarding_stages:C,session_idle_timeout:k&&6e4*k,logo_url:S,country:E,allowed_phone_code:t["default-country-phone-codes"],disbursement_provider:T,mobile_money_provider:t["mobile-money-provider"],kyc_status_allowed_for_loans:t["kyc-status-allowed-for-loans"],accept_verve_cards:A,require_mandate_on_onboard:t["require-mandate-on-onboard"],require_email_verification:t.require_email_verification,slug:t.slug}),e({loading:!1})}catch(t){e({loading:!1})}},chooseOnboardingFlow:async function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{fetchCustomOnboarding:s,onboarding_stages:l}=t(),c=null===l||void 0===l?void 0:l.find((e=>"form"===e.name));c?c&&await s():(n&&e({screen:a+3}),e({maxScreens:7}))},fetchCustomOnboarding:async()=>{e({loading:!0});const{checkError:a}=t();try{var n,c;const t=await Object(s.a)(l.r,"get");return e({onboarding_form:t.data,screen:10,loading:!1,maxScreens:2+(null===t||void 0===t||null===(n=t.data)||void 0===n||null===(c=n.pages)||void 0===c?void 0:c.length)}),!0}catch(i){a(i)}},postCustomOnboarding:async e=>{const{checkError:a}=t();try{return await Object(s.a)(l.r,"post",{...e}),!0}catch(n){return a(n),!1}},getVerificationDocument:async()=>{const{checkError:e}=t();try{const e=await Object(s.a)(l.T,"post",{product:"basic_kyc"});return null===e||void 0===e?void 0:e.data}catch(a){return e(a),!1}},verifySmileDocument:async e=>{const{checkError:a}=t();try{const t=await Object(s.a)(l.hc,"post",{job_id:e});return null===t||void 0===t?void 0:t.data}catch(n){a(n)}},resendCode:async()=>{e({loading:!0});const{phone_number:a}=t();try{await n.a.post(l.eb,{phone_number:a})}catch(s){const t=s;e({loading:!1}),c.toast.error(null===t||void 0===t?void 0:t.message),B(t)}e({loading:!1})},onboardOTP:async a=>{e({loading:!0});const{phone_number:s}=t();try{const{data:t}=await n.a.post(l.ob,{otp:a,phone_number:s});e({confirmation_id:t.data.confirmation_id,screen:3,loading:!1})}catch(c){t().checkError(c)}},createPassword:async a=>{const{tagOnboardEvent:s,checkError:c,chooseOnboardingFlow:i}=t();e({loading:!0});const r={password:a,phone_number:t().phone_number,confirmation_id:String(t().confirmation_id),device_id:"web"};try{const{data:t}=await n.a.post(l.qb,r);e({token:t.data.token,loading:!1,user_id:t.data.id}),O.a.setState({session_id:t.session_id}),h.a.getState().setToken(t.data),s(g),console.log(t,"======================password-data"),i(null===t||void 0===t?void 0:t.stage_id,!0)}catch(o){c(o)}},verifyBVN:async a=>{const{tagOnboardEvent:n}=t();n(w),e({loading:!0});const{checkError:s}=t();try{e({bvn:a,loading:!1,bvnScreen:2})}catch(l){s(l)}},createBVN:async a=>{let{phone_number:n,dob:c}=a;const{tagOnboardEvent:i,bvn:r}=t();i(_),e({loading:!0});try{var o;const t=await Object(s.a)(l.Qb,"post",{bvn:r,last_5_digits:n,dob:c}),a=await Object(s.a)(l.d,"post",{bvn:r,bvn_phone_number:t.data.mobile,dob:Object(d.n)((null===(o=t.data)||void 0===o?void 0:o.formatted_dob)||t.data.dob)});e({loading:!1,screen:a.data.stage_id+3})}catch(b){t().checkError(b)}},addEmail:async a=>{const{tagOnboardEvent:n}=t();n(y),e({loading:!0});const{checkError:c}=t();try{const t=await Object(s.a)(l.bb,"post",a);e({loading:!1,screen:t.data.stage_id+3})}catch(i){c(i)}},signInWithGoogle:async()=>{const{tagOnboardEvent:a}=t();a(N),e({loading:!0});try{var n;const t=j.a()[0],a=Object(u.b)(t),c=new u.a,i=null!==(n=(await Object(u.c)(a,c)).user.email)&&void 0!==n?n:null,r=await Object(s.a)(l.bb,"post",{email:i});e({screen:r.data.stage_id+3,loading:!1})}catch(m){var i,r;const t=m;var o,d,b,p;if(null!==t&&void 0!==t&&t.isAxiosError)return e({loading:!1}),c.toast.error(null===t||void 0===t||null===(o=t.response)||void 0===o||null===(d=o.data)||void 0===d?void 0:d.message),Promise.reject(new Error(null===t||void 0===t||null===(b=t.response)||void 0===b||null===(p=b.data)||void 0===p?void 0:p.message));c.toast.error(null===t||void 0===t||null===(i=t.response)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message),B(t)}e({loading:!1})},addBank:async a=>{const{tagOnboardEvent:n}=t();n(L),e({loading:!0});const{checkError:c}=t();try{const t=await Object(s.a)(l.gb,"post",a);e({screen:(null===t||void 0===t?void 0:t.data.stage_id)+3,loading:!1})}catch(i){c(i)}},addPin:async a=>{const{tagOnboardEvent:n}=t();n(M),e({loading:!0});const{checkError:c}=t();try{await Object(s.a)(l.db,"post",a),e({done:!0,phone_number:"34",loading:!1,screen:0})}catch(i){c(i)}},openCamera:()=>{const{tagOnboardEvent:e}=t();e(k)},uploadPhoto:()=>{const{tagOnboardEvent:e}=t();e(E)},addPhoto:async(a,n)=>{const{tagOnboardEvent:c}=t();c(T);const{checkError:i}=t();try{if(e({loading:!0}),!n){n=(await Object(s.a)(Object(l.Pb)("irorun"),"post",a)).data.url}const t=await Object(s.a)(l.cb,"post",{photo_url:n});e({loading:!1,done:!0,screen:(null===t||void 0===t?void 0:t.data.stage_id)+3})}catch(r){i(r)}},addCustomPhoto:async e=>{const{tagOnboardEvent:a,checkError:n}=t();a(E);try{return(await Object(s.a)(Object(l.Pb)("irorun"),"post",e)).data.url}catch(c){n(c)}},verifyBank:async e=>{const{tagOnboardEvent:a}=t();a(A);const{checkError:n}=t();try{const t=await Object(s.a)(l.Rb,"post",e);return null===t||void 0===t?void 0:t.data}catch(c){n(c)}},reset:()=>{const{allowed_phone_code:a}=t();e({...P,allowed_phone_code:a})}})),{name:"onboarding-storage",storage:Object(r.createJSONStorage)((()=>U))}));var H=t.a=V},16:function(e,t,a){"use strict";var n=a(258),s=a(21);const l={dashboard:{index:"/dashboard",transactions:{index:"/dashboard/transactions",details:"/dashboard/transactions/:id",for:e=>Object(s.g)("/dashboard/transactions/:id",{id:e})}},settings:{base:"/settings",profile:"/settings/profile",nextOfKin:"/settings/next-of-kin",cardsAndBanks:"/settings/banks-cards",cards:"/settings/banks-cards/cards",mandates:"/settings/banks-cards/mandates",wallet:"/settings/banks-cards/wallet",documents:"/settings/documents",security:"/settings/security",support:"/settings/support",language:"/settings/language",referral:{index:"/settings/referral",details:"/settings/referral/details"}},onboard:{base:"/onboard",login:"/onboard/login",reset:"/onboard/reset"},loans:{base:"/loans",history:"/loans/history",details:{definition:"/loans/:id",for:e=>Object(s.g)("/loans/:id",{id:e})},apply:{base:"/loans/apply"},repay:{definition:"/loans/repay/"}},investments:{base:{definition:"/:investment_title",for:e=>Object(s.g)("/:investment_title",{investment_title:e})},...n.b.investments},oldDashboard:"/oldDashboard",notifications:"/notifications"};t.a=l},165:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));var n=a(235),s=a(19),l=a(20),c=a(16),i=a(4),r=a(2),o=a(0);function d(e){let{customMessage:t,toLink:a,buttonText:d,hide:b}=e;const[u,j,p,m]=Object(s.a)((e=>[e.errorMessage,e.closeLoanModal,e.fetchLoans,e.fetchDraftLoans]),i.shallow),{translate:h}=Object(r.useTranslation)();return Object(o.jsxs)("div",{className:"card default-card",children:[Object(o.jsx)("div",{className:"row mx-4 loan-modal-body",children:Object(o.jsxs)("div",{style:{maxWidth:"308px"},className:" mx-auto text-center my-auto ",children:[Object(o.jsxs)("svg",{width:"75",height:"65",viewBox:"0 0 75 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-danger",children:[Object(o.jsx)("path",{d:"M72.0521 64.5245C69.5635 65.2157 68.25 64.2479 67.9735 63.0728C66.8674 49.1779 53.3873 38.2555 37.1421 38.2555C37.0729 38.2555 37.073 38.2555 37.0038 38.2555C36.9347 38.2555 36.9347 38.2555 36.8656 38.2555C20.6203 38.2555 7.07107 49.1779 6.03413 63.0728C5.68849 64.2479 4.44417 65.2157 1.95554 64.5245C0.0199339 63.9714 -0.187454 62.0358 0.15819 60.7224C2.50857 44.961 18.2008 32.9326 36.9347 32.9326C37.0038 32.9326 37.0038 32.9326 37.0729 32.9326C37.1421 32.9326 37.1421 32.9326 37.2112 32.9326C55.9451 32.9326 71.6373 44.961 73.9877 60.7224C74.1951 62.1049 73.9877 64.0406 72.0521 64.5245Z",fill:"currentColor"}),Object(o.jsx)("path",{d:"M22.003 6.3871C22.003 9.56703 19.4452 12.1248 16.2653 12.1248C13.0854 12.1248 10.5276 9.56703 10.5276 6.3871C10.5276 3.20718 13.0854 0.649414 16.2653 0.649414C19.4452 0.649414 22.003 3.20718 22.003 6.3871Z",fill:"currentColor"}),Object(o.jsx)("path",{d:"M63.3421 6.3871C63.3421 9.56703 60.7843 12.1248 57.6044 12.1248C54.4245 12.1248 51.8667 9.56703 51.8667 6.3871C51.8667 3.20718 54.4245 0.649414 57.6044 0.649414C60.7843 0.649414 63.3421 3.20718 63.3421 6.3871Z",fill:"currentColor"})]}),Object(o.jsx)("h4",{className:"fw-bold my-3",children:"We are sorry"}),Object(o.jsx)("small",{className:"text-small text-app-gray",dangerouslySetInnerHTML:{__html:u||t||"You\u2019re not eligible for a loan at this time."}}),!b&&Object(o.jsx)(l.b,{onClick:()=>{j(),p(),m()},to:null!==a&&void 0!==a?a:c.a.loans.base,className:"btn btn-primary btn-lg px-5 mt-4",children:null!==d&&void 0!==d?d:h("lender-web-app-view-loans")})]})}),Object(o.jsx)(n.a,{})]})}},173:function(e,t,a){},175:function(e,t,a){"use strict";a.d(t,"a",(function(){return x}));var n=a(1),s=a(4),l=a(19),c=a(6),i=a(5),r=a(58),o=a(416),d=a.n(o),b=(a(173),a(9)),u=a(15),j=a(417),p=a(18),m=a(12),h=a(3),O=a(2),v=a(0);function x(e){var t;let{product:a,setCurrentStep:o,setStep:x,toggleModal:f,type:g,amount:w,showConfigurableForm:_}=e;const y=Object(m.f)();let N;y&&(N=y.values);const{translate:C}=Object(O.useTranslation)(),k=C("lender-web-app-no-lender-beneficiary"),S=Object(n.useRef)(),E=Object(n.useRef)(),T=Object(n.useRef)(),[A,L]=Object(n.useState)(),[M,D]=Object(n.useState)(!1),[F,I,R,P,q,U,B]=Object(l.a)((e=>[e.mandateStatus,e.uploadPhoto,e.generateMandate,e.mandates,e.getMandatePDF,e.createMandate,e.fetchMandateDetails]),s.shallow),[V]=Object(u.a)((e=>[e.organization]),s.shallow);Object(n.useEffect)((()=>{console.log(V,"mandate signnn")}),[V]);const H=Object(n.useCallback)((async e=>{const t=e.target.files[0],a={maxSizeMB:.5,maxWidthOrHeight:1920};try{const e=await Object(j.a)(t,a),n=await Object(p.a)(e);L(n)}catch(n){console.log(n)}}),[]),Y=()=>void 0!==A||void 0!==T&&!T.current.isEmpty()||(b.toast.error(C("lender-web-app-upload-sign")),!1),W=Object(n.useCallback)((async()=>{if(D(!0),Y()){var e;let t;if(N){t=Object(p.n)(N,null===a||void 0===a?void 0:a.interest_rate).repayment}const n=await z(null!==A&&void 0!==A?A:null===T||void 0===T||null===(e=T.current)||void 0===e?void 0:e.toDataURL(),t,new Date);null!==n&&void 0!==n&&n.data&&o&&("before-loan-request"!==(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||_?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&_?o(i.b.OFFER_SELECTION):o(i.b.AUTHORIZE):o(i.b.CONFIRM))}D(!1)}),[A,T]),G=Object(n.useCallback)((async()=>{if(D(!0),Y()){var e;await z(A||(null===T||void 0===T||null===(e=T.current)||void 0===e?void 0:e.toDataURL()),w,new Date)&&(b.toast.success(C("lender-web-app-mandate-sent-bank")),f&&f())}D(!1)}),[A,T]),Z=Object(n.useCallback)((()=>{o&&("success"===F&&P.length>=1?o(i.b.MANDATES):o(i.b.ADD_MANDATE))}),[]),K=Object(n.useCallback)((()=>{x&&x(r.a.AMOUNT)}),[]),z=async(e,t,a)=>{const n=await fetch(e),s=await n.blob();try{const e=await U("nibss-easypay",t,a),n=await B(e.token);if((""===n.organization_bank_name||""===n.organization_account_number)&&!V.toLowerCase().includes("rwanda"))return void b.toast.error(k);const l=await I(s,V,"photo");if(l){const t={filename:"".concat(V,"-").concat(n.reference,".pdf"),data:{...n,amount:Object(p.e)(n.amount),scheduled_deduction:Object(p.e)(n.amount),payer_signature:null===l||void 0===l?void 0:l.data.url,start_date:Object(h.p)(n.start_date.slice(0,10)),end_date:Object(h.p)(n.end_date.slice(0,10))}},a=await q(t),s=await fetch("data:application/pdf;base64, ".concat(a)),c=await s.blob(),i=new File([c],"filename.pdf",{type:"application/pdf"}),r=await I(i,V,"file");return await R(e.token,{direct_debit_id:e.id,mandate_file_url:null===r||void 0===r?void 0:r.data.url})}}catch(l){console.log(l)}return null};return Object(v.jsxs)("div",{className:"card default-card",children:[Object(v.jsx)("div",{className:"mx-0 modal-body loan-modal-body py-4 row",children:Object(v.jsxs)("div",{className:"col-12",children:[Object(v.jsx)("div",{className:"tab-content__header",children:Object(v.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:C("lender-web-app-sign-upload")})}),Object(v.jsx)("div",{className:"signatureHolder",ref:S,children:A?Object(v.jsx)("img",{src:A,alt:"signature",className:"signatureImage"}):Object(v.jsx)(d.a,{penColor:"black",canvasProps:{width:(null===(t=S.current)||void 0===t?void 0:t.clientWidth)||200,height:200,className:"sigCanvas"},ref:T})}),Object(v.jsx)("div",{onClick:()=>{T.current?T.current.clear():(L(void 0),E.current.value="")},className:"btn btn-primary btn-lg px-5 mt-4",children:C("lender-web-app-clear-signature")}),Object(v.jsx)("label",{className:"btn btn-primary btn-lg px-5 mt-2",htmlFor:"signatureFile",children:C("lender-web-app-upload-signature")}),Object(v.jsx)("input",{className:"signatureFile",id:"signatureFile",onChange:H,type:"file",accept:"image/*",ref:E})]})}),Object(v.jsxs)("div",{className:"w-full d-flex justify-content-between modal-footer control",children:[Object(v.jsx)("button",{type:"button",onClick:()=>{"loan"===g?Z():K()},className:"pl-0 btn btn-ghost btn-lg",children:C("lender-web-app-back")}),Object(v.jsx)(c.a,{isLoading:M,onClick:"loan"===g?W:G,className:"px-5 btn btn-primary btn-lg",children:C("lender-web-app-continue")})]})]})}},176:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(1),s=a(4),l=a(19),c=a(6),i=a(13),r=(a(715),a(104)),o=a(2),d=a(7),b=a(0);function u(e){let{onBack:t,onContinue:a,type:u}=e;const{translate:j}=Object(o.useTranslation)(),[p,m]=Object(n.useState)(!1),h=Object(l.a)((e=>e.fetchMandates),s.shallow),[O,v,x]=Object(i.a)((e=>[e.mandateCharge,e.fetchTransactions,e.transactionStatus]),s.shallow);return Object(n.useEffect)((()=>{"idle"===x&&v(),h(),m(!1)}),[]),Object(n.useEffect)((()=>{O||m(!0)}),[O]),"loading"===x?Object(b.jsx)(r.a,{}):Object(b.jsxs)("div",{className:"card default-card",children:[Object(b.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(b.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(b.jsx)("div",{className:"tab-content__header",children:Object(b.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:j("lender-web-app-add-account")})}),Object(b.jsxs)("div",{className:"p-3 rounded-4 bg-light-blue",children:[Object(b.jsx)("h6",{className:"text-app-gray",children:j("lender-web-app-important-note")}),Object(b.jsxs)("div",{className:"d-inline-block",children:[Object(b.jsxs)("ul",{children:[Object(b.jsx)("li",{children:j("lender-web-app-valid-bank")}),Object(b.jsx)("br",{}),Object(b.jsx)("li",{children:j("lender-web-app-more-mandate")}),Object(b.jsx)("br",{}),Object(b.jsx)("li",{children:"The amount on your mandate may be increased to  cover future loans, ensuring you won\u2019t have to create a new mandate. This increase may also cover penalty charges that may arise in the event of a loan default."}),Object(b.jsx)("br",{}),Object(b.jsx)("li",{children:j("lender-web-app-mandate-access")})]}),null!=O&&Object(b.jsx)(d.v,{onChange:()=>m(!p),checked:p,charge:O,type:"mandate"})]})]})]})}),Object(b.jsxs)("div",{className:"loan"===u?"col-12 modal-footer control justify-content-between d-flex":"col-12 modal-footer control d-flex",children:["settings"!==u&&Object(b.jsx)("button",{type:"button",onClick:t,className:"pl-0 btn btn-ghost btn-lg",children:j("lender-web-app-back")}),Object(b.jsx)(c.a,{onClick:a,className:"px-5 btn btn-primary btn-lg",isDisabled:!p,children:j("lender-web-app-continue")})]})]})}},177:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(1),s=a(4),l=a(19),c=a(6),i=a(5),r=a(58),o=(a(173),a(9)),d=a(15),b=a(3),u=a(2),j=a(0);function p(e){var t;let{product:a,setCurrentStep:p,setStep:m,toggleModal:h,type:O,showConfigurableForm:v}=e;const{translate:x}=Object(u.useTranslation)(),f=Object(d.a)((e=>e.emandate_activation_details)),[g,w]=Object(n.useState)(!1),[_,y]=Object(n.useState)(!1),[N,C,k,S]=Object(l.a)((e=>[e.mandateStatus,e.mandate,e.mandates,e.fetchMandateStatus]),s.shallow),[E,T]=Object(d.a)((e=>[e.organization,e.getLendersPreferences]),s.shallow);Object(n.useEffect)((()=>{E||T()}),[E]);const A=Object(n.useCallback)((async()=>{try{return"Bank Approved"===(await S(C.id)).provider_status?(o.toast.success("Your mandate has been approved by the bank and we are running an activation check."),!0):(o.toast.error("Mandate status could not be verified. Please try again."),!1)}catch(e){return console.log(e),!1}}),[]),L=Object(n.useCallback)((async()=>{w(!0);await A()?(p&&("before-loan-request"!==(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||v?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&v?p(i.b.OFFER_SELECTION):p(i.b.AUTHORIZE):p(i.b.CONFIRM)),w(!1)):w(!1)}),[]),M=Object(n.useCallback)((async()=>{w(!0);await A()?(o.toast.success(x("lender-web-app-mandate-sent-bank")),h&&h(),w(!1)):w(!1)}),[]),D=Object(n.useCallback)((()=>{p&&("success"===N&&k.length>=1?p(i.b.MANDATES):p(i.b.ADD_MANDATE))}),[]),F=Object(n.useCallback)((()=>{m&&m(r.a.AMOUNT)}),[]);return Object(j.jsxs)("div",{className:"card default-card",children:[Object(j.jsx)("div",{className:"mx-0 modal-body loan-modal-body py-4 row",children:Object(j.jsxs)("div",{className:"col-12",children:[Object(j.jsxs)("div",{className:"tab-content__header",children:[Object(j.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:"Activate Mandate"}),Object(j.jsxs)("small",{className:"text-app-gray",children:["To be able to use your mandate for loan repayments and other transactions, it needs to be activated. Your mandate would be activated when you transfer ",Object(b.q)((null===f||void 0===f?void 0:f.amount)||50,null===a||void 0===a?void 0:a.currency)," from your ",C.payer_account," at ",C.bank_name," to any of the accounts below"]})]}),Object(j.jsx)("div",{className:"row",children:null===f||void 0===f||null===(t=f.accounts)||void 0===t?void 0:t.map((e=>Object(j.jsx)("div",{className:"col-12",children:Object(j.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-3",children:[null!==e&&void 0!==e&&e.description?Object(j.jsx)("div",{className:"col-12 col-sm-12",children:Object(j.jsx)("p",{className:"f-14px",children:null===e||void 0===e?void 0:e.description})}):null,Object(j.jsx)("div",{className:"row",children:Object(j.jsxs)("div",{className:"col-12 col-sm-12",children:[Object(j.jsx)("p",{className:"text-app-gray",children:"Account Name"}),Object(j.jsx)("p",{children:(null===e||void 0===e?void 0:e["account-name"])||"-"})]})}),Object(j.jsxs)("div",{className:"row mt-3",children:[Object(j.jsxs)("div",{className:"col-12 col-sm-6",children:[Object(j.jsx)("p",{className:"text-app-gray",children:"Bank Name"}),Object(j.jsx)("p",{children:(null===e||void 0===e?void 0:e["bank-name"])||"-"})]}),Object(j.jsxs)("div",{className:"col-12 col-sm-6 ms-auto text-sm-end mt-3 mt-md-0",children:[Object(j.jsx)("p",{className:"text-app-gray",children:"Account Number"}),Object(j.jsx)("p",{children:(null===e||void 0===e?void 0:e["account-number"])||"-"})]})]})]})},null===e||void 0===e?void 0:e["account-number"])))}),Object(j.jsxs)("div",{style:{marginTop:"20px",marginBottom:"20px",display:"flex",alignItems:"flex-start"},children:[Object(j.jsx)("input",{id:"consent",name:"reason",checked:_,onChange:e=>y(e.target.checked),style:{marginTop:"5px"},type:"checkbox"}),Object(j.jsx)("label",{htmlFor:"consent",style:{marginLeft:"10px",color:"black"},children:"I confirm that I have transferred the amount"})]})]})}),Object(j.jsxs)("div",{className:"w-full d-flex justify-content-between modal-footer control",children:[Object(j.jsx)("button",{type:"button",onClick:()=>{"loan"===O?D():F()},className:"pl-0 btn btn-ghost btn-lg",children:x("lender-web-app-back")}),Object(j.jsx)(c.a,{isLoading:g,isDisabled:!_,onClick:"loan"===O?L:M,className:"px-5 btn btn-primary btn-lg",children:x("lender-web-app-continue")})]})]})}},178:function(e,t,a){"use strict";var n=a(1);t.a=()=>{const[e,t]=Object(n.useState)(!1),[a,s]=Object(n.useState)(!1),[l,c]=Object(n.useState)(!1),[i,r]=Object(n.useState)(!1),o={length:e,upperCase:a,lowerCase:l,char:i};return{validate:e=>{e.length>7?t(!0):t(!1),/[A-Z]/.test(e)?s(!0):s(!1),/[a-z]/.test(e)?c(!0):c(!1),/[=!@#&$%]/.test(e)?r(!0):r(!1)},values:o,validated:Object.values(o).every((e=>e))}}},18:function(e,t,a){"use strict";a.d(t,"x",(function(){return p})),a.d(t,"u",(function(){return m})),a.d(t,"v",(function(){return h})),a.d(t,"m",(function(){return v})),a.d(t,"z",(function(){return x})),a.d(t,"k",(function(){return f})),a.d(t,"j",(function(){return g})),a.d(t,"g",(function(){return w})),a.d(t,"s",(function(){return _})),a.d(t,"w",(function(){return y})),a.d(t,"q",(function(){return N})),a.d(t,"y",(function(){return C})),a.d(t,"o",(function(){return k})),a.d(t,"d",(function(){return S})),a.d(t,"c",(function(){return E})),a.d(t,"p",(function(){return T})),a.d(t,"f",(function(){return A})),a.d(t,"b",(function(){return L})),a.d(t,"e",(function(){return M})),a.d(t,"a",(function(){return D})),a.d(t,"h",(function(){return F})),a.d(t,"l",(function(){return I})),a.d(t,"n",(function(){return R})),a.d(t,"r",(function(){return P})),a.d(t,"t",(function(){return q})),a.d(t,"i",(function(){return U}));var n=a(12),s=a(67),l=a(72),c=a(118),i=a(439),r=a(1),o=a(9),d=a(21),b=a(220),u=a.n(b),j=a(2);const p=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return(null===t||void 0===t?void 0:t.flat(1/0)).reduce(((e,t)=>+e+t),0)},m=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const a=t.map((e=>e.toUpperCase()));return null===e||void 0===e?void 0:e.filter((e=>{const t=s.a.statusPill(e.status.status);return(null===a||void 0===a?void 0:a.findIndex((e=>e.toLowerCase()===t.toLowerCase())))>-1}))}},h=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const a=t.map((e=>e.toUpperCase()));return null===e||void 0===e?void 0:e.filter((e=>{const t=l.a.statusPill(e.is_matured);return(null===a||void 0===a?void 0:a.findIndex((e=>e.toLowerCase()===t.toLowerCase())))>-1}))}},O={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};function v(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise(((t,a)=>{if(!e){var n;const e=JSON.parse(null!==(n=localStorage.getItem("coord"))&&void 0!==n?n:"{}");if(null!==e&&void 0!==e&&e.longitude&&null!==e&&void 0!==e&&e.latitude)return t(e)}navigator.geolocation.getCurrentPosition((e=>{const{latitude:a,longitude:n,altitude:s,accuracy:l}=e.coords,c={latitude:a,longitude:n,altitude:s,accuracy:l};localStorage.setItem("coord",JSON.stringify(c)),t(e.coords)}),a,O)}))}function x(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];const s=null===t||void 0===t?void 0:t.flat(1/0),l=Object(n.f)(),i=Object(r.useMemo)((()=>Object(c.a)(s,l.values)),[l,s]),o=Object(r.useMemo)((()=>Object(c.a)(s,l.errors)),[l,s]);return{isValid:Object(r.useMemo)((()=>{let e=!0;for(const t of s){const a=l.getFieldMeta(t);e=e&&!a.error}return e}),[s,l]),values:i,errors:o}}const f=e=>null===e||void 0===e?void 0:e.reduce(((e,t)=>(null===t||void 0===t?void 0:t.amount_due)+e),0),g=e=>null===e||void 0===e?void 0:e.reduce(((e,t)=>(null===t||void 0===t?void 0:t.interest)+e),0),w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Array.from({length:e})},_=e=>"Non-Individual"===(null===e||void 0===e?void 0:e.customer_type),y={business_name:"",business_type:"",industry:"",date_of_incorporation:"",business_registered:!1,purpose:"Business",address:"",country:"Nigeria",state:"",city:"",office_rented:!1,no_of_outlets:null,no_of_employees:null,rc_number:null,tin:null},N=e=>{const t=Object(i.a)([null===e||void 0===e?void 0:e.min_tenor_period,null===e||void 0===e?void 0:e.max_tenor_period]);return(null===t||void 0===t?void 0:t.filter(Boolean).length)>0?t:["days","weeks","months","years"]};function C(){const e=Object(d.i)();return{goTo:Object(r.useCallback)((t=>{e.push(t)}),[e])}}const k=(e,t)=>{const a={...e};null!==a&&void 0!==a&&a.documents&&null!==a&&void 0!==a&&a.documents.length||(a.documents=[1]);const n={missing:!0};return null!==a&&void 0!==a&&a.documents&&null!==a&&void 0!==a&&a.documents.length?(t.some((e=>{var t,s;return!(!(null!==a&&void 0!==a&&null!==(t=a.documents)&&void 0!==t&&t.includes(null===(s=e.userData)||void 0===s?void 0:s.type_id)||e.required||null===e||void 0===e)&&e.userData)&&((e,t)=>{var a;const n=null===(a=e.userData)||void 0===a?void 0:a.status,s=n?n.toLowerCase():"",l={archived:"is archived",rejected:"has been rejected"};return t.header="Upload your ".concat(e.name),t.doc=e,["archived","rejected"].includes(s)?(t.description="Your ".concat(e.name," ").concat(l[s],". Kindly submit a valid document for your loan to be processed"),!0):e.userData?void 0:(t.description="Kindly submit a valid ".concat(e.name," for your loan to be processed"),!0)})(e,n)})),n.description||(n.missing=!1),n):{missing:!1}},S=async e=>{const t=await Object(j.translate)("lender-web-app-copied-clipboard");try{var a;if(window.ReactNativeWebView)null===(a=window.ReactNativeWebView)||void 0===a||a.postMessage(JSON.stringify({method:"copy",arguments:{text:e},callback:""}));else await navigator.clipboard.writeText(e);o.toast.success(t)}catch(n){const e=await Object(j.translate)("lender-web-app-error-message",{err:n});o.toast.error(e,{id:"referral_link_copy"})}},E=async e=>{let{title:t,text:a,url:n}=e;var s;window.ReactNativeWebView?null===(s=window.ReactNativeWebView)||void 0===s||s.postMessage(JSON.stringify({method:"share",arguments:{title:t,text:a,url:n},callback:""})):await navigator.share({title:t,text:a,url:n})};function T(e){var t;const a=/^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/;return null===(t=e.replace(" ","").split(","))||void 0===t?void 0:t.filter((e=>a.test(e)))}const A=async(e,t,a)=>{const n=await fetch(e,{method:"POST",headers:{Accept:"application/octet-stream",accesskey:Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}).REACT_APP_PDF_SERVICE_API_ACCESS_KEY,"Content-Type":"application/json","x-api-key":"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi"},body:JSON.stringify(t)}).then((e=>e.blob())).catch((e=>{o.toast.error(e)}));if(!n)return;const s=URL.createObjectURL(n),l=document.createElement("a");l.href=s,l.download=a,l.click()},L=e=>{if(void 0===e)return;return(e=e.replaceAll("_"," ")).split(" ").map((e=>u()(e))).join(" ")},M=e=>new Intl.NumberFormat("en-NG",{style:"currency",currency:"NGN"}).format(e),D=e=>{const t=new FileReader;return t.readAsDataURL(e),new Promise((e=>{t.onloadend=()=>{e(t.result)}}))},F=[{label:"Months",value:"months",frequency:"Monthly"},{label:"Weeks",value:"weeks",frequency:"Weekly"},{label:"Days",value:"days",frequency:"Daily"}],I=e=>"months"===e?30:"weeks"===e?7:1,R=(e,t)=>{const a=+e.requested_amount,n=a+a*(t/100),s=null===F||void 0===F?void 0:F.find((t=>t.value===e.proposed_tenor_period)),l=+e.proposed_tenor,c=null===s||void 0===s?void 0:s.value,i=l*I(c);let r=null;return e.proposed_payday&&(r=new Date(e.proposed_payday),r.setDate(r.getDate()+i)),{repayment:n,maturity_date:r,loan_days:i}},P=(e,t,a)=>{let n=0;return e.applicable_to&&e.percentage?(n="principal"===e.applicable_to.toLowerCase()?e.percentage/100*t:e.percentage/100*t+a,e.amount&&(n+=e.amount)):e.fixed&&(n=e.amount),e.min_amount&&n<e.min_amount?n=e.min_amount:e.max_amount&&n>e.max_amount&&(n=e.max_amount),n},q=(e,t,a)=>{let n=0;return e.applicable_to&&(n="principal"===e.applicable_to.toLowerCase()?e.percentage/100*t:e.percentage/100*t+a),(e.min_amount&&n<e.min_amount||e.max_amount&&n>e.max_amount)&&(n=e.min_amount),n},U=(e,t,a)=>{var n,s;return null!==(n=null===e||void 0===e||null===(s=e.reduce)||void 0===s?void 0:s.call(e,((e,n)=>{var s,l;let c=0;switch((null===(s=n.type)||void 0===s||null===(l=s.trim())||void 0===l?void 0:l.toLowerCase())||"flat"){case"percentage":c=q(n,t,a);break;case"hybrid":c+=P(n,t,a);break;default:c=n.amount||0}return e+c}),0))&&void 0!==n?n:0}},180:function(e,t,a){"use strict";a.d(t,"a",(function(){return j}));var n=a(1),s=a(15),l=a.p+"static/media/fr.78df1f5f.svg",c=a.p+"static/media/gb.516897fd.svg",i=a.p+"static/media/ke.0aab7961.svg",r=a.p+"static/media/rw.3b2c0ac2.svg",o=a(13),d=a(117),b=a(4),u=a(0);function j(){const{country:e}=s.a.getState(),t=Object(n.useMemo)((()=>"CAN"===e?[{name:"English",code:"en",flag:c},{name:"French",code:"fr-FR",flag:l}]:[{name:"English",code:"en",flag:c},{name:"French",code:"fr-FR",flag:l},{name:"kinyarwanda",code:"rw",flag:r}]),[e]),[a,j,p]=Object(s.a)((e=>[e.language,e.languageName,e.setLanguage]),b.shallow),[m,h]=Object(o.a)((e=>[e.showLanguageDrop,e.setShowLanguageDrop]),b.shallow),O=Object(n.useMemo)((()=>"fr-FR"===a?l:"sw"===a?i:"rw"===a?r:c),[a]);return Object(u.jsxs)("div",{className:"language-container",onClick:e=>{e.stopPropagation(),h(!m)},children:[Object(u.jsx)("img",{className:"flag",src:O,alt:"".concat(j," Flag")}),Object(u.jsx)("p",{children:j}),Object(u.jsx)("div",{className:"language-icon",children:Object(u.jsx)("svg",{id:"drop-icon",width:"8",height:"5",children:Object(u.jsx)("use",{xlinkHref:"/icon-sprite.svg#drop-icon"})})}),m&&Object(u.jsx)("div",{className:"language-drop-container",children:t.map((e=>Object(u.jsxs)("p",{className:"language-drop-item",onClick:()=>(e=>{p(e.code,e.name),h(!1);try{Object(d.a)(),window.location.reload()}catch(t){console.log(t)}})(e),children:[Object(u.jsx)("img",{className:"flag",src:e.flag,alt:"".concat(e.name," Flag")}),e.name]},e.name)))})]})}},181:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return s}));const n=e=>(null===e||void 0===e?void 0:e.length)>36?"".concat(e.slice(0,36),"...'"):null!==e&&void 0!==e?e:"",s=e=>{var t;return null!==(t={audio:".mp3, .m4a, .flac, .wav, .mkv, .aac, .ogg, audio/mpeg",video:".mp4, .mov, .avi, .wmv, .flv, .mkv",image:"image/jpeg, .png, .jpg, .pdf, .gif, .svg, .webp, .bmp, .tiff"}[e])&&void 0!==t?t:"image/jpeg, .png, .jpg, .pdf, .doc, .docx"}},19:function(e,t,a){"use strict";var n=a(53),s=a(61),l=a(33),c=a(16),i=a(408),r=a(11),o=a(10),d=a(9),b=a.n(d),u=a(118),j=a(32),p=a(13),m=a(2);Object(l.b)();const h={loansStatus:"idle",singleLoanStatus:"idle",loanBreakdownStatus:"idle",bankStatus:"idle",mandateStatus:"idle",loansRepayment:"idle",loanExtensionStatus:"idle",loansMessage:"",singleLoanMessage:"",ussdStatus:"idle",ussd:[],loanOptionsStatus:"idle",loanOptions:[],offers:[],selectedOffer:null,offersRequestStatus:"idle",isUserEligle:!1,eligibilityMessage:"",loanRequestData:{},loanCompletionResult:null,loanCompletionStatus:"idle",productLociEligibilityStatus:"idle",banks:[],mandateVerification:{},mandates:[],errorMessage:"",offerLetter:null,offerLetterStatus:"idle",signOfferLetterStatus:"idle",myLoans:[],myDraftLoans:[],singleLoan:null,request_id:null,mandateDetails:{},notLinked:!1,loanInterest:0,loanProfiles:{Individual:null,"Non-Individual":null},businessProfileStatus:"idle",businessProfiles:[],products:[],loanModal:!1,loanProductsStatus:"idle",loanProductsMessage:"",additionalPagesData:{},currentPage:0,savedLoanDetails:{},additionalData:{},bankDetails:{},bankRecords:{},isRemita:!1,isRemitaValid:!1},O=Object(n.create)()(Object(s.devtools)(Object(s.persist)(((e,t)=>({...h,updateSavedLoanDetails:t=>{e((e=>({savedLoanDetails:{...e.savedLoanDetails,...t}})))},addPageData:a=>{const n=t().additionalPagesData;e({additionalPagesData:{...n,...a}})},setRequestId:t=>{e({request_id:t})},fetchPageData:e=>t().additionalData[e],setCurrentPage:t=>{e({currentPage:t})},getOptionsByKey:e=>{const a=t().loanOptions,n=null===a||void 0===a?void 0:a.find((t=>t.key===e));return n?n.option:[]},setIsRemita:t=>{e({isRemita:t})},setIsRemitaValid:t=>{e({isRemitaValid:t})},openLoanModal:t=>{e({loanModal:!0}),Object(j.a)({event_name:j.b.LOAN_APPLY_NEW,loan_id:t})},closeLoanModal:()=>{e({loanModal:!1,productLociEligibilityStatus:"idle"})},setBankDetails:async t=>{e({bankDetails:t})},setErrorMessage:async t=>{e({errorMessage:t})},setLoanInterest:t=>{e({loanInterest:t})},fetchBankRecords:async()=>{try{const{banks:a}=t();e({bankStatus:"loading"});let n={data:[]};const s=await Object(r.a)(o.l,"get");s.data.length&&!a.length&&(n=await Object(r.a)(o.h,"get")),e({bankRecords:s.data,banks:n.data,bankStatus:"success"})}catch(n){var a;b.a.error(null!==(a=null===n||void 0===n?void 0:n.message)&&void 0!==a?a:await Object(m.translate)("lender-web-app-default-error")),e({bankStatus:"error"})}},fetchOfferLetter:async()=>{const{selectedOffer:a}=t();e({offerLetterStatus:"loading"});try{const t=await Object(r.a)(Object(o.z)((null===a||void 0===a?void 0:a.loan_token)||""),"get");e({offerLetter:t,offerLetterStatus:"success"})}catch(s){var n;b.a.error(null!==(n=null===s||void 0===s?void 0:s.message)&&void 0!==n?n:await Object(m.translate)("lender-web-app-error-getting-offer")),e({offerLetterStatus:"error"})}},getLoanRepaymentBreakdown:async t=>{e({loanBreakdownStatus:"loading"});try{const a=await Object(r.a)(o.xb,"post",t);return e({loanBreakdownStatus:"success"}),a.data}catch(a){e({loanBreakdownStatus:"error"})}},signOfferLetter:async a=>{const{selectedOffer:n}=t();e({signOfferLetterStatus:"loading"});try{await Object(r.a)(o.dc,"post",{name:a,token:(null===n||void 0===n?void 0:n.loan_token)||""}),e({signOfferLetterStatus:"success"})}catch(l){var s;b.a.error("string"===typeof l?l:null!==(s=null===l||void 0===l?void 0:l.message)&&void 0!==s?s:await Object(m.translate)("lender-web-app-default-error")),e({signOfferLetterStatus:"error"})}},postProductEligibilityCheck:async a=>{let{product_id:n}=a;const{setErrorMessage:s}=t();e({productLociEligibilityStatus:"loading"});try{var l,c;const t=await Object(r.a)(o.zb,"post",{product_id:n});null!==(l=t.data)&&void 0!==l&&l.ok||null!==(c=t.data)&&void 0!==c&&c.whitelisted?e({productLociEligibilityStatus:"success"}):(e({productLociEligibilityStatus:"failed"}),s(t.message))}catch(d){e({productLociEligibilityStatus:"failed"});let t="";var i;if("string"===typeof d)t=d;else t=null!==(i=null===d||void 0===d?void 0:d.message)&&void 0!==i?i:await Object(m.translate)("lender-web-app-default-error");s(t)}},setNotLinked:t=>{e({notLinked:t})},uploadPhoto:async(t,a,n)=>{const s=new FormData;s.append("file",t,"photo"===n?"user-signature.png":"mandate.pdf");try{const e=await Object(r.a)("photo"===n?Object(o.Pb)(a):Object(o.Ob)(a),"post",s);return Object(j.a)({event_name:j.b.UPLOAD_SIGNATURE}),e}catch(c){var l;b.a.error("string"===typeof c?c:null!==(l=null===c||void 0===c?void 0:c.message)&&void 0!==l?l:await Object(m.translate)("lender-web-app-default-error")),e({signOfferLetterStatus:"error"})}},requestLoanExtension:async(t,a)=>{e({loanExtensionStatus:"loading"});try{const n=await Object(r.a)(Object(o.Gb)(t),"post",a);if(n.data)return e({loanExtensionStatus:"success"}),n.data;b.a.error((null===n||void 0===n?void 0:n.message)||await Object(m.translate)("lender-web-app-unknown-error"))}catch(n){e({loanExtensionStatus:"error"}),b.a.error(await Object(m.translate)("lender-web-app-default-error"))}},requestLoanScheduleExtension:async(t,a)=>{e({loanExtensionStatus:"loading"});try{const n=await Object(r.a)(Object(o.Hb)(t),"post",a);if(n.data)return e({loanExtensionStatus:"success"}),n.data;b.a.error((null===n||void 0===n?void 0:n.message)||await Object(m.translate)("lender-web-app-unknown-error"))}catch(n){e({loanExtensionStatus:"error"}),b.a.error(await Object(m.translate)("lender-web-app-default-error"))}},getMandatePDF:async e=>{try{const t=await fetch("".concat("https://vigil.lendsqr.com/media-generator","/pdf/nibss-easypay-mandate"),{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/octet-stream",accesskey:"7mvkUcJH4l45AJr9AWm1rcjJhLUFaspk","Content-Type":"application/json","x-api-key":"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi"}}),a=await t.arrayBuffer(),n=new Uint8Array(a);return i.a.fromUint8Array(n)}catch(a){var t;b.a.error("string"===typeof a?a:null!==(t=null===a||void 0===a?void 0:a.message)&&void 0!==t?t:await Object(m.translate)("lender-web-app-default-error"))}},generateMandate:async(e,t)=>{try{const a=await Object(r.a)("".concat(o.ub,"?suppress_notification=true"),"post",{...t,token:e});return Object(j.a)({event_name:j.b.GENERATE_MANDATE}),a}catch(n){var a;b.a.error("string"===typeof n?n:null!==(a=null===n||void 0===n?void 0:n.message)&&void 0!==a?a:await Object(m.translate)("lender-web-app-default-error"))}},fetchBanks:async()=>{try{const{banks:a}=t();if(e({bankStatus:"loading"}),a.length)return void e({bankStatus:"success"});const n=await Object(r.a)(o.h,"get");e({banks:n.data,bankStatus:"success"})}catch(n){var a;b.a.error(null!==(a=null===n||void 0===n?void 0:n.message)&&void 0!==a?a:await Object(m.translate)("lender-web-app-default-error")),e({bankStatus:"error"})}},fetchMandates:async()=>{e({mandateStatus:"loading"});try{const{banks:a}=t();let n={data:a};const s=await Object(r.a)(o.V,"get");s.data.length&&!a.length&&(n=await Object(r.a)(o.h,"get")),e({mandates:s.data,banks:n.data,mandateStatus:"success"})}catch(n){var a;b.a.error(null!==(a=null===n||void 0===n?void 0:n.message)&&void 0!==a?a:await Object(m.translate)("lender-web-app-default-error")),e({mandateStatus:"error"})}},fetchSingleLoan:async t=>{try{e({singleLoanStatus:"loading"});const a=await Object(r.a)(Object(o.Q)(t),"get"),n=null===a||void 0===a?void 0:a.data;e({singleLoanStatus:"success",singleLoan:n,singleLoanMessage:null===a||void 0===a?void 0:a.message})}catch(a){e({singleLoanStatus:"error",singleLoanMessage:null===a||void 0===a?void 0:a.message})}},fetchLoans:async()=>{try{e({loansStatus:"loading"});const a=await Object(r.a)(o.w,"get"),n="success",s=a.data,l=null===a||void 0===a?void 0:a.message,c={...t().loanProfiles,Individual:null,"Non-Individual":null};for(const e of s){const t=e.loan_profile?JSON.parse(JSON.stringify(e.loan_profile)):JSON.parse(JSON.stringify(e.loan_profile_business)),a=e.customer_type;t&&a&&(delete t.id,c[a]=t)}e({loansStatus:n,myLoans:s,loansMessage:l,loanProfiles:c})}catch(a){e({loansStatus:"error",loansMessage:null===a||void 0===a?void 0:a.message})}},fetchDraftLoans:async()=>{try{const t=(await Object(r.a)(o.t,"get")).data.filter((e=>1!==e.cancellation_status));e({myDraftLoans:t})}catch(t){e({loansStatus:"error",loansMessage:null===t||void 0===t?void 0:t.message})}},fetchProducts:async()=>{e({productsStatus:"loading"});try{const t=await Object(r.a)(o.k,"get"),a="success",n=[],s=null===t||void 0===t?void 0:t.message;if(t.data.length)for(const e of t.data){(null===e||void 0===e?void 0:e.attributes.channels.split(",")).includes("Web")&&n.push({...e,attributes:{...null===e||void 0===e?void 0:e.attributes}})}e({products:n,productsStatus:a,productsMessage:s})}catch(t){e({productsStatus:"error",productsMessage:null===t||void 0===t?void 0:t.message})}},fetchLoanOptions:async()=>{const{loanOptions:a}=t();if(!(a.length>0))try{e({loanOptionsStatus:"loading"});const t=await Object(r.a)(o.v,"get"),a="success",n=t.data,s=null===t||void 0===t?void 0:t.message;e({loanOptionsStatus:a,loanOptions:n,loanOptionsMessage:s})}catch(n){e({loanOptionsStatus:"error",loanOptionsMessage:null===n||void 0===n?void 0:n.message})}},fetchBusinessProfiles:async()=>{const a=t();if(!(a.businessProfiles.length>0))try{e({businessProfileStatus:"loading"});const t=await Object(r.a)(o.p,"get"),n=Object(l.a)(a,(e=>{e.businessProfileStatus="success",e.businessProfiles=t.data}));e(n)}catch(n){e({businessProfileStatus:"error"})}},fetchUssd:async t=>{e({ussdStatus:"loading"});try{const{data:a}=await Object(r.a)(Object(o.S)("loan"),"post",{amount:t});e({ussdStatus:"success",ussd:a})}catch(n){var a;b.a.error(null!==(a=n.message)&&void 0!==a?a:await Object(m.translate)("lender-web-app-default-error"))}},setOfferLoading:async t=>{e({offersRequestStatus:t})},getLoanOffers:async(a,n)=>{const s=t();e({offersRequestStatus:"loading"});try{const[t,c]=v(a,n);t.data_provider_record_id||delete t.data_provider_record_id;const i=await Object(r.a)(c,"post",t),o=Object(l.a)(s,(e=>{e.offersRequestStatus="success",e.eligibilityMessage=null===i||void 0===i?void 0:i.message,e.offers=i.data,e.isUserEligle=i.status,e.loanRequestData.customer_type=n?"Non-Individual":"Individual"}));return e(o),{message:null===i||void 0===i?void 0:i.message,status:i.status}}catch(c){const t=null!==c&&void 0!==c&&c.message?null===c||void 0===c?void 0:c.message:"There was a problem submitting your request",a=Object(l.a)(s,(e=>{e.offersRequestStatus="error",e.eligibilityMessage=t,e.isUserEligle=!1}));return e(a),{message:t,status:"error"}}},chooseOffer:a=>{const{offers:n,loanRequestData:s,selectedOffer:c}=t(),i=null===n||void 0===n?void 0:n.find((e=>e.loan_token===a)),r=Object(l.a)({selectedOffer:c,loanRequestData:s},(e=>{e.selectedOffer=i,e.loanRequestData.token=a}));e(r),Object(j.a)({event_name:j.b.LOAN_TAKE_THIS_OFFER,loan_id:i.id})},addOffer:a=>{const{loanRequestData:n,selectedOffer:s}=t(),c=Object(l.a)({selectedOffer:s,loanRequestData:n},(e=>{e.selectedOffer=a,e.loanRequestData.token=a.loan_token}));e(c),Object(j.a)({event_name:j.b.LOAN_TAKE_THIS_OFFER,loan_id:a.id})},async getLoanPaymentSchedules(t){try{e({loansRepayment:"loading"});const a=await Object(r.a)(o.Ab,"post",{token:t});return e({loansRepaymentData:a.data}),e({loansRepayment:"success"}),!0}catch(a){e({loansRepayment:"error"}),b.a.error(await Object(m.translate)("lender-web-app-default-error"))}},setLoanRepaymentCard(a){const{loanRequestData:n}=t(),s=Object(l.a)({loanRequestData:n},(e=>{e.loanRequestData.card_id=a}));e(s)},setMandate(a){const{loanRequestData:n}=t(),s=Object(l.a)({loanRequestData:n},(e=>{e.loanRequestData.mandate_id=a.id}));e(s)},setMobileBank(a){const{loanRequestData:n}=t(),s=Object(l.a)({loanRequestData:n},(e=>{e.loanRequestData.bank_account_id=a.id}));e(s)},createMandate:async(a,n,s,l)=>{const{profile:i,profileStatus:d}=p.a.getState();if((null===i||void 0===i||!i.address)&&"success"===d)return b.a.error(await Object(m.translate)("lender-web-app-update-address")),void(l?l.push(c.a.settings.profile):window.location.href=c.a.settings.profile);e({mandateStatus:"loading"});const{selectedOffer:u,requestOTP:j,setMandate:h,bankDetails:O}=t();try{var v;null===n&&(n=u.amount_due,s=u.due_date);const t={account_number:O.account_number,bank_code:O.bank_code,amount:n,start_date:s},l="nibss-easypay"===a?"".concat(o.V,"?suppress_notification=true"):o.V,c=await Object(r.a)(l,"post",t);return h(c.data),"nibss-easypay"!==(null===(v=c.data)||void 0===v?void 0:v.mandate_type.toLowerCase())&&await j(),e({mandateStatus:"success",mandate:c.data}),c.data}catch(f){var x;console.log(f,"ssdsd"),e({mandateStatus:"error"}),b.a.error(null!==(x=f.message)&&void 0!==x?x:await Object(m.translate)("lender-web-app-default-error"))}},fetchMandateDetails:async t=>{try{const a=await Object(r.a)(o.X,"post",{token:t});return e({mandateDetails:null===a||void 0===a?void 0:a.data}),a.data}catch(a){console.log(a)}},fetchMandateStatus:async t=>{try{const a=await Object(r.a)(Object(o.g)(t),"get",{});return e({mandateDetails:null===a||void 0===a?void 0:a.data}),a.data}catch(a){console.log(a)}},clearLoanRequestData(){const{loanRequestData:a}=t(),n=Object(l.a)({loanRequestData:a},(e=>{e.loanRequestData.card_id=void 0,e.loanRequestData.mandate_id=void 0}));e(n)},requestOTP:async()=>{e({mandateStatus:"loading"});const{mandate:a}=t();try{const t={mandate_id:a.id},n=await Object(r.a)(o.bc,"post",t);e({mandateStatus:"success",mandateVerification:n.data})}catch(n){e({mandateStatus:"error"}),b.a.error(await Object(m.translate)("lender-web-app-default-error"))}},verifyMandateOtp:async t=>{e({mandateVerifyStatus:"loading"});try{const a=await Object(r.a)(o.gc,"post",t);if(a.data)return e({mandateVerifyStatus:"success",mandate:a.data}),a.data;b.a.error((null===a||void 0===a?void 0:a.message)||await Object(m.translate)("lender-web-app-unknown-error"))}catch(a){e({mandateVerifyStatus:"error"}),b.a.error(await Object(m.translate)("lender-web-app-default-error"))}},setLoanGuarantor(a){const{loanRequestData:n}=t(),s=Object(l.a)({loanRequestData:n},(e=>{e.loanRequestData.guarantor_id=a}));e(s)},completeLoanApplication:async t=>{try{var a;e({loanCompletionStatus:"loading"});const n=await Object(r.a)(o.pb,"post",{...t,channel:"web"});e({loanCompletionResult:n.data}),e({loanCompletionStatus:"success"}),Object(j.a)({event_name:j.b.LOAN_SUBMISSION_SUCCESSFUL,loan_id:null===(a=n.data)||void 0===a?void 0:a.id})}catch(s){var n;const a=/not available/.test(null===s||void 0===s?void 0:s.message)?"not-available":"error";if(e({loanCompletionStatus:a}),Object(j.a)({event_name:j.b.LOAN_SUBMISSION_FAILED,loan_id:null===t||void 0===t?void 0:t.id}),"Kindly choose or add a card that is tied to your bank account."===s.message)return s.message;b.a.error(null!==(n=null===s||void 0===s?void 0:s.message)&&void 0!==n?n:await Object(m.translate)("lender-web-app-default-error"))}},resetLoan:()=>{e({loanCompletionStatus:"idle",loanRequestData:{},productLociEligibilityStatus:"idle"})},resetCard:()=>{const a=JSON.parse(JSON.stringify(t().loanRequestData));a.card_id=null,e({loanRequestData:a})},reset:()=>{e(h)},resetStatus:()=>{e({loanCompletionStatus:"idle"})}})),{name:"app.loans"})));t.a=O;const v=function(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){const t=["proposed_payday","proposed_tenor","proposed_tenor_period","requested_amount","gender","marital_status","no_of_dependent","type_of_residence","educational_attainment","employment_status","employment_category","sector_of_employment","monthly_net_income","current_employer","purpose","work_email","address","work_start_date","longitude","latitude","product_id","data_provider_record_id","attributes"];return[Object(u.a)(t,e),o.yb]}const t=Object(u.a)(["no_of_dependent","type_of_residence","address","educational_attainment","employment_status","sector_of_employment","monthly_net_income","current_employer","employment_category","work_email","proposed_payday","proposed_tenor","proposed_tenor_period","work_start_date","purpose","requested_amount","gender","marital_status","longitude","latitude","business_name","business_type","industry","business_registered","tin","office_rented","no_of_outlets","no_of_employees","city","state","country","date_of_incorporation","rc_number","product_id","attributes"],e);t.business_registered=Boolean(t.business_registered),t.office_rented=Boolean(t.office_rented),t.business_registered||(delete t.date_of_incorporation,delete t.rc_number,delete t.tin);return[t,o.hb]}},198:function(e,t,a){"use strict";a.d(t,"b",(function(){return m})),a.d(t,"a",(function(){return h}));var n=a(1),s=a(11),l=a(10),c=a(9),i=a.n(c),r=a(6),o=a(25),d=a(32),b=a(15),u=a(2),j=a(4),p=a(0);function m(e){let{status:t,id:a,onSuccess:s}=e;const[l,c]=Object(n.useState)(!1),i=Object(n.useCallback)((()=>{"verified"!==(null===t||void 0===t?void 0:t.toLowerCase())&&c((e=>!e))}),[t]),{translate:r}=Object(u.useTranslation)();return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(h,{id:a,show:l,close:i,onSuccess:s,abandoned:!1}),Object(p.jsx)("button",{type:"submit",onClick:i,className:"btn btn-outline-danger","data-bs-toggle":"modal","data-bs-target":"#cancelLoan",children:r("lender-web-app-cancel-loan")})]})}function h(e){let{show:t,close:a,onSuccess:c,id:m,abandoned:h=!1}=e;const[O,v]=Object(n.useState)(),[x,f]=Object(n.useState)(""),[g,w]=Object(n.useState)("idle"),{translate:_}=Object(u.useTranslation)(),y=Object(b.a)((e=>e.loan_cancelation_reason),j.shallow),N=Object(n.useMemo)((()=>h?y:[_("lender-web-app-changed-mind"),_("lender-web-app-not-friendly"),_("lender-web-app-rather-not")]),[_]),C=_("lender-web-app-loan-application-cancelled"),k=Object(n.useCallback)((async e=>{e.preventDefault();let t=O;"other"===O&&(t=x);try{w("loading");const e=h?"".concat(l.kb,"?loan_profile_id=").concat(m):Object(l.q)(m);await Object(s.a)(e,"post",{reason:t}),w("success"),i.a.success(C),Object(d.a)({event_name:d.b.CANCEL_ABANDONED_LOAN}),"function"===typeof c&&(a(),c())}catch(n){console.dir(n)}}),[x,O,a,c]);return Object(p.jsxs)(o.a,{show:t,close:a,description:_("lender-web-app-cancel-loan"),isUpload:!1,children:[Object(p.jsxs)("div",{className:"modal-body",children:[Object(p.jsx)("p",{className:"modal-body__p",children:_("lender-web-app-why-declining")}),Object(p.jsxs)("form",{method:"post",onSubmit:k,className:"modal-form",children:[null===N||void 0===N?void 0:N.filter((e=>""!==e)).map((e=>Object(p.jsx)("div",{className:"form-group",children:Object(p.jsxs)("div",{className:"form-check",children:[Object(p.jsx)("input",{id:e,className:"form-check-input",name:"reason",checked:O===e,onChange:()=>{f(""),v(e)},type:"checkbox"}),Object(p.jsx)("label",{htmlFor:e,className:"form-check-label",children:e})]})},e))),Object(p.jsxs)("div",{className:"form-group",children:[Object(p.jsxs)("div",{className:"form-check",children:[Object(p.jsx)("input",{className:"form-check-input",id:"other",name:"reason",checked:"other"===O,onChange:()=>v("other"),type:"checkbox"}),Object(p.jsx)("label",{htmlFor:"other",className:"form-check-label",children:_("lender-web-app-other-reasons")})]}),Object(p.jsx)("textarea",{disabled:"other"!==O,value:x,onChange:e=>f(e.target.value),className:"form-control",style:{marginTop:"10px"}})]}),Object(p.jsx)("div",{className:"text-center",style:{marginTop:"20px"},children:Object(p.jsx)("small",{className:"error-message text-danger",hidden:!0,children:null})})]})]}),Object(p.jsxs)("div",{className:"modal-footer",children:[Object(p.jsx)("button",{type:"button",onClick:a,className:"btn btn-gray",children:_("lender-web-app-cancel")}),Object(p.jsx)(r.a,{isDisabled:!("other"===O&&x.length>0||"other"!==O&&""!==O),onClick:k,isLoading:"loading"===g,type:"submit",className:"btn btn-primary",children:_("lender-web-app-submit")})]})]},m)}},218:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(12),s=a(0);const l=e=>{let{label:t,className:a,info:l,placeholder:c,name:i,inputProps:r,type:o="text"}=e;const[d,b]=Object(n.d)(i),u=[a,"form-control rounded-5 px-3 py-3 f-14px",b.touched&&b.error?"is-invalid":""].join(" ");return Object(s.jsxs)("div",{className:"form-group",children:[Object(s.jsx)("label",{className:"mb-1",htmlFor:t.split(" ").join(""),children:t}),Object(s.jsx)("input",{className:u,type:o,id:t.split(" ").join(""),placeholder:c,...d,...r}),l,b.touched&&b.error&&Object(s.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:b.touched&&b.error?b.error:null})]})}},227:function(e,t,a){"use strict";var n=a(1),s=(a(739),a(81),a(15)),l=a(12),c=a(4),i=a(9),r=a.n(i),o=a(0);t.a=function(e){let{field:t,callback:a}=e;const[i,d]=Object(n.useState)("Verify Smile Id"),{setFieldValue:b}=Object(l.f)(),[u,j,p,m]=Object(s.a)((e=>[e.getVerificationDocument,e.organization,e.logo_url,e.privacy_url]),c.shallow),h=e=>{var n;const s=sessionStorage.getItem("primary_color");SmileIdentity({token:null===e||void 0===e?void 0:e.token,product:null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.product,callback_url:null===e||void 0===e?void 0:e.callback_url,environment:"live",job_id:null===e||void 0===e?void 0:e.job_id,id_selection:{RW:["IDENTITY_CARD"]},partner_details:{partner_id:null===e||void 0===e?void 0:e.partner_id,name:j,logo_url:p,policy_url:m,theme_color:s},onSuccess:async()=>{d("Verified"),b&&b(t.id,"success"),r.a.success("Your ID is pending verification and approval"),a&&a()},onClose:()=>{d("Verify Smile Id")},onError:()=>{d("Verify Smile Id"),r.a.error("Document failed to upload, please try again")}})};return Object(o.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"20px"},children:Object(o.jsx)("button",{id:"verify-with-smile-id",disabled:"Verify Smile Id"!==i,onClick:()=>{(async()=>{d("Initializing...");const e=await u();h(e)})()},children:i})})}},228:function(e,t,a){"use strict";var n=a(1),s=a(15),l=a(4),c=a(41);t.a=()=>{const[e,t]=Object(n.useState)(!1),[a,i]=Object(n.useState)(60),[r,o]=Object(n.useState)(!1),[d]=Object(s.a)(Object(n.useCallback)((e=>[e.session_idle_timeout]),[]),l.shallow),[b]=Object(c.a)(Object(n.useCallback)((e=>[e.sessionTimeoutId]),[]),l.shallow),u=()=>{const e=Date.now()+(d-6e4);localStorage.setItem("expireTime",e.toString())};return Object(n.useEffect)((()=>{if(null==d)return;const e=setInterval((()=>{(()=>{const e=localStorage.getItem("expireTime");null!==e&&+e<Date.now()&&!r&&(i(60),t(!0),o(!0))})()}),1e3);return()=>clearInterval(e)}),[r,d]),Object(n.useEffect)((()=>{if(null!=d)return u(),window.addEventListener("click",u),window.addEventListener("keypress",u),window.addEventListener("scroll",u),window.addEventListener("mousemove",u),()=>{window.removeEventListener("click",u),window.removeEventListener("keypress",u),window.removeEventListener("scroll",u),window.removeEventListener("mousemove",u),clearInterval(b)}}),[d]),{isInactive:r,showInactiveModal:e,countDown:a,setCountDown:i,setShowInactiveModal:t,setIsInactive:o}}},229:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(6),s=a(25),l=a(1),c=a(45),i=a(18),r=a(0);function o(e){let{showPrompt:t,close:a,description:o,countDown:d,setCountDown:b,isLoggedIn:u}=e;const j=Object(i.y)(),p=Object(c.a)(Object(l.useCallback)((e=>e.logout),[]));return Object(l.useEffect)((()=>{const e=setInterval((()=>{d>0?b((e=>e-1)):(p(),u||j.goTo("/login"))}),1e3);return()=>{clearInterval(e)}})),Object(r.jsxs)(s.a,{show:t,close:a,description:o,isUpload:!1,className:"small-modal",children:[Object(r.jsx)("div",{className:"modal-body py-5 d-flex text-center align-items-center flex-column",children:Object(r.jsxs)("p",{style:{maxWidth:"300px",fontSize:"18px"},className:"d-block text-black-500",children:["You are about to be logged out in : ",d]})}),Object(r.jsx)("div",{className:"modal-footer justify-content-center align-items-center",style:{},children:Object(r.jsx)(n.a,{isLoading:!1,onClick:()=>{a()},className:"btn btn-danger",children:"Stay signed in"})})]},o)}},230:function(e,t,a){"use strict";var n=a(1),s=a(21);t.a=()=>{const e=Object(s.i)();return Object(n.useEffect)((()=>{if("https:"!==window.location.protocol){const e="https://".concat(window.location.hostname).concat(window.location.pathname).concat(window.location.search);window.location.replace(e)}}),[e]),null}},231:function(e,t,a){"use strict";a.d(t,"a",(function(){return v}));var n=a(114),s=a(13),l=a(19),c=a(1),i=a(90),r=a(4),o=a(5),d=a(12),b=a(49),u=a(18),j=a(9),p=a.n(j),m=a(3),h=a(2),O=a(0);function v(e){let{setCurrentStep:t,product:a,showConfigurableForm:n}=e;const[i,b]=Object(c.useState)(!1),j=Object(d.f)();let v;j&&(v=j.values);const[f,g]=Object(c.useState)(),[w,_]=Object(c.useState)(),[y,N,C,k]=Object(l.a)((e=>[e.loanRequestData.card_id,e.setLoanRepaymentCard,e.resetCard,e.selectedOffer]),r.shallow),S=Object(s.a)((e=>e.cards)),E=Object(c.useCallback)((()=>{if(!f)return;const e=f.card_exp_year.length>2?f.card_exp_year:"20".concat(f.card_exp_year),s=new Date(+e,+f.card_exp_month-1);if(w&&s.getTime()<(null===w||void 0===w?void 0:w.getTime()))return void p.a.error(L("lender-web-app-error-card-expiry",{date:Object(m.a)(w)}));N(f.id);const l=null===a||void 0===a?void 0:a.attributes["repayment-methods"];l["direct-debit"]?t(o.b.INFO_MANDATE):!l["direct-debit"]&&l["mobile-money"]?t(o.b.MOBILE_MONEY):"before-loan-request"!==(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||n?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&n?t(o.b.OFFER_SELECTION):"after-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&(console.log("to authorizeeeeeeeeeeeeeeeeeee"),t(o.b.AUTHORIZE)):t(o.b.CONFIRM)}),[f]),T=Object(c.useCallback)((e=>{g(e)}),[]);Object(c.useEffect)((()=>{C(),A(),b(!0)}),[]);const A=Object(c.useCallback)((()=>{let e;if(void 0!==v){e=Object(u.n)(v,a.interest_rate).maturity_date,_(e)}else _(new Date(k.due_date))}),[]),{translate:L}=Object(h.useTranslation)();return Object(O.jsxs)("div",{className:"card default-card",children:[Object(O.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(O.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(O.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(O.jsx)("p",{className:"text-primary fs-5 fw-bold",children:L("lender-web-app-choose-card")}),Object(O.jsx)("small",{className:"text-app-gray",children:L("lender-web-app-choose-card-repayment")})]}),Object(O.jsx)(O.Fragment,{children:i&&Object(O.jsx)(x,{cards:S,chosen:y,onChange:T})})]})}),Object(O.jsxs)("div",{className:"d-flex justify-content-between modal-footer control ",children:[Object(O.jsx)("button",{type:"button",onClick:()=>{const e=null===a||void 0===a?void 0:a.attributes["repayment-methods"];e["direct-debit"]||e["debit-card"]||e.none?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])?t(o.b.PROFESSIONAL_INFO):t(o.b.OFFER_SELECTION):t(o.b.CHOOSE_PAYMENT_METHOD)},className:"btn py-3 pl-0 btn-ghost btn-lg",children:L("lender-web-app-back")}),Object(O.jsx)("button",{type:"button",disabled:!f,onClick:()=>{E()},className:"btn py-3 btn-primary btn-lg px-5",children:L("lender-web-app-continue")})]})]})}function x(e){let{onChange:t,chosen:a,cards:l}=e;const[o,d]=Object(s.a)((e=>[e.initCard,e.cardInitStatus]),r.shallow),u=Object(c.useCallback)((e=>{t(e)}),[t]),{translate:j}=Object(h.useTranslation)();return Object(O.jsxs)("div",{className:"",children:[Object(O.jsx)("div",{className:"small ",children:Object(O.jsx)(b.c,{children:null===l||void 0===l?void 0:l.map((e=>Object(O.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(O.jsx)(n.a,{value:e.id,card:e,defaultChecked:+a===e.id,onChange:()=>{u(e)}})},e.id)))})}),Object(O.jsx)(i.a,{allowCard:!0,allowBank:!1,renderButton:e=>Object(O.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(O.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{"idle"===d?o().then((async()=>{e()})).catch((e=>{console.log(e)})):e()},children:"loading"===d?Object(O.jsx)("div",{className:"spinner-border",children:Object(O.jsxs)("span",{className:"visually-hidden",children:[j("lender-web-app-loading"),"..."]})}):Object(O.jsx)("p",{className:"mt-2",children:j("lender-web-app-add-card")})})})})]})}},232:function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));var n=a(6),s=a(12),l=a(19),c=a(1),i=a(4),r=a(8),o=a(5),d=a(59),b=a(15),u=a(2),j=a(7),p=a(0);function m(e){var t;let{setCurrentStep:a,product_id:m,abandoned:h}=e;const O=Object(d.a)(),{translate:v}=Object(u.useTranslation)(),[x,f]=Object(c.useState)(!1),g=r.g().shape({token:r.h().required(v("lender-web-app-select-an-offer")),guarantor_id:r.f().optional(),mandate_id:r.f().optional(),card_id:r.f().optional(),pin:r.h().length(4,v("lender-web-app-invalid-pin")).required(v("lender-web-app-please-enter-your-pin"))}),[w,_,y,N,C,k,S,E]=Object(l.a)((e=>[e.selectedOffer,e.loanRequestData,e.loanCompletionStatus,e.loanRequestData,e.completeLoanApplication,e.clearLoanRequestData,e.mandate,e.setNotLinked]),i.shallow),T=Object(b.a)((e=>e.direct_debit_provider)),A=null!==m&&void 0!==m?m:O.get("id"),L=Object(l.a)((e=>e.products),i.shallow),M=Object(c.useMemo)((()=>null===L||void 0===L?void 0:L.find((e=>e.id==A))),[A]),D=Object(c.useMemo)((()=>"before-loan-request"!==(null===M||void 0===M?void 0:M.attributes["request-payment-method"])||h?null!==N&&void 0!==N&&N.mandate_id?o.b.MANDATES:null!==N&&void 0!==N&&N.card_id?o.b.REPAYMENT_METHOD:o.b.MOBILE_MONEY:o.b.OFFER_SELECTION),[w]),F=Object(s.e)({initialValues:{..._,pin:""},validationSchema:g,onSubmit:async e=>{"Kindly choose or add a card that is tied to your bank account."===await C(e)&&f(!0)}});return Object(c.useEffect)((()=>{var e;"not-available"!==y?"success"===y&&(null!==w&&void 0!==w&&null!==(e=w.attributes)&&void 0!==e&&e.require_guarantor?a(o.b.GUARANTOR):"remita"===T&&N.mandate_id&&-1!=S.status.indexOf("pending")?a(o.b.SUCCESS_MANDATE):a(o.b.SUCCESSFUL)):a(o.b.AMOUNT_SELECTION)}),[y]),Object(p.jsx)("div",{className:"card default-card",children:Object(p.jsxs)("form",{onSubmit:F.handleSubmit,children:[Object(p.jsx)("div",{className:"py-4 mx-4 row loan-modal-body",children:Object(p.jsxs)("div",{className:"pl-4 col-12 loan-form",children:[Object(p.jsxs)("div",{className:"tab-content__header",children:[Object(p.jsx)("p",{className:"text-primary fs-5 fw-bold",children:v("lender-web-app-authorize-loan")}),Object(p.jsx)("small",{className:"text-app-gray",children:v("lender-web-app-please-enter-pin")})]}),Object(p.jsx)("div",{className:"form-text",children:v("lender-web-app-enter-pin")}),Object(p.jsx)(j.o,{length:4,onChange:e=>{F.setFieldValue("pin",e,!0)},error:F.errors.pin,password:!0,autofocus:!0})]})}),x&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("div",{style:{color:"red",textAlign:"center",width:"80%",margin:"auto",fontSize:"12px",lineHeight:"1"},children:Object(p.jsx)("small",{children:v("lender-web-app-card-not-tied")})}),Object(p.jsxs)("div",{style:{color:"#46b779",width:"50%",margin:"1rem auto",fontSize:"12px",lineHeight:"1",display:"flex",justifyContent:"space-between"},children:[Object(p.jsx)(n.a,{onClick:()=>a(o.b.REPAYMENT_METHOD),children:v("lender-web-app-add-a-card")}),Object(p.jsx)(n.a,{onClick:()=>{E(!0),a(o.b.ADD_BANK)},children:v("lender-web-app-add-a-bank")})]})]}),Object(p.jsxs)("div",{className:" d-flex modal-footer justify-content-between control ",children:[Object(p.jsx)("button",{type:"button",onClick:()=>{k(),a(D)},className:"py-3 pl-0 btn btn-ghost btn-lg",children:v("lender-web-app-back")}),Object(p.jsx)(n.a,{isLoading:"loading"===y,type:"submit",isDisabled:(null===(t=F.values.pin)||void 0===t?void 0:t.length)<4||x,className:"px-5 py-3 btn btn-primary btn-lg",children:v("lender-web-app-continue")})]})]})})}},233:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(1),s=a(220),l=a.n(s),c=a(13),i=a(4),r=a(25),o=a(2),d=a(144),b=a(15),u=a(9),j=a.n(u),p=a(0);function m(e){return"doc_type"in e}const h=e=>e?["badge rounded-pill__".concat(e.toLowerCase()),"/images/".concat(e.toLowerCase(),".png")]:[];function O(e){let{status:t,fileName:a,id:s,currentDoc:u,required:O,isStage:v,options:x}=e;const[f,g]=Object(n.useState)(!1),w=Object(n.useCallback)((()=>{["approved","pending"].includes(null===t||void 0===t?void 0:t.toLowerCase())||g((e=>!e))}),[t]),{translate:_}=Object(o.useTranslation)(),[y,N]=Object(n.useState)(!1),[C,k]=h("Approved"===t?"verified":t),[S,E,T]=Object(c.a)((e=>[e.docUploadStatus,e.uploadUserDoc,e.updateUserDoc]),i.shallow),A=Object(n.useCallback)((async(e,t)=>{const a=(m(u)||"documentType")&&m(u)?T:E;await a(e,null===u||void 0===u?void 0:u.type_id,null===u||void 0===u?void 0:u.id,w),"function"===typeof t&&t()}),[E,s,w,u,T]),[L,M,D,F,I]=Object(b.a)((e=>[e.getVerificationDocument,e.organization,e.logo_url,e.privacy_url,e.slug]),i.shallow);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(r.a,{show:f,close:()=>{N(!1),w()},description:a,children:[v&&!y&&Object(p.jsxs)("div",{className:"modal-body modal-content-center",style:{textAlign:"center"},children:[Object(p.jsx)("h5",{children:"Acceptable Documents"}),Object(p.jsxs)("p",{children:["Please note that the acceptable documents are: ",null===x||void 0===x?void 0:x.map(((e,t)=>t===x.length-1?e.name:"".concat(e.name,", ")))]}),Object(p.jsx)("button",{onClick:()=>{N(!0)},className:"btn btn-primary mt-3",children:"Continue"})]}),(!v||y)&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("div",{className:"modal-body",children:Object(p.jsxs)("div",{className:"modal-form",children:[Object(p.jsx)(d.a,{onFileSelect:A,status:S}),Object(p.jsx)("div",{className:"tips",children:Object(p.jsxs)("p",{children:["**",_("lender-web-app-pdf-jpeg")]})})]})}),Object(p.jsx)("div",{className:"modal-footer",children:Object(p.jsx)("button",{type:"button",className:"btn btn-primary",disabled:!0,children:_("lender-web-app-submit")})})]})]},a),Object(p.jsxs)("button",{onClick:async()=>{if("Identification Documents"!==a||"rejected"!==t||"standard-life"!==I)"Identification Documents"!==a||"pending"!==t||"standard-life"!==I?w():j.a.error("Your ID is pending approval");else{console.log(I,"============================filename");(e=>{const t=sessionStorage.getItem("primary_color");SmileIdentity({token:null===e||void 0===e?void 0:e.token,product:"doc_verification",callback_url:null===e||void 0===e?void 0:e.callback_url,environment:"live",job_id:null===e||void 0===e?void 0:e.job_id,id_selection:{RW:["IDENTITY_CARD"]},partner_details:{partner_id:null===e||void 0===e?void 0:e.partner_id,name:M,logo_url:D,policy_url:F,theme_color:t},onSuccess:async()=>{console.log("success")},onClose:()=>{console.log("failed")},onError:()=>{console.log("error")}})})(await L())}},className:"card-btn",children:[Object(p.jsx)("span",{children:a}),!!t&&Object(p.jsxs)("span",{className:C,children:[Object(p.jsx)("img",{src:k,alt:"",width:"10px"}),Object(p.jsx)("span",{className:"text",children:l()(t)})]})||O&&""===t&&Object(p.jsxs)("span",{className:"badge",children:[Object(p.jsx)("img",{src:k,alt:"",width:"10px"}),Object(p.jsx)("span",{className:"text",children:"Required"})]})]})]})}},234:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));a(1);var n=a(20),s=a(16),l=a(4),c=a(13),i=a(19),r=a(2),o=a(0);function d(){const e=Object(c.a)((e=>e.setDownloadAppModal),l.shallow),[t,a]=Object(i.a)((e=>[e.fetchLoans,e.fetchDraftLoans]),l.shallow),{translate:d}=Object(r.useTranslation)();return Object(o.jsxs)("div",{className:"card default-card",children:[Object(o.jsx)("div",{className:"row mx-4 loan-modal-body",children:Object(o.jsxs)("div",{style:{minHeight:"20vh"},className:"mx-auto d-flex loan-form text-center flex-column justify-content-center align-items-center",children:[Object(o.jsxs)("svg",{id:"success-check-mark",width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(o.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(o.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(o.jsxs)("defs",{className:"text-primary",children:[Object(o.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(o.jsx)("stop",{stopColor:"currentColor"}),Object(o.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(o.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(o.jsx)("stop",{stopColor:"currentColor"}),Object(o.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(o.jsxs)("h4",{className:"fw-bold my-3 text-primary",children:[d("lender-web-app-success"),"!"]}),Object(o.jsx)("small",{className:"text-small text-app-gray",children:d("lender-web-app-applied-succefully")}),Object(o.jsx)(n.b,{to:s.a.loans.base,className:"btn btn-primary btn-lg px-5 mt-4",onClick:()=>{t(),a(),setTimeout((()=>{e(!0)}),2e3)},children:d("lender-web-app-view-loans")})]})}),Object(o.jsx)("div",{style:{height:"72px"},children:""})]})}},235:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(0);function s(){return Object(n.jsx)("div",{style:{height:"72px"},children:""})}},236:function(e,t,a){"use strict";(function(e){var n=a(6),s=a(1),l=a(4),c=a(425),i=a.n(c),r=a(11),o=a(10),d=a(12),b=a(19),u=a(25),j=a(9),p=a(8),m=a(15),h=a(104),O=a(2),v=a(0);const x=p.g().shape({flexCheckChecked:p.b().oneOf([!0]),flexCheckChecked1:p.b().oneOf([!0]),flexCheckChecked2:p.b().oneOf([!0])});t.a=t=>{let{setCurrentStep:a,nextStep:c,prevStep:p}=t;const{setFieldValue:f}=Object(d.f)(),[g,w]=Object(s.useState)(!1),[_,y]=Object(s.useState)(!1),[N,C,k,S,E,T]=Object(b.a)((e=>[e.fetchBankRecords,e.bankStatus,e.bankRecords,"loading"===e.offersRequestStatus,e.setOfferLoading,e.banks]),l.shallow),{translate:A}=Object(O.useTranslation)();Object(s.useEffect)((()=>{N()}),[]);const[L]=Object(m.a)(Object(s.useCallback)((e=>[e.mono_public_key]),[])),M=Object(d.e)({initialValues:{flexCheckChecked:!1,flexCheckChecked1:!1,flexCheckChecked2:!1},validateOnMount:!0,validationSchema:x,onSubmit:()=>{F.open()}}),D=()=>{j.toast.error(A("lender-web-app-error-connecting-mono"),{id:"mono-error"}),E("error"),a(p)},F=Object(s.useMemo)((()=>{var t,n;if(!L)return void D();const s=new i.a({key:"production"===(null===(t=e)||void 0===t||null===(n=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}))||void 0===n?void 0:n.NODE_ENV)?L:"test_pk_Onia7MQADoMG7r9EWny0",onClose:()=>console.log("Widget closed"),onLoad:()=>console.log("Widget loaded successfully"),onSuccess:async e=>{let{code:t}=e;try{y(!1),E("loading");const e=await Object(r.a)("".concat(o.fb,"/mono"),"post",{code:t});E("success"),f("data_provider_record_id",e.data.id),a(c)}catch(n){E("error"),j.toast.error(n.message)}},onEvent:e=>{"ERROR"===e&&D()}});return s.setup(),s}),[]);return"loading"===C?Object(v.jsx)(h.a,{}):Object(v.jsxs)("div",{className:"card default-card",children:[Object(v.jsxs)("div",{className:"",children:["success"===C?Object(v.jsxs)(v.Fragment,{children:[Object(v.jsxs)("div",{className:"col-12 loan-form modal-body loan-modal-body pl-4",children:[Object(v.jsxs)("div",{className:"tab-content__header mb-3",children:[Object(v.jsx)("p",{className:"text-black mb-1  fs-5 fw-bold",children:A("lender-web-app-connect-bank")}),Object(v.jsx)("small",{className:"text-black-50",children:A("lender-web-app-connect-bank-loan")})]}),k.length?Object(v.jsxs)("div",{children:[k.map((e=>{var t,n,s;return Object(v.jsxs)("div",{onClick:async()=>{f("data_provider_record_id",e.id),a(c)},style:{border:"1px solid rgba(98, 149, 218, 0.15)"},className:"mt-2 cursor-pointer align-items-center rounded-2 px-4 py-3 d-flex",children:[Object(v.jsx)("img",{width:"40px",className:"me-4 rounded-1",src:(null===T||void 0===T||null===(t=T.find((t=>t.additional_code==e.bankCode)))||void 0===t?void 0:t.url)||"/svgs/home.svg",alt:""}),Object(v.jsxs)("div",{children:[Object(v.jsx)("p",{children:e.name}),Object(v.jsx)("p",{children:"".concat(null===(n=e.accountNumber)||void 0===n?void 0:n.slice(0,3),"****").concat(null===(s=e.accountNumber)||void 0===s?void 0:s.slice(-2))})]})]},e.id)})),Object(v.jsx)("p",{className:"text-center text-primary  mt-4",children:"OR"})]}):Object(v.jsxs)(v.Fragment,{children:[Object(v.jsx)("div",{className:"mb-5 d-flex align-items-center flex-column justify-content-center",children:Object(v.jsxs)("div",{className:"bg-light-blue rounded-3 py-4 px-4",children:[Object(v.jsxs)("h6",{className:"mb-3",children:[A("lender-web-app-what-to-know"),":"]}),Object(v.jsxs)("ul",{className:"text-left",style:{maxWidth:"400px"},children:[Object(v.jsx)("li",{className:"mb-2 text-small",children:A("lender-web-app-connect-before-process")}),Object(v.jsx)("li",{className:"mb-2 text-small",children:A("lender-web-app-calculate-eligibilty")}),Object(v.jsx)("li",{className:"mb-2 text-small",children:A("lender-web-app-ensure-account-added")}),Object(v.jsx)("li",{className:"text-small",children:A("lender-web-app-data-safe")})]})]})}),Object(v.jsxs)("p",{className:"mt-35",children:[A("lender-web-app-powered-by-single")," ",Object(v.jsx)("img",{src:"/svgs/mono.svg",alt:""})," "]})]}),Object(v.jsxs)("div",{className:"d-flex justify-content-between control mt-3  ",children:[Object(v.jsx)(n.a,{type:"button",onClick:()=>a(p),className:"btn me-3    py-3 w-100 btn-outline-primary btn-lg mt-4",children:A("lender-web-app-back")}),Object(v.jsx)(n.a,{type:"button",onClick:()=>y(!0),className:"btn   py-3 w-100 btn-primary btn-lg  mt-4",isLoading:S,children:k.length?"Connect New Account":"Connect"})]})]}),Object(v.jsx)("div",{style:{height:"72px"},children:""})]}):Object(v.jsxs)(v.Fragment,{children:[Object(v.jsx)("div",{className:"d-flex justify-content-center align-items-center loan-modal-body",children:Object(v.jsx)("p",{className:"",children:A("lender-web-app-error-fetching-records")})}),Object(v.jsx)("div",{style:{height:"72px"},children:""})]})," "]}),Object(v.jsxs)(u.a,{show:_,close:()=>y(!1),description:A("lender-web-app-connect-bank"),isUpload:!1,children:[Object(v.jsxs)("div",{className:"modal-body loan-modal-body mx-auto py-5 d-flex  align-items-center flex-column",children:[Object(v.jsx)("img",{width:"70px",className:"mb-4",src:"/svgs/home.svg",alt:""}),Object(v.jsx)("form",{id:"modal-form",onSubmit:M.handleSubmit,children:Object(v.jsxs)("div",{className:"mx-auto",style:{maxWidth:"400px"},children:[Object(v.jsxs)("div",{className:"form-check",children:[Object(v.jsx)("input",{className:"form-check-input",type:"checkbox",id:"flexCheckChecked",required:!0,onChange:M.handleChange,value:"".concat(M.values.flexCheckChecked)}),Object(v.jsx)("label",{className:"form-check-label small",htmlFor:"flexCheckChecked",children:A("lender-web-app-confirm-primary-bank")})]}),Object(v.jsxs)("div",{className:"my-2 form-check",children:[Object(v.jsx)("input",{className:"form-check-input",type:"checkbox",id:"flexCheckChecked1",required:!0,onChange:M.handleChange,value:"".concat(M.values.flexCheckChecked1)}),Object(v.jsx)("label",{className:"form-check-label small",htmlFor:"flexCheckChecked1",children:A("lender-web-app-confirm-six-months")})]}),Object(v.jsxs)("div",{className:"form-check",children:[Object(v.jsx)("input",{className:"form-check-input",type:"checkbox",id:"flexCheckChecked2",required:!0,onChange:M.handleChange,value:"".concat(M.values.flexCheckChecked2)}),Object(v.jsx)("label",{className:"form-check-label small",htmlFor:"flexCheckChecked2",children:A("lender-web-app-confirm-monthly-income")})]})]})})]}),Object(v.jsxs)("div",{className:"modal-footer d-flex justify-content-between",children:[Object(v.jsx)(n.a,{isLoading:S,type:"button",onClick:()=>y(!1),className:"btn text-primary ",children:A("lender-web-app-cancel")}),Object(v.jsx)(n.a,{isLoading:S,form:"modal-form",type:"submit",isDisabled:!M.isValid,className:"btn btn-primary",children:A("lender-web-app-continue")})]})]}),Object(v.jsxs)(u.a,{show:g,close:()=>w(!1),description:A("lender-web-app-connect-bank"),isUpload:!1,children:[Object(v.jsxs)("div",{className:"modal-body loan-modal-body py-5 mt-4 d-flex text-center align-items-center flex-column",children:[Object(v.jsx)("img",{width:"60px",className:"mb-3",src:"/svgs/home.svg",alt:""}),Object(v.jsxs)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-black-50",children:[A("lender-web-app-data-safe-review")," ",Object(v.jsx)("br",{}),A("lender-web-app-ask-cancel")]})]}),Object(v.jsxs)("div",{className:"modal-footer",children:[Object(v.jsx)(n.a,{isLoading:S,type:"button",onClick:()=>a(p),className:"btn text-primary ",children:A("lender-web-app-cancel")}),Object(v.jsx)(n.a,{isLoading:S,onClick:()=>{w(!1),y(!0)},type:"submit",className:"btn btn-primary",children:A("lender-web-app-continue")})]})]})]})}}).call(this,a(159))},237:function(e,t,a){"use strict";a.d(t,"a",(function(){return x}));var n=a(114),s=a(13),l=a(19),c=a(1),i=a(90),r=a(4),o=a(5),d=a(12),b=a(11),u=a(10),j=a(9),p=a.n(j),m=a(6),h=a(49),O=a(2),v=a(0);function x(e){let{setCurrentStep:t,product:a}=e;const{submitForm:n}=Object(d.f)(),[i,j]=Object(c.useState)(!1),[h,x]=Object(c.useState)(!1),[g,w,_,y]=Object(l.a)((e=>[e.loanRequestData.card_id,e.setLoanRepaymentCard,"loading"===e.offersRequestStatus,e.resetCard]),r.shallow),N=Object(s.a)((e=>e.cards),r.shallow);Object(c.useEffect)((()=>{y(),x(!0)}),[]);const{translate:C}=Object(O.useTranslation)();return Object(v.jsxs)("div",{className:"card default-card",children:[Object(v.jsx)("div",{className:"modal-body loan-modal-body py-4",children:Object(v.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(v.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(v.jsx)("p",{className:"text-primary  fs-5  fw-bold",children:C("lender-web-app-choose-card")}),Object(v.jsx)("small",{className:"text-app-gray",children:C("lender-web-app-choose-card-repayment")})]}),h&&Object(v.jsx)(f,{cards:N,chosen:g,onChange:w})]})}),Object(v.jsxs)("div",{className:"d-flex justify-content-between modal-footer",children:[Object(v.jsx)("button",{type:"button",onClick:()=>t(o.b.CONFIRM),className:"btn py-3 btn-ghost btn-lg p-0",children:C("lender-web-app-back")}),Object(v.jsx)(m.a,{type:"button",isLoading:i||_,disabled:!g,onClick:async()=>{j(!0),n();try{const{data:e}=await Object(b.a)(Object(u.c)(a.id),"post",{card_id:g});"success"===(null===e||void 0===e?void 0:e.status)?(p.a.success(C("lender-web-app-payment-successful")),n()):n()}catch(e){p.a.error(e.message||C("lender-web-app-an-error-occured"))}finally{j(!1)}},className:"btn py-3 btn-primary btn-lg px-5",children:C("lender-web-app-authorize")})]})]})}function f(e){let{onChange:t,chosen:a,cards:l}=e;const[o,d]=Object(s.a)((e=>[e.initCard,e.cardInitStatus]),r.shallow),b=Object(c.useCallback)((e=>{t(e.target.value)}),[t]),{translate:u}=Object(O.useTranslation)();return Object(v.jsxs)("div",{className:"",children:[Object(v.jsx)("div",{className:"small ",children:Object(v.jsx)(h.c,{children:null===l||void 0===l?void 0:l.map((e=>Object(v.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(v.jsx)(n.a,{card:e,value:e.id,defaultChecked:+a===e.id,onChange:b})},e.id)))})}),Object(v.jsx)(i.a,{allowCard:!0,allowBank:!1,renderButton:e=>Object(v.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(v.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{"idle"===d?o().then((()=>e())).catch((e=>{console.log(e)})):e()},children:"loading"===d?Object(v.jsx)("div",{className:"spinner-border",children:Object(v.jsxs)("span",{className:"visually-hidden",children:[u("lender-web-app-loading"),"..."]})}):Object(v.jsx)("p",{className:"mt-2",children:u("lender-web-app-add-new-card")})})})})]})}},238:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var n=a(5),s=a(1),l=a(19),c=a(4),i=a(11),r=a(9),o=a.n(r),d=a(10),b=a(239),u=a(59),j=a(18),p=a(2),m=a(0);function h(e){var t,a,r;let{setCurrentStep:h,product_id:O}=e;const v=Object(u.a)(),[x,f]=Object(s.useState)(""),[g,w]=Object(l.a)((e=>[e.selectedOffer,e.products]),c.shallow),_=+v.get("id"),y=Object(s.useMemo)((()=>null===w||void 0===w?void 0:w.find((e=>e.id==_||O))),[v]);Object(s.useEffect)((()=>{(async()=>{try{const e=await Object(i.a)(d.vb,"post");f(e.data.guarantor_link)}catch(t){var e;o.a.error(null!==(e=null===t||void 0===t?void 0:t.message)&&void 0!==e?e:C("lender-web-app-error-generating-guarantor"))}})()}),[]);const N=null===g||void 0===g||null===(t=g.attributes)||void 0===t?void 0:t.no_of_guarantors,{translate:C}=Object(p.useTranslation)();return Object(m.jsxs)("div",{className:"card default-card",children:[Object(m.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(m.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(m.jsx)("h4",{className:"",children:C("lender-web-app-share-guarantor-link")}),(null===g||void 0===g||null===(a=g.attributes)||void 0===a?void 0:a.borrower_message)&&Object(m.jsx)("p",{children:null===g||void 0===g||null===(r=g.attributes)||void 0===r?void 0:r.borrower_message.replace(/{no_of_guarantors}/g,N)}),Object(m.jsxs)("div",{className:"input-group input-group-lg my-3",children:[Object(m.jsx)("input",{type:"text",disabled:!0,className:"form-control text-base",placeholder:"Loading....",value:x}),Object(m.jsxs)("button",{disabled:!x,onClick:()=>Object(j.d)(x),className:"btn text-base btn-primary input-group-append",type:"button",children:[Object(m.jsx)("img",{className:"px-2",src:b.a,alt:"copy"}),C("lender-web-app-copy")]})]}),Object(m.jsx)("div",{className:"col my-4",children:Object(m.jsx)("div",{className:"rounded-3 text-small p-3 bg-light-blue text-black",role:"alert",children:C("lender-web-app-loan-requires-guarantor-note",{no_of_guarantors:N,guarantor_text:N>1?"guarantors":"guarantor"})})})]})}),Object(m.jsx)("div",{className:"modal-footer control",children:Object(m.jsx)("button",{disabled:""===x,type:"button",onClick:()=>{var e;null!==y&&void 0!==y&&null!==(e=y.collection_method)&&void 0!==e&&e.includes("direct_debit")?h(n.b.SUCCESS_MANDATE):h(n.b.SUCCESSFUL)},className:"btn py-3  btn-primary btn-lg px-5",children:C("lender-web-app-continue")})})]})}},239:function(e,t,a){"use strict";t.a=a.p+"static/media/copy.4066c27a.svg"},240:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(6),s=a(19),l=a(1),c=a(4),i=a(5),r=a(12),o=a(18),d=a(3),b=a(2),u=a(0);const j=e=>{switch(e){case"pending":return{background:"rgba(253, 182, 69, 0.1)",color:"#FDB645"};case"successful":return{background:"rgba(49, 197, 161, 0.1)",color:"#31C5A1"};default:return{background:"rgba(84, 86, 89, 0.1)",color:"#545659"}}};function p(e){let{setCurrentStep:t,product:a,showConfigurableForm:p}=e;const m=i.b.INFO_MANDATE,{values:h}=Object(r.f)()||{values:void 0},[O,v]=Object(l.useState)({amount:0,dueDate:null}),[x,f,g,w,_]=Object(s.a)((e=>[e.fetchMandates,e.mandateStatus,e.mandates,e.setMandate,e.selectedOffer]),c.shallow);Object(l.useEffect)((()=>{x(),N()}),[]);const{translate:y}=Object(b.useTranslation)(),N=Object(l.useCallback)((()=>{let e,t;if(void 0!==h){var n;const s=Object(o.n)(h,a.interest_rate);e=s.repayment,t=s.maturity_date,t.setDate((null===(n=t)||void 0===n?void 0:n.getDate())+s.loan_days),v({amount:e,dueDate:t})}else v({amount:_.amount_due,dueDate:new Date(_.due_date)})}),[]),C=Object(l.useCallback)((e=>{if(null===e)return e;if(null===e.includes("-"))return e;const[t,a,n]=e.split("/");return"".concat(n,"-").concat(a,"-").concat(t)}),[]),k=Object(l.useMemo)((()=>{let e=[];return g.length>0&&null!=O.dueDate?(e=g.filter((e=>{var t;if(null==e.end_date)return!1;const a={...O},n=new Date(null===a||void 0===a||null===(t=a.dueDate)||void 0===t?void 0:t.getTime());null===n||void 0===n||n.setMonth((null===n||void 0===n?void 0:n.getMonth())+3);const s=new Date(C(e.end_date.slice(0,10)));return e.amount>=O.amount&&(!s||(null===n||void 0===n?void 0:n.getTime())&&s.getTime()>=(null===n||void 0===n?void 0:n.getTime()))})),0===e.length&&t(i.b.ADD_MANDATE),e):(0===g.length&&"success"===f&&t(i.b.ADD_MANDATE),[])}),[g,O,f]),[S,E]=Object(l.useState)(!1);return Object(u.jsxs)("div",{className:"card default-card",children:[Object(u.jsxs)("div",{className:"mx-0 modal-body loan-modal-body pt-4 pb-2 row",children:["loading"===f&&Object(u.jsx)("div",{style:{maxWidth:"550px",minHeight:"500px"},className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(u.jsx)("div",{className:"spinner-border text-primary",children:Object(u.jsxs)("span",{className:"visually-hidden",children:[y("lender-web-app-loading"),"..."]})})})||"success"===f&&Object(u.jsxs)("div",{className:"pl-4 col-12",children:[Object(u.jsx)("div",{className:"mb-4 tab-content__header",children:Object(u.jsx)("p",{className:"text-primary fs-5 fw-bold",children:y("lender-web-app-choose-existing-mandate")})}),Object(u.jsxs)("div",{children:[Object(u.jsx)("button",{className:"text-primary mx-auto mb-1 d-block bg-transparent border-0",style:{width:"fit-content"},onClick:()=>{t(i.b.ADD_MANDATE)},children:y("lender-web-app-add-account-mandate")}),k.map((e=>{var t;return Object(u.jsxs)("label",{onClick:()=>(e=>{w(e),E(!0)})({...e,back_to_list:!0}),className:"card_radio position-relative mandate-card bg-light-primary border-0",children:[Object(u.jsx)("input",{readOnly:!0,type:"radio",name:"mandate_id",value:e.id,...e}),Object(u.jsxs)("div",{className:"content d-flex mt-3 justify-content-between",children:[Object(u.jsxs)("div",{className:"select-mandate-div",children:[Object(u.jsxs)("div",{className:"select-mandate-inner d-flex justify-content-between",children:[Object(u.jsxs)("div",{children:[Object(u.jsx)("h6",{children:y("lender-web-app-accounnt")}),Object(u.jsx)("p",{className:"small",children:"".concat(e.payer_account," / ").concat(e.payer_name)})]}),Object(u.jsxs)("div",{children:[Object(u.jsx)("h6",{children:y("lender-web-app-bank")}),Object(u.jsx)("p",{className:"small",children:e.bank_name})]})]}),Object(u.jsxs)("div",{className:"select-mandate-inner d-flex justify-content-between",children:[Object(u.jsxs)("div",{children:[Object(u.jsx)("h6",{children:y("lender-web-app-amount")}),Object(u.jsx)("p",{className:"small",children:Object(d.q)(e.amount,e.currency)})]}),Object(u.jsxs)("div",{children:[Object(u.jsx)("h6",{children:y("lender-web-app-expires")}),Object(u.jsx)("p",{className:"small",children:Object(d.p)(C(null===(t=e.end_date)||void 0===t?void 0:t.slice(0,10)))})]})]})]}),Object(u.jsxs)("div",{children:[Object(u.jsx)("div",{style:{...j("pending"),right:"0.5rem",top:"0.75rem"},className:"badge me-2 badge-danger position-absolute",children:Object(o.b)(e.status)}),Object(u.jsx)("svg",{width:"11",className:"unchecked-icon text-primary",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(u.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"})}),Object(u.jsxs)("svg",{className:"checked-icon text-primary",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(u.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"}),Object(u.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"currentColor"})]})]})]})]},e.id)}))]})]})||Object(u.jsx)("div",{className:" d-flex justify-content-center align-items-center",children:Object(u.jsx)("p",{className:"",children:y("lender-web-app-error-fetching-records")})})," "]}),Object(u.jsxs)("div",{className:"col-12 modal-footer control justify-content-between d-flex",children:[Object(u.jsx)(n.a,{onClick:()=>t(m),className:"px-5 btn btn-ghost",children:y("lender-web-app-back")}),Object(u.jsx)(n.a,{onClick:()=>{(null===a||void 0===a?void 0:a.attributes["repayment-methods"])["mobile-money"]?t(i.b.MOBILE_MONEY):"before-loan-request"!==(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||p?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&p?t(i.b.OFFER_SELECTION):t(i.b.AUTHORIZE):t(i.b.CONFIRM)},className:"px-5 btn btn-primary",isDisabled:!S,children:y("lender-web-app-continue")})]})]})}},241:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var n=a(6),s=a(12),l=a(5),c=a(8),i=a(19),r=a(1),o=a(4),d=a(10),b=a(9),u=a.n(b),j=a(11),p=a(2),m=a(7),h=a(0);function O(e){var t,a;let{setCurrentStep:b}=e;const[O,v]=Object(r.useState)("idle"),[x,f,g,w,_]=Object(i.a)((e=>[e.fetchBanks,e.bankStatus,e.setBankDetails,e.banks,e.bankDetails]),o.shallow);Object(r.useEffect)((()=>{x()}),[]);const{translate:y}=Object(p.useTranslation)();return Object(h.jsxs)("div",{className:"card default-card",children:[Object(h.jsx)("div",{className:"row mx-4",children:Object(h.jsxs)("div",{className:"col-12 py-4 loan-modal-body",children:[Object(h.jsx)("div",{className:"tab-content__header mb-4",children:Object(h.jsx)("p",{className:"fs-5 text-center mb-1 text-primary fw-bold",children:y("lender-web-app-add-bank-repayment")})}),Object(h.jsx)(s.c,{initialValues:{account_number:null!==(t=null===_||void 0===_?void 0:_.account_number)&&void 0!==t?t:"",bank_code:null!==(a=null===_||void 0===_?void 0:_.bank_code)&&void 0!==a?a:""},validationSchema:c.g().shape({bank_code:c.h().required(y("lender-web-app-select-network-bank")),account_number:c.h().required(y(y("lender-web-app-please-account-number")))}),onSubmit:async e=>{try{v("loading");const t=await Object(j.a)(d.Rb,"post",e),a=null===w||void 0===w?void 0:w.find((t=>t.additional_code===e.bank_code));g({...e,bank_name:a.code_description,account_name:t.data.account_name}),b(l.b.MANDATE_ACCOUNT),v("success")}catch(t){console.error(t),v("error"),u.a.error((null===t||void 0===t?void 0:t.message)||y("lender-web-app-error-saving-bank"))}},children:e=>{return Object(h.jsxs)(s.b,{id:"card-submit",onSubmit:e.handleSubmit,children:[Object(h.jsx)(m.t,{name:"account_number",placeholder:y("lender-web-app-10digit-account-number"),label:y("lender-web-app-account-number")}),Object(h.jsx)(m.r,{loading:"loading"===f,name:"bank_code",label:"Bank",keyField:"additional_code",valueField:"additional_code",labelField:"code_description",options:(t={"mandate-service":"nibss-easypay"},null===w||void 0===w?void 0:w.filter((e=>{if(t){const a=JSON.parse((null===e||void 0===e?void 0:e.meta)||"{}");return Object.entries(t).every((e=>{var t;let[n,s]=e;return(null===(t=a[n])||void 0===t?void 0:t.toLowerCase())===(null===s||void 0===s?void 0:s.toLowerCase())}))}return!0})))})]});var t}})]})}),Object(h.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(h.jsx)("button",{type:"button",onClick:()=>b(l.b.INFO_MANDATE),className:"btn pl-0 btn-ghost btn-lg",children:y("lender-web-app-back")}),Object(h.jsx)(n.a,{isLoading:"loading"===O,type:"submit",form:"card-submit",className:"btn btn-primary px-5",children:y("lender-web-app-add-bank")})]})]})}},242:function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));var n=a(6),s=a(5),l=a(19),c=a(4),i=a(12),r=a(15),o=a(18),d=a(21),b=a(9),u=a.n(b),j=a(2),p=a(0);function m(e){let{setCurrentStep:t,product:a}=e;const{translate:b}=Object(j.useTranslation)(),m=b("lender-web-app-not-accepting-mandate"),h=b("lender-web-app-use-debit-card"),[O]=Object(l.a)((e=>[e.loansRepaymentData]),c.shallow),v=Object(i.f)();let x;v&&(x=v.values);const f=Object(r.a)((e=>e.mandate_activation_type)),g=Object(d.i)(),[w,_,y]=Object(l.a)((e=>[e.bankDetails,e.createMandate,e.mandateStatus]),c.shallow),[N]=Object(r.a)((e=>[e.direct_debit_provider]));console.log(N,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");const C=()=>{a.attributes["repayment-methods"]["direct-debit"]?(u.a.error(m),setTimeout((()=>{g.push("/")}),1500)):(u.a.error(h),t(s.b.REPAYMENT_METHOD))};return Object(p.jsxs)("div",{className:"card default-card",children:[Object(p.jsx)("div",{className:"row mx-4",children:Object(p.jsxs)("div",{className:"col-12 loan-modal-body py-4",children:[Object(p.jsx)("div",{className:"tab-content__header mb-4",children:Object(p.jsx)("p",{className:"fs-5 mb-1 text-primary fw-bold",children:b("lender-web-app-is-bank")})}),Object(p.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-35",children:[Object(p.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(p.jsxs)("div",{children:[Object(p.jsxs)("p",{className:"text-app-gray",children:[b("lender-web-app-account-number")," "]}),Object(p.jsx)("p",{children:w.account_number})]}),Object(p.jsxs)("div",{className:" text-right",children:[Object(p.jsxs)("p",{className:"text-app-gray",children:[b("lender-web-app-account-name")," "]}),Object(p.jsx)("p",{children:w.account_name})]})]}),Object(p.jsx)("div",{className:"d-flex  mt-3  justify-content-between",children:Object(p.jsxs)("div",{children:[Object(p.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-bank-name")}),Object(p.jsx)("p",{children:w.bank_name})]})})]})]})}),Object(p.jsxs)("div",{className:"d-flex justify-content-between modal-footer control ",children:[Object(p.jsx)("button",{type:"button",onClick:()=>t(s.b.ADD_MANDATE),className:"btn pl-0 btn-ghost btn-lg",children:b("lender-web-app-back")}),Object(p.jsx)(n.a,{isLoading:"loading"===y,onClick:async()=>{if("none"!==N)if("nibss-easypay"===N&&"emandate"!==f)t(s.b.MANDATE_SIGNATURE);else{let l,c;if(void 0!==x){var e;l=Object(o.n)(x,a.interest_rate).repayment,c=new Date(null===(e=x)||void 0===e?void 0:e.proposed_payday)}else if(O){var n;l=Object(o.n)({requested_amount:O.total_principal,proposed_tenor_period:O.tenor_period,proposed_tenor:O.tenor},a.interest_rate).repayment,c=new Date(null===(n=O.schedules[0])||void 0===n?void 0:n.due_date)}await _(N,l,c,g)&&t("emandate"===f?s.b.EMANDATE_INFO:s.b.DOWNLOAD_MANDATE)}else C()},className:"btn btn-primary px-5",children:b("lender-web-app-continue")})]})]})}},243:function(e,t,a){"use strict";a.d(t,"a",(function(){return j}));var n=a(6),s=a(12),l=a(5),c=a(8),i=a(1),r=a(9),o=a.n(r),d=a(2),b=a(7),u=a(0);function j(e){let{setCurrentStep:t}=e;const a=l.b.BUSINESS_INFO,[r,j]=Object(i.useState)("idle"),{translate:p}=Object(d.useTranslation)();return Object(u.jsxs)("div",{className:"card default-card",children:[Object(u.jsx)("div",{className:"row mx-4 loan-modal-body py-4",children:Object(u.jsxs)("div",{className:"col-12",children:[Object(u.jsx)("div",{className:"tab-content__header mb-4",children:Object(u.jsx)("p",{className:"fs-5 mb-1 text-primary fw-bold",children:p("lender-web-app-enter-otp-card")})}),Object(u.jsx)(s.c,{initialValues:{account_number:"",bank_code:""},validationSchema:c.g().shape({bank_code:c.h().required(p("lender-web-app-select-network-bank")),account_number:c.h().required(p("lender-web-app-please-account-number"))}),onSubmit:async()=>{try{j("loading"),t(l.b.MANDATE_ACCOUNT),j("success")}catch(e){console.error(e),j("error"),o.a.error((null===e||void 0===e?void 0:e.message)||p("lender-web-app-error-saving-bank"))}},children:e=>Object(u.jsxs)(s.b,{id:"card-submit",onSubmit:e.handleSubmit,children:[Object(u.jsx)("p",{style:{marginBottom:0},children:p("lender-web-app-otp")}),Object(u.jsx)(b.o,{length:4,password:!0,onChange:t=>{e.setFieldValue("otp",t,!0)},error:void 0}),Object(u.jsx)("div",{className:"mt-2",children:Object(u.jsx)(b.t,{name:"last_4_digits",placeholder:"Enter last four digits of the bank card",label:p("lender-web-app-card-digits")})})]})})]})}),Object(u.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(u.jsx)("button",{type:"button",onClick:()=>t(a),className:"btn pl-0 btn-ghost btn-lg",children:p("lender-web-app-back")}),Object(u.jsx)(n.a,{isLoading:"loading"===r,type:"submit",form:"card-submit",className:"btn btn-primary px-5",children:p("lender-web-app-activate-mandate")})]})]})}},244:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(1),s=a(20),l=a(16),c=a(4),i=a(13),r=a(19),o=a(59),d=a(2),b=a(0);function u(){var e,t,a;const u=Object(o.a)(),j=Object(i.a)((e=>e.setDownloadAppModal),c.shallow),p=+u.get("id"),{translate:m}=Object(d.useTranslation)(),[h,O,v,x]=Object(r.a)((e=>[e.products,e.mandate,e.fetchLoans,e.fetchDraftLoans]),c.shallow),f=Object(n.useMemo)((()=>null===h||void 0===h?void 0:h.find((e=>e.id==p))),[u]);return Object(b.jsxs)("div",{className:"card default-card",children:[Object(b.jsx)("div",{className:"mx-4 row loan-modal-body",children:Object(b.jsxs)("div",{className:"mx-auto d-flex loan-form text-center flex-column justify-content-center align-items-center",children:[Object(b.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(b.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(b.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(b.jsxs)("defs",{className:"text-primary",children:[Object(b.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(b.jsx)("stop",{stopColor:"currentColor"}),Object(b.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(b.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(b.jsx)("stop",{stopColor:"currentColor"}),Object(b.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),null!==f&&void 0!==f&&null!==(e=f.collection_method)&&void 0!==e&&e.includes("direct_debit")&&"nibss-easypay"===(null===O||void 0===O?void 0:O.mandate_type.toLowerCase())?Object(b.jsxs)(b.Fragment,{children:[" ",Object(b.jsx)("h6",{className:"mb-3 mt-35 text-primary",children:m("lender-web-app-mandate-email-sent")}),Object(b.jsxs)("p",{className:"text-center text-app-gray",children:[m("lender-web-app-an-email-sent",{user:(null===(t=i.a.getState())||void 0===t||null===(a=t.profile)||void 0===a?void 0:a.email)||m("lender-web-app-you")})," ",m("lender-web-app-to-activate-mandate")]})]}):Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("h6",{className:"mb-3 mt-35 text-primary",children:m("lender-web-app-request-submitted")}),Object(b.jsx)("p",{className:"text-center text-app-gray",children:m("lender-web-app-sent-information-verification")})]})]})}),Object(b.jsx)("div",{className:"gap-2 d-flex modal-footer control ",children:Object(b.jsx)(s.b,{to:l.a.loans.base,className:"btn btn-primary btn-lg px-2",onClick:()=>{v(),x(),setTimeout((()=>{j(!0)}),2e3)},children:m("lender-web-app-view-loans")})})]})}},245:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(6),s=a(12),l=a(19),c=a(1),i=a(4),r=a(5),o=a(2),d=a(7),b=a(0);function u(e){let{setCurrentStep:t,product:a}=e;const[u,j,p,m,h]=Object(l.a)((e=>[e.mandate,e.mandateVerification,e.mandateStatus,e.verifyMandateOtp,e.mandateVerifyStatus]),i.shallow),[O,v]=Object(c.useState)(),{translate:x}=Object(o.useTranslation)(),f=Object(c.useCallback)((()=>{"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])?t(r.b.CONFIRM):t(r.b.AUTHORIZE)}),[]);Object(c.useEffect)((()=>{var e;const t=[];if(null===j||void 0===j||null===(e=j.authParams)||void 0===e||!e[0])return;const a={description:j.authParams[0].description1,label:j.authParams[0].label1,param:j.authParams[0].param1.toLowerCase()},n={description:j.authParams[0].description2,label:j.authParams[0].label2,param:j.authParams[0].param2.toLowerCase()};a.label&&t.push(a),n.label&&t.push(n),v(t)}),[j]);const g=Object(s.e)({initialValues:{otp:"",card:""},onSubmit:async e=>{try{const t={authParams:w(e),remitaTransRef:j.remitaTransRef};await m(t)&&f()}catch(t){console.log(t)}}}),w=e=>{const t=[],a={OTP:Number(e.otp),CARD:Number(e.card)},n=j.authParams[0];return null!==n&&void 0!==n&&n.param1&&t.push({param1:null===n||void 0===n?void 0:n.param1,value:a[null===n||void 0===n?void 0:n.param1]}),null!==n&&void 0!==n&&n.param2&&t.push({param2:null===n||void 0===n?void 0:n.param2,value:a[null===n||void 0===n?void 0:n.param2]}),t};return Object(b.jsxs)("div",{className:"card default-card",children:[Object(b.jsx)("div",{className:"mx-0 modal-body loan-modal-body py-4 row",children:"loading"===p?Object(b.jsx)("div",{style:{maxWidth:"550px",minHeight:"500px"},className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(b.jsx)("div",{className:"spinner-border text-primary",children:Object(b.jsxs)("span",{className:"visually-hidden",children:[x("lender-web-app-loading"),"..."]})})}):"success"===p&&Object(b.jsx)("div",{className:"col-12",children:Object(b.jsx)("div",{className:"d-flex py-35 flex-column align-items-center",children:j.remitaTransRef?Object(b.jsx)("form",{id:"submit-form",className:"w-100",onSubmit:g.handleSubmit,children:null===O||void 0===O?void 0:O.map((e=>Object(b.jsxs)("div",{className:"w-100 form-group",children:[Object(b.jsx)("label",{className:"text-center",children:e.description}),"otp"===e.param?Object(b.jsx)("div",{className:"pin-container",children:Object(b.jsx)(d.o,{length:4,password:!0,onChange:t=>{g.setFieldValue(e.param,t)},error:g.errors.otp})}):Object(b.jsx)("div",{className:"form-group",children:Object(b.jsx)("input",{type:"number",value:g.values[e.param],onChange:t=>{t.target.value.length>4||g.setFieldValue(e.param,t.target.value)},className:"px-3 py-3 form-control rounded-5 f-14px"})})]},e.param)))}):Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("p",{className:"text-center text-app-gray",children:x("lender-web-app-activate-download-mandate")}),Object(b.jsx)("a",{href:(null===u||void 0===u?void 0:u.form_link_url)||(null===u||void 0===u?void 0:u.url)||j,target:"_blank",className:"mt-5 btn-ghost btn-lg btn fs-5",rel:"noreferrer",children:x("lender-web-app-download-mandate")})]})})})||Object(b.jsx)("div",{className:" d-flex justify-content-center align-items-center",children:Object(b.jsx)("p",{className:"",children:x("lender-web-app-error-fetching-records")})})}),"success"===p&&Object(b.jsxs)("div",{className:"modal-footer col-12 control justify-content-between d-flex",children:[Object(b.jsx)(n.a,{onClick:()=>t(u.back_to_list?r.b.MANDATES:r.b.MANDATE_ACCOUNT),className:"btn btn-ghost",children:x("lender-web-app-back")}),Object(b.jsx)(n.a,{isLoading:"loading"===h,type:j.remitaTransRef?"submit":"button",onClick:j.remitaTransRef?()=>{}:()=>f(),form:"submit-form",className:"px-5 btn btn-primary",children:x("lender-web-app-continue")})]})]})}},246:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));var n=a(1),s=a(4),l=a(19),c=a(6),i=a(5),r=a(2),o=a(0);function d(e){let{setCurrentStep:t}=e;const[a,d,b]=Object(l.a)((e=>[e.fetchOfferLetter,e.offerLetter,e.offerLetterStatus]),s.shallow),{translate:u}=Object(r.useTranslation)();return Object(n.useEffect)((()=>{a()}),[]),Object(o.jsxs)("div",{className:"card default-card",children:[Object(o.jsx)("div",{className:"mx-0 modal-body loan-modal-body py-4 row",children:Object(o.jsxs)("div",{className:"col-12",children:[Object(o.jsx)("div",{className:"tab-content__header",children:Object(o.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:u("lender-web-app-offer-letter")})}),Object(o.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(o.jsx)("div",{className:"d-inline-flex align-items-center justify-content-center w-100 embeded-pdf",children:"loading"===b&&Object(o.jsx)("div",{style:{maxHeight:"100%",color:"#ffffff"},className:"spinner-border ",children:Object(o.jsxs)("span",{className:"visually-hidden mx-auto",children:[u("lender-web-app-loading"),"..."]})})||"success"===b&&Object(o.jsx)("iframe",{className:"h-100 w-100 embed-responsive-item",title:"offer-letter",src:"data:application/pdf;base64,".concat(d,"#toolbar=0"),name:"application/pdf#view=FitH",id:"offer-letter-iframe",seamless:!0,children:u("lender-web-app-embeded-offer-letter")})||Object(o.jsx)("div",{style:{maxHeight:"100%"},children:Object(o.jsx)("span",{className:"mx-auto",children:u("lender-web-app-error-offer-letter")})})})})]})}),Object(o.jsxs)("div",{className:"w-full d-flex justify-content-between modal-footer control",children:[Object(o.jsx)("button",{type:"button",onClick:()=>t(i.b.OFFER_SELECTION),className:"pl-0 btn btn-ghost btn-lg",children:u("lender-web-app-back")}),Object(o.jsx)(c.a,{isDisabled:"success"!==b,onClick:()=>(async()=>{t(i.b.SIGN_OFFER)})(),className:"px-5 btn btn-primary btn-lg",children:u("lender-web-app-sign-letter")})]})]})}},247:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var n=a(1),s=a(4),l=a(19),c=a(6),i=a(5),r=a(12),o=a(2),d=a(7),b=a(0);function u(e){let{setCurrentStep:t,product:a}=e;const[u,j]=Object(l.a)((e=>[e.signOfferLetter,e.signOfferLetterStatus]),s.shallow),{translate:p}=Object(o.useTranslation)();return Object(n.useMemo)((()=>{if("success"===j){const e=null===a||void 0===a?void 0:a.attributes["repayment-methods"];"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||!0===e.none?t(i.b.AUTHORIZE):!0===e["debit-card"]?t(i.b.REPAYMENT_METHOD):!0===e["remita-inflight"]?t(i.b.OFFER_SELECTION):!0===e["direct-debit"]?t(i.b.INFO_MANDATE):t(i.b.CHOOSE_PAYMENT_METHOD)}}),[j]),Object(b.jsx)("div",{className:"card default-card",children:Object(b.jsx)(r.c,{initialValues:{full_name:""},onSubmit:async e=>{u(e.full_name)},children:e=>Object(b.jsxs)("form",{onSubmit:e.handleSubmit,children:[Object(b.jsx)("div",{className:"mx-4 pt-4 pb-2 row loan-modal-body",children:Object(b.jsxs)("div",{className:"col-12",children:[Object(b.jsxs)("div",{className:"tab-content__header",children:[Object(b.jsx)("p",{className:"fs-5 text-primary fw-bold",children:p("lender-web-app-sign-letter")}),Object(b.jsx)("small",{className:"text-app-gray",children:p("lender-web-app-verify-read")})]}),Object(b.jsx)("div",{className:"d-flex py-35 w-100",children:Object(b.jsx)(d.s,{label:p("lender-web-app-enter-full-name"),name:"full_name",type:"text",groupStyle:{minWidth:"100%"}})})]})}),Object(b.jsxs)("div",{className:"w-full  d-flex justify-content-between modal-footer control",children:[Object(b.jsx)("button",{type:"button",onClick:()=>t(i.b.OFFER_LETTER),className:"pl-0 btn btn-ghost btn-lg",children:p("lender-web-app-back")}),Object(b.jsx)(c.a,{isDisabled:!e.values.full_name,isLoading:"loading"===j,type:"submit",className:"px-5 btn btn-primary btn-lg",children:p("lender-web-app-continue")})]})]})})})}},248:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(6),s=a(13),l=a(60),c=a(12),i=a(1),r=a(9),o=a(3),d=a(11),b=a(10),u=a(4),j=a(5),p=a(19),m=a(2),h=a(68),O=a(41),v=a(7),x=a(0);function f(e){let{setCurrentStep:t,accountType:a="mobile"}=e;const f=Object(l.a)((e=>e.getOptionsByKey),u.shallow),g=Object(s.a)((e=>e.fetchUserAccounts),u.shallow),[w,_]=Object(p.a)((e=>[e.setNotLinked,e.notLinked]),u.shallow),y=Object(O.a)((e=>e.access_token)),[N,C]=Object(i.useState)("idle"),[k,S]=Object(i.useState)(""),{translate:E}=Object(m.useTranslation)();return Object(x.jsxs)("div",{className:"mt-2 mx-4 mb-4",children:[Object(x.jsxs)("h4",{style:{color:"#46b779"},children:["Add a new ",a," account"]}),"mobile"===a&&Object(x.jsx)(h.a,{visible:"mobile"===a,access_token:y,type:"account",onSuccess:async()=>{await g("refetching")},onFailed:()=>{console.log("failed")}}),"bank"===a&&Object(x.jsx)(c.c,{initialValues:{account_number:"",bank_code:""},validateOnBlur:!0,onSubmit:async e=>{try{if(C("loading"),k){if(await Object(d.a)(b.ab,"post",e),await g("refetching"),r.toast.success(E("lender-web-app-bank-added")),C("success"),_&&k)return t(j.b.AUTHORIZE),void w(!1);t(j.b.MANDATE_SIGNATURE)}else{const t=await Object(d.a)(b.Rb,"post",e);S(t.data.account_name)}C("success")}catch(a){console.error(a),C("error"),r.toast.error(Object(o.l)(a)||E("lender-web-app-error-saving-bank"))}},children:e=>Object(x.jsxs)(c.b,{onSubmit:t=>{t.preventDefault(),e.submitForm()},children:[Object(x.jsx)(v.t,{type:"tel",name:"account_number",label:E("lender-web-app-account-number")}),Object(x.jsx)(v.q,{name:"bank_code",label:"Bank",valueField:"additional_code",keyField:"additional_code",labelField:"code_description",options:f("bank")}),k&&Object(x.jsxs)("div",{className:"form-group form-floating",children:[Object(x.jsx)("input",{disabled:!0,className:"form-control",value:k,placeholder:E("lender-web-app-account-name")}),Object(x.jsx)("label",{children:E("lender-web-app-account-name")})]}),Object(x.jsx)("div",{style:{padding:0,height:"auto"},className:"modal-footer ",children:Object(x.jsx)(n.a,{isDisabled:!e.values.account_number||!e.values.bank_code,isLoading:"loading"===N,type:"submit",className:"btn btn-primary btn-lg px-5 mt-3",children:E(k?"lender-web-app-download-save":"lender-web-app-verify-account")})})]})})]})}},249:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));a(1),a(173);var n=a(5),s=a(2),l=a(15),c=a(0);function i(e){let{product:t,setCurrentStep:a}=e;const{translate:i}=Object(s.useTranslation)(),r=Object(l.a)((e=>e.country)),o=Object(l.a)((e=>e.mobile_money_provider));return Object(c.jsxs)("div",{className:"card default-card",children:[Object(c.jsx)("div",{className:"row mx-4 py-4 loan-modal-body",children:Object(c.jsxs)("div",{className:"mx-auto",children:[Object(c.jsx)("h4",{className:"fw-bold my-3 chooseHeader",children:i("lender-web-app-choose-payment-method")}),Object(c.jsxs)("div",{className:"choose-payment-holder",children:[Object(c.jsx)("div",{className:"btn btn-outline-primary mb-3",onClick:()=>{a(n.b.REPAYMENT_METHOD)},children:i("lender-web-app-pay-debit")}),"NGA"===r&&Object(c.jsx)("div",{className:"btn btn-outline-primary mb-3",onClick:()=>{a(n.b.INFO_MANDATE)},children:i("lender-web-app-pay-bank")}),o&&"none"!=o&&Object(c.jsx)("div",{className:"btn btn-outline-primary",onClick:()=>{a(n.b.MOBILE_MONEY)},children:"Pay with Mobile Money"})]})]})}),Object(c.jsx)("div",{className:"d-flex justify-content-between modal-footer control ",children:Object(c.jsx)("button",{type:"button",onClick:()=>{"after-loan-request"===(null===t||void 0===t?void 0:t.attributes["request-payment-method"])?a(n.b.OFFER_SELECTION):a(n.b.PROFESSIONAL_INFO)},className:"btn py-3 pl-0 btn-ghost btn-lg",children:i("lender-web-app-back")})})]})}},25:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(1),s=a(217),l=a.n(s),c=a(2),i=a(0);const r=document.getElementById("modal-root");function o(e){return l.a.createPortal(Object(i.jsx)(d,{...e}),r)}function d(e){let{show:t,close:a,description:s,children:l,subDescription:r,additionalHeaderButton:o,className:d,fixed:b=!1,isUpload:u=!1}=e;Object(n.useEffect)((()=>{const{body:e}=document;return e.classList[t?"add":"remove"]("modal-open"),()=>{e.classList.remove("modal-open")}}),[t]);const{translate:j}=Object(c.useTranslation)();return Object(i.jsxs)(i.Fragment,{children:[Object(i.jsx)("div",{className:"modal-backdrop ".concat(t?"show":"fade")}),Object(i.jsx)("div",{className:"modal fade ".concat(t?"show":""),style:{display:t?"block":"none"},tabIndex:-1,"aria-hidden":!t,children:Object(i.jsx)("div",{className:"modal-dialog modal-dialog-centered",children:Object(i.jsxs)("div",{className:"modal-content ".concat(d," ").concat(b?"fixed-modal":""),children:[Object(i.jsxs)("div",{style:{height:r?"100px":"72px"},className:"modal-header",children:[Object(i.jsxs)("h5",{className:"modal-title",id:"uploadDocLabel",children:[u?"".concat(j("lender-web-app-upload")," -"):""," ",Object(i.jsx)("span",{className:"text-capitalize",children:s}),r&&Object(i.jsx)("p",{className:"f-14px modal-subtitle fw-normal",children:r})]}),Object(i.jsxs)("div",{className:"d-flex align-items-center ms-1 gap-4",children:[o,Object(i.jsx)("button",{onClick:a,type:"button",className:"close","data-bs-dismiss":"modal","aria-label":"Close",children:Object(i.jsx)("svg",{width:"16",height:"16",children:Object(i.jsx)("use",{className:"text-app-gray",xlinkHref:"/icon-sprite.svg#close-icon"})})})]})]}),l]})})})]})}},250:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(235),s=a(19),l=a(1),c=a(20),i=a(16),r=a(4),o=a(2),d=a(0);function b(e){let{customMessage:t}=e;const[a,b,u,j]=Object(s.a)(Object(l.useCallback)((e=>[e.errorMessage,e.closeLoanModal,e.fetchLoans,e.fetchDraftLoans]),[]),r.shallow),{translate:p}=Object(o.useTranslation)();return Object(d.jsxs)("div",{className:"card default-card",children:[Object(d.jsx)("div",{className:"row mx-4 loan-modal-body",children:Object(d.jsxs)("div",{style:{maxWidth:"308px"},className:" mx-auto text-center my-auto ",children:[Object(d.jsxs)("svg",{width:"75",height:"65",viewBox:"0 0 75 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-danger",children:[Object(d.jsx)("path",{d:"M72.0521 64.5245C69.5635 65.2157 68.25 64.2479 67.9735 63.0728C66.8674 49.1779 53.3873 38.2555 37.1421 38.2555C37.0729 38.2555 37.073 38.2555 37.0038 38.2555C36.9347 38.2555 36.9347 38.2555 36.8656 38.2555C20.6203 38.2555 7.07107 49.1779 6.03413 63.0728C5.68849 64.2479 4.44417 65.2157 1.95554 64.5245C0.0199339 63.9714 -0.187454 62.0358 0.15819 60.7224C2.50857 44.961 18.2008 32.9326 36.9347 32.9326C37.0038 32.9326 37.0038 32.9326 37.0729 32.9326C37.1421 32.9326 37.1421 32.9326 37.2112 32.9326C55.9451 32.9326 71.6373 44.961 73.9877 60.7224C74.1951 62.1049 73.9877 64.0406 72.0521 64.5245Z",fill:"currentColor"}),Object(d.jsx)("path",{d:"M22.003 6.3871C22.003 9.56703 19.4452 12.1248 16.2653 12.1248C13.0854 12.1248 10.5276 9.56703 10.5276 6.3871C10.5276 3.20718 13.0854 0.649414 16.2653 0.649414C19.4452 0.649414 22.003 3.20718 22.003 6.3871Z",fill:"currentColor"}),Object(d.jsx)("path",{d:"M63.3421 6.3871C63.3421 9.56703 60.7843 12.1248 57.6044 12.1248C54.4245 12.1248 51.8667 9.56703 51.8667 6.3871C51.8667 3.20718 54.4245 0.649414 57.6044 0.649414C60.7843 0.649414 63.3421 3.20718 63.3421 6.3871Z",fill:"currentColor"})]}),Object(d.jsx)("h4",{className:"fw-bold my-3",children:"We are sorry"}),Object(d.jsx)("small",{className:"text-small text-app-gray",dangerouslySetInnerHTML:{__html:a||t||"You\u2019re not eligible for a loan at this time."}}),Object(d.jsx)(c.b,{onClick:()=>{b(),u(),j()},to:i.a.loans.base,className:"btn btn-primary btn-lg px-5 mt-4",children:p("lender-web-app-view-loans")})]})}),Object(d.jsx)(n.a,{})]})}},251:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));var n=a(6),s=a(19),l=a(1),c=a(5),i=a(2),r=a(13),o=a(0);function d(e){let{setCurrentStep:t,product:a,showConfigurableForm:d}=e;const b=Object(r.a)((e=>e.banks)),u=Object(r.a)((e=>e.fetchUserAccounts)),j=Object(r.a)((e=>e.banksStatus)),p=Object(s.a)((e=>e.setMobileBank)),m=Object(s.a)((e=>e.loanRequestData));Object(l.useEffect)((()=>{u()}),[]);const{translate:h}=Object(i.useTranslation)(),[O,v]=Object(l.useState)(!1);return Object(o.jsxs)("div",{className:"card default-card",children:[Object(o.jsxs)("div",{className:"mx-0 modal-body loan-modal-body pt-4 pb-2 row",children:["loading"===j&&Object(o.jsx)("div",{style:{maxWidth:"550px",minHeight:"500px"},className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(o.jsx)("div",{className:"spinner-border text-primary",children:Object(o.jsxs)("span",{className:"visually-hidden",children:[h("lender-web-app-loading"),"..."]})})})||"success"===j&&Object(o.jsxs)("div",{className:"pl-4 col-12",children:[Object(o.jsx)("div",{className:"mb-4 tab-content__header",children:Object(o.jsx)("p",{className:"text-primary fs-5 fw-bold",children:"Choose your Mobile Wallet"})}),Object(o.jsx)("p",{className:"mb-3 text-primary",children:h("lender-web-app-solely-repayment")}),Object(o.jsxs)("div",{children:[Object(o.jsx)("button",{className:"text-primary mx-auto mb-1 d-block bg-transparent border-0",style:{width:"fit-content"},onClick:()=>{t(c.b.ADD_MOBILE_MONEY)},children:"Add Mobile Wallet"}),b.filter((e=>"mobile"===e.account_type)).map((e=>{var t;return Object(o.jsxs)("label",{onClick:()=>(e=>{p(e),v(!0)})({...e,back_to_list:!0}),className:"card_radio position-relative mandate-card bg-light-primary border-0 row-new",children:[Object(o.jsx)("input",{readOnly:!0,type:"radio",name:"mandate_id",value:e.id}),Object(o.jsx)("div",{className:"content d-flex justify-content-between ",children:Object(o.jsxs)("div",{className:"mobile-money-container",children:[Object(o.jsx)("svg",{width:"11",className:"unchecked-icon text-primary",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(o.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"})}),Object(o.jsxs)("svg",{className:"checked-icon text-primary",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(o.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"}),Object(o.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"currentColor"})]}),Object(o.jsx)("div",{className:"mobile-bank-number",children:Object(o.jsx)("p",{className:"small",children:"".concat(null===e||void 0===e?void 0:e.account_number)})}),Object(o.jsx)("img",{className:"bank-logo",src:null!==(t=e.url)&&void 0!==t?t:"https://documents.lendsqr.com/lsq-lendstack-files/logos/default_bank.png",alt:"bank logo"})]})})]},e.id)}))]})]})||Object(o.jsx)("div",{className:" d-flex justify-content-center align-items-center",children:Object(o.jsx)("p",{className:"",children:h("lender-web-app-error-fetching-records")})})," "]}),Object(o.jsxs)("div",{className:"col-12 modal-footer control justify-content-between d-flex",children:[Object(o.jsx)(n.a,{onClick:()=>{const e=null===a||void 0===a?void 0:a.attributes["repayment-methods"];e["debit-card"]?t(c.b.REPAYMENT_METHOD):e["direct-debit"]?t(c.b.INFO_MANDATE):"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])?t(c.b.PROFESSIONAL_INFO):t(c.b.OFFER_SELECTION)},className:"px-5 btn btn-ghost",children:h("lender-web-app-back")}),Object(o.jsx)(n.a,{onClick:()=>{console.log(m),"before-loan-request"!==(null===a||void 0===a?void 0:a.attributes["request-payment-method"])||d?"before-loan-request"===(null===a||void 0===a?void 0:a.attributes["request-payment-method"])&&d?t(c.b.OFFER_SELECTION):t(c.b.AUTHORIZE):t(c.b.CONFIRM)},className:"px-5 btn btn-primary",isDisabled:!O,children:h("lender-web-app-continue")})]})]})}},252:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));a(1),a(173);var n=a(5),s=a(2),l=a(68),c=a(41),i=a(13),r=a(4),o=a(0);function d(e){let{product:t,setCurrentStep:a}=e;const{translate:d}=Object(s.useTranslation)(),b=Object(c.a)((e=>e.access_token)),[u]=Object(i.a)((e=>[e.fetchUserAccounts]),r.shallow);return Object(o.jsxs)("div",{className:"card default-card",children:[Object(o.jsx)("div",{className:"row mx-4 py-4 loan-modal-body",children:Object(o.jsxs)("div",{className:"mx-auto relative",children:[Object(o.jsx)("h4",{className:"fw-bold chooseHeader",children:"Add Mobile Wallet"}),Object(o.jsx)("div",{className:"custom-integrations-holder",children:Object(o.jsx)(l.a,{visible:!0,access_token:b,type:"mobile-account",onSuccess:async()=>{await u("refetching"),a(n.b.MOBILE_MONEY)},onFailed:()=>{a(n.b.MOBILE_MONEY)}})})]})}),Object(o.jsx)("div",{className:"d-flex justify-content-between modal-footer control ",children:Object(o.jsx)("button",{type:"button",onClick:()=>{"after-loan-request"===(null===t||void 0===t?void 0:t.attributes["request-payment-method"])?a(n.b.OFFER_SELECTION):a(n.b.PROFESSIONAL_INFO)},className:"btn py-3 pl-0 btn-ghost btn-lg",children:d("lender-web-app-back")})})]})}},253:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var n=a(1),s=a(6),l=a(25),c=a(12),i=a(132),r=a(4),o=a(3),d=a(11),b=a(10),u=a(9),j=a.n(u),p=a(8),m=a(13),h=a(18),O=a(2),v=a(7),x=a(0);const f=e=>{let{setShowModal:t,showModal:a}=e;const[s,c]=Object(n.useState)("initiate"),[o]=Object(i.a)((e=>[e.reset]),r.shallow);Object(n.useEffect)((()=>{c("initiate"),o()}),[a,o]);const{translate:d}=Object(O.useTranslation)();return Object(x.jsx)(l.a,{close:()=>t(!1),description:d("lender-web-app-fund-account"),show:a,isUpload:!1,children:"initiate"===s?Object(x.jsx)(_,{setScreen:c}):"confirm"===s?Object(x.jsx)(w,{setScreen:c}):"success"===s?Object(x.jsx)(g,{setShowModal:t}):Object(x.jsx)(_,{setScreen:c})})},g=e=>{let{setShowModal:t}=e;const[a]=Object(i.a)((e=>[e.amount]),r.shallow),{translate:n}=Object(O.useTranslation)();return Object(x.jsxs)(x.Fragment,{children:[Object(x.jsx)("div",{className:"modal-body account-modal-body",children:Object(x.jsxs)("div",{className:"d-flex py-35 flex-column align-items-center",children:[Object(x.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(x.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(x.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(x.jsxs)("defs",{className:"text-primary",children:[Object(x.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(x.jsx)("stop",{stopColor:"#41A1CE"}),Object(x.jsx)("stop",{offset:"1",stopColor:"#016AB3"})]}),Object(x.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(x.jsx)("stop",{stopColor:"#41A1CE"}),Object(x.jsx)("stop",{offset:"1",stopColor:"#016AB3"})]})]})]}),Object(x.jsx)("h6",{className:"mt-35 mb-3",children:n("lender-web-app-wallet-successful")}),Object(x.jsxs)("p",{children:[n("lender-web-app-wallet-successful-with")," ",Object(x.jsxs)("span",{style:{color:"#3DB99B"},children:[a&&Object(o.q)(+a),"."]})]})]})}),Object(x.jsx)("div",{className:"modal-footer",children:Object(x.jsx)(s.a,{onClick:()=>t(!1),type:"submit",className:"btn btn-primary",children:n("lender-web-app-close")})})]})},w=e=>{let{setScreen:t}=e;const[a,l]=Object(n.useState)(""),[c,d,b,u,j,p]=Object(i.a)((e=>[e.status,e.transaction_amount,e.amount,e.card,e.fundCard,e.method]),r.shallow),[f]=Object(m.a)((e=>[e.wallet]),r.shallow),{translate:g}=Object(O.useTranslation)();return Object(x.jsxs)(x.Fragment,{children:[Object(x.jsxs)("div",{className:"modal-body account-modal-body",children:["bank"===p&&Object(x.jsx)("p",{className:" mb-3",children:g("lender-web-app-copy-virtual")}),"card"===p&&Object(x.jsxs)(x.Fragment,{children:[Object(x.jsx)("div",{className:"",children:Object(x.jsx)(y,{})}),Object(x.jsx)("p",{className:" mt-3",children:g("lender-web-app-enter-your-pin")}),Object(x.jsx)(v.o,{length:4,onChange:e=>{l(e)},password:!0})]})||"bank"===p&&Object(x.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-35",children:[Object(x.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(x.jsxs)("div",{children:[Object(x.jsx)("p",{className:"text-app-gray",children:g("lender-web-app-bank-name")}),Object(x.jsx)("p",{children:null===f||void 0===f?void 0:f.virtual_accounts[0].bank_name})]}),Object(x.jsxs)("div",{className:" text-right",children:[Object(x.jsx)("p",{className:"text-app-gray",children:g("lender-web-app-account-number")}),Object(x.jsxs)("div",{className:"d-flex",children:[Object(x.jsx)("p",{className:"me-2",children:null===f||void 0===f?void 0:f.virtual_accounts[0].account_number}),Object(x.jsx)("img",{onClick:()=>Object(h.d)(null===f||void 0===f?void 0:f.virtual_accounts[0].account_number),className:"cursor-pointer",src:"/copy.svg",alt:""})]})]})]}),Object(x.jsx)("div",{className:"d-flex  mt-3  justify-content-between",children:Object(x.jsxs)("div",{children:[Object(x.jsx)("p",{className:"text-app-gray",children:g("lender-web-app-total-amount")}),Object(x.jsx)("p",{children:Object(o.q)(Number(b)+Number(d))})]})})]})||"ussd"===p&&Object(x.jsx)(N,{copyToClipBoard:h.d,setScreen:t})||null]}),Object(x.jsxs)("div",{className:"modal-footer ",children:[Object(x.jsx)(s.a,{onClick:()=>t("initiate"),type:"submit",className:"btn btn-outline-primary",children:g("lender-web-app-back")}),Object(x.jsx)(s.a,{onClick:async()=>{try{"card"===p&&await j(a),t("success")}catch(s){var e,n;console.log(null===s||void 0===s||null===(e=s.response)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.message)}},isLoading:"loading"===c,isDisabled:"card"===p&&(!u||a.length<4),type:"submit",className:"btn btn-primary",children:"card"===p?"Confirm details":"I have paid"})]})]})},_=e=>{let{setScreen:t}=e;const[a,n,l,c,d,b,u,j]=Object(i.a)((e=>[e.status,e.fetchUssd,e.setIdle,e.setMethod,e.method,e.setAmount,e.amount,e.transaction_amount]),r.shallow),{translate:p}=Object(O.useTranslation)();return Object(x.jsxs)(x.Fragment,{children:[Object(x.jsxs)("div",{className:"modal-body account-modal-body",children:[Object(x.jsx)("p",{className:"modal-body__p",children:p("lender-web-ask-fund-amount")}),Object(x.jsxs)("div",{className:"modal-form",children:[Object(x.jsx)("div",{className:"form-group mb-3",children:Object(x.jsx)(v.e,{label:"",className:"form-control",onChange:e=>{b(e),l()}})}),Object(x.jsx)("p",{className:"small text-app-gray mb-2 mt-35",children:p("lender-web-app-payment-method")}),Object(x.jsx)("div",{className:"row type justify-between",children:[{label:"Debit card",value:"card"},{label:"Bank transfer",value:"bank"},{label:"USSD",value:"ussd"}].map((e=>Object(x.jsx)("div",{className:"col-6 col-sm-4",children:Object(x.jsx)(v.g,{disabled:!u||u<100,checked:d===e.value,onChange:e=>c(e.target.value),onClick:()=>n(e.value),label:e.label,name:"payment_method",value:e.value})},e.value)))}),"loading"===a&&Object(x.jsx)("div",{className:"d-flex py-3 justify-content-center align-items-center",children:Object(x.jsx)("div",{className:"spinner-border text-primary",role:"status",children:Object(x.jsxs)("span",{className:"visually-hidden",children:[p("lender-web-app-loading"),"..."]})})}),"success"===a&&d&&Object(x.jsxs)(x.Fragment,{children:[Object(x.jsx)("p",{className:"small mb-2 mt-3",children:p("lender-web-app-confirm-transactions")}),Object(x.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-4",children:[Object(x.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(x.jsxs)("div",{className:"",children:[Object(x.jsx)("p",{className:"text-app-gray",children:p("lender-web-app-amount")}),Object(x.jsx)("p",{children:Object(o.q)(u)})]}),Object(x.jsxs)("div",{className:"text-right",children:[Object(x.jsx)("p",{className:"text-app-gray",children:p("lender-web-app-transaction-fee")}),Object(x.jsx)("p",{children:Object(o.q)(j)})]})]}),Object(x.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(x.jsx)("div",{className:"",children:Object(x.jsx)(x.Fragment,{})}),Object(x.jsxs)("div",{className:" text-right",children:[Object(x.jsx)("p",{className:"text-app-gray",children:p("lender-web-app-total-amount")}),Object(x.jsx)("p",{children:Object(o.q)(Number(u)+Number(j))})]})]})]})]})]})]}),Object(x.jsx)("div",{className:"modal-footer",children:Object(x.jsx)(s.a,{isDisabled:"loading"===a||!d,form:"card-submit",onClick:()=>t("confirm"),type:"submit",className:"btn btn-primary",children:p("lender-web-app-continue")})})]})},y=()=>{const[e,t,a,l,c,o]=Object(i.a)((e=>[e.setCard,e.bank_data,e.card,e.status,e.fetchUssd,e.setSuccess]),r.shallow),[u,p]=Object(n.useState)("idle"),m=Object(n.useCallback)((async()=>{if(!window.PaystackPop)return void p("error");const e=await Object(d.a)(b.wb,"post"),{reference:t,...a}=e.data,n={ref:t,...a,callback(e){p("verifying"),Object(d.a)(b.Sb,"post",{reference:e.reference}).then((()=>c("card"))).then((()=>{j.a.success(h("lender-web-app-card-added")),o()})).catch((e=>{p("error"),j.a.error((null===e||void 0===e?void 0:e.message)||h("lender-web-app-error-adding-card"))}))},onClose(){p("confirm")}},s=window.PaystackPop.setup(n);p("paying"),s.openIframe()}),[c,o]),{translate:h}=Object(O.useTranslation)();return["loading","verifying"].includes(u)&&Object(x.jsx)("div",{className:"d-flex py-3 justify-content-center align-items-center",children:Object(x.jsx)("div",{className:"spinner-border text-primary",children:Object(x.jsxs)("span",{className:"visually-hidden",children:[h("lender-web-app-loading"),"..."]})})})||"error"===u&&Object(x.jsx)("div",{className:"d-flex py-3 justify-content-center align-items-center",children:Object(x.jsx)("h4",{className:"text-black-50",children:h("lender-web-app-error-adding-card")})})||"adding"===l&&Object(x.jsx)("div",{className:"d-flex justify-content-center",children:Object(x.jsx)(s.a,{className:"btn btn-outline-primary  mt-3",onClick:m,children:h("lender-web-app-click-add-card")})})||Object(x.jsxs)(x.Fragment,{children:[Object(x.jsx)("p",{className:"small mb-3",children:"Choose the card you would like to use"}),Object(x.jsxs)("div",{className:"cards d-flex w-100",children:[Object(x.jsx)("div",{style:{minWidth:"140px"},className:"add-card my-2  mx-1",children:Object(x.jsxs)("button",{onClick:m,className:"add-btn px-2 rounded-3 border-0 h-100 w-100",children:[Object(x.jsx)("svg",{width:"18",height:"24",children:Object(x.jsx)("use",{xlinkHref:"/icon-sprite.svg#addition"})}),Object(x.jsx)("small",{className:"mt-2 d-block",children:h("lender-web-app-add-card")})]})}),null===t||void 0===t?void 0:t.cards.map((t=>Object(x.jsx)(v.f,{checked:(null===a||void 0===a?void 0:a.id)===t.id,onClick:()=>e(t),logo:t.logo_url,name:"card",cardName:"".concat("X".repeat(4),"  ").concat("X".repeat(4)," ").concat(t.card_last4),number:"".concat(t.card_exp_month,"/").concat(t.card_exp_year)},t.id)))]})]})};function N(e){let{setScreen:t,copyToClipBoard:a}=e;const[s]=Object(i.a)(Object(n.useCallback)((e=>[e.bank_data]),[]),r.shallow),{translate:l}=Object(O.useTranslation)();return Object(x.jsx)("div",{className:"",children:Object(x.jsx)(c.c,{initialValues:{bank_code:""},validationSchema:p.g().shape({bank_code:p.h().required(l("lender-web-app-please-select-bank"))}),onSubmit:async()=>{try{t("success")}catch(e){return null}},children:e=>{var t,n,i,r;return Object(x.jsxs)(c.b,{method:"post",id:"card-submit",onSubmit:e.handleSubmit,children:[Object(x.jsx)("p",{className:"small mb-3",children:l("lender-web-app-select-bank")}),Object(x.jsx)(v.q,{name:"bank_code",label:"Bank",keyField:"additional_code",valueField:"additional_code",labelField:"code_description",options:null===s||void 0===s?void 0:s.ussds}),e.values.bank_code&&Object(x.jsx)("div",{className:"mt-3 rounded-3 p-35 bg-light-blue",children:Object(x.jsxs)("div",{className:"d-flex flex-column align-items-center",children:[Object(x.jsx)("p",{className:"text-app-gray small text-uppercase",children:l("lender-web-app-ussd-code",{banks:null===s||void 0===s||null===(t=s.ussds)||void 0===t||null===(n=t.find((t=>t.additional_code===e.values.bank_code)))||void 0===n?void 0:n.code_description})}),Object(x.jsxs)("div",{className:"d-flex mt-2",children:[Object(x.jsx)("h4",{style:{marginBottom:0},className:" me-2",children:null===s||void 0===s||null===(i=s.ussds)||void 0===i||null===(r=i.find((t=>t.additional_code===e.values.bank_code)))||void 0===r?void 0:r.ussd}),Object(x.jsx)("img",{onClick:()=>{var t,n;return a(null===s||void 0===s||null===(t=s.ussds)||void 0===t||null===(n=t.find((t=>t.additional_code===e.values.bank_code)))||void 0===n?void 0:n.ussd)},className:"cursor-pointer",src:"/copy.svg",alt:""})]}),Object(x.jsxs)("p",{className:"text-app-gray small mt-1",children:[" ",l("lender-web-app-dial-code")]})]})})]})}})})}},254:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(1),s=a(84),l=a(4),c=a(3),i=a(6),r=a(21),o=a(2),d=a(0);function b(){var e,t;const a=null===(e=Object(r.i)().location)||void 0===e||null===(t=e.search)||void 0===t?void 0:t.split("=").pop(),{translate:b}=Object(o.useTranslation)(),[u,j,p,m,h]=Object(s.a)((e=>[e.getTransaction,e.loadingTransaction,e.transactionDetail,e.getTransactionReceipt,e.loadingReceipt]),l.shallow);Object(n.useEffect)((()=>{a&&u(a)}),[a]);return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)("div",{className:"modal-body",children:"loading"===j&&Object(d.jsx)("div",{style:{minHeight:"200px"},className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(d.jsx)("div",{className:"spinner-border text-primary",children:Object(d.jsxs)("span",{className:"visually-hidden",children:[b("lender-web-app-loading"),"..."]})})})||"success"===j&&Object(d.jsxs)(d.Fragment,{children:[Object(d.jsxs)("div",{className:"d-sm-flex flex-wrap justify-content-between",children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("p",{className:"small mb-1 col col-sm-6 text-app-gray",children:b("lender-web-app-type")}),Object(d.jsx)("p",{className:"fs-18",children:null===p||void 0===p?void 0:p.type})]}),Object(d.jsxs)("div",{className:"text-sm-end col col-sm-6 mt-3 mt-sm-0",children:[Object(d.jsx)("p",{className:"small mb-1 text-app-gray",children:b("lender-web-app-details")}),Object(d.jsx)("p",{className:"fs-18",children:null===p||void 0===p?void 0:p.meta})]})]}),Object(d.jsxs)("div",{className:"d-sm-flex flex-wrap mt-3  justify-content-between",children:[Object(d.jsxs)("div",{className:" col col-sm-6 ",children:[Object(d.jsx)("p",{className:"small mb-1 text-app-gray",children:b("lender-web-app-amount")}),Object(d.jsx)("p",{className:"fs-18",children:Object(c.q)(null===p||void 0===p?void 0:p.amount,null===p||void 0===p?void 0:p.currency)})]}),Object(d.jsxs)("div",{className:"text-sm-end  col col-sm-6  mt-3 mt-sm-0",children:[Object(d.jsx)("p",{className:"small mb-1 text-app-gray",children:b("lender-web-app-date")}),Object(d.jsx)("p",{className:"fs-18",children:Object(c.w)(null===p||void 0===p?void 0:p.created_on)})]})]}),Object(d.jsxs)("div",{className:"d-sm-flex flex-wrap mt-3 justify-content-between",children:[Object(d.jsxs)("div",{className:" col col-sm-6 ",children:[Object(d.jsx)("p",{className:"small mb-1  col col-sm-6  text-app-gray",children:b("lender-web-app-status")}),Object(d.jsx)("p",{className:"text-capitalize fs-18",children:null===p||void 0===p?void 0:p.status})]}),Object(d.jsxs)("div",{className:"text-sm-end  col col-sm-6  mt-3 mt-sm-0",children:[Object(d.jsx)("p",{className:"small mb-1 text-app-gray",children:b("lender-web-app-reference")}),Object(d.jsx)("p",{className:"fs-18",children:null===p||void 0===p?void 0:p.reference})]})]}),Object(d.jsx)("div",{className:"d-sm-flex mt-3 justify-content-between",children:Object(d.jsxs)("div",{className:" col col-sm-6 ",children:[Object(d.jsx)("p",{className:"small mb-1 text-app-gray",children:b("lender-web-app-payment-method")}),Object(d.jsx)("p",{className:"fs-18",children:b("lender-web-app-web")})]})})]})||Object(d.jsx)("div",{className:" d-sm-flex justify-content-center align-items-center",children:Object(d.jsx)("p",{className:"",children:b("lender-web-app-error-fetching-transaction")})})}),Object(d.jsx)("div",{className:"modal-footer",children:"success"===j&&Object(d.jsx)(i.a,{className:"btn btn-primary",onClick:()=>{return e=null===p||void 0===p?void 0:p.id,void m(e);var e},isLoading:"loading"===h,children:b("lender-web-app-download-receipt")})})]})}},255:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(2),s=a(6),l=a(25),c=a(0);function i(e){let{showPrompt:t,close:a,logout:i,warningMessage:r,description:o}=e;const{translate:d}=Object(n.useTranslation)();return Object(c.jsxs)(l.a,{show:t,close:a,description:o,isUpload:!1,className:"small-modal",children:[Object(c.jsx)("div",{className:"modal-body py-5 d-flex text-center align-items-center flex-column",children:Object(c.jsx)("p",{style:{maxWidth:"300px",fontSize:"18px"},className:"d-block text-black-500",children:r})}),Object(c.jsxs)("div",{className:"modal-footer logout-footer justify-content-between align-items-center",children:[Object(c.jsx)(s.a,{type:"button",onClick:a,className:"btn text-primary ",children:d("lender-web-app-cancel")}),Object(c.jsx)(s.a,{isLoading:!1,onClick:()=>{i()},className:"btn btn-danger",children:d("lender-web-app-yes")})]})]},o)}},258:function(e,t,a){"use strict";a.d(t,"b",(function(){return ye})),a.d(t,"a",(function(){return Ne}));var n=a(21),s=a(16),l=a(1),c=a(20),i=a(4),r=a(53),o=a(61),d=a(33),b=a(11),u=a(10),j=a(9),p=a.n(j),m=a(24),h=a.n(m),O=a(442),v=a(59),x=a(18);Object(d.b)();const f={savingsStatus:"idle",fetchSavingStatus:"idle",savings:[],frequencyStatus:"idle",frequencies:null,schedules:[],breakdown:{},savingCompletionStatus:"idle",mySavings:[],savingTransactions:[],savingDetail:null,archivingStatus:"idle",showSavingModal:!1,cardToUse:null};var g=Object(r.create)()(Object(o.persist)(((e,t)=>({...f,fetchProducts:async()=>{const{reset:a}=t();try{a(),e({savingsStatus:"loading"});const t=await Object(b.a)(u.B,"get"),n=await Object(b.a)(u.E,"get");e({savings:null===t||void 0===t?void 0:t.data,mySavings:null===n||void 0===n?void 0:n.data,savingsStatus:"success"})}catch(n){e({savingsStatus:"error"})}},updateMySavings:async()=>{try{e({savingsStatus:"updating"});const t=await Object(b.a)(u.E,"get");e({mySavings:null===t||void 0===t?void 0:t.data,savingsStatus:"success"})}catch(t){e({savingsStatus:"error"})}},fetchSaving:async a=>{e({fetchSavingStatus:"loading"});const{savings:n,fetchProducts:s}=t();try{const{data:t}=await Object(b.a)(Object(u.G)(a),"get"),l=await Object(b.a)(Object(u.F)(a),"get");n||await s();const c=null===n||void 0===n?void 0:n.find((e=>e.id===t.product_id));e({fetchSavingStatus:"success",savingDetail:{details:t,savingType:c,balance:l.data}})}catch(l){p.a.error(null===l||void 0===l?void 0:l.message),e({fetchSavingStatus:"error"})}},fetchSavingTransactions:async t=>{e({fetchSavingStatus:"loading"});try{const{data:a}=await Object(b.a)(Object(u.H)(t),"get");e({fetchSavingStatus:"success",savingTransactions:a})}catch(a){p.a.error(null===a||void 0===a?void 0:a.message),e({fetchSavingStatus:"error"})}},fetchFrequencies:async()=>{try{e({frequencyStatus:"loading"});const{data:t}=await Object(b.a)(u.u,"get");e({frequencies:t,frequencyStatus:"success"})}catch(t){e({frequencyStatus:"error"})}},saving:e=>{var a,n;const{savings:s}=t();if(!e)return{savingProduct:void 0,savingOffers:[],offer:void 0};const{productTypeId:l,productId:c}=JSON.parse(e),i=l,r=c,o=null===s||void 0===s?void 0:s.find((e=>e.id===i)),d=null===o||void 0===o||null===(a=o.offers)||void 0===a?void 0:a.find((e=>e.id===r));return{savingProduct:o,savingOffers:null!==(n=null===o||void 0===o?void 0:o.offers)&&void 0!==n?n:[],offer:d}},setCardToUse:async t=>{e({cardToUse:t})},setSchedules:async t=>{e({schedules:t})},setBreakdown:async t=>{e({breakdown:t})},openSavingModal:()=>{e({showSavingModal:!0})},closeSavingModal:(t,a)=>{const n=Object(v.b)(a);t.replace({search:n.toString()}),e({showSavingModal:!1})},reset:()=>{e(f)},createSavings:async a=>{var n;e({savingCompletionStatus:"loading"});const{schedules:s,cardToUse:l}=t(),{name:c,product_id:i,product_offer:r,tenor_id:o,start_date:d,target:j,frequency:m,automated:O}=a,v={name:c,product_id:i,tenor:o,offer_id:r,target:j*s.length,start_date:h()(d).add(1,"days"),periodic_amount:null===(n=s[0])||void 0===n?void 0:n.amount_saved,frequency_id:(null===m||void 0===m?void 0:m.id)||1,collection_method_id:O,card_id:l};try{return await Object(b.a)(u.sb,"post",v),e({savingCompletionStatus:"success"}),!0}catch(x){e({savingCompletionStatus:"error"}),p.a.error(null===x||void 0===x?void 0:x.message)}},updateSavings:async(a,n,s,l,c)=>{var i;e({savingCompletionStatus:"loading"});const{cardToUse:r}=t(),o=_(n,s,l,c.balance),{name:d,periodic_amount:j,frequency:m,automated:h}=n;let O;var v;null!==s&&void 0!==s&&null!==(i=s.product)&&void 0!==i&&i.is_fixed?O={name:d}:O={name:d,periodic_amount:j,target:o.total_contribution,frequency_id:(null===m||void 0===m?void 0:m.id)||1,card_id:r||(null===s||void 0===s||null===(v=s.card)||void 0===v?void 0:v.id),collection_method_id:h};try{return await Object(b.a)(Object(u.Zb)(a),"put",O),e({savingCompletionStatus:"success"}),!0}catch(x){e({savingCompletionStatus:"error"}),p.a.error(null===x||void 0===x?void 0:x.message)}},archiveSavings:async t=>{e({archivingStatus:"loading"});try{return await Object(b.a)(Object(u.b)(t),"post"),e({archivingStatus:"success"}),!0}catch(a){e({archivingStatus:"error"}),p.a.error(null===a||void 0===a?void 0:a.message)}},restoreSavings:async t=>{e({archivingStatus:"loading"});try{return await Object(b.a)(Object(u.cc)(t),"post"),e({archivingStatus:"success"}),!0}catch(a){e({archivingStatus:"error"}),p.a.error(null===a||void 0===a?void 0:a.message)}}})),{name:"app.savings"}));const w=(e,t,a)=>{let n=(e*Math.pow(1+t/100,1)-e)/360*a;return n=Number(n.toFixed(2)),n},_=(e,t,a,n)=>{var s,l,c;const i=Number(null===e||void 0===e?void 0:e.periodic_amount),{start_date:r}=e,o=null===t||void 0===t?void 0:t.offer;let d=(null===o||void 0===o?void 0:o.tenor_period)||"days";d=d.endsWith("s")?d:"".concat(d,"s");const b=Object(x.l)(d),u=(null===e||void 0===e||null===(s=e.proposed_tenor)||void 0===s?void 0:s.toString())*b,j=(null===o||void 0===o?void 0:o.interest_rate)||0,p=(null===a||void 0===a?void 0:a.withholding_tax_rate)||0,m=h()(r,"YYYY/MM/DD").add(u,"days").format("yyyy-MM-DD");let v=0,f=0;const g=[],_=(e=>{let t=1;return"monthly"===e?t=30:"weekly"===e&&(t=7),t})(null===e||void 0===e||null===(l=e.frequency)||void 0===l||null===(c=l.name)||void 0===c?void 0:c.toLowerCase()),y=Math.floor(u/_);let N=0;for(let x=0;x<y;x++){let e=0;const t=h()(r,"YYYY/MM/DD").add(x,d).format("yyyy-MM-DD");h()(t).isAfter(Object(O.a)())&&(x>0&&(e=w(N,j,_),f+=e),N=N+i+e,g.push({index:x,due_date:t,amount_saved:i,balance:N}),v+=i)}return{total_contribution:v+n,maturity_value:v+f,maturity_date:m,interest_earned:f,interest_rate:j,withholding_tax:p/100*f,withholding_tax_rate:p,schedules:g}};var y=a(3),N=a(2),C=a(0);var k=e=>{let{balance:t,is_fixed:a}=e;const n=Number(null===t||void 0===t?void 0:t.balance)/Number(null===t||void 0===t?void 0:t.target)||0,{translate:s}=Object(N.useTranslation)();return Object(C.jsxs)("div",{className:"balance",children:[Object(C.jsx)("p",{children:s("lender-web-app-balance")}),Object(C.jsx)("h3",{children:Object(y.q)(t.balance,null===t||void 0===t?void 0:t.currency)}),!a&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{style:{fontWeight:"500"},className:"d-flex mt-35 justify-content-between",children:[Object(C.jsxs)("p",{style:{color:"#31C5A1"},children:[100*n||0,"% done"]}),Object(C.jsxs)("p",{children:[s("lender-web-app-target")," ",Object(y.q)(t.target,null===t||void 0===t?void 0:t.currency)]})]}),Object(C.jsx)("div",{className:"progress mt-1",style:{height:"4px"},children:Object(C.jsx)("div",{style:{background:"#31C5A1",width:"".concat(100*n,"%")},className:"progress-bar rounded-3",role:"progressbar","aria-valuenow":75,"aria-valuemin":0,"aria-valuemax":100})})]})]})},S=a(72),E=a(6),T=a(25),A=a(12),L=a(8),M=a(114),D=a(13),F=a(90),I=a(49);function R(e){let{nextStep:t,prevStep:a,configName:n}=e;const[s,l]=g((e=>[e.cardToUse,e.setCardToUse]),i.shallow),{translate:c}=Object(N.useTranslation)();return Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"modal-body py-4",children:[Object(C.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(C.jsx)("p",{className:"text-primary  fs-5  fw-bold",children:c("lender-web-app-how-to-fund",{config_name:n})}),Object(C.jsx)("small",{className:"text-app-gray",children:c("lender-web-app-select-funding-method")})]}),Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)(P,{chosen:s,onChange:l}),Object(C.jsx)("div",{className:"mt-4"})]})]}),Object(C.jsxs)("div",{className:"d-flex modal-footer justify-content-between control",children:[a&&Object(C.jsx)("button",{type:"button",onClick:a,className:"btn py-3 me-3 pl-0 btn-ghost btn-lg",children:c("lender-web-app-back")}),Object(C.jsx)(E.a,{isDisabled:!s,onClick:t,className:"btn py-3 btn-primary btn-lg px-5 ms-auto",children:c("lender-web-app-continue")})]})]})}function P(e){let{onChange:t,chosen:a}=e;const[n,s,c,r]=Object(D.a)((e=>[e.initCard,e.cardInitStatus,e.cards,e.fetchCards]),i.shallow);Object(l.useEffect)((()=>{r()}),[]);const o=Object(l.useCallback)((e=>{t(e.target.value)}),[t]),{translate:d}=Object(N.useTranslation)();return Object(C.jsxs)("div",{className:"",children:[Object(C.jsx)("div",{className:"small ",children:Object(C.jsx)(I.c,{children:null===c||void 0===c?void 0:c.map((e=>Object(C.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(C.jsx)(M.a,{value:e.id,card:e,defaultChecked:+a===e.id,onChange:o})},e.id)))})}),Object(C.jsx)(F.a,{allowCard:!0,allowBank:!1,renderButton:e=>Object(C.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(C.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{"idle"===s?n().then((()=>e())).catch((e=>console.log(e))):e()},children:"loading"===s?Object(C.jsx)("div",{className:"spinner-border",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[d("lender-web-app-loading"),"..."]})}):Object(C.jsx)("p",{className:"mt-2",children:d("lender-web-app-add-card")})})})})]})}var q=a(29),U=a(7);var B=e=>{var t,a,s,c,r,o,d,b;let{setShowEditModal:u}=e;const{translate:p}=Object(N.useTranslation)(),{dictionary:m}=Object(l.useContext)(q.a),h=null===m||void 0===m?void 0:m.enable_and_name_savings,{params:O}=Object(n.k)(),[v,x]=Object(l.useState)(!1),[f,w,_,k,M,D,F,I,P]=g((e=>[e.fetchSaving,e.fetchSavingStatus,e.updateSavings,e.savingCompletionStatus,e.savingDetail,e.cardToUse,e.frequencyStatus,e.frequencies,e.fetchFrequencies]),i.shallow);Object(l.useEffect)((()=>{f(O.id),P()}),[O]);const B=p("lender-web-app-provide-numeric-value"),{details:V,savingType:H,balance:Y}=Object(l.useMemo)((()=>M||{details:null,savingType:null,balance:null}),[M]);return Object(C.jsx)(C.Fragment,{children:v?Object(C.jsx)(T.a,{close:()=>{x(!1)},description:p("lender-web-app-config-application",{config_name:h}),show:v,isUpload:!1,children:v&&Object(C.jsx)(R,{nextStep:()=>{x(!1)},configName:h})}):Object(C.jsx)("div",{className:"card default-card",children:"loading"===w||"loading"===F?Object(C.jsx)("div",{style:{minHeight:"50vh"},className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(C.jsx)("div",{className:"spinner-border text-primary",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[p("lender-web-app-loading"),"..."]})})}):"success"===w&&Object(C.jsx)("div",{className:"row mx-0",children:Object(C.jsx)(A.c,{validationSchema:L.g().shape({name:L.h(),periodic_amount:L.f().typeError(B).min(null===V||void 0===V||null===(t=V.offer)||void 0===t?void 0:t.min_amount,p("lender-web-app-amount-range",{min_amount:Object(y.q)(null===V||void 0===V||null===(a=V.offer)||void 0===a?void 0:a.min_amount),max_amount:Object(y.q)(null===V||void 0===V||null===(s=V.offer)||void 0===s?void 0:s.max_amount)})).max(null===V||void 0===V||null===(c=V.offer)||void 0===c?void 0:c.max_amount,p("lender-web-app-amount-range",{min_amount:Object(y.q)(null===V||void 0===V||null===(r=V.offer)||void 0===r?void 0:r.min_amount),max_amount:Object(y.q)(null===V||void 0===V||null===(o=V.offer)||void 0===o?void 0:o.max_amount)})),frequency:null!==V&&void 0!==V&&null!==(d=V.product)&&void 0!==d&&d.is_fixed?L.h().optional().nullable():L.g().required("Please select a date"),automated:L.h().optional()}),initialValues:{name:null===V||void 0===V?void 0:V.name,periodic_amount:null===V||void 0===V?void 0:V.periodic_amount,frequency:null===V||void 0===V?void 0:V.frequency,automated:null===V||void 0===V||null===(b=V.collection_method)||void 0===b?void 0:b.id},onSubmit:async e=>{try{await _(O.id,e,V,H,Y)&&(u&&u(!1),f(O.id),P())}catch(t){j.toast.error(t.message),console.log(t)}},children:e=>{var t,a,n,s,l,c,i;return Object(C.jsxs)(A.b,{method:"post",onSubmit:e.handleSubmit,className:"p-0",children:[Object(C.jsxs)("div",{className:"row mx-0 modal-body py-3",children:[Object(C.jsx)("div",{className:"tab-content__header mb-4",children:Object(C.jsx)("p",{className:"text-primary fs-5 fw-bold text-capitalize",children:p("lender-web-app-app-details",{config_name:h})})}),Object(C.jsx)(U.s,{name:"name",label:p("lender-web-app-plan-name"),placeholder:p("lender-web-app-plan-name")}),Object(C.jsx)(U.e,{placeholder:"Amount",label:p("lender-web-app-periodic-amount"),onChange:t=>e.setFieldValue("periodic_amount",t),disabled:!(null===V||void 0===V||null===(t=V.product)||void 0===t||!t.is_fixed),error:!!e.errors.periodic_amount,errorMessage:e.errors.periodic_amount,info:Object(C.jsxs)("small",{className:"form-text text-primary p-2 rounded-3 bg-light-blue d-block mt-2",children:[p("lender-web-app-minimum-is",{money:Object(y.q)(null===V||void 0===V||null===(a=V.offer)||void 0===a?void 0:a.min_amount)}),p("lender-web-app-minimum-maximum",{money:Object(y.q)(null===V||void 0===V||null===(n=V.offer)||void 0===n?void 0:n.max_amount)})]})}),Object(C.jsx)("p",{className:"mb-2 text-small",children:p("lender-web-app-often-invest")}),Object(C.jsx)("div",{className:"row",children:!(null!==V&&void 0!==V&&null!==(s=V.product)&&void 0!==s&&s.is_fixed)&&(null===I||void 0===I?void 0:I.filter((e=>((e,t)=>{var a,n,s,l;return"daily"===(null===t||void 0===t||null===(a=t.product)||void 0===a||null===(n=a.frequency)||void 0===n?void 0:n.toLowerCase())?"daily"===e.name.toLowerCase():"weekly"===(null===t||void 0===t||null===(s=t.product)||void 0===s||null===(l=s.frequency)||void 0===l?void 0:l.toLowerCase())?"weekly"===e.name.toLowerCase()||"daily"===e.name.toLowerCase():e.name})(e,V))).map((t=>{var a,n;return Object(C.jsx)("div",{className:"col-12 col-sm-4",children:Object(C.jsx)(U.g,{label:t.name,name:"frequency",className:"mx-0",checked:(null===(a=e.values.frequency)||void 0===a?void 0:a.id)==t.id,value:null===(n=e.values.frequency)||void 0===n?void 0:n.id,onChange:()=>e.setFieldValue("frequency",t)})},t.id)})))}),Object(C.jsxs)("div",{className:"form-check form-switch ms-2",children:[Object(C.jsx)("input",{className:"form-check-input",type:"checkbox",name:"automated",disabled:!(null===V||void 0===V||null===(l=V.product)||void 0===l||!l.is_fixed),checked:e.values.automated===S.b.automatic.id,value:e.values.automated,onChange:()=>e.setFieldValue("automated",e.values.automated===S.b.automatic.id?S.b.manual.id:S.b.automatic.id),id:"flexSwitchCheckChecked"}),Object(C.jsxs)("label",{className:"form-check-label",htmlFor:"flexSwitchCheckChecked",children:[p("lender-web-app-automate",{config_name:h}),Object(C.jsx)("small",{className:"d-block",children:p("lender-web-app-debitcard-funding",{config_name:h})})]})]}),!(null!==V&&void 0!==V&&null!==(c=V.product)&&void 0!==c&&c.is_fixed)&&Object(C.jsx)("div",{className:"btn text-primary mx-auto",onClick:()=>{x(!0)},children:p("lender-web-app-change-linked-card")})]}),Object(C.jsx)("div",{className:"col-12 modal-footer control",children:Object(C.jsx)(E.a,{isLoading:"loading"===k,isDisabled:(null===V||void 0===V||null===(i=V.card)||void 0===i?void 0:i.id)===D||!e.isValid,type:"submit",className:"btn col-6 btn-primary py-3 btn-lg px-6",children:p("lender-web-app-continue")})})]})}})})})})};const V=e=>{var t,a,r,o,d,b,u,j,m,h,O,v,x,f;let{setShowEditModal:w}=e;const{dictionary:_}=Object(l.useContext)(q.a),T=null===_||void 0===_?void 0:_.enable_and_name_savings,A=Object(n.i)(),{params:L}=Object(n.k)(),{translate:M}=Object(N.useTranslation)(),F=Object(D.a)((e=>e.checkNotAllowed)),[I,R,P,U,B,V]=g((e=>[e.fetchSaving,e.fetchSavingStatus,e.savingDetail,e.archiveSavings,e.restoreSavings,e.archivingStatus]),i.shallow),{details:H,savingType:Y,balance:W}=Object(l.useMemo)((()=>P||{details:null,savingType:null,balance:null}),[P]);return Object(C.jsxs)("div",{className:"p-lg-3",children:[Object(C.jsx)(k,{balance:{balance:null===H||void 0===H?void 0:H.balance,target:null===H||void 0===H?void 0:H.target,currency:null===W||void 0===W?void 0:W.currency},is_fixed:!(null===Y||void 0===Y||!Y.is_fixed)}),Object(C.jsxs)("div",{className:"row action p-3 gap-3 mb-3",children:[0===(null===H||void 0===H?void 0:H.archived_flag)&&Object(C.jsxs)(C.Fragment,{children:[null!==Y&&void 0!==Y&&Y.is_fixed?null:Object(C.jsxs)("button",{disabled:!H.status,onClick:()=>A.push("/".concat(null===T||void 0===T?void 0:T.replace(/[^a-zA-Z0-9]/g,"-"),"/").concat(L.id,"/topup")),className:"col action__green border-0 py-3 small",children:[Object(C.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("circle",{cx:"9",cy:"9",r:"9",fill:"#31C5A1"}),Object(C.jsx)("path",{d:"M8.45354 9.67803H5.76074V8.67003H8.45354V5.76123H9.50474V8.67003H12.1975V9.67803H9.50474V12.5868H8.45354V9.67803Z",fill:"white"})]}),M("lender-web-app-top-up-investment",{config_name:T})]}),Object(C.jsxs)("button",{onClick:()=>{var e;F()||(!H.is_matured&&null!==(e=H.product)&&void 0!==e&&e.lock_on_create?p.a.error(M("lender-web-app-cannot-widthraw")):A.push("/".concat(T.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-"),"/").concat(L.id,"/withdraw")))},className:"col action__red border-0 py-3 small",disabled:!H.is_matured&&!(null===(t=H.product)||void 0===t||!t.lock_on_create),children:[Object(C.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("circle",{cx:"9",cy:"9",r:"9",fill:!H.is_matured&&null!==(a=H.product)&&void 0!==a&&a.lock_on_create?"#bcbcbc":"#EB5757"}),Object(C.jsx)("path",{d:"M12.7656 5H5.23438C5.10492 5 5 5.10492 5 5.23438V5.95312H13V5.23438C13 5.10492 12.8951 5 12.7656 5Z",fill:"white"}),Object(C.jsx)("path",{d:"M8.17169 11.8125H9.82831C9.91046 11.6694 10.0288 11.5511 10.1719 11.4689V7.93732C10.0288 7.8551 9.91046 7.73682 9.82831 7.59375H8.17169C8.08948 7.73682 7.97119 7.85516 7.82812 7.93732V11.4689C7.97119 11.5511 8.08954 11.6694 8.17169 11.8125ZM9 11.3438C8.87054 11.3438 8.76562 11.2388 8.76562 11.1094C8.76562 10.9799 8.87054 10.875 9 10.875C9.12946 10.875 9.23438 10.9799 9.23438 11.1094C9.23438 11.2388 9.12946 11.3438 9 11.3438ZM9 8.0625C9.12946 8.0625 9.23438 8.16742 9.23438 8.29688C9.23438 8.42633 9.12946 8.53125 9 8.53125C8.87054 8.53125 8.76562 8.42633 8.76562 8.29688C8.76562 8.16742 8.87054 8.0625 9 8.0625ZM9 9C9.3877 9 9.70312 9.31543 9.70312 9.70312C9.70312 10.0908 9.3877 10.4062 9 10.4062C8.6123 10.4062 8.29688 10.0908 8.29688 9.70312C8.29688 9.31543 8.6123 9 9 9Z",fill:"white"}),Object(C.jsx)("path",{d:"M9 9.9375C9.12933 9.9375 9.23438 9.83246 9.23438 9.70312C9.23438 9.57379 9.12933 9.46875 9 9.46875C8.87067 9.46875 8.76562 9.57379 8.76562 9.70312C8.76562 9.83246 8.87067 9.9375 9 9.9375Z",fill:"white"}),Object(C.jsx)("path",{d:"M5 7.125C5 7.25446 5.10492 7.35938 5.23438 7.35938H6.1875V6.42188H5V7.125Z",fill:"white"}),Object(C.jsx)("path",{d:"M11.8125 7.35938H12.7656C12.8951 7.35938 13 7.25446 13 7.125V6.42188H11.8125V7.35938Z",fill:"white"}),Object(C.jsx)("path",{d:"M6.65625 12.7656C6.65625 12.8951 6.76117 13 6.89062 13H11.1094C11.2388 13 11.3438 12.8951 11.3438 12.7656V6.42188H6.65625V12.7656ZM7.35938 7.78522C7.35938 7.6886 7.43768 7.59711 7.52789 7.56244C7.65051 7.51538 7.74982 7.41614 7.79688 7.29352C7.83148 7.20331 7.92584 7.125 8.02246 7.125H9.97754C10.0742 7.125 10.1685 7.20331 10.2032 7.29352C10.2502 7.41614 10.3495 7.51538 10.4721 7.56244C10.5623 7.59711 10.6406 7.6886 10.6406 7.78522V11.621C10.6406 11.7176 10.5623 11.8091 10.4721 11.8438C10.3495 11.8908 10.2502 11.9901 10.2032 12.1127C10.1685 12.2029 10.0742 12.2812 9.97754 12.2812H8.02246C7.92584 12.2812 7.83148 12.2029 7.79688 12.1127C7.74982 11.9901 7.65051 11.8908 7.52789 11.8438C7.43774 11.8091 7.35938 11.7177 7.35938 11.621C7.35938 10.9164 7.35938 8.48987 7.35938 7.78522Z",fill:"white"})]}),M("lender-web-app-withdraw-from-app",{config_name:T})," "]}),Object(C.jsxs)("button",{onClick:()=>H.is_matured?A.push("/".concat(T.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-"),"/").concat(L.id,"/rollover")):p.a.error(M("lender-web-app-cannot-rollover")),className:"col action__blue border-0 py-3 small",disabled:!H.is_matured,children:[Object(C.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("circle",{cx:"9",cy:"9",r:"9",fill:H.is_matured?"#41A1CE":"#bcbcbc"}),Object(C.jsx)("path",{d:"M8.61538 6C6.06769 6 4 7.03385 4 8.30769C4 9.34154 5.35692 10.2138 7.23077 10.5092V12L9.07692 10.1538L7.23077 8.30769V9.56769C5.77692 9.30923 4.92308 8.69077 4.92308 8.30769C4.92308 7.81846 6.32615 6.92308 8.61538 6.92308C10.9046 6.92308 12.3077 7.81846 12.3077 8.30769C12.3077 8.64462 11.6338 9.18 10.4615 9.47538V10.4215C12.0908 10.0662 13.2308 9.25385 13.2308 8.30769C13.2308 7.03385 11.1631 6 8.61538 6Z",fill:"white"})]}),M("lender-web-app-rollover",{config_name:T})," "]})]}),1===(null===H||void 0===H?void 0:H.archived_flag)&&Object(C.jsx)(E.a,{className:"btn btn-primary py-2 d-flex w-sm-100 col",isLoading:"loading"===V,onClick:async()=>{await B(null===H||void 0===H?void 0:H.id),I(H.id)},children:M("lender-web-app-reset")}),Object(C.jsxs)("button",{onClick:()=>A.push(s.a.investments.detailsTransactions.for(null===L||void 0===L?void 0:L.id)),className:"col action__orange border-0 py-3 small",children:[Object(C.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("path",{d:"M32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16Z",fill:"#B71205"}),Object(C.jsx)("path",{d:"M9.16651 7.99707L9.25651 8.00507C9.35642 8.02332 9.44839 8.07156 9.52021 8.14338C9.59202 8.21519 9.64026 8.30717 9.65851 8.40707L9.66651 8.49707V10.7081C10.8632 9.35081 12.4846 8.43931 14.266 8.12238C16.0475 7.80545 17.8838 8.1018 19.4751 8.96307C21.0665 9.82433 22.3188 11.1996 23.0277 12.8644C23.7366 14.5292 23.8602 16.3852 23.3784 18.1292C22.8965 19.8733 21.8376 21.4026 20.3745 22.4673C18.9114 23.5319 17.1307 24.0692 15.3229 23.9913C13.5151 23.9134 11.7872 23.225 10.4211 22.0384C9.05504 20.8518 8.13159 19.2372 7.80151 17.4581C7.69464 16.8038 7.65111 16.1407 7.67151 15.4781C7.68299 15.35 7.74339 15.2313 7.84014 15.1465C7.93689 15.0618 8.06256 15.0176 8.19104 15.0232C8.31951 15.0287 8.44092 15.0835 8.53003 15.1763C8.61913 15.269 8.66909 15.3925 8.66951 15.5211C8.65235 16.1084 8.69051 16.6959 8.78351 17.2761C9.07833 18.8664 9.91478 20.3056 11.1507 21.3489C12.3866 22.3923 13.9457 22.9755 15.5629 22.9994C17.1802 23.0232 18.7558 22.4863 20.0219 21.4799C21.2881 20.4735 22.1667 19.0596 22.5083 17.4787C22.8499 15.8978 22.6336 14.2473 21.896 12.8079C21.1583 11.3684 19.945 10.2288 18.4622 9.58277C16.9794 8.93673 15.3186 8.82412 13.7622 9.26406C12.2058 9.70401 10.8497 10.6694 9.92451 11.9961H12.6645L12.7545 12.0051C12.8698 12.0259 12.9741 12.0866 13.0492 12.1766C13.1243 12.2665 13.1654 12.3799 13.1654 12.4971C13.1654 12.6142 13.1243 12.7277 13.0492 12.8176C12.9741 12.9075 12.8698 12.9682 12.7545 12.9891L12.6645 12.9971H9.16651L9.07651 12.9891C8.97647 12.9708 8.88439 12.9224 8.81257 12.8504C8.74074 12.7784 8.69258 12.6862 8.67451 12.5861L8.66651 12.4961V8.49607L8.67451 8.40607C8.69295 8.30635 8.74127 8.21459 8.81307 8.14297C8.88487 8.07135 8.97674 8.02326 9.07651 8.00507L9.16651 7.99707V7.99707ZM15.1665 11.9971L15.2565 12.0051C15.3564 12.0233 15.4484 12.0716 15.5202 12.1434C15.592 12.2152 15.6403 12.3072 15.6585 12.4071L15.6665 12.4971V16.0001H17.6665L17.7565 16.0081C17.8712 16.0295 17.9748 16.0904 18.0494 16.1801C18.1239 16.2699 18.1647 16.3829 18.1647 16.4996C18.1647 16.6163 18.1239 16.7293 18.0494 16.819C17.9748 16.9088 17.8712 16.9696 17.7565 16.9911L17.6665 17.0001H15.1665L15.0765 16.9921C14.9766 16.9738 14.8846 16.9256 14.8128 16.8538C14.741 16.782 14.6928 16.69 14.6745 16.5901L14.6665 16.5001V12.4981L14.6745 12.4081C14.6928 12.3082 14.741 12.2162 14.8128 12.1444C14.8846 12.0726 14.9766 12.0243 15.0765 12.0061L15.1665 11.9981V11.9971Z",fill:"#FFFFFF",stroke:"#FFFFFF",strokeWidth:"0.2"})]}),M("lender-web-app-transaction")]})]}),Object(C.jsxs)("div",{className:"p-4  rounded-3",style:{background:"#F9F9FA",border:"1px solid #016AB3"},children:[Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-name")}),Object(C.jsx)("p",{className:"fs-18",children:null===H||void 0===H?void 0:H.name})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3 mt-sm-0",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-periodic-amount")}),Object(C.jsx)("p",{className:"fs-18",children:Object(y.q)(null===H||void 0===H?void 0:H.periodic_amount)})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-target")}),Object(C.jsx)("p",{className:"fs-18",children:Object(y.q)(null!==(r=null===H||void 0===H?void 0:H.target)&&void 0!==r?r:0)})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-interest-rate")}),Object(C.jsxs)("p",{className:"fs-18",children:[null!==(o=null===H||void 0===H||null===(d=H.offer)||void 0===d?void 0:d.interest_rate)&&void 0!==o?o:0,"%"]})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-frequency")}),Object(C.jsx)("p",{className:"fs-18",children:null!==H&&void 0!==H&&H.frequency?H.frequency.name:"N/A"})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-debit-card")}),Object(C.jsxs)("p",{className:"fs-18",children:[null===H||void 0===H||null===(b=H.card)||void 0===b?void 0:b.card_last4," ",null===H||void 0===H||null===(u=H.card)||void 0===u?void 0:u.card_type]})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-status")}),Object(C.jsx)("p",{className:"fs-18 ".concat(null!==H&&void 0!==H&&H.is_matured?"text-success":"text-warning"),children:null===(j=S.a.statusPill(null===H||void 0===H?void 0:H.is_matured))||void 0===j?void 0:j.toUpperCase()})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-withholding-tax")}),Object(C.jsxs)("p",{className:"fs-18",children:[null!==(m=null===H||void 0===H||null===(h=H.product)||void 0===h?void 0:h.withholding_tax_rate)&&void 0!==m?m:0,"%"]})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-start-by")}),Object(C.jsx)("p",{className:"fs-18",children:Object(y.r)(null===H||void 0===H?void 0:H.start_date)})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-withdraw-by")}),Object(C.jsx)("p",{className:"fs-18",children:Object(y.r)(null===H||void 0===H?void 0:H.end_date)})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-savings-product")}),Object(C.jsx)("p",{className:"fs-18",children:null!==(O=null===H||void 0===H||null===(v=H.product)||void 0===v?void 0:v.name)&&void 0!==O?O:"-"})]}),Object(C.jsxs)("div",{className:"text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-gray small mb-1",children:M("lender-web-app-savngs-mode")}),Object(C.jsx)("p",{className:"fs-18",children:null!==(x=null===H||void 0===H||null===(f=H.collection_method)||void 0===f?void 0:f.name)&&void 0!==x?x:"-"})]})]}),Object(C.jsxs)("div",{className:"d-sm-flex justify-content-between",children:[null!==H&&void 0!==H&&H.is_matured&&0===(null===H||void 0===H?void 0:H.balance)&&0===(null===H||void 0===H?void 0:H.archived_flag)?Object(C.jsxs)(E.a,{className:"btn btn-primary mt-3 px-35 py-2 d-flex w-sm-100",isLoading:"loading"===V,onClick:async()=>{await U(H.id),I(H.id)},children:[Object(C.jsx)("span",{className:"d-inline-block me-1",children:Object(C.jsx)("svg",{width:"16px",height:"16px",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#archive"})})}),M("lender-web-app-archive")]}):null,"success"===R&&null!==H&&void 0!==H&&H.status&&0===(null===H||void 0===H?void 0:H.archived_flag)?Object(C.jsxs)(c.b,{className:"btn btn-outline-primary mt-3 px-35 py-2 ms-auto",to:{state:{productId:JSON.stringify({savingTypeId:null===Y||void 0===Y?void 0:Y.id,savingId:null===H||void 0===H?void 0:H.product_id}),search:"?edit-savingId=".concat(null===L||void 0===L?void 0:L.id)}},onClick:()=>{w(!0)},children:[M("lender-web-app-edit"),Object(C.jsx)("img",{height:"15px",className:"ms-2",src:"/svgs/edit.svg",alt:""})]}):null]})]})]})};var H=()=>{const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,{params:a}=Object(n.k)(),r=Object(v.a)(),{translate:o}=Object(N.useTranslation)(),[d,b]=g((e=>[e.fetchSaving,e.fetchSavingStatus]),i.shallow),[u,j]=Object(l.useState)(!1);return Object(l.useEffect)((()=>{d(a.id)}),[]),Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{className:"d-flex align-items-center",children:Object(C.jsx)("div",{style:{flex:1},className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)(c.b,{to:s.a.investments.base.for(t.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:o("lender-web-app-back-to-investment",{config_name:t})})]})})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsxs)("p",{className:"text-capitalize",children:[" ",o("lender-web-app-config-details",{config_name:t})," "]})}),Object(C.jsx)("div",{style:{maxWidth:"650px",minHeight:"500px"},className:"card default-card page-table",children:"loading"===b&&Object(C.jsx)("div",{className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(C.jsx)("div",{className:"spinner-border text-primary",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[o("lender-web-app-loading"),"..."]})})})||"success"===b&&Object(C.jsx)(V,{setShowEditModal:j})||Object(C.jsx)("div",{className:" d-flex justify-content-center align-items-center",children:Object(C.jsx)("p",{className:"",children:o("lender-web-app-error-fetching-transaction")})})}),Object(C.jsx)(T.a,{close:()=>{j(!1)},description:o("lender-web-app-config-application",{config_name:t}),show:u||!!r.get("edit-savingId"),className:"",isUpload:!1,children:(u||r.get("edit-savingId"))&&Object(C.jsx)(B,{setShowEditModal:j})})]})},Y=a(148),W=a(124),G=a(89),Z=a(79),K=a(105);const z=[{key:"Running",value:0},{key:"Matured",value:1}];function J(e){let{title:t,userSavings:a}=e;const{dictionary:n}=Object(l.useContext)(q.a),r=null===n||void 0===n?void 0:n.enable_and_name_savings,o=Object(x.y)(),[d,b]=Object(l.useState)(""),[u,j]=Object(l.useState)(""),[p]=g((e=>[e.fetchSavingStatus]),i.shallow),[m,h]=Object(l.useState)(5),[O,v]=Object(l.useState)(1),f=Object(l.useMemo)((()=>null===a||void 0===a?void 0:a.filter((e=>new RegExp(d||".","i").test(e.name)&&!(null!==e&&void 0!==e&&e.archived_flag)&&(""===u||+u==(null===e||void 0===e?void 0:e.is_matured))))),[a,u,d]),w=Object(l.useMemo)((()=>null===a||void 0===a?void 0:a.filter((e=>1===(null===e||void 0===e?void 0:e.archived_flag))).length),[a]);Object(l.useEffect)((()=>{v(1)}),[f]);const _=Object(l.useMemo)((()=>{const e=m*O-m,t=m*O;return f.slice(e,t)}),[O,m,f]),k=Object(l.useCallback)((e=>{v(e)}),[]),{translate:S}=Object(N.useTranslation)();return Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"table__header mb-2 mt-3 d-flex justify-content-between",children:[Object(C.jsx)("p",{className:"table__header--title text-capitalize",children:t}),w>0&&Object(C.jsx)(c.b,{className:"text-priamry fw-bold",to:"/".concat(r.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-"),"/archive"),children:Object(C.jsx)("small",{children:S("lender-web-app-view-archive")})})]}),Object(C.jsx)("div",{className:"card default-card page-table",children:"loading"===p?Object(C.jsx)("div",{children:Object(x.g)(m).map((e=>Object(C.jsx)(Z.a,{height:60,rounded:!0},e)))}):Object(C.jsx)("div",{className:"loans__history",children:f.length<1?Object(C.jsxs)("div",{className:"text-center w-100",children:[Object(C.jsx)("span",{className:"text-primary",children:Object(C.jsx)(K.a,{})}),Object(C.jsxs)("h4",{className:"mt-3",children:[S("lender-web-app-no")," ",r]}),Object(C.jsx)("p",{className:"text-app-gray",children:S("lender-web-app-no-investment",{config_name:r})})]}):Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"filter-and-search",children:[Object(C.jsx)("div",{className:"filter-box d-flex",children:Object(C.jsxs)("div",{className:"input-group input-group-filter",children:[Object(C.jsx)("div",{className:"input-group-prepend",children:Object(C.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[S("lender-web-app-status"),":"]})}),Object(C.jsxs)("select",{value:u,onChange:e=>j(e.target.value),onBlur:e=>j(e.target.value),className:"form-control",children:[Object(C.jsx)("option",{value:"",selected:!0,children:S("lender-web-app-all")}),Array.from(z).map((e=>Object(C.jsx)("option",{value:e.value,children:e.key},e.value)))]})]})}),Object(C.jsx)("div",{className:" search-box",children:Object(C.jsx)("input",{value:d,onChange:e=>b(e.target.value),type:"search",className:"form-control",placeholder:"".concat(S("lender-web-app-search"),"..."),autoComplete:"false"})})]}),Object(C.jsx)("div",{className:"loans__history",children:null!==_&&void 0!==_&&_.length?Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(C.jsx)("thead",{children:Object(C.jsxs)("tr",{children:[Object(C.jsx)("th",{}),Object(C.jsx)("th",{className:"principal",children:S("lender-web-app-plan-name")}),Object(C.jsx)("th",{className:"tenor",children:S("lender-web-app-interest-rate")}),Object(C.jsx)("th",{className:"tenor",children:S("lender-web-app-balance")}),Object(C.jsx)("th",{style:{textAlign:"right"},className:"tenor",children:S("lender-web-app-maturity-date")})]})}),Object(C.jsx)("tbody",{children:_.map((e=>Object(C.jsxs)("tr",{className:"link-row",onClick:()=>o.goTo(ye.investments.details.for(e.id)),children:[Object(C.jsx)("td",{style:{textAlign:"right"},"data-toggle":"tooltip","data-placement":"top",className:"d-flex status align-items-end align-items-sm-end justify-content-end",children:Object(C.jsx)("div",{style:{width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"},className:"".concat(null!==e&&void 0!==e&&e.is_matured?"running":"pending","-pill")})}),Object(C.jsx)("td",{className:"date",children:e.name}),Object(C.jsxs)("td",{className:"interest",children:[e.interest_rate,"%"]}),Object(C.jsx)("td",{className:"date",children:Object(y.q)(e.balance)}),Object(C.jsx)("td",{style:{textAlign:"right"},className:"date",children:Object(y.v)(e.end_date)})]},e.id)))})]}),Object(C.jsx)("div",{className:"mobileListTable d-lg-none",children:_.map((e=>Object(C.jsxs)("div",{onClick:()=>o.goTo(s.a.investments.details.for(e.id)),className:"list",children:[Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("p",{className:"text-black-50 mb-0",children:S("lender-web-app-name")}),Object(C.jsx)("p",{className:"principal",children:e.name})]})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("p",{className:"text-black-50 mb-0",children:S("lender-web-app-balance")}),Object(C.jsx)("p",{className:"date",children:Object(y.q)(e.balance)})]})}),Object(C.jsxs)("div",{className:"row listData",children:[Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("p",{className:"text-black-50 mb-0",children:S("lender-web-app-interest-rate")}),Object(C.jsxs)("p",{className:"interest",children:[e.interest_rate,"%"]})]}),Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("p",{className:"text-black-50 mb-0",children:S("lender-web-app-status")}),Object(C.jsx)("div",{className:"status-wrapper",children:Object(C.jsx)("div",{style:{width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"},className:"".concat(null!==e&&void 0!==e&&e.is_matured?"running":"pending","-pill")})})]})]})]},e.id)))})]}):Object(C.jsx)("div",{className:"mx-auto text-center text-capitalize",children:S("lender-web-app-not-found",{config_name:r})})})]})})}),(null===f||void 0===f?void 0:f.length)>0&&Object(C.jsx)(G.a,{total:null===f||void 0===f?void 0:f.length,perPage:m,setPerPage:h,currentPage:O,loadPage:k,setCurrentPage:v})]})}const Q="SELECT_OFFER",X="AMOUNT_SELECTION",$="BREAKDOWN",ee="PAYMENT_METHOD",te="SUMMARY",ae="SUCCESSFUL";var ne=e=>{let{saving:t,setCurrentStep:a,offer:n,configName:s}=e;const c=Object(x.z)("target","proposed_tenor_period","start_date","name","proposed_tenor","frequency","automated"),{setFieldValue:r,values:o,errors:d}=Object(A.f)(),[b,u,j]=g((e=>[e.frequencyStatus,e.frequencies,e.fetchFrequencies]),i.shallow);Object(l.useEffect)((()=>{0===t.is_fixed&&j()}),[j,t.is_fixed]);const{translate:p}=Object(N.useTranslation)();return"loading"===b?Object(C.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"15rem"},children:Object(C.jsx)("div",{className:"spinner-border text-primary",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[p("lender-web-app-step"),"..."]})})}):Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"modal-body",children:[Object(C.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(C.jsxs)("p",{className:"text-primary fs-5 fw-bold d-flex justify-content-between",children:[null===t||void 0===t?void 0:t.name," ",Object(C.jsx)("div",{className:"me-1 text-primary",children:Object(C.jsx)("svg",{width:"20",height:"20",children:null!==t&&void 0!==t&&t.lock_on_create?Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#lock-icon"}):Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#piggy-bank-icon"})})})]}),Object(C.jsx)("small",{className:"text-black-50",children:null===t||void 0===t?void 0:t.description})]}),Object(C.jsx)(U.s,{name:"name",label:p("lender-web-app-give-plan-name"),placeholder:p("lender-web-app-plan-name")}),Object(C.jsx)(U.e,{placeholder:"Amount",label:p("lender-web-app-start-amount"),onChange:e=>{r("target",e)},defaultValue:o.target,error:!!d.target,errorMessage:d.target,onFocus:e=>{"0"===e.target.value&&r("target","",!1)},info:Object(C.jsx)("small",{className:"form-text text-primary p-2 rounded-3 bg-light-blue d-block mt-2",children:p("lender-web-app-minimum-maximum-money",{min_amount:Object(y.q)(null===n||void 0===n?void 0:n.min_amount),max_amount:Object(y.q)(null===n||void 0===n?void 0:n.max_amount)})})}),Object(C.jsxs)("div",{className:"row form-flex",children:[Object(C.jsx)("div",{className:"col-sm",children:Object(C.jsx)(U.s,{name:"proposed_tenor",type:"number",label:p("lender-web-app-ask-duration"),placeholder:"Minimum duration to invest",onKeyDown:y.b,onKeyUp:y.t})}),Object(C.jsx)("div",{className:"col-sm",children:Object(C.jsx)(U.q,{name:"proposed_tenor_period",label:"Period",keyField:"value",options:[{value:null===n||void 0===n?void 0:n.tenor_period}]})})]}),0===(null===t||void 0===t?void 0:t.is_fixed)&&(null===u||void 0===u?void 0:u.length)>0&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("p",{className:"text-app-gray f-14px",children:p("lender-web-app-often-invest")}),Object(C.jsx)("div",{className:"d-flex flex-wrap flex-sm-nowrap justify-between mb-2",children:null===u||void 0===u?void 0:u.filter((e=>((e,t)=>{const a=e.proposed_tenor_period;let n;return n="days"===a?"daily"===(null===t||void 0===t?void 0:t.name.toLowerCase()):"weeks"===a?"weekly"===(null===t||void 0===t?void 0:t.name.toLowerCase())||"daily"===(null===t||void 0===t?void 0:t.name.toLowerCase()):null===t||void 0===t?void 0:t.name,n})(o,e))).map(((e,t)=>{var a;return Object(C.jsx)("div",{style:{maxWidth:"150px"},className:"w-100 ".concat(1===t&&"mx-sm-3"),children:Object(C.jsx)(U.g,{label:null===e||void 0===e?void 0:e.name,name:"frequency",checked:(null===(a=o.frequency)||void 0===a?void 0:a.id)==(null===e||void 0===e?void 0:e.id),value:o.frequency,onChange:()=>r("frequency",e)})},null===e||void 0===e?void 0:e.id)}))})]}),Object(C.jsx)(U.i,{minDate:Object(O.a)(),label:p("lender-web-app-when-start-investing"),name:"start_date"}),!t.is_fixed&&Object(C.jsxs)("div",{className:"form-check form-switch",children:[Object(C.jsx)("input",{className:"form-check-input",type:"checkbox",name:"automated",checked:o.automated===S.b.automatic.id,disabled:!!t.is_fixed,value:o.automated,onChange:()=>r("automated",o.automated===S.b.automatic.id?S.b.manual.id:S.b.automatic.id),id:"flexSwitchCheckChecked"}),Object(C.jsxs)("label",{className:"form-check-label",htmlFor:"flexSwitchCheckChecked",children:[p("lender-web-app-automate",{config_name:s}),Object(C.jsx)("small",{className:"d-block",children:p("lender-web-app-debitcard-funding",{config_name:s})})]})]})]}),Object(C.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(C.jsx)("button",{type:"button",onClick:()=>a(Q),className:"py-3 pl-0 btn me-3 btn-ghost btn-lg",children:p("lender-web-app-back")}),Object(C.jsx)("button",{disabled:!o.target||!c.isValid,type:"button",onClick:()=>a($),className:"px-5 py-3 btn btn-primary btn-lg",children:p("lender-web-app-continue")})]})]})};function se(e){let{showPrompt:t,close:a,warningMessage:n,continueApp:s,image:l,description:c}=e;const{translate:i}=Object(N.useTranslation)();return Object(C.jsxs)(T.a,{show:t,close:a,description:c,isUpload:!1,className:"small-modal",children:[Object(C.jsxs)("div",{className:"modal-body py-5 mt-4 d-flex text-center align-items-center flex-column",children:[l||Object(C.jsx)("img",{width:"60px",className:"mb-3",src:"/svgs/home.svg",alt:""}),Object(C.jsx)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-black-50",children:n})]}),Object(C.jsxs)("div",{className:"modal-footer justify-content-between align-items-center",children:[Object(C.jsx)(E.a,{type:"button",onClick:a,className:"btn text-primary ",children:i("lender-web-app-cancel")}),Object(C.jsx)(E.a,{isLoading:!1,onClick:()=>{s(),a()},className:"btn btn-primary",children:i("lender-web-app-continue")})]})]},c)}var le=a(144);const ce=(e,t,a,n)=>{const s=("years"===n?365:"months"===n&&30)||"weeks"===n&&7||1;let l=(e*Math.pow(1+t/100,1)-e)/s*a;return l=Number(l.toFixed(2)),l};function ie(e){var t,a;let{saving:n,setCurrentStep:s,offer:c,configName:r}=e;const{values:o,setFieldValue:d}=Object(A.f)(),[b,u,j]=g((e=>[e.setSchedules,e.breakdown,e.setBreakdown]),i.shallow),[p,m]=Object(l.useState)("default"),[O,v]=Object(l.useState)(!1),[f,w]=Object(l.useState)(!1),[_,k]=Object(l.useState)(!1),[S,L,M]=Object(D.a)((e=>[e.documentTypes,e.documents,e.fetchDocs]),i.shallow),{translate:F}=Object(N.useTranslation)(),{start_date:I,frequency:R}=o;Object(l.useEffect)((()=>{var e;const t=Number(o.target);M();let a=(null===c||void 0===c?void 0:c.tenor_period)||"days";a=a.endsWith("s")?a:"".concat(a,"s");const s=Object(x.l)(a),l=(null===(e=o.proposed_tenor)||void 0===e?void 0:e.toString())*s,i=c.interest_rate||0,r=n.withholding_tax_rate||0,u=h()(I,"YYYY/MM/DD").add(l,"days").format("yyyy-MM-DD");d("maturity_date",u);let p=0,m=0;const O=[];if(n.is_fixed)O.push({index:0,due_date:h()(I,"YYYY/MM/DD").format("yyyy-MM-DD"),amount_saved:t,balance:t}),p=t,m=ce(t,i,l,null===c||void 0===c?void 0:c.interest_period);else{const e=o.frequency.name.toLowerCase(),a=("monthly"==e?30:"weekly"==e&&7)||1,n=Math.floor(l/a);let s=0;for(let l=0;l<n;l++){let e=0;l>0&&(e=ce(s,i,a,null===c||void 0===c?void 0:c.interest_period),m+=e),s=s+t+e;const n=Object(y.h)(null===R||void 0===R?void 0:R.name);O.push({index:l,due_date:h()(I,"YYYY/MM/DD").add(l,n).format("yyyy-MM-DD"),amount_saved:t,balance:s}),p+=t}}j({total_contribution:p,maturity_value:p+m,maturity_date:u,interest_earned:m,interest_rate:i,withholding_tax:r/100*m,withholding_tax_rate:r,schedules:O}),b(O)}),[n.is_fixed,n.withholding_tax_rate,c.interest_rate,c.min_tenor,c.tenor_period,d,b,I,o]);const P=()=>{const e=S.map((e=>({...e,userData:null===L||void 0===L?void 0:L.find((t=>t.type_id===e.id))}))),t=null===e||void 0===e?void 0:e.find((e=>"id"===e.additional_code));!t||t.userData&&"rejected"!==t.userData.status.toLowerCase()?s(ee):(v(!0),m("default"))},[q,U,B]=Object(D.a)((e=>[e.docUploadStatus,e.uploadUserDoc,e.updateUserDoc]),i.shallow),V=Object(l.useCallback)((async(e,t)=>{const a=null===S||void 0===S?void 0:S.find((e=>"id"===e.additional_code));if(!a)return;const n=null===L||void 0===L?void 0:L.find((e=>e.type_id===a.id)),s=n?B:U;await s(e,a.id,null===n||void 0===n?void 0:n.id,(()=>v(!1))),"function"===typeof t&&t()}),[U,B]);return Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"modal-body pb-4",children:[Object(C.jsxs)("div",{className:"mb-4 tab-content__header",children:[Object(C.jsx)("p",{className:"mb-1 text-primary fs-5 fw-bold",children:F("lender-web-app-breakdown",{config_name:r})}),Object(C.jsx)("small",{className:"text-app-gray",children:F("lender-web-app-plan-summary")})]}),Object(C.jsxs)("div",{className:"px-3 py-4 d-block bg-light-blue d-sm-none",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px text-app-gray",children:F("lender-web-app-total-invested")}),Object(C.jsx)("p",{children:Object(y.q)(u.total_contribution,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:F("lender-web-app-maturity-date")}),Object(C.jsxs)("p",{children:[" ",Object(y.r)(u.maturity_date)+(null===u||void 0===u?void 0:u.currency)]}),Object(C.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:F("lender-web-app-interest-earned")}),Object(C.jsx)("p",{children:Object(y.q)(u.interest_earned,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:F("lender-web-app-interest-rate")}),Object(C.jsxs)("p",{children:[u.interest_rate,"% per"," ",Object(y.f)("years"==(null===c||void 0===c?void 0:c.interest_period)?"annum":null===c||void 0===c?void 0:c.interest_period)]}),Object(C.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:F("lender-web-app-withholding-tax")}),Object(C.jsx)("p",{children:Object(y.q)(u.withholding_tax,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("h6",{className:"mt-3 fw-normal f-14px text-app-gray",children:F("lender-web-app-total-payout")}),Object(C.jsx)("p",{children:Object(y.q)(u.maturity_value-u.withholding_tax,null===u||void 0===u?void 0:u.currency)})]}),Object(C.jsx)("div",{className:"px-3 py-4 bg-light-blue rounded-3 px-md-35 d-none d-sm-block",children:Object(C.jsxs)("div",{className:"d-md-block",children:[Object(C.jsxs)("div",{className:"justify-between d-flex text-app-gray",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px ",children:F("lender-web-app-total-invested")}),Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:F("lender-web-app-maturity-date")})]}),Object(C.jsxs)("div",{className:"justify-between d-flex",children:[Object(C.jsx)("p",{children:Object(y.q)(u.total_contribution,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("p",{className:" ms-auto",children:Object(y.r)(u.maturity_date)})]}),Object(C.jsxs)("div",{className:"justify-between mt-4 d-flex text-app-gray",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:F("lender-web-app-interest-earned")}),Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:F("lender-web-app-interest-rate")})]}),Object(C.jsxs)("div",{className:"justify-between d-flex",children:[Object(C.jsx)("p",{children:Object(y.q)(u.interest_earned,null===u||void 0===u?void 0:u.currency)}),Object(C.jsxs)("p",{className:" ms-auto",children:[u.interest_rate,"% per"," ",Object(y.f)("years"==(null===n||void 0===n?void 0:n.interest_period)?"annum":null===n||void 0===n?void 0:n.interest_period)]})]}),Object(C.jsxs)("div",{className:"justify-between mt-4 d-flex text-app-gray",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:F("lender-web-app-withholding-tax")}),Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:F("lender-web-app-total-payout")})]}),Object(C.jsxs)("div",{className:"justify-between d-flex",children:[Object(C.jsx)("p",{children:Object(y.q)(u.withholding_tax,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("p",{className:" ms-auto",children:Object(y.q)(u.maturity_value-u.withholding_tax,null===u||void 0===u?void 0:u.currency)})]})]})}),Object(C.jsxs)("div",{className:"px-3 py-4 bg-light-blue rounded-3 mt-35 px-md-35",children:[Object(C.jsxs)("div",{className:"d-none d-sm-block",children:[Object(C.jsxs)("div",{className:"row text-gray mb-35",children:[Object(C.jsx)("h6",{className:" col-4 text-m-small",children:F("lender-web-app-date")}),Object(C.jsx)("h6",{className:" col-4 text-m-small",children:F("lender-web-app-invested")}),Object(C.jsx)("h6",{className:"text-right  col-4 text-m-small",children:F("lender-web-app-balance")})]}),null===(t=u.schedules)||void 0===t?void 0:t.map(((e,t)=>Object(C.jsxs)(C.Fragment,{children:[0!==t&&Object(C.jsx)("hr",{}),Object(C.jsxs)("div",{className:"pt-1 pb-1 text-black row",children:[Object(C.jsx)("p",{className:"col-4 text-small",children:Object(y.r)(e.due_date)}),Object(C.jsx)("p",{className:"col-4 text-small",children:Object(y.q)(e.amount_saved,null===u||void 0===u?void 0:u.currency)}),Object(C.jsx)("p",{className:"text-right col-4 text-small",children:Object(y.q)(e.balance,null===u||void 0===u?void 0:u.currency)})]},e.index)]})))]}),Object(C.jsx)("div",{className:"mobileListTable d-sm-none",children:null===(a=u.schedules)||void 0===a?void 0:a.map((e=>Object(C.jsxs)("div",{className:"list",children:[Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("h6",{className:"mt-3 fw-normal text-app-gray",children:F("lender-web-app-date")}),Object(C.jsx)("p",{className:"date",children:e.due_date})]})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("h6",{className:"mt-3 fw-normal text-app-gray",children:F("lender-web-app-invested")}),Object(C.jsx)("p",{children:Object(y.q)(e.amount_saved,null===u||void 0===u?void 0:u.currency)})]})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)("h6",{className:"mt-3 fw-normal text-app-gray",children:F("lender-web-app-balance")}),Object(C.jsx)("p",{className:"interest",children:Object(y.q)(e.balance,null===u||void 0===u?void 0:u.currency)})]})})]},"".concat(e.amount_saved,"-").concat(e.due_date))))})]})]}),Object(C.jsxs)("div",{className:"d-flex justify-content-between modal-footer control",children:[Object(C.jsx)("button",{type:"button",onClick:()=>s(X),className:"py-3 pl-0 btn me-3 btn-ghost btn-lg",children:F("lender-web-app-back")}),Object(C.jsx)("button",{onClick:()=>{(null===n||void 0===n?void 0:n.penal_charge_rate)>0?w(!0):P()},type:"button",className:"px-5 py-3 btn btn-primary btn-lg",children:F("lender-web-app-continue")})]}),Object(C.jsxs)(T.a,{show:O,close:()=>v(!1),description:F("lender-web-app-upload-your-id"),isUpload:!1,children:["default"===p?Object(C.jsxs)("div",{className:"py-5 text-center modal-body d-flex align-items-center flex-column",children:[Object(C.jsx)("img",{className:"mb-4",width:"60px",src:"/svgs/id.svg",alt:""}),Object(C.jsx)("h6",{children:F("lender-web-app-upload-id")}),Object(C.jsx)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-app-gray",children:F("lender-web-app-id-transactions")})]}):Object(C.jsx)("div",{className:"modal-body",children:Object(C.jsxs)("div",{className:"modal-form",children:[Object(C.jsx)(le.a,{onFileSelect:V,status:q}),Object(C.jsx)("div",{className:"tips",children:Object(C.jsxs)("p",{children:["**",F("lender-web-app-pdf-jpeg"),"."]})})]})}),"default"===p&&Object(C.jsx)("div",{className:"modal-footer",children:Object(C.jsx)(E.a,{onClick:()=>m("upload"),type:"submit",className:"btn btn-primary",children:F("lender-web-app-continue")})})]}),Object(C.jsx)(se,{showPrompt:f,close:()=>w(!1),description:F("lender-web-app-early-liqudation-penalty"),continueApp:()=>{null!==n&&void 0!==n&&n.lock_on_create?k(!0):P()},warningMessage:Object(C.jsxs)(C.Fragment,{children:[F("lender-web-app-percentage-penalty",{percentage:null===n||void 0===n?void 0:n.penal_charge_rate.toString()}),Object(C.jsx)("br",{}),F("lender-web-app-wish-to-proceed")]})}),Object(C.jsx)(se,{showPrompt:_,close:()=>k(!1),description:F("lender-web-app-locked-config",{config_name:r}),continueApp:P,image:Object(C.jsx)("svg",{width:"60",height:"60",className:"text-primary",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#lock-icon"})}),warningMessage:Object(C.jsxs)(C.Fragment,{children:[F("lender-web-app-plan-locked")," ",Object(C.jsx)("span",{style:{whiteSpace:"nowrap"},children:Object(y.r)(null===u||void 0===u?void 0:u.maturity_date)})]})})]})}var re=e=>{var t,a,n,s;let{setCurrentStep:l,saving:c,configName:r}=e;const{values:o}=Object(A.f)(),[d,b,u]=g((e=>[e.schedules,e.savingCompletionStatus,e.breakdown]),i.shallow),{translate:j}=Object(N.useTranslation)();return Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"modal-body py-4",children:[Object(C.jsx)("p",{className:"text-primary fs-5  fw-bold",children:j("lender-web-app-plan-summary")}),Object(C.jsxs)("div",{className:"bg-light-blue rounded-3 mt-35 py-2 px-3 px-md-35",children:[Object(C.jsx)("div",{className:"row align-flex-start",children:Object(C.jsx)(E.a,{onClick:()=>l(X),style:{maxWidth:"100px"},className:"d-flex btn-nofill pe-0",children:j("lender-web-app-edit-information")})}),Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-6 info-group",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-plan-name")}),Object(C.jsx)("p",{className:"info--value fw-bold",children:o.name||"-"})]}),Object(C.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-product")}),Object(C.jsx)("p",{className:"info--value fw-bold",children:c.name||"-"})]})]}),Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-6 info-group",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-frequency-amount")}),Object(C.jsx)("p",{className:"info--value fw-bold",children:Object(y.q)(null===(t=d[0])||void 0===t?void 0:t.amount_saved,null===(a=d[0])||void 0===a?void 0:a.currency)||"-"})]}),Object(C.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-duration")}),Object(C.jsxs)("p",{className:"info--value fw-bold",children:[d.length,null===o||void 0===o?void 0:o.proposed_tenor_period]})]})]}),Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-6 info-group",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-config-target",{config_name:r})}),Object(C.jsx)("p",{className:"info--value fw-bold",children:Object(y.q)(d.reduce(((e,t)=>e+t.amount_saved),0),null===(n=d[0])||void 0===n?void 0:n.currency)||"-"})]}),Object(C.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(C.jsx)("p",{className:"info--title",children:"Type"}),Object(C.jsx)("p",{className:"info--value fw-bold",children:o.automated===S.b.automatic.id?"Automated":"Manual"})]})]}),Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-6 info-group",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-total-payout")}),Object(C.jsx)("p",{className:"info--value fw-bold",children:Object(y.q)(u.maturity_value-u.withholding_tax,null===(s=d[0])||void 0===s?void 0:s.currency)||"-"})]}),Object(C.jsxs)("div",{className:"col-6 info-group ms-auto text-sm-end",children:[Object(C.jsx)("p",{className:"info--title",children:j("lender-web-app-wthdraw-by")}),Object(C.jsx)("p",{className:"info--value fw-bold",children:Object(y.r)(o.maturity_date)||"-"})]})]})]})]}),Object(C.jsxs)("div",{className:"d-flex modal-footer justify-content-between control",children:[Object(C.jsx)("button",{type:"button",onClick:()=>l(ee),className:"btn py-3 me-3 pl-0 btn-ghost btn-lg",children:j("lender-web-app-back")}),Object(C.jsx)(E.a,{isLoading:"loading"===b,type:"submit",className:"btn py-3 btn-primary btn-lg px-5",children:j("lender-web-app-continue")})]})]})};function oe(e){let{configName:t}=e;const a=Object(D.a)((e=>e.setDownloadAppModal),i.shallow),{translate:n}=Object(N.useTranslation)();return Object(C.jsx)("div",{style:{minHeight:"50vh"},className:"d-flex align-items-center",children:Object(C.jsxs)("div",{className:"mx-auto my-auto text-center ",children:[Object(C.jsxs)("svg",{id:"success-check-mark",width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(C.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(C.jsxs)("defs",{className:"text-primary",children:[Object(C.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(C.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(C.jsxs)("h4",{className:"my-3 fw-bold text-primary",children:[n("lender-web-app-success"),"!"]}),Object(C.jsx)("small",{className:"text-small text-app-gray",children:n("lender-web-app-created-plan",{config_name:t})}),Object(C.jsx)(c.b,{to:s.a.investments.base,className:"px-5 mt-4 btn btn-primary btn-lg",onClick:()=>{setTimeout((()=>{a(!0)}),2e3)},children:n("lender-web-app-go-dashboard")})]})})}function de(e){var t;let{setCurrentStep:a,saving:n,configName:s}=e;const{translate:l}=Object(N.useTranslation)();return Object(C.jsx)(C.Fragment,{children:Object(C.jsxs)("div",{className:"modal-body py-4",children:[Object(C.jsxs)("div",{className:"tab-content__header mb-4",children:[Object(C.jsx)("p",{className:"text-primary  fs-5 text-capitalize  fw-bold",children:l("lender-web-app-config-offers",{config_name:s})}),Object(C.jsx)("small",{className:"text-app-gray",children:l("lender-web-app-select-preferred-offer")})]}),Object(C.jsx)("div",{className:"row mt-2 productGroup",children:(null===n||void 0===n||null===(t=n.offers)||void 0===t?void 0:t.length)>0?Object(C.jsx)(I.c,{children:null===n||void 0===n?void 0:n.offers.map((e=>Object(C.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 p-2",children:Object(C.jsx)(Y.a,{name:n.name,interestRate:e.interest_rate,lockedInvestment:!(null===n||void 0===n||!n.lock_on_create),productId:e.id,productTypeId:n.id,interestPeriod:n.interest_period.endsWith("s")?n.interest_period.slice(0,-1):n.interest_period,minAmount:e.min_amount,maxAmount:e.max_amount,onClick:()=>{a(X)},type:"investment"})},n.id)))}):Object(C.jsxs)("div",{className:"text-center w-100",children:[Object(C.jsx)("span",{className:"text-primary",children:Object(C.jsx)(K.a,{})}),Object(C.jsx)("h4",{className:"mt-3",children:l("lender-web-app-no-offers",{config_name:s})})]})})]})})}var be=()=>{var e;const{translate:t}=Object(N.useTranslation)(),[a,s]=Object(l.useState)(Q),{dictionary:c}=Object(l.useContext)(q.a),r=null===c||void 0===c?void 0:c.enable_and_name_savings,o=Object(n.j)(),[d,b,u]=g((e=>[e.saving,e.createSavings,e.updateMySavings]),i.shallow),{savingProduct:p,offer:m}=Object(l.useMemo)((()=>{var e;return d(null===o||void 0===o||null===(e=o.state)||void 0===e?void 0:e.productId)}),[null===o||void 0===o||null===(e=o.state)||void 0===e?void 0:e.productId]),h=t("lender-web-app-provide-numeric-value"),v=Object(l.useMemo)((()=>L.g().shape({name:L.h().required("Plan Name is required"),proposed_tenor:L.f().typeError(h).min(null===m||void 0===m?void 0:m.min_tenor,t("lender-web-app-duration-range",{min_tenor:null===m||void 0===m?void 0:m.min_tenor.toString(),max_tenor:null===m||void 0===m?void 0:m.max_tenor.toString()})).max(null===m||void 0===m?void 0:m.max_tenor,t("lender-web-app-duration-range",{min_tenor:null===m||void 0===m?void 0:m.min_tenor.toString(),max_tenor:null===m||void 0===m?void 0:m.max_tenor.toString()})).required(t("lender-web-app-please-enter-duration")),target:L.f().typeError(h).min(null===m||void 0===m?void 0:m.min_amount,t("lender-web-app-amount-range",{min_amount:Object(y.q)(null===m||void 0===m?void 0:m.min_amount),max_amount:Object(y.q)(null===m||void 0===m?void 0:m.max_amount)})).max(null===m||void 0===m?void 0:m.max_amount).required(t("lender-web-app-enter-an-amount")),start_date:L.d().min(Object(O.a)(),t("lender-web-app-select-valid-date")).required("Please select a date"),frequency:null!==p&&void 0!==p&&p.is_fixed?L.h().optional():L.g().required("Please select a date"),proposed_tenor_period:L.h().required("requiredChoice"),maturity_date:L.d(),automated:L.f().optional()})),[t,m]);return Object(C.jsx)("div",{className:"row",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("div",{className:"row",children:Object(C.jsx)("div",{className:"col-12",children:Object(C.jsx)("div",{className:"card default-card",children:a===ae?Object(C.jsx)("div",{className:"row",children:Object(C.jsx)(oe,{configName:r})}):Object(C.jsx)("div",{className:"row",children:Object(C.jsx)("div",{className:"pl-4 col-12 loan-form",children:a===Q?Object(C.jsx)(de,{saving:p,setCurrentStep:s,configName:r}):Object(C.jsx)(A.c,{validationSchema:v,initialValues:{name:"",start_date:"",proposed_tenor:null===m||void 0===m?void 0:m.min_tenor,proposed_tenor_period:null===m||void 0===m?void 0:m.tenor_period,target:null===m||void 0===m?void 0:m.min_amount,maturity_date:"",automated:S.b.automatic.id},onSubmit:async e=>{try{var t;await b({...e,product_id:null===p||void 0===p?void 0:p.id,product_offer:null===m||void 0===m?void 0:m.id,tenor_id:null===m||void 0===m||null===(t=m.min_tenor)||void 0===t?void 0:t.toString()})&&(s(ae),u())}catch(a){j.toast.error(a.message)}},children:e=>Object(C.jsxs)(A.b,{method:"post",onSubmit:e.handleSubmit,children:[a===X&&Object(C.jsx)(ne,{saving:p,offer:m,setCurrentStep:s,configName:r}),a===$&&Object(C.jsx)(ie,{saving:p,offer:m,setCurrentStep:s,configName:r}),a===ee&&Object(C.jsx)(R,{prevStep:()=>s($),nextStep:()=>s(te),configName:r}),a===te&&Object(C.jsx)(re,{saving:p,setCurrentStep:s,configName:r})]})})})})})})})})})};function ue(){var e,t,a;const{dictionary:s}=Object(l.useContext)(q.a),c=null===s||void 0===s?void 0:s.enable_and_name_savings,r=Object(n.i)(),o=Object(v.a)(),[d,b,u,j,p,m]=g((e=>[e.fetchProducts,e.savings,e.savingsStatus,e.mySavings,e.showSavingModal,e.closeSavingModal]),i.shallow);Object(l.useEffect)((()=>{d()}),[]);const h={dots:!1,infinite:!1,speed:500,slidesToShow:(3===(null===b||void 0===b?void 0:b.length)?3:(null===b||void 0===b?void 0:b.length)<=2&&2)||4,slidesToScroll:1,nextArrow:Object(C.jsx)(I.a,{}),prevArrow:Object(C.jsx)(I.b,{}),responsive:[{breakpoint:1280,settings:{slidesToShow:2===(null===b||void 0===b?void 0:b.length)?2:3,slidesToScroll:1}},{breakpoint:900,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:500,settings:{slidesToShow:1,slidesToScroll:1}}]},[O,f]=Object(l.useMemo)((()=>{var e,t;return null!==j&&void 0!==j&&j.length?[null!==(e=Object(x.v)("MATURED")(j))&&void 0!==e?e:[],null!==(t=Object(x.v)("RUNNING")(j))&&void 0!==t?t:[]]:[]}),[j]),{translate:w}=Object(N.useTranslation)();return"loading"===u?Object(C.jsxs)("div",{className:"row",children:[Object(C.jsx)("div",{className:"col-lg-4",children:Object(C.jsx)(Z.a,{rounded:!0})}),Object(C.jsx)("div",{className:"col-lg-8 mt-4 mt-lg-0",children:Object(C.jsx)(Z.a,{rounded:!0})})]}):Object(C.jsxs)("div",{className:"",children:[Object(C.jsx)("div",{className:"row",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsxs)("div",{className:"row",children:[Object(C.jsx)("div",{className:"col-lg-4",children:Object(C.jsx)(Y.b,{title:"".concat(w("lender-web-app-active")," ").concat(c),amount:f&&(null===f||void 0===f?void 0:f.length)>0?Object(x.x)(null===O||void 0===O||null===(e=O.filter((e=>e.balance>0)))||void 0===e?void 0:e.map((e=>e.balance)))+Object(x.x)(f.map((e=>e.balance))):0})}),Object(C.jsx)("div",{className:"col-lg-8",children:Object(C.jsx)("div",{className:"card default-card statsgroup ",children:Object(C.jsxs)("div",{className:"halfcard row",children:[Object(C.jsx)(W.a,{title:"".concat(w("lender-web-app-running")," ").concat(c),count:null!==(t=null===f||void 0===f?void 0:f.length)&&void 0!==t?t:0}),Object(C.jsx)(W.a,{title:"".concat(w("lender-web-app-matured")," ").concat(c),count:null!==(a=null===O||void 0===O?void 0:O.length)&&void 0!==a?a:0})]})})})]}),Object(C.jsx)("div",{className:"productGroup",children:Object(C.jsx)("div",{className:"row",children:Object(C.jsx)(I.c,{settings:h,children:b.map((e=>Object(C.jsx)("div",{className:"col-12 col-md-6 mb-0 col-lg-4 col-xl-3 px-2",children:Object(C.jsx)(Y.a,{name:e.name,interestRate:e.interest_rate,lockedInvestment:!(null===e||void 0===e||!e.lock_on_create),productId:e.id,productTypeId:e.id,interestPeriod:e.interest_period.endsWith("s")?e.interest_period.slice(0,-1):e.interest_period,minAmount:e.min_amount,maxAmount:e.max_amount,type:"investment-plans"})},e.id)))})})}),Object(C.jsx)("div",{className:"row  mt-4",children:Object(C.jsx)("div",{className:"col-12",children:Object(C.jsx)(J,{title:"".concat(c," ").concat(w("lender-web-app-history")),userSavings:j})})})]})}),Object(C.jsx)(T.a,{close:()=>{m(r,"savingId"),m(r,"id")},description:w("lender-web-app-config-application",{config_name:c}),show:p||!!o.get("id"),className:"",isUpload:!1,children:(p||o.get("id"))&&Object(C.jsx)(be,{})})]})}const je=[{key:"Non-fixed",value:0},{key:"Fixed",value:1}];function pe(){const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,a=Object(x.y)(),[n,r]=Object(l.useState)(""),[o,d]=Object(l.useState)(""),[b,u]=Object(l.useState)(""),[j,p]=Object(l.useState)(1),{translate:m}=Object(N.useTranslation)(),h=g(Object(l.useCallback)((e=>{var t;return null===(t=e.mySavings)||void 0===t?void 0:t.filter((e=>{var t;return new RegExp(o||".","i").test(e.name)&&(null===e||void 0===e?void 0:e.archived_flag)&&(""===b||+b==(null===e||void 0===e||null===(t=e.product)||void 0===t?void 0:t.lock_on_create))}))}),[b,o]),i.shallow);Object(l.useEffect)((()=>{p(1)}),[h]);const O=Object(l.useMemo)((()=>{const e=15*j-15,t=15*j;return h.slice(e,t)}),[j,15,h]),v=Object(l.useCallback)((e=>{p(e)}),[]);return Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)(c.b,{to:s.a.investments.base.for(t.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:m("lender-web-app-back-to-config",{config_name:t})})]})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsx)("p",{children:m("lender-web-app-archived-config",{config_name:t})})}),Object(C.jsx)("div",{className:"card default-card page-table",children:Object(C.jsx)("div",{className:"loans__history",children:(null===h||void 0===h?void 0:h.length)<1?Object(C.jsxs)("div",{className:"text-center w-100",children:[Object(C.jsx)("span",{className:"text-primary",children:Object(C.jsx)(K.a,{})}),Object(C.jsx)("h4",{className:"mt-3",children:m("lender-web-app-no-archived-config",{config_name:t})}),Object(C.jsx)("p",{className:"text-app-gray",children:m("lender-web-app-yet-to-archive",{config_name:t})})]}):Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("div",{className:"filter-and-search",children:[Object(C.jsxs)("div",{className:"filter-box d-flex",children:[Object(C.jsx)(U.k,{setDate:r,date:n}),Object(C.jsxs)("div",{className:"input-group input-group-filter",children:[Object(C.jsx)("div",{className:"input-group-prepend",children:Object(C.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[m("lender-web-app-status"),":"]})}),Object(C.jsxs)("select",{value:b,onChange:e=>u(e.target.value),onBlur:e=>u(e.target.value),className:"form-control",children:[Object(C.jsx)("option",{value:"",selected:!0,children:m("lender-web-app-all")}),Array.from(je).map((e=>Object(C.jsx)("option",{value:e.value,children:e.key},e.value)))]})]})]}),Object(C.jsx)("div",{className:" search-box",children:Object(C.jsx)("input",{value:o,onChange:e=>d(e.target.value),type:"search",className:"form-control",placeholder:"".concat(m("lender-web-app-search"),"..."),autoComplete:"false"})})]}),Object(C.jsx)("div",{className:"loans__history",children:null!==O&&void 0!==O&&O.length?Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(C.jsx)("thead",{children:Object(C.jsxs)("tr",{children:[Object(C.jsx)("th",{}),Object(C.jsx)("th",{className:"principal",children:m("lender-web-app-plan-name")}),Object(C.jsx)("th",{className:"tenor",children:m("lender-web-app-plan-name")}),Object(C.jsx)("th",{className:"tenor",children:m("lender-web-app-balance")}),Object(C.jsx)("th",{style:{textAlign:"right"},className:"tenor",children:m("lender-web-app-maturity-date")})]})}),Object(C.jsx)("tbody",{children:O.map((e=>Object(C.jsxs)("tr",{className:"link-row",onClick:()=>a.goTo(s.a.investments.details.for(e.id)),children:[Object(C.jsx)("td",{style:{textAlign:"right"},"data-toggle":"tooltip","data-placement":"top",className:"d-flex status align-items-end align-items-sm-end justify-content-end",children:Object(C.jsx)("div",{style:{width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"},className:"".concat(null!==e&&void 0!==e&&e.is_matured?"running":"pending","-pill")})}),Object(C.jsx)("td",{className:"date",children:e.name}),Object(C.jsxs)("td",{className:"interest",children:[e.interest_rate,"%"]}),Object(C.jsx)("td",{className:"date",children:Object(y.q)(e.balance)}),Object(C.jsx)("td",{style:{textAlign:"right"},className:"date",children:Object(y.v)(e.end_date)})]},e.id)))})]}),Object(C.jsx)("div",{className:"mobileListTable d-lg-none",children:O.map((e=>Object(C.jsxs)("div",{onClick:()=>a.goTo(s.a.investments.details.for(e.id)),className:"list",children:[Object(C.jsx)("div",{className:"row listData",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"principal",children:e.name})})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"date",children:Object(y.q)(e.balance)})})}),Object(C.jsxs)("div",{className:"row listData",children:[Object(C.jsx)("div",{className:"col",children:Object(C.jsxs)("p",{className:"interest",children:[e.interest_rate,"%"]})}),Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("div",{className:"status-wrapper",children:Object(C.jsx)("div",{style:{width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"},className:"".concat(null!==e&&void 0!==e&&e.is_matured?"running":"pending","-pill")})})})]})]},e.id)))})]}):Object(C.jsx)("div",{className:"mx-auto text-center text-capitalize",children:m("lender-web-app-not-found",{config_name:t})})})]})})}),h.length>=1&&Object(C.jsx)(G.a,{total:h.length,perPage:15,currentPage:j,loadPage:v})]})}function me(){const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,{params:a}=Object(n.k)(),[r,o]=Object(l.useState)(1),[d,b,u]=g((e=>[e.savingTransactions,e.fetchSavingTransactions,e.fetchSavingStatus]),i.shallow),{translate:j}=Object(N.useTranslation)();Object(l.useEffect)((()=>{b(+a.id)}),[]),Object(l.useEffect)((()=>{o(1)}),[d]);const p=Object(l.useMemo)((()=>{const e=15*r-15,t=15*r;return d.slice(e,t)}),[r,15,d]),m=Object(l.useCallback)((e=>{o(e)}),[]);return Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)(c.b,{to:s.a.investments.details.for(a.id),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:j("lender-web-app-back-to-investment",{config_name:t})})]})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsx)("p",{className:"text-capitalize",children:j("lender-web-app-config-name-transactions",{config_name:t})})}),Object(C.jsx)("div",{className:"card default-card page-table",children:Object(C.jsx)("div",{className:"loans__history",children:"loading"===u&&Object(C.jsx)("div",{className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(C.jsx)("div",{className:"spinner-border text-primary",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[j("lender-web-app-loading"),"..."]})})})||(null===d||void 0===d?void 0:d.length)<1&&Object(C.jsxs)("div",{className:"text-center w-100",children:[Object(C.jsx)("span",{className:"text-primary",children:Object(C.jsx)(K.a,{})}),Object(C.jsx)("h4",{className:"mt-3",children:j("lender-web-app-no-investment-transaction",{config_name:t})}),Object(C.jsx)("p",{className:"text-app-gray",children:j("lender-web-app-yet-to-transact",{config_name:t})})]})||Object(C.jsx)("div",{className:"loans__history",children:(null===p||void 0===p?void 0:p.length)&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(C.jsx)("thead",{children:Object(C.jsxs)("tr",{children:[Object(C.jsx)("th",{}),Object(C.jsx)("th",{className:"principal",children:j("lender-web-app-type")}),Object(C.jsx)("th",{className:"tenor",children:j("lender-web-app-amount")}),Object(C.jsx)("th",{className:"tenor",children:j("lender-web-app-reference")}),Object(C.jsx)("th",{className:"tenor",children:j("lender-web-app-narration")}),Object(C.jsx)("th",{style:{textAlign:"right"},className:"tenor",children:j("lender-web-app-date")})]})}),Object(C.jsx)("tbody",{children:p.map((e=>Object(C.jsxs)("tr",{className:"link-row",children:[Object(C.jsx)("td",{style:{textAlign:"right"},"data-toggle":"tooltip",title:e.status,"data-placement":"top",className:"d-flex status align-items-end align-items-sm-end justify-content-end",children:Object(C.jsx)("div",{style:{background:("success"===e.status?"green":"pending"===e.status&&"orange")||"red",width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"}})}),Object(C.jsx)("td",{className:"date",children:"Top up"}),Object(C.jsx)("td",{className:"date",children:Object(y.q)(e.amount)}),Object(C.jsx)("td",{className:"date",children:e.transaction_id}),Object(C.jsx)("td",{className:"interest",children:e.meta}),Object(C.jsx)("td",{style:{textAlign:"right"},className:"date",children:Object(y.w)(e.created_on)})]},e.id)))})]}),Object(C.jsx)("div",{className:"mobileListTable d-lg-none",children:p.map((e=>Object(C.jsxs)("div",{className:"list",children:[Object(C.jsxs)("div",{className:"row listData",children:[Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"interest",children:e.transaction_id})}),Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("div",{className:"status-wrapper",children:Object(C.jsx)("div",{"data-toggle":"tooltip","data-placement":"top",title:e.status,className:"rounded-circle ms-3",style:{background:("success"===e.status?"green":"pending"===e.status&&"orange")||"red",width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"}})})})]}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"principal",children:Object(y.q)(e.amount)})})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"date",children:e.meta})})}),Object(C.jsx)("div",{className:"row listData",children:Object(C.jsx)("div",{className:"col",children:Object(C.jsx)("p",{className:"date",children:Object(y.w)(e.created_on)})})})]},e.transaction_id)))})]})||Object(C.jsxs)("div",{className:"mx-auto text-center text-capitalize",children:[t," Not Found"]})})})}),d.length>=1&&Object(C.jsx)(G.a,{total:d.length,perPage:15,currentPage:r,loadPage:m})]})}var he=a(51);var Oe=()=>{var e;const{dictionary:t}=Object(l.useContext)(q.a),a=null===t||void 0===t?void 0:t.enable_and_name_savings,{params:s}=Object(n.k)(),c=Object(n.i)(),[r,o]=Object(l.useState)(""),[d,p]=Object(l.useState)(!1),[m,h]=Object(l.useState)(!1),[O,v]=Object(l.useState)(""),[x,f]=Object(l.useState)(""),[w,_]=Object(l.useState)("repay"),[y,S]=Object(l.useState)(""),T=Object(he.a)((e=>e.initiateTransfer)),A=g((e=>e.savingDetail),i.shallow),{details:L,savingType:M,balance:D}=Object(l.useMemo)((()=>A||{savingType:null,balance:null,details:null}),[A]),F=async e=>{h(!0);try{const t=await Object(b.a)(Object(u.Vb)(s.id),"post",e?{amount:r,pin:O,otp:e}:{amount:r,pin:O});j.toast.success(null===t||void 0===t?void 0:t.message),S(null===t||void 0===t?void 0:t.message),h(!1),_("success")}catch(t){j.toast.error(t.message),h(!1)}},{translate:I}=Object(N.useTranslation)();return Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{style:{flex:1},className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)("button",{onClick:()=>c.goBack(),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:I("lender-web-app-back-to-config",a)})]})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsxs)("p",{children:[a," Details"]})}),"success"===w?Object(C.jsx)("div",{className:"card default-card page-table",style:{maxWidth:"650px",minHeight:"500px"},children:Object(C.jsx)(ve,{message:y})}):Object(C.jsx)("div",{style:{maxWidth:"650px",minHeight:"500px"},className:"card default-card page-table",children:Object(C.jsxs)("div",{className:"p-lg-3",style:{maxWidth:"550px"},children:["repay"===w&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("h5",{children:I("lender-web-app-withdraw-from-app",{config_name:a})}),Object(C.jsxs)("p",{className:"mb-4",children:[I("lender-web-app-details-to-withdraw")," ",a,"."]}),Object(C.jsx)(k,{balance:{balance:null===L||void 0===L?void 0:L.balance,target:null===L||void 0===L?void 0:L.target,currency:null===D||void 0===D?void 0:D.currency},is_fixed:!(null===M||void 0===M||!M.is_fixed)}),Object(C.jsx)("p",{className:" text-small mt-5",children:I("lender-web-app-howmuch-to-withdraw")}),Object(C.jsx)("div",{className:"form-group mt-1 mb-1",children:Object(C.jsx)("input",{onChange:e=>{o(e.target.value)},type:"number",value:r,placeholder:"Amount",className:"form-control"})}),Object(C.jsx)(se,{showPrompt:d,close:()=>p(!1),description:I("lender-web-app-early-liqudation-penalty"),continueApp:()=>{_("pin")},warningMessage:Object(C.jsx)(C.Fragment,{children:I("lender-web-app-note-penalty-fee",{penal_charge_rate:null!==(e=null===M||void 0===M?void 0:M.penal_charge_rate.toString())&&void 0!==e?e:""})})})]}),"pin"===w&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("p",{className:"text-black fs-5 fw-bold",children:I("lender-web-app-authorize-applicaiton")}),Object(C.jsx)("small",{className:"text-black-50",children:I("lender-web-app-please-enter-pin")}),Object(C.jsx)("p",{className:" mt-5",children:I("lender-web-app-enter-pin")}),Object(C.jsx)(U.o,{length:4,onChange:e=>{v(e)},password:!0})]}),"otp"===w&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("p",{className:"text-black fs-5 fw-bold",children:"One Time Password"}),Object(C.jsx)("small",{className:"text-black-50",children:"Enter OTP sent to your phone"}),Object(C.jsx)("p",{className:" mt-5",children:I("lender-web-app-enter-pin")}),Object(C.jsx)(U.o,{length:6,onChange:e=>{f(e)},password:!0})]}),Object(C.jsxs)("div",{className:"d-flex justify-content-between control mt-3 mt-3",children:[Object(C.jsx)("button",{type:"button",onClick:()=>"pin"===w?_("repay"):c.goBack(),className:"btn   py-3 me-3 btn-outline-primary btn-lg px-5 mt-4",children:I("lender-web-app-back")}),Object(C.jsx)(E.a,{isLoading:m,onClick:()=>"pin"===w&&(async()=>{h(!0);const e=await T(O);null!==e&&void 0!==e&&e.data.otp?(_("otp"),h(!1)):F(null)})()||"otp"===w&&F(x)||(null===L||void 0===L?void 0:L.is_matured)&&_("pin")||p(!0),isDisabled:"pin"===w?O.length<4:!r,className:"btn btn-primary py-3 me-3  btn-lg mt-4",children:I("lender-web-app-continue")})]})]})})," "]})};function ve(e){let{message:t}=e;const{dictionary:a}=Object(l.useContext)(q.a),n=null===a||void 0===a?void 0:a.enable_and_name_savings,{translate:i}=Object(N.useTranslation)();return Object(C.jsx)("div",{className:"row m-4 py-2",children:Object(C.jsxs)("div",{style:{minHeight:"50vh"},className:"mx-auto d-flex loan-form text-center flex-column justify-content-center align-items-center",children:[Object(C.jsxs)("svg",{id:"success-check-mark",className:"text-primary",width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(C.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(C.jsxs)("defs",{children:[Object(C.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(C.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(C.jsx)("h4",{className:"fw-bold my-3 text-primary",children:t.includes("Request")?"Request successful":"Congrats!"}),Object(C.jsx)("small",{className:"text-small text-app-gray",children:t.includes("Request")?"Your Liquidation Request is being Processed":"Your withdrawal is ".concat(t)}),Object(C.jsx)(c.b,{to:s.a.investments.base.for(n.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),className:"btn btn-primary btn-lg px-5 mt-4",children:i("lender-web-app-go-dashboard")})]})})}var xe=a(15);var fe=()=>{const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,{params:a}=Object(n.k)(),s=Object(n.i)(),[c,r]=Object(l.useState)(!1),[o,d]=Object(l.useState)(""),[p,m]=Object(l.useState)(),[h,O]=Object(l.useState)(!1),v=g((e=>e.savingDetail),i.shallow),{details:x,savingType:f,balance:w}=Object(l.useMemo)((()=>v||{savingType:null,balance:null,details:null}),[v]),[_]=Object(xe.a)(Object(l.useCallback)((e=>[e.currency]),[])),{translate:y}=Object(N.useTranslation)();return Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{style:{flex:1},className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)("button",{onClick:()=>s.goBack(),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:y("lender-web-app-back-to-investment",{config_name:t})})]})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsx)("p",{children:y("lender-web-app-app-details",{config_name:t})})}),Object(C.jsx)("div",{className:"card default-card page-table",style:{maxWidth:"650px",minHeight:"500px"},children:c?Object(C.jsx)(ge,{}):Object(C.jsxs)("div",{className:"p-lg-3",children:[Object(C.jsx)("h5",{children:y("lender-web-app-top-up-investment",{config_name:t})}),Object(C.jsx)("p",{className:"mb-4",children:y("lender-web-app-details-to-topup",{config_name:t})}),Object(C.jsx)(k,{balance:{balance:null===x||void 0===x?void 0:x.balance,target:null===x||void 0===x?void 0:x.target,currency:null===w||void 0===w?void 0:w.currency},is_fixed:!(null===f||void 0===f||!f.is_fixed)}),Object(C.jsx)("div",{className:"form-group mt-5 mb-5",children:Object(C.jsx)(U.e,{className:"form-control",placeholder:"Enter Amount",label:y("lender-web-app-how-much-transfer",{currency:null!==_&&void 0!==_?_:"(\u20a6)"}),onChange:e=>m(e)})}),Object(C.jsx)("small",{className:"text-black-50 mb-2 mt-35 text-small",children:y("lender-web-app-select-preferred-funding")}),Object(C.jsxs)("div",{className:"col",children:[Object(C.jsx)(P,{chosen:o,onChange:d}),Object(C.jsx)("div",{className:"mt-4"})]}),Object(C.jsxs)("div",{className:"d-flex justify-content-between control mt-3 mt-3",children:[Object(C.jsx)("button",{type:"button",onClick:()=>s.goBack(),className:"btn py-3  me-3 btn-outline-primary btn-lg px-5 mt-4",children:y("lender-web-app-back")}),Object(C.jsx)(E.a,{isLoading:h,onClick:()=>(async()=>{const e={amount:p,card_id:o};O(!0);try{const t=await Object(b.a)(Object(u.Nb)(a.id),"post",e);j.toast.success(null===t||void 0===t?void 0:t.message),O(!1),r(!0)}catch(t){j.toast.error(t.message),O(!1)}})(),isDisabled:!p||!o,className:"btn btn-primary py-3 me-3 btn-lg mt-4",children:y("lender-web-app-continue")})]})]})})]})};function ge(){const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings;return Object(C.jsx)("div",{className:"row m-4 py-2",children:Object(C.jsxs)("div",{style:{maxWidth:"538px",minHeight:"50vh"},className:"mx-auto d-flex text-center flex-column justify-content-center align-items-center",children:[Object(C.jsxs)("svg",{id:"success-check-mark",className:"text-primary",width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(C.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(C.jsxs)("defs",{children:[Object(C.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(C.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(C.jsx)("h4",{className:"fw-bold my-3",children:"Topup successful!"}),Object(C.jsx)("small",{className:"text-small text-app-gray",children:"Your plan has been successfully topped up."}),Object(C.jsx)(c.b,{to:s.a.investments.base.for(t.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),className:"btn btn-primary btn-lg px-5 mt-4",children:"Go to Dashboard"})]})})}var we=()=>{const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,{params:a}=Object(n.k)(),s=Object(n.i)(),[c,r]=Object(l.useState)(!1),[o,d]=Object(l.useState)(!1),[p,m]=Object(l.useState)(""),{translate:O}=Object(N.useTranslation)(),[v,x,f,w]=g((e=>[e.fetchSaving,e.savings,e.fetchSavingStatus,e.savingDetail]),i.shallow);Object(l.useEffect)((()=>{v(a.id)}),[a]);const{details:_,savingType:y,balance:S}=Object(l.useMemo)((()=>w||{details:null,savingType:null,balance:null}),[w]),T=null===x||void 0===x?void 0:x.find((e=>e.id===(null===_||void 0===_?void 0:_.product_id))),{maxTenorValue:A,maxTenorPeriod:L}=Object(l.useMemo)((()=>({maxTenorValue:T.max_tenor_value,maxTenorPeriod:T.max_tenor_period})),[T]);return Object(C.jsxs)("div",{children:[Object(C.jsx)("div",{style:{flex:1},className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(C.jsxs)("button",{onClick:()=>s.goBack(),className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(C.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(C.jsx)("svg",{width:"20",height:"20",children:Object(C.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(C.jsx)("p",{children:O("lender-web-app-back-to-investment",{config_name:t})})]})}),Object(C.jsx)("div",{className:"pageTitle",children:Object(C.jsxs)("p",{children:[" ",O("lender-web-app-app-details",{config_name:t})," "]})}),"loading"===f&&Object(C.jsx)("div",{style:{maxWidth:"650px",minHeight:"500px"},className:"col-md-6 bg-white flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(C.jsx)("div",{className:"spinner-border text-primary",role:"status",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[O("lender-web-app-app-loading"),"..."]})})})||"success"===f&&Object(C.jsx)("div",{className:"card default-card page-table",style:{maxWidth:"650px",minHeight:"500px"},children:c?Object(C.jsx)(_e,{}):Object(C.jsxs)("div",{className:"p-lg-3",children:[Object(C.jsx)("h5",{children:O("lender-web-app-rollover",{config_name:t})}),Object(C.jsx)("p",{className:"mb-5",children:O("lender-web-app-rollover-mature",{config_name:t})}),Object(C.jsx)(k,{balance:{balance:null===_||void 0===_?void 0:_.balance,target:null===_||void 0===_?void 0:_.target,currency:null===S||void 0===S?void 0:S.currency},is_fixed:!(null===y||void 0===y||!y.is_fixed)}),Object(C.jsxs)("div",{className:"form-group  mt-35",children:[Object(C.jsx)("label",{htmlFor:"",children:O("lender-web-app-set-new-withdrawal")}),Object(C.jsx)(U.m,{minDate:h()().format(),maxDate:h()(A,L).add().format(),setValue:m})]}),Object(C.jsx)("small",{className:"form-text text-primary p-2 rounded-3 bg-light-blue d-block mt-2",children:O("lender-web-app-maturity-explained",{config_name:t,penal_charge_rate:null===T||void 0===T?void 0:T.penal_charge_rate.toString()})}),Object(C.jsxs)("div",{className:"d-flex justify-content-between control mt-3 mt-1",children:[Object(C.jsx)("button",{type:"button",onClick:()=>s.goBack(),className:"btn py-3 me-3 btn-outline-primary btn-lg px-5 mt-4",children:O("lender-web-app-back")}),Object(C.jsx)(E.a,{isLoading:o,onClick:()=>(async()=>{d(!0);try{const e=await Object(b.a)(Object(u.Lb)(a.id),"post",{end_date:h()(p).toDate()});j.toast.success(null===e||void 0===e?void 0:e.message),d(!1),r(!0)}catch(e){j.toast.error(e.message),d(!1)}})(),isDisabled:!p,className:"btn py-3 me-3 pl-0 btn-primary btn-lg mt-4",children:O("lender-web-app-continue")})]})]})})||Object(C.jsx)("div",{className:" d-flex justify-content-center align-items-center",children:Object(C.jsx)("p",{className:"",children:O("lender-web-app-error-fetching-transaction")})})," "]})};function _e(){const{dictionary:e}=Object(l.useContext)(q.a),t=null===e||void 0===e?void 0:e.enable_and_name_savings,{translate:a}=Object(N.useTranslation)();return Object(C.jsx)("div",{className:"row m-4 py-2",children:Object(C.jsxs)("div",{style:{minHeight:"50vh"},className:"mx-auto  loan-form d-flex text-center flex-column justify-content-center align-items-center",children:[Object(C.jsxs)("svg",{id:"success-check-mark",className:"text-primary",width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(C.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(C.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(C.jsxs)("defs",{children:[Object(C.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(C.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(C.jsx)("stop",{stopColor:"currentColor"}),Object(C.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(C.jsx)("h4",{className:"fw-bold my-3",children:a("lender-web-app-rollover-successful")}),Object(C.jsx)("small",{className:"text-small text-app-gray",children:a("lender-web-app-rollover-successful-explained")}),Object(C.jsx)(c.b,{to:s.a.investments.base.for(t.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),className:"btn btn-primary btn-lg px-5 mt-4",children:a("lender-web-app-go-dashboard")})]})})}const ye={investments:{archive:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/archive"),details:{definition:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id"),for:e=>Object(n.g)("/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id"),{id:e})},detailsTransactions:{definition:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/transactions"),for:e=>Object(n.g)("/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/transactions"),{id:e})},topup:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/topup"),withdraw:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/withdraw"),edit:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/edit"),rollover:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/:id/rollover"),apply:{base:"/".concat(window.APP_INVESTMENT_CONFIG_NAME,"/apply")}}};function Ne(){const{dictionary:e}=Object(l.useContext)(q.a),t=Object(n.j)(),a=null===e||void 0===e?void 0:e.enable_and_name_savings.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-");return Object(C.jsx)("div",{className:"main__content ".concat(t.pathname.match(/loans\/\d+/)?"loanDetails":"loans"),children:Object(C.jsxs)(n.e,{children:[Object(C.jsx)(n.c,{path:"/".concat(a,"/archive"),children:Object(C.jsx)(pe,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id/withdraw"),children:Object(C.jsx)(Oe,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id/topup"),children:Object(C.jsx)(fe,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id/edit"),children:Object(C.jsx)(B,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id/rollover"),children:Object(C.jsx)(we,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id/transactions"),children:Object(C.jsx)(me,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/:id"),children:Object(C.jsx)(H,{})}),Object(C.jsx)(n.c,{path:"/".concat(a,"/apply"),children:Object(C.jsx)(be,{})}),Object(C.jsx)(n.c,{exact:!0,path:s.a.investments.base.for(a),children:Object(C.jsx)(ue,{})})]})})}},259:function(e,t,a){"use strict";var n=a(12),s=a(443),l=a(766),c=a(442),i=a(1),r=a(6),o=a(145),d=a(13),b=a(4),u=a(9),j=a.n(u),p=a(2);var m=a(0);var h=function(e){let{field:t}=e;const[a,s]=Object(i.useState)(!1),[l,c]=Object(i.useState)(null),{setFieldValue:j,values:h}=Object(n.f)(),[O,v,x]=Object(d.a)((e=>[e.additionalDocuments,e.uploadAdditionalDoc,e.clearAdditionalDoc]),b.shallow),f=null===O||void 0===O?void 0:O.find((e=>e.id===t.id)),g=async e=>{const a=await(n=e,s="".concat(t.id,".png"),l="image/png",fetch(n).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],s,{type:l})})).catch((()=>{Object(p.translate)("lender-web-app-error-uploading-file").then((e=>{u.toast.error(e)}))})));var n,s,l;const c=await v(a,t.id);j(t.id,null===c||void 0===c?void 0:c.url)},{translate:w}=Object(p.useTranslation)();return Object(m.jsxs)("div",{className:"action-btn mb-4",children:[Object(m.jsxs)("div",{className:"d-flex",children:[Object(m.jsx)(r.a,{className:"btn btn-primary custom-file-uploadbtn py-1 px-2",onClick:()=>{s(!0)},children:w("lender-web-app-upload-image")}),(!!h[t.id]||(null===f||void 0===f?void 0:f.data))&&Object(m.jsx)("button",{className:"btn btn-gray py-1 px-2 ms-2",onClick:()=>{j(t.id,""),x(t.id)},children:w("lender-web-app-remove")})]}),a&&Object(m.jsx)(o.a,{showWebCamModal:a,setShowWebCamModal:s,setCapturedImage:c,capturedImage:l,description:w("lender-web-app-take-a-picture"),handleSave:()=>{g(l),s(!1)}})]})},O=a(424),v=a.n(O),x=a(260),f=a(25),g=a(181);function w(e){var t,a,s,l,c;let{id:o,field:d,document:b,uploadStatus:u,uploadDoc:j}=e;const{setFieldValue:h}=Object(n.f)(),[O,v]=Object(i.useState)(!1),x=Object(i.useCallback)((()=>{v((e=>!e))}),[null===b||void 0===b?void 0:b.status]),[g,w]=Object(i.useState)(),y=Object(i.useCallback)((async(e,t,a,n)=>{const s=await j(e,t,x,n);h(t,s.url),e.type.includes("image")?w({preview:s.url,type:"image"}):w({preview:e.name,type:"doc"}),"function"===typeof a&&a()}),[j,o,x]),{translate:N}=Object(p.useTranslation)();return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(f.a,{show:O,close:x,description:d.name,children:Object(m.jsx)("div",{className:"modal-body",children:Object(m.jsx)("div",{className:"modal-form",children:Object(m.jsx)(_,{onFileSelect:y,status:u,id:o,allowed:null===d||void 0===d||null===(t=d.validation)||void 0===t?void 0:t.allowed,type:d.type})})})},d.name),Object(m.jsxs)("div",{className:"d-flex mb-2",children:[(b||g)&&(null!==b&&void 0!==b&&null!==(a=b.data)&&void 0!==a&&null!==(s=a.type)&&void 0!==s&&s.includes("image")||"image"===(null===g||void 0===g?void 0:g.type)?Object(m.jsx)("img",{src:"".concat((null===g||void 0===g?void 0:g.preview)||(null===b||void 0===b||null===(l=b.data)||void 0===l?void 0:l.url)),alt:"".concat(null===b||void 0===b?void 0:b.data.name),className:"rounded-circle image-container",style:{height:"4rem",width:"4rem"}}):Object(m.jsx)("span",{className:"file-name",children:(null===g||void 0===g?void 0:g.preview)||(null===b||void 0===b||null===(c=b.data)||void 0===c?void 0:c.name)})),b?Object(m.jsx)("button",{className:"btn btn-gray custom-file-uploadbtn px-3 ms-3",onClick:x,style:{display:"inline-block",height:"fit-content",padding:"0.4rem 0",margin:"auto 0"},children:N("lender-web-app-upload-file")}):Object(m.jsx)(r.a,{onClick:x,type:"button",className:"btn btn-primary custom-file-uploadbtn py-1 px-3",children:N("lender-web-app-upload")})]})]})}function _(e){let{onFileSelect:t,status:a,id:n,allowed:s,type:l}=e;const c=(s||Object(g.a)(l)).split(",");for(let i=0;i<c.length;i++)c[i]=v.a.lookup(c[i].trim());c.includes("video/x-msvideo")&&c.push(".avi");const[r,o]=Object(i.useState)(null),d=Object(i.useCallback)((e=>{e.length&&(o(e[0]),t(e[0],n,(()=>{}),s||Object(g.a)(l)))}),[t]),{getRootProps:b,getInputProps:j}=Object(x.a)({accept:c.filter((e=>e)).join(", "),onDrop:d,maxSize:52428800,maxFiles:1,onDropRejected:()=>{u.toast.error(h("lender-web-app-file-too-large"))}}),{translate:h}=Object(p.useTranslation)();return Object(m.jsx)("div",{className:"form-group upload-btn btn",...b(),children:r?Object(m.jsxs)("label",{className:"filelabel successUpload",children:["success"===a&&Object(m.jsx)("div",{className:"btn-wrapper",children:Object(m.jsx)("button",{className:"btn btn-link text-danger",onClick:()=>o(null),children:h("lender-web-remove")})}),Object(m.jsxs)("div",{className:"file",children:[Object(m.jsxs)("div",{className:"file--wrapper",children:[Object(m.jsx)("div",{className:"file-icon",children:Object(m.jsx)("svg",{width:"32",height:"32",children:Object(m.jsx)("use",{xlinkHref:"/icon-sprite.svg#file"})})}),Object(m.jsxs)("div",{children:[Object(m.jsx)("p",{className:"name",children:r.name}),Object(m.jsxs)("p",{className:"size",children:[(r.size/1e6).toFixed(2),"MB"]})]})]}),Object(m.jsx)("div",{className:"file-status",children:"loading"===a&&Object(m.jsx)("div",{className:"spinner-border text-primary",children:Object(m.jsxs)("span",{className:"visually-hidden",children:[h("lender-web-app-loading"),"..."]})})||"success"===a&&Object(m.jsx)("svg",{width:"24",height:"24",children:Object(m.jsx)("use",{xlinkHref:"/icon-sprite.svg#done"})})||null})]})]}):Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)("input",{...j()}),Object(m.jsxs)("div",{className:"filelabel d-flex align-items-center justify-content-center flex-column","aria-label":"uploadDocument",children:[Object(m.jsx)("svg",{width:"48",height:"48",children:Object(m.jsx)("use",{xlinkHref:"/icon-sprite.svg#image"})}),Object(m.jsxs)("div",{className:"upload-text",children:[Object(m.jsxs)("div",{className:"top",children:[Object(m.jsx)("h3",{children:h("lender-web-app-drag-file")}),Object(m.jsxs)("p",{children:[h("lender-web-app-or")," ",Object(m.jsx)("span",{className:"text-primary",children:Object(m.jsxs)("u",{children:[h("lender-web-app-browse")," "]})})," ",h("lender-web-app-to-choose")]})]}),Object(m.jsx)("div",{className:"down",children:Object(m.jsxs)("p",{children:["(",h("lender-web-app-max-50"),")"]})})]})]})]})})}function y(e){let{id:t,field:a}=e;const[n,s,l]=Object(d.a)((e=>[e.additionalDocuments,e.additionalDocUploadStatus,e.uploadAdditionalDoc]),b.shallow);return Object(m.jsx)("div",{className:"card default-card",children:Object(m.jsx)("div",{className:"row py-2",children:Object(m.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(m.jsx)(w,{id:t,field:a,document:null===n||void 0===n?void 0:n.find((e=>e.id===t)),uploadStatus:s,uploadDoc:l})})})})}var N=a(3),C=a(60),k=e=>[{id:"bank_code",name:"Bank Code",type:"bank",label:"Select your bank",description:"Select your bank",validation:{required:!0}},{id:"account_number",name:"Account Number",type:"api",sub_type:"short_text",label:"Bank account number",dedescription:"Account number to be used to test regex. Double \\ escapes the regex backslash character",parameters:{url:"".concat("https://vigil.lendsqr.com/remita/","inflight/verify"),body:{bank_code:"{{bank_code}}",account_number:"{{account_number}}"},method:"POST",headers:{accesskey:e},assign:[{key:"data.customerId",value:"customer_id"},{key:"data.customerName",value:"customer_name"},{key:"data.companyName",value:"company_name"},{key:"data.firstPaymentDate",value:"first_payment_date"},{key:"data.salaryPaymentDetails[0].paymentDate",value:"last_payment_date"},{key:"data.loanHistory",value:"loan_history"},{key:"data.oustandingAmount",value:"outstanding_loan_amount"},{key:"data.loanHistoryDetails[0].loanDisbursementDate",value:"last_disbursement_date"},{key:"data.authorization_code",value:"authorization_code"},{key:"data.salaryPaymentDetails[0].amount",value:"salary_amount"}]},validation:{required:!0,rule:"^\\d{10}$"}},{id:"customer_id",name:"Customer ID",type:"short_text",label:"Customer ID",description:"Remita customer ID",validation:{required:!0,minimum_length:"5",maximum_length:"100"},disabled:!0},{id:"customer_name",name:"Customer Name",type:"short_text",label:"Customer Name",description:"Customer's name",validation:{required:!0,minimum_length:"5",maximum_length:"256"},disabled:!0},{id:"company_name",name:"Company Name",type:"short_text",label:"Company Name",description:"Company's name",validation:{minimum_length:"5",maximum_length:"256"},disabled:!0},{id:"first_payment_date",name:"First Payment Date",type:"date",label:"First Payment Date",description:"First Payment Date",validation:{minimum_length:"20 years before",maximum_length:"0 years before"},disabled:!0},{id:"last_payment_date",name:"Last payment Date",type:"date",label:"Last Salary Date",description:"Last Salary Date",validation:{minimum_length:"20 years before",maximum_length:"0 years before"},disabled:!0},{id:"loan_history",name:"Loan History",type:"short_text",label:"Loan History",description:"User's Loan History",validation:{minimum_length:"0",maximum_length:"256"},disabled:!0},{id:"outstanding_loan_amount",name:"Outstanding Loan Amount",type:"number",label:"Outstanding Loan Amount",description:"User's outstanding loan amount",validation:{minimum_length:"0",maximum_length:"256"},disabled:!0},{id:"last_disbursement_date",name:"Last Disbursement Date",type:"date",label:"Last Disbursement Date",description:"Last Disbursement Date",validation:{minimum_length:"20 years before",maximum_length:"0 years before"},disabled:!0}],S=a(24),E=a.n(S),T=a(227),A=(a(81),a(15)),L=a(269),M=function(e){let{field:t,callback:a}=e;const[s,l]=Object(i.useState)("Verify Veriff"),c=Object(n.f)(),{setFieldValue:r}=c||{},[o]=Object(A.a)((e=>[e.getVerificationDocument]),b.shallow),d=e=>{Object(L.b)({url:e.url,onEvent(e){e===L.a.CANCELED&&l("Verify Veriff"),e===L.a.FINISHED&&(l("Verified"),r&&r(t.id,"success"),j.a.success("Your ID is pending verification and approval"),a&&a()),console.log(e)}})};return Object(m.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"20px"},children:Object(m.jsx)("button",{id:"verify-with-veriff",disabled:"Verify Veriff"!==s,onClick:()=>{(async()=>{l("Initializing...");const e=await o();d(e)})()},children:s})})},D=a(7),F=a(36);const I=new Date,R=Object(s.a)(I,5),P=Object(l.a)(I,100);t.a=function e(t){var a,s,l,i,r,o,u,j,O,v,x;let{field:f,props:g}=t;const{setFieldValue:w,getFieldMeta:_}=Object(n.f)(),S=Object(C.a)((e=>e.getOptionsByKey),b.shallow),A=Object(d.a)((e=>e.profile),b.shallow),{translate:L}=Object(p.useTranslation)();let I="",q="";switch(f.type){case F.a.api:return Object(m.jsx)(D.a,{name:f.id,label:f.label,parameters:f.parameters,user:A});case F.a.short_text:return Object(m.jsx)(D.s,{name:f.id,label:f.label,placeholder:f.label,disabled:f.disabled,...g});case F.a.label:return Object(m.jsx)(D.s,{name:f.id,label:f.label,placeholder:f.label});case F.a.phone:return Object(m.jsx)(D.s,{type:"number",name:f.id,label:f.label,tel:!0,placeholder:f.label});case F.a.email:return Object(m.jsx)(D.s,{name:f.id,label:L("lender-web-app-email-address"),placeholder:f.label});case F.a.long_text:return Object(m.jsx)(D.l,{name:f.id,label:f.label,validation:f.validation});case F.a.number:return Object(m.jsx)(D.s,{type:"number",name:f.id,label:f.label,inputProps:{onFocus:e=>{"0"===e.target.value&&w(f.id,"",!1)}},disabled:f.disabled,isNumberString:(null===f||void 0===f||null===(a=f.validation)||void 0===a?void 0:a.minimum_length)&&(null===f||void 0===f||null===(s=f.validation)||void 0===s?void 0:s.maximum_length),isToggleAble:null===f||void 0===f?void 0:f.masked,onKeyDown:f.masked?N.c:()=>{}});case F.a.amount:return Object(m.jsx)(D.e,{label:f.label,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w(f.id,+e,!0)},error:!!_(f.id).error,errorMessage:_(f.id).error,onFocus:e=>{"0"===e.target.value&&w(f.id,"",!0)}});case F.a.integer:return Object(m.jsx)(D.s,{type:"number",name:f.id,label:f.label,inputProps:{onFocus:e=>{"0"===e.target.value&&w(f.id,"",!1)}}});case F.a.date:return(e=>{const t="years";"string"===typeof e.validation.maximum_length?(I=Object(N.e)(e.validation.maximum_length,e.validation.type),q=Object(N.e)(e.validation.minimum_length,e.validation.type)):"number"===typeof e.validation.maximum_length?(I=e.validation.maximum_length<0?E()().subtract(-1*+e.validation.maximum_length,t).format("YYYY/MM/DD HH:mm:ss"):E()().add(e.validation.maximum_length,t).format("YYYY/MM/DD HH:mm:ss"),q=e.validation.minimum_length<0?E()().subtract(-1*+e.validation.minimum_length,t).format("YYYY/MM/DD HH:mm:ss"):E()().add(e.validation.minimum_length,t).format("YYYY/MM/DD HH:mm:ss")):(q=E()().subtract(100,t).format("YYYY/MM/DD HH:mm:ss"),I=E()().add(0,t).format("YYYY/MM/DD HH:mm:ss"))})(f),Object(m.jsx)(D.i,{maxDate:I,minDate:q,label:f.label,name:f.id,disabled:f.disabled});case F.a.time:return(e=>{if("number"===typeof e.validation.maximum_length){const t="years";I=e.validation.maximum_length<0?E()().subtract(-1*+e.validation.maximum_length,t).format("YYYY/MM/DD HH:mm:ss"):E()().add(e.validation.maximum_length,t).format("YYYY/MM/DD HH:mm:ss"),q=e.validation.minimum_length<0?E()().subtract(-1*+e.validation.minimum_length,t).format("YYYY/MM/DD HH:mm:ss"):E()().add(e.validation.minimum_length,t).format("YYYY/MM/DD HH:mm:ss")}})(f),Object(m.jsx)(D.u,{label:f.label,name:f.id,maxDate:Object(N.e)(f.validation.maximum_length,f.validation.type),minDate:Object(N.e)(f.validation.minimum_length,f.validation.type)});case F.a.date_time:return Object(m.jsx)(D.j,{minDate:P,maxDate:R,currentDate:Object(c.a)(),label:f.label,name:f.id,dateTime:!0});case F.a.drop_down:case F.a.select:return Object(m.jsx)(D.q,{name:f.id,label:f.label,keyField:"value",options:null!==(l=null===f||void 0===f?void 0:f.options)&&void 0!==l?l:[]});case F.a.bank:return Object(m.jsx)(D.q,{name:f.id,label:null===f||void 0===f?void 0:f.label,labelField:"code_description",valueField:"additional_code",keyField:"additional_code",loading:!(null!==(i=S("bank"))&&void 0!==i&&i.length),options:null!==(r=S("bank"))&&void 0!==r?r:[]});case F.a.remita_inflight:return console.log(k(null===A||void 0===A||null===(o=A.organization)||void 0===o?void 0:o.id),"======================user"),Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)("p",{className:"",children:f.description}),_("clf_api_error").value&&"loading"!==_("clf_api_error").value&&Object(m.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:_("clf_api_error").value}),_("authorization_code").value&&!_("salary_amount").value&&Object(m.jsx)("small",{className:"form-text text-danger d-block mb-3 text-small",style:{height:"0.7rem"},children:L("lender-web-app-no-salary-found")}),k(null===A||void 0===A||null===(u=A.organization)||void 0===u?void 0:u.id).map((t=>Object(m.jsx)(e,{field:t},t.id)))]});case F.a.checkbox:return Object(m.jsx)(D.b,{name:f.id,label:null===f||void 0===f?void 0:f.label,options:null===f||void 0===f?void 0:f.options,validation:f.validation,props:g,field:f});case F.a.url:return Object(m.jsx)(D.d,{name:f.label,default_value:null===f||void 0===f?void 0:f.default_value});case F.a.radio:return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("label",{className:"mt-2 form-text",children:[f.label," ",null!==(j=f.validation)&&void 0!==j&&j.required?"*":""]})," ",Object(m.jsx)("br",{}),null===(O=f.options)||void 0===O?void 0:O.map((e=>{var t;return Object(m.jsx)("div",{className:"flex items-center gap-2",children:Object(m.jsx)(D.c,{label:e.label,name:f.id,value:e.value,props:g})},null===(t=f.options)||void 0===t?void 0:t.id)})),Object(m.jsx)("br",{})]});case F.a.smileid:return Object(m.jsx)(T.a,{field:f});case F.a.veriff:return Object(m.jsx)(M,{field:f});case F.a.upload:case F.a.file:case F.a.image:case F.a.video:case F.a.audio:return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("label",{className:"mt-2 form-text",children:[" ",f.label," "]})," ",Object(m.jsxs)("span",{className:"required-icon",children:[null!==(v=f.validation)&&void 0!==v&&v.required?"*":""," "]}),Object(m.jsx)(y,{id:f.id,field:f})]});case"FIELD_TYPES.image":return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("label",{className:"mt-4 mb-2 form-text",children:[f.label," ",null!==(x=f.validation)&&void 0!==x&&x.required?"*":""]}),Object(m.jsx)(h,{field:f})]});default:return Object(m.jsx)(m.Fragment,{})}}},261:function(e,t,a){"use strict";a.d(t,"a",(function(){return Z}));var n=a(13),s=a(19),l=a(231),c=a(1),i=a(4),r=a(232),o=a(5),d=a(234),b=a(237),u=a(238),j=a(240),p=a(176),m=a(241),h=a(242),O=a(243),v=a(244),x=a(245),f=a(246),g=a(247),w=a(15),_=a(248),y=a(21),N=a(2),C=a(0);function k(e){let{status:t,loanId:a}=e;const n=Object(y.i)(),{translate:s}=Object(N.useTranslation)();return Object(C.jsx)("div",{className:"card default-card h-100",children:Object(C.jsx)("div",{className:"row m-4 h-100",children:Object(C.jsxs)("div",{style:{maxWidth:"308px"},className:" mx-auto text-center my-auto ",children:[Object(C.jsx)("h4",{className:"fw-bold my-3",children:s("lender-web-app-loan-taken")}),Object(C.jsx)("small",{className:"text-small text-app-gray",children:s("lender-web-app-loan-status-is",{status:t.toLowerCase()})}),Object(C.jsx)("div",{onClick:()=>{n.push("/loans/".concat(a,"/general"))},className:"btn btn-primary btn-lg px-5 mt-4",children:s("lender-web-app-go-to-loan")})]})})})}var S=a(75),E=a(3),T=a(6),A=a(24),L=a.n(A),M=a(18);const D={OFFERS:"OFFERS",BREAKDOWN:"BREAKDOWN"};function F(e){var t,a;let{setCurrentStep:n,product:l,offers:r,onDecline:d}=e;const[b,u,j,p,m]=Object(s.a)((e=>[e.getLoanPaymentSchedules,e.loansRepayment,e.loansRepaymentData,e.signOfferLetterStatus,e.addOffer]),i.shallow),[h,O]=Object(c.useState)(D.OFFERS),v=Object(c.useCallback)((async e=>{await b(e)&&(m(r[0]),O(D.BREAKDOWN))}),[m]),{translate:x}=Object(N.useTranslation)();return Object(C.jsxs)("div",{className:"card default-card",children:[Object(C.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(C.jsxs)("div",{className:"col-12 pl-4",children:[Object(C.jsxs)("div",{className:"tab-content__header",children:[Object(C.jsx)("p",{className:"text-primary fs-5  fw-bold",children:h===D.BREAKDOWN?x("lender-web-app-loan-repayment-breakdown"):x("lender-web-app-loan-offers")}),Object(C.jsx)("small",{className:"text-app-gray",children:h===D.BREAKDOWN?x("lender-web-app-repayment-breakdown-schedule"):x("lender-web-app-loan-repayment-breakdown")})]}),h===D.OFFERS&&Object(C.jsx)("div",{className:"row",children:Object(C.jsx)("div",{className:"col-12",children:Object(C.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-3",children:[Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-12 col-sm-6",children:[Object(C.jsx)("p",{className:"text-app-gray",children:x("lender-web-app-loan-amount")}),Object(C.jsx)("p",{children:Object(E.q)(r[0].loan_amount,null===(t=r[0])||void 0===t?void 0:t.currency)})]}),Object(C.jsxs)("div",{className:"col-12 col-sm-6 ms-auto text-sm-end mt-3 mt-md-0",children:[Object(C.jsx)("p",{className:"text-app-gray",children:x("lender-web-app-interest")}),Object(C.jsxs)("p",{children:[r[0].interest_rate,"%"]})]})]}),Object(C.jsxs)("div",{className:"row",children:[Object(C.jsxs)("div",{className:"col-12 col-sm-6 mt-3",children:[Object(C.jsx)("p",{className:"text-app-gray",children:x("lender-web-app-repayment-amount")}),Object(C.jsx)("p",{children:Object(E.q)(r[0].amount_due,null===(a=r[0])||void 0===a?void 0:a.currency)})]}),Object(C.jsxs)("div",{className:"col-12 col-sm-6 ms-auto text-sm-end mt-3",children:[Object(C.jsx)("p",{className:"text-app-gray",children:x("lender-web-app-due-date")}),Object(C.jsx)("p",{children:L()(r[0].due_date).format("MMM DD, YYYY")})]})]})]})},r[0].loan_token)}),h===D.BREAKDOWN&&Object(C.jsxs)("div",{className:"mt-3",children:[Object(C.jsx)(I,{offer:r[0],product:l}),Object(C.jsx)(R,{schedule:j})]})]})}),Object(C.jsxs)("div",{className:"d-flex  justify-content-between modal-footer control",children:[Object(C.jsx)("button",{type:"button",onClick:()=>{d()},style:{maxWidth:"270px"},className:"btn py-3 pl-0 btn-ghost btn-lg",children:"Decline Offer"}),h===D.BREAKDOWN?Object(C.jsx)("button",{onClick:()=>{const e=null===l||void 0===l?void 0:l.attributes["repayment-methods"];1===l.require_loan_offer&&"success"!==p?n(o.b.OFFER_LETTER):"before-loan-request"===(null===l||void 0===l?void 0:l.attributes["request-payment-method"])||!0===e.none?n(o.b.AUTHORIZE):!0===e["debit-card"]?n(o.b.REPAYMENT_METHOD):!0===e["direct-debit"]?n(o.b.INFO_MANDATE):n(o.b.CHOOSE_PAYMENT_METHOD)},className:"btn py-3 btn-primary btn-lg px-5",children:x("lender-web-app-continue")}):Object(C.jsx)(T.a,{isLoading:"loading"===u,onClick:()=>{v(r[0].loan_token)},className:"btn py-3 btn-primary btn-lg px-5",children:x("lender-web-app-take-offer")})]})]})}function I(e){var t,a;let{offer:n,product:s}=e;const l=Object(c.useMemo)((()=>{var e;const t=null===s||void 0===s||null===(e=s.fees)||void 0===e?void 0:e.filter((function(e){var t,a;return"penal"!==(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())&&"management"!==(null===(a=e.category)||void 0===a?void 0:a.toLowerCase())}));return t.reduce(((e,t)=>{var a,s;let l=0;switch((null===(a=t.type)||void 0===a||null===(s=a.trim())||void 0===s?void 0:s.toLowerCase())||"flat"){case"percentage":l=Object(M.t)(t,null===n||void 0===n?void 0:n.loan_amount,null===n||void 0===n?void 0:n.interest_due);break;case"hybrid":l+=Object(M.r)(t,null===n||void 0===n?void 0:n.loan_amount,null===n||void 0===n?void 0:n.interest_due);break;default:l=t.amount||0}return e+l}),0)}),[n]),i=Object(c.useMemo)((()=>{var e;const t=null===s||void 0===s||null===(e=s.fees)||void 0===e?void 0:e.filter((function(e){var t;return"management"===(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())}));return Object(M.i)(t,null===n||void 0===n?void 0:n.loan_amount,null===n||void 0===n?void 0:n.interest_value)}),[n]),r=(null===n||void 0===n?void 0:n.loan_amount)-l,{translate:o}=Object(N.useTranslation)();return Object(C.jsx)("div",{className:"loan-form",children:Object(C.jsxs)("div",{className:"bg-light-blue rounded-3 py-4 px-3 px-md-35",children:[Object(C.jsxs)("div",{className:"d-block d-sm-none",children:[Object(C.jsx)("h6",{className:"text-app-gray",children:o("lender-web-app-loan-amount")}),Object(C.jsx)("p",{children:Object(E.q)(n.loan_amount,null===n||void 0===n?void 0:n.currency)}),Object(C.jsxs)("h6",{className:"mt-3 text-app-gray",children:[o("lender-web-app-interest"),"(",n.interest_rate,"%)"]}),Object(C.jsx)("p",{children:Object(E.q)(n.interest_due,null===n||void 0===n?void 0:n.currency)}),Object(C.jsx)("h6",{className:"mt-3  text-app-gray",children:o("lender-web-app-origination-fee")}),Object(C.jsx)("p",{children:Object(E.q)(l,null===n||void 0===n?void 0:n.currency)}),(null===s||void 0===s||null===(t=s.attributes)||void 0===t?void 0:t["upfront-fee-payment"])&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("h6",{className:"mt-3 text-app-gray",children:"Management Fee"}),Object(C.jsx)("p",{children:Object(E.q)(Object(E.d)(i),null===s||void 0===s?void 0:s.currency)})]}),Object(C.jsx)("h6",{className:"mt-3 text-app-gray",children:o("lender-web-app-disbursement-amount")}),Object(C.jsx)("p",{children:Object(E.q)(r,null===n||void 0===n?void 0:n.currency)}),Object(C.jsx)("h6",{className:"mt-3  text-app-gray",children:o("lender-web-app-repayment")}),Object(C.jsx)("p",{children:Object(E.q)(n.amount_due,null===n||void 0===n?void 0:n.currency)}),0!=(null===s||void 0===s?void 0:s.allow_multi_tenor)?Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)("h6",{className:"mt-3  text-app-gray",children:o("lender-web-app-repayment-frequency")}),Object(C.jsxs)("p",{children:[" ",Object(S.capitalize)(Object(E.s)(n.tenor_period))]})]}):"",Object(C.jsx)("h6",{className:"mt-3  text-app-gray",children:o("lender-web-app-repayment-date")}),Object(C.jsx)("p",{children:Object(E.u)(new Date(n.due_date))}),Object(C.jsx)("h6",{className:"mt-3  text-app-gray",children:o("lender-web-app-loan-duration")}),Object(C.jsxs)("p",{children:[" ",n.tenor," ",n.tenor_period]})]}),Object(C.jsx)("div",{className:"d-none d-sm-block",children:Object(C.jsxs)("div",{className:"repayment-breakdown-desktop",children:[Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:o("lender-web-app-loan-amount")}),Object(C.jsx)("p",{children:Object(E.q)(n.loan_amount,null===n||void 0===n?void 0:n.currency)})]}),Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsxs)("h6",{className:"fw-normal f-14px ms-auto",children:[o("lender-web-app-interest"),"(",n.interest_rate,"%)"]}),Object(C.jsx)("p",{className:" ms-auto",children:Object(E.q)(n.interest_due,null===n||void 0===n?void 0:n.currency)})]}),Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:o("lender-web-app-origination-fee")}),Object(C.jsx)("p",{children:Object(E.q)(l,null===n||void 0===n?void 0:n.currency)})]}),Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:o("lender-web-app-disbursement-fee")}),Object(C.jsx)("p",{className:" ms-auto",children:Object(E.q)(r,null===n||void 0===n?void 0:n.currency)})]}),Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:o("lender-web-app-repayment")}),Object(C.jsx)("p",{children:Object(E.q)(n.amount_due,null===n||void 0===n?void 0:n.currency)})]}),0!=(null===s||void 0===s?void 0:s.allow_multi_tenor)?Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:o("lender-web-app-repayment-frequency")}),Object(C.jsx)("p",{className:" ms-auto",children:Object(S.capitalize)(Object(E.s)(n.tenor_period))})]}):"",Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:o("lender-web-app-repayment-date")}),Object(C.jsx)("p",{children:Object(E.u)(new Date(n.due_date))})]}),Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px ms-auto",children:o("lender-web-app-loan-duration")}),Object(C.jsxs)("p",{className:" ms-auto",children:[n.tenor," ",n.tenor_period]})]}),(null===s||void 0===s||null===(a=s.attributes)||void 0===a?void 0:a["upfront-fee-payment"])&&Object(C.jsxs)("div",{className:"repayment-breakdown-div",children:[Object(C.jsx)("h6",{className:"fw-normal f-14px",children:"Management Fee"}),Object(C.jsx)("p",{children:Object(E.q)(Object(E.d)(i),null===s||void 0===s?void 0:s.currency)})]})]})})]})})}function R(e){let{schedule:t}=e;const{translate:a}=Object(N.useTranslation)(),[n]=Object(w.a)(Object(c.useCallback)((e=>[e.currency]),[]));return Object(C.jsxs)("div",{className:"bg-light-blue loan-form mt-35 rounded-3 py-4  px-3 px-md-35",children:[Object(C.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(C.jsx)("thead",{children:Object(C.jsxs)("tr",{children:[Object(C.jsx)("th",{className:"date pb-0",children:a("lender-web-app-date")}),Object(C.jsx)("th",{className:"principal pb-0",children:a("lender-web-app-amount-due")}),Object(C.jsx)("th",{className:"status pb-0",children:a("lender-web-app-balance")})]})}),Object(C.jsx)("tbody",{children:null===t||void 0===t?void 0:t.schedules.map((e=>Object(C.jsxs)("tr",{children:[Object(C.jsx)("td",{className:"date fw-normal",children:Object(E.u)(e.due_date)}),Object(C.jsx)("td",{className:"amount",children:Object(E.q)(e.amount_due,null===e||void 0===e?void 0:e.currency)}),Object(C.jsx)("td",{className:"interest",children:Object(E.q)(e.balance,null===e||void 0===e?void 0:e.currency)})]},e.label)))})]}),Object(C.jsx)("div",{className:"mobileListTable d-lg-none",children:null===t||void 0===t?void 0:t.schedules.map((e=>Object(C.jsxs)("div",{className:"list",children:[Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsxs)("p",{className:"text-black-50 mb-0",children:[a("lender-web-app-date"),":"]}),Object(C.jsx)("p",{className:"date",children:e.due_date})]})}),e.amount_due&&Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsxs)("p",{className:"text-black-50 mb-0",children:[a("lender-web-app-amount-due"),":"]}),Object(C.jsxs)("p",{children:[null!==n&&void 0!==n?n:"\u20a6",e.amount_due]})]})}),e.balance&&Object(C.jsx)("div",{className:"row listData",children:Object(C.jsxs)("div",{className:"col",children:[Object(C.jsxs)("p",{className:"text-black-50 mb-0",children:[a("lender-web-app-balance"),":"]}),Object(C.jsxs)("p",{className:"interest",children:[null!==n&&void 0!==n?n:"\u20a6",e.balance]})]})})]},e.label)))})]})}var P=a(249),q=a(175),U=a(165),B=a(130),V=a(67),H=a(251),Y=a(252),W=a(250),G=a(177);function Z(e){let{loan:t,onDecline:a}=e;const n=Object(s.a)((e=>e.myLoans)),{products:l,resetLoan:i}=s.a.getState(),r=Object(c.useMemo)((()=>{if(void 0!==(null===t||void 0===t?void 0:t.offer_data))return null===l||void 0===l?void 0:l.find((e=>{var a;return e.id===(null===t||void 0===t||null===(a=t.offer_data[0])||void 0===a?void 0:a.product_id)}))}),[l]);Object(c.useEffect)((()=>{i()}),[]),console.log("abandoned==========>",l);const o=Object(c.useMemo)((()=>{let e=0;if(r){for(const s of n){var t,a;["running","pending","past_due"].includes(V.a.statusPill(null===s||void 0===s||null===(t=s.status)||void 0===t?void 0:t.status))&&r.id===(null===s||void 0===s||null===(a=s.loan_profile)||void 0===a?void 0:a.product_id)&&e++}return e>=(null===r||void 0===r?void 0:r.max_active_loans)}}),[n,r]);return r?o?Object(C.jsx)(W.a,{customMessage:"You have reached the max loans allowed for this loan product: ".concat(null===r||void 0===r?void 0:r.max_active_loans)}):"DraftLoanProduct"===Object(B.b)(t)&&!Object(B.d)(t)&&Object(C.jsx)(K,{product:r,offers:t.offer_data,onDecline:a})||"UserLoanProduct"===Object(B.b)(t)&&Object(B.d)(t)&&Object(C.jsx)(k,{status:t.status.status,loanId:t.id})||null:Object(C.jsx)("div",{className:"card default-card",children:Object(C.jsx)("div",{className:"row m-4",children:Object(C.jsx)("div",{className:"col-12 pl-4",children:Object(C.jsx)("div",{className:"tab-content__header mb-4",children:Object(C.jsx)("p",{className:"text-black fw-bold text-center",children:"Loan product cannot be found"})})})})})}function K(e){let{product:t,offers:a,onDecline:y}=e;const[k,S,E,T]=Object(n.a)((e=>[e.profileStatus,e.fetchUserProfile,e.fetchCards,e.fetchDocs]),i.shallow),[A,L,M]=Object(s.a)((e=>[e.fetchLoanOptions,e.fetchBusinessProfiles,e.resetStatus]),i.shallow);Object(c.useEffect)((()=>{S()}),[]);const[D]=Object(w.a)((e=>[e.account_type]));Object(c.useEffect)((()=>{M(),L(),A(),E(),T()}),[A,E,T,L,M]);const{translate:I}=Object(N.useTranslation)(),[R,B]=Object(c.useState)(o.b.OFFER_SELECTION),[V,W]=Object(c.useState)("");return Object(c.useEffect)((()=>{window.scrollTo(0,0)}),[R]),Object(c.useEffect)((()=>{void 0===a?(B(o.b.NOT_ELIGIBLE),W("Loan offer has either been cancelled or has expired")):B(o.b.OFFER_SELECTION)}),[a]),"loading"===k?Object(C.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"15rem"},children:Object(C.jsx)("div",{className:"spinner-border text-primary",children:Object(C.jsxs)("span",{className:"visually-hidden",children:[I("lender-web-app-loading"),"..."]})})}):Object(C.jsxs)("div",{className:"col-12 scroll-modal",children:[R===o.b.OFFER_SELECTION&&Object(C.jsx)(F,{product:t,offers:a,setCurrentStep:B,onDecline:y}),R===o.b.REPAYMENT_METHOD&&Object(C.jsx)(l.a,{product:t,setCurrentStep:B}),R===o.b.SUCCESSFUL&&Object(C.jsx)(d.a,{}),R===o.b.SUCCESS_MANDATE&&Object(C.jsx)(v.a,{}),R===o.b.GUARANTOR&&Object(C.jsx)(u.a,{setCurrentStep:B,product_id:a[0].product_id}),R===o.b.AUTHORIZE&&Object(C.jsx)(r.a,{setCurrentStep:B,product_id:a[0].product_id,abandoned:!0}),R===o.b.SHOW_CARDS&&Object(C.jsx)(b.a,{setCurrentStep:B,product:t}),R===o.b.NOT_ELIGIBLE&&Object(C.jsx)(U.a,{customMessage:V}),R===o.b.ADD_BANK&&Object(C.jsx)(_.a,{accountType:D,setCurrentStep:B}),R===o.b.DOWNLOAD_MANDATE&&Object(C.jsx)(x.a,{product:t,setCurrentStep:B}),R===o.b.MANDATE_ACCOUNT&&Object(C.jsx)(h.a,{product:t,setCurrentStep:B}),R===o.b.ADD_MANDATE&&Object(C.jsx)(m.a,{setCurrentStep:B}),R===o.b.MANDATES&&Object(C.jsx)(j.a,{product:t,setCurrentStep:B}),R===o.b.MOBILE_MONEY&&Object(C.jsx)(H.a,{product:t,setCurrentStep:B}),R===o.b.ADD_MOBILE_MONEY&&Object(C.jsx)(Y.a,{product:t,setCurrentStep:B}),R===o.b.INFO_MANDATE&&Object(C.jsx)(p.a,{onBack:()=>{(null===t||void 0===t?void 0:t.attributes["repayment-methods"])["debit-card"]?B(o.b.REPAYMENT_METHOD):B(o.b.OFFER_SELECTION)},onContinue:()=>B(o.b.MANDATES),type:"loan"}),R===o.b.MANDATE_SIGNATURE&&Object(C.jsx)(q.a,{product:t,setCurrentStep:B,type:"loan"}),R===o.b.EMANDATE_INFO&&Object(C.jsx)(G.a,{product:t,setCurrentStep:B,type:"loan"}),R===o.b.OTP_MANDATE&&Object(C.jsx)(O.a,{setCurrentStep:B}),R===o.b.OFFER_LETTER&&Object(C.jsx)(f.a,{setCurrentStep:B}),R===o.b.SIGN_OFFER&&Object(C.jsx)(g.a,{setCurrentStep:B,product:t}),R===o.b.CHOOSE_PAYMENT_METHOD&&Object(C.jsx)(P.a,{product:t,setCurrentStep:B})]})}},264:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(2),s=a(8),l=a(36);const c=[l.a.veriff,l.a.smileid,l.a.image,l.a.file,l.a.upload,l.a.audio,l.a.video,l.a.date,l.a.time,l.a.url,l.a.remita_inflight],i=[l.a.integer,l.a.number,l.a.amount],r=async function(e){let t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.a;if(t=await(async(e,t)=>{var a,l,c,i,r,o,d,b;const u=await Object(n.translate)("lender-web-app-valid-text"),j=await Object(n.translate)("lender-web-app-value-must-date"),p=await Object(n.translate)("lender-web-app-valid-email"),m=await Object(n.translate)("lender-web-app-value-must-phone"),h=await Object(n.translate)("lender-web-app-valid-number-format"),O=await Object(n.translate)("lender-web-app-valid-integer"),v=await Object(n.translate)("lender-web-app-only-positive-integers"),x=await Object(n.translate)("lender-web-app-can-only-string"),f=await Object(n.translate)("lender-web-app-only-number"),g=await Object(n.translate)("lender-web-app-select-option"),w=await Object(n.translate)("lender-web-app-select-item");let _;switch(e.type){case t.short_text:case t.api:_=s.h().typeError(u).matches(new RegExp(e.validation.rule,"i"),await Object(n.translate)("lender-web-app-enter-valid-field",{name:e.name}));break;case t.long_text:_=s.h().typeError(u);break;case t.bank:_=s.h();break;case t.date:case t.date_time:_=s.d().typeError(j);break;case t.email:_=s.h().email(p).typeError(p);break;case t.phone:_=s.h().matches(/^0[789]\d{9}$/,h).typeError(m).min(11,await Object(n.translate)("lender-web-app-must-be-digits",{phone_number_length:11..toString()})).max(11,await Object(n.translate)("lender-web-app-must-be-digits",{phone_number_length:11..toString()}));break;case t.integer:_=s.f().integer(O).typeError(v);break;case t.label:_=s.h().typeError(x);break;case t.number:case t.amount:_=null!==e&&void 0!==e&&null!==(a=e.validation)&&void 0!==a&&a.minimum_length&&null!==e&&void 0!==e&&null!==(l=e.validation)&&void 0!==l&&l.maximum_length?s.h():s.f().integer().typeError(f);break;case t.checkbox:_=s.a(),null!==(c=e.validation)&&void 0!==c&&c.minimum_select&&null!==(i=e.validation)&&void 0!==i&&i.maximum_select&&(_=s.a().min(e.validation.minimum_select,await Object(n.translate)("lender-web-app-select-min-max",{minimum_select:e.validation.minimum_select,maximum_select:e.validation.maximum_select})).max(e.validation.maximum_select,await Object(n.translate)("lender-web-app-select-min-max",{minimum_select:e.validation.minimum_select,maximum_select:e.validation.maximum_select}))),null!==(r=e.validation)&&void 0!==r&&r.maximum_select&&(_=s.a().max(e.validation.maximum_select,await Object(n.translate)("lender-web-app-most-select",{maximum_select:e.validation.maximum_select}))),null!==(o=e.validation)&&void 0!==o&&o.minimum_select&&(_=s.a().min(e.validation.minimum_select,await Object(n.translate)("lender-web-app-least-select",{minimum_select:e.validation.minimum_select})));break;case t.radio:_=s.h().oneOf([...(null===(d=e.options)||void 0===d?void 0:d.map((e=>null===e||void 0===e?void 0:e.value)))||""],g);break;case t.drop_down:case t.select:_=s.h().oneOf([...(null===(b=e.options)||void 0===b?void 0:b.map((e=>null===e||void 0===e?void 0:e.value)))||""]).label(w);break;case t.smileid:case t.veriff:case t.image:case t.file:case t.upload:case t.audio:case t.video:case t.time:_=s.e();break;default:_=null}return _})(e,a),e.validation.required&&!0===e.validation.required){var r;const a=await Object(n.translate)("lender-web-app-is-required",{name:e.name});t=null===(r=t)||void 0===r?void 0:r.required(a)}var o,d,b,u,j;if(e.validation&&+e.validation.maximum&&i.includes(e.type))return t=t.min(+e.validation.minimum,await Object(n.translate)("lender-web-app-field-range",{name:e.name,minimum:null!==(o=e.validation.minimum)&&void 0!==o?o:0,maximum:null!==(d=e.validation.maximum)&&void 0!==d?d:0})),t=t.max(+e.validation.maximum,await Object(n.translate)("lender-web-app-field-range",{name:e.name,minimum:null!==(b=e.validation.minimum)&&void 0!==b?b:0,maximum:null!==(u=e.validation.maximum)&&void 0!==u?u:0})),t;e.validation&&+e.validation.maximum_length&&!c.includes(e.type)&&(t=t.max(+e.validation.maximum_length,await Object(n.translate)("lender-web-app-field-max-length",{name:e.name,minimum_length:null===(j=e.validation)||void 0===j?void 0:j.maximum_length})),t=t.min(+e.validation.minimum_length,await Object(n.translate)("lender-web-app-field-min-length",{name:e.name,maximum_length:e.validation.minimum_length})));if(e.validation.disallowed){const a=e.validation.disallowed.split(",");for(const n of a){const a=new RegExp("[^".concat(n,"]"));t=t.matches(a,"".concat(e.name," is not allowed"))}}return t},o=async e=>{const t={},a=[];for(let n=0;n<(null===e||void 0===e?void 0:e.pages.length);n++){const s=null===e||void 0===e?void 0:e.pages[n];for(let e=0;e<(null===s||void 0===s?void 0:s.sections.length);e++){const n=s.sections[e];for(let e=0;e<(null===n||void 0===n?void 0:n.fields.length);e++){const s=null===n||void 0===n?void 0:n.fields[e];a.push(r(s).then((e=>{t[s.id]=e})))}}}return await Promise.all(a),s.g().shape(t)}},29:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(1);const s=Object(n.createContext)({})},3:function(e,t,a){"use strict";a.d(t,"q",(function(){return i})),a.d(t,"k",(function(){return r})),a.d(t,"d",(function(){return o})),a.d(t,"i",(function(){return d})),a.d(t,"f",(function(){return b})),a.d(t,"s",(function(){return u})),a.d(t,"h",(function(){return j})),a.d(t,"v",(function(){return p})),a.d(t,"w",(function(){return m})),a.d(t,"u",(function(){return h})),a.d(t,"r",(function(){return O})),a.d(t,"m",(function(){return v})),a.d(t,"n",(function(){return x})),a.d(t,"t",(function(){return f})),a.d(t,"b",(function(){return g})),a.d(t,"c",(function(){return w})),a.d(t,"x",(function(){return _})),a.d(t,"p",(function(){return y})),a.d(t,"a",(function(){return N})),a.d(t,"j",(function(){return C})),a.d(t,"l",(function(){return k})),a.d(t,"g",(function(){return S})),a.d(t,"e",(function(){return E})),a.d(t,"o",(function(){return T}));var n=a(15),s=a(166),l=a(24),c=a.n(l);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"NGN";"RWA"===(null===n.a||void 0===n.a?void 0:n.a.getState().country)&&"NGN"===t&&(t="RWF");return new Intl.NumberFormat("en-NG",{style:"currency",currency:t}).format(e)},r=function(){return i(0,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NGN").slice(0,1)},o=e=>{if(e)return"number"===typeof e?e:Number(null===e||void 0===e?void 0:e.replace(/[^0-9.-]+/g,""))},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null===e||void 0===e?void 0:e.trim().replace(/_/g," ")},b=e=>{if(!e)return"";for(const t of["day","week","month","year","annum"])if(new RegExp(t,"i").test(e))return t;return e},u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";switch(e){case"day":case"days":return"daily";case"week":case"weeks":return"weekly";case"month":case"months":return"monthly";case"year":case"years":return"yearly";default:return e}},j=function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:""){case"Daily":default:return"days";case"Weekly":return"weeks";case"Monthly":return"months";case"Yearly":return"years"}},p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{const t=new Date(e);return Object(s.a)(t,"MMM d, yyyy h:mm a")}catch(t){return e}},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{let t;return t=Array.isArray(e)&&3===(null===e||void 0===e?void 0:e.length)?new Date(e[0],e[1]-1,e[2]):new Date(e),t=new Date(t.valueOf()+60*t.getTimezoneOffset()*1e3),Object(s.a)(t,"MMM d, yyyy ")}catch(t){return e}},h=e=>{try{return"string"===typeof e&&(e=new Date(e),e=new Date(e.valueOf()+60*e.getTimezoneOffset()*1e3)),Object(s.a)(e,"MMM dd, yyyy")}catch(a){var t;return null===(t=e)||void 0===t?void 0:t.toString()}},O=e=>{try{return"string"===typeof e&&(e=new Date(e),e=new Date(e.valueOf()+60*e.getTimezoneOffset()*1e3)),Object(s.a)(e,"dd MMM, yyyy")}catch(a){var t;return null===(t=e)||void 0===t?void 0:t.toString()}},v=e=>{try{const t="string"===typeof e?new Date(e):e;return Object(s.a)(t,"YYYY/MM/DD HH:mm:ss")}catch(t){return e.toString()}},x=e=>{try{return"string"===typeof e&&(e=new Date(e),e=new Date(e.valueOf()+60*e.getTimezoneOffset()*1e3)),Object(s.a)(e,"yyyy/MM/dd")}catch(t){return e.toString()}},f=(i(),e=>{e.target.value=e.target.value.replace(/[^0-9 ]/g,""),e.target.value=e.target.value.replace(/[&/#, +()$~%.'":*?<>{}]/g,"")}),g=e=>{const t=37,a=39,n=8,s=46,l=48,c=57;return e.keyCode===n||e.keyCode===s||e.keyCode===a||e.keyCode===t||(!(e.keyCode<l||e.keyCode>c||e.target.value.length===e.target.maxLength||e.shiftKey)||(e.stopPropagation(),e.preventDefault(),!1))},w=e=>{const t=e.which?e.which:e.keyCode;return t>=48&&t<=57||8===t||(e.stopPropagation(),e.preventDefault(),!1)},_=(e,t)=>e.length>t?"".concat(e.slice(0,t)," ..."):e,y=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),N=e=>new Date(e).toLocaleDateString("en-US",{month:"short",year:"numeric"}),C=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),k=e=>{var t,a;return(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||e.message||e},S=e=>{const t="+234";return e.startsWith(t)?"0".concat(e.slice(4)):e},E=(e,t)=>{if(!e)return"";if("fixed"===t)return c()(e).format("YYYY/MM/DD HH:mm:ss");const[a,n,s]=e.split(" ");return"after"===s?c()().add(a,n).format("YYYY/MM/DD HH:mm:ss"):"before"===s?c()().subtract(a,n).format("YYYY/MM/DD HH:mm:ss"):c()().format("YYYY/MM/DD HH:mm:ss")},T=e=>{var t,a,n,s;return null!==e&&void 0!==e&&e.attributes&&"show_only_clf"in e.attributes?!!e.attributes.show_only_clf:"true"===(null===e||void 0===e||null===(t=e.attributes)||void 0===t||null===(a=t.additional_loan_data)||void 0===a||null===(n=a.meta)||void 0===n||null===(s=n.show_only_clf)||void 0===s?void 0:s.toLowerCase())}},311:function(e,t,a){"use strict";var n=a(1),s=a(21),l=a(18),c=a(79),i=a(3),r=a(4),o=a(84),d=a(89),b=a(105),u=a(25),j=a(59),p=a(254),m=a(2),h=a(7),O=a(0);function v(e){let{title:t,showModal:a}=e;const{translate:v}=Object(m.useTranslation)(),[x,f]=Object(n.useState)(!1),g=Object(s.i)(),[w,_]=Object(n.useState)(""),[y,N]=Object(n.useState)(""),[C,k]=Object(n.useState)(""),[S,E,T,A,L]=Object(o.a)((e=>[e.getTransactions,e.loading,e.transactions.length,e.transactions,e.types]),r.shallow),M=Object(n.useMemo)((()=>A.filter((e=>{return new RegExp(w||".","i").test(e.meta)&&e.type.includes(y)&&(!C||(t=new Date(e.created_on),a=new Date(C),(null===t||void 0===t?void 0:t.getYear())===(null===a||void 0===a?void 0:a.getYear())&&(null===t||void 0===t?void 0:t.getMonth())===(null===a||void 0===a?void 0:a.getMonth())&&(null===t||void 0===t?void 0:t.getDate())===(null===a||void 0===a?void 0:a.getDate())));var t,a}))),[w,y,C,A]);Object(n.useEffect)((()=>{!1===a?S("updating"):S()}),[]);const[D,F]=Object(n.useState)(1),[I,R]=Object(n.useState)(50),P=Object(n.useMemo)((()=>{const e=I*D-I,t=I*D;return M.slice(e,t)||[]}),[D,I,M]),q=Object(n.useCallback)((e=>{F(e)}),[]),U=null===M||void 0===M?void 0:M.indexOf(null===M||void 0===M?void 0:M.filter((e=>{var t,a;return e.id===Number(null===(t=g.location)||void 0===t||null===(a=t.search)||void 0===a?void 0:a.split("=").pop())}))[0]);return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"table__header mb-2 mt-3",children:Object(O.jsx)("p",{className:"table__header--title",children:t})}),Object(O.jsxs)("div",{className:"card default-card page-table",children:["loading"===E&&Object(O.jsx)("div",{children:Object(l.g)(I).map((e=>Object(O.jsx)(c.a,{height:60,rounded:!0},e)))})||("success"===E||"updating"===E)&&Object(O.jsx)("div",{className:"loans__history",children:T<1?Object(O.jsxs)("div",{className:"text-center w-100",children:[Object(O.jsx)("span",{className:"text-primary",children:Object(O.jsx)(b.a,{})}),Object(O.jsx)("h4",{className:"mt-3",children:v("lender-web-app-no-transactions")}),Object(O.jsx)("p",{className:"text-app-gray",children:v("lender-web-app-no-conduct-transactions")})]}):Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("div",{className:"filter-and-search",children:[Object(O.jsxs)("div",{className:"filter-box d-flex",children:[Object(O.jsx)(h.k,{setDate:k,date:C}),Object(O.jsxs)("div",{className:"input-group input-group-filter",children:[Object(O.jsx)("div",{className:"input-group-prepend",children:Object(O.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[v("lender-web-app-type"),":"]})}),Object(O.jsxs)("select",{value:y,onChange:e=>N(e.target.value),onBlur:e=>N(e.target.value),className:"form-control",children:[Object(O.jsx)("option",{value:"",selected:!0,children:v("lender-web-app-all")}),Array.from(L).map((e=>Object(O.jsx)("option",{children:e},e)))]})]})]}),Object(O.jsx)("div",{className:"search-box",children:Object(O.jsx)("input",{value:w,onChange:e=>{e.target.value.includes("+")||_(e.target.value.replace("+",""))},type:"search",className:"form-control",placeholder:"".concat(v("lender-web-app-search"),"..."),autoComplete:"false"})})]}),P.length>0?Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(O.jsx)("thead",{children:Object(O.jsxs)("tr",{children:[Object(O.jsx)("th",{className:"date"}),Object(O.jsx)("th",{children:v("lender-web-app-date")}),Object(O.jsx)("th",{children:v("lender-web-app-type")}),Object(O.jsx)("th",{children:v("lender-web-app-channel")}),Object(O.jsx)("th",{children:v("lender-web-app-narration")}),Object(O.jsx)("th",{children:v("lender-web-app-amount")})]})}),Object(O.jsx)("tbody",{children:P.map((e=>Object(O.jsxs)("tr",{onClick:()=>{g.push({search:"?transaction-id=".concat(e.id)}),f(!0)},className:"link-row",children:[Object(O.jsx)("td",{style:{textAlign:"right"},"data-toggle":"tooltip","data-placement":"top",title:e.status,className:"d-flex align-items-end align-items-sm-end justify-content-end",children:Object(O.jsx)("div",{style:{background:("success"===e.status?"green":"pending"===e.status&&"orange")||"red",width:"8px",marginTop:"4px",height:"8px",borderRadius:"12px"}})}),Object(O.jsx)("td",{children:Object(i.w)(e.created_on)}),Object(O.jsx)("td",{children:e.type}),Object(O.jsx)("td",{children:v("lender-web-app-web")}),Object(O.jsx)("td",{style:{maxWidth:"270px"},children:e.meta}),Object(O.jsxs)("td",{style:{color:"debit"===e.entry.toLowerCase()?"#E7284E":"inherit"},children:["credit"===e.entry.toLowerCase()?"+":"-",Object(i.q)(e.amount,null===e||void 0===e?void 0:e.currency)]})]},e.id)))})]}),Object(O.jsx)("div",{className:"mobileListTable d-lg-none",children:P.map((e=>Object(O.jsxs)("div",{onClick:()=>{g.push({search:"?transaction-id=".concat(e.id)}),f(!0)},className:"list cursor-pointer",children:[Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("p",{className:"date",children:Object(i.w)(e.created_on)})}),Object(O.jsx)("div",{className:"col px-2",children:Object(O.jsx)("div",{className:"d-flex align-items-end align-items-sm-end justify-content-end",style:{height:"20px"},children:Object(O.jsx)("div",{"data-toggle":"tooltip","data-placement":"top",title:e.status,className:"rounded-circle ms-3",style:{width:"10px",height:"10px",background:("success"===e.status?"green":"pending"===e.status&&"orange")||"red"}})})})]}),Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsx)("div",{className:"col",children:Object(O.jsxs)("p",{className:"principal",children:[" ","Credit"===e.entry?"+":"-"," ",Object(i.q)(e.amount,null===e||void 0===e?void 0:e.currency)]})}),Object(O.jsx)("div",{className:"col px-2",children:Object(O.jsx)("p",{className:"tenor",children:v("lender-web-app-web")})})]}),Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsx)("div",{className:"col pe-0",children:Object(O.jsx)("p",{className:"interest",children:e.meta})}),Object(O.jsx)("div",{className:"col px-2",children:Object(O.jsx)("div",{className:"status-wrapper",children:Object(O.jsx)("div",{className:"",children:Object(O.jsx)("p",{children:e.type})})})})]})]},e.id)))})]}):Object(O.jsxs)("div",{className:"text-center w-100",children:[Object(O.jsx)("span",{className:"text-primary",children:Object(O.jsx)(b.a,{})}),Object(O.jsx)("h4",{className:"mt-3",children:v("lender-web-app-no-searched-transactions")})]})]})})||null," "]}),(null===M||void 0===M?void 0:M.length)>0&&Object(O.jsx)(d.a,{total:null===M||void 0===M?void 0:M.length,perPage:I,setPerPage:R,currentPage:D,loadPage:q,setCurrentPage:F}),Object(O.jsx)(u.a,{close:()=>{const e=Object(j.b)("transaction-id");g.replace({search:e.toString()}),f(!1)},fixed:!0,additionalHeaderButton:Object(O.jsxs)(O.Fragment,{children:[U>0&&Object(O.jsx)("button",{onClick:()=>{var e;g.push({search:"?transaction-id=".concat(null===(e=M[U-1])||void 0===e?void 0:e.id)})},type:"button",className:"close","data-bs-dismiss":"modal","aria-label":"Close",children:Object(O.jsx)("svg",{width:"16",height:"16",children:Object(O.jsx)("use",{className:"text-app-gray",xlinkHref:"/icon-sprite.svg#arrow-head-up-icon"})})}),U<M.length-1&&Object(O.jsx)("button",{onClick:()=>{var e;g.push({search:"?transaction-id=".concat(null===(e=M[U+1])||void 0===e?void 0:e.id)})},type:"button",className:"close","data-bs-dismiss":"modal","aria-label":"Close",children:Object(O.jsx)("svg",{width:"16",height:"16",children:Object(O.jsx)("use",{className:"text-app-gray",xlinkHref:"/icon-sprite.svg#arrow-head-down-icon"})})})]}),description:v("lender-web-app-transaction-details"),show:x||g.location.search.includes("transaction-id"),className:"",isUpload:!1,children:(x||g.location.search.includes("transaction-id"))&&Object(O.jsx)(p.a,{})})]})}var x=a(16),f=a(29),g=a(24),w=a.n(g),_=a(10),y=a(6),N=a(13),C=a(51),k=a(9),S=a.n(k),E=a(49),T=a(32),A=a(11),L=a(15),M=a(101),D=a(127);function F(e){let{action:t="transfer",back:a,submit:s}=e;const{translate:l}=Object(m.useTranslation)(),[c,i]=Object(n.useState)(""),r=Object(M.a)((e=>e.status)),o=Object(D.a)((e=>e.status)),d=Object(C.a)((e=>e.status));return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("div",{className:"modal-body account-modal-body",children:[Object(O.jsx)("p",{children:"Please enter the OTP sent to you"}),Object(O.jsx)("div",{className:"",children:Object(O.jsx)(h.o,{length:6,onChange:e=>{i(e)},onComplete:e=>s(e),password:!0})})]}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between",children:[Object(O.jsx)(y.a,{onClick:()=>a(),type:"submit",className:"new-transfer-btn btn px-0",children:l("lender-web-app-back")}),Object(O.jsx)(y.a,{onClick:()=>s(c),isDisabled:c.length<6,isLoading:"loading"===(()=>{let e;return e="airtime"===t?o:"bill"===t?r:d,e})(),type:"submit",className:"btn btn-primary",children:l("lender-web-app-make-payment")})]})]})}const I=e=>{let{setShowModal:t,showModal:a}=e;const{translate:s}=Object(m.useTranslation)(),[l,c]=Object(n.useState)("initiate"),i=Object(C.a)((e=>e.reset)),[r,o]=Object(n.useState)(""),d=Object(C.a)((e=>e.transfer)),b=async e=>{await d(r,e);const{status:t}=C.a.getState();"error"!==t&&c("success")},j=()=>{c("confirm")},p={initiate:{description:s("lender-web-app-transfer-money"),subDescription:s("lender-web-app-send-money-friends")},"new-transfer":{description:s("lender-web-app-confirm-transfer"),subDescription:s("lender-web-app-about-send-money")},confirm:{description:s("lender-web-app-confirm-transfer"),subDescription:s("lender-web-app-about-send-money")},authorize:{description:s("lender-web-app-authorise-payment"),subDescription:s("lender-web-app-enter-4digit-pin")},success:{description:"",subDescription:""},reciept:{description:s("lender-web-app-transfer-receipt"),subDescription:s("lender-web-app-transfer-receipt-download")},otp:{description:"One Time Password",subDescription:"Enter OTP sent to your phone"}};Object(n.useEffect)((()=>{c("initiate"),"initiaite"==l&&i()}),[a,i]);return Object(O.jsx)(u.a,{close:()=>t(!1),description:p[l].description,subDescription:p[l].subDescription,show:a,isUpload:!1,children:"initiate"===l?Object(O.jsx)(R,{setScreen:c}):"new-transfer"===l?Object(O.jsx)(P,{setScreen:c}):"confirm"===l?Object(O.jsx)(q,{setScreen:c}):"authorize"===l?Object(O.jsx)(U,{pin:r,setPin:o,setScreen:c}):"success"===l?Object(O.jsx)(B,{setScreen:c,setShowModal:t}):"receipt"===l?Object(O.jsx)(V,{setShowModal:t}):"otp"===l?Object(O.jsx)(F,{action:"transfer",back:j,submit:b}):Object(O.jsx)(R,{setScreen:c})})},R=e=>{var t;let{setScreen:a}=e;const[s,l,c,i,o,d]=Object(N.a)((e=>[e.cards,e.fetchCards,e.banks,e.fetchUserAccounts,e.banksStatus,e.wallet]),r.shallow),{translate:b}=Object(m.useTranslation)(),[u,j]=Object(n.useState)(""),[p,v,x,f,g,_,k,A,L,M,D]=Object(C.a)((e=>[e.amount,e.setAmount,e.setBeneficiary,e.beneficiary,e.getFee,e.validateTierTransaction,e.feestatus,e.setData,e.narration,e.setDate,e.reset]),r.shallow);Object(n.useEffect)((()=>{D();(async()=>{s.length||await l(),c.length||await i()})()}),[]);const F=async()=>{try{await _(null!==p&&void 0!==p?p:0);const{status:e}=C.a.getState();"error"!==e&&(M(w()().format("DD-MMM-YYYY HH:MM")),a("confirm"),Object(T.a)({event_name:T.b.TRANSACTIONS_START_TRANSFER}))}catch(t){var e;S.a.error(null!==(e=null===t||void 0===t?void 0:t.message)&&void 0!==e?e:b("lender-web-app-default-error"))}};return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("form",{className:"modal-form",children:[Object(O.jsx)("div",{className:"form-group mb-3",children:Object(O.jsx)(h.e,{className:"form-control f-14px",placeholder:b("lender-web-app-amount"),label:b("lender-web-app-how-much-transfer",{currency:null!==(t=null===d||void 0===d?void 0:d.currency)&&void 0!==t?t:" (\u20a6)"}),onChange:e=>(e=>{0!=e?null!==d&&void 0!==d&&d.accountBalance&&e>(null===d||void 0===d?void 0:d.accountBalance)?j("You do not have the sufficient balance for this transaction"):(j(""),v(e)):j("Enter a vald amount")})(e),currency:null===d||void 0===d?void 0:d.currency,errorMessage:u,error:u.length>0})}),Object(O.jsx)("label",{className:"f-14px form-group-label mb-1 mt-2",children:b("lender-web-app-transfer-location")}),("loading"===o||"idle"===o)&&Object(O.jsx)("div",{className:"d-flex py-3 justify-content-center align-items-center",children:Object(O.jsx)("div",{className:"spinner-border text-primary",children:Object(O.jsxs)("span",{className:"visually-hidden",children:[b("lender-web-app-loading"),"..."]})})})||"error"===o&&Object(O.jsx)("div",{className:"d-flex py-3 justify-content-center align-items-center",children:Object(O.jsx)("p",{className:"text-center small",children:b("lender-web-app-error-fetching-accounts")})})||Object(O.jsx)("div",{className:"row w-100",children:Object(O.jsx)(E.c,{children:c.map((e=>Object(O.jsx)("div",{className:"w-100 col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(O.jsx)(h.f,{checked:(null===f||void 0===f?void 0:f.id)===e.id,onClick:()=>x(e),logo:e.url,name:"bank",cardName:e.account_name,number:e.account_number,className:"cards"},e.id)},e.id)))})}),Object(O.jsxs)("div",{className:"form-group my-3",children:[Object(O.jsx)("label",{className:"mb-1",htmlFor:"narration",children:b("lender-web-app-remarks-optional")}),Object(O.jsx)("input",{placeholder:b("lender-web-app-enter-remark"),className:"form-control",onChange:e=>A({narration:e.target.value}),value:L})]})]})}),Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{isLoading:"loading"===k,isDisabled:!f||!p||u.length>0,onClick:async()=>{try{await g();const{status:e}=C.a.getState();"error"!==e&&F()}catch(t){var e;S.a.error(null!==(e=null===t||void 0===t?void 0:t.message)&&void 0!==e?e:b("lender-web-app-default-error"))}},type:"submit",className:"btn btn-primary",children:b("lender-web-app-confirm-transfer")})})]})},P=e=>{let{setScreen:t}=e;const{translate:a}=Object(m.useTranslation)(),[s,l,c,i,o,d,b,u,j,p]=Object(C.a)((e=>[e.amount,e.setAmount,e.setBeneficiary,e.beneficiary,e.getFee,e.validateTierTransaction,e.feestatus,e.setData,e.narration,e.setDate]),r.shallow),[v,x]=Object(n.useState)(!1),f=async()=>{try{await d(null!==s&&void 0!==s?s:0);const{status:e}=C.a.getState();"error"!==e&&(p(w()().format("DD-MMM-YYYY HH:MM")),t("confirm"))}catch(n){var e;S.a.error(null!==(e=null===n||void 0===n?void 0:n.message)&&void 0!==e?e:a("lender-web-app-default-error"))}},g=async e=>{x(!0);try{const t=await Object(A.a)(_.Rb,"post",e);c({...i,account_name:t.data.account_name}),(async()=>{try{await o();const{status:e}=C.a.getState();"error"!==e&&f()}catch(t){var e;S.a.error(null!==(e=null===t||void 0===t?void 0:t.message)&&void 0!==e?e:a("lender-web-app-default-error"))}})()}catch(t){S.a.error(t.message),x(!1)}},[N]=Object(L.a)(Object(n.useCallback)((e=>[e.currency]),[]));return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("form",{className:"modal-form",children:[Object(O.jsx)("div",{className:"form-group mb-3",children:Object(O.jsx)(h.e,{className:"form-control f-14px",placeholder:a("lender-web-app-amount"),label:a("lender-web-app-how-much-transfer",{currency:null!==N&&void 0!==N?N:" (\u20a6)"}),onChange:e=>l(e)})}),Object(O.jsxs)("div",{className:"form-group mb-3",children:[Object(O.jsx)("label",{className:"mb-1",htmlFor:"account_number",children:a("lender-web-app-account-number")}),Object(O.jsx)("input",{type:"number",placeholder:a("lender-web-app-10digit-account-number"),pattern:"[0-9]*",maxLength:10,className:"form-control f-14px",onChange:e=>{c({...i,account_number:e.target.value})}})]}),Object(O.jsx)(h.p,{name:"bank_code",label:a("lender-web-app-select-bank")}),Object(O.jsxs)("div",{className:"form-group mb-3",children:[Object(O.jsx)("label",{className:"mb-1",htmlFor:"beneficary",children:a("lender-web-app-beneficiary-name")}),Object(O.jsx)("input",{type:"text",placeholder:a("lender-web-app-account-name"),className:"form-control f-14px",onChange:e=>{c({...i,account_number:e.target.value})}})]}),Object(O.jsxs)("div",{className:"form-group my-3",children:[Object(O.jsx)("label",{className:"mb-1",htmlFor:"narration",children:a("lender-web-app-remarks-optional")}),Object(O.jsx)("input",{placeholder:a("lender-web-app-enter-remark"),className:"form-control f-14px",onChange:e=>u({narration:e.target.value}),value:j})]})]})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between",children:[Object(O.jsx)(y.a,{isDisabled:"loading"===b,type:"submit",className:"new-transfer-btn btn px-0",onClick:()=>{t("initaite")},children:a("lender-web-app-back")}),Object(O.jsx)(y.a,{isLoading:"loading"===b||!0===v,isDisabled:!i||!s,onClick:()=>{g(i)},type:"submit",className:"btn btn-primary",children:a("lender-web-app-confirm-transfer")})]})]})},q=e=>{let{setScreen:t}=e;const[a,n,s,l,c,o]=Object(C.a)((e=>[e.amount,e.beneficiary,e.status,e.transaction_amount,e.narration,e.date]),r.shallow),d=Object(N.a)((e=>e.wallet)),{translate:b}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("div",{className:"bg-light-blue rounded-3 p-35",children:[Object(O.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-amount")}),Object(O.jsx)("p",{className:" text-medium",children:Object(i.q)(a,null===d||void 0===d?void 0:d.currency)})]}),Object(O.jsxs)("div",{className:" text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:"Transfer Fee"}),Object(O.jsx)("p",{className:" text-medium",children:Object(i.q)(l,null===d||void 0===d?void 0:d.currency)})]})]}),Object(O.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(O.jsxs)("div",{className:"",children:[Object(O.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-account-number")}),Object(O.jsxs)("p",{className:" text-medium",children:[null===n||void 0===n?void 0:n.account_number," "]})]}),Object(O.jsxs)("div",{className:"text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-bank-name")}),Object(O.jsxs)("p",{className:" text-medium",children:[null===n||void 0===n?void 0:n.code_description," "]})]})]}),Object(O.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(O.jsxs)("div",{className:"",children:[Object(O.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-remarks")}),Object(O.jsxs)("p",{className:" text-medium",children:[c||"-"," "]})]}),Object(O.jsxs)("div",{className:"text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:b("lender-web-app-date")}),Object(O.jsxs)("p",{className:" text-medium",children:[Object(i.w)(o)," "]})]})]})]})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between",children:[Object(O.jsx)(y.a,{onClick:()=>t("initiate"),type:"submit",isDisabled:"loading"===s,className:"new-transfer-btn btn px-0",children:b("lender-web-app-back")}),Object(O.jsx)(y.a,{onClick:()=>t("authorize"),isLoading:"loading"===s,type:"submit",className:"btn btn-primary",children:b("lender-web-app-authorise-transfer")})]})]})},U=e=>{let{setScreen:t,setPin:a,pin:n}=e;const s=Object(C.a)((e=>e.initiateTransfer)),l=Object(C.a)((e=>e.transferWithoutOtp)),c=Object(C.a)((e=>e.status)),i=async e=>{const a=await s(e||n),{status:c}=C.a.getState();if("error"!==c)if(null!==a&&void 0!==a&&a.data.otp)t("otp");else{await l(e);const{status:a}=C.a.getState();"error"!==a&&t("success")}},{translate:r}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsx)("div",{className:"",children:Object(O.jsx)(h.o,{length:4,onChange:e=>{a(e)},onComplete:e=>i(e),password:!0})})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between",children:[Object(O.jsx)(y.a,{onClick:()=>t("confirm"),type:"submit",className:"new-transfer-btn btn px-0",children:r("lender-web-app-back")}),Object(O.jsx)(y.a,{onClick:()=>i(n),isDisabled:n.length<4,isLoading:"loading"===c,type:"submit",className:"btn btn-primary",children:r("lender-web-app-make-payment")})]})]})},B=e=>{let{setShowModal:t,setScreen:a}=e;const[n,s,l]=Object(o.a)((e=>[e.getTransactionReceipt,e.loading,e.getTransactions]),r.shallow),{translate:c}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("div",{className:"d-flex py-35 flex-column align-items-center",children:[Object(O.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(O.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(O.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(O.jsxs)("defs",{className:"text-primary",children:[Object(O.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(O.jsx)("stop",{stopColor:"currentColor"}),Object(O.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(O.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(O.jsx)("stop",{stopColor:"currentColor"}),Object(O.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(O.jsx)("h6",{className:"mt-35 mb-3 ",children:c("lender-web-app-successful")}),Object(O.jsx)("p",{className:"text-grey",children:c("lender-web-app-successfull-withdrawal")})]})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between",children:[Object(O.jsx)(y.a,{onClick:()=>{a("receipt")},type:"submit",isDisabled:"loading"===s||"error"===s,className:"new-transfer-btn btn px-0",children:c("lender-web-app-view-reciept")}),Object(O.jsx)(y.a,{onClick:()=>{(async()=>{await l();const e=o.a.getState().transactions[0];e.id&&n(e.id)})(),t(!1)},isLoading:"loading"===s,isDisabled:"loading"===s||"error"===s,type:"submit",className:"btn btn-primary",children:c("lender-web-app-download-receipt")})]})]})},V=e=>{let{setShowModal:t}=e;const{translate:a}=Object(m.useTranslation)(),s=Object(N.a)((e=>e.wallet)),{assets:l}=Object(n.useContext)(f.a),[c,d,b,u,j,p]=Object(C.a)((e=>[e.amount,e.beneficiary,e.status,e.transaction_amount,e.narration,e.date]),r.shallow);return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("div",{className:"modal-body account-modal-body",children:[Object(O.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(O.jsx)("img",{style:{height:"40px",width:"auto",margin:"24px auto"},src:null===l||void 0===l?void 0:l.logo_url,alt:""})}),Object(O.jsxs)("div",{className:"bg-light-blue rounded-3 p-35",children:[Object(O.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-download-receipt")}),Object(O.jsx)("p",{className:" text-medium",children:Object(i.q)(c,null===s||void 0===s?void 0:s.currency)})]}),Object(O.jsxs)("div",{className:" text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-transfer-fee")}),Object(O.jsx)("p",{className:" text-medium",children:Object(i.q)(u,null===s||void 0===s?void 0:s.currency)})]})]}),Object(O.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(O.jsxs)("div",{className:"",children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-account-number")}),Object(O.jsxs)("p",{className:" text-medium",children:[null===d||void 0===d?void 0:d.account_number," "]})]}),Object(O.jsxs)("div",{className:"text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-bank")}),Object(O.jsxs)("p",{className:" text-medium",children:[null===d||void 0===d?void 0:d.code_description," "]})]})]}),Object(O.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(O.jsxs)("div",{className:"",children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-remarks")}),Object(O.jsxs)("p",{className:" text-medium",children:[j||"-"," "]})]}),Object(O.jsxs)("div",{className:"text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-date")}),Object(O.jsx)("p",{className:" text-medium",children:Object(i.w)(p)})]})]})]})]}),Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{onClick:()=>{(async()=>{var e;const t=null===(e=o.a.getState())||void 0===e?void 0:e.transactions[0];o.a.getState().getTransactionReceipt(t.id)})(),t(!1)},isLoading:"loading"===b,type:"submit",className:"btn btn-primary",children:a("lender-web-app-download-receipt")})})]})};var H=a(253),Y=a(19),W=a(12),G=a(8);const Z=e=>{var t,a;let{setShowModal:s,showModal:l}=e;const{translate:c}=Object(m.useTranslation)(),[i,o,d,b]=Object(D.a)((e=>[e.setData,e.buyAirtime,e.screen,e.reset]),r.shallow),j=async e=>{await o(e)},p=()=>{i({screen:"confirm"})};Object(n.useEffect)((()=>{i({screen:"initiate"}),b()}),[l,b]);const h={initiate:{description:"Airtime"},pin:{description:c("lender-web-app-authorise-payment"),subDescription:c("lender-web-app-enter-4digit-pin")},confirm:{description:c("lender-web-app-confirm-payment")},otp:{description:"One Time Password",subDescription:"Enter OTP sent to your phone"}};return Object(O.jsx)(u.a,{close:()=>s(!1),description:null===(t=h[d])||void 0===t?void 0:t.description,subDescription:null===(a=h[d])||void 0===a?void 0:a.subDescription,show:l,isUpload:!1,children:"initiate"===d?Object(O.jsx)(Q,{}):"confirm"===d?Object(O.jsx)(z,{}):"pin"===d?Object(O.jsx)(J,{}):"success"===d?Object(O.jsx)(K,{setShowModal:s}):"otp"===d?Object(O.jsx)(F,{action:"airtime",submit:j,back:p}):Object(O.jsx)(Q,{})})},K=e=>{let{setShowModal:t}=e;const{translate:a}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("div",{className:"d-flex py-35 flex-column align-items-center",children:[Object(O.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(O.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(O.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(O.jsxs)("defs",{className:"text-primary",children:[Object(O.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(O.jsx)("stop",{stopColor:"currentColor"}),Object(O.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(O.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(O.jsx)("stop",{stopColor:"currentColor"}),Object(O.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(O.jsx)("h6",{className:"mt-35 mb-3 text-primary",children:a("lender-web-app-successful")}),Object(O.jsx)("p",{className:"text-app-gray",children:a("lender-web-app-airtime-successful")})]})}),Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{onClick:()=>t(!1),type:"submit",className:"btn btn-primary",children:a("lender-web-app-close")})})]})},z=()=>{const[e,t,a,n]=Object(D.a)((e=>[e.setData,e.phone_number,e.network_type,e.amount]),r.shallow),{translate:s}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsx)("div",{className:"mt-3 bg-light-blue rounded-3 p-35",children:Object(O.jsx)("div",{className:"d-grid w-100 ",children:Object(O.jsxs)("div",{className:"row gy-4",children:[Object(O.jsxs)("div",{className:"col-sm-12 col-md-6",children:[Object(O.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-network-provider")}),Object(O.jsx)("p",{children:a})]}),Object(O.jsxs)("div",{className:"col-sm-12 col-md-6 text-md-end",children:[Object(O.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-amount")}),Object(O.jsx)("p",{children:Object(i.q)(n)})]}),Object(O.jsxs)("div",{className:"col-sm-12 col-md-6",children:[Object(O.jsx)("p",{className:"text-app-gray",children:s("lender-web-app-phone-number")}),Object(O.jsx)("p",{children:t})]})]})})})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between ",children:[Object(O.jsx)(y.a,{onClick:()=>e({screen:"initiate"}),className:"btn btn-ghost",children:s("lender-web-app-back")}),Object(O.jsx)(y.a,{onClick:()=>e({screen:"pin"}),className:"btn btn-primary",children:s("lender-web-app-continue")})]})]})},J=()=>{const[e,t,a,n]=Object(D.a)((e=>[e.setData,e.pin,e.buyAirtime,e.status]),r.shallow),s=Object(C.a)((e=>e.initiateTransfer)),{translate:l}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body ",children:Object(O.jsx)(h.o,{length:4,onChange:t=>{e({pin:t})},password:!0})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between ",children:[Object(O.jsx)(y.a,{onClick:()=>e({screen:"confirm"}),className:"btn btn-ghost",children:l("lender-web-app-back")}),Object(O.jsx)(y.a,{isLoading:"loading"===n,isDisabled:!t||t.length<4,onClick:async()=>{var n,l;e({status:"loading"});const c=await s(t);e({status:"idle"}),console.log(c,"===============respone"),!0===(null===c||void 0===c||null===(n=c.data)||void 0===n?void 0:n.otp)&&e({screen:"otp"}),!1===(null===c||void 0===c||null===(l=c.data)||void 0===l?void 0:l.otp)&&a(null)},className:"btn btn-primary",children:l("lender-web-app-make-payment")})]})]})},Q=()=>{const e=Object(D.a)((e=>e.setData)),t=Object(N.a)((e=>e.wallet),r.shallow),{translate:a}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsx)(W.c,{initialValues:{network_type:"",phone_number:"",amount:""},validationSchema:G.g().shape({network_type:G.h().required(a("lender-web-app-select-network-type")),phone_number:G.h().min(11,a("lender-web-app-use-phone-format")).max(15,a("lender-web-app-use-phone-format")).required(a("lender-web-app-please-enter-number")),amount:G.f().min(1,a("lender-web-app-amount-range",{min_amount:Object(i.q)(1),max_amount:Object(i.q)(null===t||void 0===t?void 0:t.availableBalance,null===t||void 0===t?void 0:t.currency)})).max(null===t||void 0===t?void 0:t.availableBalance,"Insufficient Balance").required(a("lender-web-app-enter-an-amount"))}),onSubmit:t=>{e({screen:"confirm",...t})},children:e=>Object(O.jsxs)(W.b,{id:"card-submit",onSubmit:e.handleSubmit,children:[Object(O.jsx)(h.r,{name:"network_type",label:a("lender-web-app-mobile-network"),valueField:"value",labelField:"value",keyField:"value",options:X}),Object(O.jsx)(h.t,{name:"phone_number",placeholder:a("lender-web-app-enter-11-digit"),label:a("lender-web-app-mobile-number"),inputProps:{maxLength:11,minLength:11}}),Object(O.jsx)(h.e,{placeholder:a("lender-web-app-enter-amount"),label:a("lender-web-app-amount"),onChange:t=>e.setFieldValue("amount",t),error:!!e.errors.amount,errorMessage:e.errors.amount,disabled:t&&(null===t||void 0===t?void 0:t.availableBalance)<1})]})})}),Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{form:"card-submit",type:"submit",className:"btn btn-primary",children:a("lender-web-app-continue")})})]})},X=[{value:"MTN"},{value:"Airtel"},{value:"9mobile"},{value:"Glo"}];var $=a(218);const ee=e=>{var t,a;let{setShowModal:s,showModal:l}=e;const{translate:c}=Object(m.useTranslation)(),[i,o,d,b,j,p,h]=Object(M.a)((e=>[e.setData,e.fetchStatus,e.screen,e.reset,e.getBillCategories,e.modalDescription,e.makeBillPayment]),r.shallow);Object(n.useEffect)((()=>(i({screen:"initiate"}),()=>{b()})),[l,b]);const v={initiate:{description:c("lender-web-app-bills"),subDescription:c("lender-web-app-pay-personal-bills")},pin:{description:c("lender-web-app-authorise-payment"),subDescription:c("lender-web-app-enter-4digit-pin")},confirm:{description:c("lender-web-app-confirm-payment")}};Object(n.useEffect)((()=>{j()}),[]);return Object(O.jsx)(u.a,{close:()=>s(!1),description:(null===(t=v[d])||void 0===t?void 0:t.description)||p,subDescription:null===(a=v[d])||void 0===a?void 0:a.subDescription,show:l,isUpload:!1,children:("loading"===o||"idle"===o)&&Object(O.jsx)("div",{className:"col-md-6 modal-loader w-100 col-xl-4 d-flex justify-content-center align-items-center empty-account-modal-body",children:Object(O.jsx)("div",{className:"spinner-border text-primary",children:Object(O.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})||"error"===o&&Object(O.jsx)("div",{className:"col-md-6 col-xl-4 d-flex justify-content-center align-items-center",children:Object(O.jsx)("p",{className:"text-center",children:"There was an error fetching bills"})})||("initiate"===d?Object(O.jsx)(se,{}):"confirm"===d?Object(O.jsx)(ae,{}):"biller"===d?Object(O.jsx)(le,{}):"item"===d?Object(O.jsx)(ce,{}):"pin"===d?Object(O.jsx)(ne,{}):"success"===d?Object(O.jsx)(te,{setShowModal:s}):"otp"===d?Object(O.jsx)(F,{action:"bill",submit:h,back:()=>{i({screen:"confirm"})}}):Object(O.jsx)(se,{}))})},te=e=>{let{setShowModal:t}=e;const{translate:a}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("div",{className:"d-flex py-35 flex-column align-items-center",children:[Object(O.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(O.jsx)("path",{d:"M54.3987 7.65566C53.5748 6.83043 52.2382 6.82901 51.4144 7.65216L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0707 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.802 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.81757 55.2218 8.4809 54.3987 7.65566Z",fill:"url(#paint0_radial)"}),Object(O.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(O.jsxs)("defs",{className:"text-primary",children:[Object(O.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(O.jsx)("stop",{stopColor:"#41A1CE"}),Object(O.jsx)("stop",{offset:"1",stopColor:"#016AB3"})]}),Object(O.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(O.jsx)("stop",{stopColor:"#41A1CE"}),Object(O.jsx)("stop",{offset:"1",stopColor:"#016AB3"})]})]})]}),Object(O.jsx)("h6",{className:"mt-35 mb-3",children:a("lender-web-app-successful")}),Object(O.jsx)("p",{children:a("lender-web-app-successful-bill")})]})}),Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{onClick:()=>t(!1),type:"submit",className:"btn btn-primary",children:a("lender-web-app-close")})})]})},ae=()=>{var e;const t=Object(M.a)((e=>e.setData)),[a,n,s,l,c]=Object(M.a)((e=>[e.amount,e.biller,e.customer_id,e.item,e.payment_code]),r.shallow),{translate:o}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsxs)("div",{className:"mt-3 bg-light-blue rounded-3 p-35",children:[Object(O.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("p",{className:"text-app-gray",children:n.fields[0]}),Object(O.jsx)("p",{children:s})]}),Object(O.jsxs)("div",{className:" text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:o("lender-web-app-biller")}),Object(O.jsx)("p",{children:n.name})]})]}),Object(O.jsxs)("div",{className:"d-flex  mt-3  justify-content-between",children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("p",{className:"text-app-gray",children:o("lender-web-app-plan")}),Object(O.jsx)("p",{children:null===l||void 0===l||null===(e=l.find((e=>{var t;return e.paymentCode===(null===(t=JSON.parse(c))||void 0===t?void 0:t.paymentCode)})))||void 0===e?void 0:e.name})]}),Object(O.jsxs)("div",{className:" text-right",children:[Object(O.jsx)("p",{className:"text-app-gray",children:o("lender-web-app-amount")}),Object(O.jsx)("p",{children:Object(i.q)(a)})]})]})]})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between ",children:[Object(O.jsx)(y.a,{onClick:()=>t({screen:"item"}),className:"btn btn-ghost",children:o("lender-web-app-back")}),Object(O.jsx)(y.a,{onClick:()=>t({screen:"pin"}),className:"btn btn-primary",children:o("lender-web-app-continue")})]})]})},ne=()=>{const[e,t,a,n]=Object(M.a)((e=>[e.setData,e.pin,e.makeBillPayment,e.status]),r.shallow),s=Object(C.a)((e=>e.initiateTransfer)),{translate:l}=Object(m.useTranslation)();return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsx)("form",{children:Object(O.jsx)(h.o,{length:4,onChange:t=>{e({pin:t})},password:!0})})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between ",children:[Object(O.jsx)(y.a,{onClick:()=>e({screen:"confirm"}),className:"btn btn-ghost",children:l("lender-web-app-back")}),Object(O.jsx)(y.a,{isLoading:"loading"===n,isDisabled:!t||t.length<4,onClick:async()=>{e({status:"loading"});const n=await s(t);e({status:"idle"});const{status:l}=C.a.getState();"error"!==l&&(null!==n&&void 0!==n&&n.data.otp?e({screen:"otp"}):a(null))},className:"btn btn-primary",children:l("lender-web-app-make-payment")})]})]})},se=()=>{const[e,t,a,n]=Object(M.a)((e=>[null===e||void 0===e?void 0:e.filteredCategories,e.searchCategories,e.getBillers,e.setData]),r.shallow);return Object(O.jsxs)("div",{className:"modal-body empty-account-modal-body",children:[Object(O.jsx)("div",{className:"form-group",children:Object(O.jsx)("input",{className:"form-control search",onChange:e=>{t(e.target.value)},placeholder:"Search for a provider"})}),e.map((e=>Object(O.jsxs)("div",{onClick:()=>{a(e.id),n({modalDescription:e.name})},className:"px-4 py-3 bill-category",children:[Object(O.jsx)("p",{children:e.name}),Object(O.jsx)("svg",{width:"8",height:"15",viewBox:"0 0 8 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(O.jsx)("path",{d:"M1.00017 1.30298L6.67709 6.9799C6.72124 7.02134 6.75643 7.07139 6.78049 7.12695C6.80454 7.18252 6.81696 7.24243 6.81696 7.30298C6.81696 7.36353 6.80454 7.42344 6.78049 7.479C6.75643 7.53457 6.72124 7.58462 6.67709 7.62606L1.00017 13.303",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.id)))]})},le=()=>{const[e,t,a,n,s]=Object(M.a)((e=>[null===e||void 0===e?void 0:e.filteredBillers,e.searchBillers,e.billerStatus,e.getItemsForBillers,e.setData]),r.shallow),{translate:l}=Object(m.useTranslation)();return"loading"===a?Object(O.jsx)("div",{className:"col-md-6 modal-loader w-100 col-xl-4 d-flex justify-content-center align-items-center empty-account-modal-body",children:Object(O.jsx)("div",{className:"spinner-border text-primary",children:Object(O.jsxs)("span",{className:"visually-hidden",children:[l("lender-web-app-loading"),"..."]})})}):Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("div",{className:"modal-body account-modal-body",children:[Object(O.jsx)("div",{className:"form-group",children:Object(O.jsx)("input",{className:"form-control search",onChange:e=>{t(e.target.value)},placeholder:"Search for a bill"})}),null===e||void 0===e?void 0:e.map((e=>Object(O.jsxs)("div",{onClick:()=>{n(e.id),s({modalDescription:e.name,biller:e})},className:"px-4 py-3 bill-category",children:[Object(O.jsx)("p",{children:e.name}),Object(O.jsx)("svg",{width:"8",height:"15",viewBox:"0 0 8 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(O.jsx)("path",{d:"M1.00017 1.30298L6.67709 6.9799C6.72124 7.02134 6.75643 7.07139 6.78049 7.12695C6.80454 7.18252 6.81696 7.24243 6.81696 7.30298C6.81696 7.36353 6.80454 7.42344 6.78049 7.479C6.75643 7.53457 6.72124 7.58462 6.67709 7.62606L1.00017 13.303",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.id)))]}),Object(O.jsx)("div",{className:"modal-footer justify-content-between ",children:Object(O.jsx)(y.a,{onClick:()=>s({screen:"initiate"}),className:"btn btn-ghost",children:l("lender-web-app-back")})})]})},ce=()=>{const[e,t,a,s]=Object(M.a)((e=>[e.item,e.setData,e.itemStatus,e.biller]),r.shallow),{translate:l}=Object(m.useTranslation)();return Object(n.useEffect)((()=>{s||t({screen:"biller"})}),[a]),"loading"===a&&Object(O.jsx)("div",{className:"col-md-6 modal-loader w-100 col-xl-4 d-flex justify-content-center align-items-center empty-account-modal-body",children:Object(O.jsx)("div",{className:"spinner-border text-primary",children:Object(O.jsxs)("span",{className:"visually-hidden",children:[l("lender-web-app-loading"),"..."]})})})||"success"===a&&Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"modal-body account-modal-body",children:Object(O.jsx)(W.c,{initialValues:{payment_code:null,customer_id:"",amount:0},validationSchema:G.g().shape({payment_code:G.e().required(l("lender-web-app-enter-an-amount")),customer_id:G.h().required(l("lender-web-app-enter-an-amount")),amount:G.h().required(l("lender-web-app-enter-an-amount"))}),onSubmit:e=>{var a;e.amount||(e.amount=null===(a=JSON.parse(e.payment_code||"{}"))||void 0===a?void 0:a.amount);t({screen:"confirm",...e,biller_id:null===s||void 0===s?void 0:s.id})},children:t=>{var a,n;return Object(O.jsxs)(W.b,{id:"card-submit",onSubmit:t.handleSubmit,children:[Object(O.jsx)($.a,{name:"customer_id",placeholder:"Enter ".concat(null===s||void 0===s?void 0:s.fields[0]),label:null===s||void 0===s?void 0:s.fields[0]}),Object(O.jsx)("p",{}),Object(O.jsx)(h.r,{name:"payment_code",label:"".concat(null===s||void 0===s?void 0:s.name.split(" ")[0]," plans"),labelField:"name",keyField:"id",options:e}),Object(O.jsxs)("div",{className:"form-group",children:[Object(O.jsx)("label",{htmlFor:"amount",children:"Amount"}),Object(O.jsx)("input",{disabled:!t.values.payment_code||(null===(a=JSON.parse(t.values.payment_code||"{}"))||void 0===a?void 0:a.amount),value:(null===(n=JSON.parse(t.values.payment_code||"{}"))||void 0===n?void 0:n.amount)||t.values.amount,className:"form-control",onChange:t.handleChange,type:"number",id:"amount",placeholder:"Enter an amount"})]})]})}})}),Object(O.jsxs)("div",{className:"modal-footer justify-content-between ",children:[Object(O.jsx)(y.a,{onClick:()=>t({screen:"biller"}),className:"btn btn-ghost",children:l("lender-web-app-back")}),Object(O.jsx)(y.a,{type:"submit",form:"card-submit",className:"btn btn-primary",children:l("lender-web-app-continue")})]})]})||null};var ie=a(67);function re(e){let{productId:t,name:a,interestRate:n,maxAmount:l,tenorPeriod:c,minTenorValue:r,maxTenorValue:o,type:d,loanStatus:b,tenorValue:u,maxTenorPeriod:j,currency:p}=e;const h=Object(Y.a)((e=>e.openLoanModal)),v=Object(s.i)(),{translate:f}=Object(m.useTranslation)();return Object(O.jsxs)("div",{className:"card mb-0 dashboard-cardProduct",onClick:()=>{"runningLoan"===d&&v.push(x.a.loans.details.for(t))},style:{cursor:"runningLoan"===d?"pointer":"default"},children:[Object(O.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(O.jsx)("p",{className:"dashboard-cardProduct__name",children:a}),Object(O.jsx)("p",{})]}),Object(O.jsxs)("div",{className:"d-flex mt-3 justify-content-between",children:[Object(O.jsxs)("div",{className:"loan-amount-holder",children:[Object(O.jsx)("p",{className:"tiny-text",children:f("runningLoan"===d?"lender-web-app-loan-amount":"lender-web-app-maximum-amount")}),Object(O.jsx)("h4",{className:"dashboardCardAmount",children:Object(i.q)(l,p)})]}),Object(O.jsxs)("div",{children:[Object(O.jsx)("p",{className:"tiny-text",children:f("lender-web-app-interest")}),Object(O.jsxs)("h4",{children:[n,"%"]})]})]}),Object(O.jsxs)("div",{className:"d-flex mt-2 align-items-center justify-content-between",children:[Object(O.jsxs)("h6",{children:[f("lender-web-app-tenor"),": ","runningLoan"===d&&u?"".concat(u," ").concat(u>1?c:c.slice(0,-1)):j!==c?"".concat(r," ").concat(c," - ").concat(o," ").concat(j):"".concat(r,"-").concat(o," ").concat(c)]}),"runningLoan"===d?Object(O.jsx)("div",{className:"py-2",children:Object(O.jsx)("div",{className:"status-pill  ".concat(ie.a.statusPill(b)),children:Object(O.jsx)("p",{children:Object(i.x)(null===b||void 0===b?void 0:b.toLowerCase(),10)})})}):Object(O.jsx)(y.a,{onClick:()=>{v.push({search:"?id=".concat(t)}),h(t)},className:"btn small btn-primary px-4 py-2",children:f("lender-web-app-apply")})]})]})}var oe,de,be,ue=a(147),je=a(261),pe=a(198),me=(a(746),a(144)),he=a(130);function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Oe.apply(this,arguments)}function ve(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",Oe({width:22,height:20,viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,oe||(oe=n.createElement("rect",{x:1.03223,y:.5,width:19.9677,height:19,rx:3.5,fill:"#F3F3F300",stroke:"currentColor"})),de||(de=n.createElement("g",{clipPath:"url(#clip0_666_15383)"},n.createElement("path",{d:"M14.0303 6.875V5H9.93503C9.8047 5 9.6797 5.04939 9.58754 5.13729C9.49538 5.2252 9.4436 5.34443 9.4436 5.46875V12.6562C9.4436 12.7806 9.49538 12.8998 9.58754 12.9877C9.6797 13.0756 9.8047 13.125 9.93503 13.125H15.5046C15.6349 13.125 15.7599 13.0756 15.8521 12.9877C15.9442 12.8998 15.996 12.7806 15.996 12.6562V6.875H14.0303Z",fill:"currentColor"}),n.createElement("path",{d:"M8.78836 12.6562V6.875H7.31406C7.18373 6.875 7.05873 6.92439 6.96657 7.01229C6.87441 7.1002 6.82263 7.21943 6.82263 7.34375V14.5312C6.82263 14.6556 6.87441 14.7748 6.96657 14.8627C7.05873 14.9506 7.18373 15 7.31406 15H12.8836C13.014 15 13.139 14.9506 13.2311 14.8627C13.3233 14.7748 13.3751 14.6556 13.3751 14.5312V13.75H9.93503C9.63101 13.7497 9.33954 13.6344 9.12457 13.4293C8.9096 13.2242 8.78868 12.9462 8.78836 12.6562ZM15.8527 6.42578L14.5012 5.13672C14.4555 5.09323 14.4012 5.05877 14.3415 5.03531C14.2817 5.01185 14.2177 4.99985 14.1532 5H14.0303V6.875H15.996V6.75664C15.996 6.63261 15.9445 6.51364 15.8527 6.42578Z",fill:"currentColor"}))),be||(be=n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_666_15383"},n.createElement("rect",{width:9.17339,height:10,fill:"white",transform:"translate(6.82263 5)"})))))}const xe=n.forwardRef(ve);a.p;var fe=e=>{var t,a;let{setShowIdModal:s,setModalValue:o,setShowModal:d,setAccountModalValue:b,profilePhoneNumber:u}=e;const{translate:j}=Object(m.useTranslation)(),[p,h]=Object(N.a)((e=>[e.wallet,e.walletStatus]),r.shallow),[v,x,g]=Object(N.a)((e=>[e.documentTypes,e.documents,e.checkNotAllowed]),r.shallow),{configs:w}=Object(n.useContext)(f.a),_=Object(n.useCallback)((()=>{const e=v.map((e=>({...e,userData:null===x||void 0===x?void 0:x.find((t=>t.type_id===e.id))}))),t=null===e||void 0===e?void 0:e.find((e=>"identification documents"===(null===e||void 0===e?void 0:e.description.toLowerCase())||1===Number(e.id)));!t||t.userData&&"rejected"!==t.userData.status.toLowerCase()?d(!0):(s(!0),o("default"))}),[v,x]),C=Object(n.useMemo)((()=>{var e,t;if(p)return Number.isNaN(+(null===p||void 0===p?void 0:p.account_no))||null!==p&&void 0!==p&&null!==(e=p.virtual_accounts[0])&&void 0!==e&&e.is_account_number_masked?null===p||void 0===p||null===(t=p.virtual_accounts[0])||void 0===t?void 0:t.account_number:null===p||void 0===p?void 0:p.account_no}),[p]);return Object(O.jsx)(O.Fragment,{children:"loading"===h&&Object(O.jsx)(c.a,{rounded:!0})||("success"===h||"updating"===h)&&Object(O.jsxs)("div",{className:"d-flex justify-content-between -mt-3 flex-wrap",children:[Object(O.jsxs)("div",{className:"mb-2 d-flex flex-column justify-content-between ",children:[Object(O.jsx)("h6",{className:"small text-app-gray",children:j("lender-web-app-account-details")}),Object(O.jsx)("div",{className:"flex-1 flex-column d-flex align-items-start justify-content-end",children:!(null===p||void 0===p||null===(t=p.virtual_accounts)||void 0===t||!t.length)&&Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("h4",{className:"my-2",children:p.virtual_accounts[0].bank_name}),Object(O.jsxs)("p",{className:"mt-0 d-flex flex-nowrap",children:[null!==C&&void 0!==C?C:"-",!(null!==p&&void 0!==p&&null!==(a=p.virtual_accounts[0])&&void 0!==a&&a.is_account_number_masked)&&Object(O.jsx)("button",{onClick:()=>Object(l.d)(C),className:"ms-1 border-0 text-primary",children:Object(O.jsx)(xe,{})})]})]})}),Object(O.jsxs)("div",{className:"mt-3 top-card",children:["FALSE"!==(null===w||void 0===w?void 0:w.fund_account)?Object(O.jsx)(y.a,{className:"btn w-sm-100 py-2 btn-primary me-3",onClick:()=>{g()||(_(),b("fund"))},children:j("lender-web-app-fund-account")}):null,Object(O.jsx)(y.a,{onClick:()=>{g()||(_(),b("transfer"))},className:"btn  w-sm-100 py-2 btn-outline-primary",children:j("lender-web-app-transfer-money")})]})]}),Object(O.jsxs)("div",{className:"bill-options",children:[Object(O.jsxs)("div",{className:"bill-top",children:[Object(O.jsx)("h6",{className:"text-right  small text-app-gray",children:j("lender-web-app-available-funds")}),Object(O.jsx)("div",{className:"row align-items-start text-right justify-content-end",children:Object(O.jsx)("h1",{className:"mt-2",children:Object(i.q)(null===p||void 0===p?void 0:p.availableBalance,null===p||void 0===p?void 0:p.currency)})})]}),Number(null===w||void 0===w?void 0:w.enable_airtime_and_bills)||"08089722636"===u?Object(O.jsx)("div",{className:"flex-1 mt-1 d-flex w-100 align-items-end",children:Object(O.jsxs)("div",{className:"d-flex justify-content-between gx-4 w-100",children:[Object(O.jsx)(ge,{onClick:()=>{g()||(_(),b("airtime"))},text:"Airtime",icon:Object(O.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(O.jsxs)("g",{className:"text-primary",children:[Object(O.jsx)("path",{d:"M17.4615 3H6.38462C5.61991 3 5 3.61991 5 4.38462V19.6154C5 20.3801 5.61991 21 6.38462 21H17.4615C18.2262 21 18.8462 20.3801 18.8462 19.6154V4.38462C18.8462 3.61991 18.2262 3 17.4615 3Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M10.8844 17.5381H12.9613",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),Object(O.jsx)(ge,{onClick:()=>{g()||(_(),b("bills"))},text:"Pay bills",icon:Object(O.jsx)("svg",{width:"17",height:"20",viewBox:"0 0 17 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(O.jsxs)("g",{className:"text-primary",stroke:"currentColor",children:[Object(O.jsx)("path",{d:"M4 13.8076H13",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M4 9.6543H13",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M4 5.5H13",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M1 19V1L16.2308 1.00005V19C15.6093 19 14.4275 18.7471 13.9881 18.2971C13.5486 17.847 13.3018 17.2365 13.3018 16.6C13.3018 17.2365 13.0549 17.847 12.6155 18.2971C12.176 18.7471 11.58 19 10.9586 19C10.3371 19 9.74113 18.7471 9.30169 18.2971C8.86226 17.847 8.61538 17.2365 8.61538 16.6C8.61538 17.2365 8.36851 17.847 7.92908 18.2971C7.48964 18.7471 6.89364 19 6.27219 19C5.65074 19 5.05473 18.7471 4.6153 18.2971C4.17587 17.847 3.92899 17.2365 3.92899 16.6C3.92899 17.2365 3.68212 17.847 3.24269 18.2971C2.80325 18.7471 2.20725 19 1.5858 19H1Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),Object(O.jsx)("a",{href:"#transactions",style:{color:"inherit"},children:Object(O.jsx)(ge,{text:"Transactions",icon:Object(O.jsx)("svg",{width:"17",height:"20",viewBox:"0 0 17 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(O.jsxs)("g",{className:"text-primary",stroke:"currentColor",children:[Object(O.jsx)("path",{d:"M16.2307 17.6154C16.2307 17.9826 16.0848 18.3348 15.8251 18.5945C15.5655 18.8541 15.2133 19 14.8461 19H2.38452C2.0173 19 1.66512 18.8541 1.40545 18.5945C1.14579 18.3348 0.999908 17.9826 0.999908 17.6154V2.38462C0.999908 2.01739 1.14579 1.66521 1.40545 1.40554C1.66512 1.14588 2.0173 1 2.38452 1H9.3076L16.2307 7.92308V17.6154Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M5.15347 6.53809H7.9227",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M5.15347 10.6924H12.0765",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(O.jsx)("path",{d:"M5.15347 14.8457H12.0765",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})})})]})}):Object(O.jsx)("div",{className:"flex-1"})]})]})||null})};const ge=e=>{let{text:t,icon:a,onClick:n}=e;return Object(O.jsxs)("div",{onClick:n,className:"d-flex pe-3 pe-md-0 ps-md-3 pt-2 cursor-pointer flex-column align-items-center",children:[Object(O.jsx)("div",{className:"rounded-svg",children:a}),Object(O.jsx)("p",{children:t})]})};t.a=()=>{const[e,t]=Object(n.useState)(!1),{params:a}=Object(s.k)(),[l,c]=Object(n.useState)(""),{dictionary:i}=Object(n.useContext)(f.a),d=Object(s.i)(),b=Object(j.a)(),[p,h,g,w,_,C,k,S]=Object(Y.a)((e=>[e.myLoans,e.myDraftLoans,e.fetchLoans,e.products,e.closeLoanModal,e.fetchProducts,e.loanCompletionStatus,e.fetchDraftLoans]),r.shallow),T=Object(N.a)((e=>e.fetchWallet),r.shallow),[A,M]=Object(n.useState)("default"),[D,F]=Object(n.useState)(!1),[R,P]=Object(n.useState)(!1),[q,U]=Object(n.useState)(!1),[B,V]=Object(n.useState)(),[W,G]=Object(n.useState)(!1),[K,z,J]=Object(N.a)((e=>[e.documentTypes,e.documents,e.fetchDocs]),r.shallow),[Q,X]=Object(o.a)((e=>[e.showProfileUpdateShortcut,e.setShowProfileUpdateShortcut]),r.shallow),[$,te,ae,ne,se,le,ce,ie,oe,de]=Object(N.a)((e=>[e.docUploadStatus,e.uploadUserDoc,e.updateUserDoc,e.documents,e.profile,e.cards,e.fetchCards,e.documentsStatus,e.cardsStatus,e.profileStatus]),r.shallow),be=Object(n.useCallback)((async(e,a)=>{const n=null===K||void 0===K?void 0:K.find((e=>"identification documents"===e.description.toLowerCase()||1===Number(e.id))),s=null===z||void 0===z?void 0:z.find((e=>e.type_id===(null===n||void 0===n?void 0:n.id))),l=s?ae:te;await l(e,null===n||void 0===n?void 0:n.id,null===s||void 0===s?void 0:s.id,(()=>{F(!1),t(!0)})),"function"===typeof a&&a()}),[te,ae,K,z]);Object(n.useEffect)((()=>{J(),g(),S(),C(),ce()}),[J,g,S]),Object(n.useEffect)((()=>{!1===e?T("loading"):T()}),[e,T]);const Oe=Object(n.useMemo)((()=>(null===p||void 0===p?void 0:p.filter((e=>{var t,a,n,s,l,c;return(null===e||void 0===e||null===(t=e.status)||void 0===t||null===(a=t.status)||void 0===a?void 0:a.includes("PENDING"))||(null===e||void 0===e||null===(n=e.status)||void 0===n||null===(s=n.status)||void 0===s?void 0:s.includes("PAST DUE"))||(null===e||void 0===e||null===(l=e.status)||void 0===l||null===(c=l.status)||void 0===c?void 0:c.includes("RUNNING"))})).map((e=>e)))||[]),[p]),ve=null===ne||void 0===ne?void 0:ne.filter((e=>{var t,a;return"identification documents"===(null===e||void 0===e||null===(t=e.doc_type)||void 0===t||null===(a=t.name)||void 0===a?void 0:a.toLowerCase())})),xe=Object(n.useMemo)((()=>{let e=0;return null!==se&&void 0!==se&&se.address&&(e+=25),null!==se&&void 0!==se&&se.kin&&(e+=25),(null===le||void 0===le?void 0:le.length)>0&&(e+=25),(null===ve||void 0===ve?void 0:ve.length)>0&&(e+=25),e}),[se,le,ve]);Object(n.useEffect)((()=>{X("success"===ie&&("success"===oe||"empty"===oe)&&"success"===de&&xe<100)}),[se,le,ve]);const ge={dots:!1,infinite:!1,speed:500,slidesToShow:((null===Oe||void 0===Oe?void 0:Oe.length)+(null===w||void 0===w?void 0:w.length)===3?3:(null===Oe||void 0===Oe?void 0:Oe.length)+(null===w||void 0===w?void 0:w.length)<=2&&2)||4,slidesToScroll:1,nextArrow:Object(O.jsx)(E.a,{}),prevArrow:Object(O.jsx)(E.b,{}),responsive:[{breakpoint:1280,settings:{slidesToShow:(null===Oe||void 0===Oe?void 0:Oe.length)+(null===w||void 0===w?void 0:w.length)===2?2:3,slidesToScroll:1}},{breakpoint:900,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:500,settings:{slidesToShow:1,slidesToScroll:1}}]};Object(n.useEffect)((()=>{if(a.request_id){var e;const t=null!==(e=null===p||void 0===p?void 0:p.find((e=>{var t;return(null===(t=e.loan_profile)||void 0===t?void 0:t.id)==(null===a||void 0===a?void 0:a.request_id)})))&&void 0!==e?e:h.find((e=>(null===e||void 0===e?void 0:e.id)==(null===a||void 0===a?void 0:a.request_id)));V(t),P(!0)}}),[h,p]);const _e=Object(L.a)((e=>e.country)),ye=Object(L.a)((e=>e.slug)),{translate:Ne}=Object(m.useTranslation)(),Ce=Object(n.useMemo)((()=>{let e=!0;return 0===ve.length&&(e=!1),ve.forEach((t=>{"rejected"===t.status&&(e=!1)})),e&&"done"}),[ve]);return Object(O.jsxs)("div",{className:"main__content",children:[Object(O.jsxs)("div",{className:"top-tab row no-gutter",children:["NGA"===_e&&Object(O.jsx)("div",{className:"bank-card col-12 dashboard-top-card",children:Object(O.jsx)(fe,{setShowIdModal:F,setModalValue:M,setShowModal:t,setAccountModalValue:c,profilePhoneNumber:null===se||void 0===se?void 0:se.phone_number})}),Object(O.jsxs)("div",{className:"mr-2 d-flex  align-items-center col-12 bg-primary advert ".concat("NGA"!==_e?"flex1":""),children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("h4",{children:null===i||void 0===i?void 0:i.referral_title}),Object(O.jsx)("p",{children:null===i||void 0===i?void 0:i.referral_sub_title}),Object(O.jsx)(y.a,{onClick:()=>d.push("/settings/referral"),className:"btn py-2 btn-secondary mt-3 px-3",children:Ne("lender-web-app-refer-friends")})]}),Object(O.jsx)("img",{src:"/images/shutterstock.png",alt:""})]}),"standard-life"===ye&&Object(O.jsxs)("div",{className:" d-flex  align-items-center col-12 rwa-blue advert ".concat("NGA"!==_e?"flex1":""),children:[Object(O.jsxs)("div",{children:[Object(O.jsx)("h4",{children:"Get a loan with just a dial"}),Object(O.jsx)("p",{children:"Make use of our USSD option by dialling *508*10# right from your mobile phone to take a loan."}),Object(O.jsx)("a",{href:"tel:",children:Object(O.jsx)(y.a,{className:"btn py-2 btn-secondary mt-3 px-3",children:"Dial Codes"})})]}),Object(O.jsx)("img",{src:"/images/phone-image.svg",alt:"",className:"smaller-image"})]})]}),Object(O.jsxs)(u.a,{show:D,close:()=>F(!1),description:Ne("lender-web-app-upload-your-id"),isUpload:!1,children:["default"===A?Object(O.jsxs)("div",{className:"modal-body py-5 d-flex text-center align-items-center flex-column",children:[Object(O.jsx)("img",{className:"mb-4",width:"60px",src:"/svgs/id.svg",alt:""}),Object(O.jsx)("h6",{children:Ne("lender-web-app-upload-id")}),Object(O.jsx)("small",{style:{maxWidth:"300px"},className:"mt-2 d-block text-black-50",children:Ne("lender-web-app-id-transactions")})]}):Object(O.jsx)("div",{className:"modal-body",children:Object(O.jsxs)("div",{className:"modal-form",children:[Object(O.jsx)(me.a,{onFileSelect:be,status:$}),Object(O.jsx)("div",{className:"tips",children:Object(O.jsxs)("p",{children:["**",Ne("lender-web-app-pdf-jpeg")]})})]})}),"default"===A&&Object(O.jsx)("div",{className:"modal-footer",children:Object(O.jsx)(y.a,{onClick:()=>M("upload"),type:"submit",className:"btn btn-primary",children:Ne("lender-web-app-continue")})})]}),Q&&Object(O.jsxs)("div",{className:"p-4 mt-4 dashboard__complete-profile",children:[Object(O.jsxs)("div",{className:"d-flex justify-content-between w-100 mb-3",children:[Object(O.jsxs)("p",{className:"table__header--title pt-0 fs-6 d-flex gap-2 align-items-center flex-wrap",children:[Ne("lender-web-app-update-information"),Object(O.jsxs)("div",{className:"d-flex align-items-center",children:[Object(O.jsxs)("span",{className:"d-block fw-normal me-1",style:{fontSize:"0.875rem"},children:[xe,"%"]}),Object(O.jsx)("div",{className:"progress d-inine-block",style:{height:"40px",width:"150px"},children:Object(O.jsx)("div",{className:"progress-bar bg-primary",style:{width:"".concat(xe,"%")},"aria-valuenow":xe,"aria-valuemin":0,"aria-valuemax":100})})]})]}),xe>=100&&Object(O.jsx)("button",{type:"button",className:"close border-0 text-primary bg-transparent","data-bs-dismiss":"modal","aria-label":"Close",onClick:()=>X(!1),children:Object(O.jsx)("svg",{width:"48",height:"48",children:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#close-icon"})})})]}),Object(O.jsxs)("div",{className:"row",children:[Object(O.jsx)(we,{icon:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#location_icon"}),title:Ne("lender-web-app-update-address"),description:Ne("lender-web-app-update-address-desc"),link:x.a.settings.profile,state:(null===se||void 0===se?void 0:se.address)&&"done"}),Object(O.jsx)(we,{icon:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#add_user_icon"}),title:Ne("lender-web-app-update-nok"),description:Ne("lender-web-app-nok-desc"),link:x.a.settings.nextOfKin,state:(null===se||void 0===se?void 0:se.kin)&&"done"}),Object(O.jsx)(we,{icon:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#card_icon"}),title:Ne("lender-web-app-add-your-debit"),description:Ne("lender-web-app-add-debit-desc"),link:x.a.settings.cards,state:(null===le||void 0===le?void 0:le.length)>0&&"done"}),Object(O.jsx)(we,{icon:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#border_user_icon"}),title:Ne("lender-web-app-upload-your-id"),description:Ne("lender-web-app-upload-id-desc"),link:x.a.settings.documents,state:Ce})]})]}),(null===w||void 0===w?void 0:w.length)>0&&Object(O.jsxs)("div",{className:"pt-4",children:[Object(O.jsxs)("div",{className:"table__header--title mt-3 mb-3 fs-6 d-flex",children:[(null===Oe||void 0===Oe?void 0:Oe.length)>0&&Object(O.jsxs)("p",{className:"col-6 px-2",children:[Ne("lender-web-app-your-loan")," ",Object(O.jsx)("span",{className:"bg-primary rounded-circle text-white fw-normal d-inline-flex align-items-center justify-content-center",style:{fontSize:"0.875rem",width:"1.5rem",height:"1.5rem"},children:null===Oe||void 0===Oe?void 0:Oe.length})]}),Object(O.jsxs)("p",{className:"col-6 px-2 text-nowrap",children:[Ne("lender-web-app-availaible-offers")," ",Object(O.jsx)("span",{className:" bg-primary rounded-circle text-white fw-normal d-inline-flex align-items-center justify-content-center",style:{fontSize:"0.875rem",width:"1.5rem",height:"1.5rem"},children:null===w||void 0===w?void 0:w.length})]})]}),Object(O.jsxs)(E.c,{settings:ge,children:[null===Oe||void 0===Oe?void 0:Oe.map((e=>{var t,a;const n=null===w||void 0===w||null===(t=w.filter((t=>t.id===(null===e||void 0===e?void 0:e.product_id)))[0])||void 0===t?void 0:t.name;return Object(O.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3",children:Object(O.jsx)(re,{productId:null===e||void 0===e?void 0:e.id,name:n,interestRate:null===e||void 0===e?void 0:e.interest_rate,maxAmount:null===e||void 0===e?void 0:e.loan_amount,tenorValue:null===e||void 0===e?void 0:e.tenor,tenorPeriod:null===e||void 0===e?void 0:e.tenor_period,loanStatus:null===e||void 0===e||null===(a=e.status)||void 0===a?void 0:a.status,currency:null===e||void 0===e?void 0:e.currency,type:"runningLoan"})},e.id)})),null===w||void 0===w?void 0:w.map((e=>Object(O.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3",children:Object(O.jsx)(re,{productId:null===e||void 0===e?void 0:e.id,name:null===e||void 0===e?void 0:e.name,interestRate:null===e||void 0===e?void 0:e.interest_rate,maxAmount:null===e||void 0===e?void 0:e.max_amount,minTenorValue:null===e||void 0===e?void 0:e.min_tenor_value,maxTenorValue:null===e||void 0===e?void 0:e.max_tenor_value,tenorPeriod:null===e||void 0===e?void 0:e.min_tenor_period,maxTenorPeriod:null===e||void 0===e?void 0:e.max_tenor_period,currency:null===e||void 0===e?void 0:e.currency})},null===e||void 0===e?void 0:e.id)))]})]}),Object(O.jsx)("div",{className:"pt-4",id:"transactions",children:Object(O.jsx)(v,{title:Ne("lender-web-app-latest-transactions"),showModal:e})}),"transfer"===l&&Object(O.jsx)(I,{setShowModal:t,showModal:e})||"airtime"===l&&Object(O.jsx)(Z,{setShowModal:t,showModal:e})||"bills"===l&&Object(O.jsx)(ee,{setShowModal:t,showModal:e})||Object(O.jsx)(H.a,{setShowModal:t,showModal:e})," ",Object(O.jsx)(u.a,{close:()=>{d.push("/"),_()},description:Ne("lender-web-app-loan-application"),show:!!b.get("id"),isUpload:!1,children:b.get("id")&&Object(O.jsx)(ue.a,{})}),Object(O.jsx)(u.a,{close:()=>{P(!1),"success"===k?d.push("/loans"):d.push("/")},description:Ne("lender-web-app-loan-application"),show:R,className:"",isUpload:!1,children:R&&!!B&&Object(O.jsx)(je.a,{loan:B,onDecline:()=>{G(!0),P(!1),U(!0)}})}),q&&Object(O.jsx)(pe.a,{id:null===B||void 0===B?void 0:B.id,show:q,close:()=>{U(!1),W&&P(!0)},abandoned:Object(he.c)(B),onSuccess:()=>{d.push("/"),S(),U(!1),P(!1)}})]})};const we=e=>{let{icon:t,title:a,description:n,state:l,link:c}=e;const i=Object(s.i)();return Object(O.jsx)("div",{className:"col-sm-6 col-lg p-1",children:Object(O.jsxs)("div",{className:"card h-100  text-center p-4 border-0 cursor-pointer",style:{opacity:"".concat("done"===l?.5:1)},onClick:()=>{i.push(c)},children:[Object(O.jsx)("div",{className:"icon-bg mx-auto","data-state":l,style:{width:"40px",height:"40px"},children:Object(O.jsx)("svg",{className:"text-primary",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:"done"===l?Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#single-check-done"}):t})}),Object(O.jsx)("h6",{className:"mt-2",children:a}),Object(O.jsx)("p",{className:"fst-italic text-app-gray",children:n})]})})}},32:function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"a",(function(){return d}));var n=a(45),s=a(3),l=a(11),c=a(10),i=a(200);const r=async(e,t)=>{const{session_id:a,user:r}=n.a.getState(),o={event_name:e,description:t,session_id:a,app_name:"".concat(window.ORG_NAME," WebApp"),time:Object(s.j)(new Date)};Object(l.a)(c.Mb,"post",o).catch(console.error);const d=Object(i.a)();Object(i.c)(d,"".concat(null===r||void 0===r?void 0:r.id)),Object(i.d)(d,{user_id_number:null===r||void 0===r?void 0:r.id}),Object(i.b)(d,o.event_name,{description:o.description})},o={AUTHENTICATION_LOG_IN:"authentication_log_in",LOAN_APPLY_NEW:"loan_apply_new",LOAN_TAKE_THIS_OFFER:"loan_take_this_offer",LOAN_SUBMISSION_SUCCESSFUL:"loan_submission_successful",LOAN_SUBMISSION_FAILED:"loan_submission_failed",LOAN_VIEW_EXISTING:"loan_view_existing",LOAN_CANCEL:"loan_cancel",LOAN_REPAYMENT:"loan_repayment",USER_ADD_DOCUMENT:"user_add_document",USER_UPDATE_DOCUMENT:"user_update_document",TRANSACTIONS_START_TRANSFER:"transactions_start_transfer",TRANSACTIONS_SUCCESSFUL_TRANSFER:"transactions_successful_transfer",TRANSACTIONS_FAILED_TRANSFER:"transactions_failed_transfer",CANCEL_ABANDONED_LOAN:"cancel_abandoned_loan",UPLOAD_SIGNATURE:"upload_signature",GENERATE_MANDATE:"generate_mandate"},d=e=>{let{event_name:t,...a}=e;const{user:s}=n.a.getState();if(!s)return null;const l=s.id;switch(t){case o.AUTHENTICATION_LOG_IN:r(o.AUTHENTICATION_LOG_IN,"User".concat(l," logged in"));break;case o.LOAN_APPLY_NEW:r(o.LOAN_APPLY_NEW,"User".concat(l," started application for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_TAKE_THIS_OFFER:r(o.LOAN_TAKE_THIS_OFFER,"User".concat(l," chose offer for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_SUBMISSION_SUCCESSFUL:r(o.LOAN_SUBMISSION_SUCCESSFUL,"User".concat(l," successfully applied for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_SUBMISSION_FAILED:r(o.LOAN_SUBMISSION_FAILED,"User".concat(l," loan submission failed for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_VIEW_EXISTING:r(o.LOAN_VIEW_EXISTING,"User".concat(l," viewed details for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_CANCEL:r(o.LOAN_CANCEL,"User".concat(l," canceled request for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.LOAN_REPAYMENT:r(o.LOAN_REPAYMENT,"User".concat(l," repaid ").concat(null===a||void 0===a?void 0:a.amount," for loan ").concat(null===a||void 0===a?void 0:a.loan_id));break;case o.USER_ADD_DOCUMENT:r(o.USER_ADD_DOCUMENT,"User ".concat(l," added document ").concat(null===a||void 0===a?void 0:a.doc_id));break;case o.USER_UPDATE_DOCUMENT:r(o.USER_UPDATE_DOCUMENT,"User ".concat(l," updated document ").concat(null===a||void 0===a?void 0:a.doc_id));break;case o.TRANSACTIONS_START_TRANSFER:r(o.TRANSACTIONS_START_TRANSFER,"User".concat(l," initiated transfer"));break;case o.TRANSACTIONS_SUCCESSFUL_TRANSFER:r(o.TRANSACTIONS_SUCCESSFUL_TRANSFER,"User".concat(l," successfully transfer ").concat(null===a||void 0===a?void 0:a.amount));break;case o.TRANSACTIONS_FAILED_TRANSFER:r(o.TRANSACTIONS_FAILED_TRANSFER,"User".concat(l," transfer failed"));break;case o.CANCEL_ABANDONED_LOAN:r(o.CANCEL_ABANDONED_LOAN,"User".concat(l," canceled abandoned loan"));break;case o.UPLOAD_SIGNATURE:r(o.UPLOAD_SIGNATURE,"User".concat(l," uploaded a signature for their mandate"));break;case o.GENERATE_MANDATE:r(o.GENERATE_MANDATE,"User".concat(l," signed their mandate using nibbs"))}}},36:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={short_text:"short_text",long_text:"long_text",date:"date",time:"time",date_time:"date_time",integer:"integer",number:"number",amount:"amount",phone:"phone",email:"email",checkbox:"checkbox",drop_down:"dropdown",select:"select",radio:"radio",label:"label",upload:"upload",file:"file",video:"video",audio:"audio",image:"image",api:"api",remita_inflight:"remita_inflight",bank:"bank",url:"url",smileid:"smileid",veriff:"veriff"}},395:function(e,t,a){},397:function(e,t,a){},401:function(e,t,a){},404:function(e,t,a){"use strict";(function(e){var n=a(438),s=a(440),l=a(21),c=a(16),i=(a(745),a(311)),r=a(441),o=a(45),d=a(1),b=a(4),u=a(13),j=a(437),p=a(426),m=a(254),h=a(427),O=a(258),v=a(226),x=a(29),f=a(428),g=a.n(f),w=a(429),_=a(15),y=a(163),N=a(230),C=a(263),k=a(444),S=a(18),E=a(41),T=a(2),A=a(0);t.a=function(){var t;const{dictionary:a,assets:f}=Object(d.useContext)(x.a),L=window.location.hostname,[M,D]=Object(d.useState)(!1);window.APP_INVESTMENT_CONFIG_NAME=""!==(null===a||void 0===a?void 0:a.enable_and_name_savings)?null===a||void 0===a?void 0:a.enable_and_name_savings.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-"):"Saj1623&#4fcv",window.ORG_NAME=null===a||void 0===a?void 0:a.page_title;const{state:F}=Object(l.j)(),[I,R]=Object(o.a)((e=>[e.user,e.storePermissionToken]),b.shallow),P=Object(u.a)((e=>e.fetchUserProfile)),[q,U,B]=Object(E.a)((e=>[e.sessionTimeoutId,e.setSessionTimeout,e.refreshToken]),b.shallow),V=e=>{Notification.requestPermission().then((t=>{if("granted"===t){const t=Object(C.a)(e);if(!t)return;Object(C.b)(t,{vapidKey:"BP--LYCdb9S7gh7tUQ4rDczBSm7aWl0l2EZjtgnf2qtM-5Mi1hckEXoDySEg3YRIHwoPcJhOdSHZlA6V5L5byuk"}).then((e=>{H(e)}))}else console.log("no permision granted")}))},H=e=>{e?(console.log("current token:",e),R(e)):console.log("No token found")};Object(d.useEffect)((()=>{I&&((async()=>{try{var e;if("Notification"in window&&"PushManager"in window&&null!==(e=y.a())&&void 0!==e&&e.length){const e=y.a()[0];if(!e)return;V(e)}}catch(t){console.log(t)}})(),k.g({id:I.id,username:I.phone_number}))}),[null===I||void 0===I?void 0:I.id]),Object(d.useEffect)((()=>{M&&(Z(),(I||"number"===typeof G&&G>=4)&&(clearInterval(q),B(),U()))}),[M]),Object(d.useEffect)((()=>{var t,n;window.APP_INVESTMENT_CONFIG_NAME="development"!==(null===(t=e)||void 0===t||null===(n=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}))||void 0===n?void 0:n.NODE_ENV)?null===a||void 0===a?void 0:a.enable_and_name_savings.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-"):"Saj1623&#4fcv",I&&P(),Object(S.m)().catch((()=>0))}),[I,P]),Object(w.a)();const[Y,W,G,Z,K,z,J,Q,X]=Object(_.a)((e=>[e.language,e.setLanguage,e.screen,e.getLendersPreferences,e.firebase_web_api_key,e.firebase_web_sender_id,e.firebase_web_auth_domain,e.firebase_web_project_id,e.firebase_web_app_id]),b.shallow);Object(d.useEffect)((()=>{K&&!y.a().length&&y.b({apiKey:K,projectId:Q,messagingSenderId:z,appId:X,authDomain:J})}),[K,null===I||void 0===I?void 0:I.id]);const $=Object(d.useMemo)((()=>{var e,t,a,n;return null!==F&&void 0!==F&&null!==(e=F.location)&&void 0!==e&&e.search?"".concat(null===F||void 0===F||null===(t=F.location)||void 0===t?void 0:t.pathname).concat(null===F||void 0===F||null===(a=F.location)||void 0===a?void 0:a.search):null===F||void 0===F||null===(n=F.location)||void 0===n?void 0:n.pathname}),[F]);return Object(d.useEffect)((()=>{var e;if(Y)return;const t=null!==(e=new URLSearchParams(window.location.search).get("language"))&&void 0!==e?e:navigator.language;let a="";a="fr-FR"===t||"fr"===t?"French":"sw"===t?"Swahili":"English",W(t,a)}),[F]),Object(A.jsx)(T.LinguaProvider,{language:Y,onReady:async()=>{D(!0)},children:M&&Object(A.jsxs)(A.Fragment,{children:[Object(A.jsxs)(v.a,{children:[Object(A.jsx)("meta",{charSet:"utf-8"}),Object(A.jsx)("meta",{name:"description",content:"Sign up or log in to view your ".concat(null===a||void 0===a?void 0:a.page_title," account online. Get instant access to your ").concat(null===a||void 0===a?void 0:a.page_title," account on the web!").concat(L.includes("lsq.")?" Powered by Lendsqr":"")}),Object(A.jsxs)("title",{children:[null===a||void 0===a?void 0:a.page_title,L.includes("lsq.")?" Web App \u2013 Powered by Lendsqr":""]}),Object(A.jsx)("link",{rel:"canonical",href:"https://".concat(window.location.hostname)}),Object(A.jsx)("link",{href:null===f||void 0===f?void 0:f.favicon,rel:"shortcut icon",id:"favicon",type:"image/jpg"}),Object(A.jsx)("script",{src:"https://cdn.smileidentity.com/inline/v1/js/script.min.js",type:"text/javascript",async:!0})]}),(null===a||void 0===a?void 0:a.freshchat_token)&&Object(A.jsx)(g.a,{token:null===a||void 0===a?void 0:a.freshchat_token,tags:[null===a||void 0===a?void 0:a.page_title]}),I?Object(A.jsxs)(r.a,{children:[Object(A.jsx)(N.a,{}),Object(A.jsxs)(l.e,{children:[Object(A.jsx)(l.c,{path:c.a.investments.base.for(null===(t=window.APP_INVESTMENT_CONFIG_NAME)||void 0===t?void 0:t.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),children:Object(A.jsx)(O.a,{})}),Object(A.jsx)(l.c,{path:"/loans/requests/:request_id",children:Object(A.jsx)(i.a,{})}),Object(A.jsx)(l.c,{path:c.a.loans.base,children:Object(A.jsx)(s.a,{})}),Object(A.jsx)(l.c,{path:c.a.dashboard.transactions.details,children:Object(A.jsx)(m.a,{})}),Object(A.jsx)(l.c,{path:c.a.notifications,children:Object(A.jsx)(h.a,{})}),Object(A.jsx)(l.c,{path:c.a.dashboard.transactions.index,children:Object(A.jsx)(p.a,{})}),Object(A.jsx)(l.c,{path:c.a.dashboard.index,children:Object(A.jsx)(i.a,{})}),Object(A.jsx)(l.c,{path:c.a.settings.base,children:Object(A.jsx)(j.a,{})}),Object(A.jsx)(l.b,{to:null!==$&&void 0!==$?$:c.a.dashboard.index})]})]}):Object(A.jsx)(n.a,{})]})})}}).call(this,a(159))},41:function(e,t,a){"use strict";var n=a(10),s=a(53),l=a(61),c=a(33),i=a(11);Object(c.b)();const r={sessionTimeoutId:null,access_token:"",session_id:"",refresh_token:"",timeout:void 0,tokenStatus:"idle",tokenUsage:[],sessionStatus:"idle"},o=Object(s.create)()(Object(l.devtools)(Object(l.persist)(((e,t)=>({...r,setToken:a=>{const{refreshToken:n}=t(),s=Object(c.a)(t(),(e=>{var t;e.access_token=null!==(t=a.access_token)&&void 0!==t?t:a.token,e.refresh_token=a.refresh_token,e.timeout=1e3*(null===a||void 0===a?void 0:a.expires_in),e.sessionTimeoutId=window.setInterval((()=>{n()}),e.timeout-6e4)}));e(s)},setSessionTimeout:()=>{const{refreshToken:a,setSessionTimeout:n}=t(),s=Object(c.a)(t(),(e=>{e.sessionTimeoutId=window.setTimeout((()=>{n(),a()}),e.timeout&&e.timeout-6e4)}));e(s)},setSessionStatus:t=>{e({sessionStatus:t})},addUsage:a=>{const n=Object(c.a)(t(),(e=>{e.tokenUsage.push(a)}));e(n)},removeUsage:a=>{const n=Object(c.a)(t(),(e=>{const t=e.tokenUsage.indexOf(a);e.tokenUsage.splice(t,1)}));e(n)},getTokenStatus:()=>t().tokenStatus,clearTokenUsage:()=>{const a=Object(c.a)(t(),(e=>{e.tokenUsage=[]}));e(a)},refreshToken:async()=>{if("refreshing"===t().tokenStatus)return;e({tokenStatus:"refreshing"});const{refresh_token:a,delay:s}=t();for(;t().tokenUsage.length>0;)await s(1e3);if(a)try{const s=await Object(i.a)(n.Fb,"post",{token:a}),l=Object(c.a)(t(),(e=>{var t;e.access_token=s.data.access_token;let a=72e4;null!==s&&void 0!==s&&null!==(t=s.data)&&void 0!==t&&t.expires_in&&(a=1e3*s.data.expires_in),e.timeout=a,e.tokenStatus="idle"}));e(l)}catch(l){console.dir(l)}finally{e({tokenStatus:"idle"})}else e({tokenStatus:"idle"})},delay:e=>new Promise((t=>setTimeout(t,e))),reset:()=>{e(r)}})),{name:"app.token"})));t.a=o},426:function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));var n=a(89),s=a(1),l=a(20),c=a(18),i=a(16),r=a(84),o=a(4),d=a(3),b=a(79),u=a(2),j=a(7),p=a(0);function m(){const e=Object(c.y)(),[t,a]=Object(s.useState)(""),[m,h]=Object(s.useState)(""),[O,v]=Object(s.useState)(""),[x,f]=Object(s.useState)(1),[g,w,_,y]=Object(r.a)((e=>{var a;return[e.getTransactions,e.loading,null===(a=e.transactions)||void 0===a?void 0:a.filter((e=>new RegExp(t||".","i").test(e.meta)&&e.type.includes(m)&&(!O||Object(d.m)(e.created_on)===Object(d.m)(O)))),e.types]}),o.shallow);Object(s.useEffect)((()=>{f(1)}),[]),Object(s.useEffect)((()=>{g()}),[g]);const[N,C]=Object(s.useState)(15),k=Object(s.useMemo)((()=>{const e=N*x-N,t=N*x;return _.slice(e,t)}),[x,N,_]),S=Object(s.useCallback)((e=>{f(e)}),[]),{translate:E}=Object(u.useTranslation)();return Object(p.jsxs)("div",{className:"main__content",children:[Object(p.jsx)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(p.jsxs)(l.b,{to:i.a.dashboard.index,href:"loans.html",className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(p.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(p.jsx)("svg",{width:"20",height:"20",children:Object(p.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(p.jsx)("p",{children:E("lender-web-app-back-to-accounts")})]})}),Object(p.jsx)("div",{className:"pageTitle",children:Object(p.jsx)("p",{children:E("lender-web-app-transactions")})}),w&&_.length<1?Object(p.jsx)("div",{children:Object(c.g)(4).map((e=>Object(p.jsx)(b.a,{height:60,rounded:!0},e)))}):Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:"card default-card page-table",children:[Object(p.jsxs)("div",{className:"filter-and-search",children:[Object(p.jsxs)("div",{className:"filter-box d-flex",children:[Object(p.jsx)(j.k,{setDate:v,date:O}),Object(p.jsxs)("div",{className:"input-group input-group-filter",children:[Object(p.jsx)("div",{className:"input-group-prepend",children:Object(p.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[E("lender-web-app-type"),":"]})}),Object(p.jsxs)("select",{value:m,onChange:e=>h(e.target.value),onBlur:e=>h(e.target.value),className:"form-control",children:[Object(p.jsx)("option",{value:"",selected:!0,children:E("lender-web-app-all")}),Array.from(y).map((e=>Object(p.jsx)("option",{children:e},e)))]})]})]}),Object(p.jsx)("div",{className:"search-box",children:Object(p.jsx)("input",{value:t,onChange:e=>a(e.target.value),type:"search",className:"form-control",placeholder:"".concat(E("lender-web-app-search"),"..."),autoComplete:"false"})})]}),Object(p.jsxs)("div",{className:"loans__history",children:[Object(p.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(p.jsx)("thead",{children:Object(p.jsxs)("tr",{children:[Object(p.jsx)("th",{className:"date"}),Object(p.jsx)("th",{className:"date",children:E("lender-web-app-date")}),Object(p.jsx)("th",{className:"interest",children:E("lender-web-app-type")}),Object(p.jsx)("th",{className:"status",children:E("lender-web-app-channel")}),Object(p.jsx)("th",{className:"narration",children:E("lender-web-app-transactions")}),Object(p.jsx)("th",{className:"principal",children:E("lender-web-app-amount")})]})}),Object(p.jsx)("tbody",{children:k.map((t=>Object(p.jsxs)("tr",{onClick:()=>e.goTo(i.a.dashboard.transactions.for(t.id)),className:"link-row",children:[Object(p.jsx)("td",{style:{textAlign:"right"},"data-toggle":"tooltip","data-placement":"top",title:t.status,className:"d-flex align-items-end align-items-sm-end justify-content-end",children:Object(p.jsx)("div",{style:{background:("success"===t.status?"green":"pending"===t.status&&"orange")||"red",width:"12px",height:"12px",borderRadius:"12px"}})}),Object(p.jsx)("td",{children:Object(d.v)(t.created_on)}),Object(p.jsx)("td",{children:t.type}),Object(p.jsx)("td",{children:E("lender-web-app-web")}),Object(p.jsx)("td",{style:{maxWidth:"270px"},children:t.meta}),Object(p.jsxs)("td",{style:{color:"Debit"===t.entry?"#E7284E":"inherit"},children:["Credit"===t.entry?"+":"-"," ",Object(d.q)(t.amount,null===t||void 0===t?void 0:t.currency)]})]},t.id)))})]}),Object(p.jsx)("div",{className:"mobileListTable d-lg-none",children:k.map((t=>Object(p.jsxs)("div",{onClick:()=>e.goTo(i.a.dashboard.transactions.for(t.id)),className:"list cursor-pointer",children:[Object(p.jsxs)("div",{className:"row listData",children:[Object(p.jsx)("div",{className:"col",children:Object(p.jsx)("p",{className:"date",children:Object(d.v)(t.created_on)})}),Object(p.jsx)("div",{className:"col px-2",children:Object(p.jsx)("div",{className:"d-flex align-items-end align-items-sm-end justify-content-end",style:{height:"20px"},children:Object(p.jsx)("div",{"data-toggle":"tooltip","data-placement":"top",title:t.status,className:"rounded-circle ms-3",style:{width:"10px",height:"10px",background:("success"===t.status?"green":"pending"===t.status&&"orange")||"red"}})})})]}),Object(p.jsxs)("div",{className:"row listData",children:[Object(p.jsx)("div",{className:"col",children:Object(p.jsxs)("p",{className:"principal",children:[" ","Credit"===t.entry?"+":"-"," ",Object(d.q)(t.amount,null===t||void 0===t?void 0:t.currency)]})}),Object(p.jsx)("div",{className:"col px-2",children:Object(p.jsx)("p",{className:"tenor",children:E("lender-web-app-web")})})]}),Object(p.jsxs)("div",{className:"row listData",children:[Object(p.jsx)("div",{className:"col pe-0",children:Object(p.jsx)("p",{className:"interest",children:t.meta})}),Object(p.jsx)("div",{className:"col px-2",children:Object(p.jsx)("div",{className:"status-wrapper",children:Object(p.jsx)("div",{className:"",children:Object(p.jsx)("p",{children:t.type})})})})]})]},t.id)))})]})]}),Object(p.jsx)(n.a,{total:_.length,perPage:N,setPerPage:C,currentPage:x,loadPage:S,pageSize:[15,20,25],setCurrentPage:f})]})]})}},427:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(1),s=a(20),l=a(16),c=a(84),i=a(4),r=a(3),o=a(2),d=a(0);function b(){const[e,t,a]=Object(c.a)((e=>[e.getNotifications,e.loading,e.notifications]),i.shallow);Object(n.useEffect)((()=>{e()}),[]);const{translate:b}=Object(o.useTranslation)();return Object(d.jsxs)("div",{className:"main__content",children:[Object(d.jsx)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(d.jsxs)(s.b,{to:l.a.dashboard.index,href:"loans.html",className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(d.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(d.jsx)("svg",{width:"20",height:"20",children:Object(d.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(d.jsx)("p",{children:b("lender-web-app-back-to-accounts")})]})}),Object(d.jsx)("div",{className:"pageTitle",children:Object(d.jsx)("p",{children:b("lender-web-app-nottifications")})}),Object(d.jsx)("div",{style:{maxWidth:"700px",minHeight:"500px"},className:"card default-card page-table",children:t?Object(d.jsx)("div",{className:"col-md-6 flex-grow-1 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(d.jsx)("div",{className:"spinner-border text-primary",role:"status",children:Object(d.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}):Object(d.jsx)(d.Fragment,{children:null===a||void 0===a?void 0:a.map((e=>Object(d.jsxs)("div",{className:"d-flex mb-4 justify-content-between align-items-center",children:[Object(d.jsxs)("div",{className:"d-flex align-items-start ",children:[Object(d.jsx)("div",{className:"rounded-circle me-2",style:{width:"10px",height:"10px",background:"red",marginTop:"3.5px"}}),Object(d.jsxs)("div",{style:{maxWidth:"266px"},children:[Object(d.jsx)("h5",{className:"fs-18",children:e.title}),Object(d.jsx)("p",{className:"small",children:e.body})]})]}),Object(d.jsxs)("p",{className:"small",children:[" ",Object(r.u)(e.time)]})]},"".concat(e.title,"-").concat(e.time))))})})]})}},429:function(e,t,a){"use strict";var n=a(1),s=a(430),l=a.n(s),c=a(29);t.a=()=>{const{configs:e}=Object(n.useContext)(c.a);Object(n.useEffect)((()=>{window.location.href.includes("localhost")||l.a.initialize({gtmId:null===e||void 0===e?void 0:e.ga_tracking_id})}),[])}},437:function(e,t,a){"use strict";a.d(t,"a",(function(){return Fe}));var n=a(1),s=a(21),l=a(6),c=a(13),i=a(60),r=a(12),o=a(118),d=a(9),b=a.n(d),u=a(11),j=a(10),p=a(4),m=a(8),h=a(16),O=a(145),v=a(19),x=a(2),f=a(15),g=a(7),w=a(227),_=a(25),y=a(0);var N=function(e){let{show:t,onClose:a,email:s}=e;const{translate:i}=Object(x.useTranslation)(),[o,d]=Object(n.useState)(!1),[b,u,j,h]=Object(c.a)((e=>[e.postVerifyUserEmail,e.resetEmailVerification,e.verifyEmailStatus,e.postRequestVerifyUserEmail]),p.shallow),O=m.g().shape({otp:m.h().length(6,i("lender-web-app-valid-code")).required(i("lender-web-app-enter-the-code"))}),v=Object(r.e)({initialValues:{otp:""},validationSchema:O,onSubmit:async e=>{let{otp:t}=e;d(!0),b({email:s,otp:t}).catch((e=>{v.setFieldError("otp",e)})).finally((()=>{d(!1)}))}}),[f,w]=Object(n.useState)(60);Object(n.useEffect)((()=>{if(f>0){const e=setTimeout((()=>w(f-1)),1e3);return()=>clearTimeout(e)}}),[f]);const N=()=>{v.resetForm(),u(),a()};return Object(y.jsx)(_.a,{show:t,close:()=>N(),description:"Verify your email address",isUpload:!1,className:"",children:Object(y.jsxs)("form",{onSubmit:v.handleSubmit,children:[Object(y.jsx)("div",{className:"modal-body",children:Object(y.jsxs)("div",{children:[Object(y.jsxs)("p",{children:["We have sent an email with a verification link or code to ",s,". You may check your spam folder if you\u2019re not able to see the email in your inbox"]}),Object(y.jsx)(g.o,{length:6,onChange:e=>{v.setFieldValue("otp",e,!0)},error:v.errors.otp,autofocus:!0,password:!0,clearOnMount:t}),Object(y.jsx)("div",{className:"",children:v.errors.otp&&Object(y.jsx)("p",{className:"text-danger",children:v.errors.otp})}),Object(y.jsxs)("p",{className:"d-flex align-items-center",children:[i("lender-web-app-no-otp")," ",Object(y.jsx)("button",{type:"button",style:{border:"none",color:"#016AB3"},onClick:()=>{w(60),h(!0)},className:"resend-button ms-1 bg-white",disabled:o||f>0||"resending-code"===j,children:Object(y.jsx)("small",{children:i("lender-web-app-resend-code")})}),"resending-code"===j&&Object(y.jsx)("div",{className:"spinner-border text-primary spinner-border-sm",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[i("lender-web-app-loading"),"..."]})})]}),Object(y.jsx)("p",{children:(e=>{const t=Math.floor(e/60),a=e%60;return"".concat(t.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0"))})(f)})]})}),Object(y.jsxs)("div",{className:"modal-footer justify-content-between flex-nowrap modal-footer-flex",children:[Object(y.jsx)(l.a,{disabled:o,type:"submit",className:"w-25 py-3 btn btn-outline-neutral btn-lg ",onClick:N,children:i("lender-web-app-cancel")}),Object(y.jsx)(l.a,{isLoading:o,type:"submit",className:" btn-primary btn-lg",style:{width:"75%"},isDisabled:!(v.isValid||v.touched),children:i("lender-web-app-continue")})]})]})},"verify-email")};function C(){var e,t;const{translate:a}=Object(x.useTranslation)(),s=a("lender-web-app-provide-valid-email"),l=a("lender-web-app-valid-street-address"),d=a("lender-web-app-provide-valid-city"),u=a("lender-web-app-provide-valid-landmark"),j=a("lender-web-app-please-select"),h=Object(n.useMemo)((()=>a("lender-web-app-profile-updated")),[a]),[O,v,g,w]=Object(c.a)((e=>[e.profile,e.updateUserProfile,e.profileStatus,e.fetchUserProfile]),p.shallow),_=Object(f.a)((e=>e.country)),[N,C]=Object(n.useState)("");Object(n.useEffect)((()=>{w()}),[]);const[E,T]=Object(i.a)((e=>[e.fetchCustomStates,e.states]),p.shallow);Object(n.useEffect)((()=>{(async()=>{await E(null!==_&&void 0!==_?_:"Nigeria")})()}),[]);const[A,L]=Object(n.useState)([]),M=(e,t,a)=>{const n=e.find((e=>e[a]===t));return null===n||void 0===n?void 0:n.id},D=Object(n.useMemo)((()=>T.length>0?m.g().shape({photo_url:m.h().optional(),email:m.h().email(s).required(s),address:m.h().min(3).max(100).required(l).typeError(l).nullable(),country:m.h(),city:m.h().min(3).max(52).required(d).typeError(d),gender_id:m.f().required(a("lender-web-app-please-select-gender")).typeError(a("lender-web-app-select-valid-gender")),state_id:m.f().required(a("lender-web-app-please-provide-state")).typeError("".concat(j," a valid state")),nearest_landmark:m.h().min(3).max(52).optional().nullable().typeError(u),marital_status_id:m.f().required(a("lender-web-app-select-marital-status")).typeError(a("lender-web-app-select-valid-marital-status")),lga_id:m.f().required(a("lender-web-app-select-a-local-government")).typeError(a("lender-web-app-select-valid-local-government"))}):m.g().shape({photo_url:m.h().optional().nullable(),email:m.h().email(s).required(s),address:m.h().min(3).max(100).required(l).typeError(l),country:m.h(),city:m.h().min(3).max(52).required(d).typeError(d),gender_id:m.f().required(a("lender-web-app-please-select-gender")).typeError(a("lender-web-app-select-valid-gender")),nearest_landmark:m.h().min(3).max(52).optional().typeError(u).nullable(),marital_status_id:m.f().required(a("lender-web-app-select-marital-status")).typeError(a("lender-web-app-select-valid-marital-status")),lga:m.h().required().nullable(),state:m.h().required().nullable()})),[T]);return Object(y.jsxs)("div",{className:"tab-pane fade show active",id:"profile",role:"tabpanel","aria-labelledby":"profile-tab",children:[Object(y.jsx)("div",{className:"tab-content__header",children:Object(y.jsx)("p",{children:a("lender-web-app-profile")})}),Object(y.jsx)("div",{className:"tab-content__main tab-content__profile",children:"loading"===g&&Object(y.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"25em"},children:Object(y.jsx)("div",{className:"spinner-border text-primary",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[a("lender-web-app-loading"),"..."]})})})||"error"===g&&Object(y.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"25em"},children:Object(y.jsx)("h3",{className:"text-black-50 text-center w-100",children:a("lender-web-app-loading-profile-again")})})||Object(y.jsx)("div",{className:"bottom",children:Object(y.jsx)(r.c,{initialValues:{...O,country:"Nigeria",bvn:"".concat(null===O||void 0===O||null===(e=O.bvn)||void 0===e?void 0:e.slice(0,3),"*****").concat(null===O||void 0===O||null===(t=O.bvn)||void 0===t?void 0:t.slice(-2)),state_id:M(T,null===O||void 0===O?void 0:O.state,"code_description"),lga_id:M(A,null===O||void 0===O?void 0:O.lga,"code_description"),nearest_landmark:""},validationSchema:D,validateOnBlur:!0,onSubmit:async e=>{const t=["email","address","city","gender_id","state_id","nearest_landmark","marital_status_id","lga_id"];try{const a=Object(o.a)(t,e);await v(a),b.a.success(h),C("updated")}catch(n){b.a.error(a("lender-web-app-error-updating-profile",(null===n||void 0===n?void 0:n.message)||n))}},children:Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(S,{photo_url:null===O||void 0===O?void 0:O.photo_url}),Object(y.jsx)(k,{updateProfile:N,setUpdateProfile:C,profile:O,lgaOptions:A,setLgaOptions:L})]})})})})]})}function k(e){let{profile:t,updateProfile:a,setUpdateProfile:o,lgaOptions:d,setLgaOptions:b}=e;const u=Object(c.a)(Object(n.useCallback)((e=>e.profileStatus),[])),[j,m]=Object(c.a)((e=>[e.verifyEmailStatus,e.postRequestVerifyUserEmail]),p.shallow),O=Object(f.a)((e=>e.slug)),v=Object(s.i)(),[w,_,C]=Object(i.a)((e=>[e.getOptionsByKey,e.fetchLgaOptionsFor,e.states]),p.shallow),{handleSubmit:k,values:S,dirty:E,submitCount:T,isValid:A}=Object(r.f)();Object(n.useMemo)((()=>{E&&T>=1&&o("")}),[S]);const L=Object(i.a)(Object(n.useCallback)((e=>"loading"===e.optionsStatus),[])),[M,D]=Object(f.a)((e=>[e.country,e.require_email_verification]),p.shallow);Object(n.useEffect)((()=>{(async()=>{if(await _(S.state_id),!S.state_id)return void b([]);const e=w("state"),t=null===e||void 0===e?void 0:e.find((e=>e.id===+S.state_id)),a=w("".concat(null===t||void 0===t?void 0:t.ref_code,"-lga"));b(null!==a&&void 0!==a?a:[])})()}),[S.state_id,_,w]);const{translate:F}=Object(x.useTranslation)();return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)(r.b,{onSubmit:k,children:[Object(y.jsx)(s.a,{when:E&&T<1,message:"Are you sure you want to abandon your unsubmitted changes?"}),Object(y.jsx)(g.s,{name:"first_name",label:F("lender-web-app-first-name"),disabled:!0}),Object(y.jsx)(g.s,{name:"last_name",label:F("lender-web-app-last-name"),disabled:!0}),Object(y.jsx)(g.s,{name:"phone_number",label:F("lender-web-app-phone-number"),type:"tel",inputProps:{maxLength:11,minLength:11},disabled:!0}),Object(y.jsx)(g.s,{name:"email",label:F("lender-web-app-email-address"),type:"email",rightIcon:D&&!t.email_verified?Object(y.jsx)("div",{className:"status-pill pending cursor-pointer",children:"Verify Email"}):t.email_verified?Object(y.jsx)("div",{className:"status-pill running",children:"Verified"}):null,onIconClick:()=>{t.email_verified||m()},loading:"sending-code"===j}),Object(y.jsxs)("div",{className:"row form-flex",children:[Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{name:"gender_id",label:F("lender-web-app-gender"),valueField:"id",keyField:"id",disabled:!!t.gender,labelField:"code_description",options:w("gender")})}),Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{name:"marital_status_id",label:F("lender-web-app-marital-status"),keyField:"id",valueField:"id",labelField:"code_description",options:w("marital-status")})})]}),"NGA"===M&&Object(y.jsx)(g.s,{name:"country",label:F("lender-web-app-country"),disabled:!0}),Object(y.jsx)(g.s,{name:"address",label:F("lender-web-app-street")}),Object(y.jsx)(g.s,{name:"city",label:"RWA"===M?"Sector":F("lender-web-app-city")}),C.length>0&&Object(y.jsxs)("div",{className:"row form-flex",children:[Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{name:"state_id",label:F("lender-web-app-state"),valueField:"id",keyField:"id",labelField:"code_description",options:C})}),Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{loading:L,name:"lga_id",label:F("lender-web-app-lga"),valueField:"id",keyField:"id",labelField:"code_description",options:d,disabled:!S.state_id})})]}),0===C.length&&Object(y.jsxs)("div",{className:"row form-flex",children:[Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.s,{name:"state",label:F("lender-web-app-province")||"Province"})}),Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.s,{name:"lga",label:F("lender-web-app-district")||"District"})})]}),"standard-life"!==O&&Object(y.jsx)(g.s,{name:"nearest_landmark",label:F("lender-web-app-nearest-landmark")}),"NGA"===M&&Object(y.jsx)(g.s,{name:"bvn",label:F("lender-web-app-id-number"),type:"tel",disabled:!0}),Object(y.jsxs)("div",{className:"d-flex ",children:[Object(y.jsx)(l.a,{isLoading:"updating"===u,isDisabled:!A||"updated"===a,type:"submit",className:"btn ".concat("updated"===a?"btn-outline-primary":"btn-primary"," "),children:F("updated"===a?"lender-web-app-saved":"lender-web-app-save-changes")}),"updated"===a&&Object(y.jsx)(l.a,{onClick:()=>{v.push("".concat(h.a.dashboard.index))},type:"button",className:"btn btn-primary ms-2",children:F("lender-web-app-return-dashboard")})]})]}),Object(y.jsx)(N,{show:"sent-code"===j||"verifying"===j||"resending-code"===j,onClose:()=>{},email:null===t||void 0===t?void 0:t.email})]})}function S(e){let{photo_url:t}=e;const a=Object(f.a)((e=>e.slug)),{translate:s}=Object(x.useTranslation)(),[i,o]=Object(c.a)((e=>[e.updateUserProfile,e.appName]),p.shallow),[d,m]=Object(n.useState)(t),[h,g]=Object(n.useState)("idle"),N=Object(n.useMemo)((()=>s("lender-web-app-profile-photo-updated")),[s]),{setFieldValue:C}=Object(r.f)(),k=Object(c.a)((e=>e.profile)),S=Object(n.useCallback)((async e=>{try{const a=await fetch(e),n=await a.blob();if(n.size/1e9>5)return void b.a.error(s("lender-web-app-upload-less-5"));const l=new FormData;l.set("file",n,"profile-picture.png");const c=new FileReader;c.onloadend=e=>{var t;m(null===(t=e.target)||void 0===t?void 0:t.result)},c.readAsDataURL(n);try{g("loading");const e=await Object(u.a)(Object(j.Pb)(o),"post",l);await i({photo_url:e.data.url}),C("photo_url",e.data.url),g("success"),b.a.success(N)}catch(t){g("error"),b.a.error((null===t||void 0===t?void 0:t.message)||s("lender-web-app-error-while-uploading"))}}catch(t){g("error"),b.a.error(s("lender-web-app-error-photo-message"))}}),[i,o,s]),[E]=Object(v.a)(Object(n.useCallback)((e=>[e.myLoans]),[]),p.shallow),T=Object(n.useMemo)((()=>(null===E||void 0===E?void 0:E.filter((e=>{var t,a,n,s,l,c;return(null===e||void 0===e||null===(t=e.status)||void 0===t||null===(a=t.status)||void 0===a?void 0:a.includes("PENDING"))||(null===e||void 0===e||null===(n=e.status)||void 0===n||null===(s=n.status)||void 0===s?void 0:s.includes("PAST DUE"))||(null===e||void 0===e||null===(l=e.status)||void 0===l||null===(c=l.status)||void 0===c?void 0:c.includes("RUNNING"))})).map((e=>e)))||[]),[E]),[A,L]=Object(n.useState)(!1),[M,D]=Object(n.useState)(!1),[F,I]=Object(n.useState)(null);return Object(y.jsxs)("div",{className:"top d-flex",children:[Object(y.jsxs)("div",{className:"profile-picture d-flex justify-content-center flex-column",children:[d?Object(y.jsx)("div",{className:"image-container",style:{opacity:"loading"===h?.6:1,filter:"blur(".concat("loading"===h?2:0,"px)")},children:Object(y.jsx)("img",{src:d,alt:"profile"})}):Object(y.jsx)("div",{className:"image-container emptyImageContainer",hidden:!0,children:Object(y.jsx)("img",{src:"/svgs/avatar.svg",alt:"profile"})}),Object(y.jsx)("p",{className:"subtext text-center",children:s("lender-web-app-max-5")})]}),Object(y.jsxs)("div",{className:"action-btn",children:["standard-life"===a&&("Failed"===(null===k||void 0===k?void 0:k.selfie_id_check)||"Pending"===(null===k||void 0===k?void 0:k.selfie_id_check))&&Object(y.jsx)(l.a,{className:"btn btn-primary",onClick:()=>D(!0),children:"Verify Smile ID"}),Object(y.jsx)(_.a,{description:"Smile ID",show:M,close:()=>{D(!1)},children:Object(y.jsxs)("div",{style:{padding:"40px 20px"},children:[Object(y.jsx)("p",{style:{marginTop:"20px",textAlign:"center"},children:"Please note that the only acceptable document is your Rwandan National ID"}),Object(y.jsx)(w.a,{field:{meta:{product:"doc_verification"},id:"photo_url"},callback:()=>{D(!1)}})]})}),"standard-life"!==a&&Object(y.jsx)(l.a,{isLoading:"loading"===h,className:"btn btn-primary custom-file-uploadbtn",onClick:()=>{L(!0)},...T&&T.length>0&&{isDisabled:!0,"data-toggle":"tooltip","data-placement":"top",title:"You cannot change your profile picture while you have an active loan"},children:s("lender-web-app-upload-picture")}),A&&Object(y.jsx)(O.a,{showWebCamModal:A,setShowWebCamModal:L,setCapturedImage:I,capturedImage:F,description:s("lender-web-app-take-a-picture"),handleSave:()=>{S(F),L(!1)}})]})]})}var E,T,A,L,M,D,F,I,R,P,q=a(90),U=a(233);function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},B.apply(this,arguments)}function V(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",B({xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"100%",height:"100%",viewBox:"0 0 647.63626 632.17383",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,E||(E=n.createElement("path",{d:"M687.3279,276.08691H512.81813a15.01828,15.01828,0,0,0-15,15v387.85l-2,.61005-42.81006,13.11a8.00676,8.00676,0,0,1-9.98974-5.31L315.678,271.39691a8.00313,8.00313,0,0,1,5.31006-9.99l65.97022-20.2,191.25-58.54,65.96972-20.2a7.98927,7.98927,0,0,1,9.99024,5.3l32.5498,106.32Z",transform:"translate(-276.18187 -133.91309)",fill:"#f2f2f2"})),T||(T=n.createElement("path",{d:"M725.408,274.08691l-39.23-128.14a16.99368,16.99368,0,0,0-21.23-11.28l-92.75,28.39L380.95827,221.60693l-92.75,28.4a17.0152,17.0152,0,0,0-11.28028,21.23l134.08008,437.93a17.02661,17.02661,0,0,0,16.26026,12.03,16.78926,16.78926,0,0,0,4.96972-.75l63.58008-19.46,2-.62v-2.09l-2,.61-64.16992,19.65a15.01489,15.01489,0,0,1-18.73-9.95l-134.06983-437.94a14.97935,14.97935,0,0,1,9.94971-18.73l92.75-28.4,191.24024-58.54,92.75-28.4a15.15551,15.15551,0,0,1,4.40966-.66,15.01461,15.01461,0,0,1,14.32032,10.61l39.0498,127.56.62012,2h2.08008Z",transform:"translate(-276.18187 -133.91309)",fill:"#3f3d56"})),A||(A=n.createElement("path",{d:"M398.86279,261.73389a9.0157,9.0157,0,0,1-8.61133-6.3667l-12.88037-42.07178a8.99884,8.99884,0,0,1,5.9712-11.24023l175.939-53.86377a9.00867,9.00867,0,0,1,11.24072,5.9707l12.88037,42.07227a9.01029,9.01029,0,0,1-5.9707,11.24072L401.49219,261.33887A8.976,8.976,0,0,1,398.86279,261.73389Z",transform:"translate(-276.18187 -133.91309)",fill:"currentColor"})),L||(L=n.createElement("circle",{cx:190.15351,cy:24.95465,r:20,fill:"currentColor"})),M||(M=n.createElement("circle",{cx:190.15351,cy:24.95465,r:12.66462,fill:"#fff"})),D||(D=n.createElement("path",{d:"M878.81836,716.08691h-338a8.50981,8.50981,0,0,1-8.5-8.5v-405a8.50951,8.50951,0,0,1,8.5-8.5h338a8.50982,8.50982,0,0,1,8.5,8.5v405A8.51013,8.51013,0,0,1,878.81836,716.08691Z",transform:"translate(-276.18187 -133.91309)",fill:"#e6e6e6"})),F||(F=n.createElement("path",{d:"M723.31813,274.08691h-210.5a17.02411,17.02411,0,0,0-17,17v407.8l2-.61v-407.19a15.01828,15.01828,0,0,1,15-15H723.93825Zm183.5,0h-394a17.02411,17.02411,0,0,0-17,17v458a17.0241,17.0241,0,0,0,17,17h394a17.0241,17.0241,0,0,0,17-17v-458A17.02411,17.02411,0,0,0,906.81813,274.08691Zm15,475a15.01828,15.01828,0,0,1-15,15h-394a15.01828,15.01828,0,0,1-15-15v-458a15.01828,15.01828,0,0,1,15-15h394a15.01828,15.01828,0,0,1,15,15Z",transform:"translate(-276.18187 -133.91309)",fill:"#3f3d56"})),I||(I=n.createElement("path",{d:"M801.81836,318.08691h-184a9.01015,9.01015,0,0,1-9-9v-44a9.01016,9.01016,0,0,1,9-9h184a9.01016,9.01016,0,0,1,9,9v44A9.01015,9.01015,0,0,1,801.81836,318.08691Z",transform:"translate(-276.18187 -133.91309)",fill:"currentColor"})),R||(R=n.createElement("circle",{cx:433.63626,cy:105.17383,r:20,fill:"currentColor"})),P||(P=n.createElement("circle",{cx:433.63626,cy:105.17383,r:12.18187,fill:"#fff"})))}const H=n.forwardRef(V);a.p;function Y(){const[e,t,a,s,l]=Object(c.a)((e=>[e.documentTypes,e.documents,e.fetchDocs,e.documentTypesStatus,e.documentsStatus]),p.shallow),{translate:i}=Object(x.useTranslation)();console.log(e,"==========documenttypes"),Object(n.useEffect)((()=>{a()}),[]);const r=Object(n.useCallback)((e=>{const a=null===t||void 0===t?void 0:t.find((t=>t.type_id===e));return[a,null===a||void 0===a?void 0:a.status]}),[t]);return Object(y.jsxs)("div",{className:"tab-pane fade h-100 show active ",id:"documents",role:"tabpanel","aria-labelledby":"documents-tab",children:[Object(y.jsx)("div",{className:"tab-content__header",children:Object(y.jsx)("p",{children:i("lender-web-app-documents")})}),"loading"===s||"loading"===l&&Object(y.jsx)("div",{className:"col-md-6 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(y.jsx)("div",{className:"spinner-border text-primary",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[i("lender-web-app-loading"),"..."]})})}),"loading"!==s&&"loading"!==l&&(0===t.length&&0===e.length?Object(y.jsx)("div",{className:"d-flex align-items-center justify-content-center",style:{height:"inherit"},children:Object(y.jsxs)("div",{className:"text-primary text-center mb-8",children:[Object(y.jsx)("div",{style:{width:"150px",height:"150px"},children:Object(y.jsx)(H,{})}),Object(y.jsx)("p",{className:"mt-4",children:i("lender-web-app-no-required-documents")})]})}):Object(y.jsx)(y.Fragment,{children:Object(y.jsx)("div",{className:"tab-content__main tab-content__security",children:Object(y.jsx)("div",{className:"card-btns",children:null===e||void 0===e?void 0:e.map((e=>{const[t,a]=r(e.id);return Object(y.jsx)(U.a,{status:null!==a&&void 0!==a?a:"",fileName:e.name,required:!(null===e||void 0===e||!e.required),options:e.options,currentDoc:null!==t&&void 0!==t?t:e,isStage:!0},e.id)}))})})}))]})}function W(){const{translate:e}=Object(x.useTranslation)(),t=e("lender-web-app-provide-valid-email"),a=e("lender-web-app-valid-street-address"),s=e("lender-web-app-provide-valid-name"),l=e("lender-web-app-provide-valid-city"),d=e("lender-web-app-provide-valid-landmark"),u=e("lender-web-app-nok-updated"),j=Object(i.a)((e=>e.states)),h=Object(n.useMemo)((()=>{if(j.length>0)return m.g().shape({first_name:m.h().min(3,s).max(52,s).required(s),last_name:m.h().min(3,s).max(52,s).required(s),phone_number:m.h().min(6).max(15).required(e("lender-web-app-phone-number-error")),relationship_id:m.f().required(e("lender-web-app-select-relationship")).typeError(e("lender-web-app-select-valid-relationship")),email:m.h().email(t).required(t),address:m.h().min(3,a).max(52,a).required(a),city:m.h().min(3,l).max(52,l).required(l),state_id:m.f().required(e("lender-web-app-select-valid-state")).typeError(e("lender-web-app-select-valid-state")),nearest_landmark:m.h().min(3,d).max(52,d).optional(),lga_id:m.f().required(e("lender-web-app-select-a-local-government")).typeError(e("lender-web-app-select-a-local-government"))});return m.g().shape({first_name:m.h().min(3,s).max(52,s).required(s),last_name:m.h().min(3,s).max(52,s).required(s),phone_number:m.h().min(6).max(15).required(e("lender-web-app-phone-number-error")),relationship_id:m.f().required(e("lender-web-app-select-relationship")).typeError(e("lender-web-app-select-valid-relationship")),email:m.h().email(t).required(t),address:m.h().min(3,a).max(52,a).required(a),city:m.h().min(3,l).max(52,l).required(l),state:m.h().required().nullable(),nearest_landmark:m.h().min(3,d).max(52,d).optional(),lga:m.h().required().nullable()})}),[e]),[O,v,f]=Object(c.a)((e=>[e.profile,e.updateNextOfKin,e.profileStatus]),p.shallow),[g,w]=Object(n.useState)(!1);return Object(y.jsxs)("div",{className:"tab-pane fade show active",id:"nextOfKin",role:"tabpanel","aria-labelledby":"nextOfKin-tab",children:[Object(y.jsx)("div",{className:"tab-content__header",children:Object(y.jsx)("p",{children:e("lender-web-app-next-of-kin")})}),Object(y.jsx)("div",{className:"tab-content__main",children:"loading"===f&&Object(y.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"25em"},children:Object(y.jsx)("div",{className:"spinner-border text-primary",role:"status",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[e("lender-web-app-loading"),"..."]})})})||"error"===f&&Object(y.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"25em"},children:Object(y.jsx)("h3",{className:"text-black-50",children:e("lender-web-app-problem-loading-profile")})})||Object(y.jsx)("div",{className:"bottom",children:Object(y.jsx)(r.c,{initialValues:{first_name:"",last_name:"",relationship_id:"",email:"",address:"",city:"",state_id:"",nearest_landmark:"",lga_id:"",country:"Nigeria",state:"",id:"",...null===O||void 0===O?void 0:O.kin},validationSchema:h,validateOnBlur:!0,onSubmit:async t=>{const a=j.length>0?["first_name","last_name","phone_number","email","address","city","state_id","nearest_landmark","lga_id","relationship_id"]:["first_name","last_name","phone_number","email","address","city","state","nearest_landmark","lga","relationship_id"];try{const e=Object(o.a)(a,t);e.relationship_id=+e.relationship_id,await v(e),b.a.success(u),w(!0)}catch(n){b.a.error(n.message||e("lender-web-app-error-updating-nok"))}},children:Object(y.jsx)(G,{setUpdatedNOK:w,updatedNOK:g})})})})]})}function G(e){var t;let{setUpdatedNOK:a,updatedNOK:d}=e;const{country:b}=f.a.getState(),u=Object(s.i)(),[j,m,O]=Object(c.a)((e=>[e.profile,e.profileStatus,e.nextOfKinStatus]),p.shallow),[v,w,_]=Object(i.a)((e=>[e.getOptionsByKey,e.fetchLgaOptionsFor,e.states]),p.shallow),N=Object(f.a)((e=>e.slug)),{handleSubmit:C,values:k,setValues:S,isValid:E,submitCount:T,dirty:A}=Object(r.f)();Object(n.useMemo)((()=>{A&&T>=1&&a(!1)}),[k]);const L=Object(i.a)((e=>"loading"===e.optionsStatus),p.shallow),[M,D]=Object(n.useState)((()=>{if(!k.state_id)return[];const e=v("state"),t=null===e||void 0===e?void 0:e.find((e=>e.id===+k.state_id)),a=v("".concat(null===t||void 0===t?void 0:t.ref_code,"-lga"));return null!==a&&void 0!==a?a:[]})),{translate:F}=Object(x.useTranslation)();Object(n.useEffect)((()=>{(async()=>{if(await w(k.state_id),!k.state_id)return void D([]);const e=v("state"),t=null===e||void 0===e?void 0:e.find((e=>e.id===+k.state_id)),a=v("".concat(null===t||void 0===t?void 0:t.ref_code,"-lga"));D(null!==a&&void 0!==a?a:[])})()}),[k.state_id,w,v]);const I=Object(n.useRef)(Object(o.a)(_.length>0?["address","city","state_id","nearest_landmark","lga_id"]:["address","city","state","nearest_landmark","lga"],k));return console.log(_,"==============="),Object(y.jsxs)(r.b,{onSubmit:C,children:[Object(y.jsx)(g.s,{name:"first_name",label:F("lender-web-app-first-name")}),Object(y.jsx)(g.s,{name:"last_name",label:F("lender-web-app-last-name")}),Object(y.jsx)(g.n,{tel:!0,name:"phone_number",label:F("lender-web-app-phone-number"),inputProps:{maxLength:11,minLength:11},singleValue:null===j||void 0===j||null===(t=j.kin)||void 0===t?void 0:t.phone_number}),Object(y.jsx)(g.s,{name:"email",label:F("lender-web-app-email-address"),type:"email"}),Object(y.jsx)(g.q,{name:"relationship_id",label:F("lender-web-app-relationship"),keyField:"id",valueField:"id",labelField:"code_description",options:v("relationship")}),Object(y.jsxs)("div",{className:"mb-3 form-check form-switch",children:[Object(y.jsx)("input",{className:"form-check-input",type:"checkbox",id:"switchCheck",onChange:e=>{if(e.target.checked){const e=_.length>0?["address","city","state_id","nearest_landmark","lga_id"]:["address","city","state","nearest_landmark","lga"];console.log(e,"----------------"),I.current=Object(o.a)(e,k),S((t=>({...t,...Object(o.a)(e,j)})))}else S((e=>({...e,...I.current})))}}),Object(y.jsx)("label",{className:"form-check-label",htmlFor:"switchCheck",children:F("lender-web-app-copy-address")})]}),Object(y.jsx)(g.s,{name:"address",label:F("lender-web-app-street")}),Object(y.jsx)(g.s,{name:"city",label:"RWA"===b?"Sector":F("lender-web-app-city")}),_.length>0&&Object(y.jsxs)("div",{className:"row form-flex",children:[Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{name:"state_id",label:F("lender-web-app-state"),keyField:"id",valueField:"id",labelField:"code_description",options:_})}),Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.q,{loading:L,name:"lga_id",label:F("lender-web-app-lga"),keyField:"id",valueField:"id",labelField:"code_description",options:M})})]}),0===_.length&&Object(y.jsxs)("div",{className:"row form-flex",children:[Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.s,{name:"state",label:F("lender-web-app-province")||"Province"})}),Object(y.jsx)("div",{className:"col-sm",children:Object(y.jsx)(g.s,{name:"lga",label:F("lender-web-app-district")||"District"})})]}),"standard-life"!==N&&Object(y.jsx)(g.s,{name:"nearest_landmark",label:F("lender-web-app-nearest-landmark")}),Object(y.jsxs)("div",{className:"d-flex",children:[Object(y.jsx)(l.a,{isLoading:"updating"===O||"refetching"===m,isDisabled:!E,type:"submit",className:"btn ".concat(d?"btn-outline-primary":"btn-primary"," "),children:F(d?"lender-web-app-saved":"lender-web-app-save-changes")}),d&&T>=1&&Object(y.jsx)(l.a,{onClick:()=>{u.push("".concat(h.a.dashboard.index))},type:"button",className:"btn btn-primary ms-2",children:F("lender-web-app-return-dashboard")})]})]})}function Z(){const{translate:e}=Object(x.useTranslation)();return Object(y.jsxs)("div",{className:"tab-pane fade show active",id:"security",role:"tabpanel","aria-labelledby":"security-tab",children:[Object(y.jsx)("div",{className:"tab-content__header",children:Object(y.jsx)("p",{children:e("lender-web-app-security")})}),Object(y.jsxs)("div",{className:"tab-content__main tab-content__security",children:[Object(y.jsxs)("div",{className:"security-detail-group row",children:[Object(y.jsxs)("div",{className:"security-detail col-sm-7",children:[Object(y.jsx)("h5",{className:"security-detail-title",children:e("lender-web-app-update-password")}),Object(y.jsx)("p",{className:"security-detail-value",children:e("lender-web-app-change-password")})]}),Object(y.jsx)("div",{className:"security-detail security-detail-button col-sm-5",children:Object(y.jsx)(K,{})})]}),Object(y.jsxs)("div",{className:"security-detail-group row",children:[Object(y.jsxs)("div",{className:"security-detail col-sm-7",children:[Object(y.jsx)("h5",{className:"security-detail-title",children:e("lender-web-app-update-pin")}),Object(y.jsx)("p",{className:"security-detail-value",children:e("lender-web-app-change-transaction-pin")})]}),Object(y.jsx)("div",{className:"security-detail security-detail-button col-sm-5",children:Object(y.jsx)(z,{})})]}),Object(y.jsxs)("div",{className:"security-detail-group row",children:[Object(y.jsxs)("div",{className:"security-detail col-sm-7",children:[Object(y.jsx)("h5",{className:"security-detail-title",children:e("lender-web-app-reset-pin")}),Object(y.jsx)("p",{className:"security-detail-value",children:e("lender-web-app-reset-transaction-pin")})]}),Object(y.jsx)("div",{className:"security-detail security-detail-button col-sm-5",children:Object(y.jsx)(J,{})})]})]})]})}function K(){const[e,t]=Object(n.useState)(!1),a=Object(n.useCallback)((()=>{t((e=>!e))}),[]),[s,c]=Object(n.useState)("idle"),{translate:i}=Object(x.useTranslation)(),o=i("lender-web-app-password-updated"),d=m.g().shape({old_password:m.h().min(8,i("lender-web-app-enter-valid-password")).max(256,i("lender-web-app-enter-valid-password")).required(i("lender-web-app-provide-old-password")),new_password:m.h().min(8,i("lender-web-app-enter-valid-password")).max(256,i("lender-web-app-enter-valid-password")).required(i("lender-web-app-password-must-match"))}),p=[{id:1,description:i("lender-web-app-8-more-characters"),regex:/.{8,}/,pass:!1},{id:2,description:i("lender-web-app-an-upper-case"),regex:/[A-Z]/,pass:!1},{id:3,description:i("lender-web-app-a-lower-case"),regex:/[a-z]/,pass:!1},{id:4,description:i("lender-web-app-a-symbol"),regex:/[(=!@#$%)]/,pass:!1}];return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(_.a,{show:e,close:a,description:i("lender-web-app-change-password"),isUpload:!1,children:Object(y.jsx)("div",{className:"modal-body",children:Object(y.jsx)(r.c,{initialValues:{old_password:"",new_password:""},validationSchema:d,validateOnBlur:!0,onSubmit:async e=>{try{c("loading"),await Object(u.a)(j.lb,"post",e),b.a.success(o),c("success"),a()}catch(t){c("error"),b.a.error(null===t||void 0===t?void 0:t.message)}},children:e=>{const t=p.map((t=>{const a=e.values.new_password;return t.regex.test(a)?{...t,pass:!0}:{...t,pass:!1}})),a=t.every((e=>e.pass));return Object(y.jsxs)(r.b,{onSubmit:e.handleSubmit,className:"modal-form",children:[Object(y.jsx)(g.s,{type:"text",name:"old_password",isToggleAble:!0,label:i("lender-web-app-old-password")}),Object(y.jsx)(g.s,{type:"text",name:"new_password",isToggleAble:!0,label:i("lender-web-app-new-password")}),Object(y.jsx)("ul",{className:"bg-light-blue list-unstyled p-2 px-4 rounded-3",children:t.map((e=>Object(y.jsxs)("li",{className:"d-flex my-2 align-items-center",children:[e.pass?Object(y.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(y.jsx)("path",{d:"M6 0C2.68468 0 0 2.68468 0 6C0 9.31531 2.68468 12 6 12C9.31531 12 12 9.31531 12 6C12 2.68468 9.31531 0 6 0ZM9.54955 4.9009L5.65766 8.79279C5.36937 9.08108 4.9009 9.08108 4.61261 8.79279L4.34234 8.52252L2.5045 6.68468C2.21622 6.3964 2.21622 5.92793 2.5045 5.63964L2.77477 5.36937C3.06306 5.08108 3.53153 5.08108 3.81982 5.36937L5.13513 6.68468L8.23423 3.58558C8.52252 3.2973 8.99099 3.2973 9.27928 3.58558L9.54955 3.85585C9.83784 4.14414 9.83784 4.61261 9.54955 4.9009Z",fill:"#27AE60"})}):Object(y.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(y.jsx)("circle",{opacity:"0.2",cx:"6",cy:"6",r:"6",fill:"#112945"})}),Object(y.jsx)("span",{className:"ms-2",children:e.description})]},e.id)))}),Object(y.jsx)("div",{style:{padding:0,height:"auto"},className:"modal-footer ",children:Object(y.jsx)(l.a,{isDisabled:!a,isLoading:"loading"===s,type:"submit",style:{height:"auto"},className:"btn btn-primary btn-lg px-5 mt-3",children:i("lender-web-app-change")})})]})}})})},i("lender-web-app-change-password")),Object(y.jsx)("button",{onClick:a,className:"btn btn-outline-primary securityBtn",type:"button","data-bs-toggle":"modal","data-bs-target":"#changePassword",children:i("lender-web-app-change-password")})]})}function z(){const{translate:e}=Object(x.useTranslation)(),[t,a]=Object(n.useState)(!1),s=Object(n.useCallback)((()=>{a((e=>!e))}),[]),[c,i]=Object(n.useState)("idle"),o=e("lender-web-app-pin-updated"),d=m.g().shape({old_pin:m.h().matches(/^\d+$/,e("lender-web-app-old-pin-number")).min(4,e("lender-web-app-please-valid-pin")).max(4,e("lender-web-app-please-valid-pin")).required(e("lender-web-app-enter-old-pin")),new_pin:m.h().matches(/^\d+$/,e("lender-web-app-old-pin-number")).min(4,e("lender-web-app-please-valid-pin")).max(4,e("lender-web-app-please-valid-pin")).required(e("lender-web-app-enter-new-pin"))}),p=Object(r.e)({initialValues:{old_pin:"",new_pin:""},validationSchema:d,validateOnBlur:!1,onSubmit:async e=>{try{i("loading"),await Object(u.a)(j.Cb,"post",e),b.a.success(o),i("success"),s()}catch(t){i("error"),b.a.error(null===t||void 0===t?void 0:t.message)}}});return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(_.a,{show:t,close:s,description:e("lender-web-app-change-pin"),isUpload:!1,children:Object(y.jsx)("div",{className:"modal-body",children:Object(y.jsxs)("form",{onSubmit:p.handleSubmit,children:[Object(y.jsxs)("p",{className:"mb-1",children:[e("lender-web-app-old-pin")," "]}),Object(y.jsx)(g.o,{onChange:e=>{p.setFieldValue("old_pin",e,!0)},error:p.errors.old_pin,password:!0,autofocus:!1},"old_pin"),Object(y.jsx)("div",{className:"",children:p.errors.old_pin&&Object(y.jsx)("p",{className:"text-danger",children:p.errors.old_pin})}),Object(y.jsxs)("p",{className:"mb-1 mt-3",children:[e("lender-web-app-new-pin")," "]}),Object(y.jsx)(g.o,{onChange:e=>{p.setFieldValue("new_pin",e,!0)},error:p.errors.new_pin,autofocus:!1,password:!0},"new_pin"),Object(y.jsx)("div",{className:"",children:p.errors.new_pin&&Object(y.jsx)("p",{className:"text-danger",children:p.errors.new_pin})}),Object(y.jsx)("div",{style:{padding:0,height:"auto"},className:"modal-footer ",children:Object(y.jsx)(l.a,{isLoading:"loading"===c,type:"submit",style:{height:"auto"},className:"btn btn-primary btn-lg px-5 mt-3",children:e("lender-web-app-change")})})]})})},e("lender-web-app-change-pin")),Object(y.jsx)("button",{onClick:s,className:"btn btn-outline-primary",type:"button","data-bs-toggle":"modal","data-bs-target":"#changePassword",children:e("lender-web-app-change-pin")})]})}function J(){const{translate:e}=Object(x.useTranslation)(),t=e("lender-web-app-pin-updated"),a=m.g().shape({otp:m.h().matches(/^\d+$/,e("lender-web-app-otp-must-number")).min(6,e("lender-web-app-enter-valid-otp")).max(6,e("lender-web-app-enter-valid-otp")).required(e("lender-web-app-enter-your-otp")),new_pin:m.h().matches(/^\d+$/,e("lender-web-app-otp-must-number")).min(4,e("lender-web-app-please-valid-pin")).max(4,e("lender-web-app-please-valid-pin")).required(e("lender-web-app-please-enter-your-pin"))}),[s,c]=Object(n.useState)(!1),[i,o]=Object(n.useState)("idle"),d=Object(r.e)({initialValues:{otp:"",new_pin:""},validationSchema:a,validateOnBlur:!1,onSubmit:async e=>{try{o("loading"),await Object(u.a)(j.Db,"post",e),b.a.success(t),o("success"),c(!1)}catch(a){o("error"),b.a.error(null===a||void 0===a?void 0:a.message)}}});return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(_.a,{show:s,close:()=>c(!1),description:e("lender-web-app-change-pin"),isUpload:!1,children:Object(y.jsx)("div",{className:"modal-body",children:Object(y.jsxs)("form",{onSubmit:d.handleSubmit,children:[Object(y.jsx)("p",{className:"mb-1",children:e("lender-web-app-enter-otp")}),Object(y.jsx)(g.o,{length:6,onChange:e=>{d.setFieldValue("otp",e,!0)},error:d.errors.otp,password:!0}),Object(y.jsx)("div",{className:"",children:d.errors.otp&&Object(y.jsx)("p",{className:"text-danger",children:d.errors.otp})}),Object(y.jsx)("p",{className:"mb-1 mt-3",children:e("lender-web-app-new-pin")}),Object(y.jsx)(g.o,{onChange:e=>{d.setFieldValue("new_pin",e,!0)},error:d.errors.new_pin,autofocus:!1,password:!0}),Object(y.jsx)("div",{className:"",children:d.errors.new_pin&&Object(y.jsx)("p",{className:"text-danger",children:d.errors.new_pin})}),Object(y.jsx)("div",{style:{padding:0,height:"auto"},className:"modal-footer ",children:Object(y.jsx)(l.a,{isLoading:"loading"===i,type:"submit",style:{height:"auto"},className:"btn btn-primary btn-lg px-5 mt-3",children:e("lender-web-app-change")})})]})})},e("lender-web-app-change-pin")),Object(y.jsx)(l.a,{isLoading:"loading"===i,onClick:async()=>{try{o("loading"),await Object(u.a)(j.Eb,"post"),o("success"),c(!0)}catch(e){o("error"),b.a.error(null===e||void 0===e?void 0:e.message)}},className:"btn btn-outline-primary",type:"button","data-bs-toggle":"modal","data-bs-target":"#changePassword",children:e("lender-web-app-reset-pin")})]})}var Q=a(20),X=a(3),$=a(45),ee=a(29),te=a(18);var ae=()=>{const[e,t,a,s,l]=Object(c.a)((e=>[e.referrals,e.fetchReferralActivities,e.referralStatus,e.wallet,e.fetchWallet]),p.shallow),i=Object($.a)((e=>e.user)),{dictionary:r}=Object(n.useContext)(ee.a),{translate:o}=Object(x.useTranslation)();return Object(n.useEffect)((()=>{null!==s&&void 0!==s&&s.currency||l()}),[s]),Object(n.useEffect)((()=>{t()}),[]),"loading"===a?Object(y.jsx)("div",{className:"col-md-6 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(y.jsx)("div",{className:"spinner-border text-primary",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[o("lender-web-app-loading"),"..."]})})}):"error"===a?Object(y.jsx)("div",{className:"col-md-6 col-xl-4 d-flex justify-content-center align-items-center",children:Object(y.jsx)("p",{className:"text-center",children:o("lender-web-app-error-fetching-activities")})}):Object(y.jsxs)("div",{className:" rounded-3",children:[Object(y.jsxs)("h5",{children:[null===r||void 0===r?void 0:r.settings_referral_title," "]}),Object(y.jsx)("p",{style:{maxWidth:"355px"},children:null===r||void 0===r?void 0:r.settings_referral_sub_title}),Object(y.jsxs)("div",{className:" rounded-3 p-3 d-flex mt-35 justify-content-between bg-light-primary",children:[Object(y.jsxs)("div",{children:[Object(y.jsx)("h6",{className:"text-small",children:o("lender-web-app-total-signups")}),Object(y.jsx)("p",{className:"fw-bold",children:e.length})]}),Object(y.jsxs)("div",{children:[Object(y.jsx)("h6",{className:"text-small",children:o("lender-web-app-total-earnings")}),Object(y.jsx)("p",{className:"fw-bold",children:Object(X.q)(e.reduce(((e,t)=>t.earning+e),0),null===s||void 0===s?void 0:s.currency)})]})]}),Object(y.jsxs)("div",{style:{minHeight:"280px"},className:"rounded-3 p-3 mt-35 bg-light-primary",children:[Object(y.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(y.jsx)("h6",{children:o("lender-web-app-activities")}),e.length>0&&Object(y.jsx)(Q.b,{className:" text-small text-black text-decoration-underline",to:{pathname:h.a.settings.referral.details},children:o("lender-web-app-view-more")})]}),e.length>0?Object(y.jsx)("div",{children:e.slice(0,3).map((e=>{let{user:t,created_on:a,description:n}=e;return Object(y.jsxs)("div",{className:"d-flex justify-content-between mt-4",children:[Object(y.jsx)("p",{style:{maxWidth:"300px"},className:"small",children:n}),Object(y.jsx)("p",{className:"small",children:Object(X.v)(a)})]},t.id)}))}):Object(y.jsxs)("div",{className:"mx-auto p-35 d-flex align-items-center flex-column",children:[Object(y.jsx)("img",{style:{maxWidth:"100%"},src:"/images/download-icons.png",alt:""}),Object(y.jsx)("p",{style:{maxWidth:"250px"},className:"text-center mt-3",children:o("lender-web-app-friends-yet-link")})]})]}),Object(y.jsxs)("div",{className:"referral-row overflow-hidden  mt-35 border border-primary rounded-3",children:[Object(y.jsx)("p",{className:" p-3",children:null===i||void 0===i?void 0:i.referral_code}),Object(y.jsxs)("div",{className:"referral-button-row",children:[Object(y.jsxs)("button",{onClick:()=>Object(te.d)(null===i||void 0===i?void 0:i.referral_code),className:"py-3 border-0  px-3 btn-primary btn text-white rounded-bottom-3",style:{borderRadius:0},children:[Object(y.jsx)("svg",{className:"me-3 ",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(y.jsx)("path",{d:"M16.3138 3.95284H14.0111V1.50949L13.2318 0.730177L13.1251 0.588379H1.50704L1.4004 0.730177L0.727736 1.40284L0.585938 1.50948V13.1264L0.727736 13.233L1.50705 14.0123H3.95157V16.492L4.09336 16.5986L4.87267 17.378H16.4896L17.3755 16.492V4.87513L16.5962 4.09582L16.4896 3.95402H16.3126L16.3138 3.95284ZM13.2319 3.95284H4.87303L4.76639 4.09463L4.09373 4.76729L3.95193 4.87394V13.2328H1.82733L1.40193 12.7723V1.82828L1.82733 1.40288H12.7713L13.2319 1.82828L13.2319 3.95284ZM5.19163 4.76728H16.1722L16.5976 5.19268V16.1733L16.1722 16.5987H5.19163L4.76623 16.1733V5.19268L5.19163 4.76728Z",fill:"#fff"})}),o("lender-web-app-copy-code")]}),Object(y.jsxs)("button",{onClick:async()=>{try{await Object(te.c)({title:"".concat((null===r||void 0===r?void 0:r.settings_referral_title)||"Referral Link"),text:"".concat((null===r||void 0===r?void 0:r.settings_referral_sub_title)||""),url:"https://".concat(window.location.host,"/signup?referral_code=").concat(null===i||void 0===i?void 0:i.referral_code)})}catch(e){console.log("Error: ".concat(e),{id:"referral_link_share"})}},className:"py-2 bg-transparent border-0 px-3 text-primary rounded-bottom-3",children:[Object(y.jsx)("div",{className:"me-3 d-inline-flex align-items-center justify-content-center rounded-circle bg-light-primary",style:{width:"40px",height:"40px"},children:Object(y.jsx)("svg",{width:"13",height:"13",children:Object(y.jsx)("use",{xlinkHref:"/icon-sprite.svg#share-icon"})})}),o("lender-web-app-share-link")]})]})]})]})};var ne,se,le=()=>{const[e,t,a]=Object(c.a)((e=>[e.referrals,e.fetchReferralActivities,e.referralStatus]),p.shallow),{translate:s}=Object(x.useTranslation)(),[l,i]=Object(n.useState)("Sign ups");Object(n.useEffect)((()=>{t()}),[t]);const r=null===e||void 0===e?void 0:e.filter((e=>"SIGN_UP"===e.activity)),o=null===e||void 0===e?void 0:e.filter((e=>"SIGN_UP"!==e.activity));return"loading"===a?Object(y.jsx)("div",{className:"col-md-6 h-100 w-100 col-xl-4 d-flex justify-content-center align-items-center",children:Object(y.jsx)("div",{className:"spinner-border text-primary",children:Object(y.jsxs)("span",{className:"visually-hidden",children:[s("lender-web-app-loading"),"..."]})})}):"error"===a?Object(y.jsx)("div",{className:"col-md-6 col-xl-4 d-flex justify-content-center align-items-center",children:Object(y.jsx)("p",{className:"text-center",children:s("lender-web-app-error-fetching-activities")})}):Object(y.jsxs)("div",{className:"rounded-3 ",children:[Object(y.jsx)("h5",{children:s("lender-web-app-referral-activities")}),Object(y.jsx)("div",{className:"mt-3 border-bottom px-6 d-flex justify-content-between border-primary p-0",children:["Sign ups","Referal activities"].map((e=>Object(y.jsx)("button",{onClick:()=>i(e),style:{borderBottomWidth:e===l?"1px":0},className:"border-top-0 text-primary fw-bold px-4 py-2 bg-white border-end-0 border-start-0 border-bottom-1 border-primary  ",children:e},e)))}),Object(y.jsx)("div",{className:"mt-6",children:"Sign ups"===l?r.map((e=>{let{user:t,created_on:a,description:n}=e;return Object(y.jsxs)("div",{style:{background:"#E9F6FD"},className:"d-flex p-3 rounded-3 justify-content-between mt-4",children:[Object(y.jsx)("p",{style:{maxWidth:"300px"},className:"small",children:n}),Object(y.jsx)("p",{className:"small",children:Object(X.v)(a)})]},null===t||void 0===t?void 0:t.id)})):o.map((e=>{let{user:t,created_on:a,description:n}=e;return Object(y.jsxs)("div",{style:{background:"#E9F6FD"},className:"d-flex p-3 rounded-3 justify-content-between mt-4",children:[Object(y.jsx)("p",{style:{maxWidth:"300px"},className:"small",children:n}),Object(y.jsx)("p",{className:"small",children:Object(X.v)(a)})]},null===t||void 0===t?void 0:t.id)}))})]})};function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ce.apply(this,arguments)}function ie(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",ce({width:41,height:38,viewBox:"0 0 41 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,ne||(ne=n.createElement("rect",{x:.0419922,y:.0214844,width:40.2264,height:37.7586,fill:"url(#pattern0)"})),se||(se=n.createElement("defs",null,n.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},n.createElement("use",{xlinkHref:"#image0_1655_1901",transform:"matrix(0.00769231 0 0 0.00819504 0 -0.0326778)"})),n.createElement("image",{id:"image0_1655_1901",width:130,height:130,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAACCCAYAAACKAxD9AAAACXBIWXMAABcRAAAXEQHKJvM/AAAJU0lEQVR4nO2dXWhcRRTHZ3eTtNt0u0lbWm+xdCs+qC0kBYsoxWzBl4LiFt/8wBREH/zaKsKCQlNF2BchBfvmR/Kg+FJIFPRJTV76UoUEKpUKbdZa15akzWap2+ZjV2Z7FreZO3fvx9y5M/eeHywbdnaTmzv/PXPmzMw5sUajQRAkHvk7gDRBISBNUAhIExQC0qQrrLfBKFSzhJAMPAYJIX3w8x7mzXymoWWGELJICJkihMyVi6k57ic0JRSzBqNQpZ2cbXsMMG8SSwVE0XyUi6kZ2f+zaLQVglGo0m/5MJHT8Z1oCWOCPsrF1GKH9yuHVkIwClVq2vOEkJxDEy+bSRDEmMLXeA9aCMEoVIfh2z/ENKoNtRRUDKOq+xXKCgHG/WGwACp/++0yTkVRLqamVLw45YQAAsjDI828QX/oTGRENUEoJQQYAkZCYgE6MQ6CUGLIUEIIMAMY1dAH8EoF/IeRoC8kUCHAMEBvwttMY7QoUX8oyOEiMCFA5G8sIsOAXU7BcCE9DhHIWoNRqFIr8DOKgIFaxikYKqUi1SLAUDARQV/AKdR3yMsMSEkTAqh8KqRTQr8YLxdTwzL+kBQhwLRwFEXgChp3yPntN/guBBDBl0wD4oRZurjmpxh8dRbBKUQReGfAbyfSN4tgFKrU0XmZaUC8UAHLIHz/gy8WASwBikA8abAMGdG/WbhFQJ9ACsJ9BqEWAUUgjZbP0CfqDwoTAjgyKAJ5DECIXghChgZQ5lwU4gT7dsVJemOMef18uU6WaoGs25wUsXopSggzCmwgFcqWZIw8s7+r9tjexI1H9yRW926L214XWVkjtb8W69fpz5fm6/G5hXr9Qrm+4/JCPXnlZoNcuVlnPuORo+ViasLLr/AsBKNQHQ3TMvILB7trrxzqWXpoZ3wn0yiAz88ulz749o7oxTY6rRz0ssnF0wEXWEoOhQjeP7Kh8tqhnp7uBEkS0nzoRBr8hazba3btLLatJGrNEw8kyO8nNlfeGOpJgwh0ZQjiN3KFEIZFpE+e2zh/5tVNJJ2MhcXJPeE22ORqaIAhQdvIIXUEf3xr0437++PbmUb9cTVEuLUI2pzgWU+bCLYyjeFgCAJ7jnAsBBiHtN1iFnIRtBh1GnV0JIS2wydaQn2CCIiAgO/mqJ+cWgRtTx/R2cHzB7vD6BPwyDuxCraFoLM1oH7BFy8lK0xDuHFkFZxYBG2twZvZnkqIpohOsG0VbAlBd2tAI4ZMQzSwbRXsWoScrtaALhxpHjH0iq2ppF0hBH5I0y3vPLXhlp5XLow9duIKHYUAUUQt4wa7++NkVzoWpZkCj45CsBNilnLSxg+efDBRk7WSuHS7cXPhVmOJaVjHxWv1zcyL/kOjjRmrZWo7Qsgxr2jCkf1d89Qw+HW1lVqj8tH3d3q+O7+aXKo1+gkh/cyb1CEHC4WmWArBKFS1dRIp+4yEb7OFT6eXKx//cEenezNsJYROPoK21oBy35aYL7uMvj63Mq+ZCCgDVkvUoRUCjR/4AR0O3j1zW1cHlNufXCHA9nRth4X9Bvdf88Tp6WXhO08lwt2nYHW3uB+KMj9dXFXZIewEt09RCA757W+dDQJJ805UoxAc8M9S45o2F8vHtF9NhQDeJWY3WUdtpXGbeVE/HFkE0zcjocC0b1EI0cP0aCIKIYKYOYw8IQg7d48oCdO/PCEwikFCBdO/PCHgjCHcdLYIItOxIMrC9DEjBDOzgYQOpo/NhIBEEBQC0gSFgDSx3KqmAp+9mLzwiBHf5PRSkt2xjYQQoTuUdvfHt599r7fENDjg9NTyjq/OrSh3zkJ5ITy+N7G8tTf2MNMQAF1x0rt3W7zXy1++vKDmMjYODZKh6fVUBIUgEZp/0Ycci0JAIUiklYRTRRghqFq7OAz8UlpTxSdj+pgRAuIff1yvO579yIInhKhlF5HCr3+uqbIDmqnzwBOC8FIxyN0M7orA9C9PCNxTs4g76GnpgNL4m8H0LwpBEterjX9VuRaz4/E8ITBeJeKN6T9WVxW5hdPMKxZCYBSDeIMW7lDkFpr2rakQwHR4WlxB7mXm6poqC02m1t5UCADjWSLuUejMpGm/WgnBVDmIcxQ6M1nhVZFFIUjg6mJ9WZFL4fapZXEvo1CdCzq1Hq+8XufPJciHT29gXvcC/Wa//k3N8WYXnyq7ueFYuZgyrbXRaRFkIujiXSrlI6Cnoc9eWmNe1whuDS6roYFYmRJEO2ataklbCgGKSuI0MhxwU+sRm8vQXHOCaIVlP9oRgqlzgWjFpNWwYEsIMO80jU8j2mA5LNgSAoBWQV9KdrYf2hICzD3RadQTW7U2nOxZ7GheEOWo8AJIXoQwhnsZtcP2l9e2EMDrRKugDxVfhEDuimEEfQVtyHeaMrbj5lyDtoW+IkTJrm/QwrEQ4A9gXEFt/K8WD2hbKDwCTLo5tuhKCBBtPMk0IEFTcVuVz/XZR3AcZ5kGJEiGnTiIQoQAaFsTMoRMwrYBV3gSAgwRx5kGRDYlr19Kz8fiy8UUDVqMMw2ILKhfkHM7JLQQlR8hj/5CYOR5W9SdIEQIoMYcrkVI55TTwBEPYRlT4JhcFsUgjfFyMSUsniM0dQ6YKJxJ+A/dkSz0PgvPoQRTmGNMAyKKWV7JPi/4kkwLxi0Ug3iaIvA6QzDDt6xqKAbh+CYC4nd6PRDDYXQgPTPupwiIjDyLsBKGswn30NmB6zUEu0hJuAmziQwGnRxzTPTsgIe0zKtU0eViitYSOsU0IuuhawcHRAWL7CA9BS8EQY7iUMFlkhbfEhE2dkIguZgh1jCIW97ugX4xjpeLKc8LSG4ILCk3DUmXi6ksTDGjbh1aViCw4wKBZ2eHcTAT0aVs6gscBStgmv9QFkqk6QdHknrHByIyXFALeLJcTGW87CoSiVL1GqiDBMPF4ZAKogKbfjOw51MZlKzy1gpCGYVqFg7UDDFv0ovW8bPRIBxBOyhd7q9NEBnYBTWsWSV7atXGZMYD3KJ83Ufy/6YXKoS8UajmQBDPMm9UgxKcHB8L2gF0ghZCaAecqwmjUO2DNYwcPAeZGHQaklVNyQ4EiUI7IbSAsXailS3MKFQHIUiVhecB5kNiqEBi6yl4zKg67jvBMgVvCBiEGAV97oPnFjwHtNRW02AROr31PGNWGCsMhF0IiE2w7iPSBIWANEEhIIQQQv4D8wEO4mJgh1EAAAAASUVORK5CYII="}))))}const re=n.forwardRef(ie);var oe,de;a.p;function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},be.apply(this,arguments)}function ue(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",be({width:38,height:35,viewBox:"0 0 38 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,oe||(oe=n.createElement("g",{clipPath:"url(#clip0_1655_1887)"},n.createElement("path",{d:"M2.33945 3.27772C-0.601776 6.05156 0.000193238 8.99815 0.000193238 17.9498C0.000193238 25.3835 -1.42831 32.8357 6.04796 34.59C8.38254 35.1352 29.0678 35.1352 31.3993 34.5872C34.5121 33.858 37.0447 31.5656 37.3909 27.5683C37.4393 27.0104 37.4393 8.89904 37.3893 8.32983C37.0213 4.07207 34.1347 1.61822 30.331 1.12123C29.4593 1.00653 29.2846 0.972552 24.8119 0.965472C8.94708 0.972552 5.46938 0.331126 2.33945 3.27772Z",fill:"url(#paint0_linear_1655_1887)"}),n.createElement("path",{d:"M18.7109 5.41006C13.0484 5.41006 7.67121 4.95271 5.61734 9.73861C4.76897 11.7153 4.89217 14.2824 4.89217 17.9582C4.89217 21.1837 4.77832 24.2153 5.61734 26.1764C7.66653 30.9651 13.0874 30.5063 18.7078 30.5063C24.1302 30.5063 29.7211 31.0189 31.7999 26.1764C32.6498 24.1799 32.5251 21.651 32.5251 17.9582C32.5251 13.0562 32.8229 9.89154 30.2045 7.51557C27.5534 5.10846 23.968 5.41006 18.7047 5.41006H18.7109ZM17.4727 7.67133C29.2844 7.65434 30.7878 6.46211 29.9581 23.0245C29.6634 28.8822 24.7509 28.2394 18.7125 28.2394C7.7024 28.2394 7.38582 27.9534 7.38582 17.9525C7.38582 7.83558 8.25914 7.67699 17.4727 7.6685V7.67133ZM26.0874 9.75419C25.172 9.75419 24.4297 10.4282 24.4297 11.2593C24.4297 12.0905 25.172 12.7645 26.0874 12.7645C27.0028 12.7645 27.7452 12.0905 27.7452 11.2593C27.7452 10.4282 27.0028 9.75419 26.0874 9.75419ZM18.7109 11.5142C14.7919 11.5142 11.6152 14.3999 11.6152 17.9582C11.6152 21.5165 14.7919 24.4008 18.7109 24.4008C22.63 24.4008 25.8051 21.5165 25.8051 17.9582C25.8051 14.3999 22.63 11.5142 18.7109 11.5142ZM18.7109 13.7755C24.8008 13.7755 24.8086 22.1409 18.7109 22.1409C12.6226 22.1409 12.6133 13.7755 18.7109 13.7755Z",fill:"white"}))),de||(de=n.createElement("defs",null,n.createElement("linearGradient",{id:"paint0_linear_1655_1887",x1:2.41122,y1:32.7777,x2:34.2882,y2:2.39146,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:"#FFDD55"}),n.createElement("stop",{offset:.5,stopColor:"#FF543E"}),n.createElement("stop",{offset:1,stopColor:"#C837AB"})),n.createElement("clipPath",{id:"clip0_1655_1887"},n.createElement("rect",{width:37.4281,height:33.9828,fill:"white",transform:"translate(0 0.965332)"})))))}const je=n.forwardRef(ue);var pe;a.p;function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},me.apply(this,arguments)}function he(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",me({width:42,height:38,viewBox:"0 0 42 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,pe||(pe=n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.8777 10.6979C38.0172 11.6699 38.0934 12.6301 35.7836 12.8203C34.348 12.9383 32.9416 12.841 31.5222 12.6079C29.2399 12.2333 28.8992 11.3292 28.7776 10.3793C28.1482 5.46617 13.374 5.46617 12.7449 10.3793C12.6232 11.3292 12.2826 12.2318 10.0003 12.6079C8.58095 12.841 7.17622 12.9383 5.73893 12.8203C3.42906 12.6301 3.50368 11.6713 3.64478 10.6979C5.07547 0.786251 36.4451 0.786251 37.8761 10.6979H37.8777ZM23.0127 13.0445V11.2466C23.0127 8.91613 26.5018 8.91613 26.5018 11.2466V13.1419C26.8133 13.1537 27.1263 13.1684 27.4394 13.1817C29.4005 13.3572 30.7939 13.7023 31.3844 14.3764C34.0657 18.0549 37.1008 22.1007 38.9711 26.5181C39.3912 27.4281 39.5113 28.2792 39.4237 29.083C28.9579 30.3367 11.2688 30.3928 2.10737 29.1199C2.01167 28.3042 2.12846 27.4414 2.55506 26.5181C4.42534 22.1007 7.46009 18.0549 10.1418 14.3764C10.7323 13.7024 12.1256 13.3572 14.0868 13.1817C14.3982 13.1669 14.7113 13.1537 15.0227 13.1419V11.2466C15.0227 8.91616 18.5118 8.91616 18.5118 11.2466V13.0445C19.2629 13.0327 20.0123 13.0268 20.7633 13.0268C21.5127 13.0268 22.2621 13.0327 23.0132 13.0445L23.0127 13.0445ZM4.30039 33.3473C3.57855 32.4653 2.8989 31.5361 2.48688 30.5361C8.91382 31.3768 15.5608 31.4461 22.038 31.3842C27.7088 31.3311 33.4302 31.1275 39.0619 30.4845C38.6499 31.5051 37.9605 32.4506 37.2273 33.3473C28.416 34.8488 11.6956 34.9078 4.30197 33.3473H4.30039ZM20.7633 16.0123C25.1899 16.0123 28.7798 18.4327 28.7798 21.4179C28.7798 24.403 25.1901 26.8234 20.7633 26.8234C16.3364 26.8234 12.7467 24.403 12.7467 21.4179C12.7467 18.4327 16.3364 16.0123 20.7633 16.0123Z",fill:"#213F7D"})))}const Oe=n.forwardRef(he);var ve,xe;a.p;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},fe.apply(this,arguments)}function ge(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",fe({width:43,height:38,viewBox:"0 0 43 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,ve||(ve=n.createElement("g",{clipPath:"url(#clip0_1655_1935)"},n.createElement("path",{d:"M21.6115 37.7586C33.0267 37.7586 42.2806 29.3061 42.2806 18.8793C42.2806 8.45256 33.0267 0 21.6115 0C10.1963 0 0.942383 8.45256 0.942383 18.8793C0.942383 29.3061 10.1963 37.7586 21.6115 37.7586Z",fill:"#1DA1F2"}),n.createElement("path",{d:"M17.8291 28.8383C26.9958 28.8383 32.0081 21.9002 32.0081 15.8871C32.0081 15.6889 32.0081 15.4907 31.9978 15.3019C32.9692 14.66 33.8167 13.8576 34.4884 12.942C33.5996 13.3007 32.6385 13.5461 31.6257 13.6594C32.6592 13.093 33.4446 12.2057 33.8167 11.139C32.8555 11.6582 31.7911 12.0357 30.6543 12.2434C29.7448 11.3561 28.453 10.8086 27.0165 10.8086C24.2675 10.8086 22.0353 12.8476 22.0353 15.3585C22.0353 15.7172 22.0766 16.0665 22.1696 16.3969C18.0255 16.2081 14.3567 14.3957 11.8971 11.6393C11.4733 12.3095 11.2253 13.093 11.2253 13.9237C11.2253 15.5001 12.1037 16.8972 13.4472 17.709C12.6308 17.6901 11.8661 17.4824 11.1943 17.1426C11.1943 17.1615 11.1943 17.1804 11.1943 17.1992C11.1943 19.4081 12.9098 21.2394 15.1938 21.6642C14.7804 21.768 14.336 21.8247 13.8813 21.8247C13.5609 21.8247 13.2509 21.7964 12.9408 21.7397C13.5713 23.5521 15.4108 24.8642 17.5914 24.902C15.8862 26.1197 13.7366 26.8466 11.401 26.8466C10.998 26.8466 10.6052 26.8277 10.2125 26.7805C12.3931 28.0832 15.0181 28.8383 17.8291 28.8383Z",fill:"white"}))),xe||(xe=n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_1655_1935"},n.createElement("rect",{width:41.3382,height:37.7586,fill:"white",transform:"translate(0.942383)"})))))}const we=n.forwardRef(ge);var _e,ye;a.p;function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Ne.apply(this,arguments)}function Ce(e,t){let{title:a,titleId:s,...l}=e;return n.createElement("svg",Ne({width:43,height:39,viewBox:"0 0 43 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},l),a?n.createElement("title",{id:s},a):null,_e||(_e=n.createElement("g",{clipPath:"url(#clip0_1655_1912)"},n.createElement("path",{d:"M16.3307 16.1167V16.1979C16.2904 16.3269 16.2521 16.4541 16.2179 16.5795L16.1776 16.7252C16.1473 16.8413 16.1171 16.9575 16.0889 17.0736L16.0587 17.2064C16.0224 17.3612 15.9922 17.5179 15.96 17.6783V17.7484C15.9358 17.883 15.9157 18.0213 15.8975 18.1595V18.3107C15.8975 18.4306 15.8834 18.5486 15.8572 18.6647V18.8067C15.8572 18.9615 15.8572 19.1238 15.827 19.2787H20.7929L20.7909 16.0928H16.3407L16.3307 16.1167Z",fill:"#213F7D"}),n.createElement("path",{d:"M15.7949 20.9823V21.0339C15.7949 21.1888 15.8312 21.34 15.8513 21.5059V21.6294C15.8695 21.7493 15.8876 21.871 15.9077 21.9926V22.1051C15.9359 22.2563 15.9662 22.413 16.0004 22.5771V22.6582C16.0306 22.7836 16.0649 22.909 16.0991 23.0306L16.1354 23.1579C16.1737 23.2906 16.2119 23.4215 16.2543 23.5542V23.6059H20.6319V20.6763H15.7748C15.7788 20.7887 15.7849 20.8791 15.7949 20.9823L15.7949 20.9823Z",fill:"#213F7D"}),n.createElement("path",{d:"M20.4565 10.4049L20.1161 10.6594L20.0637 10.7018L19.7857 10.9322L19.6769 11.0263L19.4553 11.2254L19.3465 11.3249L19.1088 11.5554L19.0423 11.6255L18.7482 11.9371L18.6716 12.0274L18.4762 12.2929L18.3775 12.4053L18.1922 12.6413L18.1035 12.7501L17.8618 13.0857C17.7792 13.2037 17.7026 13.3217 17.624 13.4397L17.5515 13.5577L17.3924 13.8176L17.3158 13.9448L17.1043 14.332C17.0398 14.4555 16.9774 14.5772 16.9189 14.7007H20.7406V10.2354L20.5754 10.3478L20.4565 10.4049Z",fill:"#213F7D"}),n.createElement("path",{d:"M17.094 25.376L17.1564 25.4884L17.3116 25.7668L17.3841 25.894L17.5593 26.1817L17.6158 26.272C17.6943 26.3955 17.7749 26.5154 17.8575 26.6352L17.92 26.72L18.1214 26.9929L18.21 27.1053L18.4055 27.3505L18.4881 27.4501L18.7761 27.7764L18.8064 27.8096L19.0803 28.0936L19.1791 28.1876L19.4067 28.4051L19.5094 28.4992L19.7875 28.7444L19.8338 28.7868L20.1682 29.056L20.2669 29.1315L20.5248 29.3196L20.6376 29.4007L20.7262 29.4579L20.7242 24.9888H16.9026C16.965 25.1178 17.0275 25.2469 17.094 25.3759L17.094 25.376Z",fill:"#213F7D"}),n.createElement("path",{d:"M26.1296 14.3265L26.0772 14.2324L25.912 13.9356L25.8354 13.8029L25.6964 13.5576L25.6078 13.4212L25.4426 13.176L25.36 13.0525L25.1344 12.7649L25.0941 12.7077L24.8201 12.3629L24.7435 12.2726L24.5381 12.0311L24.4353 11.9186L24.2399 11.7066L24.1492 11.5904L23.9317 11.3784L23.833 11.2844L23.5187 11.0005L23.1843 10.7221L23.0815 10.6409L22.8398 10.4566L22.7108 10.3662L22.4792 10.2058L22.3502 10.121L22.2777 10.0786V14.7007H26.3149C26.2464 14.5735 26.1839 14.45 26.1295 14.3265L26.1296 14.3265Z",fill:"#213F7D"}),n.createElement("path",{d:"M15.2529 14.7011V14.6532C15.3113 14.5149 15.3737 14.3785 15.4382 14.242L15.4684 14.172C15.5369 14.03 15.6074 13.8899 15.6799 13.7516L15.7263 13.6668C15.7988 13.5248 15.8754 13.3884 15.958 13.252V13.2188C16.0345 13.086 16.1131 12.957 16.1957 12.8316L16.242 12.7615C16.3246 12.6325 16.4112 12.5034 16.4999 12.3744L16.5563 12.2988C16.649 12.1716 16.7416 12.0388 16.8403 11.9171C16.933 11.7936 17.0297 11.6756 17.1284 11.5576L17.1848 11.4912L17.489 11.1428L17.5515 11.0764C17.6603 10.9584 17.7691 10.8404 17.8819 10.728L18.1035 10.5067L18.1055 10.5049C15.6437 11.2276 13.5486 12.7358 12.1989 14.7527H15.1905L15.2529 14.7011Z",fill:"#213F7D"}),n.createElement("path",{d:"M14.2318 19.2789V18.9157V18.8254V18.5415V18.4327C14.2318 18.3258 14.2438 18.2188 14.268 18.1119V18.0695C14.268 17.9515 14.3043 17.828 14.3204 17.71V17.6104C14.3204 17.5201 14.3385 17.4279 14.3728 17.3375V17.238C14.3728 17.12 14.4191 17.002 14.4493 16.884C14.4755 16.766 14.5057 16.6535 14.5319 16.5355L14.5581 16.436L14.6306 16.1668V16.106H11.4839C11.0225 17.12 10.7526 18.1967 10.6841 19.2918H14.2317L14.2318 19.2789Z",fill:"#213F7D"}),n.createElement("path",{d:"M17.9604 29.0575L17.6461 28.7312L17.5897 28.6703L17.2794 28.3164L17.217 28.2408C17.1142 28.1172 17.0115 27.99 16.9128 27.8628C16.8141 27.7356 16.7214 27.6084 16.6287 27.4812L16.5824 27.3964C16.4938 27.2673 16.4051 27.1364 16.3185 27.0055L16.2661 26.9299C16.1835 26.8008 16.1029 26.6699 16.0244 26.539V26.5114C15.9418 26.375 15.8652 26.233 15.7866 26.0873L15.7282 25.9804C15.6517 25.8384 15.5812 25.6965 15.5106 25.5564L15.4744 25.5084C15.4099 25.3738 15.3475 25.2356 15.289 25.0936V25.0088H12.2148C13.5767 27.0903 15.7323 28.639 18.2643 29.3543L18.0125 29.1091L17.9604 29.0575Z",fill:"#213F7D"}),n.createElement("path",{d:"M14.7573 23.5967V23.5303L14.6948 23.3035L14.6646 23.2003L14.5981 22.9219V22.8702C14.5739 22.7596 14.5498 22.6509 14.5256 22.5439V22.4499L14.4269 22.2047V22.0922C14.4269 22.0129 14.4148 21.9337 14.3906 21.8507V21.7567C14.3906 21.646 14.3765 21.5373 14.3503 21.4266V21.3695C14.3503 21.2791 14.3402 21.1851 14.3201 21.0911V20.9786V20.7426V20.6763H10.7C10.7846 21.6792 11.0384 22.6637 11.4514 23.5967L14.7573 23.5967Z",fill:"#213F7D"}),n.createElement("path",{d:"M26.883 23.5838V23.5322C26.9233 23.3994 26.9636 23.2685 27.0018 23.1358L27.0381 23.0086C27.0724 22.8832 27.1046 22.7578 27.1368 22.6361V22.555C27.1711 22.4038 27.2013 22.2471 27.2295 22.083V21.9706C27.2496 21.8507 27.2698 21.7291 27.2859 21.6074V21.4838C27.2859 21.329 27.3262 21.1778 27.3423 21.0119V20.9602V20.6542L22.2455 20.6523V23.5746H26.887L26.883 23.5838Z",fill:"#213F7D"}),n.createElement("path",{d:"M28.4601 16.0929V16.1537L28.5326 16.4174L28.5588 16.5206C28.5891 16.6331 28.6173 16.7492 28.6414 16.8654C28.6676 16.9834 28.6938 17.1014 28.718 17.2194V17.3226C28.718 17.413 28.7341 17.5033 28.7643 17.5918V17.6913C28.7643 17.8093 28.8006 17.9273 28.8167 18.0509V18.0933C28.8167 18.2002 28.8288 18.3071 28.853 18.4141V18.5229V18.8012V18.9008V19.264H32.1488C32.0783 18.1689 31.8083 17.0921 31.349 16.0781H28.4601L28.4601 16.0929Z",fill:"#213F7D"}),n.createElement("path",{d:"M25.1806 10.5713L25.2632 10.6561L25.3297 10.7225L25.644 11.058L25.6963 11.1152L25.9945 11.4636C26.0932 11.5872 26.1899 11.7088 26.2886 11.8324L26.345 11.9024L26.6129 12.2712L26.6653 12.3468C26.754 12.474 26.8406 12.6067 26.9292 12.7376V12.7708C27.0118 12.8999 27.0904 13.0308 27.167 13.1617L27.2435 13.2373C27.3221 13.37 27.3986 13.5046 27.4712 13.6429L27.5175 13.7277C27.59 13.866 27.6605 14.0061 27.729 14.148L27.7592 14.2089C27.8237 14.3472 27.8862 14.4854 27.9446 14.6237V14.6661H30.6824L30.6844 14.668C29.4031 12.7745 27.4651 11.3327 25.1805 10.5713L25.1806 10.5713Z",fill:"#213F7D"}),n.createElement("path",{d:"M21.5705 0.965332C16.0991 0.965332 10.8532 2.95465 6.98315 6.49461C3.1152 10.0363 0.941406 14.8374 0.941406 19.8446C0.941406 24.8519 3.11509 29.6529 6.98315 33.1947C10.8531 36.7345 16.0991 38.724 21.5705 38.724C27.0418 38.724 32.2878 36.7346 36.1578 33.1947C40.0258 29.653 42.1996 24.8519 42.1996 19.8446C42.1996 14.8374 40.0259 10.0364 36.1578 6.49461C32.2879 2.95474 27.0418 0.965332 21.5705 0.965332ZM21.4819 31.0061C18.2485 31.0061 15.1461 29.8317 12.8573 27.7372C10.5708 25.6446 9.28552 22.8055 9.28552 19.8443C9.28552 16.883 10.5708 14.0441 12.8573 11.9513C15.1459 9.85687 18.2482 8.68244 21.4819 8.68244C24.7172 8.68244 27.8196 9.85687 30.1084 11.9513C32.395 14.0439 33.6802 16.883 33.6802 19.8443C33.6782 22.8034 32.3909 25.6407 30.1044 27.7353C27.8179 29.8279 24.7176 31.0042 21.482 31.006L21.4819 31.0061Z",fill:"#213F7D"}),n.createElement("path",{d:"M25.3296 26.6605L25.3961 26.5665L25.5815 26.2936L25.6641 26.1609L25.8192 25.9064L25.9018 25.77L26.0569 25.4916L26.1193 25.3791C26.1878 25.2501 26.2543 25.121 26.3148 24.992L22.2454 24.9883V29.6233L22.2977 29.5901L22.608 29.3818L22.7268 29.297L22.9646 29.1218L23.0874 29.0223L23.3191 28.8342L23.4319 28.7402L23.7301 28.4765L23.7603 28.4489L24.0746 28.1465L24.1673 28.0469L24.3788 27.8257L24.4876 27.7077L24.683 27.4865L24.7817 27.3685L24.9993 27.0993L25.0617 27.0237C25.1403 26.9039 25.2309 26.7822 25.3297 26.6605L25.3296 26.6605Z",fill:"#213F7D"}),n.createElement("path",{d:"M28.9722 20.6764V20.7428V20.9788V21.0876C28.9722 21.1816 28.9621 21.2756 28.942 21.3715V21.4286C28.942 21.5393 28.9259 21.6499 28.8956 21.7642V21.8582C28.8956 21.9394 28.8815 22.0223 28.8553 22.1034L28.7909 22.2048L28.7445 22.4464V22.5404C28.7204 22.651 28.6962 22.7598 28.672 22.8704V22.9128L28.5995 23.1967L28.5733 23.3L28.5109 23.5304V23.5913H31.5589L31.5609 23.5931C31.9739 22.6602 32.2298 21.6739 32.3123 20.6709H28.9722L28.9722 20.6764Z",fill:"#213F7D"}),n.createElement("path",{d:"M27.9608 24.9884V25.064C27.8984 25.2097 27.8359 25.3498 27.7694 25.4881V25.5452C27.701 25.6909 27.6284 25.8328 27.5519 25.9748L27.5116 26.0559C27.435 26.1979 27.3585 26.338 27.2799 26.4763L27.2436 26.5334C27.1651 26.668 27.0825 26.8026 26.9959 26.9354V26.9722C26.9072 27.1087 26.8206 27.2414 26.7279 27.3741L26.6755 27.4497C26.5829 27.5788 26.4882 27.706 26.3915 27.8314L26.2646 27.8682C26.1679 27.9936 26.0692 28.1171 25.9664 28.237C25.8637 28.3605 25.7549 28.4822 25.6461 28.6002L25.5837 28.6666L25.2593 29.0058L25.1969 29.0666L25.084 29.1791L25.082 29.181C27.4552 28.4103 29.4617 26.9095 30.755 24.9331H27.9709L27.9608 24.9884Z",fill:"#213F7D"}),n.createElement("path",{d:"M27.4287 18.8066V18.6646C27.4287 18.5448 27.4146 18.4249 27.3884 18.3051V18.1539C27.3683 18.0156 27.3461 17.8792 27.3219 17.7428V17.6727C27.2917 17.5123 27.2595 17.3556 27.2232 17.2007L27.193 17.068C27.1648 16.9518 27.1366 16.8357 27.1044 16.7195L27.0641 16.5739C27.0298 16.4485 26.9915 16.3213 26.9512 16.1922L26.9251 16.1074H22.2835L22.2815 19.2786H27.4609C27.4549 19.1219 27.4448 18.9615 27.4287 18.8066L27.4287 18.8066Z",fill:"#213F7D"}))),ye||(ye=n.createElement("defs",null,n.createElement("clipPath",{id:"clip0_1655_1912"},n.createElement("rect",{width:41.2582,height:37.7586,fill:"white",transform:"translate(0.941406 0.965332)"})))))}const ke=n.forwardRef(Ce);a.p;var Se=e=>{let{logo:t,contact:a,name:n,id:s}=e;return Object(y.jsxs)("div",{className:"support_item_group",children:[Object(y.jsx)("div",{style:{width:"50px"},children:t}),Object(y.jsxs)("div",{children:[Object(y.jsx)("p",{className:"support_item_name",children:n}),!s&&Object(y.jsx)("p",{className:"support_item_contact",children:a||"N/A"}),"PHONE"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"tel:".concat(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"}),"EMAIL"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"mailto:".concat(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})," ","WEBSITE"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?(e=>{if("WEBSITE"===s)return e.startsWith("https://")?e:"https://".concat(e)})(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})," ","WHATSAPP"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"https://api.whatsapp.com/send?phone=".concat(Object(X.g)(a)):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})," ","INSTAGRAM"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"".concat(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})," ","TWITTER"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"".concat(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})," ","FACEBOOK"===s&&Object(y.jsx)("a",{className:"support_item_contact",href:a?"".concat(a):"",target:"_blank",rel:"noreferrer",children:a||"N/A"})]})]})};var Ee=()=>{const{translate:e}=Object(x.useTranslation)(),[t,a,s,l,c,i,r]=Object(f.a)((e=>[e.customer_support_phone,e.social_media_instagram,e.social_media_facebook,e.customer_support_website,e.social_media_twitter,e.customer_support_email,e.loading])),o=Object(n.useMemo)((()=>[{name:e("lender-web-app-phone").toUpperCase(),contact:t,logo:Object(y.jsx)(Oe,{}),id:"PHONE"},{name:e("lender-web-app-instagram").toUpperCase(),contact:a,logo:Object(y.jsx)(je,{}),id:"INSTAGRAM"},{name:e("lender-web-app-facebook").toUpperCase(),contact:s,logo:Object(y.jsx)(re,{}),id:"FACEBOOK"},{name:e("lender-web-app-website").toUpperCase(),contact:l,logo:Object(y.jsx)(ke,{}),id:"WEBSITE"},{name:e("lender-web-app-twitter").toUpperCase(),contact:c,logo:Object(y.jsx)(we,{}),id:"TWITTER"},{name:e("lender-web-app-email").toUpperCase(),contact:i,logo:Object(y.jsx)(ke,{}),id:"EMAIL"}]),[]);return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)("div",{className:"tab-content__header mb-6",children:Object(y.jsx)("p",{children:e("lender-web-app-contact-channel")})}),Object(y.jsx)("div",{className:"support_grid_container",children:!r&&o.map((e=>Object(y.jsx)(Se,{logo:e.logo,name:e.name,contact:e.contact,id:e.id},e.id)))})]})},Te=a(180);function Ae(){const{translate:e}=Object(x.useTranslation)();return Object(y.jsxs)("div",{className:"tab-pane fade h-100 show active ",id:"language",role:"tabpanel","aria-labelledby":"documents-tab",children:[Object(y.jsx)("div",{className:"tab-content__header",children:Object(y.jsx)("p",{children:e("lender-web-app-language")})}),Object(y.jsx)("div",{className:"desktop-language mt-5",children:Object(y.jsx)(Te.a,{})})]})}var Le=a(75),Me=a(255);function De(){const[e,t]=Object(n.useState)(!1),a=Object(c.a)((e=>e.profile)),s=Object(f.a)((e=>e.terms_url)),l=Object($.a)((e=>e.logout)),{assets:i,links:r}=Object(n.useContext)(ee.a),{translate:o}=Object(x.useTranslation)(),d=[{text:o("lender-web-app-profile"),link:h.a.settings.profile},{text:o("lender-web-app-next-of-kin"),link:h.a.settings.nextOfKin},{text:o("lender-web-app-banks-and-cards"),link:h.a.settings.cardsAndBanks},{text:o("lender-web-app-documents"),link:h.a.settings.documents},{text:o("lender-web-app-security"),link:h.a.settings.security},{text:o("lender-web-app-support"),link:h.a.settings.support},{text:o("lender-web-app-referral"),link:h.a.settings.referral.index},{text:o("lender-web-app-terms-condition"),link:s||(null===r||void 0===r?void 0:r.terms_conditions),external:!0,visible:null===r||void 0===r?void 0:r.terms_conditions},{text:o("lender-web-app-privacy-policy"),link:null===i||void 0===i?void 0:i.privacy_policy,external:!0,visible:null===i||void 0===i?void 0:i.privacy_policy},{text:o("lender-web-app-faqs"),link:null===i||void 0===i?void 0:i.faqs,external:!0,visible:null===i||void 0===i?void 0:i.faqs},{text:o("lender-web-app-language"),link:h.a.settings.language}];return Object(y.jsxs)("div",{className:"side position-sticky top-0 right-0",children:[Object(y.jsx)("div",{className:"side__header",children:Object(y.jsxs)("div",{className:"profile d-flex align-items-center",children:[Object(y.jsxs)("div",{className:"profile-picture",children:[Object(y.jsx)("div",{className:"image-container",children:Object(y.jsx)("img",{src:null===a||void 0===a?void 0:a.photo_url,alt:""})}),Object(y.jsx)("div",{className:"image-container emptyImageContainer",hidden:!0,children:Object(y.jsx)("img",{src:"/svgs/avatar.svg",alt:""})})]}),Object(y.jsxs)("p",{className:"profile-name",children:[Object(Le.capitalize)(null===a||void 0===a?void 0:a.first_name)," ",Object(Le.capitalize)(null===a||void 0===a?void 0:a.last_name)]})]})}),Object(y.jsxs)("ul",{className:"nav nav-tabs settings-nav-tabs",id:"myTab",role:"tablist",children:[d.map((e=>Object(y.jsxs)("li",{className:"nav-item",role:"presentation",children:[e.external&&e.visible&&Object(y.jsx)("a",{target:"_blank",className:"nav-link",href:e.link,rel:"noreferrer",children:e.text}),!e.external&&Object(y.jsx)(Q.c,{to:e.link,activeClassName:"active",className:"nav-link",id:"profile-tab","data-bs-toggle":"tab","data-bs-target":"#profile",role:"tab","aria-controls":"profile","aria-selected":"false",children:e.text})]},e.link))),Object(y.jsxs)("li",{className:"nav-item",role:"presentation",children:[Object(y.jsx)("button",{onClick:()=>{t(!0)},className:"nav-link text-danger",id:"profile-tab","data-bs-toggle":"tab","data-bs-target":"#profile",role:"tab","aria-controls":"profile","aria-selected":"false",children:o("lender-web-app-logout")}),Object(y.jsx)(Me.a,{showPrompt:e,close:()=>{t(!1)},logout:()=>{t(!1),l()},description:o("lender-web-app-confirm-logout"),warningMessage:o("lender-web-app-sure-logout")})]})]})]})}function Fe(){const e=Object(s.j)(),{translate:t}=Object(x.useTranslation)();Object(n.useEffect)((()=>{window.scrollTo(0,0)}),[e.pathname]);const[a,l]=Object(n.useState)(!1),c=[{title:"Profile",url:h.a.settings.profile},{title:"Next of kin",url:h.a.settings.nextOfKin},{title:"Bank and Cards",url:h.a.settings.cardsAndBanks},{title:"Documents",url:h.a.settings.documents},{title:"Security",url:h.a.settings.security},{title:"Support",url:h.a.settings.support},{title:"Referral",url:h.a.settings.referral}];return Object(y.jsxs)("div",{className:"main__content settings",children:[!a&&Object(y.jsxs)("div",{className:"back-to-settings-link",onClick:()=>l(!0),children:[Object(y.jsx)("div",{className:"icon d-flex align-items-center",children:Object(y.jsx)("svg",{width:"20",height:"20",children:Object(y.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(y.jsx)("p",{children:"Back to settings"})]}),a&&Object(y.jsx)("div",{className:"pageTitle",children:Object(y.jsx)("p",{children:t("lender-web-app-settings")})}),a&&Object(y.jsx)("div",{className:"mob-settings-holder",children:c.map((e=>Object(y.jsxs)(Q.b,{to:e.url,className:"mob-settings-cell ",onClick:()=>l(!1),children:[Object(y.jsx)("p",{children:e.title}),Object(y.jsx)("img",{src:"/svgs/chev-right.svg",alt:"chev-right"})]},e.title)))}),!a&&Object(y.jsx)("div",{className:"row",children:Object(y.jsx)("div",{className:"col",children:Object(y.jsxs)("div",{className:"card default-card settings__main",children:[Object(y.jsx)(De,{}),Object(y.jsx)("div",{className:"tab-content",id:"myTabContent",children:Object(y.jsxs)(s.e,{children:[Object(y.jsx)(s.c,{path:h.a.settings.profile,children:Object(y.jsx)(C,{})}),Object(y.jsx)(s.c,{path:h.a.settings.nextOfKin,children:Object(y.jsx)(W,{})}),Object(y.jsx)(s.c,{path:h.a.settings.cardsAndBanks,children:Object(y.jsx)(q.b,{})}),Object(y.jsx)(s.c,{path:h.a.settings.documents,children:Object(y.jsx)(Y,{})}),Object(y.jsx)(s.c,{path:h.a.settings.security,children:Object(y.jsx)(Z,{})}),Object(y.jsx)(s.c,{path:h.a.settings.support,children:Object(y.jsx)(Ee,{})}),Object(y.jsx)(s.c,{path:h.a.settings.referral.details,children:Object(y.jsx)(le,{})}),Object(y.jsx)(s.c,{path:h.a.settings.referral.index,children:Object(y.jsx)(ae,{})}),Object(y.jsx)(s.c,{path:h.a.settings.language,children:Object(y.jsx)(Ae,{})}),Object(y.jsx)(s.b,{to:h.a.settings.profile})]})})]})})})]})}},438:function(e,t,a){"use strict";a.d(t,"a",(function(){return ne}));var n=a(21),s=a(16),l=a(1),c=a(45),i=a(12),r=a(6),o=a(8),d=a(29),b=a(20),u=a(2),j=a(180),p=a(4),m=a(13),h=a(0);var O=e=>{let{children:t}=e;const{dictionary:a,assets:n,configs:s}=Object(l.useContext)(d.a),c=window.location.hostname,{translate:i}=Object(u.useTranslation)(),[r]=Object(m.a)((e=>[e.setShowLanguageDrop]),p.shallow);return Object(h.jsxs)("div",{className:"d-flex auth-page ",style:{minHeight:"100vh"},onClick:()=>r(!1),children:[Object(h.jsx)("div",{className:"card default-card rounded-0 min-vh-100 min-vw-50 w-50 p-5",children:Object(h.jsxs)("div",{className:"mw-446 d-flex flex-column h-100 my-auto w-100 mx-auto",children:[Object(h.jsxs)("div",{style:{display:"flex",alignItems:"left",width:"100%",justifyContent:"space-between"},children:[Object(h.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"left",width:"fit-content"},children:[Object(h.jsx)(b.b,{style:{paddingLeft:0},className:"",to:"/",children:Object(h.jsx)("img",{style:{height:"40px",width:"auto"},src:null===n||void 0===n?void 0:n.logo_url,alt:""})}),(c.includes("lsq.")||"localhost"===c)&&s&&("1"===s["show-lendsqr-brand"]||"true"===s["show-lendsqr-brand"])&&Object(h.jsxs)("small",{style:{fontSize:"9px"},children:[i("lender-web-app-powered-by",{webview:window.ReactNativeWebView?"app":"webapp"})," ",Object(h.jsxs)("a",{href:"https://lendsqr.com?utm_source=".concat(c,"&utm_medium=webapp"),target:"_blank",rel:"noreferrer",style:{color:"#23C6A1"},children:[" ","Lendsqr"]})]})]}),Object(h.jsx)(j.a,{})]}),Object(h.jsx)("div",{className:"d-flex align-items-center flex-column justify-content-center flex-grow-1",children:Object(h.jsx)("div",{className:"w-100",children:t})})]})}),Object(h.jsxs)("div",{className:"h-100 w-50 d-none d-md-flex flex-column text-white p-7 position-fixed onboard-cover",style:{left:"50%",backgroundImage:"".concat(null!==s&&void 0!==s&&s.enable_auth_overlay?"linear-gradient(rgba(17, 41, 69,0.6),rgba(17, 41, 69,0.6))":"linear-gradient(rgba(17, 41, 69,0.0),rgba(17, 41, 69,0.0))",", url(").concat(null===n||void 0===n?void 0:n.auth_bg,") "),backgroundSize:"cover"},children:[Object(h.jsx)("h3",{className:"mt-auto mw-500",children:null===a||void 0===a?void 0:a.login_banner_title}),Object(h.jsx)("p",{className:"mw-500",children:null===a||void 0===a?void 0:a.login_banner_body})]})]})},v=a(18),x=a(178),f=a(9),g=a.n(f),w=a(7);function _(){const{translate:e}=Object(u.useTranslation)(),t=o.g().shape({pin:o.h().min(4,e("lender-web-app-valid-code")).max(4,e("lender-web-app-valid-code")).required(e("lender-web-app-enter-the-code"))}),[a,n]=Object(l.useState)("bg-gray"),[s,d]=Object(l.useState)(0),[b,j]=Object(l.useState)("password"),[m,f]=Object(l.useState)(""),{validate:_,validated:y}=Object(x.a)(),[N,C,k]=Object(c.a)((e=>[e.setPasswordandPin,e.signingIn,e.reset]),p.shallow),S=Object(v.y)(),E=Object(i.e)({initialValues:{pin:""},validationSchema:t,onSubmit:async t=>{let{pin:a}=t;try{if(!m&&y)return;await N({pin:a,password:m}),g.a.success(e("lender-web-app-password-set")),S.goTo("/login")}catch(n){console.log(n)}}});return Object(l.useEffect)((()=>{k()}),[k]),Object(h.jsxs)(O,{children:[Object(h.jsxs)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 mt-7 ",children:[e("lender-web-app-welcome-back"),Object(h.jsx)("br",{})," ",e("lender-web-app-create-password-pin")]}),Object(h.jsxs)("form",{onSubmit:E.handleSubmit,children:[Object(h.jsx)("p",{style:{marginBottom:0},children:e("lender-web-app-enter-four-digit")}),Object(h.jsx)(w.o,{length:4,onChange:e=>{E.setFieldValue("pin",e,!0)},error:E.errors.pin,password:!0}),Object(h.jsx)("p",{className:"mb-2",children:e("lender-web-app-enter-password")}),Object(h.jsxs)("div",{className:"form-group form-floating",children:[Object(h.jsx)("input",{className:"form-control",onChange:async e=>{let t=0;const{value:a}=e.target;f(a),_(a),a.length>7&&(t+=25),/[A-Z]/.test(a)&&(t+=25),/[a-z]/.test(a)&&(t+=25),/[=!@#&$%]/.test(a)&&(t+=25),n(t<50?"bg-danger":100===t?"bg-success":"bg-warning"),d(t)},value:m,type:b,placeholder:"Password"}),Object(h.jsx)("label",{children:e("lender-web-app-password")}),Object(h.jsx)("span",{onClick:()=>j((e=>"password"===e?"text":"password")),className:"input-icon",style:{marginTop:"-1.5rem"},id:"toggle-icon",children:"password"===b?Object(h.jsx)("svg",{width:"20",height:"20",className:"eye-off",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye-close"})}):Object(h.jsx)("svg",{width:"20",height:"20",className:"eye",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye"})})})]}),Object(h.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>25&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>50&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>90&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})})]}),Object(h.jsx)("p",{className:"password-hint",children:e("lender-web-app-password-requirment")}),Object(h.jsx)(r.a,{isLoading:C,type:"submit",isDisabled:!y||!E.isValid,className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:e("lender-web-app-create-password")})]}),Object(h.jsxs)("p",{style:{marginBottom:0},className:"text-center mt-4",children:[e("lender-web-app-forgot-password")," ",Object(h.jsx)("a",{href:"/reset",children:e("lender-web-app-reset")})]}),Object(h.jsxs)("p",{className:"text-center mt-2",children:[e("lender-web-app-dont-have-account")," ",Object(h.jsxs)("a",{href:"/signup",children:[e("lender-web-app-sign-up")," "]})]})]})}var y=a(60),N=a(15);function C(){const{translate:e}=Object(u.useTranslation)(),t=o.g().shape({phone_number:o.h().min(6,e("lender-web-app-phone-min")).max(20,e("lender-web-app-phone-max")).required(e("lender-web-app-phone-number-error")),password:o.h().min(8,e("lender-web-app-enter-valid-password")).max(256,e("lender-web-app-enter-valid-password")).required(e("lender-web-app-enter-your-password"))}),a=Object(v.y)(),{dictionary:n}=Object(l.useContext)(d.a),[s,b,j]=Object(m.a)((e=>[e.fetchUserProfile,e.fetchTransactions,e.fetchDocs]),p.shallow),x=Object(y.a)(Object(l.useCallback)((e=>e.fetchOptions),[]),p.shallow),[f,g,_]=Object(c.a)((e=>[e.login,e.signingIn,e.reset]),p.shallow),C=Object(N.a)((e=>e.resetLogin),p.shallow),[k,S]=Object(l.useState)("");return Object(l.useEffect)((()=>{C()}),[]),Object(l.useEffect)((()=>{_()}),[_]),Object(h.jsxs)(O,{children:[Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 mt-7 ",children:null!==n&&void 0!==n&&n.login_header_text?null===n||void 0===n?void 0:n.login_header_text:e("lender-web-app-welcome-back-login")}),Object(h.jsx)(i.c,{initialValues:{phone_number:"",password:"",device_id:"web"},validationSchema:t,onSubmit:async t=>{try{await f(t),await s(),await x(),await b(),await j()}catch(n){n.message.includes("set your password")?a.goTo("/create-password"):n.message.includes("proceed")&&a.goTo("/signup"),S(n.message||("string"===typeof n?n:e("lender-web-app-problem-signin")))}},children:t=>Object(h.jsxs)(i.b,{method:"post",onSubmit:t.handleSubmit,children:[Object(h.jsx)(w.n,{tel:!0,name:"phone_number",label:e("lender-web-app-phone-number"),inputProps:{maxLength:11,minLength:11}}),Object(h.jsx)(w.s,{isToggleAble:!0,name:"password",type:"password",label:e("lender-web-app-password"),error:!!k&&!g,errorMessage:k}),Object(h.jsxs)("div",{className:"login-label-container mt-4",children:[Object(h.jsx)("p",{className:"login-text-p",children:Object(h.jsx)("a",{href:"/reset",children:e("lender-web-app-forgot-password")})}),Object(h.jsx)("p",{className:"login-text-p",children:Object(h.jsxs)("a",{href:"/signup",children:[e("lender-web-app-sign-up")," "]})})]}),Object(h.jsx)(r.a,{isLoading:g,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:e("lender-web-app-login")})]})})]})}var k=a(86),S=a(10),E=a(53),T=a(33);Object(T.b)();const A={loading:!1,phone_number:"",otp:""};var L=Object(E.create)()(((e,t)=>({...A,sendOTP:async a=>{const n=t(),s=(null===a||void 0===a?void 0:a.phone_number)||n.phone_number;e({loading:!0,phone_number:s});try{await k.a.post(S.Kb,{...a,phone_number:s})}catch(i){var l,c;if(null!==i&&void 0!==i&&i.isAxiosError)return e({loading:!1}),f.toast.error(null===(l=i.response.data)||void 0===l?void 0:l.message),Promise.reject(new Error(null===(c=i.response.data)||void 0===c?void 0:c.message));f.toast.error(i.message)}e({loading:!1})},enterOTP:async t=>{e({otp:t})},resetPassword:async a=>{e({loading:!0});const{phone_number:n}=t(),{otp:s}=t();try{await k.a.post(S.Jb,{new_password:a,otp:s,phone_number:n})}catch(i){var l,c;if(null!==i&&void 0!==i&&i.isAxiosError)return e({loading:!1}),f.toast.error(null===(l=i.response.data)||void 0===l?void 0:l.message),Promise.reject(new Error(null===(c=i.response.data)||void 0===c?void 0:c.message));f.toast.error(i.message)}e({loading:!1})},reset:()=>{e(A)}})));const M=e=>{let{setScreen:t}=e;const[a,s]=L((e=>[e.loading,e.sendOTP]),p.shallow),l=Object(n.i)(),{translate:c}=Object(u.useTranslation)(),d=o.g().shape({phone_number:o.h().min(5).max(16).required(c("lender-web-app-phone-number-error"))});return Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mt-7 mb-35 ",children:c("lender-web-app-enter-your-mobile")}),Object(h.jsx)(i.c,{validationSchema:d,initialValues:{phone_number:""},onSubmit:async e=>{try{await s(e),t("pin")}catch(n){var a;null!==(a=n.message)&&void 0!==a&&a.toLowerCase().includes("not yet registered")&&l.push({pathname:"/signup",state:{phone_number:e.phone_number}})}},children:e=>Object(h.jsxs)(i.b,{method:"post",onSubmit:e.handleSubmit,children:[Object(h.jsx)(w.n,{tel:!0,name:"phone_number",label:c("lender-web-app-phone-number")}),Object(h.jsx)(r.a,{isLoading:a,type:"submit",className:"w-100 rounded-5 py-3 btn btn-primary btn-lg px-5 mt-4",children:c("lender-web-app-reset-password")})]})}),Object(h.jsx)("a",{href:"/login",className:"d-block text-center mt-4 block",children:c("lender-web-app-remember-now")}),Object(h.jsxs)("p",{className:"text-center mt-2",children:[c("lender-web-app-no-access")," ",Object(h.jsxs)("a",{href:"/signup",children:[" ",c("lender-web-app-sign-up")," "]})]})]})},D=e=>{let{setScreen:t}=e;const[a,n]=Object(l.useState)("bg-gray"),[s,c]=Object(l.useState)(0),[i,o]=L((e=>[e.loading,e.resetPassword]),p.shallow),[d,b]=Object(l.useState)(""),{validate:j,validated:m}=Object(x.a)(),[O,v]=Object(l.useState)("password"),{translate:f}=Object(u.useTranslation)();return Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mt-7 mb-35 ",children:f("lender-web-app-new-password")}),Object(h.jsxs)("form",{children:[Object(h.jsxs)("div",{className:"form-group form-floating ",style:{position:"relative"},children:[Object(h.jsx)("input",{className:"form-control form-left",onChange:async e=>{let t=0;const{value:a}=e.target;b(a),j(a),a.length>7&&(t+=25),/[A-Z]/.test(a)&&(t+=25),/[a-z]/.test(a)&&(t+=25),/[=!@#&$%]/.test(a)&&(t+=25),n(t<50?"bg-danger":100===t?"bg-success":"bg-warning"),c(t)},value:d,type:O,placeholder:"Password"}),Object(h.jsx)("label",{children:f("lender-web-app-password")}),Object(h.jsx)("span",{onClick:()=>v((e=>"password"===e?"text":"password")),id:"toggle-icon",style:{position:"absolute",top:"50%",transform:"translateY(-50%)"},children:"password"===O?Object(h.jsx)("svg",{width:"20",height:"20",className:"eye-off",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye-close"})}):Object(h.jsx)("svg",{width:"20",height:"20",className:"eye",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye"})})})]}),Object(h.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>25&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>50&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(h.jsx)("div",{className:"progress",children:Object(h.jsx)("div",{className:"progress-bar bg-gray ".concat(s>90&&a),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})})]}),Object(h.jsx)("p",{className:"password-hint",children:f("lender-web-app-password-requirment")}),Object(h.jsx)(r.a,{isDisabled:!m,isLoading:i,onClick:async()=>{try{await o(d),t("success")}catch(e){t("pin")}},className:"w-100 py-3 rounded-5 btn btn-primary btn-lg px-5 mt-3",children:f("lender-web-app-reset-password")})]})]})},F=e=>{let{setScreen:t}=e;const{translate:a}=Object(u.useTranslation)(),[n,s,c]=L((e=>[e.loading,e.sendOTP,e.enterOTP]),p.shallow),d=o.g().shape({otp:o.h().min(6,a("lender-web-app-enter-valid-otp")).max(6,a("lender-web-app-enter-valid-otp")).required(a("lender-web-app-enter-your-otp"))}),b=Object(i.e)({initialValues:{otp:""},validationSchema:d,onSubmit:async e=>{let{otp:a}=e;await c(a),t("password")}}),j=Object(l.useRef)(null),[m,O]=Object(l.useState)(600);Object(l.useEffect)((()=>{if(m>0){const e=setTimeout((()=>O(m-1)),1e3);return()=>clearTimeout(e)}}),[m]);return Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mt-7 mb-35 ",children:a("lender-web-app-enter-otp")}),Object(h.jsxs)("form",{ref:j,onSubmit:b.handleSubmit,children:[Object(h.jsxs)("p",{children:[a("lender-web-app-six-digit")," "]}),Object(h.jsx)(w.o,{length:6,onChange:e=>{b.setFieldValue("otp",e,!0)},error:b.errors.otp,password:!0}),Object(h.jsx)("div",{className:"",children:b.errors.otp&&Object(h.jsx)("p",{className:"text-danger",children:b.errors.otp})}),Object(h.jsxs)("p",{className:"",children:[a("lender-web-app-no-otp")," ",Object(h.jsx)("button",{type:"button",style:{border:"none",color:"#016AB3"},onClick:()=>{O(600),s()},className:"mt-1 resend-button bg-white",disabled:n||m>0,children:Object(h.jsx)("small",{children:a("lender-web-app-resent-code")})})]}),Object(h.jsx)("p",{children:(e=>{const t=Math.floor(e/60),a=e%60;return"".concat(t.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0"))})(m)}),Object(h.jsx)(r.a,{isLoading:!!n,type:"submit",className:"w-100 py-3 rounded-5 btn btn-primary btn-lg px-5 mt-4",children:a("lender-web-app-reset-password")})]}),Object(h.jsx)("a",{href:"/login",className:"d-block text-center mt-4 block",children:a("lender-web-app-remember-now")})]})},I=()=>{const{translate:e}=Object(u.useTranslation)(),t=Object(n.i)();return Object(h.jsxs)("div",{className:"d-flex flex-column align-items-center text-center h-100 justify-content-center",children:[Object(h.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(h.jsx)("path",{d:"M54.3987 7.6557C53.5748 6.83046 52.2382 6.82904 51.4144 7.65219L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0708 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.8021 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.8176 55.2218 8.48093 54.3987 7.6557Z",fill:"url(#paint0_radial)"}),Object(h.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(h.jsxs)("defs",{className:"text-primary",children:[Object(h.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(h.jsx)("stop",{stopColor:"currentColor"}),Object(h.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(h.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(h.jsx)("stop",{stopColor:"currentColor"}),Object(h.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(h.jsx)("h5",{className:"mt-35 mb-3 text-primary",children:e("lender-web-app-password-reset")}),Object(h.jsx)("p",{className:"text-app-gray",children:e("lender-web-app-successfull-reset-password")}),Object(h.jsx)(r.a,{onClick:()=>t.push("/login"),style:{maxWidth:"300px"},type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4 mx-auto",children:e("lender-web-app-go-login")})]})};var R=()=>{const[e,t]=Object(l.useState)();return Object(h.jsx)(O,{children:"number"===e?Object(h.jsx)(M,{setScreen:t}):"pin"===e?Object(h.jsx)(F,{setScreen:t}):"password"===e?Object(h.jsx)(D,{setScreen:t}):"success"===e?Object(h.jsx)(I,{}):Object(h.jsx)(M,{setScreen:t})})},P=a(81),q=a(226);const U=()=>{const[e,t]=Object(N.a)((e=>[e.setScreen,e.allowed_domain_error])),{translate:a}=Object(u.useTranslation)();return Object(h.jsxs)("div",{className:"d-flex flex-column align-items-center text-center h-100 justify-content-center",children:[Object(h.jsxs)("svg",{width:"75",height:"65",viewBox:"0 0 75 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-danger",children:[Object(h.jsx)("path",{d:"M72.0521 64.5245C69.5635 65.2157 68.25 64.2479 67.9735 63.0728C66.8674 49.1779 53.3873 38.2555 37.1421 38.2555C37.0729 38.2555 37.073 38.2555 37.0038 38.2555C36.9347 38.2555 36.9347 38.2555 36.8656 38.2555C20.6203 38.2555 7.07107 49.1779 6.03413 63.0728C5.68849 64.2479 4.44417 65.2157 1.95554 64.5245C0.0199339 63.9714 -0.187454 62.0358 0.15819 60.7224C2.50857 44.961 18.2008 32.9326 36.9347 32.9326C37.0038 32.9326 37.0038 32.9326 37.0729 32.9326C37.1421 32.9326 37.1421 32.9326 37.2112 32.9326C55.9451 32.9326 71.6373 44.961 73.9877 60.7224C74.1951 62.1049 73.9877 64.0406 72.0521 64.5245Z",fill:"currentColor"}),Object(h.jsx)("path",{d:"M22.003 6.3871C22.003 9.56703 19.4452 12.1248 16.2653 12.1248C13.0854 12.1248 10.5276 9.56703 10.5276 6.3871C10.5276 3.20718 13.0854 0.649414 16.2653 0.649414C19.4452 0.649414 22.003 3.20718 22.003 6.3871Z",fill:"currentColor"}),Object(h.jsx)("path",{d:"M63.3421 6.3871C63.3421 9.56703 60.7843 12.1248 57.6044 12.1248C54.4245 12.1248 51.8667 9.56703 51.8667 6.3871C51.8667 3.20718 54.4245 0.649414 57.6044 0.649414C60.7843 0.649414 63.3421 3.20718 63.3421 6.3871Z",fill:"currentColor"})]}),Object(h.jsx)("h5",{className:"mt-35 mb-3 text-danger",children:"Error!!!"}),Object(h.jsx)("p",{className:"text-app-gray",children:t}),Object(h.jsx)(r.a,{onClick:()=>{e(1)},style:{maxWidth:"300px"},type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4 mx-auto",children:a("lender-web-app-go-back")})]})};var B=a(259),V=a(145);a(68);const H=e=>{let{field:t,setIsLoading:a}=e;const{setFieldValue:n}=Object(i.f)(),[s,c]=Object(N.a)((e=>[e.addPhoto,e.addCustomPhoto]),p.shallow),[r,o]=Object(l.useState)(!1),[d,b]=Object(l.useState)(null),[j,m]=Object(l.useState)(),O=!1,{token:v}=N.a.getState(),x=Object(l.useCallback)((e=>{m({file:e,preview:e})}),[]);Object(l.useEffect)((()=>{null!==j&&void 0!==j&&j.file&&(a(!0),f())}),[j]);const f=async()=>{try{const s=await fetch(null===j||void 0===j?void 0:j.file),l=await s.blob();if(l.size/1e9>4)return g.a.error(w("lender-web-app-upload-less-50")),void a(!1);try{const e=new FormData;e.append("file",l,"profile-picture.png");const s=await c(e);n(t.id,s),a(!1)}catch(e){g.a.error("".concat(e.message||e)),a(!1)}}catch(e){g.a.error("".concat(w("lender-web-app-error-uploading-photo")," ").concat(null===e||void 0===e?void 0:e.message))}},{translate:w}=Object(u.useTranslation)();return Object(h.jsxs)(h.Fragment,{children:[Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:w("lender-web-app-take-picture")}),!r&&Object(h.jsx)("div",{className:"mb-3 text-center rounded d-flex bg-light-blue btn justify-content-center align-items-center flex-column",style:{border:"1px dashed #016AB3",height:"229px"},onClick:()=>{o(!0)},children:j?Object(h.jsx)("img",{className:"p-1",style:{maxHeight:"215px",maxWidth:"100%",objectFit:"contain"},alt:"Preview",src:null===j||void 0===j?void 0:j.preview}):Object(h.jsxs)("div",{className:"p-5",children:[Object(h.jsx)("svg",{className:"mb-3 ",width:"40",height:"36",viewBox:"0 0 40 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(h.jsx)("path",{d:"M36 4H4V32L22.584 13.412C22.9591 13.0371 23.4677 12.8264 23.998 12.8264C24.5283 12.8264 25.0369 13.0371 25.412 13.412L36 24.02V4ZM0 1.986C0.00366009 1.46076 0.213801 0.958035 0.585026 0.586435C0.956251 0.214836 1.45876 0.0041893 1.984 0H38.016C39.112 0 40 0.89 40 1.986V34.014C39.9963 34.5392 39.7862 35.042 39.415 35.4136C39.0438 35.7852 38.5412 35.9958 38.016 36H1.984C1.45763 35.9995 0.952994 35.79 0.580979 35.4176C0.208964 35.0452 -2.6691e-07 34.5404 0 34.014V1.986ZM12 16C10.9391 16 9.92172 15.5786 9.17157 14.8284C8.42143 14.0783 8 13.0609 8 12C8 10.9391 8.42143 9.92172 9.17157 9.17157C9.92172 8.42143 10.9391 8 12 8C13.0609 8 14.0783 8.42143 14.8284 9.17157C15.5786 9.92172 16 10.9391 16 12C16 13.0609 15.5786 14.0783 14.8284 14.8284C14.0783 15.5786 13.0609 16 12 16Z",fill:"#567890"})}),Object(h.jsx)("p",{className:"fw-bold",children:w("lender-web-app-click-take-picture")}),Object(h.jsxs)("p",{className:"text-small text-app-gray",children:["(",w("lender-web-app-max-50"),")"]})]})}),j&&Object(h.jsxs)("div",{style:{background:"var(--light_primary_color)"},className:"p-3 mt-3 rounded-3 d-flex justify-content-center align-items-center",children:[Object(h.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(h.jsx)("path",{d:"M8.5 0C3.8033 0 0 3.8033 0 8.5C0 13.1967 3.8033 17 8.5 17C13.1967 17 17 13.1967 17 8.5C17 3.8033 13.1967 0 8.5 0ZM13.5285 6.94294L8.01501 12.4565C7.60661 12.8649 6.94294 12.8649 6.53453 12.4565L6.15165 12.0736L3.54805 9.46997C3.13964 9.06156 3.13964 8.3979 3.54805 7.98949L3.93093 7.60661C4.33934 7.1982 5.003 7.1982 5.41141 7.60661L7.27477 9.46997L11.6652 5.07958C12.0736 4.67117 12.7372 4.67117 13.1456 5.07958L13.5285 5.46246C13.9369 5.87087 13.9369 6.53453 13.5285 6.94294Z",fill:"#31C5A1"})}),Object(h.jsx)("p",{className:" ms-3",children:w("lender-web-app-good-picture")})]}),O,r&&Object(h.jsx)(V.a,{showWebCamModal:r,setShowWebCamModal:o,setCapturedImage:b,capturedImage:d||"",description:w("lender-web-app-take-a-picture"),handleSave:()=>{x(d),o(!1)}})]})};var Y=a(781),W=function(e){let{section:t,props:a,setIsLoading:n}=e;const s=Object(l.useMemo)((()=>(e=>{var t;return(null===e||void 0===e||null===(t=e.fields)||void 0===t?void 0:t.map((e=>({...e,mapId:Object(Y.a)()}))))||[]})(t)),[t]);return Object(h.jsx)("div",{className:"mt-2 ",children:null===s||void 0===s?void 0:s.map((e=>"image"===e.type?Object(h.jsx)(H,{setIsLoading:n,field:e},e.mapId):Object(h.jsx)(B.a,{field:e,props:a},e.mapId)))})};a(743);const G="continue",Z="cancel",K="submit";var z=function(e){let{action:t,page:a,onContinue:n,isLoading:s,onPrevious:c}=e;const r=Object(i.f)(),[o,d]=Object(l.useState)(!1);return Object(l.useEffect)((()=>{var e;const t=[];null===a||void 0===a||null===(e=a.sections)||void 0===e||e.forEach((e=>{var a;null===e||void 0===e||null===(a=e.fields)||void 0===a||a.forEach((e=>{t.push(e.id)}))}));const n=null===t||void 0===t?void 0:t.find((e=>!!r.getFieldMeta(e).error));d(!n)}),[a,r]),Object(h.jsx)(J,{isDisabled:!o,action:t,onContinue:n,isLoading:s,onPrevious:c})};const J=e=>{var t;let{action:a,onContinue:n,isDisabled:s,onPrevious:l,isLoading:c}=e;const{translate:i}=Object(u.useTranslation)();switch(null===(t=a.type)||void 0===t?void 0:t.toLowerCase()){case G:case K:return Object(h.jsx)(r.a,{isDisabled:s,type:"button",onClick:n,className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",style:{width:"100%",marginTop:"20px",marginBottom:"10px"},isLoading:c,children:a.label});case Z:return Object(h.jsx)(r.a,{type:"button",onClick:l,className:"btn btn-outline-primary-no-hover py-3 btn-lg px-5 w-full rounded-5",style:{width:"100%"},children:a.label});default:return Object(h.jsx)("button",{type:"button",onClick:l,className:"btn py-3 pl-0 btn-ghost btn-lg",children:i("lender-web-app-back")})}};var Q=a(264);const X=e=>{let{setDisplayScreen:t,setFormRendered:a}=e;const[n,s]=Object(l.useState)(null),[c,r]=Object(l.useState)(),[o,d]=Object(l.useState)(0),[b,u]=Object(l.useState)(!1),[j,p,m,O,v,x]=Object(N.a)((e=>[e.phone_number,e.organization,e.onboarding_form,e.postCustomOnboarding,e.setScreen,e.language]));Object(l.useEffect)((()=>{(async()=>{if(m){if(!n){const e=localStorage.getItem("onboarding-stages-".concat(p,"-").concat(j));s((e=>{if(e){const t=localStorage.getItem("onboarding-page-".concat(p,"-").concat(j));return t&&d(+t),JSON.parse(null===e||void 0===e?void 0:e.toString())}const t={},a=null===m||void 0===m?void 0:m.pages;var n,s;return Object.keys(a).length>0?null===m||void 0===m||null===(n=m.pages)||void 0===n||n.forEach((e=>{var n;null===e||void 0===e||null===(n=e.sections)||void 0===n||n.forEach((e=>{var n;null===e||void 0===e||null===(n=e.fields)||void 0===n||n.forEach((e=>{var n;t[e.id]=null!==(n=a[e.id])&&void 0!==n?n:"",["image","upload","video","file","audio"].includes(e.type)&&(t[e.id]="")}))}))})):null===m||void 0===m||null===(s=m.pages)||void 0===s||s.forEach((e=>{var a;null===e||void 0===e||null===(a=e.sections)||void 0===a||a.forEach((e=>{var a;null===e||void 0===e||null===(a=e.fields)||void 0===a||a.forEach((e=>{t[e.id]=""}))}))})),t})(e))}const e=await Object(Q.a)(m);r(e)}})()}),[j,m,x]),Object(l.useEffect)((()=>{t(3+Number(o))}),[o]);return Object(l.useEffect)((()=>{setTimeout((()=>{a(!0)}),1e3)}),[]),Object(h.jsx)(h.Fragment,{children:n&&c&&Object(h.jsx)(i.c,{initialValues:n,onSubmit:async e=>console.log("configurable onboarding",e),validateOnMount:!0,validationSchema:c,children:e=>{return Object(h.jsx)("div",{children:Object(h.jsxs)(i.b,{onSubmit:e.handleSubmit,children:[m&&(t=m.pages[o],Object(h.jsxs)("div",{className:"custom-holder",children:[Object(h.jsx)("div",{className:"tab-content__header mb-4",children:Object(h.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:null===t||void 0===t?void 0:t.title})}),null===t||void 0===t?void 0:t.sections.map((t=>Object(h.jsxs)("div",{className:"mt-5 text-app-gray ",children:[Object(h.jsx)("p",{className:"fw-bold",children:t.name}),Object(h.jsx)("small",{children:t.description}),Object(h.jsx)(W,{section:t,setIsLoading:u,props:e},t.name)]},t.name)))]})),null===m||void 0===m?void 0:m.pages[o].actions.map((t=>0===o&&"cancel"===t.type?"":Object(h.jsx)(z,{page:null===m||void 0===m?void 0:m.pages[o],action:t,onContinue:()=>async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(o<(null===m||void 0===m?void 0:m.pages.length)-1){d((e=>+e+1)),localStorage.setItem("onboarding-stages-".concat(p,"-").concat(j),JSON.stringify(e));const t=+o+1;localStorage.setItem("onboarding-page-".concat(p,"-").concat(j),t.toString())}else try{var t;u(!0);const a=await O({[null===m||void 0===m||null===(t=m.meta)||void 0===t?void 0:t.name]:e});u(!1),a&&(localStorage.removeItem("onboarding-stages-".concat(p,"-").concat(j)),v(0))}catch(a){g.a.error(a.message)}}(e.values),onPrevious:()=>(async()=>{d((e=>+e-1));const e=+o-1;localStorage.setItem("onboarding-page-".concat(p,"-").concat(j),e.toString())})(),isLoading:b},t.type)))]})});var t}})})};a(744);var $=a(228),ee=a(229);var te=()=>{const{dictionary:e}=Object(l.useContext)(d.a),t=window.location.hostname,[a,n]=Object(l.useState)(!1),[s,c]=Object(l.useState)(!1),[i,r,o,b,j,p,m,v]=Object(N.a)((e=>[e.screen,e.setScreen,e.onboarding_status,e.onboarding_stages,e.chooseOnboardingFlow,e.maxScreens,e.setMaxScreen,e.bvnScreen])),[x,f]=Object(l.useState)(),{isInactive:g,showInactiveModal:w,countDown:_,setCountDown:y,setShowInactiveModal:C,setIsInactive:k}=Object($.a)();Object(l.useLayoutEffect)((()=>{"ONBOARDING_ERROR"===i&&r(1)}),[]),Object(l.useEffect)((()=>{(async()=>{if("pending"===o&&await j(),b){n(!0);(null===b||void 0===b?void 0:b.find((e=>"form"===e.name)))||(c(!0),m(7))}})()}),[b,o]),Object(l.useEffect)((()=>{f("number"===typeof i&&10!=i?i<2?1:i-1:"ONBOARDING_ERROR"===i?"ONBOARDING_ERROR":3)}),[i]);const{translate:S}=Object(u.useTranslation)();return Object(h.jsxs)(O,{children:[Object(h.jsxs)(q.a,{children:[Object(h.jsx)("meta",{charSet:"utf-8"}),Object(h.jsx)("meta",{name:"description",content:"Sign up to view your ".concat(null===e||void 0===e?void 0:e.page_title," account online. Get instant access to your ").concat(null===e||void 0===e?void 0:e.page_title," account on the web!")}),Object(h.jsxs)("title",{children:[null===e||void 0===e?void 0:e.page_title,t.includes("lsq.")?"Web App \u2013 Powered by Lendsqr":" | Signup"]}),Object(h.jsx)("link",{rel:"canonical",href:"https://".concat(t,"/signup")}),Object(h.jsx)("noscript",{children:e?"Sign up to view your ".concat(null===e||void 0===e?void 0:e.page_title," account online. Get instant access to your ").concat(null===e||void 0===e?void 0:e.page_title," account on the web!"):"Web App - Powered by Lendsqr"})]}),Object(h.jsx)("small",{className:"d-block bg-white  mt-7 mb-4",children:"ONBOARDING_ERROR"!==x&&-1!==p&&s&&0!==i&&S("lender-web-app-step",{screen:" ".concat(x),max_screen:"".concat(p)})}),a?(()=>{if(a)switch(i){case 1:return Object(h.jsx)(P.f,{});case 2:return Object(h.jsx)(P.h,{});case 3:return Object(h.jsx)(P.g,{});case 4:return 1===v?Object(h.jsx)(P.b,{}):Object(h.jsx)(P.c,{});case 5:return Object(h.jsx)(P.e,{});case 6:return Object(h.jsx)(P.k,{});case 7:return Object(h.jsx)(P.a,{});case 8:return Object(h.jsx)(P.d,{});case 0:return Object(h.jsx)(P.j,{});case 10:return Object(h.jsx)(X,{setDisplayScreen:f,setFormRendered:c});case"ONBOARDING_ERROR":return Object(h.jsx)(U,{});default:return null}})():Object(h.jsx)(P.i,{positionTop:"100px"}),g&&Object(h.jsx)(ee.a,{showPrompt:w,close:()=>{C(!1),k(!1)},description:"Are you there?",countDown:_,setCountDown:y})]})},ae=a(230);function ne(){const e=Object(n.j)();return Object(h.jsxs)(h.Fragment,{children:[Object(ae.a)(),Object(h.jsxs)(n.e,{basename:s.a.onboard.base,children:[Object(h.jsx)(n.c,{path:"/create-password",children:Object(h.jsx)(_,{})}),Object(h.jsx)(n.c,{path:"/login",children:Object(h.jsx)(C,{})}),Object(h.jsx)(n.c,{path:"/reset",children:Object(h.jsx)(R,{})}),Object(h.jsx)(n.c,{path:"/signup",children:Object(h.jsx)(te,{})}),Object(h.jsx)(n.b,{to:{pathname:"/login",state:{location:e}}})]})]})}},440:function(e,t,a){"use strict";a.d(t,"a",(function(){return R}));var n=a(21),s=a(4),l=a(16),c=a(148),i=a(124),r=a(1),o=a(67),d=a(20),b=a(3),u=a(18),j=a(89),p=a(19),m=a(2),h=a(7),O=a(0);function v(e){let{title:t}=e;const a=Object(u.y)(),{translate:n}=Object(m.useTranslation)(),[c,i]=Object(r.useState)(""),[v,x]=Object(r.useState)(""),[f,g]=Object(r.useState)(""),[w,_]=Object(r.useState)(1),[y,N]=Object(r.useState)(10),[C,k]=Object(p.a)((e=>[e.myLoans,e.myDraftLoans]),s.shallow),S=Object(r.useMemo)((()=>[...null===C||void 0===C?void 0:C.filter((e=>{var t;return new RegExp(c||".").test("".concat(e.loan_amount))&&(!v||Object(b.m)(e.created_on)===Object(b.m)(v))&&(""===f||f===(null===(t=e.status)||void 0===t?void 0:t.status))})),...k.filter((e=>new RegExp(c||".").test("".concat(e.offer_data[0].loan_amount))&&(!v||Object(b.m)(e.created_on)===Object(b.m)(v))&&""===f&&0===e.cancellation_status))].sort(((e,t)=>new Date(t.created_on).getTime()-new Date(e.created_on).getTime()))),[c,v,f,C,k]),E=Object(r.useMemo)((()=>{const e=null===C||void 0===C?void 0:C.map((e=>{var t;return null===e||void 0===e||null===(t=e.status)||void 0===t?void 0:t.status}));return[...new Set(e)]}),[C]);Object(r.useEffect)((()=>{_(1)}),[S]);const T=Object(r.useMemo)((()=>{const e=y*w-y,t=y*w;return S.slice(e,t)}),[w,y,S]),A=Object(r.useCallback)((e=>{_(e)}),[]),L=e=>"status"in e?Object(b.q)(e.loan_amount,e.currency):Object(b.q)(e.requested_amount,e.product.currency),M=e=>"status"in e?"".concat(e.tenor," ").concat(e.tenor_period):"".concat(e.proposed_tenor," ").concat(e.proposed_tenor_period),D=e=>"".concat("status"in e?e.interest_rate:e.offer_data[0].interest_rate,"%"),F=e=>"status"in e?[Object(b.x)(e.status.status.toLowerCase(),10),o.a.statusPill(e.status.status)]:[Object(b.x)("Get This Offer",15),o.a.statusPill("")];return Object(O.jsxs)("div",{children:[Object(O.jsx)("div",{className:"table__header mb-2",children:Object(O.jsx)("p",{className:"table__header--title",children:t})}),Object(O.jsxs)("div",{className:"card default-card page-table",children:[Object(O.jsxs)("div",{className:"filter-and-search",children:[Object(O.jsxs)("div",{className:"filter-box d-flex",children:[Object(O.jsx)(h.k,{setDate:x,date:Object(b.w)(v)}),Object(O.jsxs)("div",{className:"input-group input-group-filter",children:[Object(O.jsx)("div",{className:"input-group-prepend",children:Object(O.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[n("lender-web-app-status"),":"]})}),Object(O.jsxs)("select",{value:f,onChange:e=>{g(e.target.value)},onBlur:e=>g(e.target.value),className:"form-control",children:[Object(O.jsx)("option",{value:"",selected:!0,children:n("lender-web-app-all")}),E.map((e=>Object(O.jsx)("option",{value:e,children:e},e)))]})]})]}),Object(O.jsx)("div",{className:" search-box",children:Object(O.jsx)("input",{value:c,onChange:e=>i(e.target.value),type:"search",className:"form-control",placeholder:n("lender-web-app-search-amount"),autoComplete:"false"})})]}),Object(O.jsx)("div",{className:"loans__history",children:null!==S&&void 0!==S&&S.length?Object(O.jsxs)(O.Fragment,{children:[Object(O.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(O.jsx)("thead",{children:Object(O.jsxs)("tr",{children:[Object(O.jsx)("th",{className:"date",children:n("lender-web-app-date")}),Object(O.jsx)("th",{className:"principal",children:n("lender-web-app-amount")}),Object(O.jsx)("th",{className:"tenor",children:n("lender-web-app-tenor")}),Object(O.jsx)("th",{className:"interest",children:n("lender-web-app-rate")}),Object(O.jsx)("th",{style:{textAlign:"right",width:"15%"},className:"status",children:n("lender-web-app-status")})]})}),Object(O.jsx)("tbody",{children:T.map((e=>Object(O.jsxs)("tr",{className:"link-row",onClick:()=>a.goTo(l.a.loans.details.for(e.id)),children:[Object(O.jsx)("td",{className:"date",children:Object(b.u)(new Date(e.created_on))}),Object(O.jsx)("td",{className:"principal",children:Object(O.jsx)(d.b,{to:l.a.loans.details.for(e.id),style:{color:"inherit"},children:L(e)})}),Object(O.jsx)("td",{className:"tenor",children:M(e)}),Object(O.jsx)("td",{className:"interest",children:D(e)}),Object(O.jsx)("td",{style:{textAlign:"right"},className:"status",children:Object(O.jsx)("div",{className:"status-pill ".concat(F(e)[1]),children:Object(O.jsx)("p",{children:F(e)[0]})})})]},e.id)))})]}),Object(O.jsx)("div",{className:"mobileListTable d-lg-none",children:T.map((e=>Object(O.jsxs)("div",{onClick:()=>a.goTo(l.a.loans.details.for(e.id)),className:"list",children:[Object(O.jsx)("div",{className:"row listData",children:Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("p",{className:"date",children:Object(b.v)(e.created_on)})})}),Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsxs)("div",{className:"col",children:[Object(O.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-principle")}),Object(O.jsx)("p",{className:"principal",children:L(e)})]}),Object(O.jsxs)("div",{className:"col",children:[Object(O.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-tenor")}),Object(O.jsx)("p",{className:"tenor",children:M(e)})]})]}),Object(O.jsxs)("div",{className:"row listData mt-2",children:[Object(O.jsxs)("div",{className:"col",children:[Object(O.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-interest-rate")}),Object(O.jsx)("p",{className:"interest",children:D(e)})]}),Object(O.jsxs)("div",{className:"col",children:[Object(O.jsx)("p",{className:"text-black-50 mb-0",children:n("lender-web-app-status")}),Object(O.jsx)("div",{className:"status-wrapper",children:Object(O.jsx)("div",{className:"status-pill ".concat(F(e)[1]),children:Object(O.jsx)("p",{children:F(e)[0]})})})]})]})]},e.id)))})]}):Object(O.jsx)(O.Fragment,{children:n("lender-web-app-loan-not-found")})})]}),Object(O.jsx)(j.a,{total:S.length,perPage:y,setPerPage:N,currentPage:w,pageSize:[5,10,15],setCurrentPage:_,loadPage:A})]})}var x=a(79),f=a(25),g=a(147),w=a(59),_=a(49);function y(){var e,t;const a=Object(w.a)(),l=Object(n.i)(),{translate:o}=Object(m.useTranslation)(),[d,b,j,h,y,N,C,k,S]=Object(p.a)((e=>[e.loansStatus,e.myLoans,e.productsStatus,e.products,e.fetchLoans,e.fetchDraftLoans,e.fetchProducts,e.myDraftLoans,e.closeLoanModal]),s.shallow);Object(r.useEffect)((()=>{C(),y(),N()}),[]);const[E,T,A,L,M]=Object(r.useMemo)((()=>{var e,t,a,n;return null!==b&&void 0!==b&&b.length?[b.slice(0,4),Object(u.u)("RUNNING")(b),Object(u.u)("PENDING")(b),null!==(e=null===(t=Object(u.u)("SETTLED","PAID")(b))||void 0===t?void 0:t.length)&&void 0!==e?e:0,null!==(a=null===(n=Object(u.u)("PAST DUE")(b))||void 0===n?void 0:n.length)&&void 0!==a?a:0]:[]}),[b]),D=Object(r.useMemo)((()=>{if(h.length>0)return{dots:!1,infinite:!1,speed:500,slidesToShow:(3===(null===h||void 0===h?void 0:h.length)?3:(null===h||void 0===h?void 0:h.length)<=2&&2)||4,slidesToScroll:1,nextArrow:Object(O.jsx)(_.a,{}),prevArrow:Object(O.jsx)(_.b,{}),responsive:[{breakpoint:1280,settings:{slidesToShow:2===(null===h||void 0===h?void 0:h.length)?2:3,slidesToScroll:1}},{breakpoint:900,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:500,settings:{slidesToShow:1,slidesToScroll:1}}]}}),[h]);return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{className:"row",children:Object(O.jsxs)("div",{className:"col",children:["loading"===d&&Object(O.jsxs)("div",{className:"row",children:[Object(O.jsx)("div",{className:"col-lg-4",children:Object(O.jsx)(x.a,{rounded:!0})}),Object(O.jsx)("div",{className:"col-lg-8 mt-4 mt-lg-0",children:Object(O.jsx)(x.a,{rounded:!0})})]})||"error"===d&&Object(O.jsx)("div",{className:"row mx-2",children:Object(O.jsx)("div",{className:"col bg-light-blue p-4 rounded-3",children:Object(O.jsx)("h5",{children:o("lender-web-app-no-loans-yet")})})})||Object(O.jsxs)("div",{className:"row",children:[Object(O.jsx)("div",{className:"col-lg-4",children:Object(O.jsx)(c.b,{title:o("lender-web-app-active-loans"),amount:T&&(null===T||void 0===T?void 0:T.length)>0?Object(u.x)(T.map((e=>e.loan_amount))):0,currency:null===(e=b[0])||void 0===e?void 0:e.currency})}),Object(O.jsx)("div",{className:"col-lg-8",children:Object(O.jsx)("div",{className:"card default-card statsgroup ",children:Object(O.jsxs)("div",{className:"row",children:[Object(O.jsx)(i.a,{title:o("lender-web-app-pending-loans"),count:null!==(t=null===A||void 0===A?void 0:A.length)&&void 0!==t?t:0}),Object(O.jsx)(i.a,{title:o("lender-web-app-paid-loans"),count:null!==L&&void 0!==L?L:0}),Object(O.jsx)(i.a,{title:o("lender-web-app-past-loans"),count:null!==M&&void 0!==M?M:0})]})})})]}),Object(O.jsx)("div",{className:"productGroup",children:Object(O.jsx)("div",{className:"row",children:"loading"===j&&Object(u.g)(4).map((e=>Object(O.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3",children:Object(O.jsx)(x.a,{rounded:!0})},e)))||"error"===j&&Object(O.jsx)("div",{className:"col-12",children:Object(O.jsx)("div",{className:"col bg-light-blue p-4 rounded-3",children:Object(O.jsx)("h5",{children:o("lender-web-app-error-fetching-offers")})})})||Object(O.jsx)(_.c,{settings:D,children:null===h||void 0===h?void 0:h.map((e=>Object(O.jsx)("div",{className:"col-12 col-md-6 mb-4 col-lg-4 col-xl-3 px-2",children:Object(O.jsx)(c.a,{productId:e.id,name:e.name,interestRate:e.interest_rate,interestPeriod:e.interest_period,minAmount:e.min_amount,maxAmount:e.max_amount,currency:null===e||void 0===e?void 0:e.currency})},e.id)))})})}),Object(O.jsx)("div",{className:"row mt-4",children:Object(O.jsx)("div",{className:"col-12",children:"loading"!==d||E?(b.length>0||k.length>0)&&Object(O.jsx)(v,{title:o("lender-web-app-loan-history")}):Object(O.jsx)(x.a,{rounded:!0,height:260})})})]})}),Object(O.jsx)(f.a,{close:()=>{l.push("/loans"),S(),y(),N()},description:o("lender-web-app-loan-application"),show:!!a.get("id"),className:"",isUpload:!1,children:a.get("id")&&Object(O.jsx)(g.a,{})})]})}function N(){const e=Object(u.y)(),[t,a]=Object(r.useState)(""),[n,c]=Object(r.useState)(""),[i,v]=Object(r.useState)("All"),{translate:x}=Object(m.useTranslation)(),f=Object(p.a)(Object(r.useCallback)((e=>{var a;return null===(a=e.myLoans)||void 0===a?void 0:a.filter((e=>{var a;return new RegExp(t||".").test("".concat(e.loan_amount))&&(!n||Object(b.m)(e.created_on)===Object(b.m)(n))&&("All"===i||"string"===typeof i&&i===(null===(a=e.status)||void 0===a?void 0:a.status))}))}),[t,n,i]),s.shallow),[g,w]=Object(r.useState)(1);Object(r.useEffect)((()=>{w(1)}),[f]);const _=Object(r.useMemo)((()=>{const e=new Set;return f.map((t=>e.add(t.status.status))),[...e]}),[f]);Object(r.useEffect)((()=>{w(1)}),[f]);const[y,N]=Object(r.useState)(15),C=Object(r.useMemo)((()=>{const e=y*g-y,t=y*g;return f.slice(e,t)}),[g,y,f]),k=Object(r.useCallback)((e=>{w(e)}),[]);return Object(O.jsx)("div",{className:"row",children:Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("div",{className:"row",children:Object(O.jsxs)("div",{className:"col-12",children:[Object(O.jsx)("div",{className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(O.jsxs)(d.b,{to:l.a.loans.base,href:"loans.html",className:"btn-with-navig_navig d-inline-flex justify-content-center align-items-center bg-transparent border-0",children:[Object(O.jsx)("div",{className:"icon d-flex align-items-center",children:Object(O.jsx)("svg",{width:"20",height:"20",children:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(O.jsx)("p",{children:x("lender-web-app-back-loans")})]})}),Object(O.jsx)("div",{className:"pageTitle",children:Object(O.jsx)("p",{children:x("lender-web-app-loan-history")})}),Object(O.jsxs)("div",{className:"card default-card page-table",children:[Object(O.jsxs)("div",{className:"filter-and-search",children:[Object(O.jsxs)("div",{className:"filter-box d-flex",children:[Object(O.jsx)(h.k,{setDate:c,date:n}),Object(O.jsxs)("div",{className:"input-group input-group-filter",children:[Object(O.jsx)("div",{className:"input-group-prepend",children:Object(O.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[x("lender-web-app-status"),":"]})}),Object(O.jsxs)("select",{value:i,onChange:e=>v(e.target.value),onBlur:e=>v(e.target.value),className:"form-control",children:[Object(O.jsx)("option",{value:"",selected:!0,children:x("lender-web-app-all")}),_.map((e=>Object(O.jsx)("option",{value:e,children:e},e)))]})]})]}),Object(O.jsx)("div",{className:" search-box",children:Object(O.jsx)("input",{value:t,onChange:e=>a(e.target.value),type:"search",className:"form-control",placeholder:x("lender-web-app-search-amount"),autoComplete:"false"})})]}),Object(O.jsxs)("div",{className:"loans__history",children:[Object(O.jsxs)("table",{className:"table d-none d-lg-table",children:[Object(O.jsx)("thead",{children:Object(O.jsxs)("tr",{children:[Object(O.jsx)("th",{className:"date",children:x("lender-web-app-date")}),Object(O.jsx)("th",{className:"principal",children:x("lender-web-app-amount")}),Object(O.jsx)("th",{className:"tenor",children:x("lender-web-app-tenor")}),Object(O.jsx)("th",{className:"interest",children:x("lender-web-app-rate")}),Object(O.jsx)("th",{style:{textAlign:"right",width:"15%"},className:"status",children:x("lender-web-app-status")})]})}),Object(O.jsx)("tbody",{children:C.map((t=>Object(O.jsxs)("tr",{className:"link-row",onClick:()=>e.goTo(l.a.loans.details.for(t.id)),children:[Object(O.jsx)("td",{className:"date",children:Object(b.u)(new Date(t.created_on))}),Object(O.jsx)("td",{className:"principal",children:Object(O.jsx)(d.b,{to:l.a.loans.details.for(t.id),style:{color:"inherit"},children:Object(b.q)(t.loan_amount,null===t||void 0===t?void 0:t.currency)})}),Object(O.jsxs)("td",{className:"tenor",children:[t.tenor," ",t.tenor_period]}),Object(O.jsxs)("td",{className:"interest",children:[t.interest_rate,"%"]}),Object(O.jsx)("td",{style:{textAlign:"right"},className:"status",children:Object(O.jsx)("div",{className:"status-pill ".concat(o.a.statusPill(t.status.status)),children:Object(O.jsx)("p",{children:Object(b.x)(t.status.status.toLowerCase(),10)})})})]},t.id)))})]}),Object(O.jsx)("div",{className:"mobileListTable d-lg-none",children:C.map((t=>Object(O.jsxs)("div",{onClick:()=>e.goTo(l.a.loans.details.for(t.id)),className:"list",children:[Object(O.jsx)("div",{className:"row listData",children:Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("p",{className:"date",children:Object(b.v)(t.created_on)})})}),Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("p",{className:"principal",children:Object(b.q)(t.loan_amount,null===t||void 0===t?void 0:t.currency)})}),Object(O.jsx)("div",{className:"col",children:Object(O.jsxs)("p",{className:"tenor",children:[t.tenor," ",t.tenor_period]})})]}),Object(O.jsxs)("div",{className:"row listData",children:[Object(O.jsx)("div",{className:"col",children:Object(O.jsxs)("p",{className:"interest",children:[t.interest_rate,"%"]})}),Object(O.jsx)("div",{className:"col",children:Object(O.jsx)("div",{className:"status-wrapper",children:Object(O.jsx)("div",{className:"status-pill ".concat(o.a.statusPill(t.status.status)),children:Object(O.jsx)("p",{children:Object(b.x)(t.status.status.toLowerCase(),10)})})})})]})]},t.id)))})]})]}),Object(O.jsx)(j.a,{total:f.length,perPage:y,setPerPage:N,currentPage:g,pageSize:[15,20,25],setCurrentPage:w,loadPage:k})]})})})})}var C=a(13),k=a(130),S=a(114),E=a(6),T=a(90),A=a(11),L=a(10),M=a(9),D=a(32);function F(){var e,t,a;const[l,c]=Object(r.useState)("Debit Card"),[i,o]=Object(r.useState)(""),[d,u]=Object(r.useState)(),[j,v]=Object(r.useState)(""),[x,f]=Object(r.useState)(!1),[g,w]=Object(r.useState)("repay"),[_,y]=Object(r.useState)(""),{productId:N}=(null===(e=Object(n.j)())||void 0===e?void 0:e.state)||{},{translate:k}=Object(m.useTranslation)(),[S,T,F]=Object(p.a)((e=>[e.myLoans,e.fetchUssd,e.ussd]),s.shallow),[R,P]=Object(C.a)((e=>[e.wallet,e.fetchWallet]),s.shallow);Object(r.useEffect)((()=>{P()}),[]);const q=Object(r.useMemo)((()=>null===S||void 0===S?void 0:S.find((e=>e.id===+N))),[N]);Object(r.useEffect)((()=>{v(""),"USSD"===l&&T(d)}),[l]);const U=Object(n.i)(),B=null!==(t=null===q||void 0===q||null===(a=q.schedules)||void 0===a?void 0:a.reduce(((e,t)=>e+parseFloat("".concat(t.amount_due))),0))&&void 0!==t?t:0;return Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("div",{style:{flex:1},className:"btn-with-navig d-inline-flex justify-content-between align-items-center",children:Object(O.jsxs)("button",{onClick:()=>U.goBack(),className:"bg-transparent border-0 btn-with-navig_navig d-inline-flex justify-content-center align-items-center",children:[Object(O.jsx)("div",{className:"icon d-flex align-items-center ",children:Object(O.jsx)("svg",{width:"20",height:"20",children:Object(O.jsx)("use",{xlinkHref:"/icon-sprite.svg#go-back-icon"})})}),Object(O.jsx)("p",{children:k("lender-web-app-back-to-loans")})]})}),Object(O.jsx)("div",{className:"pageTitle",children:Object(O.jsx)("p",{children:k("lender-web-app-loan-repayment")})}),Object(O.jsx)("div",{style:{maxWidth:"700px",minHeight:"500px"},className:"card default-card",children:Object(O.jsx)("div",{className:"py-2 m-4 row ",children:Object(O.jsxs)("div",{className:"pl-4 col-12 repayment-form loan-form ",children:["repay"===g?Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("p",{className:"mb-2 text-black fs-5 fw-bold",children:k("lender-web-app-how-much-repay")}),Object(O.jsx)("div",{className:"form-group",children:Object(O.jsx)(h.e,{placeholder:"Enter an amount",label:"Amount",onChange:e=>u(e),className:"form-control ".concat(d&&d>B&&"is-invalid"),info:Object(O.jsxs)("small",{className:"mt-2 form-text ".concat(d&&(d>B?"text-danger":"text-primary"),"  p-2 rounded-3 bg-light-blue d-block"),children:["Wallet"!==l&&k("lender-web-app-maximum-is",{money:Object(b.q)(B)}),"Wallet"===l&&k("lender-web-app-maximum-is-wallet",{money:Object(b.q)(B),wallet_balance:Object(b.q)(null===R||void 0===R?void 0:R.account_balance)})]})})}),Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("p",{className:"text-black fs-5 fw-bold",children:k("lender-web-app-how-to-repay")}),Object(O.jsx)("small",{className:"text-black-50",children:k("lender-web-app-select-repayment-method")}),Object(O.jsx)("div",{className:"justify-between row type repayment-method",children:["Wallet","Debit Card"].map((e=>Object(O.jsx)("div",{className:"col-6 col-sm-4",children:Object(O.jsx)(h.g,{disabled:"USSD"===e&&!d,label:e,checked:l===e,onChange:()=>c(e)})},e)))}),"Debit Card"===l&&Object(O.jsxs)("div",{className:"col",children:[Object(O.jsx)(I,{chosen:i,onChange:o}),Object(O.jsx)("div",{className:"mt-4"})]})]})]}):Object(O.jsxs)(O.Fragment,{children:[Object(O.jsx)("p",{className:"text-black fs-5 fw-bold",children:k("lender-web-app-authorize-transaction")}),Object(O.jsx)("small",{className:"text-black-50",children:k("lender-web-app-enter-transaction-pin")}),Object(O.jsx)("p",{className:"mt-5 ",children:k("lender-web-app-please-enter-pin")}),Object(O.jsx)(h.o,{length:4,onChange:e=>{y(e)},password:!0})]}),Object(O.jsxs)("div",{className:"mt-3 d-flex justify-content-between control",children:[Object(O.jsx)(E.a,{type:"button",onClick:()=>"pin"===g?w("repay"):U.goBack(),className:"px-5 py-3 btn w-100 me-3 btn-outline-primary btn-lg",children:k("lender-web-app-back")}),Object(O.jsx)(E.a,{isLoading:x,onClick:()=>"repay"===g?w("pin"):(async()=>{f(!0);const e={amount:Number(d),pin:_};"Debit Card"===l&&(e.card_id=i),"Wallet"===l&&(e.use_wallet=!0);try{if("USSD"===l)await Object(A.a)(Object(L.K)(F.id),"get");else{const t=await Object(A.a)(Object(L.ac)(N),"post",e);M.toast.success(null===t||void 0===t?void 0:t.message),f(!1)}window.location.href="/loans/".concat(N),Object(D.a)({event_name:D.b.LOAN_REPAYMENT,loan_id:N})}catch(t){M.toast.error(t.message),f(!1)}})(),isDisabled:!d||d>B||"Debit Card"===l&&!i||"USSD"===l&&!j,className:"px-5 py-3 btn w-100 btn-primary btn-lg",children:k("lender-web-app-repay-now")})]})]})})})]})}function I(e){let{onChange:t,chosen:a}=e;const[n,l]=Object(C.a)((e=>[e.initCard,e.cardInitStatus]),s.shallow),[c,i]=Object(C.a)((e=>[e.cards,e.fetchCards]),s.shallow);return Object(r.useEffect)((()=>{i()}),[]),Object(O.jsxs)("div",{className:"small",children:[Object(O.jsx)(_.c,{children:null===c||void 0===c?void 0:c.map((e=>Object(O.jsx)("div",{className:"col-12 col-md-6 col-lg-4 col-xl-3 px-2",children:Object(O.jsx)(S.a,{card:e,defaultChecked:+a===e.id,value:e.id,onChange:e=>{t(e.target.value)}})},e.id)))}),Object(O.jsx)(T.a,{allowCard:!0,allowBank:!1,renderButton:e=>Object(O.jsx)("div",{className:"w-100 d-flex justify-content-center",children:Object(O.jsx)("button",{type:"button",className:"text-primary border-0 bg-transparent",onClick:()=>{"idle"===l?n().then((()=>e())).catch((e=>{console.log(e,"error initiating card")})):e()},children:"loading"===l?Object(O.jsx)("div",{className:"spinner-border",role:"status",children:Object(O.jsx)("span",{className:"visually-hidden",children:"Loading..."})}):Object(O.jsx)("p",{className:"mt-2",children:"Add new card"})})})})]})}function R(){const e=Object(n.j)(),t=Object(C.a)((e=>e.fetchUserGuarantors)),[a,c,i]=Object(p.a)((e=>[e.fetchLoans,e.fetchProducts,e.fetchDraftLoans]),s.shallow);return Object(r.useEffect)((()=>{a(),c(),i(),t()}),[]),Object(O.jsx)("div",{className:"main__content ".concat(e.pathname.match(/loans\/\d+/)?"loanDetails":"loans"),children:Object(O.jsxs)(n.e,{children:[Object(O.jsx)(n.c,{path:l.a.loans.history,children:Object(O.jsx)(N,{})}),Object(O.jsx)(n.c,{path:l.a.loans.apply.base,children:Object(O.jsx)(g.a,{})}),Object(O.jsx)(n.c,{path:l.a.loans.repay.definition,children:Object(O.jsx)(F,{})}),Object(O.jsx)(n.c,{path:l.a.loans.details.definition,children:Object(O.jsx)(k.a,{})}),Object(O.jsx)(n.c,{exact:!0,path:l.a.loans.base,children:Object(O.jsx)(y,{})})]})})}},441:function(e,t,a){"use strict";a.d(t,"a",(function(){return S}));var n=a(1),s=a(4),l=a(45),c=a(20),i=a(21),r=a(16),o=a(13),d=a(6),b=a(29),u=a(255),j=(a(401),a(2)),p=a(180),m=a(15),h=a(0);function O(){var e;const{translate:t}=Object(j.useTranslation)(),{country:a}=m.a.getState(),s=Object(o.a)((e=>e.profile)),l=Object(n.useMemo)((()=>{switch(null===s||void 0===s?void 0:s.selfie_bvn_check){case"Failed":default:return"failed";case"Pending":return"pending"}}),[s]);return Object(h.jsxs)("div",{className:"error-banner ".concat(l),children:["NGA"===a&&"Failed"===(null===s||void 0===s?void 0:s.selfie_bvn_check)||"NGA"!==a&&"Failed"===(null===s||void 0===s?void 0:s.selfie_id_check)&&Object(h.jsx)("a",{href:"/settings",children:null!==(e=null===s||void 0===s?void 0:s.reason)&&void 0!==e?e:t("lender-web-app-selfie-id-failed")}),"NGA"===a&&"Pending"===(null===s||void 0===s?void 0:s.selfie_bvn_check)||"NGA"!==a&&"Pending"===(null===s||void 0===s?void 0:s.selfie_id_check)&&Object(h.jsx)("p",{children:t("lender-web-app-selfie-id-pending")})]})}const v=e=>{let{...t}=e;return Object(h.jsx)(c.c,{className:"nav-link",activeClassName:"active-page",...t})},x="0.7.2",f="e6cf7bd";function g(e){let{showNav:t,toggleNav:a}=e;const{translate:s}=Object(j.useTranslation)(),g=Object(i.j)(),{assets:w,dictionary:_,configs:y}=Object(n.useContext)(b.a),[N,C]=Object(n.useState)(!1),[k,S]=Object(n.useState)(!1),{country:E}=m.a.getState(),T=window.location.hostname,A=Object(o.a)((e=>e.profile)),L=Object(l.a)((e=>e.logout));Object(n.useEffect)((()=>{S(!1)}),[g]);const M=Object(n.useRef)();return Object(n.useEffect)((()=>{const e=M.current,t=t=>{e&&(e.contains(t.target)||S(!1))};return document.addEventListener("pointerdown",t),()=>{document.removeEventListener("pointerdown",t)}}),[]),Object(h.jsxs)("div",{className:"app-nav",children:["NGA"===E&&("Failed"===(null===A||void 0===A?void 0:A.selfie_bvn_check)||"Pending"===(null===A||void 0===A?void 0:A.selfie_bvn_check))||"NGA"!==E&&("Failed"===(null===A||void 0===A?void 0:A.selfie_id_check)||"Pending"===(null===A||void 0===A?void 0:A.selfie_id_check))&&Object(h.jsx)(O,{}),Object(h.jsxs)("nav",{className:"navbar topnav container",children:[Object(h.jsxs)("div",{className:"topnav__left",children:[Object(h.jsx)("button",{onClick:a,className:"navbar-toggler",type:"button",children:Object(h.jsx)("svg",{width:"24",height:"24",className:"nav-togler-icon",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#menu"})})}),Object(h.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"left"},children:[Object(h.jsx)(c.b,{className:"",to:"/",children:Object(h.jsx)("img",{style:{height:"40px",width:"auto"},src:null===w||void 0===w?void 0:w.logo_url,alt:" Logo",className:"nav-logo-image"})}),(T.includes("lsq.")||"localhost"===T)&&y&&("1"===y["show-lendsqr-brand"]||"true"===y["show-lendsqr-brand"])&&Object(h.jsxs)("small",{className:"nav-small-text",children:[s("lender-web-app-powered-by",{webview:window.ReactNativeWebView?"app":"webapp"})," ",Object(h.jsxs)("a",{href:"https://lendsqr.com?utm_source=".concat(T,"&utm_medium=webapp"),target:"_blank",rel:"noreferrer",style:{color:"#23C6A1"},children:[" ","Lendsqr"]})]})]}),Object(h.jsxs)("ul",{className:"nav",children:[Object(h.jsx)("li",{className:"nav-item",children:Object(h.jsx)(v,{to:r.a.dashboard.index,children:s("lender-web-app-home")})}),Object(h.jsx)("li",{className:"nav-item",children:Object(h.jsx)(v,{to:r.a.loans.base,children:s("lender-web-app-loans")})}),(null===_||void 0===_?void 0:_.enable_and_name_savings)&&Object(h.jsx)("li",{className:"nav-item",children:Object(h.jsx)(v,{to:r.a.investments.base.for(null===_||void 0===_?void 0:_.enable_and_name_savings.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),children:null===_||void 0===_?void 0:_.enable_and_name_savings})})]})]}),Object(h.jsx)("div",{className:"topnav__profile",children:Object(h.jsxs)("div",{className:"dropdown topnav-dropdown",children:[Object(h.jsxs)("div",{className:"profile",onClick:()=>S((e=>!e)),"aria-expanded":"false",children:[Object(h.jsx)("div",{className:"profile-picture",children:null!==A&&void 0!==A&&A.photo_url?Object(h.jsx)(c.b,{to:r.a.settings.base,className:"image-container",children:Object(h.jsx)("img",{src:A.photo_url,alt:"profile",className:"nav-profile-image"})}):Object(h.jsx)(c.b,{to:r.a.settings.base,className:"image-container emptyImageContainer",hidden:!0,children:Object(h.jsx)("img",{src:"/svgs/avatar.svg",alt:"profile",className:"nav-profile-image"})})}),Object(h.jsx)("p",{className:"profile-name",children:null===A||void 0===A?void 0:A.first_name}),Object(h.jsx)("svg",{id:"drop-icon",width:"8",height:"5",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#drop-icon"})})]}),Object(h.jsxs)("div",{className:"dropdown-menu ".concat(k?"show":""),ref:M,children:[Object(h.jsx)(c.b,{className:"dropdown-item",to:r.a.settings.base,children:s("lender-web-app-settings")}),Object(h.jsx)("button",{onClick:()=>{C(!0)},className:"dropdown-item",children:s("lender-web-app-logout")}),Object(h.jsx)(u.a,{showPrompt:N,close:()=>{C(!1)},logout:()=>{C(!1),L()},description:s("lender-web-app-confirm-logout"),warningMessage:s("lender-web-app-sure-logout")}),x&&Object(h.jsxs)("p",{className:"dropdown-item text-black-50 text-x-small",children:[s("lender-web-app-version")," ",x," (",f,")"]})]})]})}),Object(h.jsx)("div",{className:"menu-overlay",style:{display:t?"block":"none"},id:"mobilenav",children:Object(h.jsxs)("div",{className:"topnav__slideout animate__animated ".concat(t?"animate__slideInLeft":""),children:[Object(h.jsx)("div",{onClick:a,className:"logo-img",children:Object(h.jsxs)(v,{to:r.a.dashboard.index,children:[Object(h.jsx)("img",{style:{height:"40px",width:"auto"},src:null===w||void 0===w?void 0:w.logo_url,alt:" Logo"})," "]})}),Object(h.jsx)("div",{className:"close-btn",onClick:a,children:Object(h.jsx)("svg",{width:"16",height:"16",children:Object(h.jsx)("use",{xlinkHref:"/icon-sprite.svg#close-icon"})})}),Object(h.jsxs)("ul",{className:"nav",children:[Object(h.jsx)("li",{onClick:a,className:"nav-item",children:Object(h.jsx)(v,{to:r.a.dashboard.index,children:s("lender-web-app-home")})}),Object(h.jsx)("li",{onClick:a,className:"nav-item",children:Object(h.jsx)(v,{to:r.a.loans.base,children:s("lender-web-app-loans")})}),(null===_||void 0===_?void 0:_.enable_and_name_savings)&&Object(h.jsx)("li",{onClick:a,className:"nav-item",children:Object(h.jsx)(v,{to:r.a.investments.base.for(null===_||void 0===_?void 0:_.enable_and_name_savings.replace(/ /g,"").replace(/[^a-zA-Z0-9]/g,"-")),children:null===_||void 0===_?void 0:_.enable_and_name_savings})}),Object(h.jsx)("li",{onClick:a,className:"nav-item",children:Object(h.jsx)(v,{to:r.a.settings.base,children:s("lender-web-app-settings")})}),Object(h.jsx)("li",{className:"nav-item",children:Object(h.jsx)("div",{className:"nav-link",children:Object(h.jsx)("div",{className:"mob-language",children:Object(h.jsx)(p.a,{})})})}),Object(h.jsx)("li",{className:"nav-item",children:Object(h.jsx)(d.a,{onClick:L,className:"nav-link",children:s("lender-web-app-logout")})})]})]})})]})]})}var w=a(25);const _=()=>Object(h.jsx)("svg",{width:"72.5",height:"155",viewBox:"0 0 225 450",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(h.jsxs)("g",{className:"text-primary",children:[Object(h.jsx)("path",{d:"M0.333557 106.813H2.80322V39.1572C2.80322 34.015 3.81605 28.9232 5.78387 24.1724C7.7517 19.4217 10.636 15.105 14.2721 11.4689C17.9081 7.83282 22.2248 4.94852 26.9756 2.98068C31.7263 1.01284 36.8182 3.93973e-06 41.9604 0H185.298C190.44 -1.05057e-05 195.532 1.01281 200.283 2.98064C205.033 4.94846 209.35 7.83275 212.986 11.4688C216.622 15.1049 219.507 19.4215 221.474 24.1723C223.442 28.9231 224.455 34.0149 224.455 39.1571V410.321C224.455 415.463 223.442 420.555 221.475 425.306C219.507 430.056 216.622 434.373 212.986 438.009C209.35 441.645 205.034 444.53 200.283 446.497C195.532 448.465 190.44 449.478 185.298 449.478H41.9606C31.5754 449.478 21.6156 445.353 14.2722 438.009C6.9288 430.666 2.80328 420.706 2.80325 410.321V154.971H0.333557V106.813Z",fill:"#3F3D56"}),Object(h.jsx)("path",{d:"M40.3805 10.1873H59.0908C58.2304 12.2969 57.9019 14.5856 58.1344 16.8519C58.3669 19.1183 59.1531 21.2927 60.4239 23.1836C61.6947 25.0745 63.411 26.6239 65.4216 27.6952C67.4322 28.7666 69.6755 29.327 71.9537 29.3272H154.07C156.348 29.327 158.591 28.7666 160.602 27.6952C162.613 26.6239 164.329 25.0745 165.6 23.1836C166.871 21.2927 167.657 19.1183 167.889 16.8519C168.122 14.5856 167.793 12.2968 166.933 10.1873H184.408C192.164 10.1873 199.602 13.2682 205.086 18.7521C210.57 24.2361 213.65 31.6739 213.65 39.4294V410.049C213.65 413.889 212.894 417.691 211.425 421.239C209.955 424.787 207.801 428.011 205.086 430.726C202.37 433.441 199.147 435.595 195.599 437.065C192.051 438.534 188.248 439.291 184.408 439.291H40.3805C36.5404 439.291 32.7379 438.534 29.19 437.065C25.6422 435.595 22.4186 433.441 19.7032 430.726C16.9878 428.011 14.8338 424.787 13.3643 421.239C11.8947 417.691 11.1383 413.889 11.1383 410.049V410.049V39.4295C11.1383 35.5893 11.8947 31.7868 13.3643 28.239C14.8338 24.6912 16.9878 21.4675 19.7032 18.7522C22.4186 16.0368 25.6422 13.8828 29.19 12.4133C32.7379 10.9437 36.5404 10.1873 40.3805 10.1873Z",fill:"white"}),Object(h.jsx)("path",{d:"M143.252 114.016H81.5367V128.909H143.252V114.016Z",fill:"currentColor"}),Object(h.jsx)("path",{d:"M146.19 178.009H78.5986V192.901H146.19V178.009Z",fill:"#E5E5E5"}),Object(h.jsx)("path",{d:"M187.823 210H36.9653V224.892H187.823V210Z",fill:"#E5E5E5"}),Object(h.jsx)("path",{d:"M187.823 241.99H36.9653V256.883H187.823V241.99Z",fill:"#E5E5E5"}),Object(h.jsx)("path",{d:"M112.471 385.405C136.346 385.405 155.701 366.051 155.701 342.175C155.701 318.3 136.346 298.945 112.471 298.945C88.5955 298.945 69.2408 318.3 69.2408 342.175C69.2408 366.051 88.5955 385.405 112.471 385.405Z",fill:"currentColor"}),Object(h.jsx)("path",{d:"M108.351 360.424L95.413 343.787L102.937 337.935L109.063 345.812L129.76 323.964L136.681 330.521L108.351 360.424Z",fill:"white"})]})});var y=function(e){let{showDownloadModal:t,setShowDownloadModal:a}=e;const{configs:s}=Object(n.useContext)(b.a),{translate:l}=Object(j.useTranslation)();return Object(h.jsx)(w.a,{show:t,close:()=>a(!1),isUpload:!1,description:l("lender-web-app-download-mobile-app"),children:Object(h.jsxs)("div",{className:"modal-body",children:[Object(h.jsx)("div",{className:"text-center",children:Object(h.jsx)(_,{})}),Object(h.jsxs)("div",{className:"text-center mt-3",children:[Object(h.jsx)("p",{className:"fs-4 fw-bold text-primary",children:l("lender-web-app-download-now")}),Object(h.jsx)("p",{className:"text-app-gray",children:l("lender-web-app-enjoy-mobile")})]}),Object(h.jsx)("div",{className:"d-flex justify-content-center flex-wrap w-100 mx-auto gap-3 mt-4",children:(null===s||void 0===s?void 0:s.app_stores)&&JSON.parse(s.app_stores).map((e=>Object(h.jsx)("a",{href:null===e||void 0===e?void 0:e.store_url,style:{width:"calc(50% - 0.75rem)",maxWidth:"180px"},target:"_blank",rel:"noopenner noreferrer",children:Object(h.jsx)("img",{src:null===e||void 0===e?void 0:e.store_icon_url,className:"w-100",alt:""})},e.store_url)))})]})})},N=a(229),C=a(228);const k=()=>{const e=Object(m.a)((e=>e.customer_support_email)),t=Object(m.a)((e=>e.customer_support_phone)),a=Object(o.a)((e=>e.setNotAllowed));return Object(h.jsx)(w.a,{show:!0,close:()=>a(!1),description:"Transanction Not allowed",subDescription:"",children:Object(h.jsx)("div",{className:"modal-body account-modal-body",children:Object(h.jsxs)("div",{className:"d-flex py-10 flex-column",children:[Object(h.jsx)("p",{style:{marginBottom:"16px",fontWeight:"bold"},children:"Error: Ops! You cannot do any transfer at this time as the following are not approved or provided:"}),Object(h.jsxs)("ul",{children:[Object(h.jsx)("li",{children:"Your ID document is yet to be approved"}),Object(h.jsx)("li",{children:"Your ID document is yet to be provided"}),Object(h.jsx)("li",{children:"Your selfie image is yet to be verified "})]}),Object(h.jsx)("p",{style:{marginTop:"16px",marginBottom:"8px",fontWeight:"bold"},children:"How to solve this problem"}),Object(h.jsxs)("p",{children:["Please provide the missing document or email ",e," or call ",t," for assistance."]})]})})})};function S(e){let{children:t}=e;const[a,l]=Object(n.useState)(!1),{configs:c}=Object(n.useContext)(b.a),{isInactive:i,showInactiveModal:r,countDown:d,setCountDown:u,setShowInactiveModal:j,setIsInactive:p}=Object(C.a)(),m=Object(n.useCallback)((()=>{l((e=>!e))}),[]),[O,v,x,f,w]=Object(o.a)((e=>[e.downloadModalApp,e.setDownloadAppModal,e.profile,e.setShowLanguageDrop,e.transanction_not_allowed]),s.shallow),_=Object(n.useMemo)((()=>{switch(null===x||void 0===x?void 0:x.selfie_bvn_check){case"Failed":case"Pending":return"50px";default:return"0px"}}),[]);return Object(h.jsxs)("div",{className:"container",onClick:()=>f(!1),children:[Object(h.jsx)(g,{toggleNav:m,showNav:a}),!window.ReactNativeWebView&&""!==(null===c||void 0===c?void 0:c.app_stores)&&Object(h.jsx)(y,{showDownloadModal:O,setShowDownloadModal:v}),Object(h.jsx)("main",{className:"main ".concat(a?"lock-scroll":""),style:{marginTop:_},children:t}),i&&Object(h.jsx)(N.a,{showPrompt:r,close:()=>{j(!1),p(!1)},description:"Are you there?",countDown:d,setCountDown:u,isLoggedIn:!0}),w&&Object(h.jsx)(k,{})]})}},45:function(e,t,a){"use strict";var n=a(86),s=a(10),l=a(9),c=a(53),i=a(61),r=a(33),o=a(11),d=a(15),b=a(13),u=a(127),j=a(101),p=a(132),m=a(51),h=a(32),O=a(18),v=a(54),x=a(2),f=a(19),g=a(41);Object(r.b)();const w={sessionTimeoutId:"",loginUserSuccess:!1,user:void 0,org_id:"",access_token:"",session_id:"",refresh_token:"",signingIn:!1,timeout:null},_="0.7.2",y=Object(c.create)()(Object(i.devtools)(Object(i.persist)(((e,t)=>({...w,login:async a=>{let{phone_number:l,password:c,device_id:i}=a;const{handleLoginResult:r}=t();e({signingIn:!0});try{var o;const t=await Object(O.m)(!1).catch((()=>({longitude:void 0,latitude:void 0}))),a=await n.a.post(s.Bb,{phone_number:l,password:c,device_id:i,longitude:t.longitude?String(t.longitude):void 0,latitude:t.latitude?String(t.latitude):void 0,version_id:_,mobile_os:null!==(o=null===v.osName||void 0===v.osName?void 0:v.osName.toLowerCase())&&void 0!==o?o:void 0,device_name:"".concat("none"===v.mobileVendor?"":v.mobileVendor||""," ").concat(v.mobileModel).trim()||"".concat(v.deviceType||""," ").concat(v.browserName||""," ").concat(v.browserVersion||"").trim()||void 0,os_version:null!==v.osVersion&&void 0!==v.osVersion?v.osVersion:void 0});a?r(a,l):e({signingIn:!1})}catch(d){e({signingIn:!1}),N(d)}},handleLoginSuccess:(a,n)=>{const s=Object(r.a)(t(),(e=>{const t={...a.data.data};t.access_token=a.data.data.token,t.stage_id=a.data.data.stage_id,t.activated=a.data.data.activated,t.referral_code=a.data.data.referral_code,t.phone=n,t.session_id=a.data.session_id,e.session_id=a.data.session_id,e.user=t,e.loginUserSuccess=!0}));g.a.getState().setToken(a.data.data),e(s),Object(h.a)({event_name:h.b.AUTHENTICATION_LOG_IN})},handleLoginResult:(a,n)=>{var s;const{handleLoginSuccess:l}=t();var c,i;if(null!==(s=a.data.data)&&void 0!==s&&s.token&&window.ReactNativeWebView&&C(a),a.data.data.set_password)throw e({access_token:a.data.data.access_token}),g.a.getState().setToken(a.data.data),new Error((null===(c=a.data)||void 0===c?void 0:c.message)||"An unknown error occurred");if(!a.data.data.activated){var r;const{token:t,stage_id:s,refresh_token:l,id:c}=a.data.data;throw d.a.setState({token:t,phone_number:n,refresh_token:l,user_id:c,onboarding_status:"pending",screen:s+3}),e({session_id:a.data.session_id}),g.a.getState().setToken(a.data.data),new Error((null===(r=a.data)||void 0===r?void 0:r.message)||"An unknown error occurred")}if("success"!==a.data.status)return k(null===(i=a.data)||void 0===i?void 0:i.message);l(a,n)},storePermissionToken:async e=>{try{await Object(o.a)(s.ec,"put",{notification_token:e})}catch(t){console.log(t)}},logout(){const{sessionTimeoutId:t}=g.a.getState();clearInterval(t),b.a.getState().reset(),u.a.getState().reset(),j.a.getState().reset(),p.a.getState().reset(),m.a.getState().reset(),f.a.getState().reset(),g.a.getState().reset(),e(w)},setPasswordandPin:async t=>{e({signingIn:!0});try{await Object(o.a)(s.rb,"post",t),e({signingIn:!1})}catch(c){var a,n;return null!==c&&void 0!==c&&c.isAxiosError?(e({signingIn:!1}),l.toast.error(null===(a=c.response.data)||void 0===a?void 0:a.message),Promise.reject(new Error(null===(n=c.response.data)||void 0===n?void 0:n.message))):(e({signingIn:!1}),l.toast.error(c.message),Promise.reject(new Error(c.message)))}},refreshToken:async()=>{const a=t().refresh_token;if(a)try{const n=await Object(o.a)(s.Fb,"post",{token:a}),l=Object(r.a)(t(),(e=>{var t;e.access_token=n.data.access_token;let a=72e4;null!==n&&void 0!==n&&null!==(t=n.data)&&void 0!==t&&t.expires_in&&(a=n.data.expires_in),e.timeout=a}));e(l)}catch(n){console.dir(n)}},reset:()=>{e({signingIn:!1})}})),{name:"app.auth"})));t.a=y;const N=e=>{var t,a;if(null!==e&&void 0!==e&&e.isAxiosError&&(null!==e&&void 0!==e&&e.response))throw new Error(null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message);throw e.message.includes("proceed")?l.toast.success(e.message):l.toast.error(e.message),new Error(e.message)},C=e=>{var t;null===(t=window.ReactNativeWebView)||void 0===t||t.postMessage(JSON.stringify({method:"initFCM",arguments:{url:s.ec,method:"PUT",access_token:e.data.data.token},callback:""}))},k=async e=>{const t=await Object(x.translate)("lender-web-app-error-message",{err:e});l.toast.error(t)}},49:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return r}));a(1);var n=a(309),s=a.n(n),l=(a(731),a(732),a(0));const c={dots:!1,infinite:!1,speed:500,slidesToShow:2,slidesToScroll:1,nextArrow:Object(l.jsx)(i,{}),prevArrow:Object(l.jsx)(r,{}),responsive:[{breakpoint:500,settings:{slidesToShow:1,slidesToScroll:1}}]};function i(e){const{className:t,style:a,onClick:n}=e;return Object(l.jsxs)("svg",{onClick:n,className:t,style:{...a,width:"48px",height:"48px",right:"-15px",zIndex:1},width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(l.jsx)("g",{filter:"url(#filter0_d_783_28546)",children:Object(l.jsx)("circle",{cx:"28",cy:"24",r:"20",transform:"rotate(-180 28 24)",fill:"white"})}),Object(l.jsx)("path",{d:"M25.1832 30L30.8601 24.3231C30.9042 24.2816 30.9394 24.2316 30.9635 24.176C30.9875 24.1205 30.9999 24.0606 30.9999 24C30.9999 23.9394 30.9875 23.8795 30.9635 23.824C30.9394 23.7684 30.9042 23.7184 30.8601 23.6769L25.1832 18",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(l.jsx)("defs",{children:Object(l.jsxs)("filter",{id:"filter0_d_783_28546",x:"0",y:"0",width:"56",height:"56",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Object(l.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(l.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),Object(l.jsx)("feOffset",{dy:"4"}),Object(l.jsx)("feGaussianBlur",{stdDeviation:"4"}),Object(l.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0.5 0"}),Object(l.jsx)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_783_28546"}),Object(l.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_783_28546",result:"shape"})]})})]})}function r(e){const{className:t,style:a,onClick:n}=e;return Object(l.jsxs)("svg",{onClick:n,className:t,style:{...a,width:"48px",height:"48px",left:"-15px",zIndex:1},width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(l.jsx)("g",{filter:"url(#filter0_d_783_28498)",children:Object(l.jsx)("circle",{cx:"28",cy:"24",r:"20",fill:"white"})}),Object(l.jsx)("path",{d:"M30.8169 18L25.14 23.677C25.0958 23.7184 25.0606 23.7684 25.0366 23.824C25.0125 23.8796 25.0001 23.9395 25.0001 24C25.0001 24.0606 25.0125 24.1205 25.0366 24.1761C25.0606 24.2316 25.0958 24.2817 25.14 24.3231L30.8169 30",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Object(l.jsx)("defs",{children:Object(l.jsxs)("filter",{id:"filter0_d_783_28498",x:"0",y:"0",width:"56",height:"56",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Object(l.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(l.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),Object(l.jsx)("feOffset",{dy:"4"}),Object(l.jsx)("feGaussianBlur",{stdDeviation:"4"}),Object(l.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0.5 0"}),Object(l.jsx)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_783_28546"}),Object(l.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_783_28546",result:"shape"})]})})]})}t.c=function(e){let{children:t,settings:a}=e;return Object(l.jsx)(l.Fragment,{children:a?Object(l.jsx)(s.a,{...a,children:t}):Object(l.jsx)(s.a,{...c,children:t})})}},5:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return s}));const n={AMOUNT_SELECTION:"AMOUNT_SELECTION",PERSONAL_INFO:"PERSONAL_INFO",PROFESSIONAL_INFO:"PROFESSIONAL_INFO",BUSINESS_INFO:"BUSINESS_INFO",BREAKDOWN:"BREAKDOWN",OFFER_SELECTION:"OFFER_SELECTION",FEE_CHARGE_WARNING:"FEE_CHARGE_WARNING",SHOW_CARDS:"SHOW_CARDS",GUARANTOR:"GUARANTOR",AUTHORIZE:"AUTHORIZE",DOCUMENTS:"DOCUMENTS",REPAYMENT_METHOD:"REPAYMENT_METHOD",PENDING:"PENDING",NOT_ELIGIBLE:"NOT_ELIGIBLE",BANK_STATEMENT:"BANK_STATEMENT",SUCCESSFUL:"SUCCESSFUL",MONO:"MONO",CONFIRM:"CONFIRM",MANDATES:"MANDATES",MANDATE_ACCOUNT:"MANDATE_ACCOUNT",ADD_MANDATE:"ADD_MANDATE",DOWNLOAD_MANDATE:"DOWNLOAD_MANDATE",INFO_MANDATE:"INFO_MANDATE",EMANDATE_INFO:"EMANDATE_INFO",SUCCESS_MANDATE:"SUCCESS_MANDATE",OTP_MANDATE:"OTP_MANDATE",OFFER_LETTER:"OFFER_LETTER",SIGN_OFFER:"SIGN_OFFER",ADDITIONAL_DATA:"ADDITIONAL_DATA",ADD_BANK:"ADD_BANK",CHOOSE_PAYMENT_METHOD:"CHOOSE_PAYMENT_METHOD",MANDATE_SIGNATURE:"MANDATE_SIGNATURE",MOBILE_MONEY:"MOBILE_MONEY",ADD_MOBILE_MONEY:"ADD_MOBILE_MONEY"},s={AMOUNT_SELECTION:"AMOUNT_SELECTION",ORACULLI_DATA_CONSENT:"ORACULLI_DATA_CONSENT",ORACULLI_PRIVACY_POLICY:"ORACULLI_PRIVACY_POLICY"}},51:function(e,t,a){"use strict";var n=a(10),s=a(9),l=a(53),c=a(33),i=a(11),r=a(32),o=a(13),d=a(2);Object(c.b)();const b={status:"idle",beneficiary:void 0,amount:void 0,bank_data:{},transaction_amount:0,feestatus:"idle",narration:"",date:""},u=Object(l.create)()(((e,t)=>({...b,reset:()=>{e(b)},getFee:async()=>{const{amount:a}=t();e({feestatus:"loading"});try{var l;const t=null===(l=(await Object(i.a)(n.L,"get")).data)||void 0===l?void 0:l.find((e=>"interbank_transfer"===e.slug)),s=await Object(i.a)(n.L,"post",{amount:a,type_id:t.id});e({feestatus:"success",transaction_amount:s.data.amount,status:"idle"})}catch(r){var c;s.toast.error(null!==(c=null===r||void 0===r?void 0:r.message)&&void 0!==c?c:await Object(d.translate)("lender-web-app-default-error")),e({status:"error"})}},setIdle:async()=>{e({status:"idle"})},setDate:async t=>{e({date:t})},setAmount:async t=>{e({amount:t})},setBeneficiary:async t=>{e({beneficiary:t})},setData:async t=>{e({...t})},initiateTransfer:async t=>{e({status:"loading"});try{const a=await Object(i.a)(n.W,"post",{pin:t});return e({status:"idle"}),a}catch(b){var a,l,c,o;s.toast.error(null!==(a=null!==(l=null===(c=b.response)||void 0===c||null===(o=c.data)||void 0===o?void 0:o.message)&&void 0!==l?l:null===b||void 0===b?void 0:b.message)&&void 0!==a?a:await Object(d.translate)("lender-web-app-default-error")),e({status:"error"}),Object(r.a)({event_name:r.b.TRANSACTIONS_FAILED_TRANSFER})}},validateTierTransaction:async t=>{e({status:"loading"});try{const a=await Object(i.a)(n.fc,"post",{amount:t,entry:"Debit"});return e({status:"idle"}),a}catch(b){var a,l,c,o;s.toast.error(null!==(a=null!==(l=null===(c=b.response)||void 0===c||null===(o=c.data)||void 0===o?void 0:o.message)&&void 0!==l?l:null===b||void 0===b?void 0:b.message)&&void 0!==a?a:await Object(d.translate)("lender-web-app-default-error")),e({status:"error"}),Object(r.a)({event_name:r.b.TRANSACTIONS_FAILED_TRANSFER})}},transfer:async function(a){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";e({status:"loading"});const{amount:c,beneficiary:b}=t(),{id:u,account_name:j,code_description:p}=b;try{var m,h;const t=await Object(i.a)(n.Ub,"post",{amount:c,bank_id:u,pin:a,otp:""!==l?l:null,narration:"Transfer to ".concat(j," / ").concat(p)});var O,v;if(null===t||void 0===t||!t.data||"error"===(null===t||void 0===t||null===(m=t.data)||void 0===m?void 0:m.status))return s.toast.error(null!==(O=null===t||void 0===t||null===(v=t.data)||void 0===v?void 0:v.message)&&void 0!==O?O:await Object(d.translate)("lender-web-app-default-error"));e({status:"success",bank_data:{cards:t.data}});const r=o.a.getState().wallet;return o.a.setState({wallet:{...r,availableBalance:null===(h=t.data)||void 0===h?void 0:h.wallet_balance}}),t}catch(_){var x,f,g,w;s.toast.error(null!==(x=null!==(f=null===(g=_.response)||void 0===g||null===(w=g.data)||void 0===w?void 0:w.message)&&void 0!==f?f:null===_||void 0===_?void 0:_.message)&&void 0!==x?x:await Object(d.translate)("lender-web-app-default-error")),e({status:"error"}),Object(r.a)({event_name:r.b.TRANSACTIONS_FAILED_TRANSFER})}},transferWithoutOtp:async a=>{e({status:"loading"});const{amount:l,beneficiary:c}=t(),{id:b}=c;try{var u,j;const t=await Object(i.a)(n.Ub,"post",{amount:l,bank_id:b,pin:a});var p,m;if(null===t||void 0===t||!t.data||"error"===(null===t||void 0===t||null===(u=t.data)||void 0===u?void 0:u.status))return s.toast.error(null!==(p=null===t||void 0===t||null===(m=t.data)||void 0===m?void 0:m.message)&&void 0!==p?p:await Object(d.translate)("lender-web-app-default-error"));e({status:"success",bank_data:{cards:t.data}});const c=o.a.getState().wallet;return o.a.setState({wallet:{...c,availableBalance:null===(j=t.data)||void 0===j?void 0:j.wallet_balance}}),t}catch(f){var h,O,v,x;s.toast.error(null!==(h=null!==(O=null===(v=f.response)||void 0===v||null===(x=v.data)||void 0===x?void 0:x.message)&&void 0!==O?O:null===f||void 0===f?void 0:f.message)&&void 0!==h?h:await Object(d.translate)("lender-web-app-default-error")),e({status:"error"}),Object(r.a)({event_name:r.b.TRANSACTIONS_FAILED_TRANSFER})}}})));t.a=u},58:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={MANDATE_INFO:"MANDATE_INFO",EMANDATE_INFO:"EMANDATE_INFO",CHOOSE_BANK:"CHOOSE_BANK",AMOUNT:"AMOUNT",SIGNATURE:"SIGNATURE",REMITA:"REMITA",ADD_BANK:"ADD_BANK"}},59:function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return l}));var n=a(21);function s(){return new URLSearchParams(Object(n.j)().search)}const l=e=>{var t;const a=new URLSearchParams(null===(t=window.location)||void 0===t?void 0:t.search);return a.delete(e),a}},6:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));a(1);var n=a(2),s=a(0);function l(e){let{isLoading:t,children:a,isDisabled:l,className:c,...i}=e;const{translate:r}=Object(n.useTranslation)(),o="btn ".concat(c," ").concat(l||t?"disabled":""," ");return Object(s.jsx)("button",{type:"button",className:o,...i,disabled:l,children:t?Object(s.jsx)("div",{style:{maxHeight:"100%"},className:"spinner-border",children:Object(s.jsxs)("span",{className:"visually-hidden",children:[r("lender-web-app-loading"),"..."]})}):a})}},60:function(e,t,a){"use strict";var n=a(10),s=a(53),l=a(11),c=a(61),i=a(33),r=a(15);async function o(){const{country:e}=r.a.getState();return{key:"state",options:(await Object(l.a)(Object(n.J)(e),"get")).data}}async function d(){return{key:"bank",options:(await Object(l.a)(n.h,"get")).data}}async function b(){const e="purpose-of-loan";return{key:e,options:(await Object(l.a)(Object(n.x)(e),"get")).data}}async function u(){const e="business-type";return{key:e,options:(await Object(l.a)(Object(n.x)(e),"get")).data}}const j=Object(s.create)()(Object(c.devtools)(Object(c.persist)(((e,t)=>({appName:"irorun",options:[],optionsStatus:"idle",customBank:[],states:[],getOptionsByKey:function(e){var a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{options:s}=t(),l=null===s||void 0===s||null===(a=s.find((t=>t.key===e)))||void 0===a?void 0:a.options;return null===l||void 0===l?void 0:l.filter((e=>{if(n){const t=JSON.parse((null===e||void 0===e?void 0:e.meta)||"{}");return Object.entries(n).every((e=>{var a;let[n,s]=e;return(null===(a=t[n])||void 0===a?void 0:a.toLowerCase())===(null===s||void 0===s?void 0:s.toLowerCase())}))}return!0}))},fetchLgaOptionsFor:async a=>{var s;const{options:c,getOptionsByKey:r}=t(),o=null===(s=r("state"))||void 0===s?void 0:s.find((e=>e.id===+a));if(!o)return Promise.resolve([]);const d="".concat(null===o||void 0===o?void 0:o.ref_code,"-lga"),b=r(d);if(b){const t=Object(i.a)(c,(e=>{var t;(e=null===(t=e)||void 0===t?void 0:t.filter((e=>e.key!==d))).push({key:d,options:b})}));e({options:t,optionsStatus:"success"})}else{e({optionsStatus:"loading"});try{const t=await Object(l.a)(Object(n.y)("local-government",null===o||void 0===o?void 0:o.ref_code),"get"),a=Object(i.a)(c,(e=>{e.push({key:d,options:t.data})}));e({options:a,optionsStatus:"success"})}catch(u){e({optionsStatus:"error"})}}},fetchOptions:async()=>{const{options:a,optionsStatus:s}=t();if(a.length>0||"loading"===s)return Promise.resolve(a);e({optionsStatus:"loading"});try{const t=await Object(l.a)(n.I,"get"),[s,c,i,r]=await async function(){return Promise.all([o(),u(),d(),b()])}(),j=[...a,...t.data,s,c,i,r];e({options:j,optionsStatus:"success"})}catch(c){e({optionsStatus:"error"})}},fetchCustomBank:async()=>{const{country:t}=r.a.getState();try{var a;const s=await Object(l.a)("".concat(n.h,"?country=").concat(t),"get"),c=null===s||void 0===s||null===(a=s.data)||void 0===a?void 0:a.filter((e=>{if(null!==e&&void 0!==e&&e.meta){const t=JSON.parse((null===e||void 0===e?void 0:e.meta)||"{}");return"momo"!==(null===t||void 0===t?void 0:t.type)}return!0}));e({customBank:[...c||[]]})}catch(s){console.log(s)}},fetchCustomStates:async t=>{try{const a=await Object(l.a)(Object(n.J)(t),"get");console.log("this is states response =============>",null===a||void 0===a?void 0:a.data),e({states:JSON.parse(JSON.stringify(null===a||void 0===a?void 0:a.data))})}catch(a){console.log(a)}}})),{name:"app.options"})));t.a=j},67:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));class n{static statusPill(e){switch(e){case"PENDING":case"PENDING MANDATE ACTIVATION":case"PENDING LENDER'S APPROVAL":case"GUARANTOR VALIDATED":case"PENDING GUARANTOR VERIFICATION":case"PENDING EMAIL VERIFICATION":return"pending";case"CANCELLED":case"DECLINED":case"REVERSED":case"TERMINATED":return"cancelled";case"PAST DUE":return"past_due";case"RUNNING":return"running";case"SETTLED":return"settled";default:return"pill__blue"}}}},68:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(1),s=(a(711),a(0));function l(e){let{onSuccess:t,onFailed:a,visible:l=!1,access_token:c="",type:i=""}=e;return Object(n.useEffect)((()=>{const e=e=>{var n,s,l,c;["https://standard.paystack.co","https://checkout.seerbitapi.com","https://test.integrations.lendsqr.com","https://integrations.lendsqr.com","https://lendsqr.com","https://checkout.stripe.com"].includes(e.origin)&&("error"===(null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.command)?a(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.data)||null):t((null===e||void 0===e||null===(c=e.data)||void 0===c?void 0:c.data)||null))};return window.addEventListener("message",e,!1),()=>window.removeEventListener("message",e,!1)}),[]),l?Object(s.jsx)("div",{className:"integrations-container",children:Object(s.jsx)("iframe",{id:"integrations",title:i,allow:"camera;microphone",style:{position:"absolute",top:0,left:0,right:0,bottom:0,border:0},src:"".concat("https://integrations.lendsqr.com","/").concat(null!==i&&void 0!==i?i:"","?token=").concat(c),width:"100%",height:"100%"})}):null}},7:function(e,t,a){"use strict";a.d(t,"a",(function(){return m})),a.d(t,"m",(function(){return v})),a.d(t,"v",(function(){return _})),a.d(t,"b",(function(){return y})),a.d(t,"c",(function(){return N})),a.d(t,"d",(function(){return C})),a.d(t,"e",(function(){return S})),a.d(t,"i",(function(){return E})),a.d(t,"j",(function(){return T})),a.d(t,"h",(function(){return A})),a.d(t,"k",(function(){return M})),a.d(t,"l",(function(){return D})),a.d(t,"r",(function(){return F})),a.d(t,"n",(function(){return V})),a.d(t,"o",(function(){return Y})),a.d(t,"p",(function(){return W})),a.d(t,"q",(function(){return G})),a.d(t,"s",(function(){return Z})),a.d(t,"t",(function(){return K.a})),a.d(t,"u",(function(){return z})),a.d(t,"f",(function(){return Q})),a.d(t,"g",(function(){return X}));a(395);var n=a(12),s=a(2),l=a(1),c=a(75),i=a(412),r=a.n(i),o=a(161),d=a.n(o),b=a(24),u=a.n(b),j=a(0);const p=(e,t)=>e.replace(/{{(.+?)}}/g,((e,a)=>t[a]||a)),m=e=>{let{label:t,className:a,info:i,parameters:o,user:b,...m}=e;const{setFieldValue:h,setErrors:O,values:v}=Object(n.f)(),[x,f]=Object(n.d)(m.name),[g,w]=Object(l.useState)(!1),{translate:_}=Object(s.useTranslation)(),y=[a,"form-control rounded-5 px-3 py-3 f-14px",f.touched&&f.error?"is-invalid":""].join(" "),N=Object(l.useCallback)((async()=>{if(!f.value)return void O({[m.name]:"This field is required"});const e={url:p(o.url,v),method:o.method,headers:o.headers};var t;(o.query&&(e.params=JSON.parse(p(JSON.stringify(o.query),v))),o.headers)&&(e.headers=JSON.parse(p(JSON.stringify(o.headers),{...v,org_id:(null===b||void 0===b||null===(t=b.organization)||void 0===t?void 0:t.id)||1})));if(o.body){e.data={};const t=JSON.parse(p(JSON.stringify(o.body),v));e.data=t}const a=Object(c.pickBy)(e,c.identity);try{w(!0),h("clf_api_error","loading");const{data:e}=await d()(a);h("clf_api_error",!1),o.assign.forEach((t=>{"loan_history"===t.value&&e.data.loanHistoryDetails?h(t.value,e.data.loanHistoryDetails.length.toString()):"outstanding_loan_amount"===t.value&&e.data.loanHistoryDetails?h(t.value,e.data.loanHistoryDetails.reduce(((e,t)=>t.outstandingAmount+e),0)):"last_payment_date"===t.value||"last_disbursement_date"===t.value?h(t.value,u()("03-01-2024 08:18:00+0000","DD-MM-YYYY HH:mm:ssZ").format("YYYY-MM-DD[T]HH:mm:ss")):h(t.value,r()(e,t.key))}))}catch(n){(e=>{var t,a,n,s;o.assign.forEach((e=>{h(e.value,"")})),h("clf_api_error",(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||e.message),O({[m.name]:(null===e||void 0===e||null===(n=e.response)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.message)||e.message})})(n)}finally{w(!1)}}),[f.value,v]);return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:m.name,children:t}),Object(j.jsx)("input",{className:y,id:m.name,placeholder:t,...x,onChange:e=>{h(m.name,e.target.value)},...m,value:f.value}),Object(j.jsx)("button",{disabled:!f.value,type:"button",onClick:N,className:"submit-icon",children:g?Object(j.jsx)("div",{className:"spinner-border-small text-primary",children:Object(j.jsxs)("span",{className:"visually-hidden",children:[_("lender-web-app-loading"),"..."]})}):_("lender-web-app-submit")}),i||null,f.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:f.error})]})};var h=a(98),O=a.n(h);function v(e){let{label:t="Select a Date",minDate:a,maxDate:n,setValue:c,value:i}=e;const{translate:r}=Object(s.useTranslation)();return Object(l.useEffect)((()=>{a&&c(u()(a).format("YYYY/MM/DD")),n&&c(u()(n).format("YYYY/MM/DD"))}),[t]),Object(j.jsx)(O.a,{closeOnSelect:!0,className:"form-group form-floating",value:i,onChange:e=>c(u()(e).format()),initialValue:a?u()(a).format("DD-MM-YYYY"):"",isValidDate:e=>x(e,a,n),dateFormat:"DD-MM-YYYY",timeFormat:!1,inputProps:{placeholder:r("lender-web-app-select-date"),className:"form-control rounded-5 px-3 py-3 f-14px",readOnly:!0}})}const x=(e,t,a)=>a&&t?e.isBetween(t,a):a?e.isBefore(a):t?e.isSame(t)||e.isAfter(t):void 0;var f=a(13),g=a(3),w=a(4);const _=e=>{let{onChange:t,checked:a,charge:n,type:c}=e;const[i,r,o]=Object(f.a)((e=>[e.fetchWallet,e.wallet,e.walletStatus]),w.shallow);Object(l.useEffect)((()=>{null!==r&&void 0!==r&&r.currency||i()}),[]);const{translate:d}=Object(s.useTranslation)();return"success"===o?Object(j.jsxs)("div",{style:{marginBottom:"20px",display:"flex",alignItems:"flex-start"},children:[Object(j.jsx)("input",{id:"consent",name:"reason",checked:a,onChange:t,style:{marginTop:"5px"},type:"checkbox"}),Object(j.jsx)("label",{htmlFor:"consent",style:{marginLeft:"10px",color:"black"},children:d("lender-web-app-confirm-charge",{amount:Object(g.q)(n,null===r||void 0===r?void 0:r.currency),type:c})})]}):Object(j.jsx)(j.Fragment,{})};const y=e=>{let{name:t,label:a,validation:n,options:l,props:c,field:i}=e;const{translate:r}=Object(s.useTranslation)(),{getFieldMeta:o,handleChange:d,handleBlur:b,getFieldProps:u}=c,p=o(t),m=e=>{const{value:a}=e.target,s=u(t).value;null!==n&&void 0!==n&&n.maximum_select&&s.length>=(null===n||void 0===n?void 0:n.maximum_select)&&!s.includes(a)||d(e)};return Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)("label",{className:"mt-2 form-text",children:a})," ",Object(j.jsxs)("span",{className:"required-icon",children:[null!==n&&void 0!==n&&n.required?"*":""," "]}),l.map((e=>Object(j.jsxs)("div",{className:"form-check text-app-gray",children:[Object(j.jsx)("input",{type:"checkbox",className:"form-check-input",name:t,id:"".concat(t,"-").concat(e.value),checked:o(t).value.includes(e.value),value:e.value,onChange:m,onBlur:b}),Object(j.jsx)("label",{htmlFor:"".concat(t,"-").concat(e.value),className:"text-textColor",children:e.label})]},e.id))),p.touched&&n&&0===o(t).value.length&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small mt-2",style:{height:"2rem",marginTop:"-1.1rem"},children:r("lender-web-app-is-required",{name:i.name})})]})},N=e=>{let{name:t,label:a,children:n,props:s,value:l}=e;const{getFieldMeta:c,handleChange:i,handleBlur:r}=s;return Object(j.jsxs)("label",{className:"custom_radio",children:[Object(j.jsx)("input",{onChange:i,type:"radio",name:t,id:t,value:l,checked:c(t).value===l,onBlur:r}),Object(j.jsxs)("div",{className:"content  rounded-3 ms-0",children:[Object(j.jsx)("svg",{width:"16",className:"unchecked-icon text-primary",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"})}),Object(j.jsxs)("svg",{className:"checked-icon text-primary",width:"16",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"}),Object(j.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"currentColor"})]}),n||a]})]})},C=e=>{let{name:t,default_value:a}=e;return Object(j.jsxs)("div",{className:"form-group mt-2",children:[Object(j.jsx)("div",{className:"mb-1",children:t}),Object(j.jsx)("a",{href:a,download:!0,children:a})]})};var k=a(413);const S=e=>{let{label:t,className:a,info:n,defaultValue:s,error:l,placeholder:c,errorMessage:i,onChange:r,currency:o,onFocus:d,groupStyle:b,disabled:u}=e;const p=[a,"form-control rounded-5 px-3 py-3 f-14px",l?"is-invalid":"",l&&"is-invalid"].join(" ");return Object(j.jsxs)("div",{className:"form-group",style:{...b},children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:null===t||void 0===t?void 0:t.split(" ").join(""),children:t}),Object(j.jsx)(k.a,{className:p,id:null===t||void 0===t?void 0:t.split(" ").join(""),decimalsLimit:2,defaultValue:s,onValueChange:r,allowNegativeValue:!1,prefix:Object(g.k)(o),placeholder:c,onFocus:d,disabled:u,value:s}),n,l&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:i})]})};a(396);const E=e=>{let{label:t="Select a Date",minDate:a,maxDate:c,className:i,disabled:r=!1,name:o}=e;const{translate:d}=Object(s.useTranslation)(),[,b,p]=Object(n.d)(o),m=[i,"form-control rounded-5 px-3 py-3 f-14px"].join(" ");Object(l.useEffect)((()=>{a&&p.setValue(u()(a).format("YYYY/MM/DD")),c&&p.setValue(u()(c).format("YYYY/MM/DD"))}),[t]);return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsx)("label",{children:t}),Object(j.jsx)(O.a,{closeOnSelect:!0,className:[i,"form-group"].join(" "),value:u()(b.value).format("DD-MM-YYYY"),onChange:e=>{p.setValue(u()(e).format("YYYY/MM/DD"))},initialValue:a?u()(a).format("DD-MM-YYYY"):u()().format("DD-MM-YYYY"),isValidDate:e=>c&&a?e.isBetween(a,c):a?e.isSame(a)||e.isAfter(a):!c||e.isBefore(c),dateFormat:"DD-MM-YYYY",timeFormat:!1,inputProps:{placeholder:d("lender-web-app-select-date"),className:m,readOnly:!0,disabled:r}}),b.error&&!b.value&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"2rem",marginTop:"-1.1rem"},children:b.error})]})},T=e=>{let{label:t="Select a Date",minDate:a,maxDate:c,className:i,dateTime:r,currentDate:o,name:d}=e;const[,b,p]=Object(n.d)(d),m=[i,"form-control rounded-5 px-3 py-3 f-14px",b.error?"is-invalid":""].join(" ");Object(l.useEffect)((()=>{o?p.setValue(u()(o).format("YYYY/MM/DD")):a?p.setValue(u()(a).format("YYYY/MM/DD")):c&&p.setValue(u()(c).format("YYYY/MM/DD"))}),[t]);const{translate:h}=Object(s.useTranslation)();return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsx)("label",{children:t}),Object(j.jsx)(O.a,{closeOnSelect:!0,className:[i,"form-group"].join(" "),onChange:e=>{p.setValue(u()(e).format("YYYY/MM/DD"))},initialValue:(()=>{let e="";return o?e=u()(o).format("DD-MM-YYYY"):a&&(e=u()(a).format("DD-MM-YYYY")),e})(),isValidDate:e=>c?e.isBefore(c):a?e.isSame(a)||e.isAfter(a):void 0,dateFormat:"DD-MM-YYYY",timeFormat:r,inputProps:{placeholder:h("lender-web-app-select-date"),className:m,readOnly:!0}}),b.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"2rem",marginTop:"-1.1rem"},children:b.error})]})};function A(e){let{label:t="Select a Date",className:a,...l}=e;const[,c,i]=Object(n.d)(l),r=[a,"form-control rounded-5 px-3 py-3 f-14px",c.touched&&c.error?"is-invalid":""].join(" "),o=u()().subtract(18,"year"),{translate:d}=Object(s.useTranslation)();return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsx)("label",{className:"mb-1 text-app-gray",children:t}),Object(j.jsx)(O.a,{closeOnSelect:!0,className:"form-floating",onChange:e=>{i.setValue(u()(e).format("YYYY/MM/DD"))},initialValue:"",initialViewDate:o,isValidDate:e=>e.isBefore(o),dateFormat:"YYYY-MM-DD",timeFormat:!1,inputProps:{placeholder:d("lender-web-app-select-date"),className:r,readOnly:!0}}),c.touched&&c.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"2rem",marginTop:"-1.1rem"},children:c.error})]})}var L=a(765);const M=e=>{let{date:t,setDate:a}=e;const{translate:n}=Object(s.useTranslation)();return Object(j.jsxs)("div",{className:"input-group input-group-filter date-sort",children:[Object(j.jsx)("div",{className:"input-group-prepend",children:Object(j.jsxs)("span",{className:"input-group-text",id:"filter-1",children:[n("lender-web-app-date"),":"]})}),Object(j.jsx)(O.a,{className:"blue",closeOnSelect:!0,value:t,onChange:e=>a(Object(g.m)(e.toString())),timeFormat:!1,isValidDate:e=>e.isBefore(Object(L.a)()),inputProps:{placeholder:n("lender-web-app-select-date"),value:Object(g.m)(t),autoComplete:" off",name:"date"}}),t&&Object(j.jsx)("button",{type:"button",onClick:()=>a(""),className:"bg-white border-0 me-2 close text-app-gray","aria-label":"Close",children:Object(j.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]})},D=e=>{let{name:t,label:a,className:s,info:l,inputProps:c,error:i,errorMessage:r,groupStyle:o,validation:d}=e;const[b,u,p]=Object(n.d)(t),m=[s,"form-control rounded-5 px-3 py-3 f-14px",u.touched&&u.error?"is-invalid":"",i&&r?"is-invalid":""].join(" ");return Object(j.jsxs)("div",{className:"form-group",style:{...o},children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:a.split(" ").join(""),children:a}),Object(j.jsx)("textarea",{className:m,id:a.split(" ").join(""),placeholder:a,maxLength:+(null===d||void 0===d?void 0:d.maximum_length),minLength:+(null===d||void 0===d?void 0:d.minimum_length),...b,...c,onChange:e=>{if(!e.target.value.trim())return p.setValue("");b.onChange(e)}}),l,i&&r?Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:i&&r&&r}):u.touched&&u.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:u.touched&&u.error&&u.error})]})},F=e=>{let{label:t,options:a,name:l,className:c,loading:i,valueField:r,keyField:o,placeholder:d,labelField:b="value"}=e;const[u,p]=Object(n.d)(l),{translate:m}=Object(s.useTranslation)(),h=[c,"form-select rounded-5 px-3 py-3 f-14px",p.touched&&p.error?"is-invalid":""].join(" ");return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsxs)("label",{className:"mb-1 text-app-gray",children:[t,i&&Object(j.jsx)("div",{className:"ms-1 spinner-border text-primary spinner-border-sm",children:Object(j.jsxs)("span",{className:"visually-hidden",children:[m("lender-web-app-loading"),"..."]})})]}),Object(j.jsxs)("select",{style:{textTransform:"capitalize"},className:h,"aria-label":m("lender-web-app-floating-label-select"),...u,children:[Object(j.jsx)("option",{value:"",children:d?"".concat(d):"Select"}),null===a||void 0===a?void 0:a.map((e=>Object(j.jsx)("option",{value:r?e[r]:JSON.stringify(e),children:e[b]},e[o])))]}),p.touched&&p.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:p.error})]})};var I=a(15),R=a(414),P=a.n(R);a(712);const q=[{name:"Afghanistan",dial_code:"+93",alpha2_code:"AF",alpha3_code:"AFG"},{name:"Aland Islands",dial_code:"+358",alpha2_code:"AX",alpha3_code:"ALA"},{name:"Albania",dial_code:"+355",alpha2_code:"AL",alpha3_code:"ALB"},{name:"Algeria",dial_code:"+213",alpha2_code:"DZ",alpha3_code:"DZA"},{name:"American Samoa",dial_code:"+1684",alpha2_code:"AS",alpha3_code:"ASM"},{name:"Andorra",dial_code:"+376",alpha2_code:"AD",alpha3_code:"AND"},{name:"Angola",dial_code:"+244",alpha2_code:"AO",alpha3_code:"AGO"},{name:"Anguilla",dial_code:"+1264",alpha2_code:"AI",alpha3_code:"AIA"},{name:"Antarctica",dial_code:"+672",alpha2_code:"AQ",alpha3_code:"ATA"},{name:"Antigua and Barbuda",dial_code:"+1268",alpha2_code:"AG",alpha3_code:"ATG"},{name:"Argentina",dial_code:"+54",alpha2_code:"AR",alpha3_code:"ARG"},{name:"Armenia",dial_code:"+374",alpha2_code:"AM",alpha3_code:"ARM"},{name:"Aruba",dial_code:"+297",alpha2_code:"AW",alpha3_code:"ABW"},{name:"Australia",dial_code:"+61",alpha2_code:"AU",alpha3_code:"AUS"},{name:"Austria",dial_code:"+43",alpha2_code:"AT",alpha3_code:"AUT"},{name:"Azerbaijan",dial_code:"+994",alpha2_code:"AZ",alpha3_code:"AZE"},{name:"Bahamas",dial_code:"+1242",alpha2_code:"BS",alpha3_code:"BHS"},{name:"Bahrain",dial_code:"+973",alpha2_code:"BH",alpha3_code:"BHR"},{name:"Bangladesh",dial_code:"+880",alpha2_code:"BD",alpha3_code:"BGD"},{name:"Barbados",dial_code:"+1246",alpha2_code:"BB",alpha3_code:"BRB"},{name:"Belarus",dial_code:"+375",alpha2_code:"BY",alpha3_code:"BLR"},{name:"Belgium",dial_code:"+32",alpha2_code:"BE",alpha3_code:"BEL"},{name:"Belize",dial_code:"+501",alpha2_code:"BZ",alpha3_code:"BLZ"},{name:"Benin",dial_code:"+229",alpha2_code:"BJ",alpha3_code:"BEN"},{name:"Bermuda",dial_code:"+1441",alpha2_code:"BM",alpha3_code:"BMU"},{name:"Bhutan",dial_code:"+975",alpha2_code:"BT",alpha3_code:"BTN"},{name:"Bolivia, Plurinational State of",dial_code:"+591",alpha2_code:"BO",alpha3_code:"BOL"},{name:"Bosnia and Herzegovina",dial_code:"+387",alpha2_code:"BA",alpha3_code:"BIH"},{name:"Botswana",dial_code:"+267",alpha2_code:"BW",alpha3_code:"BWA"},{name:"Brazil",dial_code:"+55",alpha2_code:"BR",alpha3_code:"BRA"},{name:"British Indian Ocean Territory",dial_code:"+246",alpha2_code:"IO",alpha3_code:"IOT"},{name:"Brunei Darussalam",dial_code:"+673",alpha2_code:"BN",alpha3_code:"BRN"},{name:"Bulgaria",dial_code:"+359",alpha2_code:"BG",alpha3_code:"BGR"},{name:"Burkina Faso",dial_code:"+226",alpha2_code:"BF",alpha3_code:"BFA"},{name:"Burundi",dial_code:"+257",alpha2_code:"BI",alpha3_code:"BDI"},{name:"Cambodia",dial_code:"+855",alpha2_code:"KH",alpha3_code:"KHM"},{name:"Cameroon",dial_code:"+237",alpha2_code:"CM",alpha3_code:"CMR"},{name:"Canada",dial_code:"+1",alpha2_code:"CA",alpha3_code:"CAN"},{name:"Cape Verde",dial_code:"+238",alpha2_code:"CV",alpha3_code:"CPV"},{name:"Cayman Islands",dial_code:"+345",alpha2_code:"KY",alpha3_code:"CYM"},{name:"Central African Republic",dial_code:"+236",alpha2_code:"CF",alpha3_code:"CAF"},{name:"Chad",dial_code:"+235",alpha2_code:"TD",alpha3_code:"TCD"},{name:"Chile",dial_code:"+56",alpha2_code:"CL",alpha3_code:"CHL"},{name:"China",dial_code:"+86",alpha2_code:"CN",alpha3_code:"CHN"},{name:"Christmas Island",dial_code:"+61",alpha2_code:"CX",alpha3_code:"CXR"},{name:"Cocos (Keeling) Islands",dial_code:"+61",alpha2_code:"CC",alpha3_code:"CCK"},{name:"Colombia",dial_code:"+57",alpha2_code:"CO",alpha3_code:"COL"},{name:"Comoros",dial_code:"+269",alpha2_code:"KM",alpha3_code:"COM"},{name:"Congo",dial_code:"+242",alpha2_code:"CG",alpha3_code:"COG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"+243",alpha2_code:"CD",alpha3_code:"COD"},{name:"Cook Islands",dial_code:"+682",alpha2_code:"CK",alpha3_code:"COK"},{name:"Costa Rica",dial_code:"+506",alpha2_code:"CR",alpha3_code:"CRI"},{name:"Cote d'Ivoire",dial_code:"+225",alpha2_code:"CI",alpha3_code:"CIV"},{name:"Croatia",dial_code:"+385",alpha2_code:"HR",alpha3_code:"HRV"},{name:"Cuba",dial_code:"+53",alpha2_code:"CU",alpha3_code:"CUB"},{name:"Cyprus",dial_code:"+357",alpha2_code:"CY",alpha3_code:"CYP"},{name:"Czech Republic",dial_code:"+420",alpha2_code:"CZ",alpha3_code:"CZE"},{name:"Denmark",dial_code:"+45",alpha2_code:"DK",alpha3_code:"DNK"},{name:"Djibouti",dial_code:"+253",alpha2_code:"DJ",alpha3_code:"DJI"},{name:"Dominica",dial_code:"+1767",alpha2_code:"DM",alpha3_code:"DMA"},{name:"Dominican Republic",dial_code:"+1849",alpha2_code:"DO",alpha3_code:"DOM"},{name:"Ecuador",dial_code:"+593",alpha2_code:"EC",alpha3_code:"ECU"},{name:"Egypt",dial_code:"+20",alpha2_code:"EG",alpha3_code:"EGY"},{name:"El Salvador",dial_code:"+503",alpha2_code:"SV",alpha3_code:"SLV"},{name:"Equatorial Guinea",dial_code:"+240",alpha2_code:"GQ",alpha3_code:"GNQ"},{name:"Eritrea",dial_code:"+291",alpha2_code:"ER",alpha3_code:"ERI"},{name:"Estonia",dial_code:"+372",alpha2_code:"EE",alpha3_code:"EST"},{name:"Ethiopia",dial_code:"+251",alpha2_code:"ET",alpha3_code:"ETH"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",alpha2_code:"FK",alpha3_code:"FLK"},{name:"Faroe Islands",dial_code:"+298",alpha2_code:"FO",alpha3_code:"FRO"},{name:"Fiji",dial_code:"+679",alpha2_code:"FJ",alpha3_code:"FJI"},{name:"Finland",dial_code:"+358",alpha2_code:"FI",alpha3_code:"FIN"},{name:"France",dial_code:"+33",alpha2_code:"FR",alpha3_code:"FRA"},{name:"French Guiana",dial_code:"+594",alpha2_code:"GF",alpha3_code:"GUF"},{name:"French Polynesia",dial_code:"+689",alpha2_code:"PF",alpha3_code:"PYF"},{name:"French Southern Territories",dial_code:"+262",alpha2_code:"TF",alpha3_code:"ATF"},{name:"Gabon",dial_code:"+241",alpha2_code:"GA",alpha3_code:"GAB"},{name:"Gambia",dial_code:"+220",alpha2_code:"GM",alpha3_code:"GMB"},{name:"Georgia",dial_code:"+995",alpha2_code:"GE",alpha3_code:"GEO"},{name:"Germany",dial_code:"+49",alpha2_code:"DE",alpha3_code:"DEU"},{name:"Ghana",dial_code:"+233",alpha2_code:"GH",alpha3_code:"GHA"},{name:"Gibraltar",dial_code:"+350",alpha2_code:"GI",alpha3_code:"GIB"},{name:"Greece",dial_code:"+30",alpha2_code:"GR",alpha3_code:"GRC"},{name:"Greenland",dial_code:"+299",alpha2_code:"GL",alpha3_code:"GRL"},{name:"Grenada",dial_code:"+1473",alpha2_code:"GD",alpha3_code:"GRD"},{name:"Guadeloupe",dial_code:"+590",alpha2_code:"GP",alpha3_code:"GLP"},{name:"Guam",dial_code:"+1671",alpha2_code:"GU",alpha3_code:"GUM"},{name:"Guatemala",dial_code:"+502",alpha2_code:"GT",alpha3_code:"GTM"},{name:"Guernsey",dial_code:"+44",alpha2_code:"GG",alpha3_code:"GGY"},{name:"Guinea",dial_code:"+224",alpha2_code:"GN",alpha3_code:"GIN"},{name:"Guinea-Bissau",dial_code:"+245",alpha2_code:"GW",alpha3_code:"GNB"},{name:"Guyana",dial_code:"+592",alpha2_code:"GY",alpha3_code:"GUY"},{name:"Haiti",dial_code:"+509",alpha2_code:"HT",alpha3_code:"HTI"},{name:"Heard Island and Mcdonald Islands",dial_code:"+0",alpha2_code:"HM",alpha3_code:"HMD"},{name:"Holy See (Vatican City State)",dial_code:"+379",alpha2_code:"VA",alpha3_code:"VAT"},{name:"Honduras",dial_code:"+504",alpha2_code:"HN",alpha3_code:"HND"},{name:"Hong Kong",dial_code:"+852",alpha2_code:"HK",alpha3_code:"HKG"},{name:"Hungary",dial_code:"+36",alpha2_code:"HU",alpha3_code:"HUN"},{name:"Iceland",dial_code:"+354",alpha2_code:"IS",alpha3_code:"ISL"},{name:"India",dial_code:"+91",alpha2_code:"IN",alpha3_code:"IND"},{name:"Indonesia",dial_code:"+62",alpha2_code:"ID",alpha3_code:"IDN"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"+98",alpha2_code:"IR",alpha3_code:"IRN"},{name:"Iraq",dial_code:"+964",alpha2_code:"IQ",alpha3_code:"IRQ"},{name:"Ireland",dial_code:"+353",alpha2_code:"IE",alpha3_code:"IRL"},{name:"Isle of Man",dial_code:"+44",alpha2_code:"IM",alpha3_code:"IMN"},{name:"Israel",dial_code:"+972",alpha2_code:"IL",alpha3_code:"ISR"},{name:"Italy",dial_code:"+39",alpha2_code:"IT",alpha3_code:"ITA"},{name:"Jamaica",dial_code:"+1876",alpha2_code:"JM",alpha3_code:"JAM"},{name:"Japan",dial_code:"+81",alpha2_code:"JP",alpha3_code:"JPN"},{name:"Jersey",dial_code:"+44",alpha2_code:"JE",alpha3_code:"JEY"},{name:"Jordan",dial_code:"+962",alpha2_code:"JO",alpha3_code:"JOR"},{name:"Kazakhstan",dial_code:"+77",alpha2_code:"KZ",alpha3_code:"KAZ"},{name:"Kenya",dial_code:"+254",alpha2_code:"KE",alpha3_code:"KEN"},{name:"Kiribati",dial_code:"+686",alpha2_code:"KI",alpha3_code:"KIR"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"+850",alpha2_code:"KP",alpha3_code:"PRK"},{name:"Korea, Republic of South Korea",dial_code:"+82",alpha2_code:"KR",alpha3_code:"KOR"},{name:"Kuwait",dial_code:"+965",alpha2_code:"KW",alpha3_code:"KWT"},{name:"Kyrgyzstan",dial_code:"+996",alpha2_code:"KG",alpha3_code:"KGZ"},{name:"Laos",dial_code:"+856",alpha2_code:"LA",alpha3_code:"LAO"},{name:"Latvia",dial_code:"+371",alpha2_code:"LV",alpha3_code:"LVA"},{name:"Lebanon",dial_code:"+961",alpha2_code:"LB",alpha3_code:"LBN"},{name:"Lesotho",dial_code:"+266",alpha2_code:"LS",alpha3_code:"LSO"},{name:"Liberia",dial_code:"+231",alpha2_code:"LR",alpha3_code:"LBR"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",alpha2_code:"LY",alpha3_code:"LBY"},{name:"Liechtenstein",dial_code:"+423",alpha2_code:"LI",alpha3_code:"LIE"},{name:"Lithuania",dial_code:"+370",alpha2_code:"LT",alpha3_code:"LTU"},{name:"Luxembourg",dial_code:"+352",alpha2_code:"LU",alpha3_code:"LUX"},{name:"Macao",dial_code:"+853",alpha2_code:"MO",alpha3_code:"MAC"},{name:"Macedonia",dial_code:"+389",alpha2_code:"MK",alpha3_code:"MKD"},{name:"Madagascar",dial_code:"+261",alpha2_code:"MG",alpha3_code:"MDG"},{name:"Malawi",dial_code:"+265",alpha2_code:"MW",alpha3_code:"MWI"},{name:"Malaysia",dial_code:"+60",alpha2_code:"MY",alpha3_code:"MYS"},{name:"Maldives",dial_code:"+960",alpha2_code:"MV",alpha3_code:"MDV"},{name:"Mali",dial_code:"+223",alpha2_code:"ML",alpha3_code:"MLI"},{name:"Malta",dial_code:"+356",alpha2_code:"MT",alpha3_code:"MLT"},{name:"Marshall Islands",dial_code:"+692",alpha2_code:"MH",alpha3_code:"MHL"},{name:"Martinique",dial_code:"+596",alpha2_code:"MQ",alpha3_code:"MTQ"},{name:"Mauritania",dial_code:"+222",alpha2_code:"MR",alpha3_code:"MRT"},{name:"Mauritius",dial_code:"+230",alpha2_code:"MU",alpha3_code:"MUS"},{name:"Mayotte",dial_code:"+262",alpha2_code:"YT",alpha3_code:"MYT"},{name:"Mexico",dial_code:"+52",alpha2_code:"MX",alpha3_code:"MEX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"+691",alpha2_code:"FM",alpha3_code:"FSM"},{name:"Moldova",dial_code:"+373",alpha2_code:"MD",alpha3_code:"MDA"},{name:"Monaco",dial_code:"+377",alpha2_code:"MC",alpha3_code:"MCO"},{name:"Mongolia",dial_code:"+976",alpha2_code:"MN",alpha3_code:"MNG"},{name:"Montenegro",dial_code:"+382",alpha2_code:"ME",alpha3_code:"MNE"},{name:"Montserrat",dial_code:"+1664",alpha2_code:"MS",alpha3_code:"MSR"},{name:"Morocco",dial_code:"+212",alpha2_code:"MA",alpha3_code:"MAR"},{name:"Mozambique",dial_code:"+258",alpha2_code:"MZ",alpha3_code:"MOZ"},{name:"Myanmar",dial_code:"+95",alpha2_code:"MM",alpha3_code:"MMR"},{name:"Namibia",dial_code:"+264",alpha2_code:"NA",alpha3_code:"NAM"},{name:"Nauru",dial_code:"+674",alpha2_code:"NR",alpha3_code:"NRU"},{name:"Nepal",dial_code:"+977",alpha2_code:"NP",alpha3_code:"NPL"},{name:"Netherlands",dial_code:"+31",alpha2_code:"NL",alpha3_code:"NLD"},{name:"New Caledonia",dial_code:"+687",alpha2_code:"NC",alpha3_code:"NCL"},{name:"New Zealand",dial_code:"+64",alpha2_code:"NZ",alpha3_code:"NZL"},{name:"Nicaragua",dial_code:"+505",alpha2_code:"NI",alpha3_code:"NIC"},{name:"Niger",dial_code:"+227",alpha2_code:"NE",alpha3_code:"NER"},{name:"Nigeria",dial_code:"+234",alpha2_code:"NG",alpha3_code:"NGA"},{name:"Niue",dial_code:"+683",alpha2_code:"NU",alpha3_code:"NIU"},{name:"Norfolk Island",dial_code:"+672",alpha2_code:"NF",alpha3_code:"NFK"},{name:"Northern Mariana Islands",dial_code:"+1670",alpha2_code:"MP",alpha3_code:"MNP"},{name:"Norway",dial_code:"+47",alpha2_code:"NO",alpha3_code:"NOR"},{name:"Oman",dial_code:"+968",alpha2_code:"OM",alpha3_code:"OMN"},{name:"Pakistan",dial_code:"+92",alpha2_code:"PK",alpha3_code:"PAK"},{name:"Palau",dial_code:"+680",alpha2_code:"PW",alpha3_code:"PLW"},{name:"Palestinian Territory, Occupied",dial_code:"+970",alpha2_code:"PS",alpha3_code:"PSE"},{name:"Panama",dial_code:"+507",alpha2_code:"PA",alpha3_code:"PAN"},{name:"Papua New Guinea",dial_code:"+675",alpha2_code:"PG",alpha3_code:"PNG"},{name:"Paraguay",dial_code:"+595",alpha2_code:"PY",alpha3_code:"PRY"},{name:"Peru",dial_code:"+51",alpha2_code:"PE",alpha3_code:"PER"},{name:"Philippines",dial_code:"+63",alpha2_code:"PH",alpha3_code:"PHL"},{name:"Pitcairn",dial_code:"+872",alpha2_code:"PN",alpha3_code:"PCN"},{name:"Poland",dial_code:"+48",alpha2_code:"PL",alpha3_code:"POL"},{name:"Portugal",dial_code:"+351",alpha2_code:"PT",alpha3_code:"PRT"},{name:"Puerto Rico",dial_code:"+1939",alpha2_code:"PR",alpha3_code:"PRI"},{name:"Qatar",dial_code:"+974",alpha2_code:"QA",alpha3_code:"QAT"},{name:"Romania",dial_code:"+40",alpha2_code:"RO",alpha3_code:"ROU"},{name:"Russian Federation",dial_code:"+7",alpha2_code:"RU",alpha3_code:"RUS"},{name:"Rwanda",dial_code:"+250",alpha2_code:"RW",alpha3_code:"RWA"},{name:"Reunion",dial_code:"+262",alpha2_code:"RE",alpha3_code:"REU"},{name:"Saint Barthelemy",dial_code:"+590",alpha2_code:"BL",alpha3_code:"BLM"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",alpha2_code:"SH",alpha3_code:"SHN"},{name:"Saint Kitts and Nevis",dial_code:"+1869",alpha2_code:"KN",alpha3_code:"KNA"},{name:"Saint Lucia",dial_code:"+1758",alpha2_code:"LC",alpha3_code:"LCA"},{name:"Saint Martin",dial_code:"+590",alpha2_code:"MF",alpha3_code:"MAF"},{name:"Saint Pierre and Miquelon",dial_code:"+508",alpha2_code:"PM",alpha3_code:"SPM"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",alpha2_code:"VC",alpha3_code:"VCT"},{name:"Samoa",dial_code:"+685",alpha2_code:"WS",alpha3_code:"WSM"},{name:"San Marino",dial_code:"+378",alpha2_code:"SM",alpha3_code:"SMR"},{name:"Sao Tome and Principe",dial_code:"+239",alpha2_code:"ST",alpha3_code:"STP"},{name:"Saudi Arabia",dial_code:"+966",alpha2_code:"SA",alpha3_code:"SAU"},{name:"Senegal",dial_code:"+221",alpha2_code:"SN",alpha3_code:"SEN"},{name:"Serbia",dial_code:"+381",alpha2_code:"RS",alpha3_code:"SRB"},{name:"Seychelles",dial_code:"+248",alpha2_code:"SC",alpha3_code:"SYC"},{name:"Sierra Leone",dial_code:"+232",alpha2_code:"SL",alpha3_code:"SLE"},{name:"Singapore",dial_code:"+65",alpha2_code:"SG",alpha3_code:"SGP"},{name:"Slovakia",dial_code:"+421",alpha2_code:"SK",alpha3_code:"SVK"},{name:"Slovenia",dial_code:"+386",alpha2_code:"SI",alpha3_code:"SVN"},{name:"Solomon Islands",dial_code:"+677",alpha2_code:"SB",alpha3_code:"SLB"},{name:"Somalia",dial_code:"+252",alpha2_code:"SO",alpha3_code:"SOM"},{name:"South Africa",dial_code:"+27",alpha2_code:"ZA",alpha3_code:"ZAF"},{name:"South Sudan",dial_code:"+211",alpha2_code:"SS",alpha3_code:"SSD"},{name:"Spain",dial_code:"+34",alpha2_code:"ES",alpha3_code:"ESP"},{name:"Sri Lanka",dial_code:"+94",alpha2_code:"LK",alpha3_code:"LKA"},{name:"Sudan",dial_code:"+249",alpha2_code:"SD",alpha3_code:"SDN"},{name:"Suriname",dial_code:"+597",alpha2_code:"SR",alpha3_code:"SUR"},{name:"Svalbard and Jan Mayen",dial_code:"+47",alpha2_code:"SJ",alpha3_code:"SJM"},{name:"Swaziland",dial_code:"+268",alpha2_code:"SZ",alpha3_code:"SWZ"},{name:"Sweden",dial_code:"+46",alpha2_code:"SE",alpha3_code:"SWE"},{name:"Switzerland",dial_code:"+41",alpha2_code:"CH",alpha3_code:"CHE"},{name:"Syrian Arab Republic",dial_code:"+963",alpha2_code:"SY",alpha3_code:"SYR"},{name:"Taiwan",dial_code:"+886",alpha2_code:"TW",alpha3_code:"TWN"},{name:"Tajikistan",dial_code:"+992",alpha2_code:"TJ",alpha3_code:"TJK"},{name:"Tanzania, United Republic of Tanzania",dial_code:"+255",alpha2_code:"TZ",alpha3_code:"TZA"},{name:"Thailand",dial_code:"+66",alpha2_code:"TH",alpha3_code:"THA"},{name:"Timor-Leste",dial_code:"+670",alpha2_code:"TL",alpha3_code:"TLS"},{name:"Togo",dial_code:"+228",alpha2_code:"TG",alpha3_code:"TGO"},{name:"Tokelau",dial_code:"+690",alpha2_code:"TK",alpha3_code:"TKL"},{name:"Tonga",dial_code:"+676",alpha2_code:"TO",alpha3_code:"TON"},{name:"Trinidad and Tobago",dial_code:"+1868",alpha2_code:"TT",alpha3_code:"TTO"},{name:"Tunisia",dial_code:"+216",alpha2_code:"TN",alpha3_code:"TUN"},{name:"Turkey",dial_code:"+90",alpha2_code:"TR",alpha3_code:"TUR"},{name:"Turkmenistan",dial_code:"+993",alpha2_code:"TM",alpha3_code:"TKM"},{name:"Turks and Caicos Islands",dial_code:"+1649",alpha2_code:"TC",alpha3_code:"TCA"},{name:"Tuvalu",dial_code:"+688",alpha2_code:"TV",alpha3_code:"TUV"},{name:"Uganda",dial_code:"+256",alpha2_code:"UG",alpha3_code:"UGA"},{name:"Ukraine",dial_code:"+380",alpha2_code:"UA",alpha3_code:"UKR"},{name:"United Arab Emirates",dial_code:"+971",alpha2_code:"AE",alpha3_code:"ARE"},{name:"United Kingdom",dial_code:"+44",alpha2_code:"GB",alpha3_code:"GBR"},{name:"United States",dial_code:"+1",alpha2_code:"US",alpha3_code:"USA"},{name:"Uruguay",dial_code:"+598",alpha2_code:"UY",alpha3_code:"URY"},{name:"Uzbekistan",dial_code:"+998",alpha2_code:"UZ",alpha3_code:"UZB"},{name:"Vanuatu",dial_code:"+678",alpha2_code:"VU",alpha3_code:"VUT"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"+58",alpha2_code:"VE",alpha3_code:"VEN"},{name:"Vietnam",dial_code:"+84",alpha2_code:"VN",alpha3_code:"VNM"},{name:"Virgin Islands, British",dial_code:"+1284",alpha2_code:"VG",alpha3_code:"VGB"},{name:"Virgin Islands, U.S.",dial_code:"+1340",alpha2_code:"VI",alpha3_code:"VIR"},{name:"Wallis and Futuna",dial_code:"+681",alpha2_code:"WF",alpha3_code:"WLF"},{name:"Yemen",dial_code:"+967",alpha2_code:"YE",alpha3_code:"YEM"},{name:"Zambia",dial_code:"+260",alpha2_code:"ZM",alpha3_code:"ZMB"},{name:"Zimbabwe",dial_code:"+263",alpha2_code:"ZW",alpha3_code:"ZWE"}],U=e=>{const t=[];for(const a of q)a.dial_code.replace("+","")!=e&&a.dial_code!==e||t.push(a);return t},B=e=>{let{alpha2_code:t,alpha3_code:a}=e;for(const n of q){if(t&&a&&t.toLowerCase()===n.alpha2_code.toLowerCase()&&a.toLowerCase()===n.alpha3_code.toLowerCase())return n;if(t&&t.toLowerCase()===n.alpha2_code.toLowerCase())return n;if(a&&a.toLowerCase()===n.alpha3_code.toLowerCase())return n}},V=e=>{var t;let{label:a,name:s,info:c,confirm:i,tel:r,error:o,errorMessage:d,singleValue:b,groupStyle:u,inputProps:p,auto:m}=e;const[,h,O]=Object(n.d)(s),v=Object(l.useRef)(null),x=Object(I.a)((e=>e.allowed_phone_code),w.shallow);let f=[];const{country:g}=I.a.getState(),_=Object(l.useMemo)((()=>(null===x||void 0===x?void 0:x.split(",").map((e=>e.trim())).filter(Boolean))||[]),[x]);for(const n of _)f=f.concat(U(n).map((e=>e.alpha2_code.toLocaleLowerCase())));if(!f.length){var y;const e=null===(y=B({alpha3_code:g}))||void 0===y?void 0:y.alpha2_code.toLocaleLowerCase();f=e?[e]:void 0}const N=[h.touched&&h.error?"is-invalid":"",o&&d?"is-invalid":""].join(" "),C=Object(l.useCallback)((e=>{O.setValue("+".concat(e))}),[O,i,r,s]);Object(l.useEffect)((()=>{v.current&&void 0!=m&&v.current.focus()}),[]);return console.log("country---------------",f),Object(j.jsxs)("div",{className:"form-group",style:{...u},children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:a.split(" ").join(""),children:a}),Object(j.jsx)(P.a,{country:null===(t=B({alpha3_code:g}))||void 0===t?void 0:t.alpha2_code.toLocaleLowerCase(),value:b||"",containerClass:"phoneContainer",inputClass:"phoneInput ".concat(N," "),enableAreaCodes:!1,onlyCountries:f,countryCodeEditable:!1,masks:{ng:"... ... ...."},...p,onChange:C}),c,o&&d?Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:((e,t)=>{if(e&&t)return t})(o,d)}):h.touched&&h.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:h.touched&&!!h.error&&h.error})]})};var H=a(415);const Y=e=>{let{onChange:t,error:a,password:n,autofocus:s=!0,length:c=4,onComplete:i,clearOnMount:r}=e;const[o,d]=Object(l.useState)((()=>Array(c).fill(""))),{fields:b,clear:u}=Object(H.a)({values:o,onChange:e=>{d(e),t(e.join(""))},onComplete:e=>{i&&i(e)},autoFocus:s});return Object(l.useMemo)((()=>{r&&u({focus:!0})}),[r]),Object(j.jsx)("div",{className:"pin-inputs",children:b.map(((e,t)=>{const s=a?"pin-input_field error":"pin-input_field";return e={...e,placeholder:"",type:n?"password":"text"},Object(j.jsx)("input",{className:s,...e},t)}))})},W=e=>{let{type:t="text",label:a,name:n,placeholder:s}=e;return Object(j.jsxs)("div",{className:"mb-3 form-group",children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:"amount",children:a}),Object(j.jsx)("input",{name:n,type:t,placeholder:s,className:"px-3 py-3 form-control rounded-5 f-14px"})]})},G=e=>{let{label:t,className:a,disabled:l,loading:c,valueField:i="value",labelField:r="value",keyField:o,options:d,...b}=e;const[u,p]=Object(n.d)(b),{translate:m}=Object(s.useTranslation)(),h=[a,"form-select rounded-5 px-3 py-3 f-14px",p.touched&&p.error?"is-invalid":""].join(" ");return Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsxs)("label",{className:"mb-1",children:[t,c&&Object(j.jsx)("div",{className:"ms-1 spinner-border text-primary spinner-border-sm",children:Object(j.jsxs)("span",{className:"visually-hidden",children:[m("lender-web-app-loading"),"..."]})})]}),Object(j.jsxs)("select",{style:{textTransform:"capitalize"},disabled:l,className:h,"aria-label":m("lender-web-app-floating-label-select"),...u,...b,children:[Object(j.jsx)("option",{value:"",children:m("lender-web-app-select")}),null===d||void 0===d?void 0:d.map((e=>{var t;return Object(j.jsx)("option",{value:e[i],children:null!==(t=e[r])&&void 0!==t?t:e[i]},e[o])}))]}),p.touched&&p.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:p.error})]})},Z=e=>{let{label:t,name:a,placeholder:c,type:i="text",isToggleAble:r,className:o,info:d,inputProps:b,confirm:u,tel:p,error:m,errorMessage:h,onKeyDown:O,onKeyUp:v,isNumberString:x,auto:f,groupStyle:g,disabled:w,rightIcon:_,onIconClick:y,loading:N=!1,...C}=e;const{translate:k}=Object(s.useTranslation)(),[S,E,T]=Object(n.d)(a),A=Object(l.useRef)(null),L="password"===i||r?"is-invalid-password":"is-invalid",M=[o,"form-control rounded-5 px-3 py-3 f-14px",E.touched&&E.error?L:"",m&&h?L:""].join(" "),D=Object(l.useCallback)((e=>{T.setValue((e=>p?e.target.value.slice(0,11):u?e.target.value.slice(0,5):"referral_code"===a?e.target.value.slice(0,6):e.target.value)(e))}),[T,u,p,a]);x&&console.log("numberrrr clf");const[F,I]=Object(l.useState)(r?"password":i);return Object(l.useEffect)((()=>{A.current&&void 0!=f&&A.current.focus()}),[]),Object(j.jsxs)("div",{className:"form-group",style:{...g},children:[Object(j.jsx)("label",{className:"mb-1",htmlFor:t.split(" ").join(""),children:t}),Object(j.jsx)("input",{style:r?{backgroundImage:"none"}:{},className:M,type:F,id:t.split(" ").join(""),onKeyDown:O,placeholder:null!==c&&void 0!==c?c:t,min:0,ref:A,disabled:w,...S,...b,...C,autoComplete:r?"new-password":"on",onChange:D,onKeyUp:v}),r&&Object(j.jsx)("span",{onClick:()=>I((e=>"password"===e?"text":"password")),className:"input-icon",id:"toggle-icon",children:"password"===F?Object(j.jsx)("svg",{width:"20",height:"20",className:"eye-off",children:Object(j.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye-close"})}):Object(j.jsx)("svg",{width:"20",height:"20",className:"eye",children:Object(j.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye"})})}),_&&!N&&Object(j.jsx)("span",{onClick:()=>null===y||void 0===y?void 0:y(),className:"input-icon",id:"toggle-icon",children:_}),N&&Object(j.jsx)("div",{className:"input-icon mt-2 spinner-border text-primary spinner-border-sm",children:Object(j.jsxs)("span",{className:"visually-hidden",children:[k("lender-web-app-loading"),"..."]})}),d,m&&h&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:m&&h&&h}),E.touched&&E.error&&Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"0.7rem"},children:E.touched&&E.error&&E.error})]})};var K=a(218);const z=e=>{let{label:t="Select a Time",minDate:a,maxDate:s,className:c,name:i}=e;const[,r,o]=Object(n.d)(i),d=[c,"form-control rounded-5 px-3 py-3 f-14px",r.error?"is-invalid":""].join(" ");return Object(l.useEffect)((()=>{a&&o.setValue(u()(a).format("YYYY/MM/DD HH:mm:ss")),s&&o.setValue(u()(s).format("YYYY/MM/DD HH:mm:ss"))}),[t]),Object(j.jsxs)("div",{className:"form-group",children:[Object(j.jsx)("label",{children:t}),Object(j.jsx)(O.a,{closeOnSelect:!0,className:[c,"form-group"].join(" "),onChange:e=>{o.setValue(u()(e).format("HH:mm:ss"))},isValidDate:e=>J(e,a,s),dateFormat:!1,inputProps:{placeholder:"Select time",className:d,readOnly:!0}}),r.error?Object(j.jsx)("small",{className:"form-text text-danger d-block text-small",style:{height:"2rem",marginTop:"-1.1rem"},children:r.error}):null]})},J=(e,t,a)=>a&&t?e.isBetween(t,a):a?e.isBefore(a):t?e.isSame(t)||e.isAfter(t):void 0,Q=e=>{let{checked:t,logo:a,number:n,name:s,onClick:l,cardName:c,className:i}=e;return Object(j.jsxs)("label",{onClick:l,className:"card_radio smallbankcard position-relative w-100 mx-1 ".concat(i),children:[Object(j.jsx)("input",{readOnly:!0,type:"radio",name:s,checked:t}),Object(j.jsxs)("div",{className:"content rounded-3 d-flex justify-content-between",style:{paddingLeft:"30px"},children:[Object(j.jsxs)("div",{children:[Object(j.jsx)("p",{className:"name text-small",children:c}),Object(j.jsx)("p",{className:"cardno text-x-small text-app-gray",style:{fontSize:"0.7rem"},children:n})]}),Object(j.jsx)("div",{className:"logo-wrapper mb-2",children:Object(j.jsx)("img",{height:"16px",src:a,alt:"bank logo"})}),Object(j.jsx)("svg",{width:"11",className:"unchecked-icon",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"#41A1CE"})}),Object(j.jsxs)("svg",{className:"checked-icon",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"#41A1CE"}),Object(j.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"#41A1CE"})]})]})]})},X=e=>{let{label:t,children:a,...n}=e;return Object(j.jsxs)("label",{className:"custom_radio",children:[Object(j.jsx)("input",{type:"radio",...n}),Object(j.jsxs)("div",{className:"content  rounded-3 ms-0",children:[Object(j.jsx)("svg",{width:"16",className:"unchecked-icon text-primary",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"})}),Object(j.jsxs)("svg",{className:"checked-icon text-primary",width:"16",height:"16",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(j.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"}),Object(j.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"currentColor"})]}),a||t]})]})}},711:function(e,t,a){},715:function(e,t,a){},72:function(e,t,a){"use strict";a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return s}));class n{static statusPill(e){switch(e){case 0:default:return"running";case 1:return"matured"}}}const s={automatic:{id:1,name:"Automatic"},manual:{id:2,name:"Manual"}}},743:function(e,t,a){},744:function(e,t,a){},745:function(e,t,a){},746:function(e,t,a){},762:function(e,t,a){"use strict";a.r(t);a(448),a(453),a(454),a(459),a(460),a(466),a(486),a(487),a(488),a(489),a(490),a(491),a(492),a(493),a(494),a(495),a(496),a(497),a(498),a(502),a(510),a(513),a(517),a(519),a(521),a(523),a(527),a(530),a(536),a(545),a(546);var n=a(1),s=a.n(n),l=a(403),c=a(20),i=a(9),r=a(404);var o=e=>{e&&e instanceof Function&&a.e(3).then(a.bind(null,786)).then((t=>{let{getCLS:a,getFID:n,getFCP:s,getLCP:l,getTTFB:c}=t;a(e),n(e),s(e),l(e),c(e)}))},d=a(41),b=a(117),u=a(86);function j(e){const t=document.createElement("style");document.head.appendChild(t);const a=t.sheet;if(a)for(const n of e)a.insertRule(":root {--".concat(n.property,":").concat(n.value||n.default_value," }"),a.cssRules.length)}var p=a(29),m=a(779),h=a(780),O=a(783),v=a(782),x=a(434),f=a.n(x),g=a(0);var w=()=>Object(g.jsxs)("main",{id:"primary",className:"site-main uni-width not-found-holder",children:[Object(g.jsx)("div",{className:"not-found-first",children:Object(g.jsxs)("div",{className:"not-found-inner",children:[Object(g.jsxs)("h1",{className:"not-found-header text-primary",children:[Object(g.jsx)("span",{children:"Oops!"})," Seems that page got lost"]}),Object(g.jsx)("p",{className:"not-found-p mt-16 text-secondary",children:"We\u2019re not quite sure what happened there, but let\u2019s take you back so you can explore other amazing stuff!"}),Object(g.jsx)("a",{href:"https://lsq.li/lendsqr?utm_source=web_app_404 ",className:"not-found-btn padding-small mt-32p not-found-anchor","aria-label":"Go to home page",children:"Take me home"})]})}),Object(g.jsx)("div",{className:"not-found-second",children:Object(g.jsx)("img",{src:"/images/not-found-hero.svg",alt:"falling man",className:"not-found-hero"})})]});(async function(){d.a.getState().clearTokenUsage();try{var e;const n="localhost"===window.location.hostname,s=n?Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}).REACT_APP_DOMAIN_NAME:window.location.hostname;{var t;const[e,n,l,c,i,r]=await Object(b.c)(["auth","content","colors","last_fetched","expiry","domain"]),o=null===l||void 0===l?void 0:l.find((e=>"primary_color"===e.property));if(sessionStorage.setItem("primary_color",null!==(t=null===o||void 0===o?void 0:o.value)&&void 0!==t?t:"#000"),i&&c){if(Date.now()-c>i)Object(b.d)([["auth",null],["colors",null],["content",null],["last_fetched",null],["expiry",null],["domain",null]]).then();else if(r&&s===r){var a;return window.LSQ_CONFIG_TOKEN=e.token,window.APP_INVESTMENT_CONFIG_NAME=null===n||void 0===n||null===(a=n.configs)||void 0===a?void 0:a.enable_and_name_savings,j(l),[n,""]}}}const l=await u.a.get("".concat("https://vigil.lendsqr.com/web-config","/site/").concat(s));if(200!==l.status)return[{},new Error("There was a problem starting the app")];const{data:c}=l;if(c.data.domain!==s&&!n)return window.location.href="https://".concat(c.data.domain),[{},""];window.LSQ_CONFIG_TOKEN=c.data.auth.token;const{options:i}=c.data.theme,{colors:r,dictionary:o,configs:d,assets:p,links:m}=function(e){const t=[],a={},n={},s={},l={};for(const c of e)switch(c.data_type){case"color":t.push(c);break;case"text":a[c.property]=c.value||c.default_value;break;case"config":s[c.property]=c.value||c.default_value;break;case"asset":n[c.property]=c.value||c.default_value;break;case"link":l[c.property]=c.value||c.default_value}return{colors:t,dictionary:a,assets:n,configs:s,links:l}}(i),h=null===r||void 0===r?void 0:r.find((e=>"primary_color"===e.property));return sessionStorage.setItem("primary_color",null!==(e=null===h||void 0===h?void 0:h.value)&&void 0!==e?e:"#000"),j(r),Object(b.d)([["auth",c.data.auth],["colors",r],["content",{dictionary:o,assets:p,configs:d,links:m}],["last_fetched",Date.now()],["expiry",c.data.expire],["domain",c.data.domain]]).then(),[{dictionary:o,assets:p,configs:d},""]}catch(n){return console.error(n),[{},new Error(n.message||"There was a problem starting the app")]}})().then((e=>{let[t,a]=e;if(a&&"Error: Request failed with status code 404"!==a.toString())return void console.log(a);m.a({dsn:"localhost"===window.location.hostname?null:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",environment:"production",debug:!1,release:"0.7.2",dist:"e6cf7bd",tracesSampleRate:1,profilesSampleRate:1,replaysSessionSampleRate:.5,replaysOnErrorSampleRate:1,integrations:[h.a(),O.a(),v.a({maskAllText:!1,maskAllInputs:!1})]});const n=document.getElementById("root");if(!n)return;Object(l.createRoot)(n).render(Object(g.jsx)(s.a.StrictMode,{children:Object(g.jsx)(c.a,{children:Object(g.jsxs)(f.a,{height:200,children:[Object(g.jsx)(i.Toaster,{position:"top-center",reverseOrder:!1,gutter:8,containerClassName:"",containerStyle:{},toastOptions:{className:"",duration:5e3,style:{background:"#363636",color:"#fff"},success:{duration:3e3,iconTheme:{primary:"green",secondary:"black"}}}}),Object(g.jsxs)(p.a.Provider,{value:t,children:["Error: Request failed with status code 404"===(null===a||void 0===a?void 0:a.toString())&&Object(g.jsx)(w,{}),!a&&Object(g.jsx)(r.a,{})]})]})})}))})).catch(console.error),o()},79:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));a(1);var n=a(418),s=a.n(n),l=a(0);function c(e){let{rounded:t,height:a}=e;return Object(l.jsx)("div",{children:Object(l.jsx)(s.a,{height:null!==a&&void 0!==a?a:130,style:{borderRadius:t?"9px":0}})})}},81:function(e,t,a){"use strict";a.d(t,"f",(function(){return m})),a.d(t,"h",(function(){return O})),a.d(t,"g",(function(){return x})),a.d(t,"b",(function(){return _})),a.d(t,"c",(function(){return y})),a.d(t,"a",(function(){return k})),a.d(t,"d",(function(){return S})),a.d(t,"e",(function(){return T})),a.d(t,"j",(function(){return L})),a.d(t,"k",(function(){return R})),a.d(t,"i",(function(){return P}));var n=a(8),s=a(12),l=a(6),c=a(1),i=a(15),r=a(29),o=a(21),d=a(18),b=a(2),u=a(4),j=a(7),p=a(0);const m=()=>{var e,t,a;const[m,h,O,v,x,f]=Object(i.a)((e=>[e.loading,e.onboard,e.phone_number,e.validateAllowedDomainOnboarding,e.terms_url,e.organization]),u.shallow),g=Object(o.j)(),{dictionary:w}=Object(c.useContext)(r.a),_=null===(e=window)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.search,y=new URLSearchParams(_).get("referral_code"),N=Object(d.p)(null===w||void 0===w?void 0:w["allowed-domains"]),{translate:C}=Object(b.useTranslation)(),k=n.g().shape({phone_number:n.h().min(6,C("lender-web-app-phone-min")).max(20,C("lender-web-app-phone-max")).required(C("lender-web-app-phone-number-error")),referral_code:n.h().min(6,C(C("lender-web-app-referral-code-invalid"))).max(6,C("lender-web-app-referral-code-invalid"))}),S=n.g().shape({phone_number:n.h().min(6,C("lender-web-app-phone-min")).max(20,C("lender-web-app-phone-max")).required(C("lender-web-app-phone-number-error")),referral_code:n.h().min(6,C("lender-web-app-referral-code-invalid")).max(6,C("lender-web-app-referral-code-invalid")),email:n.h().email().required(C("lender-web-app-enter-valid-email"))});return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35",children:C("lender-web-app-preferred-number")}),Object(p.jsx)(s.c,{enableReinitialize:!0,validationSchema:w&&""!==w["allowed-domains"]&&(null===N||void 0===N?void 0:N.length)>0?S:k,initialValues:{phone_number:O||(null===g||void 0===g||null===(a=g.state)||void 0===a?void 0:a.phone_number)||"",referral_code:null!==y&&void 0!==y?y:"",email:""},onSubmit:async e=>{const t=async()=>{await h(e)};if(w&&""!==w["allowed-domains"]&&(null===N||void 0===N?void 0:N.length)>0){await v(e.email)&&t()}else t()},children:e=>Object(p.jsxs)(s.b,{method:"post",onSubmit:e.handleSubmit,children:[N.length>0&&Object(p.jsx)(j.s,{type:"email",name:"email",label:C("lender-web-app-email-address")}),Object(p.jsx)(j.n,{tel:!0,name:"phone_number",label:C("lender-web-app-phone-number"),inputProps:{maxLength:11,minLength:11}}),Object(p.jsx)(j.s,{name:"referral_code",label:C("lender-web-app-referral-code")}),Object(p.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(p.jsxs)("small",{children:[C("lender-web-app-mobile-agree")," ",f,"'s",Object(p.jsxs)("a",{href:x||"/",target:"_blank",className:"",rel:"noreferrer",children:[" ",C("lender-web-app-terms-condition")," "]})]})}),Object(p.jsx)(l.a,{isLoading:m,isDisabled:!e.isValid,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:C("lender-web-app-get-started")})]})}),Object(p.jsxs)("p",{className:"mt-4 text-center",children:[C("lender-web-app-have-account")," ",Object(p.jsx)("a",{href:"/login",className:"",children:C("lender-web-app-login")})]})]})};var h=a(3);const O=()=>{const{translate:e}=Object(b.useTranslation)(),t=n.g().shape({otp:n.h().min(6,e("lender-web-app-valid-code")).max(6,e("lender-web-app-valid-code")).required(e("lender-web-app-enter-the-code"))}),[a,r,o,d,m]=Object(i.a)((e=>[e.loading,e.resendCode,e.phone_number,e.onboardOTP,e.setScreen]),u.shallow),O=Object(s.e)({initialValues:{otp:""},validationSchema:t,onSubmit:async e=>{let{otp:t}=e;await d(t)}}),[v,x]=Object(c.useState)(600);Object(c.useEffect)((()=>{if(v>0){const e=setTimeout((()=>x(v-1)),1e3);return()=>clearTimeout(e)}}),[v]);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:e("lender-web-app-enter-otp")}),Object(p.jsxs)("form",{onSubmit:O.handleSubmit,children:[Object(p.jsxs)("div",{className:"form-group form-floating",children:[Object(p.jsx)("input",{disabled:!0,value:o,className:"form-control form-left",type:"tel",id:"PhoneNumber",placeholder:e("lender-web-app-phone-number"),pattern:"[0-9]*",maxLength:11,onKeyDown:h.b,onKeyUp:h.t}),Object(p.jsx)("label",{htmlFor:"PhoneNumber",children:e("lender-web-app-phone-number")}),Object(p.jsx)("button",{type:"button",style:{border:"none",color:"#016AB3"},onClick:()=>m(1),className:"mt-1 d-block bg-white",children:Object(p.jsx)("small",{children:e("lender-web-app-change-number")})})]}),Object(p.jsxs)("p",{style:{marginBottom:0},children:[e("lender-web-app-six-digit")," "]}),Object(p.jsx)(j.o,{length:6,onChange:e=>{O.setFieldValue("otp",e,!0)},error:O.errors.otp,autofocus:!0,password:!0}),Object(p.jsx)("div",{className:"",children:O.errors.otp&&Object(p.jsx)("p",{className:"text-danger",children:O.errors.otp})}),Object(p.jsxs)("p",{className:"",children:[e("lender-web-app-no-otp")," ",Object(p.jsx)("button",{type:"button",style:{border:"none",color:"#016AB3"},onClick:()=>{x(600),r()},className:"mt-1 resend-button bg-white",disabled:a||v>0,children:Object(p.jsx)("small",{children:e("lender-web-app-resend-code")})})]}),Object(p.jsx)("p",{children:(e=>{const t=Math.floor(e/60),a=e%60;return"".concat(t.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0"))})(v)}),Object(p.jsx)(l.a,{isLoading:a,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:e("lender-web-app-continue")})]})]})};var v=a(178);const x=()=>{const[e,t]=Object(c.useState)("bg-gray"),[a,n]=Object(c.useState)(0),[s,r]=Object(i.a)((e=>[e.loading,e.createPassword]),u.shallow),[o,d]=Object(c.useState)("password"),[j,m]=Object(c.useState)(""),{validate:h,validated:O}=Object(v.a)(),{translate:x}=Object(b.useTranslation)();return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:x("lender-web-app-secure-account")}),Object(p.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{await r(j)}catch(t){console.log(t)}},children:[Object(p.jsxs)("div",{className:"form-group",children:[Object(p.jsx)("label",{children:x("lender-web-app-password")}),Object(p.jsx)("input",{className:"form-control",onChange:async e=>{let a=0;const{value:s}=e.target;m(s),h(s),s.length>7&&(a+=25),/[A-Z]/.test(s)&&(a+=25),/[a-z]/.test(s)&&(a+=25),/[=!@#&$%]/.test(s)&&(a+=25),t(a<50?"bg-danger":100===a?"bg-success":"bg-warning"),n(a)},value:j,type:o}),Object(p.jsx)("span",{onClick:()=>d((e=>"password"===e?"text":"password")),className:"input-icon",id:"toggle-icon",children:"password"===o?Object(p.jsx)("svg",{width:"20",height:"20",className:"eye-off",children:Object(p.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye-close"})}):Object(p.jsx)("svg",{width:"20",height:"20",className:"eye",children:Object(p.jsx)("use",{xlinkHref:"/icon-sprite.svg#eye"})})})]}),Object(p.jsxs)("div",{className:"d-flex justify-content-between",children:[Object(p.jsx)("div",{className:"progress",children:Object(p.jsx)("div",{className:"progress-bar bg-gray ".concat(e),style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(p.jsx)("div",{className:"progress",children:Object(p.jsx)("div",{className:"progress-bar bg-gray ".concat(a>25&&e),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(p.jsx)("div",{className:"progress",children:Object(p.jsx)("div",{className:"progress-bar bg-gray ".concat(a>50&&e),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})}),Object(p.jsx)("div",{className:"progress",children:Object(p.jsx)("div",{className:"progress-bar bg-gray ".concat(a>90&&e),role:"progressbar",style:{width:"100%"},"aria-valuenow":100,"aria-valuemin":0,"aria-valuemax":100})})]}),Object(p.jsx)("p",{className:"password-hint",children:x("lender-web-app-password-requirment")}),Object(p.jsx)(l.a,{type:"submit",isDisabled:!O,isLoading:s,className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-3",children:x("lender-web-app-continue")})]})]})};var f=a(68);const g="BVN length must be 11 characters long",w=["12345-test.lsq.li"],_=()=>{const{translate:e}=Object(b.useTranslation)(),t=n.g().shape({bvn:n.h().min(11,g).max(11,g).required(e("lender-web-app-please-add-bvn"))}),[a,r,o]=Object(i.a)((e=>[e.loading,e.verifyBVN,e.privacy_url]),u.shallow),d="localhost"===window.location.hostname?Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}).REACT_APP_DOMAIN_NAME:window.location.hostname,[m,O]=Object(c.useState)(d&&w.includes(d)),[v,x]=Object(c.useState)(""),{token:_}=i.a.getState();return m?Object(p.jsx)(f.a,{visible:m,access_token:_,type:"bvn",onSuccess:async e=>{if(!e.bvn)return O(!1);await r(e.bvn).catch((()=>{O(!1)}))},onFailed:function(){x(arguments.length>0&&void 0!==arguments[0]?arguments[0]:""),O(!1)}}):Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:e("lender-web-app-enter-bvn")}),Object(p.jsx)(s.c,{validationSchema:t,initialValues:{bvn:""},onSubmit:async e=>{let{bvn:t}=e;await r(t)},children:t=>Object(p.jsxs)(s.b,{method:"post",onSubmit:t.handleSubmit,children:[Object(p.jsx)(j.s,{name:"bvn",label:e("lender-web-app-id-number"),inputProps:{pattern:"[0-9]*",maxLength:11},onKeyDown:h.b,onKeyUp:h.t,error:!!v,errorMessage:v}),Object(p.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(p.jsxs)("small",{children:[Object(p.jsx)("a",{href:o||"/",target:"_blank",className:"",rel:"noreferrer",children:e("lender-web-app-bvn-privacy")})," ",Object(p.jsx)("br",{}),e("lender-web-app-no-bvn-access")]})}),Object(p.jsx)(l.a,{isLoading:a,isDisabled:!(t.isValid&&t.touched),type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:e("lender-web-app-continue")})]})})]})},y=()=>{const[e,t,a]=Object(i.a)((e=>[e.loading,e.createBVN,e.setBvnScreen]),u.shallow),{translate:c}=Object(b.useTranslation)(),r=c("lender-web-app-number-length-5"),o=n.g().shape({phone_number:n.h().min(5,r).max(5,r).required(c("lender-web-app-please-enter-number")),dob:n.h().nullable().required(c("lender-web-app-select-dob"))});return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:c("lender-web-app-confirm-bvn")}),Object(p.jsx)(s.c,{validationSchema:o,enableReinitialize:!0,initialValues:{phone_number:"",dob:""},onSubmit:async e=>{await t(e)},children:t=>Object(p.jsxs)(s.b,{method:"post",className:"confirm-bvn",onSubmit:t.handleSubmit,children:[Object(p.jsx)(j.s,{confirm:!0,type:"tel",name:"phone_number",label:c("lender-web-app-last-five-number")}),Object(p.jsx)(j.h,{label:c("lender-web-app-dob"),name:"dob"}),Object(p.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(p.jsx)("small",{children:c("lender-web-app-confrim-bvn-date")})}),Object(p.jsx)(l.a,{isLoading:e,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:c("lender-web-app-continue")}),Object(p.jsx)(l.a,{className:"w-100 py-3 btn btn-outline-primary text-primary rounded-5 btn-lg px-5 mt-2",style:{background:"#FFFFFF00"},onClick:()=>{a(1)},children:c("lender-web-app-back")})]})})]})};var N=a(86),C=a(10);const k=()=>{const{translate:e}=Object(b.useTranslation)(),[t,a,r,o,d]=Object(i.a)((e=>{var t;return[e.loading,e.addBank,e.token,e.verifyBank,JSON.parse(null!==(t=e.require_mandate_on_onboard)&&void 0!==t?t:"{}")]})),u=n.g().shape({account_number:n.h().required(e("lender-web-app-please-enter-account")),bank_code:n.h().required(e("lender-web-app-please-select-bank"))}),[m,h]=Object(c.useState)(!1),[O,v]=Object(c.useState)([]),[x,f]=Object(c.useState)("");Object(c.useEffect)((()=>{(async()=>{try{const{data:e}=await N.b.get(C.h,{headers:{Authorization:"bearer ".concat(r)}});v(e.data.map((e=>({bank_name:e.code_description,bank_code:e.additional_code}))))}catch(e){console.log(e)}})()}),[]);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:e("lender-web-app-need-account-details")}),Object(p.jsx)(s.c,{validationSchema:u,initialValues:{account_number:"",bank_code:""},onSubmit:async e=>{if(x)await a(e);else{const t=await(async e=>{h(!0);const t=await o(e);return h(!1),null===t||void 0===t?void 0:t.account_name})(e);t&&f(t)}},children:a=>Object(p.jsxs)(s.b,{method:"post",onSubmit:a.handleSubmit,children:[Object(p.jsx)(j.t,{name:"account_number",label:e("lender-web-app-account-number")}),Object(p.jsx)(j.q,{name:"bank_code",label:e("lender-web-app-select-bank"),labelField:"bank_name",valueField:"bank_code",keyField:"bank_code",options:O}),(null===d||void 0===d?void 0:d.require_mandate)&&x&&Object(p.jsx)(j.t,{name:"address",label:e("lender-web-app-address")}),x&&Object(p.jsxs)("div",{className:"form-group form-floating",children:[Object(p.jsx)("input",{disabled:!0,className:"form-control",style:{paddingLeft:"1rem"},value:x,placeholder:"Account Name"}),Object(p.jsx)("label",{children:e("lender-web-app-account-name")})]}),Object(p.jsx)("div",{className:"p-3 rounded-4 bg-light-blue",children:Object(p.jsx)("small",{children:"By proceeding you agree to have a mandate created"})}),Object(p.jsx)(l.a,{isLoading:x?t:m,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:e(x?"lender-web-app-get-started":"lender-web-app-verify-account")})]})})]})},S=()=>{const[e,t]=Object(i.a)((e=>[e.loading,e.addPin]),u.shallow),{translate:a}=Object(b.useTranslation)(),c=n.g().shape({pin:n.h().min(4,a("lender-web-app-please-valid-pin")).max(4,a("lender-web-app-please-valid-pin")).required(a("lender-web-app-please-enter-your-pin"))}),r=Object(s.e)({initialValues:{pin:""},validationSchema:c,onSubmit:async e=>{await t(e)}});return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:a("lender-web-app-create-pin")}),Object(p.jsxs)("form",{onSubmit:r.handleSubmit,children:[Object(p.jsx)("p",{children:a("lender-web-app-four-digit")}),Object(p.jsx)(j.o,{onChange:e=>{r.setFieldValue("pin",e,!0)},error:r.errors.pin,password:!0}),Object(p.jsx)("div",{className:"",children:r.errors.pin&&Object(p.jsx)("p",{className:"text-danger",children:r.errors.pin})}),Object(p.jsx)(l.a,{isLoading:e,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:a("lender-web-app-continue")})]})]})};var E=a(420);const T=()=>{const[e,t,a,o,m,h]=Object(i.a)((e=>[e.loading,e.addEmail,e.validateAllowedDomainOnboarding,e.approved_domain_email,e.signInWithGoogle,e.email_provider]),u.shallow),{dictionary:O}=Object(c.useContext)(r.a),v=Object(d.p)(null===O||void 0===O?void 0:O["allowed-domains"]),{translate:x}=Object(b.useTranslation)(),f=n.g().shape({email:n.h().email(x("lender-web-app-email-must-email")).required(x("lender-web-app-please-enter-email"))});return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:x("lender-web-app-need-email")}),"firebase"===h?Object(p.jsx)(E.GoogleLoginButton,{onClick:async()=>{try{await m()}catch(e){console.log(e)}},className:"my-3 "}):Object(p.jsx)(s.c,{validationSchema:f,initialValues:{email:o||""},onSubmit:async e=>{const n=async()=>{await t(e)};if(O&&""!==O["allowed-domains"]&&(null===v||void 0===v?void 0:v.length)>0){await a(e.email)&&n()}else n()},children:t=>Object(p.jsxs)(s.b,{method:"post",onSubmit:t.handleSubmit,children:[Object(p.jsx)(j.t,{name:"email",label:x("lender-web-app-email-address")}),Object(p.jsx)(l.a,{isLoading:e,type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4",children:x("lender-web-app-continue")})]})})]})};var A=a(13);const L=()=>{const e=Object(o.i)(),t=Object(A.a)((e=>e.setDownloadAppModal),u.shallow),a=Object(i.a)((e=>e.resetCerte)),{translate:n}=Object(b.useTranslation)();return Object(p.jsxs)("div",{className:"d-flex flex-column align-items-center text-center h-100 justify-content-center",children:[Object(p.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(p.jsx)("path",{d:"M54.3987 7.6557C53.5748 6.83046 52.2382 6.82904 51.4144 7.65219L26.0948 32.9049L16.9596 22.9832C16.1702 22.1263 14.8356 22.0708 13.9774 22.86C13.1198 23.6494 13.0649 24.9846 13.8542 25.8422L24.4774 37.3792C24.8664 37.8021 25.4109 38.0476 25.985 38.0595C26.0004 38.0602 26.0153 38.0602 26.0301 38.0602C26.588 38.0602 27.1247 37.8386 27.5201 37.4446L54.3945 10.6406C55.2204 9.8176 55.2218 8.48093 54.3987 7.6557Z",fill:"url(#paint0_radial)"}),Object(p.jsx)("path",{d:"M53.8894 25.8894C52.7237 25.8894 51.7789 26.8342 51.7789 28C51.7789 41.1122 41.1122 51.7789 28 51.7789C14.8886 51.7789 4.22111 41.1122 4.22111 28C4.22111 14.8886 14.8886 4.22111 28 4.22111C29.1657 4.22111 30.1106 3.27633 30.1106 2.11061C30.1106 0.944781 29.1657 0 28 0C12.5606 0 0 12.5606 0 28C0 43.4387 12.5606 56 28 56C43.4387 56 56 43.4387 56 28C56 26.8343 55.0552 25.8894 53.8894 25.8894Z",fill:"url(#paint1_radial)"}),Object(p.jsxs)("defs",{className:"text-primary",children:[Object(p.jsxs)("radialGradient",{id:"paint0_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(34.1557 22.548) rotate(36.6367) scale(25.995 24.8951)",children:[Object(p.jsx)("stop",{stopColor:"currentColor"}),Object(p.jsx)("stop",{offset:"1",stopColor:"currentColor"})]}),Object(p.jsxs)("radialGradient",{id:"paint1_radial",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(28 28) rotate(45) scale(39.598)",children:[Object(p.jsx)("stop",{stopColor:"currentColor"}),Object(p.jsx)("stop",{offset:"1",stopColor:"currentColor"})]})]})]}),Object(p.jsxs)("h5",{className:"mt-35 mb-3 text-primary",children:[n("lender-web-app-congratulations")," \ud83c\udf89\ud83c\udf89"]}),Object(p.jsx)("p",{className:"text-app-gray",children:n("lender-web-app-sign-up-complete")}),Object(p.jsx)(l.a,{onClick:()=>{a(),e.push("/"),t(!0)},style:{maxWidth:"300px"},type:"submit",className:"w-100 py-3 btn btn-primary rounded-5 btn-lg px-5 mt-4 mx-auto",children:n("lender-web-app-go-login")})]})};var M=a(9),D=a.n(M),F=a(145);const I=["app.tmbp.ng","commodo.lsq.app","kay.lsq.li","bejewelled.lsq.app","app.irorun.com","app.blocka.cash"],R=()=>{const[e,t,a,n]=Object(i.a)((e=>[e.loading,e.addPhoto,e.openCamera,e.uploadPhoto])),[s,r]=Object(c.useState)(!1),[o,d]=Object(c.useState)(),[u,j]=Object(c.useState)(),m="localhost"===window.location.hostname?Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}).REACT_APP_DOMAIN_NAME:window.location.hostname,h=!!m&&I.includes(m),{token:O}=i.a.getState(),v=Object(c.useCallback)((e=>{j({file:e,preview:e}),n()}),[]),{translate:x}=Object(b.useTranslation)();return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)("h3",{style:{lineHeight:"1.4"},className:"text-black mb-35 ",children:x("lender-web-app-take-picture")}),!h&&!s&&Object(p.jsx)("div",{className:"mb-3 text-center rounded d-flex bg-light-blue btn justify-content-center align-items-center flex-column",style:{border:"1px dashed #016AB3",height:"229px"},onClick:()=>{a(),r(!0)},children:u?Object(p.jsx)("img",{className:"p-1",style:{maxHeight:"215px",maxWidth:"100%",objectFit:"contain"},alt:"Preview",src:null===u||void 0===u?void 0:u.preview}):Object(p.jsxs)("div",{className:"p-5",children:[Object(p.jsx)("svg",{className:"mb-3 ",width:"40",height:"36",viewBox:"0 0 40 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(p.jsx)("path",{d:"M36 4H4V32L22.584 13.412C22.9591 13.0371 23.4677 12.8264 23.998 12.8264C24.5283 12.8264 25.0369 13.0371 25.412 13.412L36 24.02V4ZM0 1.986C0.00366009 1.46076 0.213801 0.958035 0.585026 0.586435C0.956251 0.214836 1.45876 0.0041893 1.984 0H38.016C39.112 0 40 0.89 40 1.986V34.014C39.9963 34.5392 39.7862 35.042 39.415 35.4136C39.0438 35.7852 38.5412 35.9958 38.016 36H1.984C1.45763 35.9995 0.952994 35.79 0.580979 35.4176C0.208964 35.0452 -2.6691e-07 34.5404 0 34.014V1.986ZM12 16C10.9391 16 9.92172 15.5786 9.17157 14.8284C8.42143 14.0783 8 13.0609 8 12C8 10.9391 8.42143 9.92172 9.17157 9.17157C9.92172 8.42143 10.9391 8 12 8C13.0609 8 14.0783 8.42143 14.8284 9.17157C15.5786 9.92172 16 10.9391 16 12C16 13.0609 15.5786 14.0783 14.8284 14.8284C14.0783 15.5786 13.0609 16 12 16Z",fill:"#567890"})}),Object(p.jsx)("p",{className:"fw-bold",children:x("lender-web-app-click-take-picture")}),Object(p.jsxs)("p",{className:"text-small text-app-gray",children:["(",x("lender-web-app-max-50"),")"]})]})}),Object(p.jsxs)("i",{className:"text-small",style:{marginBottom:0},children:["**",x("lender-web-app-pdf-jpeg")," "]}),u&&Object(p.jsxs)("div",{style:{background:"var(--light_primary_color)"},className:"p-3 mt-3 rounded-3 d-flex justify-content-center align-items-center",children:[Object(p.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(p.jsx)("path",{d:"M8.5 0C3.8033 0 0 3.8033 0 8.5C0 13.1967 3.8033 17 8.5 17C13.1967 17 17 13.1967 17 8.5C17 3.8033 13.1967 0 8.5 0ZM13.5285 6.94294L8.01501 12.4565C7.60661 12.8649 6.94294 12.8649 6.53453 12.4565L6.15165 12.0736L3.54805 9.46997C3.13964 9.06156 3.13964 8.3979 3.54805 7.98949L3.93093 7.60661C4.33934 7.1982 5.003 7.1982 5.41141 7.60661L7.27477 9.46997L11.6652 5.07958C12.0736 4.67117 12.7372 4.67117 13.1456 5.07958L13.5285 5.46246C13.9369 5.87087 13.9369 6.53453 13.5285 6.94294Z",fill:"#31C5A1"})}),Object(p.jsx)("p",{className:" ms-3",children:x("lender-web-app-good-picture")})]}),h&&Object(p.jsx)(f.a,{visible:h,access_token:O,type:"liveness",onSuccess:async e=>{r(!1),await t(void 0,e.url)},onFailed:()=>{r(!1),D.a.error(x("lender-web-app-invalid-liveness")),setTimeout((()=>{window.location.reload()}),5e3)}}),Object(p.jsx)(l.a,{isLoading:e,onClick:async()=>{try{const e=await fetch(null===u||void 0===u?void 0:u.file),a=await e.blob();if(a.size/1e9>4)return void D.a.error(x("lender-web-app-upload-less-50"));const n=new FormData;n.append("file",a,"profile-picture.png"),await t(n)}catch(e){D.a.error("".concat(x("lender-web-app-error-uploading-photo")," ").concat(null===e||void 0===e?void 0:e.message))}},isDisabled:!u,className:"px-5 py-3 mt-4 w-100 btn btn-primary rounded-5 btn-lg",children:x("lender-web-app-continue")}),s&&!h&&Object(p.jsx)(F.a,{showWebCamModal:s,setShowWebCamModal:r,setCapturedImage:d,capturedImage:o,description:x("lender-web-app-take-a-picture"),handleSave:()=>{v(o),r(!1)}})]})},P=e=>{let{positionTop:t}=e;const a=null!==t&&void 0!==t?t:"0px";return Object(p.jsx)("div",{id:"app-preloader",style:{height:"100px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative",top:a},children:Object(p.jsx)("div",{className:"spinner-border text-primary",role:"status"})})}},84:function(e,t,a){"use strict";var n=a(10),s=a(9),l=a(53),c=a(61),i=a(33),r=a(117),o=a(11),d=a(3),b=a(45),u=a(18);Object(i.b)();const j=r.b,p={loading:"idle",loadingTransaction:"idle",loadingReceipt:"idle",transactions:[],notifications:[],types:new Set,transactionDetail:void 0,showProfileUpdateShortcut:!1},m=Object(l.create)()(Object(c.persist)((e=>({...p,setShowProfileUpdateShortcut:t=>{e({showProfileUpdateShortcut:t})},getTransactions:async function(){e({loading:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"loading"});try{var t;let{data:a}=await Object(o.a)(Object(n.N)(),"get");a=null===(t=a)||void 0===t?void 0:t.filter((e=>"pending"!=e.status));const s=new Set;return await a.forEach((e=>{s.add(e.type)})),void e({transactions:a,loading:"success",types:s})}catch(a){null!==a&&void 0!==a&&a.isAxiosError&&(e({loading:"error"}),s.toast.error(a.message)),s.toast.error(a.message)}},getNotifications:async()=>{e({loading:"loading"});try{const{data:t}=await Object(o.a)(n.R,"get");return void e({notifications:t,loading:"idle"})}catch(t){null!==t&&void 0!==t&&t.isAxiosError&&(e({loading:"idle"}),s.toast.error(t.message)),s.toast.error(t.message)}e({loading:"idle"})},getTransaction:async t=>{e({loadingTransaction:"loading"});try{const{data:a}=await Object(o.a)(Object(n.K)(t),"get");return void e({transactionDetail:a,loadingTransaction:"success"})}catch(a){e({loadingTransaction:"error"}),s.toast.error(a.message)}},getTransactionReceipt:async t=>{e({loadingReceipt:"loading"});const{first_name:a,last_name:l,email:c,phone_number:i}=b.a.getState().user,r=await j("content").then((e=>e)).catch((e=>{console.log(e)}));try{var p,m,h,O;const{data:s}=await Object(o.a)(Object(n.K)(t),"get"),b={filename:"".concat(null===(p=window)||void 0===p?void 0:p.ORG_NAME,"-transaction-").concat(null===s||void 0===s?void 0:s.reference,".pdf"),data:{logo_url:r.assets.logo_url,lender_name:null===(m=window)||void 0===m?void 0:m.ORG_NAME,transaction_reference:s.reference,customer_name:"".concat(a," ").concat(l),customer_phone_number:i,customer_support_email:c,narration:s.meta,transaction_amount:Object(d.q)(s.amount,null===s||void 0===s||null===(h=s.currency)||void 0===h?void 0:h.code),transaction_time:Object(d.w)(s.created_on),type:s.entry,payment_method:"Web",transaction_type:s.type}};return Object(u.f)(n.M,b,"".concat(null===(O=window)||void 0===O?void 0:O.ORG_NAME,"-transaction-").concat(null===s||void 0===s?void 0:s.reference,".pdf")),void e({loadingReceipt:"success"})}catch(v){e({loadingReceipt:"error"}),s.toast.error(v.message)}}})),{name:"dashboard-storage"}));t.a=m},86:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return b}));var n=a(161),s=a.n(n),l=a(15),c=a(197),i=a.n(c);function r(){return"localhost"===window.location.hostname&&Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMMIT_HASH:"e6cf7bd",REACT_APP_CONFIG_SERVER:"https://vigil.lendsqr.com/web-config",REACT_APP_SENTRY_KEY:"https://d24820a695ea1d258b6afb0ae91fc15f@sentry.obscudo.com/10",REACT_APP_API_KEY:"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi",REACT_APP_PAYMENT_VERIFICATION_URL:"https://payments.lendsqr.com",REACT_APP_VERSION:"0.7.2",REACT_APP_UTILITY_URL:"https://vigil.lendsqr.com/util",REACT_APP_REMITA_URL:"https://vigil.lendsqr.com/remita/",REACT_APP_INTEGRATIONS_URL:"https://integrations.lendsqr.com",REACT_APP_API_URL:"https://vigil.lendsqr.com/pecunia/api"}).REACT_APP_ORG_TOKEN||window.LSQ_CONFIG_TOKEN}const o={headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Basic ".concat(r()),"x-api-key":"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi"}},d=s.a.create(o);d.interceptors.request.use((e=>(e.headers.Authorization="Basic ".concat(r()),e.headers["Content-Type"]="application/json",e.headers["x-locale"]=l.a.getState().language,e.headers["x-timezone"]=i.a.tz.guess(),e)));const b=s.a.create({headers:{Accept:"application/json","Content-Type":"application/json",Authorization:"Basic ".concat(r()),"x-api-key":"eUmsx3oHajIsUPOrjRBrSYEkJxTvsU5BTiwTmbEi","x-locale":null===l.a||void 0===l.a?void 0:l.a.getState().language,"x-timezone":i.a.tz.guess()}});b.interceptors.response.use((function(e){return e}),(function(e){var t;return Promise.reject((null===(t=e.response)||void 0===t?void 0:t.data)||e)}))},89:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(1),s=a(2),l=a(0);function c(e){let{total:t,currentPage:a,setCurrentPage:c,perPage:i,loadPage:r,setPerPage:o,pageSize:d}=e;const b=Object(n.useMemo)((()=>Math.ceil(t/i)),[t,i]),{translate:u}=Object(s.useTranslation)(),j=d||[5,10,15,50];return Object(n.useMemo)((()=>{c&&a>Math.ceil(t/i)&&c(Math.ceil(t/i))}),[i]),Object(l.jsx)("div",{className:"pagination-box",children:Object(l.jsxs)("div",{className:"pagination-nav-container",children:[Object(l.jsx)("nav",{children:Object(l.jsxs)("ul",{className:"pagination",children:[Object(l.jsx)("li",{className:"page-item prev-btn",children:Object(l.jsx)("button",{disabled:a<2,onClick:()=>r(Math.max(1,a-1)),className:"page-link",children:Object(l.jsx)("svg",{width:"14",height:"14",children:Object(l.jsx)("use",{xlinkHref:"/icon-sprite.svg#next-icon"})})})}),Object(l.jsx)("li",{className:"page-item active",children:Object(l.jsx)("button",{className:"page-link",children:a})}),Object(l.jsx)("li",{className:"page-item next-btn",children:Object(l.jsx)("button",{disabled:a===b,onClick:()=>r(Math.min(b,a+1)),className:"page-link",children:Object(l.jsx)("svg",{width:"14",height:"14",children:Object(l.jsx)("use",{xlinkHref:"/icon-sprite.svg#next-icon"})})})})]})}),o&&Object(l.jsxs)("div",{children:[u("lender-web-app-transactions-per-page")," ",Object(l.jsx)("div",{className:"d-inline-block input-group-filter ",children:Object(l.jsx)("select",{onChange:e=>o(Number(e.target.value)),onBlur:e=>o(Number(e.target.value)),className:"form-control form-select py-1 ps-2 cursor-pointer",style:{paddingRight:"2rem",backgroundColor:"#FFFFFF00"},children:j.map((e=>Object(l.jsx)("option",{value:e,selected:e===i,children:e},e)))})})]})]})})}},90:function(e,t,a){"use strict";a.d(t,"b",(function(){return U})),a.d(t,"a",(function(){return B}));var n=a(6),s=a(25),l=a(13),c=a(1),i=a(9),r=a.n(i),o=a(11),d=a(10),b=a(4),u=a(21),j=a(20),p=a(68),m=a(19),h=a(60),O=a(12),v=a(58),x=a(2),f=a(41),g=a(15),w=a(7),_=a(0);function y(e){let{toggleModal:t,type:a,accountType:s="bank",setSettingsStep:i}=e;const{translate:u}=Object(x.useTranslation)(),[j,y]=Object(h.a)((e=>[e.fetchCustomBank,e.customBank]),b.shallow),[N,C]=Object(l.a)((e=>[e.fetchUserAccounts,e.profile]),b.shallow),k=Object(m.a)((e=>e.setBankDetails)),S=Object(g.a)((e=>e.country)),E=Object(f.a)((e=>e.access_token));Object(c.useEffect)((()=>{j()}),[S]);const T=async()=>{await N("refetching"),t()},[A,L]=Object(c.useState)("idle"),[M,D]=Object(c.useState)(""),F=Object(c.useMemo)((()=>u(M?"signature"!==a?"lender-web-app-download-save":"lender-web-app-continue":"lender-web-app-verify-account")),[M,a,u]);return Object(c.useEffect)((()=>{console.log("in here")}),[]),Object(_.jsxs)("div",{className:"mb-2",children:["mobile"===s&&Object(_.jsx)(p.a,{visible:"mobile"===s,access_token:E,type:"mobile-account",onSuccess:async()=>{T(),await N("refetching")},onFailed:()=>{T()}}),"bank"===s&&Object(_.jsx)(O.c,{initialValues:{account_number:"",bank_code:""},validateOnBlur:!0,onSubmit:async e=>{try{if(L("loading"),M){const n=await Object(o.a)(d.ab,"post",e);await N("refetching"),r.a.success("You bank account has been added"),L("success"),"signature"===a?(k(n.data),i&&i(v.a.AMOUNT)):t()}else{var n;const t=await Object(o.a)(d.Rb,"post",{...e,country:null===C||void 0===C||null===(n=C.organization)||void 0===n?void 0:n.country});D(t.data.account_name)}L("success")}catch(s){console.error(s),L("error"),r.a.error((null===s||void 0===s?void 0:s.message)||"There was a problem saving your bank account")}},children:e=>Object(_.jsxs)(O.b,{onSubmit:e.handleSubmit,children:[Object(_.jsxs)("div",{className:"loan-modal-body pt-4",children:[Object(_.jsxs)("div",{className:"mx-4",children:[Object(_.jsx)(w.s,{type:"tel",name:"account_number",label:u("lender-web-app-account-number")}),Object(_.jsx)(w.q,{name:"bank_code",label:"Bank",keyField:"id",valueField:"additional_code",labelField:"code_description",options:y})]}),M&&"NGA"===S&&Object(_.jsxs)("div",{className:"form-group form-floating mx-4 mt-4",children:[Object(_.jsx)("input",{disabled:!0,value:M,placeholder:"Account Name",className:"form-control form-left"}),Object(_.jsx)("label",{children:"Account Name"})]}),"NGA"!==S&&Object(_.jsx)("div",{className:"form-group form-floating mx-4 mt-4 mt-4",children:Object(_.jsx)(w.s,{name:"account_name",label:u("lender-web-app-account-name")})})]}),Object(_.jsx)("div",{style:{padding:0,height:"auto"},className:"modal-footer px-4",children:Object(_.jsx)(n.a,{isLoading:"loading"===A,type:"submit",className:"btn btn-primary btn-lg px-5 mt-3",isDisabled:!e.values.account_number||!e.values.bank_code,children:F})})]})})]})}function N(e){let{showModal:t,setShowPaystackModal:a}=e;const[s,i,r,o,d]=Object(l.a)((e=>[e.cardInitStatus,e.initCard,e.cardCharge,e.fetchTransactions,e.transactionStatus]),b.shallow),[u]=Object(g.a)((e=>[e.accept_verve_cards]),b.shallow),[j,p]=Object(c.useState)(!1);Object(c.useEffect)((()=>{t&&i()}),[i,t]),Object(c.useEffect)((()=>{"idle"===d&&o(),p(!1)}),[]),Object(c.useEffect)((()=>{r||p(!0)}),[]);const{translate:m}=Object(x.useTranslation)();return Object(_.jsx)(_.Fragment,{children:["loading","verifying"].includes(s)&&Object(_.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"10rem"},children:Object(_.jsx)("div",{className:"spinner-border text-primary",children:Object(_.jsxs)("span",{className:"visually-hidden",children:[m("lender-web-app-loading"),"..."]})})})||"error"===s&&Object(_.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center",style:{height:"10rem"},children:Object(_.jsx)("h4",{className:"text-black-50",children:m("lender-web-app-error-adding-card")})})||["success"].includes(s)&&Object(_.jsx)("div",{className:"w-100 mt-3",style:{height:"10rem"},children:Object(_.jsxs)("div",{className:"rounded-3 bg-light-blue p-4 w-100",children:[Object(_.jsx)("p",{children:m("lender-web-app-card-added-successfuly")}),Object(_.jsx)(n.a,{className:"btn btn-outline-primary",onClick:i,children:m("lender-web-app-add-another")})]})})||["paying","confirm"].includes(s)&&Object(_.jsx)("div",{className:"w-100 d-flex justify-content-center align-items-center mt-4 px-4",children:Object(_.jsxs)("div",{className:"rounded-3 bg-light-blue p-4",children:[Object(_.jsxs)("p",{className:"mb-3",children:[m("lender-web-app-complete-card-transaction"),Object(_.jsx)("br",{}),Object(_.jsx)("br",{}),Object(_.jsx)("span",{className:"fw-bold",children:m("lender-web-app-mastercard-visa",{allow_verve:u?"Verve,":""})})]}),r&&Object(_.jsx)(w.v,{onChange:()=>p(!j),checked:j,charge:r,type:"card"}),Object(_.jsx)(n.a,{isLoading:"paying"===s,className:"btn btn-outline-primary",onClick:()=>a(!0),isDisabled:!j,children:m("lender-web-app-continue")})]})})})}a(397);function C(e){let{setStep:t}=e;const[a,s]=Object(m.a)((e=>[e.setBankDetails,e.bankDetails]),b.shallow),i=Object(l.a)((e=>e.banks),b.shallow);Object(c.useEffect)((()=>{a(null)}),[]);const{translate:r}=Object(x.useTranslation)();return Object(_.jsxs)("div",{className:"card default-card",children:[Object(_.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(_.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(_.jsxs)("div",{className:"mb-4 tab-content__header",children:[Object(_.jsx)("p",{className:"text-primary fs-5 fw-bold header-text",children:r("lender-web-app-choose-existing-account")}),Object(_.jsx)("button",{className:"text-primary mx-auto mb-1 d-block bg-transparent border-0",style:{width:"fit-content"},onClick:()=>{t(v.a.ADD_BANK)},children:r("lender-web-app-add-account-mandate")}),Object(_.jsx)("div",{className:"mt-4",children:i.map((e=>Object(_.jsxs)("label",{onClick:()=>a(e),className:"card_radio position-relative mandate-card bg-light-primary border-0",children:[Object(_.jsx)("input",{readOnly:!0,type:"radio",name:"mandate_id",value:e.id}),Object(_.jsxs)("div",{className:"content d-flex mt-3 justify-content-between",children:[Object(_.jsx)("div",{className:"select-mandate-div",children:Object(_.jsx)("div",{className:"select-mandate-inner d-flex justify-content-between",children:Object(_.jsxs)("div",{children:[Object(_.jsx)("h6",{children:r("lender-web-app-account")}),Object(_.jsx)("p",{className:"small",children:"".concat(e.account_number," / ").concat(e.account_name)})]})})}),Object(_.jsxs)("div",{children:[(null===e||void 0===e?void 0:e.url)&&Object(_.jsx)("img",{src:e.url,alt:"bank logo",className:"bank-url"}),Object(_.jsx)("svg",{width:"11",className:"unchecked-icon text-primary",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(_.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"})}),Object(_.jsxs)("svg",{className:"checked-icon text-primary",width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Object(_.jsx)("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor"}),Object(_.jsx)("circle",{cx:"6",cy:"6",r:"3",fill:"currentColor"})]})]})]})]},e.id)))})]})})}),Object(_.jsxs)("div",{className:"col-12 modal-footer control justify-content-between d-flex",children:[Object(_.jsx)(n.a,{onClick:()=>t(v.a.MANDATE_INFO),className:"px-5 btn btn-ghost",children:r("lender-web-app-back")}),Object(_.jsx)(n.a,{className:"btn btn-primary btn-lg px-5",isDisabled:!s,onClick:()=>{t(v.a.AMOUNT)},children:r("lender-web-app-continue")})]})]})}function k(e){let{setStep:t,value:a,setValue:s}=e;const[l,i]=Object(c.useState)(!1),r=Object(g.a)((e=>e.mandate_activation_type)),[o]=Object(m.a)((e=>[e.createMandate]),b.shallow),d=Object(c.useCallback)((async()=>{if(i(!0),"emandate"===r){await o("nibss-easypay",a,new Date)&&t(v.a.EMANDATE_INFO)}else t(v.a.SIGNATURE);i(!1)}),[a]),{translate:u}=Object(x.useTranslation)();return Object(_.jsxs)("div",{className:"card default-card",children:[Object(_.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(_.jsx)("div",{className:"col-12 loan-form pl-4",children:Object(_.jsx)(w.e,{label:u("lender-web-app-how-much-want"),onChange:e=>{s(e)},defaultValue:a,error:0==a||void 0==a,errorMessage:u("lender-web-app-must-valid-amount")})})}),Object(_.jsxs)("div",{className:"col-12 modal-footer control justify-content-between d-flex",children:[Object(_.jsx)(n.a,{onClick:()=>t(v.a.CHOOSE_BANK),className:"px-5 btn btn-ghost",children:u("lender-web-app-back")}),Object(_.jsx)(n.a,{className:"px-5 btn btn-primary",onClick:d,isDisabled:0==a||void 0==a,isLoading:l,children:u("lender-web-app-continue")})]})]})}var S=a(175);function E(){const e=Object(m.a)((e=>e.mandate)),{translate:t}=Object(x.useTranslation)();return Object(_.jsxs)("div",{className:"pl-4 col-12 px-2 pb-4",children:[Object(_.jsx)("p",{className:"text-center text-app-gray",children:t("lender-web-app-activate-download-mandate")}),Object(_.jsx)("a",{href:e.form_link_url||"",target:"_blank",className:"mt-5 btn-ghost btn-lg btn fs-5",rel:"noreferrer",children:t("lender-web-app-download-mandate")})]})}var T=a(176),A=a(16),L=a(177);function M(e){let{toggleModal:t}=e;const[a,n]=Object(c.useState)(v.a.MANDATE_INFO),[s,i]=Object(c.useState)(5e3),o=Object(u.i)(),{translate:d}=Object(x.useTranslation)(),[j,p]=Object(l.a)((e=>[e.profileStatus,e.profile]),b.shallow);return Object(c.useEffect)((()=>{null!==p&&void 0!==p&&p.address||"success"!==j||(r.a.error(d("lender-web-app-update-address")),o?o.push(A.a.settings.profile):window.location.href=A.a.settings.profile)}),[j]),Object(_.jsxs)(_.Fragment,{children:[a===v.a.MANDATE_INFO&&Object(_.jsx)(T.a,{type:"settings",onContinue:()=>n(v.a.CHOOSE_BANK)}),a===v.a.CHOOSE_BANK&&Object(_.jsx)(C,{setStep:n}),a===v.a.AMOUNT&&Object(_.jsx)(k,{setStep:n,value:s,setValue:i}),a===v.a.SIGNATURE&&Object(_.jsx)(S.a,{setStep:n,toggleModal:t,type:"settings",amount:s}),a===v.a.EMANDATE_INFO&&Object(_.jsx)(L.a,{setStep:n,toggleModal:t,type:"settings"}),a===v.a.ADD_BANK&&Object(_.jsx)(y,{accountType:"bank",toggleModal:t,type:"signature",setSettingsStep:n}),a===v.a.REMITA&&Object(_.jsx)(E,{})]})}function D(e){let{toggleModal:t}=e;const a=Object(f.a)((e=>e.access_token)),[n]=Object(l.a)((e=>[e.fetchUserAccounts]),b.shallow);return Object(_.jsx)("div",{className:"card default-card",children:Object(_.jsx)("div",{className:"row mx-0 modal-body loan-modal-body py-4",children:Object(_.jsxs)("div",{className:"col-12 loan-form pl-4",children:[Object(_.jsx)("div",{className:"tab-content__header",children:Object(_.jsx)("p",{className:"mb-4 fs-5 text-primary fw-bold",children:"Add your mobile wallet"})}),Object(_.jsx)(p.a,{visible:!0,access_token:a,type:"mobile-account",onSuccess:async()=>{await n("refetching"),t()},onFailed:()=>{t()}})]})})})}function F(e){let{renderButton:t}=e;const{translate:a}=Object(x.useTranslation)(),n=Object(l.a)((e=>e.fetchCards)),i=Object(f.a)((e=>e.access_token)),r=Object(g.a)((e=>e.account_type)),[o,d]=Object(c.useState)(!1),[b,u]=Object(c.useState)(!1),[j,m]=Object(c.useState)(0),h=Object(c.useCallback)((()=>{d((e=>!e)),m((new Date).getTime())}),[]),O=async()=>{await n("refetching"),h(),u(!1)},v=Object(c.useMemo)((()=>{const e=window.location.href,t=e.lastIndexOf("/");return e.slice(t+1).replace("s","")}),[window.location.href]);let w="";return"bank"===v?w=a("lender-web-app-add-bank"):"card"===v?w=a("lender-web-app-add-card"):"mandate"===v?w=a("lender-web-app-add-mandate"):"wallet"===v&&(w="Add Mobile Wallet"),Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)(s.a,{show:o,close:()=>b?O():h(),description:w,isUpload:!1,className:"",children:b?Object(_.jsx)(p.a,{visible:b,access_token:i,type:"card",onSuccess:()=>{O(),n(),setTimeout((()=>n()),5e3)},onFailed:()=>{O()}}):Object(_.jsx)("div",{className:"col-12 scroll-modal",children:"bank"===v&&Object(_.jsx)(y,{toggleModal:h,accountType:r})||"card"===v&&Object(_.jsx)("div",{className:"mb-4",children:Object(_.jsx)(N,{showModal:o,setShowPaystackModal:u})})||"mandate"===v&&Object(_.jsx)(M,{toggleModal:h})||Object(_.jsx)(D,{toggleModal:h})})},j),t?t(h):Object(_.jsx)("div",{className:"col-md-6 col-xl-4",children:Object(_.jsx)("div",{className:"addpayment bankcard",children:Object(_.jsxs)("button",{onClick:h,className:"addbtn btn",type:"button","data-bs-toggle":"modal","data-bs-target":"#addpayment",children:[Object(_.jsx)("svg",{width:"18",height:"24",children:Object(_.jsx)("use",{xlinkHref:"/icon-sprite.svg#addition"})}),a("lender-web-app-add-new-type",{type:v})]})})})]})}var I=a(3),R=a.p+"static/media/check.ac5ac1cb.svg",P=a.p+"static/media/down.f8f9b1bb.svg";function q(e){let{children:t,func:a}=e;const n=Object(c.useRef)(null);return function(e,t){Object(c.useEffect)((()=>{function a(a){e.current&&!e.current.contains(a.target)&&t&&t()}return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}}),[e,t])}(n,a),Object(_.jsx)("div",{className:"w-full",ref:n,children:t})}function U(){var e,t;const a=Object(u.i)(),{url:s}=Object(u.k)(),{translate:i}=Object(x.useTranslation)(),p=Object(c.useMemo)((()=>i("lender-web-app-card-deleted")),[i]),h=Object(c.useMemo)((()=>i("lender-web-app-account-deleted")),[i]),[O,v]=Object(c.useState)(!1),[f,w,y,N,C,k]=Object(l.a)((e=>[e.cards,e.cardsStatus,e.fetchCards,e.banks,e.fetchUserAccounts,e.banksStatus]),b.shallow),[S,E]=Object(m.a)((e=>[e.mandates,e.fetchMandates]),b.shallow);Object(c.useEffect)((()=>{(async()=>{await y(),null!==N&&void 0!==N&&N.length||await C(),null!==S&&void 0!==S&&S.length||await E()})()}),[]);const[T,A]=Object(g.a)(Object(c.useCallback)((e=>[e.direct_debit_provider,e.mobile_money_provider]),[])),[L,M]=Object(c.useState)("idle"),D=Object(c.useCallback)((async e=>{try{M("deleting-card-".concat(e)),await Object(o.a)(Object(d.f)(e),"delete"),await y("refetching"),r.a.success(p),M("idle")}catch(t){r.a.error((null===t||void 0===t?void 0:t.message)||i("lender-web-app-error-deleting-card")),M("idle")}}),[y,i]),U=Object(c.useCallback)((async e=>{try{M("deleting-bank-".concat(e)),await Object(o.a)(Object(d.e)(e),"delete"),await C("refetching"),r.a.success(h),M("idle")}catch(t){r.a.error((null===t||void 0===t?void 0:t.message)||i("lender-web-app-error-deleting-account")),M("idle")}}),[C,i]),B=Object(c.useCallback)((e=>{if(null==e)return e;if(null===e.includes("-"))return e;const[t,a,n]=e.split("/");return"".concat(n,"-").concat(a,"-").concat(t)}),[]),V=Object(c.useMemo)((()=>A&&"none"!==A?[{text:i("lender-web-app-banks"),path:"banks"},{text:i("lender-web-app-cards"),path:"cards"},{text:"Mobile Wallet",path:"wallet"}]:"none"===T?[{text:i("lender-web-app-banks"),path:"banks"},{text:i("lender-web-app-cards"),path:"cards"}]:[{text:i("lender-web-app-banks"),path:"banks"},{text:i("lender-web-app-cards"),path:"cards"},{text:i("lender-web-app-mandates"),path:"mandates"}]),[i]);return Object(_.jsxs)("div",{className:"tab-pane fade show active",id:"payments",role:"tabpanel","aria-labelledby":"payments-tab",children:[Object(_.jsx)("div",{className:"tab-content__header hide-900",children:Object(_.jsx)("ul",{className:"nav nav-tabs loanDetails-tab",children:V.map((e=>{var t;return Object(_.jsx)("li",{className:"nav-item w-100 text-center",children:Object(_.jsx)(j.b,{to:[s,e.path].join("/"),className:"nav-link ".concat(null!==(t=a.location.pathname.split("/"))&&void 0!==t&&t.filter(Boolean).pop().includes(e.path)?"active":""),role:"tab",children:e.text})},e.path)}))})}),Object(_.jsx)(q,{func:()=>v(!1),children:Object(_.jsxs)("div",{className:"mob-tab-content__header",children:[Object(_.jsxs)("div",{className:"mob-tab-content__div",onClick:()=>v(!O),children:[Object(_.jsx)("p",{children:(H=null===(e=a.location.pathname.split("/"))||void 0===e?void 0:e.filter(Boolean).pop(),"".concat(H[0].toUpperCase()).concat(H.substring(1)))}),Object(_.jsx)("img",{src:P,alt:"down"})]}),O&&Object(_.jsx)("div",{className:"mob-tab-dropdown",children:V.map((e=>{var t;return Object(_.jsx)("div",{className:"mob-nav-tab",children:Object(_.jsxs)(j.b,{to:[s,e.path].join("/"),className:"mob-nav-link",role:"tab",children:[Object(_.jsx)("p",{children:e.text}),(null===(t=a.location.pathname.split("/"))||void 0===t?void 0:t.filter(Boolean).pop().includes(e.path))&&Object(_.jsx)("img",{src:R,alt:"check"})]})},e.path)}))})]})}),Object(_.jsx)("div",{className:"tab-content__main tab-content__payments",children:Object(_.jsxs)("div",{className:"row",children:[Object(_.jsx)(F,{}),"loading"===w||"loading"===k&&Object(_.jsx)("div",{className:"col-md-6 col-xl-4 d-flex justify-content-center align-items-center",children:Object(_.jsx)("div",{className:"spinner-border text-primary",children:Object(_.jsxs)("span",{className:"visually-hidden",children:[i("lender-web-app-loading"),"..."]})})}),("error"===w||"error"===k)&&Object(_.jsx)("div",{className:"col-md-6 col-xl-4 d-flex justify-content-center align-items-center",children:Object(_.jsx)("p",{className:"text-center",children:i("lender-web-app-error-fetching-accounts")})}),Object(_.jsxs)(u.e,{children:[Object(_.jsx)(u.c,{path:[s,"banks"].join("/"),children:(null===N||void 0===N?void 0:N.length)>0&&(null===N||void 0===N?void 0:N.filter((e=>"mobile"!==(null===e||void 0===e?void 0:e.account_type))).map((e=>{var t,a;return Object(_.jsxs)("div",{className:"col-md-6 col-xl-4 position-relative",children:[!(null!==e&&void 0!==e&&e.is_primary)&&Object(_.jsx)(n.a,{isLoading:"deleting-bank-".concat(null===e||void 0===e?void 0:e.id)===L,onClick:()=>U(null===e||void 0===e?void 0:e.id),className:"close position-absolute text-light btn-link",style:{top:"0.3rem",left:"0.6rem"},children:Object(_.jsx)("svg",{width:"16",height:"16",children:Object(_.jsx)("use",{xlinkHref:"/icon-sprite.svg#close-icon"})})}),Object(_.jsx)("div",{className:"bankcard",children:Object(_.jsxs)("div",{className:"row",children:[Object(_.jsx)("div",{className:"col logo-wrapper",children:Object(_.jsx)("div",{className:"bank-logo",style:{width:"30px",overflow:"hidden"},children:(null===e||void 0===e?void 0:e.url)&&Object(_.jsx)("img",{src:e.url,alt:"bank logo"})})}),Object(_.jsxs)("div",{className:"col details carddeets",children:[Object(_.jsx)("div",{className:"customer-info",children:Object(_.jsx)("p",{className:"name text-x-small",style:{fontSize:"0.7rem"},children:null!==(t=null===e||void 0===e?void 0:e.account_name)&&void 0!==t?t:""})}),Object(_.jsx)("div",{className:"cardinfo",children:Object(_.jsx)("p",{className:"cardno text-small",children:null!==(a=null===e||void 0===e?void 0:e.account_number)&&void 0!==a?a:""})})]})]})})]},null===e||void 0===e?void 0:e.id)})))}),Object(_.jsx)(u.c,{path:[s,"cards"].join("/"),children:(null===f||void 0===f?void 0:f.length)>0&&(null===f||void 0===f?void 0:f.map((e=>Object(_.jsxs)("div",{className:"col-md-6 col-xl-4 position-relative",children:[Object(_.jsx)(n.a,{isLoading:"deleting-card-".concat(null===e||void 0===e?void 0:e.id)===L,onClick:()=>D(null===e||void 0===e?void 0:e.id),className:"close position-absolute text-light btn-link",style:{top:"0.3rem",left:"0.6rem"},children:Object(_.jsx)("svg",{width:"16",height:"16",children:Object(_.jsx)("use",{xlinkHref:"/icon-sprite.svg#close-icon"})})}),Object(_.jsx)("div",{className:"bankcard",children:Object(_.jsxs)("div",{className:"row",children:[Object(_.jsx)("div",{className:"col logo-wrapper",children:Object(_.jsx)("div",{className:"bank-logo",style:{width:"30px",overflow:"hidden"},children:e.logo_url&&Object(_.jsx)("img",{src:e.logo_url,alt:"bank logo"})})}),Object(_.jsx)("div",{className:"col details bankdeets",children:Object(_.jsxs)("div",{className:"customer-info",children:[Object(_.jsx)("p",{className:"name text-small",style:{fontSize:"0.7rem"},children:(null===e||void 0===e?void 0:e.card_owner_name)||"-"}),Object(_.jsxs)("p",{className:"cardno text-small",children:["X".repeat(4)," ","X".repeat(4)," ",null===e||void 0===e?void 0:e.card_last4," ","".repeat(4)," ",Object(_.jsxs)("span",{className:"text-x-small",children:[" ",null===e||void 0===e?void 0:e.card_exp_month,"/",null===e||void 0===e?void 0:e.card_exp_year," "]})]})]})})]})})]},null===e||void 0===e?void 0:e.id))))}),Object(_.jsx)(u.c,{path:[s,"wallet"].join("/"),children:N.length>0&&(null===N||void 0===N||null===(t=N.filter((e=>"mobile"===e.account_type)))||void 0===t?void 0:t.map((e=>{var t,a,s,l;return Object(_.jsxs)("div",{className:"col-md-6 col-xl-4 position-relative",children:[(null===N||void 0===N||null===(t=N.filter((e=>"mobile"===e.account_type)))||void 0===t?void 0:t.length)>=2&&Object(_.jsx)(n.a,{isLoading:"deleting-bank-".concat(null===e||void 0===e?void 0:e.id)===L,onClick:()=>U(null===e||void 0===e?void 0:e.id),className:"close position-absolute text-light btn-link",style:{top:"0.3rem",left:"0.6rem"},children:Object(_.jsx)("svg",{width:"16",height:"16",children:Object(_.jsx)("use",{xlinkHref:"/icon-sprite.svg#close-icon"})})}),Object(_.jsx)("div",{className:"bankcard",children:Object(_.jsxs)("div",{className:"row",children:[Object(_.jsx)("div",{className:"col logo-wrapper",children:Object(_.jsx)("div",{className:"bank-logo",style:{width:"30px",overflow:"hidden"},children:Object(_.jsx)("img",{src:null!==(a=e.url)&&void 0!==a?a:"https://documents.lendsqr.com/lsq-lendstack-files/logos/default_bank.png",alt:"bank logo"})})}),Object(_.jsxs)("div",{className:"col details carddeets",children:[Object(_.jsx)("div",{className:"customer-info",children:Object(_.jsx)("p",{className:"name text-x-small",style:{fontSize:"0.7rem"},children:null!==(s=null===e||void 0===e?void 0:e.account_name)&&void 0!==s?s:""})}),Object(_.jsx)("div",{className:"cardinfo",children:Object(_.jsx)("p",{className:"cardno text-small",children:null!==(l=null===e||void 0===e?void 0:e.account_number)&&void 0!==l?l:""})})]})]})})]},null===e||void 0===e?void 0:e.id)})))}),Object(_.jsx)(u.c,{path:[s,"mandates"].join("/"),children:(null===S||void 0===S?void 0:S.length)>0&&(null===S||void 0===S?void 0:S.map((e=>{var t;const a=e.status.includes("pending")?"Pending":"Active";return null==e.end_date?"":Object(_.jsx)("div",{className:"col-md-6 col-xl-4 position-relative",children:Object(_.jsx)("div",{className:"bankcard",children:Object(_.jsxs)("div",{className:"",children:[Object(_.jsx)("div",{className:"col logo-wrapper",children:Object(_.jsx)("div",{className:"bank-logo",style:{width:"30px",overflow:"hidden"},children:e.details.url&&Object(_.jsx)("img",{src:e.details.url,alt:"bank logo"})})}),Object(_.jsx)("div",{className:"col details bankdeets",children:Object(_.jsxs)("div",{className:"customer-info mandate-info",children:[Object(_.jsxs)("p",{className:"cardno text-small",style:{fontSize:"0.9rem"},children:[Object(_.jsxs)("span",{style:{marginBottom:"5px",display:"block",fontSize:"13px"},children:[e.mandate_type||"-",Object(_.jsx)("br",{})]}),Object(_.jsx)("span",{style:{fontSize:"13px"},children:"".concat(e.payer_account," / ").concat(e.payer_name)})]}),Object(_.jsxs)("p",{className:"cardTop",children:[Object(_.jsx)("span",{className:"text-x-small status-pill ".concat("Active"===a?"active__mandate":"pending__mandate"),style:{marginBottom:"3px",display:"block"},children:a}),Object(_.jsx)("span",{className:"",style:{fontSize:"18px"},children:Object(I.q)(e.amount,null===e||void 0===e?void 0:e.currency)})]}),Object(_.jsx)("p",{className:"cardno text-small",children:Object(_.jsx)("span",{className:"text-x-small",children:Object(_.jsx)("p",{className:"small",children:Object(I.p)(B(null===(t=e.end_date)||void 0===t?void 0:t.slice(0,10)))})})})]})})]})})},null===e||void 0===e?void 0:e.id)})))}),Object(_.jsx)(u.b,{to:[s,"banks"].join("/")})]})]})})]});var H}function B(e){let{allowCard:t,allowBank:a,renderButton:n,isMobile:i,isMandate:r}=e;const[o,d]=Object(c.useState)(a?"bank":"card"),j=Object(u.i)(),m=Object(l.a)((e=>e.fetchCards),b.shallow),[h,O]=Object(c.useState)(!1),[v,C]=Object(c.useState)(!1),[k,S]=Object(l.a)((e=>[e.cardInitStatus,e.initCard]),b.shallow),{access_token:E}=f.a.getState(),T=Object(l.a)((e=>e.fetchUserAccounts)),A=Object(c.useCallback)((()=>{O((e=>!e))}),[]),L=async()=>{await m("refetching"),A(),C(!1)},[D]=Object(g.a)(Object(c.useCallback)((e=>[e.account_type]),[])),F=Object(c.useMemo)((()=>{const e=j.location.pathname,t=e.lastIndexOf("/");return e.slice(t+1).replace("s","")}),[j.location.pathname]),{translate:I}=Object(x.useTranslation)();return Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)(s.a,{show:h,close:()=>v?L():A(),description:I("lender-web-app-add-variable",{variable:t?"Card":a?"Bank":"Card/Bank"}),isUpload:!1,children:v?Object(_.jsx)(p.a,{visible:v,access_token:E,type:"card",onSuccess:()=>{m(),setTimeout((()=>m()),5e3),L()},onFailed:()=>{L()}}):Object(_.jsxs)("div",{className:"modal-body",children:[a||t?null:Object(_.jsxs)(_.Fragment,{children:[Object(_.jsx)("p",{className:"modal-body__p",children:I("lender-web-app-what-to-add")}),Object(_.jsxs)("div",{className:"modal-form",children:[Object(_.jsxs)("div",{style:{maxWidth:"350px"},className:"d-flex justify-between",children:[Object(_.jsx)("div",{className:"me-2 w-100",children:Object(_.jsx)(w.g,{label:"Bank",name:"what_to_add",value:"bank",checked:"bank"===o,disabled:t,onChange:e=>d(e.target.value)})}),Object(_.jsx)("div",{className:"ms-2 me-2 w-100",children:Object(_.jsx)(w.g,{label:"Card",name:"what_to_add",value:"card",disabled:a,checked:"card"===o,onChange:e=>{["idle"].includes(k)&&S(),d(e.target.value)}})})]}),Object(_.jsx)("hr",{style:{backgroundColor:"rgba(17, 41, 69, 0.4)"}})]})," "]}),"bank"===o&&!i&&!r&&Object(_.jsx)(y,{toggleModal:A,accountType:D}),"bank"===o&&i&&!r&&Object(_.jsx)(p.a,{visible:!0,access_token:E,type:"mobile-account",onSuccess:async()=>{await T("refetching"),A()},onFailed:()=>{A()}}),"bank"===o&&r&&Object(_.jsx)(M,{toggleModal:A}),"card"===o&&Object(_.jsx)(N,{showModal:h,setShowPaystackModal:C})]})},I("lender-web-app-add-variable",{variable:"Card/Bank"})),n?n(A):Object(_.jsx)("div",{className:"col-md-6 col-xl-4",children:Object(_.jsx)("div",{className:"addpayment bankcard",children:Object(_.jsxs)("button",{onClick:A,className:"addbtn btn",type:"button","data-bs-toggle":"modal","data-bs-target":"#addpayment",children:[Object(_.jsx)("svg",{width:"18",height:"24",children:Object(_.jsx)("use",{xlinkHref:"/icon-sprite.svg#addition"})}),I("lender-web-app-add-new-type",{type:F})]})})})]})}}},[[762,1,2]]]);
//# sourceMappingURL=main.2f4b94e7.chunk.js.map