1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[950],{48114:function(e,r,t){"use strict";t.d(r,{Z:function(){return h}});var s=t(7570),n=t(87029),i=t(93090),a=t(57437),o=t(56800),l=t.n(o),c=t(26073),u=t(56184),d=t(58918),p=t.n(d),m=t(39343),h=function(e){var r=e.label,t=e.name,o=e.required,d=e.noHelperText,h=(e.style,e.onChange),v=e.value,f=e.error,_=e.noStarShow,g=(0,i._)(e,["label","name","required","noHelperText","style","onChange","value","error","noStarShow"]),x=(0,c.ML)(),j=!!(x&&x.control),w=x||{},N=w.errors,y=w.control,b=l()("input__item",{error:j?null==N?void 0:N[t]:null==f?void 0:f[t]});return(0,a.jsx)(u.gZ,{name:t,label:r,required:void 0!==o&&o,errors:j?null==N?void 0:N[t]:null==f?void 0:f[t],noHelperText:void 0!==d&&d,noStarShow:_,children:j?(0,a.jsx)(m.Qr,{name:t,control:y,defaultValue:"",render:function(e){var r=e.field;return(0,a.jsx)(p(),(0,n._)((0,s._)({className:b,mask:"+99 (999) 999 99 99",maskChar:" "},r),{children:function(e){return(0,a.jsx)("input",(0,n._)((0,s._)({},e),{type:"text"}))}}))}}):(0,a.jsx)(p(),(0,n._)((0,s._)({className:b,mask:"+99 (999) 999 99 99",maskChar:" ",value:v,onChange:h},g),{children:function(e){return(0,a.jsx)("input",(0,n._)((0,s._)({},e),{type:"text"}))}}))})}},42016:function(e,r,t){"use strict";t.d(r,{t:function(){return n}});var s=t(54550),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.rQ)("profile/user/personal-data",e,r)}},66555:function(e,r,t){"use strict";t.d(r,{L:function(){return o}});var s,n=t(61943),i=t(11735),a=t(28807),o=(s=(0,n._)(function(e,r){var t,s,n;return(0,i.Jh)(this,function(i){switch(i.label){case 0:t="https://api.sapan.com.ua",s="".concat(t,"/api/auth/phone-check?phone=").concat(e),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch(s,{method:"GET",headers:{"Accept-Language":r||a.a.defaultLocale,"Content-Type":"application/json",Accept:"application/json"}})];case 2:return[4,i.sent().json()];case 3:return(n=i.sent()).success,[2,n];case 4:return[2,i.sent()];case 5:return[2]}})}),function(e,r){return s.apply(this,arguments)})},59523:function(e,r,t){"use strict";t.d(r,{L:function(){return o}});var s,n=t(61943),i=t(11735),a=t(28807),o=(s=(0,n._)(function(e){var r,t;return(0,i.Jh)(this,function(s){switch(s.label){case 0:if(!e)return[2];r="https://api.sapan.com.ua",t="".concat(r,"/api/auth/logout"),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch(t,{method:"POST",headers:{"Accept-Language":a.a.defaultLocale,"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer ".concat(e)}})];case 2:return[4,s.sent().json()];case 3:case 4:return[2,s.sent()];case 5:return[2]}})}),function(e){return s.apply(this,arguments)})},12144:function(e,r,t){"use strict";t.d(r,{M:function(){return _}});var s=t(61943),n=t(47002),i=t(11735),a=t(57437),o=t(39343),l=t(2265),c=t(4849),u=t(66555),d=t(18087),p=t(32172),m=t(67753),h=t(99378),v=t(48114),f=t(10317),_=function(e){var r,t,_,g=e.closeForm,x=e.setAnotherWayToLogin,j=e.setPasswordRecoveryWay,w=e.setHelperCheckHandler,N=e.redirect,y=(0,o.cI)({resolver:(0,m.X)(h.p)}),b=y.setValue,S=y.setError,C=y.clearErrors,k=y.handleSubmit,A=y.reset,L=y.formState.errors,T=(0,d.useTranslations)("Authentication"),H=(0,n._)((0,l.useState)(120),2),R=H[0],q=H[1],E=(0,n._)((0,l.useState)("+38"),2),F=E[0],Z=E[1],I=(0,n._)((0,l.useState)(!1),2),J=I[0],P=I[1],W=(0,p.CG)(function(e){return e.localizeParams.data.locale}),$=k((r=(0,s._)(function(e){var r,t,s,n,a,o;return(0,i.Jh)(this,function(i){switch(i.label){case 0:if(r=e.phone,t=(0,f.p6)(r),Z(r),J)return[3,2];return[4,(0,u.L)(t,W)];case 1:if(!(s=i.sent())||!s.success)return S("recoveryStatus",{type:"custom",message:(null===(o=s.errors)||void 0===o?void 0:null===(a=o.phone)||void 0===a?void 0:a[0])||s.message||"Password recovery error"}),[2];q((n=s.message.match(/\d+$/))?parseInt(n[0],10):60),P(!0),i.label=2;case 2:return A(),[2]}})}),function(e){return r.apply(this,arguments)})),z=(t=(0,s._)(function(){var e,r,t,s,n,a;return(0,i.Jh)(this,function(i){switch(i.label){case 0:return e=(0,f.p6)(F),[4,(0,u.L)(e,W)];case 1:return(r=i.sent())&&r.success?(q((t=r.message.match(/\d+$/))?parseInt(t[0],10):60),P(!0)):(a=null==r?void 0:null===(n=r.errors)||void 0===n?void 0:null===(s=n.code)||void 0===s?void 0:s[0])&&S("recoveryStatus",{type:"custom",message:a}),[2]}})}),function(){return t.apply(this,arguments)});return J?(0,a.jsx)(c.Z,{timeLimit:R,phone:F,setSmsCodeCheckHandler:P,setHelperCheckHandler:w,onResendCode:z,isRegisterAction:!1,closeForm:g,redirect:void 0===N||N}):(0,a.jsxs)("form",{onSubmit:$,children:[(0,a.jsxs)("div",{className:"input-wrap",children:[(null==L?void 0:null===(_=L.recoveryStatus)||void 0===_?void 0:_.message)&&(0,a.jsx)("div",{className:"input-title",children:(0,a.jsx)("p",{className:"product-review-error",children:"string"==typeof L.recoveryStatus.message?L.recoveryStatus.message:String(L.recoveryStatus.message)})}),(0,a.jsx)(v.Z,{name:"phone",label:T("phone"),required:!0,value:F,onChange:function(e){C("recoveryStatus"),Z(e.target.value),b("phone",e.target.value)},error:L,noStarShow:!0})]}),(0,a.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,a.jsx)("input",{className:"button sign-in-button",type:"submit",value:T("form_field_password_recovery_button")})}),(0,a.jsxs)("div",{className:"input-wrap",children:[(0,a.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:function(){j(!1),x(!0)},children:T("remembered_password")}),(0,a.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:function(){j(!1),x(!1)},children:T("another_way_login")})]})]})}},10150:function(e,r,t){"use strict";t.d(r,{D:function(){return C}});var s,n=t(61943),i=t(47002),a=t(11735),o=t(57437);t(40728);
1var l=t(39343),c=t(2265),u=t(66555),d=function(e){var r=e.setSmsCodeCheckHandler,t=e.setAnotherWayToLogin;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"input-wrap",children:(0,o.jsx)("div",{className:"input-title",children:(0,o.jsx)("p",{className:"product-review text-center sms-phone-number",children:"ЯкÑо не надÑ
одиÑÑ ÐºÐ¾Ð´:"})})}),(0,o.jsx)("div",{className:"input-wrap map-info__list",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{className:"auth-href",children:"ÐмÑнÑÑÑ Ð½Ð¾Ð¼ÐµÑ ÑелеÑонÑ"}),(0,o.jsx)("li",{className:"auth-href",children:"ÐовÑоÑÑÑÑ Ð½Ð°Ð´ÑÐ¸Ð»Ð°Ð½Ð½Ñ ÐºÐ¾Ð´Ñ"}),(0,o.jsx)("li",{className:"auth-href",children:"УвÑйÑи з паÑолем"}),(0,o.jsx)("li",{className:"auth-href",onClick:function(){r(!1),t(!1)},children:"ÐибеÑÑÑÑ ÑнÑий ÑпоÑÑб вÑ
одÑ"}),(0,o.jsx)("li",{className:"auth-href",children:"ÐвеÑнÑÑÑÑÑ Ð·Ð° номеÑом: +38 (050) 1112233"})]})})]})},p=t(4849);t(64587);var m=t(66648),h=function(){return(0,o.jsxs)("button",{onClick:function(){window.location.href="".concat("https://api.sapan.com.ua","/api/auth/facebook/redirect")},className:"facebook-auth-button",children:[(0,o.jsx)(m.default,{src:"/img/facebook-icon.svg",alt:"Facebook Auth",width:"30",height:"30"})," ","Facebook"]})};t(86329);var v=t(16463),f=function(){var e=(0,v.useSearchParams)();return null!==e&&e.get("callbackUrl"),(0,o.jsxs)("button",{onClick:function(){window.location.href="".concat("https://api.sapan.com.ua","/api/auth/google/redirect")},className:"google-auth-button",children:[(0,o.jsx)(m.default,{src:"/img/google-icon.svg",alt:"Google Auth",width:"30",height:"30"})," ","Google"]})},_=t(7570),g=t(28807),x=(s=(0,n._)(function(e){var r,t,s;return(0,a.Jh)(this,function(n){switch(n.label){case 0:r="https://api.sapan.com.ua",t="".concat(r,"/api/register/phone-verified?phone=").concat(e),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,{method:"GET",headers:{"Accept-Language":g.a.defaultLocale,"Content-Type":"application/json",Accept:"application/json"}})];case 2:return[4,n.sent().json()];case 3:return(s=n.sent()).success,[2,s];case 4:return[2,n.sent()];case 5:return[2]}})}),function(e){return s.apply(this,arguments)}),j=t(18087),w=function(e){var r,t,s,u,d,h,v,f,g,w,N=function(){T(!1),H(!1)},y=(0,l.cI)(),b=y.register,S=(y.setValue,y.setError),C=(y.clearErrors,y.handleSubmit),k=y.reset,A=y.formState.errors,L=e.phone,T=e.setRegisterCheck,H=e.setAnotherWayToLogin,R=e.setHelperCheckHandler,q=e.closeForm,E=e.redirect,F=(0,j.useTranslations)("Authentication"),Z=(0,i._)((0,c.useState)(120),2),I=Z[0],J=Z[1],P=(0,i._)((0,c.useState)(null),2);P[0],P[1];var W=(0,i._)((0,c.useState)(!1),2),$=W[0],z=W[1],G=(0,i._)((0,c.useState)(null),2),V=G[0],D=G[1],M=(0,i._)((0,c.useState)(null),2),O=M[0],U=M[1],B=C((r=(0,n._)(function(e){var r,t,s,n,i;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(D(e.firstName),U(e.lastName),$)return[3,2];return[4,x(L)];case 1:if((r=a.sent())&&r.success)J((t=r.message.match(/\d+$/))?parseInt(t[0],10):60),z(!0);else if(i=null==r?void 0:null===(n=r.errors)||void 0===n?void 0:null===(s=n.code)||void 0===s?void 0:s[0])return S("registerStatus",{type:"custom",message:i}),[2];return[3,3];case 2:k(),a.label=3;case 3:return[2]}})}),function(e){return r.apply(this,arguments)})),Q=C((0,n._)(function(){var e,r,t,s,n;return(0,a.Jh)(this,function(i){switch(i.label){case 0:return[4,x(L)];case 1:return(e=i.sent())&&e.success?(J((r=e.message.match(/\d+$/))?parseInt(r[0],10):60),z(!0)):(n=null==e?void 0:null===(s=e.errors)||void 0===s?void 0:null===(t=s.code)||void 0===t?void 0:t[0])&&S("registerStatus",{type:"custom",message:n}),[2]}})}));return $?(0,o.jsx)(p.Z,{timeLimit:I,phone:L,firstName:V,lastName:O,setSmsCodeCheckHandler:z,setHelperCheckHandler:R,setRegisterCheck:T,onResendCode:Q,isRegisterAction:!0,closeForm:q,redirect:void 0===E||E}):(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("form",{onSubmit:B,children:[(0,o.jsxs)("div",{className:"input-title sms-phone-header",children:[(0,o.jsx)("p",{className:"product-review text-center sms-phone-number",children:L}),(0,o.jsx)(m.default,{src:"/img/phone-edit.svg",alt:"",width:"18",height:"18",onClick:N})]}),(0,o.jsx)("div",{className:"input-wrap",children:(0,o.jsx)("p",{className:"product-review text-center input-wrap",children:F("form_field_register_customer_text")})}),(null==A?void 0:null===(t=A.registerStatus)||void 0===t?void 0:t.message)&&(0,o.jsx)("p",{className:"product-review-error text-center",children:"string"==typeof A.registerStatus.message?A.registerStatus.message:String(A.registerStatus.message)}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsxs)("div",{className:"input-title",children:[(0,o.jsx)("p",{children:F("form_field_register_customer_name_title")}),(null==A?void 0:null===(s=A.firstName)||void 0===s?void 0:s.type)==="required"&&(0,o.jsxs)("p",{className:"product-review-error",children:[" ","(",F("form_field_register_customer_name_required"),")"]}),(null==A?void 0:null===(u=A.firstName)||void 0===u?void 0:u.type)==="maxLength"&&(0,o.jsxs)("p",{className:"product-review-error",children:["(",F("form_field_register_customer_name_max"),")"]}),(null==A?void 0:null===(d=A.firstName)||void 0===d?void 0:d.type)==="pattern"&&(0,o.jsxs)("p",{className:"product-review-error",children:["(",F("form_field_register_customer_name_pattern"),")"]})]}),(0,o.jsx)("div",{className:"input",children:(0,o.jsx)("input",(0,_._)({className:(null==A?void 0:null===(h=A.firstName)||void 0===h?void 0:h.type)?"input-error input__item":"input__item",type:"text"},b("firstName",{required:!0,maxLength:12,pattern:/^[a-zA-Zа-ÑÐ-ЯÑÐÑÐÑÐÑÐ'âʼ]+$/})))})]}),(0,o.jsxs)("div",{className:"input-wrap",children:[(0,o.jsxs)("div",{className:"input-title",children:[(0,o.jsx)("p",{children:F("form_field_register_customer_surname_title")}),(null==A?void 0:null===(v=A.lastName)||void 0===v?void 0:v.type)==="required"&&(0,o.jsxs)("p",{className:"product-review-error",children:[" ","(",F("form_field_register_customer_surname_required"),")"]}),(null==A?void 0:null===(f=A.lastName)||void 0===f?void 0:f.type)==="maxLength"&&(0,o.jsxs)("p",{className:"product-review-error",children:["(",F("form_field_register_customer_surname_max"),")"]}),(null==A?void 0:null===(g=A.lastName)||void 0===g?void 0:g.type)==="pattern"&&(0,o.jsxs)("p",{className:"product-review-error",children:["(",F("form_field_register_customer_surname_pattern"),")"]})]}),(0,o.jsx)("div",{className:"input",children:(0,o.jsx)("input",(0,_._)({className:(null==A?void 0:null===(w=A.lastName)||void 0===w?void 0:w.type)?"input-error input__item":"input__item",type:"text"},b("lastName",{required:!0,maxLength:24,pattern:/^[a-zA-Zа-ÑÐ-ЯÑÐÑÐÑÐÑÐ'âʼ]+$/})))})]}),(0,o.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,o.jsx)("input",{className:"button sign-in-button",type:"submit",value:F("form_field_register_customer_register_button")})}),(0,o.jsx)("div",{className:"input-wrap",children:(0,o.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:N,children:F("another_way_login")})})]})})},N=t(48114),y=t(67753),b=t(99378),S=t(10317),C=function(e){var r,t=e.closeForm,s=e.setAnotherWayToLogin,m=e.redirect,v=void 0===m||m,_=(0,l.cI)({resolver:(0,y.X)(b.p)}),g=(_.register,_.setValue),x=_.setError,C=_.clearErrors,A=_.handleSubmit,L=_.formState.errors,T=(0,j.useTranslations)("Authentication"),H=(0,i._)((0,c.useState)("+38"),2),R=H[0],q=H[1],E=(0,i._)((0,c.useState)(null),2);E[0],E[1];var F=(0,i._)((0,c.useState)(!1),2),Z=F[0],I=F[1],J=(0,i._)((0,c.useState)(!1),2),P=J[0],W=J[1],$=(0,i._)((0,c.useState)(!1),2),z=$[0],G=$[1],V=(0,i._)((0,c.useState)(120),2),D=V[0],M=V[1],O=A((0,n._)(function(){var e,r,t,s,n,i,o;return(0,a.Jh)(this,function(a){switch(a.label){case 0:return C("phone"),e=(0,S.p6)(R),[4,(0,u.L)(e)];case 1:if((r=a.sent())&&r.success)M(k(r.message)),I(!0);else{if(o=null==r?void 0:null===(s=r.errors)||void 0===s?void 0:null===(t=s.code)||void 0===t?void 0:t[0])return x("authStatus",{type:"custom",message:o}),[2];(null==r?void 0:null===(i=r.errors)||void 0===i?void 0:null===(n=i.phone)||void 0===n?void 0:n[0])&&G(!0)}return[2]}})}));return Z?(0,o.jsx)(p.Z,{timeLimit:D,phone:(0,S.p6)(R),setSmsCodeCheckHandler:I,setHelperCheckHandler:W,onResendCode:O,isRegisterAction:!1,closeForm:t,setRegisterCheck:G,redirect:v}):z?(0,o.jsx)(w,{phone:(0,S.p6)(R),setSmsCodeCheckHandler:I,setHelperCheckHandler:W,setAnotherWayToLogin:s,setRegisterCheck:G,closeForm:t,redirect:v}):P?(0,o.jsx)(d,{setSmsCodeCheckHandler:I,setAnotherWayToLogin:s,redirect:v}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("form",{onSubmit:O,children:[(0,o.jsxs)("div",{className:"input-wrap",children:[(null==L?void 0:null===(r=L.authStatus)||void 0===r?void 0:r.message)&&(0,o.jsx)("div",{className:"input-title",children:(0,o.jsx)("span",{className:"product-review-error",children:L.authStatus.message})}),(0,o.jsx)(N.Z,{name:"phone",label:T("phone"),required:!0,value:R,onChange:function(e){q(e.target.value),g("phone",e.target.value)},error:L,noStarShow:!0})]}),(0,o.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,o.jsx)("input",{className:"button sign-in-button",type:"submit",value:T("sign_in_button")})}),(0,o.jsx)("p",{className:"product-review text-center input-wrap",children:T("or")}),(0,o.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,o.jsx)("input",{className:"button sign-in-button sign-in-log-pass-button",type:"button",value:T("login_and_password"),onClick:function(){s(!0)}})})]}),(0,o.jsxs)("div",{className:"sign-in-buttons-container",children:[(0,o.jsx)(h,{}),(0,o.jsx)(f,{})]})]})},k=function(e){var r=e.match(/\d+$/);return r?parseInt(r[0],10):60}},70577:function(e,r,t){"use strict";t.d(r,{M:function(){return p}});var s=t(61943),n=t(7570),i=t(11735),a=t(57437);t(73572);var o=t(16463),l=t(30998),c=t(39343);t(2265);var u=t(18087),d=t(32172),p=function(e){var r,t,p,m,h,v,f,_,g,x,j=e.closeForm,w=e.setAnotherWayToLogin,N=e.setPasswordRecoveryWay,y=e.redirect,b=void 0===y||y,S=(0,c.cI)(),C=S.register,k=(S.setValue,S.setError),A=(S.clearErrors,S.handleSubmit),L=S.formState.errors,T=(0,u.useTranslations)("Authentication"),H=(0,o.useRouter)(),R=(0,d.CG)(function(e){return e.localizeParams.data.locale}),q=A((r=(0,s._)(function(e){var r,t,s;return(0,i.Jh)(this,function(n){switch(n.label){case 0:return r=e.email,t=e.password,[4,(0,l.signIn)("credentials",{email:r,password:t,redirect:!1,authType:"email"})];case 1:return(s=n.sent())&&!s.error?(j&&j(!1),b&&H.push("/".concat(R,"/profile"))):k("authStatus",{type:"custom",message:s.error}),[2]}})}),function(e){return r.apply(this,arguments)}));return(0,a.jsxs)("form",{onSubmit:q,children:[(0,a.jsxs)("div",{className:"input-wrap",children:[(0,a.jsxs)("div",{className:"input-title",children:[(0,a.jsx)("p",{children:T("form_field_email_title")}),(null==L?void 0:null===(t=L.email)||void 0===t?void 0:t.type)==="required"&&(0,a.jsxs)("p",{className:"product-review-error",children:[" ","(",T("form_field_email_required"),")"]}),(null==L?void 0:null===(p=L.email)||void 0===p?void 0:p.type)==="maxLength"&&(0,a.jsxs)("p",{className:"product-review-error",children:["(",T("form_field_email_max"),")"]}),(null==L?void 0:null===(m=L.email)||void 0===m?void 0:m.type)==="pattern"&&(0,a.jsxs)("p",{className:"product-review-error",children:["(",T("form_field_email_pattern"),")"]})]}),(0,a.jsx)("div",{className:"input",children:(0,a.jsx)("input",(0,n._)({className:(null==L?void 0:null===(h=L.email)||void 0===h?void 0:h.type)?"input-error input__item":"input__item",type:"email"},C("email",{required:!0,maxLength:64,pattern:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i})))})]}),(0,a.jsxs)("div",{className:"input-wrap",children:[(0,a.jsxs)("div",{className:"input-title",children:[(0,a.jsx)("p",{children:T("form_field_password_title")}),(null==L?void 0:null===(v=L.password)||void 0===v?void 0:v.type)==="required"&&(0,a.jsxs)("p",{className:"product-review-error",children:[" ","(",T("form_field_password_required"),")"]}),(null==L?void 0:null===(f=L.password)||void 0===f?void 0:f.type)==="maxLength"&&(0,a.jsxs)("p",{className:"product-review-error",children:["(",T("form_field_password_max"),")"]}),(null==L?void 0:null===(_=L.password)||void 0===_?void 0:_.type)==="pattern"&&(0,a.jsxs)("p",{className:"product-review-error",children:["(",T("form_field_password_pattern"),")"]})]}),(0,a.jsx)("div",{className:"input",children:(0,a.jsx)("input",(0,n._)({className:(null==L?void 0:null===(g=L.password)||void 0===g?void 0:g.type)?"input-error input__item":"input__item",type:"password"},C("password",{required:!0,maxLength:64})))}),(null==L?void 0:null===(x=L.authStatus)||void 0===x?void 0:x.type)==="custom"&&(0,a.jsxs)("p",{className:"product-review-error",children:["(",T("auth_data_error"),")"]})]}),(0,a.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,a.jsx)("input",{className:"button sign-in-button",type:"submit",value:T("sign_in_button")})}),(0,a.jsxs)("div",{className:"input-wrap",children:[(0,a.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:function(){N(!0)},children:T("forgot_password")}),(0,a.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:function(){w(!1)},children:T("another_way_login")})]})]})}},4849:function(e,r,t){"use strict";t.d(r,{Z:function(){return j}});var s,n=t(61943),i=t(47002),a=t(11735),o=t(57437),l=t(39343);t(40728);var c=t(66648),u=t(2265),d=t(70279),p=t.n(d),m=t(28807),h=(s=(0,n._)(function(e,r,t,s){var n,i,o,l;return(0,a.Jh)(this,function(a){switch(a.label){case 0:a.label=1;case 1:return a.trys.push([1,8,,9]),[4,fetch("/api/registernewuser",{method:"POST",headers:{"Accept-Language":m.a.defaultLocale,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({phone:e,first_name:r,last_name:t,code:s})})];case 2:if((n=a.sent()).ok)return[3,6];a.label=3;case 3:return a.trys.push([3,5,,6]),[4,n.json()];case 4:return[2,a.sent()];case 5:return a.sent(),[2,{success:!1,message:"Server error: ".concat(n.status," ").concat(n.statusText)}];case 6:return i=n.headers.get("Authorization"),[4,n.json()];case 7:return o=a.sent(),l=i||(null==o?void 0:o.authToken),o.authToken=l,(null==o?void 0:o.data)&&(o.data.authToken=l),o.success,[2,o];case 8:return[2,{success:!1,message:a.sent().message}];case 9:return[2]}})}),function(e,r,t,n){return s.apply(this,arguments)}),v=t(23580),f=t(30998),_=t(16463),g=t(18087),x=t(32172),j=function(e){var r,t=(0,l.cI)(),s=(t.register,t.setValue),d=t.setError,m=t.clearErrors,j=t.handleSubmit,w=t.formState.errors,N=e.timeLimit,y=e.phone,b=e.firstName,S=e.lastName,C=e.setSmsCodeCheckHandler,k=(e.setRegisterCheck,e.setHelperCheckHandler,e.onResendCode),A=e.isRegisterAction,L=e.closeForm,T=e.redirect,H=void 0===T||T,R=(0,g.useTranslations)("Authentication"),q=(0,x.CG)(function(e){return e.localizeParams.data.locale}),E=(0,i._)((0,u.useState)(N),2),F=E[0],Z=E[1],I=(0,i._)((0,u.useState)(""),2),J=I[0],P=I[1],W=(0,_.useRouter)();(0,u.useEffect)(function(){if(F>0){var e=setInterval(function(){Z(function(e){return e-1})},1e3);return function(){return clearInterval(e)}}},[F]);var $=function(){Z(N),k()},z=j((0,n._)(function(){var e,r,t,s,n,i;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(4!=J.length)return d("sms",{type:"custom",message:R("form_field_sms_recovery_fill")}),[2];if(m("sms"),!A)return[3,5];return[4,h(y,b,S,J)];case 1:if(!(null==(e=a.sent())?void 0:e.success))return[3,3];return v.toast.success(null==e?void 0:e.message),[4,(0,f.signIn)("credentials",{newUser:JSON.stringify(e),authType:"registerNewUser",redirect:!1})];case 2:if(null==(r=a.sent())?void 0:r.ok)L&&L(),H&&W.push("/".concat(q,"/profile"));else if(null==r?void 0:r.error)return v.toast.error(r.error),[2];return[3,4];case 3:if(n=null==e?void 0:null===(s=e.errors)||void 0===s?void 0:null===(t=s.code)||void 0===t?void 0:t[0])return v.toast.error(n),[2];if(null==e?void 0:e.message)return v.toast.error(e.message),[2];v.toast.error("An unexpected error occurred. Please try again later."),a.label=4;case 4:return[3,7];case 5:return[4,(0,f.signIn)("credentials",{phone:y,code:J,authType:"phone",redirect:!1})];case 6:if(null==(i=a.sent())?void 0:i.ok)L&&L(),H&&W.push("/".concat(q,"/profile"));else{if(null==i?void 0:i.error)return
1 v.toast.error(i.error),[2];v.toast.error("Unexpected error occurred. Please try again later.")}a.label=7;case 7:return[2]}})}));return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("form",{onSubmit:z,children:[(0,o.jsxs)("div",{className:"input-title sms-phone-header",children:[(0,o.jsx)("p",{className:"product-review text-center sms-phone-number",children:y}),(0,o.jsx)(c.default,{src:"/img/phone-edit.svg",alt:"",width:"18",height:"18",onClick:function(){C(!1)}})]}),(0,o.jsx)("div",{className:"input",children:(0,o.jsx)("p",{className:"product-review text-center input-wrap l-height_16",children:R("form_field_sms_recovery_title")})}),(null==w?void 0:null===(r=w.sms)||void 0===r?void 0:r.message)&&(0,o.jsx)("p",{className:"product-review-error text-center",children:"string"==typeof w.sms.message?w.sms.message:String(w.sms.message)}),(0,o.jsx)("div",{className:"input-wrap",children:(0,o.jsx)(p(),{length:4,initialValue:"",onChange:function(e,r){},type:"numeric",inputMode:"number",style:{padding:"10px",display:"flex",justifyContent:"center",gap:"20px"},inputStyle:{borderColor:"#BDC2D3",width:"49px",borderRadius:"5px",fontSize:"18px",fontWeight:"700",color:"#2D3A50"},inputFocusStyle:{borderColor:"#2D3A50"},onComplete:function(e,r){P(e),s("sms",e),m("sms")},autoSelect:!0,regexCriteria:/^[ A-Za-z0-9_@./#&+-]*$/})}),(0,o.jsx)("div",{className:"",children:F>0?(0,o.jsxs)("p",{className:"product-review text-center input-wrap",children:[R("form_field_sms_recovery_resend_countdown_start"),F," ",R("form_field_sms_recovery_resend_countdown_end")]}):(0,o.jsx)("p",{className:"product-review text-center input-wrap auth-href",onClick:function(){m("sms"),$()},children:R("form_field_sms_recovery_resend")})}),(0,o.jsx)("div",{className:"popup-reviews-footer input-wrap",children:(0,o.jsx)("input",{className:"button sign-in-button",type:"submit",value:R("form_field_register_customer_register_button")})})]})})}},99378:function(e,r,t){"use strict";t.d(r,{p:function(){return i},t:function(){return n}});var s=t(14245),n=s.Ry().shape({email:s.Z_().email("ÐекоÑекÑний E-mail")}),i=s.Ry().shape({phone:s.Z_().required("ТелеÑон обов'Ñзковий").matches(/^\+?\d{2} \(\d{3}\) \d{3} \d{2} \d{2}$/,"ÐекоÑекÑний номеÑ")})},40728:function(){},64587:function(){},86329:function(){},73572:function(){}}]);
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.