Files
archy-demo/web-dist/assets/Settings-a5XTzOeo.js

3 lines
49 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{d as Pt,y as St,z as Mt,S as Bt,a0 as jt,o as Tt,B as b,c as r,a as e,h as We,D as l,E as o,g,H as x,I as we,G as h,f as p,m as D,b as _,a2 as Dt,J as X,a1 as E,F as k,P as T,a6 as Et,i as At,x as Lt,r as d,j as S,X as $t,l as Ft,a7 as zt,q as i}from"./index-DnbYEqLr.js";import{u as Ut,A as Vt}from"./aiPermissions-sblnS_DK.js";import{_ as Rt}from"./ControllerIndicator.vue_vue_type_script_setup_true_lang-DH-pMX35.js";const Nt={class:"pb-6"},Ht={class:"md:hidden mb-4"},It={class:"glass-card px-6 py-6 mb-6"},Wt={class:"text-xl font-semibold text-white/96 mb-6"},qt={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"},Ot={class:"bg-black/20 rounded-xl px-5 py-4 border border-white/10"},Kt={class:"flex items-center gap-3 mb-2"},Gt={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},Qt={key:0,class:"flex items-center gap-2"},Jt={class:"text-lg font-semibold text-white/95"},Zt={class:"bg-black/20 rounded-xl px-5 py-4 border border-white/10"},Xt={class:"flex items-center gap-3 mb-2"},Yt={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},es={class:"text-lg font-semibold text-white/95"},ts={class:"bg-black/20 rounded-xl px-5 py-4 border border-white/10 md:col-span-2"},ss={class:"flex items-center gap-3 mb-2"},os={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},ls={class:"text-base font-medium text-white/90"},ns={key:0,class:"bg-black/20 rounded-xl px-5 py-4 border border-white/10 md:col-span-2 space-y-4"},as={key:0},is={class:"flex items-center justify-between gap-2 mb-2"},rs={class:"flex items-center gap-3 min-w-0"},ds={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},cs={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},us={key:1,class:"text-green-400 text-xs"},ps={key:2},hs=["title"],bs={class:"text-xs text-white/50 mt-1"},ms={class:"flex items-center gap-3 mb-2"},gs={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},vs=["title"],xs={class:"text-xs text-white/50 mb-3"},fs={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ws={key:1},ks={key:2,class:"text-green-400"},ys={"data-controller-container":"",tabindex:"0",class:"mb-6"},_s={class:"text-lg font-semibold text-white mb-4"},Cs={class:"text-white/70 text-sm mb-4"},Ps={class:"block text-sm font-medium text-white/80 mb-2"},Ss=["placeholder"],Ms={class:"block text-sm font-medium text-white/80 mb-2"},Bs=["placeholder"],js={class:"block text-sm font-medium text-white/80 mb-2"},Ts=["placeholder"],Ds={class:"flex items-center gap-2 text-sm text-white/80"},Es={key:0,class:"text-sm text-red-400"},As={key:1,class:"text-sm text-green-400"},Ls={class:"flex gap-3 pt-2"},$s=["disabled"],Fs={class:"mb-6"},zs={class:"flex items-center justify-between mb-3"},Us={class:"flex items-center gap-3"},Vs={class:"text-sm font-medium text-white/90"},Rs={class:"text-xs text-white/50"},Ns={class:"glass-card p-6 max-w-md w-full",role:"dialog","aria-modal":"true","aria-labelledby":"totp-setup-title"},Hs={id:"totp-setup-title",class:"text-lg font-semibold text-white mb-2"},Is={class:"text-white/60 text-sm mb-4"},Ws=["placeholder"],qs={key:0,class:"text-sm text-red-400"},Os={class:"flex gap-3"},Ks=["disabled"],Gs={class:"text-lg font-semibold text-white mb-2"},Qs={class:"text-white/60 text-sm mb-4"},Js=["innerHTML"],Zs={class:"bg-black/30 rounded-lg px-3 py-2 mb-4"},Xs={class:"text-xs text-white/50 mb-1"},Ys={class:"text-sm font-mono text-orange-400 break-all select-all"},eo=["placeholder"],to={key:0,class:"text-sm text-red-400"},so={class:"flex gap-3"},oo=["disabled"],lo={class:"text-lg font-semibold text-white mb-2"},no={class:"text-white/60 text-sm mb-4"},ao={class:"bg-black/30 rounded-xl p-4 mb-4"},io={class:"grid grid-cols-2 gap-2"},ro={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},co={class:"glass-card p-6 max-w-md w-full",role:"dialog","aria-modal":"true","aria-labelledby":"totp-disable-title"},uo={id:"totp-disable-title",class:"text-lg font-semibold text-white mb-2"},po={class:"text-white/60 text-sm mb-4"},ho={class:"block text-sm font-medium text-white/80 mb-2"},bo=["placeholder"],mo={class:"block text-sm font-medium text-white/80 mb-2"},go=["placeholder"],vo={key:0,class:"text-sm text-red-400"},xo={class:"flex gap-3"},fo=["disabled"],wo={class:"glass-card px-6 py-6 mb-6"},ko={class:"text-xl font-semibold text-white/96 mb-2"},yo={class:"text-sm text-white/60 mb-6"},_o={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Co=["onClick"],Po={class:"flex items-center gap-3 mb-3"},So={class:"w-6 h-6 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Mo=["d"],Bo={class:"text-lg font-semibold text-white/96"},jo={class:"text-sm text-white/60 leading-relaxed"},To={class:"glass-card px-6 py-6 mb-6"},Do={class:"flex gap-3 flex-wrap"},Eo=["onClick"],Ao={class:"mr-2"},Lo={class:"glass-card px-6 py-6 mb-6"},$o={class:"text-xl font-semibold text-white/96 mb-2"},Fo={class:"text-sm text-white/60 mb-6"},zo={class:"bg-black/20 rounded-xl px-5 py-4 border border-white/10 mb-4"},Uo={class:"flex items-center gap-3 mb-2"},Vo={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},Ro={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 5.636a9 9 0 11-12.728 0M12 9v4m0 4h.01"},No={class:"text-xs font-semibold text-white/60 uppercase tracking-wide"},Ho={class:"glass-card p-0 max-w-lg w-full overflow-hidden",style:{height:"480px"}},Io={class:"flex items-center justify-between px-4 py-3 border-b border-white/10"},Wo={class:"text-sm font-semibold text-white/80"},qo={class:"glass-card px-6 py-6 mb-6"},Oo={class:"mb-2"},Ko={class:"text-xl font-semibold text-white/96"},Go={class:"text-sm text-white/60 mb-6"},Qo={class:"flex-1 min-w-0"},Jo={class:"text-xs text-white/50 mt-0.5"},Zo={class:"space-y-5"},Xo={class:"text-xs font-medium text-white/40 uppercase tracking-wider mb-2 px-1"},Yo={class:"space-y-2"},el=["onClick"],tl=["d"],sl={class:"flex-1 min-w-0"},ol={class:"text-xs text-white/50 mt-0.5"},ll={class:"glass-card px-6 py-6 mb-6"},nl={class:"flex items-center justify-between"},al={class:"text-xl font-semibold text-white/96"},il={class:"text-sm text-white/60 mt-1"},rl={class:"glass-card px-6 py-6 mb-6"},dl={class:"flex items-center justify-between mb-4"},cl={class:"text-xl font-semibold text-white/96"},ul={class:"text-sm text-white/60 mt-1"},pl={class:"flex items-center gap-3"},hl=["aria-checked","aria-label","title"],bl={class:"space-y-4"},ml={class:"text-xs text-white/50 block mb-1"},gl=["placeholder"],vl={class:"text-xs text-white/50 block mb-1"},xl=["placeholder"],fl={class:"text-xs text-white/50 block mb-2"},wl={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},kl=["onClick","aria-checked","aria-label"],yl={key:0,class:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_l={class:"min-w-0"},Cl={class:"text-sm text-white/90 font-medium"},Pl={class:"text-xs text-white/50"},Sl={class:"flex flex-col sm:flex-row gap-2 pt-2"},Ml=["disabled"],Bl=["disabled"],jl={class:"glass-card px-6 py-6 mb-6"},Tl={class:"mb-4"},Dl={class:"text-xl font-semibold text-white/96 mb-1"},El={class:"text-sm text-white/60 mb-3"},Al={key:0,class:"text-sm text-white/40 py-4 text-center"},Ll={key:1,class:"text-sm text-white/40 py-4 text-center"},$l={key:2,class:"space-y-2"},Fl={class:"min-w-0"},zl={class:"text-sm text-white font-medium"},Ul={class:"text-xs text-white/50"},Vl={class:"flex items-center gap-2 shrink-0 flex-wrap"},Rl=["onClick","disabled","title"],Nl=["onClick","disabled","title"],Hl=["onClick","title"],Il=["onClick","disabled","aria-label","title"],Wl={class:"glass-card p-6 w-full max-w-md",role:"dialog","aria-modal":"true","aria-labelledby":"create-backup-title"},ql={id:"create-backup-title",class:"text-lg font-semibold text-white mb-4"},Ol={class:"space-y-3"},Kl={class:"text-xs text-white/50 block mb-1"},Gl=["placeholder"],Ql={class:"text-xs text-white/50 block mb-1"},Jl=["placeholder"],Zl={class:"flex gap-3 mt-5"},Xl=["disabled"],Yl={class:"glass-card p-6 w-full max-w-md",role:"dialog","aria-modal":"true","aria-labelledby":"restore-backup-title"},en={id:"restore-backup-title",class:"text-lg font-semibold text-white mb-2"},tn={class:"text-sm text-red-400/80 mb-4"},sn={class:"text-xs text-white/50 block mb-1"},on=["placeholder"],ln={class:"flex gap-3 mt-5"},nn=["disabled"],an={class:"glass-card px-6 py-6 mb-6"},rn={class:"flex items-center justify-between"},dn={class:"text-xl font-semibold text-white/96"},cn={class:"text-sm text-white/60 mt-1"},un={class:"path-option-card px-6 py-6 mt-6 border-red-500/30"},pn={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"},hn={class:"glass-card px-8 py-8 max-w-md mx-4"},bn={class:"flex gap-3 justify-end"},mn=["disabled"],wn=Pt({__name:"Settings",setup(gn){const Y=Lt(),{t,locale:qe}=St(),ee=Mt(),U=d(!1),ke=d(!1);async function Oe(){ke.value=!0;try{await b.call({method:"system.factory-reset",params:{confirm:!0}}),localStorage.clear(),U.value=!1,Y.push("/onboarding/intro")}catch{localStorage.clear(),U.value=!1,Y.push("/onboarding/intro")}}const Ke=Et,Ge=S(()=>qe.value);async function Qe(a){await zt(a)}const Ae=Bt(),m=Ut(),Je=S(()=>{const a=[];for(const s of Vt){const v=a.find(n=>n.label===s.group);v?v.items.push(s):a.push({label:s.group,items:[s]})}return a}),Ze=S(()=>[{id:"easy",label:t("settings.modeEasy"),description:t("settings.modeEasyDesc"),iconPaths:["M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"]},{id:"gamer",label:t("settings.modePro"),description:t("settings.modeProDesc"),iconPaths:["M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z","M15 12a3 3 0 11-6 0 3 3 0 016 0z"]},{id:"chat",label:t("settings.modeChat"),description:t("settings.modeChatDesc"),iconPaths:["M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"]}]),ye=S(()=>ee.serverName),A=d(!1),te=d(""),Le=d(null);function Xe(){te.value=ye.value,A.value=!0,$t(()=>Le.value?.select())}async function $e(){const a=te.value.trim();if(!a||a===ye.value){A.value=!1;return}try{await b.call({method:"server.set-name",params:{name:a}})}catch(s){console.error("Failed to rename server:",s)}A.value=!1}const Ye=S(()=>ee.serverInfo?.version||"0.0.0"),Fe=S(()=>ee.serverInfo?.["tor-address"]||null),ze=d(null),V=S(()=>Fe.value||ze.value),M=S(()=>{try{return localStorage.getItem("neode_did")||null}catch{return null}}),y=d(!1),R=d(!1);function et(){fetch("/aiui/api/claude/v1/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:"haiku",messages:[{role:"user",content:"ping"}]})}).then(a=>{if(!a.ok){y.value=!1;return}const s=a.body?.getReader();if(!s)return;const v=new TextDecoder;let n="";function c(){return s.read().then(({done:P,value:Ee})=>{if(P){y.value=!n.includes("Not logged in")&&!n.includes("error");return}return n+=v.decode(Ee,{stream:!0}),c()})}c()}).catch(()=>{y.value=!1})}function tt(){window.addEventListener("message",Ue)}function Ue(a){a.data?.type==="claude-auth-success"&&(y.value=!0,R.value=!1,window.removeEventListener("message",Ue))}const L=d(!1),_e=d(!1),Ce=d(!1),$=d(1),N=d(""),H=d(""),C=d(""),B=d(!1),Pe=d(""),Se=d(""),Me=d(""),se=d([]),I=d(!1),oe=d(""),le=d(""),W=d(""),ne=d(!1);async function st(){try{const a=await b.totpStatus();L.value=a.enabled}catch{}}async function ot(){C.value="",B.value=!0;try{const a=await b.totpSetupBegin(N.value);Pe.value=a.qr_svg,Se.value=a.secret_base32,Me.value=a.pending_token,$.value=2}catch(a){C.value=a instanceof Error?a.message:t("settings.setupFailed")}finally{B.value=!1}}async function lt(){C.value="",B.value=!0;try{const a=await b.totpSetupConfirm({code:H.value,password:N.value,pendingToken:Me.value});se.value=a.backup_codes,L.value=!0,$.value=3}catch(a){C.value=a instanceof Error?a.message:t("settings.verificationFailed")}finally{B.value=!1}}function q(){_e.value=!1,$.value=1,N.value="",H.value="",C.value="",Pe.value="",Se.value="",Me.value="",se.value=[],I.value=!1}async function nt(){W.value="",ne.value=!0;try{await b.totpDisable(oe.value,le.value),L.value=!1,ae()}catch(a){W.value=a instanceof Error?a.message:t("settings.disableFailed")}finally{ne.value=!1}}function ae(){Ce.value=!1,oe.value="",le.value="",W.value=""}async function at(){const a=se.value.join(`
`);try{await navigator.clipboard.writeText(a)}catch{const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}I.value=!0,setTimeout(()=>{I.value=!1},2e3)}const ie=d(!1),re=d(!1),de=d(!1),Ve=d(null),Re=d(null);jt(Ve,de,ue,{restoreFocusRef:Re});const ce=d(!1),j=d(""),O=d(""),w=d({currentPassword:"",newPassword:"",confirmPassword:"",alsoChangeSsh:!0});function it(a){return a.length<12?t("settings.passwordMinLength"):/[A-Z]/.test(a)?/[a-z]/.test(a)?/\d/.test(a)?/[^A-Za-z0-9]/.test(a)?null:t("settings.passwordNeedSpecial"):t("settings.passwordNeedDigit"):t("settings.passwordNeedLowercase"):t("settings.passwordNeedUppercase")}async function rt(){j.value="",O.value="";const{currentPassword:a,newPassword:s,confirmPassword:v,alsoChangeSsh:n}=w.value;if(!a||!s||!v){j.value=t("settings.passwordAllFieldsRequired");return}if(s!==v){j.value=t("settings.passwordMismatch");return}const c=it(s);if(c){j.value=c;return}ce.value=!0;try{await b.changePassword({currentPassword:a,newPassword:s,alsoChangeSsh:n}),O.value=t("settings.passwordUpdatedSuccess"),w.value={currentPassword:"",newPassword:"",confirmPassword:"",alsoChangeSsh:!0},setTimeout(()=>{ue()},2e3)}catch(P){j.value=P instanceof Error?P.message:t("settings.passwordChangeFailed")}finally{ce.value=!1}}let Be=null;async function dt(){const a=V.value;if(a){try{await navigator.clipboard.writeText(a)}catch{const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}ie.value=!0,Be&&clearTimeout(Be),Be=setTimeout(()=>{ie.value=!1},2e3)}}async function ct(){if(M.value){try{await navigator.clipboard.writeText(M.value)}catch{const a=document.createElement("textarea");a.value=M.value,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}re.value=!0,setTimeout(()=>{re.value=!1},2e3)}}function ue(){Re.value?.focus?.(),de.value=!1,j.value="",O.value="",w.value={currentPassword:"",newPassword:"",confirmPassword:"",alsoChangeSsh:!0}}Tt(async()=>{if(et(),st(),De(),kt(),!Fe.value)try{const a=await b.getTorAddress();ze.value=a.tor_address??null}catch{}});async function ut(){try{await ee.logout()}catch{}Y.push("/login").catch(()=>{window.location.href="/login"})}const pe=d([]),je=d(!1),K=d(!1),F=d(""),he=d(""),G=d(!1),Q=d(!1),Ne=d(""),z=d(""),J=d(!1),be=d(null),Te=d(null),me=d(""),He=d("success");function pt(a){return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)} MB`:`${(a/(1024*1024*1024)).toFixed(2)} GB`}function f(a,s){me.value=a,He.value=s,setTimeout(()=>{me.value=""},5e3)}async function De(){je.value=!0;try{const a=await b.call({method:"backup.list"});pe.value=a.backups||[]}catch{pe.value=[]}finally{je.value=!1}}async function ht(){if(!(G.value||!F.value)){G.value=!0;try{await b.call({method:"backup.create",params:{passphrase:F.value,description:he.value||void 0}}),K.value=!1,F.value="",he.value="",f(t("settings.backupCreatedSuccess"),"success"),await De()}catch{f(t("settings.backupCreateFailed"),"error")}finally{G.value=!1}}}async function bt(a){const s=prompt(t("settings.verifyPassphrasePrompt"));if(s){be.value=a;try{const v=await b.call({method:"backup.verify",params:{id:a,passphrase:s}});v.valid?f(t("settings.backupVerifiedOk"),"success"):f(t("settings.backupVerifyFailed",{error:v.error||"Unknown error"}),"error")}catch{f(t("settings.backupVerifyRequestFailed"),"error")}finally{be.value=null}}}function mt(a){Ne.value=a,z.value="",Q.value=!0}async function gt(){if(!(J.value||!z.value)){J.value=!0;try{await b.call({method:"backup.restore",params:{id:Ne.value,passphrase:z.value}}),Q.value=!1,f(t("settings.backupRestored"),"success")}catch{f(t("settings.backupRestoreFailed"),"error")}finally{J.value=!1}}}async function vt(a){if(confirm(t("settings.deleteBackupConfirm"))){Te.value=a;try{await b.call({method:"backup.delete",params:{id:a}}),f(t("settings.backupDeleted"),"success"),await De()}catch{f(t("settings.backupDeleteFailed"),"error")}finally{Te.value=null}}}const u=d({enabled:!1,url:"",secret:"",events:[]}),ge=d(!1),ve=d(!1),xe=d(""),Ie=d("success"),xt=S(()=>[{id:"container_crash",label:t("settings.containerCrash"),description:t("settings.containerCrashDesc")},{id:"update_available",label:t("settings.updateAvailableEvent"),description:t("settings.updateAvailableDesc")},{id:"disk_warning",label:t("settings.diskSpaceWarning"),description:t("settings.diskWarningDesc")},{id:"backup_complete",label:t("settings.backupComplete"),description:t("settings.backupCompleteDesc")}]);function Z(a,s){xe.value=a,Ie.value=s,setTimeout(()=>{xe.value=""},5e3)}function ft(a){const s=u.value.events.indexOf(a);s>=0?u.value.events.splice(s,1):u.value.events.push(a)}function wt(){u.value.enabled=!u.value.enabled}async function kt(){try{const a=await b.call({method:"webhook.get-config"});u.value.enabled=a.enabled,u.value.url=a.url,u.value.events=a.events||[]}catch{}}async function yt(){ge.value=!0;try{await b.call({method:"webhook.configure",params:{enabled:u.value.enabled,url:u.value.url,secret:u.value.secret||null,events:u.value.events}}),Z(t("settings.webhookSaved"),"success")}catch{Z(t("settings.webhookSaveFailed"),"error")}finally{ge.value=!1}}async function _t(){ve.value=!0;try{(await b.call({method:"webhook.test"})).sent?Z(t("settings.webhookTestSent"),"success"):Z(t("settings.webhookTestFailed"),"error")}catch{Z(t("settings.webhookSendFailed"),"error")}finally{ve.value=!1}}const fe=d(null);async function Ct(a){fe.value=a;try{const c=((await b.call({method:"backup.list-drives"})).drives||[]).filter(Ee=>Ee.mount_point)[0];if(!c?.mount_point){f(t("settings.noUsbDrives"),"error");return}const P=c.label||c.device;if(!confirm(`Copy backup to USB drive "${P}" at ${c.mount_point}?`))return;await b.call({method:"backup.to-usb",params:{id:a,mount_point:c.mount_point}}),f(t("settings.backupCopiedToUsb",{path:c.mount_point}),"success")}catch{f(t("settings.backupUsbFailed"),"error")}finally{fe.value=null}}return(a,s)=>{const v=Ft("RouterLink");return i(),r("div",Nt,[e("div",Ht,[We(Rt)]),e("div",It,[e("h2",Wt,l(o(t)("settings.account")),1),e("div",qt,[e("div",Ot,[e("div",Kt,[s[32]||(s[32]=e("svg",{class:"w-5 h-5 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})],-1)),e("p",Gt,l(o(t)("settings.serverName")),1)]),A.value?(i(),r("div",Qt,[g(e("input",{ref_key:"serverNameInput",ref:Le,"onUpdate:modelValue":s[0]||(s[0]=n=>te.value=n),type:"text",maxlength:"64",class:"flex-1 px-3 py-1.5 bg-white/10 border border-white/20 rounded-lg text-white text-lg font-semibold focus:outline-none focus:border-white/40 transition-colors",onKeydown:[we($e,["enter"]),s[1]||(s[1]=we(n=>A.value=!1,["escape"]))]},null,544),[[x,te.value]]),e("button",{class:"px-3 py-1.5 bg-white/10 border border-white/20 rounded-lg text-white/70 hover:text-white hover:bg-white/15 transition-colors text-sm",onClick:$e},"Save"),e("button",{class:"px-3 py-1.5 text-white/50 hover:text-white/70 transition-colors text-sm",onClick:s[2]||(s[2]=n=>A.value=!1)},"Cancel")])):(i(),r("div",{key:1,class:"flex items-center gap-2 group cursor-pointer",onClick:Xe},[e("p",Jt,l(ye.value),1),s[33]||(s[33]=e("svg",{class:"w-4 h-4 text-white/30 group-hover:text-white/60 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1))]))]),e("div",Zt,[e("div",Xt,[s[34]||(s[34]=e("svg",{class:"w-5 h-5 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})],-1)),e("p",Yt,l(o(t)("common.version")),1)]),e("p",es,l(Ye.value),1)]),e("div",ts,[e("div",ss,[s[35]||(s[35]=e("svg",{class:"w-5 h-5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("p",os,l(o(t)("settings.sessionStatus")),1)]),e("p",ls,l(o(t)("settings.loggedIn")),1)]),M.value||V.value?(i(),r("div",ns,[M.value?(i(),r("div",as,[e("div",is,[e("div",rs,[s[36]||(s[36]=e("svg",{class:"w-5 h-5 text-amber-400 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),e("p",ds,l(o(t)("settings.yourDid")),1)]),e("button",{onClick:ct,class:"shrink-0 px-3 py-1.5 rounded-lg glass-button glass-button-sm text-xs font-medium text-white/90 hover:text-white transition-colors flex items-center gap-1.5"},[re.value?(i(),r("span",us,l(o(t)("common.copied")),1)):(i(),r("svg",cs,[...s[37]||(s[37]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},null,-1)])])),re.value?h("",!0):(i(),r("span",ps,l(o(t)("common.copy")),1))])]),e("p",{class:"text-sm font-mono text-white/90 break-all",title:M.value},l(M.value),9,hs),e("p",bs,l(o(t)("settings.didHelper")),1)])):h("",!0),V.value?(i(),r("div",{key:1,class:p(M.value?"pt-4 border-t border-white/10":"")},[e("div",ms,[s[38]||(s[38]=e("svg",{class:"w-5 h-5 text-amber-400 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})],-1)),e("p",gs,l(o(t)("settings.onionAddress")),1)]),e("p",{class:"text-sm font-mono text-amber-400/90 break-all mb-1",title:V.value},l(V.value),9,vs),e("p",xs,l(o(t)("settings.onionHelper")),1),e("button",{onClick:dt,class:"w-full min-h-[44px] rounded-lg glass-button text-sm font-medium text-white/90 hover:text-white transition-colors flex items-center justify-center gap-2"},[ie.value?h("",!0):(i(),r("svg",fs,[...s[39]||(s[39]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},null,-1)])])),ie.value?(i(),r("span",ks,l(o(t)("common.copied")),1)):(i(),r("span",ws,l(o(t)("common.copy")),1))])],2)):h("",!0)])):h("",!0)]),e("div",ys,[e("button",{onClick:s[3]||(s[3]=n=>de.value=!0),class:"w-full flex items-center justify-center gap-2 mb-4 px-4 py-2 rounded-lg border border-orange-500/50 text-orange-400 font-medium hover:bg-orange-500/10 transition-colors"},[s[40]||(s[40]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),e("span",null,l(o(t)("settings.changePassword")),1)])]),(i(),D(E,{to:"body"},[de.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:s[8]||(s[8]=_(n=>ue(),["self"]))},[e("div",{ref_key:"changePasswordModalRef",ref:Ve,class:"glass-card p-6 max-w-md w-full"},[e("h3",_s,l(o(t)("settings.changePasswordTitle")),1),e("p",Cs,l(o(t)("settings.changePasswordDesc")),1),e("form",{onSubmit:_(rt,["prevent"]),class:"space-y-4"},[e("div",null,[e("label",Ps,l(o(t)("settings.currentPassword")),1),g(e("input",{"onUpdate:modelValue":s[4]||(s[4]=n=>w.value.currentPassword=n),type:"password",required:"",autocomplete:"current-password",class:"w-full px-3 py-2 rounded-lg bg-white/10 text-white border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500",placeholder:o(t)("login.enterPasswordPlaceholder")},null,8,Ss),[[x,w.value.currentPassword]])]),e("div",null,[e("label",Ms,l(o(t)("settings.newPassword")),1),g(e("input",{"onUpdate:modelValue":s[5]||(s[5]=n=>w.value.newPassword=n),type:"password",required:"",autocomplete:"new-password",class:"w-full px-3 py-2 rounded-lg bg-white/10 text-white border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500",placeholder:o(t)("settings.passwordPlaceholder")},null,8,Bs),[[x,w.value.newPassword]])]),e("div",null,[e("label",js,l(o(t)("settings.confirmNewPassword")),1),g(e("input",{"onUpdate:modelValue":s[6]||(s[6]=n=>w.value.confirmPassword=n),type:"password",required:"",autocomplete:"new-password",class:"w-full px-3 py-2 rounded-lg bg-white/10 text-white border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500",placeholder:o(t)("settings.confirmNewPassword")},null,8,Ts),[[x,w.value.confirmPassword]])]),e("label",Ds,[g(e("input",{"onUpdate:modelValue":s[7]||(s[7]=n=>w.value.alsoChangeSsh=n),type:"checkbox",class:"rounded border-white/30"},null,512),[[Dt,w.value.alsoChangeSsh]]),X(" "+l(o(t)("settings.updateSshCheckbox")),1)]),j.value?(i(),r("p",Es,l(j.value),1)):h("",!0),O.value?(i(),r("p",As,l(O.value),1)):h("",!0),e("div",Ls,[e("button",{type:"submit",disabled:ce.value,class:"flex-1 px-4 py-2 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"},l(ce.value?o(t)("settings.updatingPassword"):o(t)("settings.updatePassword")),9,$s),e("button",{type:"button",onClick:ue,class:"px-4 py-2 rounded-lg bg-white/10 text-white font-medium hover:bg-white/20 transition-colors"},l(o(t)("common.cancel")),1)])],32)],512)])):h("",!0)])),e("div",Fs,[e("div",zs,[e("div",Us,[s[41]||(s[41]=e("svg",{class:"w-5 h-5 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})],-1)),e("div",null,[e("p",Vs,l(o(t)("settings.twoFactorAuth")),1),e("p",Rs,l(o(t)("settings.twoFaProtect")),1)])]),e("span",{class:p(["text-xs font-semibold px-2 py-1 rounded-full",L.value?"bg-green-500/20 text-green-400":"bg-white/10 text-white/50"])},l(L.value?o(t)("common.enabled"):o(t)("common.disabled")),3)]),L.value?(i(),r("button",{key:1,onClick:s[10]||(s[10]=n=>Ce.value=!0),class:"w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-red-500/50 text-red-400 font-medium hover:bg-red-500/10 transition-colors"},[s[43]||(s[43]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})],-1)),e("span",null,l(o(t)("settings.disable2fa")),1)])):(i(),r("button",{key:0,onClick:s[9]||(s[9]=n=>_e.value=!0),class:"w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-orange-500/50 text-orange-400 font-medium hover:bg-orange-500/10 transition-colors"},[s[42]||(s[42]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})],-1)),e("span",null,l(o(t)("settings.enable2fa")),1)]))]),(i(),D(E,{to:"body"},[_e.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:_(q,["self"]),onKeydown:we(q,["escape"])},[e("div",Ns,[$.value===1?(i(),r(k,{key:0},[e("h3",Hs,l(o(t)("settings.setup2faTitle")),1),e("p",Is,l(o(t)("settings.setup2faPasswordPrompt")),1),e("form",{onSubmit:_(ot,["prevent"]),class:"space-y-4"},[g(e("input",{"onUpdate:modelValue":s[11]||(s[11]=n=>N.value=n),type:"password",required:"",autocomplete:"current-password",class:"w-full px-3 py-2 rounded-lg bg-white/10 text-white border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500",placeholder:o(t)("login.enterPasswordPlaceholder")},null,8,Ws),[[x,N.value]]),C.value?(i(),r("p",qs,l(C.value),1)):h("",!0),e("div",Os,[e("button",{type:"submit",disabled:B.value,class:"flex-1 px-4 py-2 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"},l(B.value?o(t)("common.loading"):o(t)("common.continue")),9,Ks),e("button",{type:"button",onClick:q,class:"px-4 py-2 rounded-lg bg-white/10 text-white font-medium hover:bg-white/20 transition-colors"},l(o(t)("common.cancel")),1)])],32)],64)):$.value===2?(i(),r(k,{key:1},[e("h3",Gs,l(o(t)("settings.scanQrCode")),1),e("p",Qs,l(o(t)("settings.scanQrInstruction")),1),e("div",{class:"flex justify-center mb-4 bg-white rounded-xl p-4 mx-auto w-fit",innerHTML:Pe.value},null,8,Js),e("div",Zs,[e("p",Xs,l(o(t)("settings.manualEntryKey")),1),e("p",Ys,l(Se.value),1)]),e("form",{onSubmit:_(lt,["prevent"]),class:"space-y-4"},[g(e("input",{"onUpdate:modelValue":s[12]||(s[12]=n=>H.value=n),type:"text",inputmode:"numeric",pattern:"[0-9]{6}",maxlength:"6",required:"",autocomplete:"one-time-code",class:"w-full px-3 py-3 rounded-lg bg-white/10 text-white text-center text-2xl tracking-[0.5em] border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500 font-mono",placeholder:o(t)("login.totpPlaceholder")},null,8,eo),[[x,H.value]]),C.value?(i(),r("p",to,l(C.value),1)):h("",!0),e("div",so,[e("button",{type:"submit",disabled:B.value||H.value.length!==6,class:"flex-1 px-4 py-2 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"},l(B.value?o(t)("login.verifying"):o(t)("settings.verifyAndEnable")),9,oo),e("button",{type:"button",onClick:q,class:"px-4 py-2 rounded-lg bg-white/10 text-white font-medium hover:bg-white/20 transition-colors"},l(o(t)("common.cancel")),1)])],32)],64)):$.value===3?(i(),r(k,{key:2},[e("h3",lo,l(o(t)("settings.saveBackupCodes")),1),e("p",no,l(o(t)("settings.backupCodesInstruction")),1),e("div",ao,[e("div",io,[(i(!0),r(k,null,T(se.value,(n,c)=>(i(),r("div",{key:c,class:"text-sm font-mono text-white/90 bg-white/5 rounded px-3 py-2 text-center"},l(n),1))),128))])]),e("button",{onClick:at,class:"w-full mb-3 flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-white/20 text-white/80 font-medium hover:bg-white/5 transition-colors"},[I.value?h("",!0):(i(),r("svg",ro,[...s[44]||(s[44]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},null,-1)])])),e("span",null,l(I.value?o(t)("common.copiedBang"):o(t)("settings.copyAllCodes")),1)]),e("button",{onClick:q,class:"w-full px-4 py-2 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600 transition-colors"},l(o(t)("common.done")),1)],64)):h("",!0)])],32)):h("",!0)])),(i(),D(E,{to:"body"},[Ce.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:_(ae,["self"]),onKeydown:we(ae,["escape"])},[e("div",co,[e("h3",uo,l(o(t)("settings.disable2faTitle")),1),e("p",po,l(o(t)("settings.disable2faDesc")),1),e("form",{onSubmit:_(nt,["prevent"]),class:"space-y-4"},[e("div",null,[e("label",ho,l(o(t)("login.password")),1),g(e("input",{"onUpdate:modelValue":s[13]||(s[13]=n=>oe.value=n),type:"password",required:"",autocomplete:"current-password",class:"w-full px-3 py-2 rounded-lg bg-white/10 text-white border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500",placeholder:o(t)("login.enterPasswordPlaceholder")},null,8,bo),[[x,oe.value]])]),e("div",null,[e("label",mo,l(o(t)("settings.authenticatorCode")),1),g(e("input",{"onUpdate:modelValue":s[14]||(s[14]=n=>le.value=n),type:"text",inputmode:"numeric",pattern:"[0-9]{6}",maxlength:"6",required:"",autocomplete:"one-time-code",class:"w-full px-3 py-3 rounded-lg bg-white/10 text-white text-center text-2xl tracking-[0.5em] border border-white/20 focus:border-orange-500 focus:ring-1 focus:ring-orange-500 font-mono",placeholder:o(t)("login.totpPlaceholder")},null,8,go),[[x,le.value]])]),W.value?(i(),r("p",vo,l(W.value),1)):h("",!0),e("div",xo,[e("button",{type:"submit",disabled:ne.value,class:"flex-1 px-4 py-2 rounded-lg bg-red-500 text-white font-medium hover:bg-red-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"},l(ne.value?o(t)("common.disabling"):o(t)("settings.disable2fa")),9,fo),e("button",{type:"button",onClick:ae,class:"px-4 py-2 rounded-lg bg-white/10 text-white font-medium hover:bg-white/20 transition-colors"},l(o(t)("common.cancel")),1)])],32)])],32)):h("",!0)])),e("button",{onClick:ut,class:"w-full path-action-button path-action-button--continue flex items-center justify-center gap-2"},[s[45]||(s[45]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1)),e("span",null,l(o(t)("settings.logout")),1)])]),e("div",wo,[e("h2",ko,l(o(t)("settings.interfaceMode")),1),e("p",yo,l(o(t)("settings.interfaceModeDesc")),1),e("div",_o,[(i(!0),r(k,null,T(Ze.value,n=>(i(),r("button",{key:n.id,onClick:c=>o(Ae).setMode(n.id),class:p(["path-option-card text-left p-5",{"path-option-card--selected":o(Ae).mode===n.id}])},[e("div",Po,[(i(),r("svg",So,[(i(!0),r(k,null,T(n.iconPaths,(c,P)=>(i(),r("path",{key:P,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:c},null,8,Mo))),128))])),e("h3",Bo,l(n.label),1)]),e("p",jo,l(n.description),1)],10,Co))),128))])]),e("div",To,[s[46]||(s[46]=e("h2",{class:"text-xl font-semibold text-white/96 mb-2"},"Language",-1)),s[47]||(s[47]=e("p",{class:"text-sm text-white/60 mb-4"},"Choose your preferred language",-1)),e("div",Do,[(i(!0),r(k,null,T(o(Ke),n=>(i(),r("button",{key:n.code,onClick:c=>Qe(n.code),class:p(["glass-button px-4 py-2 rounded-lg text-sm font-medium transition-all",Ge.value===n.code?"ring-2 ring-orange-400/60 bg-white/10":""])},[e("span",Ao,l(n.flag),1),X(l(n.name),1)],10,Eo))),128))])]),e("div",Lo,[e("h2",$o,l(o(t)("settings.claudeAuth")),1),e("p",Fo,l(o(t)("settings.claudeAuthDesc")),1),e("div",zo,[e("div",Uo,[(i(),r("svg",{class:p(["w-5 h-5 shrink-0",y.value?"text-green-400":"text-white/40"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[y.value?(i(),r("path",Vo)):(i(),r("path",Ro))],2)),e("p",No,l(o(t)("settings.connectionStatus")),1)]),e("p",{class:p(["text-base font-medium",y.value?"text-green-400":"text-white/50"])},l(y.value?o(t)("common.connected"):o(t)("settings.notConnected")),3)]),e("button",{onClick:s[15]||(s[15]=n=>R.value=!0),class:p(["w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors",y.value?"border-white/20 text-white/70 hover:bg-white/5":"border-orange-500/50 text-orange-400 font-medium hover:bg-orange-500/10"])},[s[48]||(s[48]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"})],-1)),e("span",null,l(y.value?o(t)("settings.reAuthenticate"):o(t)("settings.loginWithClaude")),1)],2)]),(i(),D(E,{to:"body"},[R.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:s[17]||(s[17]=_(n=>R.value=!1,["self"]))},[e("div",Ho,[e("div",Io,[e("h3",Wo,l(o(t)("settings.claudeAuth")),1),e("button",{onClick:s[16]||(s[16]=n=>R.value=!1),class:"text-white/50 hover:text-white/80 transition-colors"},[...s[49]||(s[49]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e("iframe",{src:"/claude-login",class:"w-full border-0",style:{height:"calc(100% - 49px)"},onLoad:tt},null,32)])])):h("",!0)])),e("div",qo,[e("div",Oo,[e("h2",Ko,l(o(t)("settings.aiDataAccess")),1)]),e("p",Go,l(o(t)("settings.aiDataAccessDesc")),1),e("button",{onClick:s[18]||(s[18]=n=>o(m).allEnabled?o(m).disableAll():o(m).enableAll()),class:p(["w-full flex items-center gap-4 p-4 rounded-xl border transition-all text-left mb-6",o(m).allEnabled?"bg-white/10 border-orange-500/40":"bg-black/20 border-white/10 hover:border-white/20"])},[(i(),r("svg",{class:p(["w-5 h-5 shrink-0",o(m).allEnabled?"text-orange-400":"text-white/40"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...s[50]||(s[50]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)),e("div",Qo,[e("p",{class:p(["text-sm font-medium",o(m).allEnabled?"text-white/95":"text-white/70"])},l(o(t)("common.enableAll")),3),e("p",Jo,l(o(t)("settings.enableAllDesc")),1)]),e("div",{class:p(["w-10 h-6 rounded-full shrink-0 transition-colors relative",o(m).allEnabled?"bg-orange-500":"bg-white/15"])},[e("div",{class:p(["absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform",o(m).allEnabled?"translate-x-5":"translate-x-1"])},null,2)],2)],2),e("div",Zo,[(i(!0),r(k,null,T(Je.value,n=>(i(),r("div",{key:n.label},[e("p",Xo,l(n.label),1),e("div",Yo,[(i(!0),r(k,null,T(n.items,c=>(i(),r("button",{key:c.id,onClick:P=>o(m).toggle(c.id),class:p(["w-full flex items-center gap-4 p-4 rounded-xl border transition-all text-left",o(m).isEnabled(c.id)?"bg-white/10 border-orange-500/40":"bg-black/20 border-white/10 hover:border-white/20"])},[(i(),r("svg",{class:p(["w-5 h-5 shrink-0",o(m).isEnabled(c.id)?"text-orange-400":"text-white/40"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:c.icon},null,8,tl)],2)),e("div",sl,[e("p",{class:p(["text-sm font-medium",o(m).isEnabled(c.id)?"text-white/95":"text-white/70"])},l(c.label),3),e("p",ol,l(c.description),1)]),e("div",{class:p(["w-10 h-6 rounded-full shrink-0 transition-colors relative",o(m).isEnabled(c.id)?"bg-orange-500":"bg-white/15"])},[e("div",{class:p(["absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform",o(m).isEnabled(c.id)?"translate-x-5":"translate-x-1"])},null,2)],2)],10,el))),128))])]))),128))])]),e("div",ll,[e("div",nl,[e("div",null,[e("h2",al,l(o(t)("settings.systemUpdates")),1),e("p",il,l(o(t)("settings.systemUpdatesDesc")),1)]),We(v,{to:"/dashboard/settings/update",class:"glass-button px-4 py-2 rounded-lg text-sm flex items-center gap-2"},{default:At(()=>[s[51]||(s[51]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),X(" "+l(o(t)("common.manageUpdates")),1)]),_:1})])]),e("div",rl,[e("div",dl,[e("div",null,[e("h2",cl,l(o(t)("settings.webhookNotifications")),1),e("p",ul,l(o(t)("settings.webhookNotificationsDesc")),1)]),e("div",pl,[e("button",{onClick:wt,role:"switch","aria-checked":u.value.enabled,"aria-label":u.value.enabled?o(t)("settings.disableWebhooks"):o(t)("settings.enableWebhooks"),class:p(["w-10 h-6 rounded-full shrink-0 transition-colors relative",u.value.enabled?"bg-orange-500":"bg-white/15"]),title:u.value.enabled?o(t)("settings.disableWebhooks"):o(t)("settings.enableWebhooks")},[e("div",{class:p(["absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform",u.value.enabled?"translate-x-5":"translate-x-1"])},null,2)],10,hl)])]),e("div",bl,[e("div",null,[e("label",ml,l(o(t)("settings.webhookUrlLabel")),1),g(e("input",{"onUpdate:modelValue":s[19]||(s[19]=n=>u.value.url=n),type:"url",placeholder:o(t)("settings.webhookUrlPlaceholder"),class:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2 text-sm text-white placeholder-white/30 focus:outline-none focus:border-orange-500/50"},null,8,gl),[[x,u.value.url]])]),e("div",null,[e("label",vl,l(o(t)("settings.webhookSecretLabel")),1),g(e("input",{"onUpdate:modelValue":s[20]||(s[20]=n=>u.value.secret=n),type:"password",placeholder:o(t)("settings.webhookSecretPlaceholderFull"),class:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2 text-sm text-white placeholder-white/30 focus:outline-none focus:border-orange-500/50"},null,8,xl),[[x,u.value.secret]])]),e("div",null,[e("label",fl,l(o(t)("settings.eventsToNotify")),1),e("div",wl,[(i(!0),r(k,null,T(xt.value,n=>(i(),r("button",{key:n.id,onClick:c=>ft(n.id),role:"checkbox","aria-checked":u.value.events.includes(n.id),"aria-label":n.label,class:p(["flex items-center gap-3 p-3 rounded-lg border transition-colors text-left",u.value.events.includes(n.id)?"bg-orange-500/10 border-orange-500/30":"bg-white/5 border-white/10 hover:border-white/20"])},[e("div",{class:p(["w-5 h-5 rounded border-2 flex items-center justify-center shrink-0 transition-colors",u.value.events.includes(n.id)?"border-orange-500 bg-orange-500":"border-white/30"])},[u.value.events.includes(n.id)?(i(),r("svg",yl,[...s[52]||(s[52]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"3",d:"M5 13l4 4L19 7"},null,-1)])])):h("",!0)],2),e("div",_l,[e("p",Cl,l(n.label),1),e("p",Pl,l(n.description),1)])],10,kl))),128))])]),e("div",Sl,[e("button",{onClick:yt,disabled:ge.value,class:"glass-button px-4 py-2 rounded-lg text-sm flex items-center justify-center gap-2 bg-orange-500/20 border-orange-500/30 disabled:opacity-50"},l(ge.value?o(t)("settings.savingWebhook"):o(t)("common.saveConfiguration")),9,Ml),e("button",{onClick:_t,disabled:ve.value||!u.value.url,class:"glass-button px-4 py-2 rounded-lg text-sm flex items-center justify-center gap-2 disabled:opacity-50"},l(ve.value?o(t)("common.sending"):o(t)("common.sendTest")),9,Bl)])]),xe.value?(i(),r("div",{key:0,role:"status","aria-live":"polite",class:p(["mt-3 text-xs px-3 py-2 rounded-lg",Ie.value==="error"?"bg-red-500/15 text-red-300":"bg-green-500/15 text-green-300"])},l(xe.value),3)):h("",!0)]),e("div",jl,[e("div",Tl,[e("h2",Dl,l(o(t)("settings.backup")),1),e("p",El,l(o(t)("settings.backupRestoreDesc")),1),e("button",{onClick:s[21]||(s[21]=n=>K.value=!0),class:"w-full min-h-[44px] glass-button rounded-lg text-sm font-medium flex items-center justify-center gap-2"},[s[53]||(s[53]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)),X(" "+l(o(t)("settings.createBackup")),1)])]),je.value?(i(),r("div",Al,l(o(t)("settings.loadingBackups")),1)):pe.value.length===0?(i(),r("div",Ll,l(o(t)("settings.noBackups")),1)):(i(),r("div",$l,[(i(!0),r(k,null,T(pe.value,n=>(i(),r("div",{key:n.id,class:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 bg-white/5 rounded-lg gap-2"},[e("div",Fl,[e("div",zl,l(n.description||o(t)("settings.systemBackup")),1),e("div",Ul,l(new Date(n.created_at).toLocaleString())+" · "+l(pt(n.size_bytes)),1)]),e("div",Vl,[e("button",{onClick:c=>bt(n.id),disabled:be.value===n.id,class:"glass-button glass-button-sm px-3 py-1.5 rounded text-xs disabled:opacity-50",title:o(t)("common.verify")},l(be.value===n.id?"...":o(t)("common.verify")),9,Rl),e("button",{onClick:c=>Ct(n.id),disabled:fe.value===n.id,class:"glass-button glass-button-sm px-3 py-1.5 rounded text-xs text-blue-400 disabled:opacity-50",title:o(t)("settings.copyToUsb")},l(fe.value===n.id?"...":"USB"),9,Nl),e("button",{onClick:c=>mt(n.id),class:"glass-button glass-button-sm px-3 py-1.5 rounded text-xs text-orange-400",title:o(t)("common.restore")},l(o(t)("common.restore")),9,Hl),e("button",{onClick:c=>vt(n.id),disabled:Te.value===n.id,"aria-label":o(t)("settings.deleteBackup"),class:"glass-button glass-button-sm px-3 py-1.5 rounded text-xs text-red-400 disabled:opacity-50",title:o(t)("common.delete")}," × ",8,Il)])]))),128))])),me.value?(i(),r("div",{key:3,role:"status","aria-live":"polite",class:p(["mt-3 text-xs px-3 py-2 rounded-lg",He.value==="error"?"bg-red-500/15 text-red-300":"bg-green-500/15 text-green-300"])},l(me.value),3)):h("",!0)]),(i(),D(E,{to:"body"},[K.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:s[25]||(s[25]=_(n=>K.value=!1,["self"]))},[e("div",Wl,[e("h3",ql,l(o(t)("settings.createEncryptedBackup")),1),e("div",Ol,[e("div",null,[e("label",Kl,l(o(t)("settings.encryptionPassphrase")),1),g(e("input",{"onUpdate:modelValue":s[22]||(s[22]=n=>F.value=n),type:"password",placeholder:o(t)("settings.enterPassphrase"),class:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2 text-sm text-white placeholder-white/30 focus:outline-none focus:border-blue-500/50"},null,8,Gl),[[x,F.value]])]),e("div",null,[e("label",Ql,l(o(t)("settings.descriptionOptional")),1),g(e("input",{"onUpdate:modelValue":s[23]||(s[23]=n=>he.value=n),type:"text",placeholder:o(t)("settings.descriptionPlaceholder"),class:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2 text-sm text-white placeholder-white/30 focus:outline-none focus:border-blue-500/50"},null,8,Jl),[[x,he.value]])])]),e("div",Zl,[e("button",{onClick:s[24]||(s[24]=n=>K.value=!1),class:"glass-button px-4 py-2 rounded-lg text-sm flex-1"},l(o(t)("common.cancel")),1),e("button",{onClick:ht,disabled:G.value||!F.value,class:"glass-button px-4 py-2 rounded-lg text-sm flex-1 bg-orange-500/20 border-orange-500/30 disabled:opacity-50"},l(G.value?o(t)("settings.creatingBackup"):o(t)("settings.createBackup")),9,Xl)])])])):h("",!0)])),(i(),D(E,{to:"body"},[Q.value?(i(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/10 backdrop-blur-md",onClick:s[28]||(s[28]=_(n=>Q.value=!1,["self"]))},[e("div",Yl,[e("h3",en,l(o(t)("settings.restoreBackupTitle")),1),e("p",tn,l(o(t)("settings.restoreWarning")),1),e("div",null,[e("label",sn,l(o(t)("settings.encryptionPassphrase")),1),g(e("input",{"onUpdate:modelValue":s[26]||(s[26]=n=>z.value=n),type:"password",placeholder:o(t)("settings.enterBackupPassphrase"),class:"w-full bg-black/30 border border-white/10 rounded-lg px-3 py-2 text-sm text-white placeholder-white/30 focus:outline-none focus:border-blue-500/50"},null,8,on),[[x,z.value]])]),e("div",ln,[e("button",{onClick:s[27]||(s[27]=n=>Q.value=!1),class:"glass-button px-4 py-2 rounded-lg text-sm flex-1"},l(o(t)("common.cancel")),1),e("button",{onClick:gt,disabled:J.value||!z.value,class:"glass-button px-4 py-2 rounded-lg text-sm flex-1 bg-red-500/20 border-red-500/30 disabled:opacity-50"},l(J.value?o(t)("common.restoring"):o(t)("common.restore")),9,nn)])])])):h("",!0)])),e("div",an,[e("div",rn,[e("div",null,[e("h2",dn,l(o(t)("common.network")),1),e("p",cn,l(o(t)("settings.networkDesc")),1)]),e("button",{onClick:s[29]||(s[29]=n=>o(Y).push("/dashboard/server")),class:"glass-button px-4 py-2 rounded-lg text-sm flex items-center gap-2"},[s[54]||(s[54]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"})],-1)),X(" "+l(o(t)("common.networkDiagnostics")),1)])])]),e("div",un,[s[55]||(s[55]=e("h2",{class:"text-xl font-semibold text-red-400/90 mb-3"},"Factory Reset",-1)),s[56]||(s[56]=e("p",{class:"text-sm text-white/60 mb-4"}," Wipe all user data, identities, and credentials. Container images are preserved. The node will restart and show the onboarding screen. ",-1)),e("button",{class:"glass-button text-red-400 border-red-500/30 hover:border-red-500/50",onClick:s[30]||(s[30]=n=>U.value=!0)}," Factory Reset ")]),(i(),D(E,{to:"body"},[U.value?(i(),r("div",pn,[e("div",hn,[s[57]||(s[57]=e("h3",{class:"text-lg font-semibold text-white/90 mb-3"},"Are you sure?",-1)),s[58]||(s[58]=e("p",{class:"text-sm text-white/60 mb-6"}," This will delete all identities, credentials, and settings. This cannot be undone. ",-1)),e("div",bn,[e("button",{class:"glass-button",onClick:s[31]||(s[31]=n=>U.value=!1)},"Cancel"),e("button",{class:"glass-button text-red-400 border-red-500/30",disabled:ke.value,onClick:Oe},l(ke.value?"Resetting...":"Yes, Reset"),9,mn)])])])):h("",!0)]))])}}});export{wn as default};