"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4856],{82515:function(n,e,t){t.d(e,{g:function(){return o}});var r="999999999999";function i(n){return n.split("-").map((function(n){return+n})).reduce((function(n,e){return n+e}))}function o(){var n,e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=0,a=null!==(e=null===(n=null===o||void 0===o?void 0:o.country.calling_code)||void 0===n?void 0:n.toString())&&void 0!==e?e:"",s="+"+(null===a||void 0===a?void 0:a.replace(/9/g,"\\$&")),l=t.replace(/[^0-9]/g,"").length-a.length,d=null===o||void 0===o?void 0:o.country.phonenumber_mask.sort((function(n,e){var t,r;return+(null===e||void 0===e||null===(t=e.replace)||void 0===t?void 0:t.call(e,/-/g,""))-+(null===n||void 0===n||null===(r=n.replace)||void 0===r?void 0:r.call(n,/-/g,""))}));if(!(null===d||void 0===d?void 0:d.length))return"".concat(s," ").concat(r);d&&d.length&&d.some((function(n,e){var t=i(n);return l<t?(u=e,!0):l===t&&(u=d.length-1===e||c?e:e+1,!0)}));var f=null===d||void 0===d?void 0:d[u].split("-").map((function(n){return"9".repeat(+n)})).join(" ");return"".concat(s," ").concat(f)}},74856:function(n,e,t){t.r(e),t.d(e,{default:function(){return G}});var r=t(47568),i=t(14924),o=t(26042),c=t(7297),u=t(97582),a=t(85893),s=t(67294),l=t(47621),d=t(1094),f=t(72569),h=t(86927),p=t(42106),v=t(14141),g=t(27899),m=t(82515),y=t(50259),x=t(60911),C=t(29971),Z=t(42746);function b(){var n=(0,c.Z)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n"]);return b=function(){return n},n}function j(){var n=(0,c.Z)(["\n  margin: 32px 0 20px;\n"]);return j=function(){return n},n}function P(){var n=(0,c.Z)(["\n  padding: 16px 24px;\n  margin: -16px -24px;\n  cursor: pointer;\n"]);return P=function(){return n},n}function k(){var n=(0,c.Z)(["\n  margin-top: 20px;\n  text-align: center;\n\n  & > a {\n    color: ",";\n    opacity: 1;\n  }\n"]);return k=function(){return n},n}var w=v.ZP.div.withConfig({componentId:"sc-dad7c1fd-0"})(b()),A=v.ZP.main.withConfig({componentId:"sc-dad7c1fd-1"})(j()),S=v.ZP.div.withConfig({componentId:"sc-dad7c1fd-2"})(P()),_=(0,v.ZP)(f.Z).withConfig({componentId:"sc-dad7c1fd-3"})(k(),(function(n){return n.theme.color.text.primary}));var F=function(n){var e=n.onClose,t=n.onSendVerificationCode,i=n.isCodeRequested,o=(0,s.useState)(!1),c=o[0],l=o[1],v=(0,s.useState)(""),b=v[0],j=v[1],P=(0,s.useState)(""),k=P[0],F=P[1],I=(0,Z.useTranslations)(),R=(0,g.h)().data;(0,s.useEffect)((function(){return l(!0),function(){l(!1)}}),[]);var T=(0,y.xX)().executeRecaptcha;function V(){return V=(0,r.Z)((function(){var n,e,r,i,o,c,a;return(0,u.__generator)(this,(function(u){switch(u.label){case 0:if(!T)return[2];n="",u.label=1;case 1:return u.trys.push([1,5,,6]),[4,T("login")];case 2:return n=u.sent(),[3,4];case 3:n="testing",u.label=4;case 4:return[3,6];case 5:return e=u.sent(),console.error(e),F("Captcha failed"),[2];case 6:return u.trys.push([6,8,,9]),[4,t(null===b||void 0===b?void 0:b.replace(/ /g,"").replace(/_/g,""),n)];case 7:return u.sent(),[3,9];case 8:return 429===(null===(r=u.sent())||void 0===r?void 0:r.errorStatusCode)?(o=null===(i=null===r||void 0===r?void 0:r.detail.match(/\d+/))||void 0===i?void 0:i[0],F(o?"Too many failed attempts. Please try again after ".concat(o," seconds."):"Too many failed attempts. Please try again later.")):(null===r||void 0===r||null===(c=r.username)||void 0===c?void 0:c.length)>0?F(r.username[0]):(null===r||void 0===r||null===(a=r.recaptcha)||void 0===a?void 0:a.length)>0?F(r.recaptcha[0]):F(I("Auth.invalidPhone")),[3,9];case 9:return[2]}}))})),V.apply(this,arguments)}var E=function(n){try{return!!n&&(0,C.t)(n)}catch(e){return!1}}(b);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(w,{children:[(0,a.jsx)(f.Z,{color:"secondary",t:{key:"Auth.enterMobileNumber"}}),(0,a.jsx)(S,{onClick:e,children:(0,a.jsx)(d.Z,{})})]}),(0,a.jsx)(A,{children:(0,a.jsx)(h.ZP,{inputMode:"tel",mask:(0,m.g)(b,R),autoFocus:c,onInput:function(n){return j(n)},value:b,errorMessage:k,tLabel:{key:"Auth.mobileNumber"},dataTest:x.U.enterPhoneInput})}),(0,a.jsx)(p.Z,{isLoading:i,t:{key:"Auth.sendCode"},type:"contained",onClick:function(){return V.apply(this,arguments)},dataTest:x.U.sendSMSBtn,disabled:!E}),(0,a.jsxs)(_,{color:"secondary",type:"body3",children:[I("Auth.protected"),(0,a.jsxs)("a",{href:"https://policies.google.com/privacy",target:"_blank",children:[" ","Google Privacy Policy"]})," ",I("Common.and"),(0,a.jsxs)("a",{href:"https://policies.google.com/terms",target:"_blank",children:[" ","Terms of Service."]})," "]})]})};var I=t(77088);function R(){var n=(0,c.Z)(["\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n"]);return R=function(){return n},n}function T(){var n=(0,c.Z)(["\n  margin: 32px 0 20px;\n"]);return T=function(){return n},n}function V(){var n=(0,c.Z)(["\n  padding: 16px 24px;\n  margin: -16px -24px;\n"]);return V=function(){return n},n}function E(){var n=(0,c.Z)(["\n  display: flex;\n  align-items: center;\n"]);return E=function(){return n},n}function M(){var n=(0,c.Z)(["\n  margin-left: 4px;\n"]);return M=function(){return n},n}var q=v.ZP.div.withConfig({componentId:"sc-4484477b-0"})(R()),L=v.ZP.main.withConfig({componentId:"sc-4484477b-1"})(T()),N=v.ZP.div.withConfig({componentId:"sc-4484477b-2"})(V()),U=v.ZP.div.withConfig({componentId:"sc-4484477b-3"})(E()),K=v.ZP.div.withConfig({componentId:"sc-4484477b-4"})(M());var O,W=function(n){var e=n.onClose,t=n.phoneForVerification,i=n.onResendCode,o=n.loginWithVerificationCode,c=(0,s.useState)(""),l=c[0],v=c[1],g=(0,s.useState)(!1),m=g[0],C=g[1],b=(0,s.useState)(!1),j=b[0],P=(b[1],(0,s.useState)(!1)),k=P[0],w=P[1],A=function(n){var e=(0,s.useRef)(1e3*n),t=(0,s.useRef)(e),r=(0,s.useState)(n),i=r[0],o=r[1],c=(0,s.useRef)(0);return(0,s.useEffect)((function(){if(!(e.current<=0)){var n,r=e.current,i=function(u){void 0===n&&(n=u);var a=u-n;if(e.current=r-a,e.current<=0)o(0),cancelAnimationFrame(c.current);else{var s=Math.floor(e.current/1e3),l=s!==Math.floor(t.current/1e3);t.current=e.current,l&&o(s),c.current=window.requestAnimationFrame(i)}};return c.current=requestAnimationFrame(i),function(){cancelAnimationFrame(c.current)}}}),[c.current]),{timer:i,resetTimer:(0,s.useCallback)((function(n){e.current=1e3*n,t.current=e.current,c.current=n,o(n)}),[])}}(30),S=A.timer,_=A.resetTimer,F=(0,s.useState)(""),R=F[0],T=F[1],V=(0,Z.useTranslations)();(0,I.useReadOTP)((function(n){v(n),E(t,n)})),(0,s.useEffect)((function(){return C(!0),function(){C(!1)}}),[]);var E=(0,s.useCallback)(function(){var n=(0,r.Z)((function(n,e){return(0,u.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),w(!0),[4,o(n,e)];case 1:return t.sent(),w(!1),[3,3];case 2:return t.sent(),T(V("Auth.invalidVerificationCode")),w(!1),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}(),[o]),M=(0,s.useCallback)((function(n){T(""),!n&&l&&v(""),n.length>6||k||!/^\d+$/.test(n)||(6===n.length&&E(t,n),v(n))}),[E,l,k,j,t]),O=(0,y.xX)().executeRecaptcha;function W(){return W=(0,r.Z)((function(){var n,e,t;return(0,u.__generator)(this,(function(r){switch(r.label){case 0:if(_(30),!O)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,O("login")];case 2:return n=r.sent(),i(n),[3,4];case 3:return(null===(e=r.sent())||void 0===e||null===(t=e.recaptcha)||void 0===t?void 0:t.length)>0?T(e.recaptcha[0]):T(V("Auth.invalidPhone")),[3,4];case 4:return[2]}}))})),W.apply(this,arguments)}var X=(0,s.useCallback)((function(n){var e=Math.floor(n/3600),t=Math.floor(n/60)-60*e,r=parseFloat(n%60).toFixed(0),i=r<10?"0"+r:r;return"".concat(t<10?"0"+t:t,":").concat(i)}),[]),D=(0,s.useMemo)((function(){return X(S)}),[X,S]),H=S<1;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(q,{children:[(0,a.jsx)(f.Z,{color:"secondary",t:{key:"Auth.verification"}}),(0,a.jsx)(N,{onClick:e,children:(0,a.jsx)(d.Z,{})})]}),(0,a.jsx)(L,{children:(0,a.jsx)(h.ZP,{inputMode:"numeric",autoFocus:m,value:l,disabled:k,placeholder:"*** ***",tLabel:{key:"Auth.verificationCode"},errorMessage:R,onInput:M,dataTest:x.U.verificationCodeInput})}),H?(0,a.jsxs)(U,{children:[(0,a.jsx)(f.Z,{type:"body3",color:"secondary",t:{key:"Auth.verificationDesc"}}),(0,a.jsx)(K,{children:(0,a.jsx)(p.Z,{onClick:function(){return W.apply(this,arguments)},children:(0,a.jsx)(f.Z,{type:"button3",t:{key:"Auth.resend"}})})})]}):(0,a.jsx)(f.Z,{type:"body3",color:"secondary",t:{key:"Auth.sendDesc",values:{countdownString:D,phoneForVerification:t}}})]})},X=t(61206),D=t(90494);function H(){var n=(0,c.Z)(["\n  padding: 16px 24px 24px;\n"]);return H=function(){return n},n}!function(n){n[n.EnterPhone=0]="EnterPhone",n[n.VerificationCode=1]="VerificationCode",n[n.Resend=2]="Resend"}(O||(O={}));var $=v.ZP.div.withConfig({componentId:"sc-387be196-0"})(H());function B(n){var e,t=(e={},(0,i.Z)(e,O.Resend,(function(){return(0,a.jsx)(a.Fragment,{})})),(0,i.Z)(e,O.EnterPhone,(function(n){return(0,a.jsx)(F,(0,o.Z)({},n))})),(0,i.Z)(e,O.VerificationCode,(function(n){return(0,a.jsx)(W,(0,o.Z)({},n))})),e);return t[n]||t[O.EnterPhone]}var G=function(n){var e=n.isOpen,t=n.onClose,i=function(){d(""),null===t||void 0===t||t()},o=(0,s.useState)(""),c=o[0],d=o[1],f=(0,s.useState)(!1),h=f[0],p=f[1],v=(0,X.Z)().sendVerificationCode,g=(0,D.E)().loginWithPhone,m=c?O.VerificationCode:O.EnterPhone;function x(n,e){return C.apply(this,arguments)}function C(){return(C=(0,r.Z)((function(n,e){var t;return(0,u.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),p(!0),[4,v(n,e)];case 1:return r.sent(),d(n),p(!1),[3,3];case 2:throw t=r.sent(),p(!1),t;case 3:return[2]}}))}))).apply(this,arguments)}function Z(){return Z=(0,r.Z)((function(n,e){return(0,u.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(n,e)];case 1:return t.sent(),i(),[3,3];case 2:throw t.sent();case 3:return[2]}}))})),Z.apply(this,arguments)}return(0,a.jsx)(y.pm,{reCaptchaKey:"6LcYerEmAAAAAFVhyiuRKH4TPSHyE-FUT9XoAgKS",scriptProps:{async:!0,defer:!0,appendTo:"body",nonce:void 0},children:(0,a.jsx)(l.Z,{isOpen:e,onClick:i,children:(0,a.jsx)($,{children:e&&B(m)({onClose:i,onSendVerificationCode:x,phoneForVerification:c,loginWithVerificationCode:function(n,e){return Z.apply(this,arguments)},onResendCode:function(n){x(c,n)},isCodeRequested:h})})})})}}}]);