1import{r as u,T as F,o,a as s,b as t,u as n,w as c,F as b,Z as A,d as e,E as w,h as _,e as d,M as V,g as $,t as K,O as x}from"./app-DUib0Qv3.js";import{A as L}from"./AuthenticationCard-Dq-wZ4GZ.js";import{_ as M}from"./AuthenticationCardLogo-CTvT5b2d.js";import{_ as B}from"./ConfirmsPassword-CgzVyqRy.js";import{_ as H}from"./InputError-BSd8XfaU.js";import{_ as N}from"./InputLabel-B3ftoatH.js";import{_ as v}from"./PrimaryButton-DOzGO8yK.js";import{_ as j}from"./TextInput-BZUB-51i.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DialogModal-DWm3sN_G.js";import"./Modal-DUmzMtWi.js";import"./bundle-mjs-3VKOpVsw.js";import"./SecondaryButton-CJuwHSrZ.js";import"./index-BQ89ja3J.js";const E={key:0},q=e("div",{class:"mb-4 text-sm text-gray-600"}," For your security, you must enable two-factor authentication before continuing. This adds an extra layer of protection to your account using an authenticator app. ",-1),D={class:"flex items-center justify-end mt-4"},O={key:1},Q=e("div",{class:"mb-4 text-sm text-gray-600"},[e("p",{class:"font-semibold"}," Scan the following QR code using your phone's authenticator application (e.g. Google Authenticator), or enter the setup key manually. Then provide the generated code below. ")],-1),R=["innerHTML"],U={key:1,class:"mt-4 text-sm text-gray-600"},z={class:"font-semibold"},G=["innerHTML"],P={class:"mt-4"},Z={class:"flex items-center justify-end mt-4"},I={key:2},J=e("div",{class:"mb-4 text-sm text-gray-600"},[e("p",{class:"font-semibold"}," Two-factor authentication is now enabled. Store these recovery codes in a secure password manager. They can be used to recover access to your account if your authenticator device is lost. ")],-1),W={class:"grid gap-1 px-4 py-4 font-mono text-sm bg-gray-100 rounded-lg"},X={class:"flex items-center justify-end mt-4"},_e={__name:"SetupTwoFactor",setup(Y){const i=u(1),m=u(!1),f=u(null),h=u(null),y=u([]),r=F({code:""}),T=()=>axios.get(route("two-factor.qr-code")).then(a=>{f.value=a.data.svg}),k=()=>axios.get(route("two-factor.secret-key")).then(a=>{h.value=a.data.secretKey}),C=()=>axios.get(route("two-factor.recovery-codes")).then(a=>{y.value=a.data}),S=()=>{m.value=!0,x.post(route("two-factor.enable"),{},{preserveScroll:!0,onSuccess:()=>Promise.all([T().catch(()=>{}),k().catch(()=>{}),C().catch(()=>{})]).then(()=>{i.value=2}),onFinish:()=>{m.value=!1}})},g=()=>{r.post(route("two-factor.confirm"),{errorBag:"confirmTwoFactorAuthentication",preserveScroll:!0,preserveState:!0,onSuccess:()=>{i.value=3}})};return(a,p)=>(o(),s(b,null,[t(n(A),{title:"Set Up Two-Factor Authentication"}),t(L,null,{logo:c(()=>[t(M)]),default:c(()=>[i.value===1?(o(),s("div",E,[q,e("div",D,[t(B,{onConfirmed:S},{default:c(()=>[t(v,{type:"button",class:w({"opacity-25":m.value}),disabled:m.value},{default:c(()=>[_(" Enable Two-Factor Authentication ")]),_:1},8,["class","disabled"])]),_:1})])])):d("",!0),i.value===2?(o(),s("div",O,[Q,f.value?(o(),s("div",{key:0,class:"inline-block p-2 bg-white",innerHTML:f.value},null,8,R)):d("",!0),h.value?(o(),s("div",U,[e("p",z,[_(" Setup Key: "),e("span",{innerHTML:h.value},null,8,G)])])):d("",!0),e("div",P,[t(N,{for:"code",value:"Code"}),t(j,{id:"code",modelValue:n(r).code,"onUpdate:modelValue":p[0]||(p[0]=l=>n(r).code=l),type:"text",class:"block w-full mt-1",inputmode:"numeric",autofocus:"",autocomplete:"one-time-code",onKeyup:V(g,["enter"])},null,8,["modelValue"]),t(H,{message:n(r).errors.code,class:"mt-2"},null,8,["message"])]),e("div",Z,[t(v,{onClick:g,class:w({"opacity-25":n(r).processing}),disabled:n(r).processing},{default:c(()=>[_(" Confirm ")]),_:1},8,["class","disabled"])])])):d("",!0),i.value===3?(o(),s("div",I,[J,e("div",W,[(o(!0),s(b,null,$(y.value,l=>(o(),s("div",{key:l},K(l),1))),128))]),e("div",X,[t(v,{onClick:p[1]||(p[1]=l=>n(x).visit(a.route("dashboard")))},{default:c(()=>[_(" Continue to Dashboard ")]),_:1})])])):d("",!0)]),_:1})],64))}};export{_e 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.