System.register(["./index-legacy-b5b2d9a0.js","./dialog-legacy-11ce4a25.js","./overlay-legacy-29ae26a6.js","./button-legacy-47e2d618.js","./input-legacy-ca2d7044.js","./QrCodePreview-legacy-c7e3d742.js","./request-legacy-6e7b4fe0.js","./vue3-clipboard.esm-legacy-e37b8e98.js","./qrcode-legacy-4ef391ab.js"],(function(e,t){"use strict";var n,l,o,u,a,c,i,r,s,d,f,v,g,y,m,p,b,j,h,_;return{setters:[function(e){n=e.r,l=e.y,o=e.o,u=e.g,a=e.w,c=e.a,i=e.h,r=e.f,s=e.t,d=e.j,f=e.m,v=e.S},function(e){g=e.E},null,function(e){y=e.E},null,function(e){m=e._},function(e){p=e.e,b=e.E,j=e.a},function(e){h=e.t},function(e){_=e.g}],execute:function(){var t=e("v",(function(e){return p({url:"/admin/2fa/verify",method:"post",data:e})})),x={class:"text-center"},w=c("div",null,"可使用双因素认证软件扫描下方二维码或复制下方密钥到软件中添加。",-1),q={class:"flex justify-between space-x-2"},S=e("_",{__name:"two-fa-dialog",props:{visible:{type:Boolean,required:!0}},emits:["close"],setup:function(e,S){var V=S.emit,C=e,k=n(C.visible),E=n(!1),L=n(!1);l((function(){return C.visible}),(function(e){k.value=e,e&&(E.value=!1,P())}));var M=function(){E.value||V("close","")},O=n({}),P=function(){p({url:"/admin/2fa/setup",method:"get"}).then((function(e){O.value=e.data,O.value.svg=_({text:O.value.qrcode,correctLevel:1,isSpace:!1},v.rendererRect)}))},U=function(){L.value=!0,t(O.value).then((function(){b.success("绑定成功"),E.value=!0,V("close",O.value.secret)})).finally((function(){L.value=!1}))},z=function(){h(O.value.secret).then((function(){b.success("复制成功")}))};return function(e,t){var n=j,l=y,v=g;return o(),u(v,{"append-to-body":"",modelValue:r(k),"onUpdate:modelValue":t[1]||(t[1]=function(e){return f(k)?k.value=e:null}),"destroy-on-close":!0,onClose:M,title:"绑定双因素认证",draggable:"",top:"5vh",width:"30%"},{default:a((function(){var e,o;return[c("div",x,[w,i(m,{class:"block my-4 mx-auto w-56 h-56",onClick:P,src:null===(e=r(O))||void 0===e?void 0:e.svg,alt:null===(o=r(O))||void 0===o?void 0:o.qrcode,filename:"two-fa-qrcode.png"},null,8,["src","alt"]),c("div",{onClick:z,class:"text-gray-300 mb-4"},s(r(O).secret),1),c("div",q,[i(n,{modelValue:r(O).code,"onUpdate:modelValue":t[0]||(t[0]=function(e){return r(O).code=e}),placeholder:"请绑定双因素认证软件后，输入显示的验证码。"},null,8,["modelValue"]),i(l,{loading:r(L),type:"primary",onClick:U},{default:a((function(){return[d("验证并绑定")]})),_:1},8,["loading"])])])]})),_:1},8,["modelValue"])}}}),V=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}));e("t",V)}}}));
