Spaces:
Sleeping
Sleeping
| import{g as E,D as ts,h as a,d as ss,E as os,i as H,o as rs,A as ls,j as ns,c as l,a as s,p as J,m as Re,q as A,v as $,s as Tt,t as n,n as g,u as R,b as m,f as pe,F as ge,r as Ve,x as je,w as V,e as r,G as as}from"./index-B38eA7T4.js";import{_ as is}from"./SelectMenu.vue_vue_type_script_setup_true_lang-n4k9i9SG.js";import{_ as be}from"./Checkbox.vue_vue_type_script_setup_true_lang-mPA_O7TM.js";import{_ as ds}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-B4oTz-IR.js";import{u as us}from"./useConfirmDialog-DRJ5fetN.js";import{_ as cs}from"./HelpTip.vue_vue_type_script_setup_true_lang-P0lttIQ0.js";const h={list:()=>E.get("/admin/accounts"),getConfig:()=>E.get("/admin/accounts-config"),updateConfig:b=>E.put("/admin/accounts-config",b),delete:b=>E.delete(`/admin/accounts/${b}`),disable:b=>E.put(`/admin/accounts/${b}/disable`),enable:b=>E.put(`/admin/accounts/${b}/enable`),startRegister:(b,w)=>E.post("/admin/register/start",{count:b,domain:w}),getRegisterTask:b=>E.get(`/admin/register/task/${b}`),getRegisterCurrent:()=>E.get("/admin/register/current"),startLogin:b=>E.post("/admin/login/start",b),getLoginTask:b=>E.get(`/admin/login/task/${b}`),getLoginCurrent:()=>E.get("/admin/login/current"),checkLogin:()=>E.post("/admin/login/check")},fs=ts("accounts",()=>{const b=a([]),w=a(!1);async function L(){w.value=!0;try{const u=await h.list();b.value=Array.isArray(u)?u:u.accounts||[]}finally{w.value=!1}}async function re(u){await h.delete(u),await L()}async function C(u){await h.disable(u),await L()}async function le(u){await h.enable(u),await L()}async function Z(u){await Promise.all(u.map(j=>h.enable(j))),await L()}async function p(u){await Promise.all(u.map(j=>h.disable(j))),await L()}async function G(u){await Promise.all(u.map(j=>h.delete(j))),await L()}async function ne(u){await h.updateConfig(u),await L()}return{accounts:b,isLoading:w,loadAccounts:L,deleteAccount:re,disableAccount:C,enableAccount:le,bulkEnable:Z,bulkDisable:p,bulkDelete:G,updateConfig:ne}}),vs={class:"space-y-8"},xs={class:"rounded-3xl border border-border bg-card p-6"},ms={class:"flex flex-wrap items-center justify-between gap-4"},ps={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"],hs=["disabled"],ws={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"],Es=["disabled"],Is={key:0,class:"mt-6 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},Ls=["onClick"],As={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"},js={key:0,class:"mt-1 text-[11px]"},Ms={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"},Hs={key:1,class:"relative mt-6 overflow-x-auto overflow-y-visible"},Js={class:"min-w-full text-left text-sm"},Gs={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"},Xs={class:"text-sm text-foreground"},Ws={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"],xo={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},mo={class:"flex max-h-[90vh] w-full max-w-lg flex-col overflow-hidden rounded-3xl border border-border bg-card shadow-xl"},po={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"},ho={key:0,class:"space-y-4"},wo={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"],Eo=["disabled"],Io={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Lo={class:"flex h-[80vh] w-full max-w-2xl flex-col overflow-hidden rounded-3xl border border-border bg-card shadow-xl"},Ao={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"},jo={key:0,class:"rounded-2xl bg-destructive/10 px-3 py-2 text-xs text-destructive"},Mo={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"},Ho={key:3,class:"mt-4 rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"},Jo={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Go={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"},Xo={class:"w-full max-w-3xl rounded-3xl border border-border bg-card p-6 shadow-xl"},Wo={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"],He="accounts-register-task-cache",Je="accounts-login-task-cache",Ge="accounts-register-log-clear",Ye="accounts-login-log-clear",qe="accounts-register-task-cleared-id",Qe="accounts-login-task-cleared-id",St="1970-01-01 00:00:00",cr=ss({__name:"Accounts",setup(b){const w=fs(),{accounts:L,isLoading:re}=os(w),C=us(),le=a(""),Z=a("all"),p=a(new Set),G=a("table"),ne=a(!1),u=a(""),j=a(!1),M=a(""),ee=a(""),B=a(!1),ae=a([]),ie=a(1),ye=a(!1),N=a("register"),de=a(""),U=a(""),_e=a(!1),Y=a(!1),z=a(!1),Me=a(null),he=a(null),we=a(null),P=a(null),F=a(null),te=a(0),se=a(0),ue=a(!1),c=a(null),f=a(null),Xe=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([]),Et=[{label:"全部状态",value:"all"},{label:"正常",value:"正常"},{label:"即将过期",value:"即将过期"},{label:"已过期",value:"已过期"},{label:"手动禁用",value:"手动禁用"},{label:"错误禁用",value:"错误禁用"},{label:"429限流",value:"429限流"}],K=H(()=>{const e=le.value.trim().toLowerCase();return L.value.filter(t=>{const o=!e||t.id.toLowerCase().includes(e),i=Z.value==="all"||fe(t)===Z.value;return o&&i})}),O=H(()=>p.value.size),De=H(()=>K.value.length>0&&K.value.every(e=>p.value.has(e.id))),ce=async()=>{await w.loadAccounts(),p.value=new Set,z.value=!1},Ze=e=>{try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}},et=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{}},tt=(e,t)=>{try{localStorage.setItem(e,JSON.stringify(t))}catch{}},st=e=>{try{localStorage.removeItem(e)}catch{}},ot=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(qe,null)),c.value=e,e.id&&e.id!==he.value&&(he.value=e.id,te.value=0,Te(Ge,0)),t&&tt(He,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!==we.value&&(we.value=e.id,se.value=0,Te(Ye,0)),t&&tt(Je,e)))},It=()=>{te.value=ot(Ge),se.value=ot(Ye),P.value=et(qe),F.value=et(Qe);const e=Ze(He);e&&e.id!==P.value&&(c.value=e,he.value=e.id||null);const t=Ze(Je);t&&t.id!==F.value&&(f.value=t,we.value=t.id||null)},Lt=()=>{ye.value=!0,N.value="register",de.value="",U.value="",_e.value=!1,ue.value=!1},Be=()=>{ye.value=!1},At=e=>{const t=[],o=[];return e.split(/\r?\n/).map(d=>d.trim()).filter(Boolean).forEach((d,x)=>{const v=d.split("----").map(S=>S.trim()),k=x+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:St,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]||"",I=v[2],es=v.slice(3).join("----");t.push({id:S,secure_c_ses:"",csesidx:"",config_id:"",expires_at:St,mail_provider:"microsoft",mail_address:S,mail_password:$e,mail_client_id:I,mail_refresh_token:es,mail_tenant:"consumers"});return}o.push(`第 ${k} 行格式错误`)}}),{items:t,errors:o}},$t=async()=>{if(U.value="",!de.value.trim()){U.value="请输入导入内容";return}const{items:e,errors:t}=At(de.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 ft()],d=new Map(i.map((k,S)=>[k.id,S])),x=[];e.forEach(k=>{const S=d.get(k.id||"");if(S===void 0){i.push(k),x.push(k.id);return}const I={...i[S],mail_provider:k.mail_provider,mail_address:k.mail_address};k.mail_provider==="microsoft"?(I.mail_client_id=k.mail_client_id,I.mail_refresh_token=k.mail_refresh_token,I.mail_tenant=k.mail_tenant,I.mail_password=k.mail_password):(I.mail_password=k.mail_password,I.mail_client_id=void 0,I.mail_refresh_token=void 0,I.mail_tenant=void 0),i[S]=I,x.push(k.id)}),await w.updateConfig(i),await ce(),p.value=new Set(x),Be(),await C.ask({title:"导入成功",message:`已导入 ${x.length} 个账户并自动选中。是否立即刷新这些账户以获取 Cookie?`,confirmText:"立即刷新",cancelText:"稍后手动刷新"})&&await Ct()}catch(o){U.value=o.message||"导入失败"}finally{_e.value=!1}},Rt=async()=>{try{const e=[],t=c.value?.id,o=f.value?.id;if(t&&!Ee(t)&&e.push(ht(t)),o&&!Ie(o)&&e.push(wt(o)),!e.length){await Ke();return}await Promise.all(e)}catch(e){y.value=e?.message||"任务状态更新失败"}},Ne=async()=>{Y.value=!0,await Rt()},Vt=()=>{Y.value=!1},jt=()=>{const e=c.value?.id||null,t=f.value?.id||null;P.value=e,F.value=t,Ce(qe,e),Ce(Qe,t),te.value=c.value?.logs?.length||0,se.value=f.value?.logs?.length||0,Te(Ge,te.value),Te(Ye,se.value),c.value=null,f.value=null,he.value=null,we.value=null,y.value="",D.value=!1,T.value=!1,X(),W(),st(He),st(Je)},Ee=e=>!!(e&&e===P.value),Ie=e=>!!(e&&e===F.value),Mt=()=>{z.value=!z.value},oe=()=>{z.value=!1},rt=e=>{if(!z.value)return;const t=e.target;Me.value&&!Me.value.contains(t)&&(z.value=!1)};rs(async()=>{It(),await ce(),await Ke(),Xt(),document.addEventListener("click",rt)});const q=H(()=>{const e=c.value?.logs||[];return te.value?e.slice(te.value):e}),Q=H(()=>{const e=f.value?.logs||[];return se.value?e.slice(se.value):e}),Dt=H(()=>!!y.value||!!c.value||!!f.value||q.value.length>0||Q.value.length>0),Ot=async()=>{await as();const e=Xe.value;e&&(e.scrollTop=e.scrollHeight)};ls([q,Q,Y],async()=>{Y.value&&await Ot()},{deep:!0});const Bt=H(()=>{const e=c.value?.status,t=f.value?.status;return e==="running"||e==="pending"||t==="running"||t==="pending"}),Nt=H(()=>{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,x=c.value.fail_count??0,v=c.value.count??d+x;e.push({success:d,fail:x,total:v,status:c.value.status})}if(f.value){const d=f.value.success_count??0,x=f.value.fail_count??0,v=f.value.account_ids?.length??d+x;e.push({success:d,fail:x,total:v,status:f.value.status})}if(!e.length)return"bg-muted-foreground";const t=e.reduce((d,x)=>d+x.success,0),o=e.reduce((d,x)=>d+x.fail,0),i=e.reduce((d,x)=>d+(x.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(),W(),Qt(),document.removeEventListener("click",rt)});const fe=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?"429限流":e.cooldown_reason==="错误禁用"?"错误禁用":e.disabled?"手动禁用":e.status==="已过期"?"已过期":e.status==="即将过期"?"即将过期":"正常",lt=e=>{const t=fe(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"},nt=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?!0:e.disabled||e.cooldown_reason==="错误禁用",at=e=>e==="已过期"?"过期":e==="未设置"?"未设置":e,it=e=>e.status==="已过期"?"text-rose-600":e.status==="即将过期"?"text-amber-700":e.status==="未设置"?"text-muted-foreground":"text-emerald-600",dt=e=>e<60?`${e} 秒`:e<3600?`${Math.ceil(e/60)} 分钟`:`${(e/3600).toFixed(1)} 小时`,Ue=e=>e.cooldown_seconds>0?"text-amber-700":e.cooldown_reason==="错误禁用"?"text-rose-600":"text-muted-foreground",ut=e=>{const t=fe(e);return t==="手动禁用"||t==="已过期"?"bg-muted/70":""},Le=e=>{const t=new Set(p.value);t.has(e)?t.delete(e):t.add(e),p.value=t},ct=()=>{if(De.value){p.value=new Set;return}p.value=new Set(K.value.map(e=>e.id))},Ut=(e,t)=>e.id||`account_${t+1}`,ft=async()=>(await h.getConfig()).accounts.map((t,o)=>({...t,id:Ut(t,o)})),vt=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,ne.value=!0,!0},xt=async e=>{u.value="";try{const t=await ft();zt(t,e)}catch(t){u.value=t.message||"加载账号配置失败"}},Pt=async()=>{M.value="";try{const e=await h.getConfig();ae.value=Array.isArray(e.accounts)?e.accounts:[],ee.value=JSON.stringify(pt(ae.value),null,2),B.value=!0,j.value=!0}catch(e){M.value=e.message||"加载账号配置失败"}},ze=()=>{j.value=!1,M.value="",B.value=!1},mt=()=>{const e=JSON.parse(ee.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)}****`,pt=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 x=i[d];x&&(i[d]=Ft(x))}),i})},Kt=()=>{if(M.value="",!B.value){try{ae.value=mt()}catch(e){M.value=e.message||"JSON 格式错误";return}ee.value=JSON.stringify(pt(ae.value),null,2),B.value=!0;return}ee.value=JSON.stringify(ae.value,null,2),B.value=!1},Ht=async()=>{M.value="";try{const e=mt();await w.updateConfig(e),ze()}catch(e){M.value=e.message||"保存失败"}},Pe=()=>{ne.value=!1,u.value=""},Jt=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 w.updateConfig(e),Pe()}catch(t){u.value=t.message||"保存失败"}},Gt=async()=>{await w.bulkEnable(Array.from(p.value)),p.value=new Set},Yt=async()=>{await C.ask({title:"批量禁用",message:"确定要批量禁用选中的账号吗?"})&&(await w.bulkDisable(Array.from(p.value)),p.value=new Set)},qt=async()=>{await C.ask({title:"批量删除",message:"确定要批量删除选中的账号吗?",confirmText:"删除"})&&(await w.bulkDelete(Array.from(p.value)),p.value=new Set)},gt=async e=>{await w.enableAccount(e)},bt=async e=>{await C.ask({title:"禁用账号",message:"确定要禁用该账号吗?"})&&await w.disableAccount(e)},yt=async e=>{await C.ask({title:"删除账号",message:"确定要删除该账号吗?",confirmText:"删除"})&&await w.deleteAccount(e)};let ve=null,xe=null,me=null,Ae=!1;const X=()=>{ve!==null&&(window.clearInterval(ve),ve=null)},W=()=>{xe!==null&&(window.clearInterval(xe),xe=null)},Qt=()=>{me!==null&&(window.clearInterval(me),me=null),Ae=!1},_t=e=>e==="pending"?"等待中":e==="running"?"执行中":e==="success"?"成功":e==="failed"?"失败":e,ht=async e=>{if(Ee(e)){X();return}const t=await h.getRegisterTask(e);if(Ee(t.id)){X();return}Oe(t),t.status!=="running"&&t.status!=="pending"&&(D.value=!1,X(),await ce())},wt=async e=>{if(Ie(e)){W();return}const t=await h.getLoginTask(e);if(Ie(t.id)){W();return}Se(t),t.status!=="running"&&t.status!=="pending"&&(T.value=!1,W(),await ce())},kt=e=>{X(),ve=window.setInterval(()=>{ht(e).catch(t=>{y.value=t?.message||"注册任务更新失败",X(),D.value=!1})},3e3)},Fe=e=>{W(),xe=window.setInterval(()=>{wt(e).catch(t=>{y.value=t?.message||"刷新任务更新失败",W(),T.value=!1})},3e3)},Xt=()=>{me===null&&(me=window.setInterval(async()=>{if(!Ae&&!Y.value&&!(ve!==null||xe!==null)&&!(!D.value&&!T.value&&!c.value&&!f.value)){Ae=!0;try{await Ke()}catch(e){y.value=e?.message||"后台刷新失败"}finally{Ae=!1}}},6e3))},Ke=async()=>{try{const e=await h.getRegisterCurrent();e&&"id"in e&&!Ee(e.id)&&(Oe(e),(e.status==="running"||e.status==="pending")&&(D.value=!0,kt(e.id)))}catch(e){y.value=e.message||"加载注册任务失败"}try{const e=await h.getLoginCurrent();e&&"id"in e&&!Ie(e.id)&&(Se(e),(e.status==="running"||e.status==="pending")&&(T.value=!0,Fe(e.id)))}catch(e){y.value=e.message||"加载刷新任务失败"}},Wt=async()=>{y.value="",D.value=!0;try{const e=Number.isFinite(ie.value)&&ie.value>0?ie.value:void 0,t=await h.startRegister(e);Oe(t),kt(t.id),ye.value=!1,Y.value=!0}catch(e){y.value=e.message||"启动注册失败",D.value=!1}},Ct=async()=>{if(p.value.size){y.value="",T.value=!0;try{const e=await h.startLogin(Array.from(p.value));Se(e),Fe(e.id),Ne()}catch(e){y.value=e.message||"启动刷新失败",T.value=!1}}},Zt=async()=>{y.value="",T.value=!0;try{await h.checkLogin();const e=await h.getLoginCurrent();if(e&&"id"in e){Se(e),Fe(e.id),Ne();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",xs,[s("div",ms,[s("div",ps,[A(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>le.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),[[$,le.value]]),J(is,{modelValue:Z.value,"onUpdate:modelValue":t[1]||(t[1]=o=>Z.value=o),options:Et},null,8,["modelValue"])]),s("div",gs,[J(be,{modelValue:De.value,"onUpdate:modelValue":ct},{default:Tt(()=>[...t[27]||(t[27]=[pe(" 全选 ",-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",G.value==="table"?"bg-accent text-accent-foreground":""]),onClick:t[2]||(t[2]=o=>G.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",G.value==="card"?"bg-accent text-accent-foreground":""]),onClick:t[3]||(t[3]=o=>G.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(re),onClick:ce}," 刷新列表 ",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:Lt}," 添加账户 ",8,hs),s("div",{ref_key:"moreActionsRef",ref:Me,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:Mt},[t[30]||(t[30]=pe(" 更多操作 ",-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)):m("",!0)],2),z.value?(r(),l("div",ws,[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=>{Ne(),oe()})}," 任务状态 "),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(),oe()})}," 刷新过期 ",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=>{Ct(),oe()})}," 刷新选中 ",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=>{Gt(),oe()})}," 批量启用 ",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(),oe()})}," 批量禁用 ",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(),oe()})}," 批量删除 ",10,Es)])):m("",!0)],512)]),G.value==="card"?(r(),l("div",Is,[(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",ut(o)]),onClick:i=>Le(o.id)},[s("div",As,[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,[J(be,{modelValue:p.value.has(o.id),"onUpdate:modelValue":i=>Le(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",lt(o)])},n(fe(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",it(o)])},n(at(o.remaining_display)),3),o.expires_at?(r(),l("p",js,n(o.expires_at),1)):m("",!0)]),s("div",null,[t[36]||(t[36]=s("p",null,"冷却",-1)),s("p",{class:g(["mt-1",Ue(o)])},[o.cooldown_seconds>0?(r(),l("span",Ms,n(dt(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=>xt(o.id),["stop"])}," 编辑 ",8,Us),nt(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=>gt(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=>bt(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=>yt(o.id)]}," 删除 ",8,Fs)])],10,Ls))),128)),!K.value.length&&!R(re)?(r(),l("div",Ks," 暂无账号数据,请检查后台配置。 ")):m("",!0)])):(r(),l("div",Hs,[s("table",Js,[s("thead",Gs,[s("tr",null,[s("th",Ys,[J(be,{modelValue:De.value,"onUpdate:modelValue":ct},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]=pe(" 剩余/过期 ",-1)),J(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",Xs,[!K.value.length&&!R(re)?(r(),l("tr",Ws,[...t[46]||(t[46]=[s("td",{colspan:"8",class:"py-8 text-center text-muted-foreground"}," 暂无账号数据,请检查后台配置。 ",-1)])])):m("",!0),(r(!0),l(ge,null,Ve(K.value,o=>(r(),l("tr",{key:o.id,class:g(["border-t border-border",ut(o)]),onClick:i=>Le(o.id)},[s("td",{class:"py-4 pr-4",onClick:t[14]||(t[14]=V(()=>{},["stop"]))},[J(be,{modelValue:p.value.has(o.id),"onUpdate:modelValue":i=>Le(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",lt(o)])},n(fe(o)),3)]),s("td",so,[s("div",{class:g(["text-sm font-semibold",it(o)])},n(at(o.remaining_display)),3),o.expires_at?(r(),l("span",oo,n(o.expires_at),1)):m("",!0)]),s("td",ro,[o.cooldown_seconds>0?(r(),l("span",{key:0,class:g(Ue(o))},n(dt(o.cooldown_seconds))+" · "+n(o.cooldown_reason),3)):(r(),l("span",{key:1,class:g(Ue(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=>xt(o.id),["stop"])}," 编辑 ",8,uo),nt(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=>gt(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=>bt(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=>yt(o.id),["stop"])}," 删除 ",8,vo)])])],10,Zs))),128))])])]))])]),J(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(je,{to:"body"},[ye.value?(r(),l("div",xo,[s("div",mo,[s("div",po,[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",ho,[t[48]||(t[48]=s("label",{class:"block text-xs text-muted-foreground"},"注册数量",-1)),A(s("input",{"onUpdate:modelValue":t[17]||(t[17]=o=>ie.value=o),type:"number",min:"1",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[$,ie.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",wo,[t[50]||(t[50]=s("label",{class:"block text-xs text-muted-foreground"},"批量导入(每行一个)",-1)),A(s("textarea",{"onUpdate:modelValue":t[18]||(t[18]=o=>de.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),[[$,de.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)):m("",!0)])),t[53]||(t[53]=s("div",{class:"rounded-2xl border border-rose-200 bg-rose-50 px-3 py-2 text-[11px] leading-relaxed"},[s("p",{class:"text-xs font-bold text-rose-600"},"⚠️ 严禁滥用:禁止将本工具用于商业用途或任何形式的滥用(无论规模大小)"),s("p",{class:"mt-1 text-muted-foreground"},[pe("详细声明请查看项目 "),s("a",{href:"https://github.com/Dreamy-rain/gemini-business2api/blob/main/docs/DISCLAIMER.md",target:"_blank",class:"text-primary hover:underline font-medium"},"DISCLAIMER.md")])],-1)),J(be,{modelValue:ue.value,"onUpdate:modelValue":t[19]||(t[19]=o=>ue.value=o)},{default:Tt(()=>[...t[52]||(t[52]=[pe(" 我已阅读并同意上述说明与限制 ",-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||!ue.value,onClick:Wt}," 开始注册 ",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||!ue.value,onClick:$t}," 导入并保存 ",8,Eo))])])])])):m("",!0)])),(r(),Re(je,{to:"body"},[Y.value?(r(),l("div",Io,[s("div",Lo,[s("div",Ao,[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&&!Q.value.length&&!c.value&&!f.value&&!y.value,onClick:jt}," 清空日志 ",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",jo,n(y.value),1)):m("",!0),c.value||f.value?(r(),l("div",Mo,[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(_t(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)])])):m("",!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(_t(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)])])):m("",!0)])):m("",!0),q.value.length||Q.value.length?(r(),l("div",Uo,[s("div",{ref_key:"taskLogsRef",ref:Xe,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(vt(o)),1))),128))])])):m("",!0),Q.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(Q.value,(o,i)=>(r(),l("div",{key:`login-${i}`,class:"font-mono"},n(vt(o)),1))),128))])])):m("",!0)],512)])):m("",!0),!y.value&&!c.value&&!f.value&&!q.value.length&&!Q.value.length?(r(),l("div",Ho," 暂无任务 ")):m("",!0)])])])):m("",!0)])),(r(),Re(je,{to:"body"},[ne.value?(r(),l("div",Jo,[s("div",Go,[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:Pe}," 关闭 ")]),u.value?(r(),l("div",Yo,n(u.value),1)):m("",!0),s("div",qo,[t[60]||(t[60]=s("label",{class:"block text-xs text-muted-foreground"},"账号 ID",-1)),A(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)),A(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)),A(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)),A(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)),A(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)),A(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:Pe}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:Jt}," 保存 ")])])])):m("",!0)])),(r(),Re(je,{to:"body"},[j.value?(r(),l("div",Qo,[s("div",Xo,[s("div",Wo,[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:ze}," 关闭 ")])]),M.value?(r(),l("div",er,n(M.value),1)):m("",!0),s("div",tr,[A(s("textarea",{"onUpdate:modelValue":t[26]||(t[26]=o=>ee.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),[[$,ee.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: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,disabled:B.value}," 保存 ",8,rr)])])])):m("",!0)]))],64))}});export{cr as default}; | |