1import{u as x,r as s,G as b,a as c,j as t,S as C}from"./app.d2295994.js";import{c as N}from"./index.893e1e4b.js";import{A as R}from"./AuthenticationCard.e278747a.js";import{I as m}from"./InputLabel.e6d91251.js";import{P as T}from"./PrimaryButton.ca1152bb.js";import{T as f}from"./TextInput.148121ec.js";import{I as y}from"./InputError.64097cc0.js";import{u as _}from"./useTranslation.762908c6.js";import"./logo-imbranet.4ab61639.js";function L(){const{t:r}=_(),p=x(),[a,v]=s.exports.useState(!1),e=b({code:"",recovery_code:""}),n=s.exports.useRef(null),i=s.exports.useRef(null);function g(o){o.preventDefault();const u=!a;v(u),setTimeout(()=>{var l,d;u?((l=n.current)==null||l.focus(),e.setData("code","")):((d=i.current)==null||d.focus(),e.setData("recovery_code",""))},100)}function h(o){o.preventDefault(),e.post(p("two-factor.login"))}return s.exports.useEffect(()=>{document.documentElement.classList.add("dark")},[]),c(R,{children:[t(C,{title:r("Two-Factor Confirmation")}),t("div",{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:r(a?"Please confirm access to your account by entering one of your emergency recovery codes.":"Please confirm access to your account by entering the authentication code provided by your authenticator application.")}),c("form",{onSubmit:h,children:[a?c("div",{children:[t(m,{htmlFor:"recovery_code",children:r("Recovery Code")}),t(f,{id:"recovery_code",type:"text",className:"mt-1 block w-full",value:e.data.recovery_code,onChange:o=>e.setData("recovery_code",o.currentTarget.value),ref:n,autoComplete:"one-time-code"}),t(y,{className:"mt-2",message:e.errors.recovery_code})]}):c("div",{children:[t(m,{htmlFor:"code",children:r("Code")}),t(f,{id:"code",type:"text",inputMode:"numeric",className:"mt-1 block w-full",value:e.data.code,onChange:o=>e.setData("code",o.currentTarget.value),autoFocus:!0,autoComplete:"one-time-code",ref:i}),t(y,{className:"mt-2",message:e.errors.code})]}),c("div",{className:"mt-4 flex items-center justify-end",children:[t("button",{type:"button",className:"cursor-pointer text-sm text-gray-600 underline hover:text-gray-900 dark:text-gray-400",onClick:g,children:a?"Use an authentication code":"Use a recovery code"}),t(T,{className:N("ml-4",{"opacity-25":e.processing}),disabled:e.processing,children:r("Log in")})]})]})]})}export{L as default};
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.