Spaces:
Sleeping
Sleeping
| import{g as A,C as ts,h as a,d as ss,D as os,i as G,o as rs,s as ls,j as ns,c as l,a as s,x as H,y as Re,m as L,v as $,A as Ct,t as n,n as g,u as R,b as x,f as J,F as ge,r as Ve,T as Me,w as V,e as r,E as as}from"./index-BRg_yWJl.js";import{_ as is}from"./SelectMenu.vue_vue_type_script_setup_true_lang-DswSmh70.js";import{_ as be}from"./Checkbox.vue_vue_type_script_setup_true_lang-CRAgcaHj.js";import{_ as ds}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-CZswS7RJ.js";import{u as us}from"./useConfirmDialog-Ds3wJrfU.js";import{_ as cs}from"./HelpTip.vue_vue_type_script_setup_true_lang-D8gzoJNA.js";const w={list:()=>A.get("/admin/accounts"),getConfig:()=>A.get("/admin/accounts-config"),updateConfig:b=>A.put("/admin/accounts-config",b),delete:b=>A.delete(`/admin/accounts/${b}`),disable:b=>A.put(`/admin/accounts/${b}/disable`),enable:b=>A.put(`/admin/accounts/${b}/enable`),startRegister:(b,h)=>A.post("/admin/register/start",{count:b,domain:h}),getRegisterTask:b=>A.get(`/admin/register/task/${b}`),getRegisterCurrent:()=>A.get("/admin/register/current"),startLogin:b=>A.post("/admin/login/start",b),getLoginTask:b=>A.get(`/admin/login/task/${b}`),getLoginCurrent:()=>A.get("/admin/login/current"),checkLogin:()=>A.post("/admin/login/check")},fs=ts("accounts",()=>{const b=a([]),h=a(!1);async function I(){h.value=!0;try{const u=await w.list();b.value=Array.isArray(u)?u:u.accounts||[]}finally{h.value=!1}}async function le(u){await w.delete(u),await I()}async function C(u){await w.disable(u),await I()}async function ne(u){await w.enable(u),await I()}async function ee(u){await Promise.all(u.map(M=>w.enable(M))),await I()}async function m(u){await Promise.all(u.map(M=>w.disable(M))),await I()}async function Y(u){await Promise.all(u.map(M=>w.delete(M))),await I()}async function ae(u){await w.updateConfig(u),await I()}return{accounts:b,isLoading:h,loadAccounts:I,deleteAccount:le,disableAccount:C,enableAccount:ne,bulkEnable:ee,bulkDisable:m,bulkDelete:Y,updateConfig:ae}}),vs={class:"space-y-8"},ps={class:"rounded-3xl border border-border bg-card p-6"},xs={class:"flex flex-wrap items-center justify-between gap-4"},ms={class:"grid w-full grid-cols-2 gap-3 sm:flex sm:w-auto sm:items-center"},gs={class:"flex w-full flex-wrap items-center gap-3 text-xs text-muted-foreground sm:w-auto sm:flex-nowrap"},bs={class:"ml-auto flex items-center gap-2 sm:ml-0"},ys={class:"mt-4 flex flex-wrap items-center gap-2"},_s=["disabled"],ws=["disabled"],hs={key:0,class:"absolute right-0 z-10 mt-2 w-full space-y-1 rounded-2xl border border-border bg-card p-2 shadow-lg"},ks=["disabled"],Cs=["disabled"],Ts=["disabled"],Ss=["disabled"],As=["disabled"],Es={key:0,class:"mt-6 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},Is=["onClick"],Ls={class:"flex items-start justify-between gap-3"},$s={class:"mt-1 font-mono text-xs text-foreground"},Rs={class:"flex items-center gap-2"},Vs={class:"mt-4 grid grid-cols-2 gap-3 text-xs text-muted-foreground"},Ms={key:0,class:"mt-1 text-[11px]"},js={key:0},Ds={key:1},Os={class:"mt-1 text-sm font-semibold text-foreground"},Bs={class:"mt-1 text-sm font-semibold text-foreground"},Ns={class:"mt-4 flex flex-wrap items-center gap-2"},Us=["onClick"],zs=["onClick"],Ps=["onClick"],Fs=["onClick"],Ks={key:0,class:"rounded-2xl border border-border bg-background p-4 text-center text-xs text-muted-foreground"},Gs={key:1,class:"relative mt-6 overflow-x-auto overflow-y-visible"},Hs={class:"min-w-full text-left text-sm"},Js={class:"text-xs uppercase tracking-[0.2em] text-muted-foreground"},Ys={class:"py-3 pr-4"},Qs={class:"py-3 pr-6"},qs={class:"inline-flex items-center gap-2"},Ws={class:"text-sm text-foreground"},Xs={key:0},Zs=["onClick"],eo={class:"py-4 pr-6 font-mono text-xs text-foreground"},to={class:"py-4 pr-6"},so={class:"py-4 pr-6"},oo={key:0,class:"block text-[11px] text-muted-foreground"},ro={class:"py-4 pr-6 text-xs"},lo={class:"py-4 pr-6 text-xs text-muted-foreground"},no={class:"py-4 pr-6 text-xs text-muted-foreground"},ao={class:"py-4 text-right"},io={class:"flex flex-wrap justify-end gap-2"},uo=["onClick"],co=["onClick"],fo=["onClick"],vo=["onClick"],po={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},xo={class:"flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-3xl border border-border bg-card shadow-xl"},mo={class:"flex items-center justify-between border-b border-border/60 px-6 py-4"},go={class:"mt-1 text-xs text-muted-foreground"},bo={class:"scrollbar-slim flex-1 overflow-y-auto px-6 py-4"},yo={class:"space-y-4 text-sm"},_o={class:"flex rounded-full border border-border bg-muted/30 p-1 text-xs"},wo={key:0,class:"space-y-4"},ho={key:1,class:"space-y-4"},ko={key:0,class:"rounded-2xl border border-rose-200 bg-rose-50 px-3 py-2 text-xs text-rose-600"},Co={class:"border-t border-border/60 px-6 py-4"},To={class:"flex items-center justify-end gap-2"},So=["disabled"],Ao=["disabled"],Eo={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Io={class:"flex h-[80vh] w-full max-w-2xl flex-col overflow-hidden rounded-3xl border border-border bg-card shadow-xl"},Lo={class:"flex items-center justify-between border-b border-border/60 px-6 py-4"},$o={class:"flex items-center gap-2"},Ro=["disabled"],Vo={class:"flex min-h-0 flex-1 flex-col px-6 py-4"},Mo={key:0,class:"rounded-2xl bg-destructive/10 px-3 py-2 text-xs text-destructive"},jo={key:1,class:"grid gap-3 text-xs text-muted-foreground"},Do={key:0,class:"space-y-1"},Oo={class:"flex flex-wrap gap-x-4 gap-y-1"},Bo={key:1,class:"space-y-1"},No={class:"flex flex-wrap gap-x-4 gap-y-1"},Uo={key:2,class:"mt-4 flex min-h-0 flex-1 flex-col"},zo={key:0,class:"space-y-2"},Po={class:"space-y-1 text-[11px] text-muted-foreground"},Fo={key:1,class:"mt-4 space-y-2"},Ko={class:"space-y-1 text-[11px] text-muted-foreground"},Go={key:3,class:"mt-4 rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"},Ho={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Jo={class:"w-full max-w-lg rounded-3xl border border-border bg-card p-6 shadow-xl"},Yo={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},Qo={class:"mt-4 space-y-3 text-sm"},qo={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Wo={class:"w-full max-w-3xl rounded-3xl border border-border bg-card p-6 shadow-xl"},Xo={class:"flex items-center justify-between"},Zo={class:"flex items-center gap-2"},er={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},tr={class:"mt-4"},sr=["readonly"],or={class:"mt-6 flex items-center justify-end gap-2"},rr=["disabled"],Ke="accounts-register-task-cache",Ge="accounts-login-task-cache",He="accounts-register-log-clear",Je="accounts-login-log-clear",Ye="accounts-register-task-cleared-id",Qe="accounts-login-task-cleared-id",Tt="1970-01-01 00:00:00",cr=ss({__name:"Accounts",setup(b){const h=fs(),{accounts:I,isLoading:le}=os(h),C=us(),ne=a(""),ee=a("all"),m=a(new Set),Y=a("table"),ae=a(!1),u=a(""),M=a(!1),j=a(""),te=a(""),B=a(!1),ie=a([]),de=a(1),ye=a(!1),N=a("register"),ue=a(""),U=a(""),_e=a(!1),Q=a(!1),z=a(!1),je=a(null),we=a(null),he=a(null),P=a(null),F=a(null),se=a(0),oe=a(0),ce=a(!1),c=a(null),f=a(null),qe=a(null),D=a(!1),T=a(!1),y=a(""),_=a({id:"",secure_c_ses:"",csesidx:"",config_id:"",host_c_oses:"",expires_at:""}),ke=a(null),We=a([]),St=[{label:"全部状态",value:"all"},{label:"正常",value:"正常"},{label:"即将过期",value:"即将过期"},{label:"已过期",value:"已过期"},{label:"手动禁用",value:"手动禁用"},{label:"错误禁用",value:"错误禁用"},{label:"429限流",value:"429限流"}],K=G(()=>{const e=ne.value.trim().toLowerCase();return I.value.filter(t=>{const o=!e||t.id.toLowerCase().includes(e),i=ee.value==="all"||ve(t)===ee.value;return o&&i})}),O=G(()=>m.value.size),De=G(()=>K.value.length>0&&K.value.every(e=>m.value.has(e.id))),fe=async()=>{await h.loadAccounts(),m.value=new Set,z.value=!1},Xe=e=>{try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}},Ze=e=>{try{return localStorage.getItem(e)||null}catch{return null}},Ce=(e,t)=>{try{if(t){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{}},et=(e,t)=>{try{localStorage.setItem(e,JSON.stringify(t))}catch{}},tt=e=>{try{localStorage.removeItem(e)}catch{}},st=e=>{const t=localStorage.getItem(e),o=Number(t);return Number.isFinite(o)?o:0},Te=(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},Oe=(e,t=!0)=>{e&&(e.id&&e.id===P.value||(e.id&&P.value&&e.id!==P.value&&(P.value=null,Ce(Ye,null)),c.value=e,e.id&&e.id!==we.value&&(we.value=e.id,se.value=0,Te(He,0)),t&&et(Ke,e)))},Se=(e,t=!0)=>{e&&(e.id&&e.id===F.value||(e.id&&F.value&&e.id!==F.value&&(F.value=null,Ce(Qe,null)),f.value=e,e.id&&e.id!==he.value&&(he.value=e.id,oe.value=0,Te(Je,0)),t&&et(Ge,e)))},At=()=>{se.value=st(He),oe.value=st(Je),P.value=Ze(Ye),F.value=Ze(Qe);const e=Xe(Ke);e&&e.id!==P.value&&(c.value=e,we.value=e.id||null);const t=Xe(Ge);t&&t.id!==F.value&&(f.value=t,he.value=t.id||null)},Et=()=>{ye.value=!0,N.value="register",ue.value="",U.value="",_e.value=!1,ce.value=!1},Be=()=>{ye.value=!1},It=e=>{const t=[],o=[];return e.split(/\r?\n/).map(d=>d.trim()).filter(Boolean).forEach((d,p)=>{const v=d.split("----").map(S=>S.trim()),k=p+1;if(v.length){if(v[0].toLowerCase()==="duckmail"){if(v.length<3||!v[1]||!v[2]){o.push(`第 ${k} 行格式错误(duckmail)`);return}const S=v[1],$e=v.slice(2).join("----");t.push({id:S,secure_c_ses:"",csesidx:"",config_id:"",expires_at:Tt,mail_provider:"duckmail",mail_address:S,mail_password:$e});return}if(v.length>=4&&v[0]&&v[2]&&v[3]){const S=v[0],$e=v[1]||"",E=v[2],es=v.slice(3).join("----");t.push({id:S,secure_c_ses:"",csesidx:"",config_id:"",expires_at:Tt,mail_provider:"microsoft",mail_address:S,mail_password:$e,mail_client_id:E,mail_refresh_token:es,mail_tenant:"consumers"});return}o.push(`第 ${k} 行格式错误`)}}),{items:t,errors:o}},Lt=async()=>{if(U.value="",!ue.value.trim()){U.value="请输入导入内容";return}const{items:e,errors:t}=It(ue.value);if(!e.length){U.value=t.length?t.join(","):"未识别到有效账号";return}if(t.length){U.value=t.slice(0,3).join(",");return}_e.value=!0;try{const i=[...await ct()],d=new Map(i.map((k,S)=>[k.id,S])),p=[];e.forEach(k=>{const S=d.get(k.id||"");if(S===void 0){i.push(k),p.push(k.id);return}const E={...i[S],mail_provider:k.mail_provider,mail_address:k.mail_address};k.mail_provider==="microsoft"?(E.mail_client_id=k.mail_client_id,E.mail_refresh_token=k.mail_refresh_token,E.mail_tenant=k.mail_tenant,E.mail_password=k.mail_password):(E.mail_password=k.mail_password,E.mail_client_id=void 0,E.mail_refresh_token=void 0,E.mail_tenant=void 0),i[S]=E,p.push(k.id)}),await h.updateConfig(i),await fe(),m.value=new Set(p),Be(),await C.ask({title:"导入成功",message:`已导入 ${p.length} 个账户并自动选中。是否立即刷新这些账户以获取 Cookie?`,confirmText:"立即刷新",cancelText:"稍后手动刷新"})&&await kt()}catch(o){U.value=o.message||"导入失败"}finally{_e.value=!1}},$t=async()=>{try{const e=[],t=c.value?.id,o=f.value?.id;if(t&&!Ae(t)&&e.push(_t(t)),o&&!Ee(o)&&e.push(wt(o)),!e.length){await Fe();return}await Promise.all(e)}catch(e){y.value=e?.message||"任务状态更新失败"}},Rt=async()=>{Q.value=!0,await $t()},Vt=()=>{Q.value=!1},Mt=()=>{const e=c.value?.id||null,t=f.value?.id||null;P.value=e,F.value=t,Ce(Ye,e),Ce(Qe,t),se.value=c.value?.logs?.length||0,oe.value=f.value?.logs?.length||0,Te(He,se.value),Te(Je,oe.value),c.value=null,f.value=null,we.value=null,he.value=null,y.value="",D.value=!1,T.value=!1,X(),Z(),tt(Ke),tt(Ge)},Ae=e=>!!(e&&e===P.value),Ee=e=>!!(e&&e===F.value),jt=()=>{z.value=!z.value},re=()=>{z.value=!1},ot=e=>{if(!z.value)return;const t=e.target;je.value&&!je.value.contains(t)&&(z.value=!1)};rs(async()=>{At(),await fe(),await Fe(),Wt(),document.addEventListener("click",ot)});const q=G(()=>{const e=c.value?.logs||[];return se.value?e.slice(se.value):e}),W=G(()=>{const e=f.value?.logs||[];return oe.value?e.slice(oe.value):e}),Dt=G(()=>!!y.value||!!c.value||!!f.value||q.value.length>0||W.value.length>0),Ot=async()=>{await as();const e=qe.value;e&&(e.scrollTop=e.scrollHeight)};ls([q,W,Q],async()=>{Q.value&&await Ot()},{deep:!0});const Bt=G(()=>{const e=c.value?.status,t=f.value?.status;return e==="running"||e==="pending"||t==="running"||t==="pending"}),Nt=G(()=>{if(y.value)return"bg-rose-500";if(Bt.value)return"bg-sky-400";const e=[];if(c.value){const d=c.value.success_count??0,p=c.value.fail_count??0,v=c.value.count??d+p;e.push({success:d,fail:p,total:v,status:c.value.status})}if(f.value){const d=f.value.success_count??0,p=f.value.fail_count??0,v=f.value.account_ids?.length??d+p;e.push({success:d,fail:p,total:v,status:f.value.status})}if(!e.length)return"bg-muted-foreground";const t=e.reduce((d,p)=>d+p.success,0),o=e.reduce((d,p)=>d+p.fail,0),i=e.reduce((d,p)=>d+(p.total||0),0);if(t>0&&o>0)return"bg-amber-400";if(o>0&&t===0)return"bg-rose-500";if(t>0&&o===0)return"bg-emerald-400";if(i===0){const d=e.every(v=>v.status==="success");if(e.some(v=>v.status==="failed"))return"bg-rose-500";if(d)return"bg-emerald-400"}return"bg-muted-foreground"});ns(()=>{X(),Z(),qt(),document.removeEventListener("click",ot)});const ve=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?"429限流":e.cooldown_reason==="错误禁用"?"错误禁用":e.disabled?"手动禁用":e.status==="已过期"?"已过期":e.status==="即将过期"?"即将过期":"正常",rt=e=>{const t=ve(e);return t==="429限流"||t==="即将过期"?"bg-amber-200 text-amber-900":t==="错误禁用"||t==="已过期"?"bg-destructive/10 text-destructive":t==="手动禁用"?"bg-muted text-muted-foreground":"bg-emerald-500 text-white"},lt=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?!0:e.disabled||e.cooldown_reason==="错误禁用",nt=e=>e==="已过期"?"过期":e==="未设置"?"未设置":e,at=e=>e.status==="已过期"?"text-rose-600":e.status==="即将过期"?"text-amber-700":e.status==="未设置"?"text-muted-foreground":"text-emerald-600",it=e=>e<60?`${e} 秒`:e<3600?`${Math.ceil(e/60)} 分钟`:`${(e/3600).toFixed(1)} 小时`,Ne=e=>e.cooldown_seconds>0?"text-amber-700":e.cooldown_reason==="错误禁用"?"text-rose-600":"text-muted-foreground",dt=e=>{const t=ve(e);return t==="手动禁用"||t==="已过期"?"bg-muted/70":""},Ie=e=>{const t=new Set(m.value);t.has(e)?t.delete(e):t.add(e),m.value=t},ut=()=>{if(De.value){m.value=new Set;return}m.value=new Set(K.value.map(e=>e.id))},Ut=(e,t)=>e.id||`account_${t+1}`,ct=async()=>(await w.getConfig()).accounts.map((t,o)=>({...t,id:Ut(t,o)})),ft=e=>`${e.time} [${e.level}] ${e.message}`,zt=(e,t)=>{let o=-1;for(let d=0;d<e.length;d+=1)if(e[d].id===t){o=d;break}if(o===-1)return u.value="未找到对应账号配置。",!1;const i=e[o];return _.value={id:i.id,secure_c_ses:i.secure_c_ses,csesidx:i.csesidx,config_id:i.config_id,host_c_oses:i.host_c_oses,expires_at:i.expires_at},We.value=e,ke.value=o,ae.value=!0,!0},vt=async e=>{u.value="";try{const t=await ct();zt(t,e)}catch(t){u.value=t.message||"加载账号配置失败"}},Pt=async()=>{j.value="";try{const e=await w.getConfig();ie.value=Array.isArray(e.accounts)?e.accounts:[],te.value=JSON.stringify(xt(ie.value),null,2),B.value=!0,M.value=!0}catch(e){j.value=e.message||"加载账号配置失败"}},Ue=()=>{M.value=!1,j.value="",B.value=!1},pt=()=>{const e=JSON.parse(te.value);if(!Array.isArray(e))throw new Error("配置格式必须是数组。");return e},Ft=e=>typeof e!="string"||!e?e:e.length<=6?`${e.slice(0,2)}****`:`${e.slice(0,3)}****`,xt=e=>{const t=new Set(["secure_c_ses","csesidx","config_id","host_c_oses","mail_password","mail_refresh_token","mail_client_id"]);return e.map(o=>{const i={...o};return t.forEach(d=>{const p=i[d];p&&(i[d]=Ft(p))}),i})},Kt=()=>{if(j.value="",!B.value){try{ie.value=pt()}catch(e){j.value=e.message||"JSON 格式错误";return}te.value=JSON.stringify(xt(ie.value),null,2),B.value=!0;return}te.value=JSON.stringify(ie.value,null,2),B.value=!1},Gt=async()=>{j.value="";try{const e=pt();await h.updateConfig(e),Ue()}catch(e){j.value=e.message||"保存失败"}},ze=()=>{ae.value=!1,u.value=""},Ht=async()=>{if(ke.value===null)return;const e=[...We.value];e[ke.value]={...e[ke.value],id:_.value.id,secure_c_ses:_.value.secure_c_ses,csesidx:_.value.csesidx,config_id:_.value.config_id,host_c_oses:_.value.host_c_oses||void 0,expires_at:_.value.expires_at||void 0};try{await h.updateConfig(e),ze()}catch(t){u.value=t.message||"保存失败"}},Jt=async()=>{await h.bulkEnable(Array.from(m.value)),m.value=new Set},Yt=async()=>{await C.ask({title:"批量禁用",message:"确定要批量禁用选中的账号吗?"})&&(await h.bulkDisable(Array.from(m.value)),m.value=new Set)},Qt=async()=>{await C.ask({title:"批量删除",message:"确定要批量删除选中的账号吗?",confirmText:"删除"})&&(await h.bulkDelete(Array.from(m.value)),m.value=new Set)},mt=async e=>{await h.enableAccount(e)},gt=async e=>{await C.ask({title:"禁用账号",message:"确定要禁用该账号吗?"})&&await h.disableAccount(e)},bt=async e=>{await C.ask({title:"删除账号",message:"确定要删除该账号吗?",confirmText:"删除"})&&await h.deleteAccount(e)};let pe=null,xe=null,me=null,Le=!1;const X=()=>{pe!==null&&(window.clearInterval(pe),pe=null)},Z=()=>{xe!==null&&(window.clearInterval(xe),xe=null)},qt=()=>{me!==null&&(window.clearInterval(me),me=null),Le=!1},yt=e=>e==="pending"?"等待中":e==="running"?"执行中":e==="success"?"成功":e==="failed"?"失败":e,_t=async e=>{if(Ae(e)){X();return}const t=await w.getRegisterTask(e);if(Ae(t.id)){X();return}Oe(t),t.status!=="running"&&t.status!=="pending"&&(D.value=!1,X(),await fe())},wt=async e=>{if(Ee(e)){Z();return}const t=await w.getLoginTask(e);if(Ee(t.id)){Z();return}Se(t),t.status!=="running"&&t.status!=="pending"&&(T.value=!1,Z(),await fe())},ht=e=>{X(),pe=window.setInterval(()=>{_t(e).catch(t=>{y.value=t?.message||"注册任务更新失败",X(),D.value=!1})},3e3)},Pe=e=>{Z(),xe=window.setInterval(()=>{wt(e).catch(t=>{y.value=t?.message||"刷新任务更新失败",Z(),T.value=!1})},3e3)},Wt=()=>{me===null&&(me=window.setInterval(async()=>{if(!Le&&!Q.value&&!(pe!==null||xe!==null)&&!(!D.value&&!T.value&&!c.value&&!f.value)){Le=!0;try{await Fe()}catch(e){y.value=e?.message||"后台刷新失败"}finally{Le=!1}}},6e3))},Fe=async()=>{try{const e=await w.getRegisterCurrent();e&&"id"in e&&!Ae(e.id)&&(Oe(e),(e.status==="running"||e.status==="pending")&&(D.value=!0,ht(e.id)))}catch(e){y.value=e.message||"加载注册任务失败"}try{const e=await w.getLoginCurrent();e&&"id"in e&&!Ee(e.id)&&(Se(e),(e.status==="running"||e.status==="pending")&&(T.value=!0,Pe(e.id)))}catch(e){y.value=e.message||"加载刷新任务失败"}},Xt=async()=>{y.value="",D.value=!0;try{const e=Number.isFinite(de.value)&&de.value>0?de.value:void 0,t=await w.startRegister(e);Oe(t),ht(t.id),ye.value=!1,Q.value=!0}catch(e){y.value=e.message||"启动注册失败",D.value=!1}},kt=async()=>{if(m.value.size){y.value="",T.value=!0;try{const e=await w.startLogin(Array.from(m.value));Se(e),Pe(e.id)}catch(e){y.value=e.message||"启动刷新失败",T.value=!1}}},Zt=async()=>{y.value="",T.value=!0;try{await w.checkLogin();const e=await w.getLoginCurrent();if(e&&"id"in e){Se(e),Pe(e.id);return}T.value=!1}catch(e){y.value=e.message||"触发刷新失败",T.value=!1}};return(e,t)=>(r(),l(ge,null,[s("div",vs,[s("section",ps,[s("div",xs,[s("div",ms,[L(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>ne.value=o),type:"text",placeholder:"搜索账号 ID",class:"w-full rounded-full border border-input bg-background px-4 py-2 text-sm sm:w-48"},null,512),[[$,ne.value]]),H(is,{modelValue:ee.value,"onUpdate:modelValue":t[1]||(t[1]=o=>ee.value=o),options:St},null,8,["modelValue"])]),s("div",gs,[H(be,{modelValue:De.value,"onUpdate:modelValue":ut},{default:Ct(()=>[...t[27]||(t[27]=[J(" 全选 ",-1)])]),_:1},8,["modelValue"]),s("span",null,"已选 "+n(O.value)+" / "+n(K.value.length)+" 个账号",1),s("div",bs,[s("button",{type:"button",class:g(["inline-flex h-8 w-8 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:border-primary hover:text-primary",Y.value==="table"?"bg-accent text-accent-foreground":""]),onClick:t[2]||(t[2]=o=>Y.value="table"),"aria-label":"列表视图"},[...t[28]||(t[28]=[s("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M4 6h16v2H4V6zm0 5h16v2H4v-2zm0 5h16v2H4v-2z"})],-1)])],2),s("button",{type:"button",class:g(["inline-flex h-8 w-8 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:border-primary hover:text-primary",Y.value==="card"?"bg-accent text-accent-foreground":""]),onClick:t[3]||(t[3]=o=>Y.value="card"),"aria-label":"卡片视图"},[...t[29]||(t[29]=[s("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M4 6h7v6H4V6zm9 0h7v6h-7V6zM4 14h7v4H4v-4zm9 0h7v4h-7v-4z"})],-1)])],2)])])]),s("div",ys,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:R(le),onClick:fe}," 刷新列表 ",8,_s),s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",onClick:Pt}," 账户配置 "),s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:D.value,onClick:Et}," 添加账户 ",8,ws),s("div",{ref_key:"moreActionsRef",ref:je,class:"relative"},[s("button",{class:g(["flex items-center gap-2 rounded-full border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary",z.value?"bg-accent text-accent-foreground":""]),onClick:jt},[t[30]||(t[30]=J(" 更多操作 ",-1)),t[31]||(t[31]=s("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M5 7l5 6 5-6H5z"})],-1)),Dt.value?(r(),l("span",{key:0,class:g(["ml-1 h-2 w-2 rounded-full",Nt.value]),"aria-hidden":"true"},null,2)):x("",!0)],2),z.value?(r(),l("div",hs,[s("button",{type:"button",class:"flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm text-foreground transition-colors hover:bg-accent",onClick:t[4]||(t[4]=o=>{Rt(),re()})}," 任务状态 "),t[32]||(t[32]=s("div",{class:"my-1 border-t border-border/60"},null,-1)),s("button",{type:"button",class:g(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",T.value?"cursor-not-allowed text-muted-foreground":"text-foreground hover:bg-accent"]),disabled:T.value,onClick:t[5]||(t[5]=o=>{Zt(),re()})}," 刷新过期 ",10,ks),s("button",{type:"button",class:g(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",!O.value||T.value?"cursor-not-allowed text-muted-foreground":"text-foreground hover:bg-accent"]),disabled:!O.value||T.value,onClick:t[6]||(t[6]=o=>{kt(),re()})}," 刷新选中 ",10,Cs),t[33]||(t[33]=s("div",{class:"my-1 border-t border-border/60"},null,-1)),s("button",{type:"button",class:g(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",O.value?"text-foreground hover:bg-accent":"cursor-not-allowed text-muted-foreground"]),disabled:!O.value,onClick:t[7]||(t[7]=o=>{Jt(),re()})}," 批量启用 ",10,Ts),s("button",{type:"button",class:g(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",O.value?"text-foreground hover:bg-accent":"cursor-not-allowed text-muted-foreground"]),disabled:!O.value,onClick:t[8]||(t[8]=o=>{Yt(),re()})}," 批量禁用 ",10,Ss),s("button",{type:"button",class:g(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",O.value?"text-destructive hover:bg-destructive/10":"cursor-not-allowed text-muted-foreground"]),disabled:!O.value,onClick:t[9]||(t[9]=o=>{Qt(),re()})}," 批量删除 ",10,As)])):x("",!0)],512)]),Y.value==="card"?(r(),l("div",Es,[(r(!0),l(ge,null,Ve(K.value,o=>(r(),l("div",{key:o.id,class:g(["rounded-2xl border border-border bg-card p-4",dt(o)]),onClick:i=>Ie(o.id)},[s("div",Ls,[s("div",null,[t[34]||(t[34]=s("p",{class:"text-xs text-muted-foreground"},"账号 ID",-1)),s("p",$s,n(o.id),1)]),s("div",Rs,[H(be,{modelValue:m.value.has(o.id),"onUpdate:modelValue":i=>Ie(o.id),onClick:t[10]||(t[10]=V(()=>{},["stop"]))},null,8,["modelValue","onUpdate:modelValue"]),s("span",{class:g(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",rt(o)])},n(ve(o)),3)])]),s("div",Vs,[s("div",null,[t[35]||(t[35]=s("p",null,"剩余时间",-1)),s("p",{class:g(["mt-1 text-sm font-semibold",at(o)])},n(nt(o.remaining_display)),3),o.expires_at?(r(),l("p",Ms,n(o.expires_at),1)):x("",!0)]),s("div",null,[t[36]||(t[36]=s("p",null,"冷却",-1)),s("p",{class:g(["mt-1",Ne(o)])},[o.cooldown_seconds>0?(r(),l("span",js,n(it(o.cooldown_seconds))+" · "+n(o.cooldown_reason),1)):(r(),l("span",Ds,n(o.cooldown_reason||"无冷却"),1))],2)]),s("div",null,[t[37]||(t[37]=s("p",null,"失败数",-1)),s("p",Os,n(o.error_count),1)]),s("div",null,[t[38]||(t[38]=s("p",null,"会话数",-1)),s("p",Bs,n(o.conversation_count),1)])]),s("div",Ns,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:V(i=>vt(o.id),["stop"])}," 编辑 ",8,Us),lt(o)?(r(),l("button",{key:0,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:[t[11]||(t[11]=V(()=>{},["stop"])),i=>mt(o.id)]}," 启用 ",8,zs)):(r(),l("button",{key:1,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:[t[12]||(t[12]=V(()=>{},["stop"])),i=>gt(o.id)]}," 禁用 ",8,Ps)),s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-destructive transition-colors hover:border-destructive hover:text-destructive",onClick:[t[13]||(t[13]=V(()=>{},["stop"])),i=>bt(o.id)]}," 删除 ",8,Fs)])],10,Is))),128)),!K.value.length&&!R(le)?(r(),l("div",Ks," 暂无账号数据,请检查后台配置。 ")):x("",!0)])):(r(),l("div",Gs,[s("table",Hs,[s("thead",Js,[s("tr",null,[s("th",Ys,[H(be,{modelValue:De.value,"onUpdate:modelValue":ut},null,8,["modelValue"])]),t[40]||(t[40]=s("th",{class:"py-3 pr-6"},"账号 ID",-1)),t[41]||(t[41]=s("th",{class:"py-3 pr-6"},"状态",-1)),s("th",Qs,[s("span",qs,[t[39]||(t[39]=J(" 剩余/过期 ",-1)),H(cs,{text:"过期时间为 12 小时,账户过期以北京时间为准。"})])]),t[42]||(t[42]=s("th",{class:"py-3 pr-6"},"冷却",-1)),t[43]||(t[43]=s("th",{class:"py-3 pr-6"},"失败数",-1)),t[44]||(t[44]=s("th",{class:"py-3 pr-6"},"会话数",-1)),t[45]||(t[45]=s("th",{class:"py-3 text-right"},"操作",-1))])]),s("tbody",Ws,[!K.value.length&&!R(le)?(r(),l("tr",Xs,[...t[46]||(t[46]=[s("td",{colspan:"8",class:"py-8 text-center text-muted-foreground"}," 暂无账号数据,请检查后台配置。 ",-1)])])):x("",!0),(r(!0),l(ge,null,Ve(K.value,o=>(r(),l("tr",{key:o.id,class:g(["border-t border-border",dt(o)]),onClick:i=>Ie(o.id)},[s("td",{class:"py-4 pr-4",onClick:t[14]||(t[14]=V(()=>{},["stop"]))},[H(be,{modelValue:m.value.has(o.id),"onUpdate:modelValue":i=>Ie(o.id)},null,8,["modelValue","onUpdate:modelValue"])]),s("td",eo,n(o.id),1),s("td",to,[s("span",{class:g(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",rt(o)])},n(ve(o)),3)]),s("td",so,[s("div",{class:g(["text-sm font-semibold",at(o)])},n(nt(o.remaining_display)),3),o.expires_at?(r(),l("span",oo,n(o.expires_at),1)):x("",!0)]),s("td",ro,[o.cooldown_seconds>0?(r(),l("span",{key:0,class:g(Ne(o))},n(it(o.cooldown_seconds))+" · "+n(o.cooldown_reason),3)):(r(),l("span",{key:1,class:g(Ne(o))},n(o.cooldown_reason||"无冷却"),3))]),s("td",lo,n(o.error_count),1),s("td",no,n(o.conversation_count),1),s("td",ao,[s("div",io,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:V(i=>vt(o.id),["stop"])}," 编辑 ",8,uo),lt(o)?(r(),l("button",{key:0,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:V(i=>mt(o.id),["stop"])}," 启用 ",8,co)):(r(),l("button",{key:1,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:V(i=>gt(o.id),["stop"])}," 禁用 ",8,fo)),s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-destructive transition-colors hover:border-destructive hover:text-destructive",onClick:V(i=>bt(o.id),["stop"])}," 删除 ",8,vo)])])],10,Zs))),128))])])]))])]),H(ds,{open:R(C).open.value,title:R(C).title.value,message:R(C).message.value,"confirm-text":R(C).confirmText.value,"cancel-text":R(C).cancelText.value,onConfirm:R(C).confirm,onCancel:R(C).cancel},null,8,["open","title","message","confirm-text","cancel-text","onConfirm","onCancel"]),(r(),Re(Me,{to:"body"},[ye.value?(r(),l("div",po,[s("div",xo,[s("div",mo,[s("div",null,[t[47]||(t[47]=s("p",{class:"text-sm font-medium text-foreground"},"添加账户",-1)),s("p",go,n(N.value==="register"?"创建 DuckMail 账号并自动注册":"批量导入账户配置"),1)]),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Be}," 关闭 ")]),s("div",bo,[s("div",yo,[s("div",_o,[s("button",{type:"button",class:g(["flex-1 rounded-full px-3 py-2 font-medium transition-colors",N.value==="register"?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"]),onClick:t[15]||(t[15]=o=>N.value="register")}," 自动注册 ",2),s("button",{type:"button",class:g(["flex-1 rounded-full px-3 py-2 font-medium transition-colors",N.value==="import"?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"]),onClick:t[16]||(t[16]=o=>N.value="import")}," 批量导入 ",2)]),N.value==="register"?(r(),l("div",wo,[t[48]||(t[48]=s("label",{class:"block text-xs text-muted-foreground"},"注册数量",-1)),L(s("input",{"onUpdate:modelValue":t[17]||(t[17]=o=>de.value=o),type:"number",min:"1",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[$,de.value,void 0,{number:!0}]]),t[49]||(t[49]=s("div",{class:"rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"}," 默认域名来自设置面板(可在“配置面板”中修改) ",-1))])):(r(),l("div",ho,[t[50]||(t[50]=s("label",{class:"block text-xs text-muted-foreground"},"批量导入(每行一个)",-1)),L(s("textarea",{"onUpdate:modelValue":t[18]||(t[18]=o=>ue.value=o),class:"min-h-[140px] w-full rounded-2xl border border-input bg-background px-3 py-2 text-xs font-mono",placeholder:`duckmail----you@example.com----password | |
| user@outlook.com----loginPassword----clientId----refreshToken`},null,512),[[$,ue.value]]),t[51]||(t[51]=s("div",{class:"rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"},[s("p",null,"支持两种格式:"),s("p",{class:"mt-1 font-mono"},"duckmail----email----password"),s("p",{class:"mt-1 font-mono"},"email----password----clientId----refreshToken"),s("p",{class:"mt-2 text-[11px]"},'导入后请执行一次"刷新选中"以获取 Cookie。')],-1)),U.value?(r(),l("div",ko,n(U.value),1)):x("",!0)])),t[53]||(t[53]=s("div",{class:"rounded-2xl border border-border bg-muted/30 px-3 py-2 text-[11px] leading-relaxed text-muted-foreground"},[s("div",{class:"space-y-2"},[s("p",{class:"text-xs font-bold text-rose-600"},"⚠️ 严禁滥用:禁止将本工具用于商业用途或任何形式的滥用(无论规模大小)"),s("div",{class:"space-y-1"},[s("p",null,[s("strong",null,"本工具严禁用于以下行为:")]),s("p",{class:"pl-3"},"• 商业用途或盈利性使用"),s("p",{class:"pl-3"},"• 任何形式的批量操作或自动化滥用(无论规模大小)"),s("p",{class:"pl-3"},"• 破坏市场秩序或恶意竞争"),s("p",{class:"pl-3"},"• 违反 Google 服务条款的任何行为"),s("p",{class:"pl-3"},"• 违反 Microsoft 服务条款的任何行为")]),s("div",{class:"space-y-1"},[s("p",null,[s("strong",null,"违规后果:"),J("滥用行为可能导致账号永久封禁、法律追责,一切后果由使用者自行承担。")])]),s("div",{class:"space-y-1"},[s("p",{class:"font-semibold text-foreground"},"📖 合法用途"),s("p",null,"本项目仅限于以下场景:"),s("p",{class:"pl-3"},"• 个人学习与技术研究"),s("p",{class:"pl-3"},"• 浏览器自动化技术探索"),s("p",{class:"pl-3"},"• 非商业性技术交流")]),s("div",{class:"space-y-1"},[s("p",{class:"font-semibold text-foreground"},"⚖️ 法律责任"),s("p",null,[s("strong",null,"使用者责任:"),J("使用本工具产生的一切后果(包括但不限于账号封禁、数据损失、法律纠纷)由使用者完全承担。")]),s("p",null,[s("strong",null,"合规义务:"),J("使用者必须遵守所在地法律法规及第三方服务条款(包括但不限于 Google Workspace、Microsoft 365 等服务条款)。")]),s("p",null,[s("strong",null,"作者免责:"),J("作者不对任何违规使用、滥用行为或由此产生的后果承担责任。")])]),s("div",{class:"space-y-1"},[s("p",{class:"font-semibold text-foreground"},"📋 技术声明"),s("p",{class:"pl-3"},'• 本项目按"现状"提供,不提供任何形式的担保'),s("p",{class:"pl-3"},"• 依赖的第三方服务(如 DuckMail API、Microsoft Graph API 等)可用性不受作者控制"),s("p",{class:"pl-3"},"• 作者保留随时停止维护、变更功能或关闭项目的权利")])])],-1)),H(be,{modelValue:ce.value,"onUpdate:modelValue":t[19]||(t[19]=o=>ce.value=o)},{default:Ct(()=>[...t[52]||(t[52]=[J(" 我已阅读并同意上述说明与限制 ",-1)])]),_:1},8,["modelValue"])])]),s("div",Co,[s("div",To,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:Be}," 取消 "),N.value==="register"?(r(),l("button",{key:0,class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",disabled:D.value||!ce.value,onClick:Xt}," 开始注册 ",8,So)):(r(),l("button",{key:1,class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",disabled:_e.value||!ce.value,onClick:Lt}," 导入并保存 ",8,Ao))])])])])):x("",!0)])),(r(),Re(Me,{to:"body"},[Q.value?(r(),l("div",Eo,[s("div",Io,[s("div",Lo,[t[54]||(t[54]=s("div",null,[s("p",{class:"text-sm font-medium text-foreground"},"任务状态"),s("p",{class:"mt-1 text-xs text-muted-foreground"},"注册与刷新任务的状态与日志")],-1)),s("div",$o,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-primary hover:text-primary",disabled:!q.value.length&&!W.value.length&&!c.value&&!f.value&&!y.value,onClick:Mt}," 清空日志 ",8,Ro),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Vt}," 关闭 ")])]),s("div",Vo,[y.value?(r(),l("div",Mo,n(y.value),1)):x("",!0),c.value||f.value?(r(),l("div",jo,[c.value?(r(),l("div",Do,[t[55]||(t[55]=s("div",{class:"font-medium text-foreground"},"注册任务",-1)),s("div",Oo,[s("span",null,"状态:"+n(yt(c.value.status)),1),s("span",null,"进度:"+n(c.value.progress)+"/"+n(c.value.count),1),s("span",null,"成功:"+n(c.value.success_count),1),s("span",null,"失败:"+n(c.value.fail_count),1)])])):x("",!0),f.value?(r(),l("div",Bo,[t[56]||(t[56]=s("div",{class:"font-medium text-foreground"},"刷新任务",-1)),s("div",No,[s("span",null,"状态:"+n(yt(f.value.status)),1),s("span",null,"进度:"+n(f.value.progress)+"/"+n(f.value.account_ids.length),1),s("span",null,"成功:"+n(f.value.success_count),1),s("span",null,"失败:"+n(f.value.fail_count),1)])])):x("",!0)])):x("",!0),q.value.length||W.value.length?(r(),l("div",Uo,[s("div",{ref_key:"taskLogsRef",ref:qe,class:"scrollbar-slim flex-1 overflow-y-auto rounded-2xl border border-border bg-muted/30 p-3"},[q.value.length?(r(),l("div",zo,[t[57]||(t[57]=s("p",{class:"text-xs font-semibold text-foreground"},"注册日志",-1)),s("div",Po,[(r(!0),l(ge,null,Ve(q.value,(o,i)=>(r(),l("div",{key:`reg-${i}`,class:"font-mono"},n(ft(o)),1))),128))])])):x("",!0),W.value.length?(r(),l("div",Fo,[t[58]||(t[58]=s("p",{class:"text-xs font-semibold text-foreground"},"刷新日志",-1)),s("div",Ko,[(r(!0),l(ge,null,Ve(W.value,(o,i)=>(r(),l("div",{key:`login-${i}`,class:"font-mono"},n(ft(o)),1))),128))])])):x("",!0)],512)])):x("",!0),!y.value&&!c.value&&!f.value&&!q.value.length&&!W.value.length?(r(),l("div",Go," 暂无任务 ")):x("",!0)])])])):x("",!0)])),(r(),Re(Me,{to:"body"},[ae.value?(r(),l("div",Ho,[s("div",Jo,[s("div",{class:"flex items-center justify-between"},[t[59]||(t[59]=s("p",{class:"text-sm font-medium text-foreground"},"编辑账号",-1)),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:ze}," 关闭 ")]),u.value?(r(),l("div",Yo,n(u.value),1)):x("",!0),s("div",Qo,[t[60]||(t[60]=s("label",{class:"block text-xs text-muted-foreground"},"账号 ID",-1)),L(s("input",{"onUpdate:modelValue":t[20]||(t[20]=o=>_.value.id=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",disabled:""},null,512),[[$,_.value.id]]),t[61]||(t[61]=s("label",{class:"block text-xs text-muted-foreground"},"secure_c_ses",-1)),L(s("textarea",{"onUpdate:modelValue":t[21]||(t[21]=o=>_.value.secure_c_ses=o),class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",rows:"3"},null,512),[[$,_.value.secure_c_ses]]),t[62]||(t[62]=s("label",{class:"block text-xs text-muted-foreground"},"csesidx",-1)),L(s("input",{"onUpdate:modelValue":t[22]||(t[22]=o=>_.value.csesidx=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[$,_.value.csesidx]]),t[63]||(t[63]=s("label",{class:"block text-xs text-muted-foreground"},"config_id",-1)),L(s("input",{"onUpdate:modelValue":t[23]||(t[23]=o=>_.value.config_id=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[$,_.value.config_id]]),t[64]||(t[64]=s("label",{class:"block text-xs text-muted-foreground"},"host_c_oses",-1)),L(s("input",{"onUpdate:modelValue":t[24]||(t[24]=o=>_.value.host_c_oses=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[$,_.value.host_c_oses]]),t[65]||(t[65]=s("label",{class:"block text-xs text-muted-foreground"},"expires_at",-1)),L(s("input",{"onUpdate:modelValue":t[25]||(t[25]=o=>_.value.expires_at=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",placeholder:"2025-12-23 10:59:21"},null,512),[[$,_.value.expires_at]])]),s("div",{class:"mt-6 flex items-center justify-end gap-2"},[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:ze}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:Ht}," 保存 ")])])])):x("",!0)])),(r(),Re(Me,{to:"body"},[M.value?(r(),l("div",qo,[s("div",Wo,[s("div",Xo,[t[66]||(t[66]=s("p",{class:"text-sm font-medium text-foreground"},"账户配置(JSON)",-1)),s("div",Zo,[s("button",{class:"rounded-full bg-foreground px-3 py-1 text-xs text-background transition-opacity hover:opacity-90",onClick:Kt},n(B.value?"显示原文":"脱敏显示"),1),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Ue}," 关闭 ")])]),j.value?(r(),l("div",er,n(j.value),1)):x("",!0),s("div",tr,[L(s("textarea",{"onUpdate:modelValue":t[26]||(t[26]=o=>te.value=o),class:"h-96 w-full rounded-2xl border border-input bg-background px-4 py-3 font-mono text-xs text-foreground",spellcheck:"false",readonly:B.value},null,8,sr),[[$,te.value]])]),s("div",or,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:Ue}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:Gt,disabled:B.value}," 保存 ",8,rr)])])])):x("",!0)]))],64))}});export{cr as default}; | |