1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7580],{46520:(e,i,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[lng]/oauth/callback/kycshare",function(){return n(81618)}])},81618:(e,i,n)=>{"use strict";n.r(i),n.d(i,{default:()=>f});var o=n(37876),l=n(61329),t=n(7842),a=n(38243),d=n(82565),u=n(1567),s=n(92094),v=n(95690),r=n(78932),c=n(52397),_=n(14232),A=n(34846),E=n(77929),m=n(8053),S=n(95256),T=n(45986),C=n(17745);let f=()=>{let{getQuery:e}=(0,S.IT)(),i=e("code"),n=e("state"),[f,x]=(0,_.useState)(""),[y,k]=(0,_.useState)(!0),p=(0,S.Ay)(),{oauthData:V,setOAuthData:g}=(0,r.A)(),[h,I]=(0,_.useState)(!1),{t:N}=(0,A.Bd)(),{doLogin:w}=(0,v.A)(),U=(0,S.uU)(),[O,L]=(0,_.useState)(""),{toFailedPage:Y,toSuccessPage:R}=(0,T.A)(),{ga4log:K}=(0,C.A)();(0,_.useEffect)(()=>{K({element_id:"paymonade3_login_pageView"})},[K]),(0,_.useEffect)(()=>{var e,i,n,o,l,t;(null==V?void 0:null===(e=V.nextValidation)||void 0===e?void 0:e.feStatus)===a.Y0.ONLY_WAIT_EMAIL_VERIFY_CODE&&(L((null==V?void 0:null===(i=V.nextValidation)||void 0===i?void 0:i.emailToCreate)||(null==V?void 0:null===(o=V.nextValidation)||void 0===o?void 0:null===(n=o.seletedAccount)||void 0===n?void 0:n.email)||(null==V?void 0:null===(t=V.nextValidation)||void 0===t?void 0:null===(l=t.userToBind)||void 0===l?void 0:l.email)),I(!0))},[V]);let P=async()=>{var e,i,n,o,t;return K({element_id:"paymonade3_send_VerifyCode"}),(null==V?void 0:null===(e=V.nextValidation)||void 0===e?void 0:e.emailToCreate)&&d.A.success({text:N("Signupwith").replace("{{email}}",(null==V?void 0:null===(n=V.nextValidation)||void 0===n?void 0:n.emailToCreate)||(null==V?void 0:null===(t=V.nextValidation)||void 0===t?void 0:null===(o=t.seletedAccount)||void 0===o?void 0:o.email)||"")}),await (0,l.Uy)({kycLoginProcessId:null==V?void 0:null===(i=V.nextValidation)||void 0===i?void 0:i.kycLoginProcessId})},B=async e=>{var i;K({element_id:"paymonade3_otp_confirm"});let{data:n}=await (0,l.Bi)({kycLoginProcessId:null==V?void 0:null===(i=V.nextValidation)||void 0===i?void 0:i.kycLoginProcessId,emailVerifyCode:e});if(n.accountIsTerminated){p.push("/".concat(U,"/account-terminated"));return}if(n.kycLoginFail){let{kycLoginStatus:e,merchantName:i}=null==n?void 0:n.kycLoginFail;if(e===s.$u.ALREADY_LINKED_ANOTHER_ACCOUNT||e===s.$u.SHARE_KYC_NOT_MATCH_USER_KYC){Y(e,i);return}if(e===s.$u.ACCOUNT_SUCCESS_SHARE_KYC_NOT_MATCH_USER_KYC){R(e,i);return}}(null==n?void 0:n.sessionToken)&&await w(null==n?void 0:n.sessionToken,!0)};return(0,_.useEffect)(()=>{k(!0),(0,l.Ke)({orderToken:(0,c._W)(s.Bm.orderToken)}).then(async e=>{let{data:i}=e;if(i.userId){await w(i.sessionToken,!0);return}i.nextValidation&&((0,c.KY)(s.Bm.oauthData,JSON.stringify(i)),g({...i,bindStatusIsInit:!!i.nextValidation.userToBind||!!i.nextValidation.usersToSelect})),k(!1)}).catch(e=>{var i,n,o,l;let t=null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(i=n.data)||void 0===i?void 0:i.code,a=null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(o=l.data)||void 0===o?void 0:o.msg;("USE001000014"===t||"USE001000015"===t||"USE001000016"===t||"USE001000017"===t||"USE0010020001"===t)&&d.A.info({text:a||N("SomethingWentWrongContactCustomer")})})},[w,i,U,p,g,n]),(0,o.jsxs)(m.Ay,{children:[y?(0,o.jsx)(E.A,{desc:N("PleaseWait")}):(0,o.jsx)(t.A,{}),(0,o.jsx)(u.A,{onConfirm:B,open:h,setOpen:I,onReSend:P,email:O})]})}}},e=>{var i=i=>e(e.s=i);e.O(0,[7248,636,6593,8792],()=>i(46520)),_N_E=e.O()}]);
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.