import{c as C,r as y,j as t,F as S,H as N}from"./app-BiexncSX.js";import{I as F,K as O,O as j,a as w,b as A}from"./use-two-factor-auth-BHnUcje3.js";import{B as R}from"./button-Cwvd_D5X.js";import{I as P}from"./input-C7geQw3H.js";import{A as k}from"./auth-layout-c0K9oGz2.js";import{s as H}from"./index-Drs7entj.js";import{I as _}from"./input-error-BizLhD6E.js";/* empty css            */import"./utils-DvRnx1Xn.js";import"./minus-BQGRvjuE.js";import"./createLucideIcon-CiyItOCI.js";import"./index-DDBh_SM-.js";function V(){const e=C.c(18),[o,v]=y.useState(!1),[d,h]=y.useState("");let p;e:{if(o){let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={title:"Recovery Code",description:"Please confirm access to your account by entering one of your emergency recovery codes.",toggleText:"login using an authentication code"},e[0]=n):n=e[0],p=n;break e}let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={title:"Authentication Code",description:"Enter the authentication code provided by your authenticator application.",toggleText:"login using a recovery code"},e[1]=s):s=e[1],p=s}const r=p;let a;e[2]!==o?(a=s=>{v(!o),s(),h("")},e[2]=o,e[3]=a):a=e[3];const f=a,b=r.title,T=r.description;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(N,{title:"Two-Factor Authentication"}),e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=H.form(),e[5]=u):u=e[5];const x=!o;let c;e[6]!==r.toggleText||e[7]!==d||e[8]!==o||e[9]!==f?(c=s=>{const{errors:n,processing:g,clearErrors:E}=s;return t.jsxs(t.Fragment,{children:[o?t.jsxs(t.Fragment,{children:[t.jsx(P,{name:"recovery_code",type:"text",placeholder:"Enter recovery code",autoFocus:o,required:!0}),t.jsx(_,{message:n.recovery_code})]}):t.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 text-center",children:[t.jsx("div",{className:"flex w-full items-center justify-center",children:t.jsx(F,{name:"code",maxLength:j,value:d,onChange:I=>h(I),disabled:g,pattern:O,children:t.jsx(w,{children:Array.from({length:j},L)})})}),t.jsx(_,{message:n.code})]}),t.jsx(R,{type:"submit",className:"w-full",disabled:g,children:"Continue"}),t.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:[t.jsx("span",{children:"or you can "}),t.jsx("button",{type:"button",className:"cursor-pointer text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",onClick:()=>f(E),children:r.toggleText})]})]})},e[6]=r.toggleText,e[7]=d,e[8]=o,e[9]=f,e[10]=c):c=e[10];let i;e[11]!==x||e[12]!==c?(i=t.jsx("div",{className:"space-y-6",children:t.jsx(S,{...u,className:"space-y-4",resetOnError:!0,resetOnSuccess:x,children:c})}),e[11]=x,e[12]=c,e[13]=i):i=e[13];let m;return e[14]!==r.description||e[15]!==r.title||e[16]!==i?(m=t.jsxs(k,{title:b,description:T,children:[l,i]}),e[14]=r.description,e[15]=r.title,e[16]=i,e[17]=m):m=e[17],m}function L(e,o){return t.jsx(A,{index:o},o)}export{V as default};
