1"use strict";(globalThis.webpackChunkopco_website||=[]).push([[723],{3375(e,t,o){o.d(t,{A:()=>c});var a=o(2074);const n="Breadcrumb_container__Vpe3A",l="Breadcrumb_item__g9Co0",i="Breadcrumb_link__PWQ0g",s="Breadcrumb_separator__XF-z5",r="Breadcrumb_active__ETrcQ";var d=o(390),u=o(4414);function c(e){let{items:t=d.R0,className:o=""}=e;const c=t.length-1;return(0,u.jsx)("nav",{className:`${n} ${o}`,children:null===t||void 0===t?void 0:t.map((e,t)=>{const o=t===c;return(0,u.jsx)("span",{className:l,children:o?(0,u.jsx)("span",{className:r,children:e.label}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.N_,{to:e.path,className:i,children:e.label}),(0,u.jsx)("span",{className:s,children:"/"})]})},t)})})}},8(e,t,o){var a=o(390),n=o(7808),l=o(6474),i=(o(3259),o(5277)),s=o(2971);o.d(t,["BY",0,async e=>{try{var t,o;const r=await n.A.request({method:"POST",url:`${a.M8}${a.o0}${l.Hr.LINE_TYPE_URL}`,data:e});if((null===r||void 0===r||null===(t=r.data)||void 0===t?void 0:t.status)===a.qO||200===(null===r||void 0===r||null===(o=r.data)||void 0===o?void 0:o.statusCode))return null===r||void 0===r?void 0:r.data;var s;(0,i.$)(null===r||void 0===r?void 0:r.data,null===r||void 0===r||null===(s=r.data)||void 0===s?void 0:s.message)}catch(r){(0,i.$)(r)}},"HP",0,async e=>{try{var t,o;const r=await n.A.request({method:"POST",url:`${a.M8}${a.o0}${l.Hr.VALIDATE_ACCOUNT}`,data:e});if(200===(null===r||void 0===r||null===(t=r.data)||void 0===t?void 0:t.statusCode)&&(null===r||void 0===r||null===(o=r.data)||void 0===o?void 0:o.status)===a.qO)return null===r||void 0===r?void 0:r.data;var s;(0,i.$)(null===r||void 0===r?void 0:r.data,null===r||void 0===r||null===(s=r.data)||void 0===s?void 0:s.message)}catch(r){(0,i.$)(r)}},"Lt",0,async e=>{try{var t,o;const r=await n.A.request({method:"POST",url:`${a.M8}${a.o0}${l.Hr.GET_DEVICE_DETAIL}`,data:e});if((null===r||void 0===r||null===(t=r.data)||void 0===t?void 0:t.status)===a.qO||200===(null===r||void 0===r||null===(o=r.data)||void 0===o?void 0:o.statusCode))return null===r||void 0===r?void 0:r.data;var s;(0,i.$)(null===r||void 0===r?void 0:r.data,null===r||void 0===r||null===(s=r.data)||void 0===s?void 0:s.message)}catch(r){(0,i.$)(r)}},"N6",0,async e=>{try{var t;const a=await n.A.request({method:"POST",url:s.b6,data:e});var o;if(200===(null===a||void 0===a||null===(t=a.data)||void 0===t?void 0:t.statusCode))return null===(o=a.data)||void 0===o?void 0:o.result;(0,i.$)(null===a||void 0===a?void 0:a.data)}catch(a){(0,i.$)(a)}},"O7",0,async e=>{try{var t,o;const d=await n.A.request({method:"POST",url:`${a.M8}${a.o0}${l.Hr.FETCH_POSTPAID_BILL}`,data:e});var s,r;if((null===d||void 0===d||null===(t=d.data)||void 0===t?void 0:t.status)===a.qO||200===(null===d||void 0===d||null===(o=d.data)||void 0===o?void 0:o.statusCode))return null===d||void 0===d||null===(s=d.data)||void 0===s?void 0:s.result;(0,i.$)(null===d||void 0===d?void 0:d.data,null===d||void 0===d||null===(r=d.data)||void 0===r?void 0:r.message)}catch(d){(0,i.$)(d)}}])},8199(e,t,o){var a=o(9950),n=o(8429),l=o(3113),i=o(81),s=o(390),r=o(2738),d=o(5771),u=o(8),c=o(6474),m=o(7842),v=o(7049),p=o(1001),h=o(6469);const _=(e,t)=>{var o,_;const{getText:g}=(0,d.A)(),{showLoader:f,hideLoader:x}=(0,i.M)(),C=(0,n.Zp)(),[T,y]=(0,a.useState)({}),[A,b]=(0,a.useState)(""),[S,P]=(0,a.useState)(!1),[N,O]=(0,a.useState)(!1),[w,E]=(0,a.useState)({}),[I,j]=(0,a.useState)(""),[L,F]=(0,a.useState)(""),{configData:D}=(0,r.A)(),M=null===D||void 0===D||null===(o=D.analyticsEvent)||void 0===o?void 0:o.POSTPAID,{globalConfig:B}=null!==(_=(0,a.useContext)(h.t))&&void 0!==_?_:{},$=o=>{var a;const n=null!==(a=null===o||void 0===o?void 0:o.totalOutstanding)&&void 0!==a?a:0;if(n%1){const t=(l=n,null!==D&&void 0!==D&&D.allowDecimalConversion?JSON.stringify(Math.ceil(l)):l);e(e=>({...e,amount:t})),O(!0)}else e(e=>({...e,amount:n}));var l;t(n)};return{fetchBillInfo:async e=>{try{null===f||void 0===f||f();const t=await(0,u.O7)(e);t?(y(t),$(t)):b((null===t||void 0===t?void 0:t.message)||s.UT)}catch(t){b((null===t||void 0===t?void 0:t.message)||s.UT)}finally{null===x||void 0===x||x()}},billInfo:T,buyAirtime:(e,t)=>
1{(0,v.f)(M,p.qY.POSTPAID.POSTPAID_MAKE_PAYMENT);const o={msisdn:(0,m.QH)(e),enableDualCurrency:(0,m.sH)(),amount:t,lineType:c.tq,transactionType:c.R9,productCode:null,description:c.bD,currency:"UNI",redirectPage:c.n_,rechargeType:c.zN.POSTPAID_BILL_PAY,theme:c.wY,flow:c.tq,template:c.M8,isDualCurrency:!(null===B||void 0===B||!B.isDualCurrency),unit:t};C(l.ut,{state:{txnData:o}})},apiFailureMsg:A,handleToastClose:()=>b(""),isBillSummary:S,setIsBillSummary:P,showNoteForAmount:N,lineTypeData:w,msisdnLineType:I,msidnError:L,handleLineTypeData:e=>{E(e),j(null===e||void 0===e?void 0:e.result),null!==e&&void 0!==e&&e.result&&e.result!==c.tq&&"HYBRID"!==e.result?((0,v.f)(M,p.qY.POSTPAID.MOBILE_ENTERED_INVALID),F(g(c.RJ))):F("")}}};o.d(t,["A",0,_])},7445(e,t,o){o.d(t,{A:()=>c});o(9950),o(9613);var a=o(2738),n=o(5771),l=o(3408),i=o(6474),s=o(7842),r=o(8385);const d={heading:"FormContainer_heading__Vqbrv",form:"FormContainer_form__bWwXh",formGroup:"FormContainer_formGroup__pGOw4",errorValidation:"FormContainer_errorValidation__Ktb0p",formControl:"FormContainer_formControl__4nCbT",code:"FormContainer_code__Qct4L",lineType:"FormContainer_lineType__iM13Q",error:"FormContainer_error__0WP-a",formClose:"FormContainer_formClose__suewT",errorMsg:"FormContainer_errorMsg__1Ewk4",amountMsg:"FormContainer_amountMsg__95YzS",billInformation:"FormContainer_billInformation__5fKgq",fetchPostpaid:"FormContainer_fetchPostpaid__mV0XU",disabled:"FormContainer_disabled__S5EXF",error_container:"FormContainer_error_container__E551s",formControlWrap:"FormContainer_formControlWrap__rja5S",formControlByBndlWrap:"FormContainer_formControlByBndlWrap__5JAXM",fetchBill:"FormContainer_fetchBill__pqnqI",formControlAccount:"FormContainer_formControlAccount__rHwYR",accountDisabled:"FormContainer_accountDisabled__9nWqV",formcontainer:"FormContainer_formcontainer__IsmhY"};var u=o(4414);const c=e=>{var t;let{formInput:o,handleChange:c,maxAmount:m,minAmount:v,minError:p,maxError:h,showNoteForAmount:_=!1,msidnError:g,placeHolderText:f,showSubheading:x=!1,heading:C,subHeading:T,sendHandleShowPopUP:y,billInfo:A,showAccountField:b=!1,showFetchBill:S=!1,lineTypeRes:P,msisdnOnly:N=!1}=e;const{getText:O}=(0,n.A)(),{configData:w}=(0,a.A)(),{msisdnLength:E,countryCode:I,opcoCurrency:j,accountNoLength:L}=w;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)("form",{autoComplete:"off",className:d.form,children:(0,u.jsxs)("div",{className:"row align-items-center",children:[(0,u.jsxs)("div",{className:`col-lg-3 col-xl-4 d-flex align-items-center p-0 px-lg-3 px-xl-0 ${d["postpaid-left"]}`,children:[(0,u.jsx)("span",{className:`d-none d-xl-block ${d.rechargeAndBill}`,children:(0,u.jsx)("img",{src:(0,l.wG)(r.aB,"orp"),width:143,height:134,alt:i._R})}),(0,u.jsxs)("div",{className:d.heading,children:[(0,u.jsx)("h3",{children:C}),x?(0,u.jsx)("h6",{children:T}):null]})]}),(0,u.jsx)("div",{className:`col-lg-9 col-xl-8 ${N?d.formControlByBndlWrap:d.formControlWrap}`,children:(0,u.jsxs)("div",{className:"row align-items-center",children:[!b&&(0,u.jsxs)("div",{className:""+(N?"col-lg-12":"col-lg-6"),children:[(0,u.jsxs)("div",{className:`${g?"":"mb-3"} mb-lg-0 ${d.formGroup} ${o.msisdn?"active":""}`,children:[(0,u.jsxs)("span",{className:d.code,children:["+",I]}),(0,u.jsx)("input",{className:d.formControl,placeholder:`${f||O(i.$P)}`,type:"text",name:"msisdn",value:o.msisdn,onChange:c,maxLength:E}),!N&&(0,s.K8)(P,g)?(0,u.jsx)("img",{className:d.formClose,src:(0,l.wG)(r.bZ,"orp"),alt:"",height:"20px",width:"20px"}):null]}),o.msisdn&&g?(0,u.jsx)("div",{className:d.error_container,children:(0,u.jsx)("p",{className:d.error,children:g})}):null]}),!N&&b?(0,u.jsx)("div",{className:null!==A&&void 0!==A&&A.totalOutstanding?"col-lg-6":"col-lg-12",children:(0,u.jsxs)("div",{className:`mb-3 mb-md-0 ${d.formGroup}`,children:[(0,u.jsx)("input",{className:`${d.formControlAccount} ${null!==A&&void 0!==A&&A.totalOutstanding?d.accountDisabled:""}`,placeholder:O(i.u5),type:"tel",name:"account",value:o.account,onChange:c,maxLength:L,disabled:null===A||void 0===A?void 0:A.totalOutstanding}),(null===(t=o.account)||void 0===t?void 0:t.length)===L&&(0,u.jsx)("img",{className:d.formClose,src:(0,l.wG)(r.bZ,"orp"),alt:"",height:"20px",width:"20px"})]})}):null,N||b&&(null===A||void 0===A||!A.totalOutstanding)?null:(0,u.jsx)("div",{className:"col-lg-6",children:(0,u.jsxs)("div",{className:`mb-3 mb-md-0 ${d.formGroup} ${o.amount||0===o.amount?"active":""}`,children:[(0,u.jsx)("span",{className:d.code,children:j}),(0,u.jsx)("input",{className:d.formControl,placeholder:O(i.OP),type:"tel",name:"amount",value:o.amount>0?o.amount:"",onChange:c,min:v,max:m,maxLength:String(m).length}),(0,s.ie)({billInfo:A,showFetchBill:S,lineTypeRes:P,msidnError:g})?(0,u.jsx)("a",{onClick:y,className:`${d.fetchBill} ${(0,s.Hq)(P)?"":"disabled"}`,children:O(i.NY)}):null,(0,u.jsxs)("div",{className:d.billInformation,children:[p&&(0,u.jsxs)("p",{children:[p," ",j," ",v]}),h&&(0,u.jsxs)("p",{children:[h," ",j," ",m]}),(0,u.jsxs)("div",{className:d.amountMsg,children:[_?(0,u.jsx)("p",{children:O(i.zH)}):null,(0,s.wq)(A)?(0,u.jsxs)("p",{children:[O(i.G7)," ",null!==A&&void 0!==A&&A.totalOutstanding?null===A||void 0===A?void 0:A.totalOutstanding:""]}):null]})]})]})})]})})]})})})}},6522(e,t,o){var a=o(9950),n=o(2738),l=o(7842),i=o(9838),s=o(7049),r=o(1001);const d=e=>{let{initialState:t,minMaxErrors:o,handleMsisdnChange:d,hybridPostpaidCheck:u,events:c}=e;const[m,v]=(0,a.useState)(t),[p,h]=(0,a.useState)(new Set),{configData:_}=(0,n.A)(),{msisdnLength:g,msisdnRegex:f}=_,{validateMsisdn:x,resetLineTypeRes:C,lineTypeRes:T,apiFailureMsg:y,handleToastClose:A}=(0,i.S)(d,{},c),b=e=>{if((null===e||void 0===e?void 0:e.length)===g)return(0,s.f)(c,r.Xs),void x(e,!1,u,!0);C()};return{formData:m,setFormData:v,handleChange:e=>{let{name:t,value:a}=e.target;a=(0,l.WL)(f,a);const n={...m,[t]:a};v(n),"amount"===t&&((0,s.f)(c,r.L$),o(a)),"msisdn"===t&&(null===b||void 0===b||b(a)),a&&!p.has(t)&&h(e=>new Set(e).add(t))},crossClick:()=>{v(e=>({...e,msisdn:""})),null===d||void 0===d||d("")},eventEmittedFields:p,lineTypeRes:T,apiFailureMsg:y,handleToastClose:A}};o.d(t,["A",0,d])},9648(e,t,o){var a=o(9950),n=o(5771),l=o(7049),i=o(1001);const s=e=>{let{min:t,max:o,minErrorKey:s,maxErrorKey:r,events:d}=e;const{getText:u}=(0,n.A)(),[c,m]=(0,a.useState)(""),[v,p]=(0,a.useState)("");return{minError:c,maxError:v,minMaxErrors:e=>{const a=Number(t),n=Number(o);e&&Number(e)<a?(m(u(s)),(0,l.f)(d,i.uW),p("")):e&&Number(e)>n?(p(u(r)),m("")):(m(""),p(""))}}};o.d(t,["A",0,s])},9838(e,t,o){var a=o(9950),n=o(81),l=o(390),i=o(8),s=o(6474),r=o(7842),d=o(7049),u=o(1001);o.d(t,["S",0,(e,t,o)=>{const[c,m]=(0,a.useState)(!1),[v,p]=(0,a.useState)(!1),{showLoader:h,hideLoader:_}=(0,n.M)(),[g,f]=(0,a.useState)({}),[x,C]=(0,a.useState)("");return{validateMsisdn:async(a,n,c,v)=>{const g={msisdn:(0,r.QH)(a),checkIfBroadband:!!n,requestType:c?s.zN.HYBRID_POSTPAID_CHECK:"",flowType:v?s.m2:null};h();try{var x;const a=await(0,i.BY)(g);var T;if((null===a||void 0===a||null===(x=a.status)||void 0===x?void 0:x.toLowerCase())===l.qO)m(!0),f({...a}),null===e||void 0===e||e(a),null===a||void 0===a||null===(T=a.result)||void 0===T||T.toLowerCase(),p(!0);else(0,d.f)(o,u.VB),C((null===a||void 0===a?void 0:a.message)||l.UT||s.RJ),t(a)}catch(y){C((null===y||void 0===y?void 0:y.message)||l.UT)}finally{_()}},isSuccess:c,showFetchBillMsg:v,lineTypeRes:g,resetLineTypeRes:()=>{f({}),null===e||void 0===e||e({}),C("")},apiFailureMsg:x,handleToastClose:()=>{C("")}}}])},9498(e,t,o){const a="BUNDLE_DATA_";o.d(t,["yW",0,()=>
1{Object.keys(sessionStorage).forEach(e=>{e.startsWith(a)&&sessionStorage.removeItem(e)})}])},723(e,t,o){o.r(t),o.d(t,{default:()=>I});var a=o(392),n=o(9950),l=o(8429),i=(o(3113),o(7687)),s=o(1048),r=o(3375),d=o(9530),u=o(390),c=o(2738),m=o(5771),v=o(3408),p=(o(786),o(1001)),h=o(7049),_=o(6522),g=o(9648),f=o(81),x=o(8);var C=o(9498),T=o(6474),y=o(7842),A=o(8385),b=o(7445),S=o(8199);const P={amountMsg:"Postpaid_amountMsg__DkNFs",postpaid:"Postpaid_postpaid__a0ZzJ",back:"Postpaid_back__2D09m","bundle-container":"Postpaid_bundle-container__q8Iau","bundle-linetype":"Postpaid_bundle-linetype__5eHUd",heading:"Postpaid_heading__FKN8+",formClose:"Postpaid_formClose__TYige",breadcrumb:"Postpaid_breadcrumb__DiLsU",bundlerechargeform:"Postpaid_bundlerechargeform__KQ1L4",makepayment:"Postpaid_makepayment__iAMWg",formcontainer:"Postpaid_formcontainer__UXMSN",buyAirtime:"Postpaid_buyAirtime__TpFWT",container:"Postpaid_container__UFa5t"};var N=o(6469),O=o(8570),w=o(4414);const E=()=>{var e,t;const{getText:o}=(0,m.A)(),{configData:E}=(0,c.A)(),{postMaxAmnt:I,postMinAmnt:j,hybridPostpaidCheck:L,otpTimer:F,otpLength:D,POSTPAID:M,accountNoLength:B,expireOtpTimer:$,rewardsConfig:k}=null!==E&&void 0!==E?E:{},q=(0,l.Zp)(),H=(0,l.zy)(),[R,U]=(0,n.useState)(!1),[Y,W]=(0,n.useState)(null),G=null===M||void 0===M?void 0:M.analyticsEvent,{minError:V,maxError:K,minMaxErrors:z}=(0,g.A)({min:j,max:I,minErrorKey:T.zV,maxErrorKey:T.t$,events:G}),{formData:Q,setFormData:X,handleChange:J,crossClick:Z,lineTypeRes:ee,apiFailureMsg:te,handleToastClose:oe}=(0,_.A)({initialState:{msisdn:"",amount:"",account:""},minMaxErrors:z,events:G}),{fetchBillInfo:ae,buyAirtime:ne,apiFailureMsg:le,handleToastClose:ie,isBillSummary:se,showNoteForAmount:re,lineTypeData:de,msisdnLineType:ue,msidnError:ce,handleLineTypeData:me,billInfo:ve}=(0,S.A)(X,z),{validateAccount:pe,apiFailureRes:he,handleToastClose:_e}=((e,t,o)=>{const{showLoader:a,hideLoader:l}=(0,f.M)(),[i,s]=(0,n.useState)("");return{validateAccount:async()=>{let n={accountNo:null===t||void 0===t?void 0:t.account,msisdn:null===t||void 0===t?void 0:t.msisdn,refId:o};a();try{await(0,x.HP)(n),await e({msisdn:t.msisdn,accNo:null===t||void 0===t?void 0:t.account,refId:o})}catch(i){s((null===i||void 0===i?void 0:i.message)||u.UT)}finally{l()}},apiFailureRes:i,handleToastClose:()=>{s("")}}})(ae,Q,Y),{globalConfig:ge}=null!==(e=(0,n.useContext)(N.t))&&void 0!==e?e:{};(0,n.useEffect)(()=>{me(ee)},[ee]),(0,n.useEffect)(()=>{const{fetchByAccount:e,msisdn:t,otpId:o}=H.state||{};e&&(U(!0),X(e=>({...e,msisdn:t})),W(o),window.history.replaceState({},""))},[H.state]);const{sendOtp:fe,verifyOtp:xe,refId:Ce,error:Te,reSendOtp:ye,attemptErrMsg:Ae,apiFailureMsg:be,otpAttempt:Se,resetOtp:Pe,resetApiFailure:Ne,generateOtpTranslation:Oe,toastErr:we,setToastErr:Ee}=(0,s.W)(e=>{Pe(),ae({msisdn:Q.msisdn,refId:Ce,tkn:e}),(0,h.f)(G,p.qY.POSTPAID.POSTPAID_FETCH_BILL_OTP)});(0,n.useEffect)(()=>{(0,C.yW)(),(0,h.f)(G,p.qY.POSTPAID.POSTPAID_BILL_PAY_PAGE)},[]),(0,n.useEffect)(()=>{Ae&&(0,h.f)(G,p.qY.POSTPAID.POSTPAID_FETCH_BILL_INVALID_OTP)},[Ae]);const Ie=()=>{(0,h.f)(G,p.qY.POSTPAID.POSTPAID_FETCH_BILL),fe({text:Q.msisdn,text1:null,otpAction:T.i0,flowType:T._2})};return(0,w.jsxs)("div",{className:P.postpaid,children:[(0,w.jsx)("div",{className:P.container,children:(0,w.jsx)("div",{className:"container",children:(0,w.jsx)(r.A,{className:P.breadcrumb,items:T.o1})})}),(0,w.jsxs)("div",{className:P.back,onClick:()=>q("/"),children:[(0,w.jsx)("img",{src:(0,v.wG)(A.sF,"orp".toLocaleLowerCase()),height:"16px",width:"16px",alt:"back"}),(0,w.jsx)("span",{children:o("BACK")})]}),(0,w.jsx)("div",{className:P.bundlerechargeform,children:(0,w.jsx)("div",{className:"container",children:(0,w.jsxs)("div",{className:P.formcontainer,children:[(0,w.jsx)(b.A,{formInput:Q,handleChange:J,crossClick:Z,showBundles:"false",sendOtpEvent:Ie,showBillSummary:se,maxAmount:I,minAmount:j,minError:V,maxError:K,showNoteForAmount:re,billInfo:ve,msidnError:ce,hybridPostpaidCheck:L,heading:o(T.kE),subHeading:o(T.Zn),showSubheading:!0,sendHandleShowPopUP:Ie,showFetchBill:!0,lineTypeRes:ee,showAccountField:R}),(0,w.jsx)("div",{className:P.buyAirtime,children:!R||null!==(t=null===ve||void 0===ve?void 0:ve.totalOutstanding)&&void 0!==t&&t?(0,w.jsx)(d.A,{style:`${P.makepayment}`,text:o(T.Uk),callBack:()=>ne(null===Q||void 0===Q?void 0:Q.msisdn,null===Q||void 0===Q?void 0:Q.amount),btnType:"danger",disabled:(0,y.Li)(null===Q||void 0===Q?void 0:Q.amount,V,K,de)}
1):(0,w.jsx)(d.A,{text:o(T.yI),callBack:pe,btnType:"danger",disabled:Q.account.length!=B})})]})})}),(0,w.jsx)("div",{className:P.postpaid_min_height}),Ce?(0,w.jsx)(a.A4,{otpText:Oe(),open:!!Ce,phoneNumber:null===Q||void 0===Q?void 0:Q.msisdn,otpLength:D,autoSubmit:!0,onOTPSubmit:xe,onOTPResend:ye,icon:(0,v.wG)(A.Od,"orp"),errorMsg:Te,otpInvalidAttemptMsg:Ae,otpAttemptLeftMsg:`${Se} ${o(T.Dv)}`,handleOTPClose:Pe,counter:F,otpCloseIcn:(0,v.wG)(A.LY,"icons"),onOTPClose:Pe,fetchByAccountNumber:!0,onAccountClick:()=>{Pe(),U(!0),W(Ce)},expireOTPCounter:$,expireOTPMsg:o(O.j4)}):null,(0,w.jsx)("div",{children:(0,w.jsx)("div",{className:P["bundle-container"],children:null})}),(le||be||te||he||we)&&(0,w.jsx)(i.A,{message:le||be||te||he||we,type:"Error",onClose:()=>{Ne(),ie(),oe(),Ee(""),he&&_e()}})]})},I=()=>(0,w.jsx)(E,{})},1048(e,t,o){var a=o(9950),n=o(6180),l=o(5445),i=o(81),s=o(2738),r=o(5771),d=o(6474);o.d(t,["W",0,e=>{var t,o;const[u,c]=(0,a.useState)(!1),[m,v]=(0,a.useState)(""),[p,h]=(0,a.useState)(!0),[_,g]=(0,a.useState)(!1),[f,x]=(0,a.useState)(!1),[C,T]=(0,a.useState)(!1),[y,A]=(0,a.useState)(""),[b,S]=(0,a.useState)(""),[P,N]=(0,a.useState)(""),{showLoader:O,hideLoader:w}=(0,i.M)(),[E,I]=(0,a.useState)(4),[j,L]=(0,a.useState)(""),[F,D]=(0,a.useState)(null),[M,B]=(0,a.useState)(""),{configData:$}=(0,s.A)(),k=null!==(t=null===$||void 0===$||null===(o=$.paymentOptionConfig)||void 0===o?void 0:o.otpAttempt)&&void 0!==t?t:4,[q,H]=(0,a.useState)(k),{getText:R}=(0,r.A)(),U=()=>!!E||(B(R(d.JH)),F&&D(null),!1);return{isOtpSent:u,isValidOtp:p,isOtpExpired:_,isOtpVerified:f,isOtpLimitExhausted:C,noOfAttemptsLeft:q,refId:m,error:y,uniqueCode:b,sendOtp:async e=>{try{null===O||void 0===O||O();let o=await(0,l.H_)(e);var t;if("200"===(null===o||void 0===o?void 0:o.status))x(!1),v(null===o||void 0===o||null===(t=o.result)||void 0===t?void 0:t.otpId),c(!0),T(!1);else"502"===(null===o||void 0===o?void 0:o.statusCode)?(T(!0),c(!1)):D(o.message)}catch(y){var o;c(!1),D((null===y||void 0===y||null===(o=y.error)||void 0===o?void 0:o.message)||(null===y||void 0===y?void 0:y.message)||n.UT)}finally{w()}},verifyOtp:async t=>{try{var o;if(!U())return;L(""),D(null),O();let i=Object.values(null===t||void 0===t?void 0:t.detail).join(""),s={otpId:m,otp:i,flowType:d._2},r=await(0,l.OK)(s);var a;if("200"===(null===r||void 0===r||null===(o=r.status)||void 0===o?void 0:o.toLowerCase()))x(!0),e(null===r||void 0===r?void 0:r.token),S(null===r||void 0===r||null===(a=r.result)||void 0===a?void 0:a.uniqueCode),N(null===r||void 0===r?void 0:r.token);else if(2003===r.httpStatus){const e=(null===r||void 0===r?void 0:r.message)||n.UT;E>0&&I(e=>e-1),L(e)}else 2002===r.httpStatus&&(L(null===r||void 0===r?void 0:r.message),I(0),g(!0))}catch(y){var i;x(!1),D((null===y||void 0===y||null===(i=y.error)||void 0===i?void 0:i.message)||n.UT)}finally{w()}},setOtpSent:c,verifyOtpUser:async e=>{if(!_&&U())try{var t;let o=await(0,l.nP)(e);w(),!o||200!==(null===o||void 0===o?void 0:o.statusCode)&&(null===o||void 0===o||null===(t=o.status)||void 0===t?void 0:t.toLowerCase())!==n.qO?2003===(null===o||void 0===o?void 0:o.statusCode)?(x(!1),h(!1),q>0&&H(e=>e-1)):2002===(null===o||void 0===o?void 0:o.statusCode)?(g(!0),H(0)):4001===(null===o||void 0===o?void 0:o.statusCode)?(x(!1),A(null===o||void 0===o?void 0:o.message)):400===(null===o||void 0===o?void 0:o.statusCode)?(A((null===o||void 0===o?void 0:o.message)||n.UT),x(!1)):(x(!1),A("Error",n.UT)):x(!0)}catch(y){var o;w(),D((null===y||void 0===y||null===(o=y.error)||void 0===o?void 0:o.message)||n.UT)}finally{w()}},reSendOtp:async()=>{L(""),D(null),I(k),g(!1),O();const e={otpId:m};try{let o=await(0,l.Qm)(e);var t;if(w(),"200"===(null===o||void 0===o?void 0:o.status))v(null===o||void 0===o||null===(t=o.result)||void 0===t?void 0:t.otpId),c(!0)}catch(y){var o;w(),D((null===y||void 0===y||null===(o=y.error)||void 0===o?void 0:o.message)||(null===y||void 0===y?void 0:y.message)||n.UT)}},otpAttempt:E,attemptErrMsg:j,apiFailureMsg:F,resetOtp:()=>{h(!0),x(!1),D(null),L(""),I(k),H(k),g(!1),T(!1),v(""),c(!1),A("")},resetApiFailure:()=>{D("")},generateOtpTranslation:()=>({resendText:R(d.c$),otpNotRecieveText:R(d.MN),heading:R(d.TB),subtext:R(d.ax),codeExpireText:R(d.ue),otpLengthText:R(d.Nn),currentTime:R(d.wM),fetchByAccountText:R(d.uR)}),token:P,toastErr:M,setToastErr:B}}])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.