1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="051aeded-b8bc-2d90-2cdb-29586effba8b")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,549523,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016),s=e.i(618566),i=e.i(475623),a=e.i(518034),o=e.i(588220),l=e.i(228441),c=e.i(885205),u=e.i(632781),d=e.i(150095),m=e.i(616867),h=e.i(803164),g=e.i(687396),p=e.i(740732),f=e.i(927766),x=e.i(642306);let v=["login","verify"],y=x.authLabelClassName,j=x.authButtonClassName,N={login:{title:"ÐойÑи в кабинеÑ"},verify:{title:"Ðовое ÑÑÑÑойÑÑво"}};function b(){let e=(0,s.useRouter)(),b=(0,s.useSearchParams)(),[S,C]=(0,r.useState)(""),[w,T]=(0,r.useState)(""),[k,F]=(0,r.useState)(""),[A,P]=(0,r.useState)(!1),[R,O]=(0,r.useState)("login"),E=(0,f.useStepDirection)(R,v),[L,B]=(0,r.useState)(""),[D,I]=(0,r.useState)(!1),[q,W]=(0,r.useState)(0),[J,K]=(0,r.useState)(!1),U=(0,r.useRef)(""),V=(0,r.useRef)(""),z=(0,r.useRef)(null),G=()=>{z.current&&(clearInterval(z.current),z.current=null)},H=e=>{G(),W(e),z.current=setInterval(()=>{W(e=>e<=1?(G(),0):e-1)},1e3)},M=()=>{g.loginFlow.markCodeSent(),H(30)};(0,r.useEffect)(()=>()=>G(),[]),(0,r.useEffect)(()=>{let e=g.loginFlow.getPendingToken();if(e){U.current=e,O("verify");let t=g.loginFlow.getCodeCooldownRemaining();t>0&&H(t)}},[]);let Q=async t=>{if(t.preventDefault(),F(""),!S||!w)return void F("ÐаполниÑе вÑе полÑ");P(!0);try{let t=await (0,h.getFingerprint)();V.current=t??"";let r=await (0,d.api)("/auth/login",{method:"POST",body:JSON.stringify({login:S,password:w,...t?{fingerprint:t}:{}})});if("requiresDeviceVerification"in r&&r.requiresDeviceVerification){U.current=r.pendingToken,g.loginFlow.setPendingToken(r.pendingToken),B(""),I(!1),O("verify"),M();return}(0,m.setCsrfToken)(r.csrfToken),t&&(0,h.storeFingerprintAfterLogin)(t),(0,m.clearLegacyAuthCookie)(),g.loginFlow.clearPendingToken();let n=b.get("redirect");e.push(n&&n.startsWith("/")&&!n.startsWith("//")?n:"/dashboard")}catch(e){F(e instanceof Error?e.message:"ÐÑибка авÑоÑизаÑии")}finally{P(!1)}},X=async()=>{K(!0),F(""),I(!1);try{await (0,d.api)("/auth/resend-device-code",{method:"POST",body:JSON.stringify({pendingToken:U.current})}),M()}catch(e){F(e instanceof Error?e.message:"ÐÑибка оÑпÑавки кода")}finally{K(!1)}},Y=async t=>{if(!A&&!(t.length<6)){F(""),I(!1),P(!0);try{let r=await (0,d.api)("/auth/verify-device",{method:"POST",body:JSON.stringify({pendingToken:U.current,code:t.trim().toUpperCase()})});(0,m.setCsrfToken)(r.csrfToken),V.current&&(0,h.storeFingerprintAfterLogin)(V.current),(0,m.clearLegacyAuthCookie)(),g.loginFlow.clearPendingToken();let n=b.get("redirect");e.push(n&&n.startsWith("/")&&!n.startsWith("//")?n:"/dashboard")}catch(e){I(!0),F(e instanceof Error?e.message:"ÐевеÑнÑй или пÑоÑÑоÑеннÑй код")}finally{P(!1)}}},Z=async e=>{e.preventDefault(),await Y(L)},{title:$}=N[R];return(0,t.jsxs)(p.AuthForm,{stepKey:R,direction:E,title:$,subtitle:"verify"===R?(0,t.jsx)(o.AuthCodeEmailSubtitle,{email:S,prefix:"Ðод оÑпÑавлен в Telegram или на поÑÑÑ"}):void 0,children:[k&&!D&&(0,t.jsx)(l.AuthErrorBanner,{children:k}),"login"===R&&(0,t.jsxs)("form",{onSubmit:Q,className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsx)("label",{htmlFor:"login",className:y,children:"ТелеÑон или email"}),(0,t.jsx)(i.AuthInput,{id:"login",type:"text",autoComplete:"username",placeholder:"+7 900 123-45-67 или [email protected]",value:S,onChange:e=>C(e.target.value),required:!0,autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsx)("label",{htmlFor:"password",className:y,children:"ÐаÑолÑ"}),(0,t.jsx)(a.PasswordInput,{id:"password",variant:"auth",placeholder:"ÐведиÑе паÑолÑ",value:w,onChange:e=>T(e.target.value),required:!0})]}),(0,t.jsxs)(c.Button,{type:"submit",className:j,disabled:A,children:[A&&(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"ÐойÑи"]}),(0,t.jsxs)("div",{className:x.authFooterClassName,children:[(0,t.jsxs)(n.default,{href:"/forgot-password",className:"group block text-muted-foreground no-underline hover:no-underline",children:[(0,t.jsx)("span",{className:"transition-colors group-hover:text-foreground",children:"ÐабÑли паÑолÑ?"})," ",(0,t.jsx)("span",{className:"font-medium text-primary transition-colors group-hover:text-primary/80",children:"ÐоÑÑÑановиÑÑ"})]}),(0,t.jsxs)(n.default,{href:"/register",className:"group block text-muted-foreground no-underline hover:no-underline",children:[(0,t.jsx)("span",{className:"transition-colors group-hover:text-foreground",children:"ÐÑÑ Ð½Ðµ заÑегиÑÑÑиÑованÑ?"})," ",(0,t.jsx)("span",{className:"font-medium text-primary transition-colors group-hover:text-primary/80",children:"ÐаÑегиÑÑÑиÑÑйÑеÑÑ!"})]})]})]}),"verify"===R&&(0,t.jsxs)("form",{onSubmit:Z,className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(o.AuthCodeInput,{id:"device-code",value:L,onChange:e=>{B(e),I(!1),F("")},onComplete:e=>void Y(e),mode:"numeric",autoFocus:!0,error:D,disabled:A}),D&&(0,t.jsx)("p",{className:"text-center text-sm text-destructive",children:k||"ÐевеÑнÑй или пÑоÑÑоÑеннÑй код"}),(0,t.jsx)("p",{className:"text-center text-sm leading-relaxed text-muted-foreground sm:text-[15px]",children:"Ðод дейÑÑвиÑелен 10 минÑÑ"}),(0,t.jsx)(o.AuthCodeResend,{cooldown:q,loading:J,onResend:()=>void X()})]}),(0,t.jsxs)(c.Button,{type:"submit",className:j,disabled:A||L.length<6,children:[A&&(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"ÐодÑвеÑдиÑÑ"]}),(0,t.jsx)("button",{type:"button",onClick:()=>{O("login"),B(""),I(!1),F(""),U.current="",g.loginFlow.clearPendingToken(),G(),W(0)},className:"w-full text-center text-base text-muted-foreground transition-colors hover:text-foreground",children:"â ÐеÑнÑÑÑÑÑ Ð½Ð°Ð·Ð°Ð´"})]})]})}e.s(["default",0,function(){return(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(b,{})})}])}]); 3 4//# debugId=051aeded-b8bc-2d90-2cdb-29586effba8b
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.