ge("roomServers_messagesLimit",o));const M=d([]),P=d(!1),p=d({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});be(async()=>{await A()});async function A(){N.value=!0,j.value=null;try{const o=await x.getIdentities();o.success?c.value=o.data:j.value=o.error||"Failed to load identities"}catch(o){j.value=o instanceof Error?o.message:"Failed to load identities"}finally{N.value=!1}}async function ee(){try{const o=await x.createIdentity(p.value);o.success?(L.value=!1,q(),await A(),i(o.message||"Identity created successfully!","success")):i(`Failed to create identity: ${o.error}`,"error")}catch(o){i(`Error creating identity: ${o}`,"error")}}async function te(){try{const o=await x.updateIdentity(l.value);o.success?(B.value=!1,l.value=null,await A(),i(o.message||"Identity updated successfully!","success")):i(`Failed to update identity: ${o.error}`,"error")}catch(o){i(`Error updating identity: ${o}`,"error")}}function re(o){z.value=o,R.value=!0}async function oe(){const o=z.value;R.value=!1;try{const t=await x.deleteIdentity(o);t.success?(await A(),i(t.message||"Identity deleted successfully!","success")):i(`Failed to delete identity: ${t.error}`,"error")}catch(t){i(`Error deleting identity: ${t}`,"error")}finally{z.value=""}}function i(o,t){H.value={message:o,variant:t},U.value=!0}async function se(o){try{const t=await x.sendRoomServerAdvert(o);t.success?i(t.message||`Advert sent for '${o}'!`,"success"):i(`Failed to send advert: ${t.error}`,"error")}catch(t){i(`Error sending advert: ${t}`,"error")}}function ne(o){l.value=JSON.parse(JSON.stringify(o)),l.value.settings||(l.value.settings={}),l.value.settings.admin_password||(l.value.settings.admin_password=""),l.value.settings.guest_password||(l.value.settings.guest_password=""),_.value=!1,B.value=!0}function q(){p.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},w.value=!1}function W(){L.value=!1,B.value=!1,l.value=null,w.value=!1,_.value=!1,q()}function ae(o){S.value.has(o)?S.value.delete(o):S.value.add(o)}async function le(o){y.value=o,K.value=!0,D.value=0,O.value=!0;const t=c.value?.configured.find(r=>r.name===o);E.value=t?.hash||"",await X(),await V(!0)}async function X(){try{console.log("Fetching ACL clients for room:",y.value,"hash:",E.value);const o=await x.getACLClients({identity_hash:E.value,identity_name:y.value});console.log("ACL clients response:",o),o.success&&o.data&&(M.value=o.data.clients||[],console.log("ACL clients loaded:",M.value.length))}catch(o){console.error("Failed to fetch ACL clients:",o)}}async function V(o=!1){o&&(D.value=0,g.value=[]),$.value=!0,C.value=null;try{const t=await x.getRoomMessages({room_name:y.value,limit:F.value,offset:D.value});if(t.success&&t.data){const r=t.data.messages||[];o?g.value=r:g.value=[...g.value,...r],O.value=r.length===F.value}else C.value=t.error||"Failed to load messages"}catch(t){C.value=t instanceof Error?t.message:"Failed to load messages"}finally{$.value=!1}}async function de(){D.value+=F.value,await V(!1)}async function T(){if(k.value.trim())try{const o=await x.postRoomMessage({room_name:y.value,message:k.value,author_pubkey:"server"});o.success?(k.value="",await V(!0)):i(`Failed to send message: ${o.error}`,"error")}catch(o){i(`Error sending message: ${o}`,"error")}}async function ie(o){if(confirm("Are you sure you want to delete this message?"))try{const t=await x.deleteRoomMessage({room_name:y.value,message_id:o});t.success?(await V(!0),i("Message deleted successfully","success")):i(`Failed to delete message: ${t.error}`,"error")}catch(t){i(`Error deleting message: ${t}`,"error")}}function ue(){K.value=!1,y.value="",E.value="",g.value=[],k.value="",C.value=null,M.value=[]}function ce(o){return o?new Date(o*1e3).toLocaleString():"Unknown"}async function pe(o,t){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const r=await x.removeACLClient({public_key:o,identity_hash:t});r.success?(await X(),i("Client removed successfully","success")):i(`Failed to remove client: ${r.error}`,"error")}catch(r){i(`Error removing client: ${r}`,"error")}}return(o,t)=>(n(),s(I,null,[e("div",he,[e("div",we,[t[26]||(t[26]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),t[27]||(t[27]=e("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),e("div",_e,[t[25]||(t[25]=G('
Room Servers Manage room server identities and messages
',1)),e("button",{onClick:t[0]||(t[0]=r=>L.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},t[24]||(t[24]=[e("span",{class:"flex items-center gap-2"},[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 4v16m8-8H4"})]),b(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(n(),s("div",Ce,[e("div",Me,[t[30]||(t[30]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",je,[e("div",null,[t[28]||(t[28]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),e("div",Le,a(c.value.total_configured),1)]),t[29]||(t[29]=e("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[e("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),e("div",Se,[t[33]||(t[33]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",$e,[e("div",null,[t[31]||(t[31]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),e("div",Ae,a(c.value.total_registered),1)]),t[32]||(t[32]=e("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[e("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),e("div",Ve,[t[37]||(t[37]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Be,[e("div",null,[t[34]||(t[34]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),e("div",{class:h(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},a(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),e("div",{class:h(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(n(),s("svg",Re,t[35]||(t[35]=[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"},null,-1)]))):(n(),s("svg",ze,t[36]||(t[36]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):u("",!0),e("div",Ee,[N.value?(n(),s("div",Fe,t[38]||(t[38]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):j.value?(n(),s("div",De,[e("div",Ie,[t[39]||(t[39]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),e("div",Ne,a(j.value),1),e("button",{onClick:A,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(n(),s("div",Ue,[(n(!0),s(I,null,J(c.value.configured,r=>(n(),s("div",{key:r.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[t[46]||(t[46]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",He,[e("div",Ke,[e("div",Oe,[e("div",Pe,[r.registered?(n(),s("div",Te)):u("",!0),e("div",{class:h(["relative w-3 h-3 rounded-full",r.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),e("h3",Ge,a(r.name),1),e("span",{class:h(["px-3 py-1 text-xs font-semibold rounded-full",r.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},a(r.registered?"● Active":"○ Inactive"),3),r.hash?(n(),s("span",Je,a(r.hash),1)):u("",!0)]),e("div",qe,[e("div",null,[t[40]||(t[40]=e("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),e("span",We,a(r.settings?.node_name||"Not set"),1)]),e("div",Xe,[t[41]||(t[41]=e("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),S.value.has(r.name)?(n(),s("span",Qe,a(r.identity_key),1)):(n(),s("span",Ye," •••••••••••••••• ")),e("button",{onClick:f=>ae(r.name),class:"text-primary/70 hover:text-primary text-xs underline"},a(S.value.has(r.name)?"Hide":"Show"),9,Ze)]),e("div",null,[t[42]||(t[42]=e("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),e("span",et,a(r.settings?.latitude||0)+", "+a(r.settings?.longitude||0),1)]),r.settings?.admin_password||r.settings?.guest_password?(n(),s("div",tt,[t[43]||(t[43]=e("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),e("span",rt,[r.settings?.admin_password?(n(),s("span",ot,"Admin")):u("",!0),r.settings?.admin_password&&r.settings?.guest_password?(n(),s("span",st," / ")):u("",!0),r.settings?.guest_password?(n(),s("span",nt,"Guest")):u("",!0)])])):u("",!0)]),r.address?(n(),s("div",at," Address: "+a(r.address),1)):u("",!0)]),e("div",lt,[e("button",{onClick:f=>le(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Manage messages for this room":"Room server must be active to manage messages"},t[44]||(t[44]=[e("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"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"})],-1),b(" Messages ",-1)]),10,dt),e("button",{onClick:f=>se(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Send advert for this room server":"Room server must be active to send advert"},t[45]||(t[45]=[e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),b(" Send Advert ",-1)]),10,it),e("button",{onClick:f=>ne(r),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,ut),e("button",{onClick:f=>re(r.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,ct)])])]))),128))])):(n(),s("div",pt,[t[47]||(t[47]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),t[48]||(t[48]=e("p",{class:"text-lg mb-2"},"No room servers configured",-1)),t[49]||(t[49]=e("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),e("button",{onClick:t[1]||(t[1]=r=>L.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),L.value?(n(),s("div",mt,[e("div",vt,[t[60]||(t[60]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),e("div",xt,[e("div",null,[t[50]||(t[50]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),m(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>p.value.name=r),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.name]])]),e("div",null,[e("label",bt,[t[51]||(t[51]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[3]||(t[3]=r=>w.value=!w.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(w.value?"Hide":"Show/Edit"),1)]),w.value?(n(),s("div",yt,[m(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>p.value.identity_key=r),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.identity_key]]),t[52]||(t[52]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(n(),s("div",gt," Will be auto-generated if not provided "))]),e("div",null,[t[53]||(t[53]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>p.value.settings.node_name=r),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.node_name]])]),e("div",kt,[e("div",null,[t[54]||(t[54]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>p.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[55]||(t[55]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[7]||(t[7]=r=>p.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.longitude,void 0,{number:!0}]])])]),e("div",ft,[e("div",null,[t[56]||(t[56]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>p.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.admin_password]]),t[57]||(t[57]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[58]||(t[58]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[9]||(t[9]=r=>p.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.guest_password]]),t[59]||(t[59]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:ee,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):u("",!0),B.value&&l.value?(n(),s("div",ht,[e("div",wt,[t[72]||(t[72]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),e("div",_t,[e("div",null,[t[61]||(t[61]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),e("input",{value:l.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,Ct)]),e("div",null,[t[62]||(t[62]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),m(e("input",{"onUpdate:modelValue":t[10]||(t[10]=r=>l.value.new_name=r),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.new_name]])]),e("div",null,[e("label",Mt,[t[63]||(t[63]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[11]||(t[11]=r=>_.value=!_.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(_.value?"Hide":"Show/Edit"),1)]),_.value?(n(),s("div",jt,[m(e("input",{"onUpdate:modelValue":t[12]||(t[12]=r=>l.value.identity_key=r),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.identity_key]]),t[64]||(t[64]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(n(),s("div",Lt,' Click "Show/Edit" to change the identity key '))]),e("div",null,[t[65]||(t[65]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[13]||(t[13]=r=>l.value.settings.node_name=r),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.node_name]])]),e("div",St,[e("div",null,[t[66]||(t[66]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[14]||(t[14]=r=>l.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[67]||(t[67]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[15]||(t[15]=r=>l.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.longitude,void 0,{number:!0}]])])]),e("div",$t,[e("div",null,[t[68]||(t[68]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),m(e("input",{"onUpdate:modelValue":t[16]||(t[16]=r=>l.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.admin_password]]),t[69]||(t[69]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[70]||(t[70]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),m(e("input",{"onUpdate:modelValue":t[17]||(t[17]=r=>l.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.guest_password]]),t[71]||(t[71]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:te,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):u("",!0)]),Q(ke,{show:R.value,title:"Delete Room Server",message:`Are you sure you want to delete '${z.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:t[18]||(t[18]=r=>R.value=!1),onConfirm:oe},null,8,["show","message"]),Q(fe,{show:U.value,message:H.value.message,variant:H.value.variant,onClose:t[19]||(t[19]=r=>U.value=!1)},null,8,["show","message","variant"]),K.value?(n(),s("div",At,[e("div",Vt,[e("div",Bt,[t[79]||(t[79]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),t[80]||(t[80]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),e("div",Rt,[e("div",zt,[t[75]||(t[75]=G('
',1)),e("div",null,[t[74]||(t[74]=e("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),e("p",Et,[t[73]||(t[73]=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:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),e("span",Ft,a(y.value),1)])])]),e("div",Dt,[e("button",{onClick:t[20]||(t[20]=r=>P.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[t[76]||(t[76]=e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),t[77]||(t[77]=e("span",{class:"hidden sm:inline"},"Sessions",-1)),e("span",It,a(M.value.length),1)]),e("button",{onClick:ue,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},t[78]||(t[78]=[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("div",Nt,[$.value&&g.value.length===0?(n(),s("div",Ut,t[81]||(t[81]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):C.value?(n(),s("div",Ht,[e("div",Kt,[t[82]||(t[82]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),e("div",Ot,a(C.value),1),e("button",{onClick:t[21]||(t[21]=r=>V(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):g.value.length>0?(n(),s("div",Pt,[(n(!0),s(I,null,J(g.value,(r,f)=>(n(),s("div",{key:r.id||f,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[t[87]||(t[87]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Tt,[e("div",Gt,[e("div",Jt,[e("div",qt,[t[84]||(t[84]=e("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[e("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),r.author_name?(n(),s("span",Wt,a(r.author_name),1)):u("",!0),r.author_pubkey?(n(),s("span",Xt,a(r.author_pubkey.substring(0,8))+"... ",1)):(n(),s("span",Qt," Anonymous ")),t[85]||(t[85]=e("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),e("span",Yt,[t[83]||(t[83]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),b(" "+a(ce(r.timestamp)),1)]),r.id?(n(),s("span",Zt," #"+a(r.id),1)):u("",!0)])]),e("div",er,a(r.message_text),1)]),e("button",{onClick:me=>ie(r.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},t[86]||(t[86]=[e("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,tr)])]))),128)),O.value&&!$.value?(n(),s("div",rr,[e("button",{onClick:de,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},t[88]||(t[88]=[e("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),b(" Load More Messages ",-1)]))])):$.value?(n(),s("div",or,t[89]||(t[89]=[e("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[e("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),b(" Loading... ")],-1)]))):u("",!0)])):(n(),s("div",sr,t[90]||(t[90]=[G('
No messages yet
Be the first to start the conversation
',1)])))]),e("div",nr,[t[93]||(t[93]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),e("div",ar,[e("div",lr,[e("div",dr,[m(e("textarea",{"onUpdate:modelValue":t[22]||(t[22]=r=>k.value=r),onKeydown:[Y(Z(T,["ctrl"]),["enter"]),Y(Z(T,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,ir),[[v,k.value]])]),e("button",{onClick:T,disabled:!k.value.trim(),class:h(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",k.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},t[91]||(t[91]=[e("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),e("span",{class:"hidden sm:inline"},"Send",-1)]),10,ur)]),t[92]||(t[92]=e("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),b(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):u("",!0),P.value?(n(),s("div",cr,[e("div",pr,[e("div",mr,[e("div",null,[t[95]||(t[95]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),e("p",vr,[t[94]||(t[94]=b("Room: ",-1)),e("span",xr,a(y.value),1)])]),e("button",{onClick:t[23]||(t[23]=r=>P.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},t[96]||(t[96]=[e("svg",{class:"w-6 h-6",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("div",br,[M.value.length===0?(n(),s("div",yr,t[97]||(t[97]=[e("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):u("",!0),(n(!0),s(I,null,J(M.value,(r,f)=>(n(),s("div",{key:r.public_key_full||f,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[e("div",gr,[e("div",kr,[e("div",fr,[e("span",hr,a(r.identity_name||"Unknown"),1),e("span",{class:h(["px-2 py-0.5 text-xs font-medium rounded",r.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},a(r.permissions),3)]),e("div",wr,[e("span",_r,a(r.identity_type),1),e("button",{onClick:me=>pe(r.public_key_full,r.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,Cr)])]),e("div",Mr,[e("div",jr,[t[98]||(t[98]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),e("code",Lr,a(r.public_key),1)]),e("div",Sr,[t[99]||(t[99]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),e("code",$r,a(r.public_key_full),1)])]),e("div",Ar,[e("div",Vr,[r.address?(n(),s("span",Br,"📍 "+a(r.address),1)):u("",!0),r.last_login_success?(n(),s("span",Rr,"Last Login: "+a(new Date(r.last_login_success*1e3).toLocaleString()),1)):u("",!0)]),r.last_activity?(n(),s("span",zr,"Active: "+a(Math.floor((Date.now()/1e3-r.last_activity)/60))+"m ago",1)):u("",!0)])])]))),128))])])])):u("",!0)],64))}});export{Ur as default};
+import{a as ve,r as d,D as xe,o as be,L as x,b as s,e,f as Q,g as u,i as G,k as b,t as a,j as h,F as I,h as J,w as m,v,X as Y,s as Z,p as n}from"./index-D0IT5vDS.js";import{g as ye,s as ge}from"./preferences-DtwbSSgO.js";import{_ as ke}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-CidOa_xU.js";import{_ as fe}from"./MessageDialog.vue_vue_type_script_setup_true_lang-C6ugQFfD.js";const he={class:"p-6 space-y-6"},we={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},_e={class:"relative flex items-center justify-between"},Ce={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Me={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},je={class:"relative flex items-center justify-between"},Le={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},Se={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},$e={class:"relative flex items-center justify-between"},Ae={class:"text-3xl font-bold text-primary mb-1"},Ve={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},Be={class:"relative flex items-center justify-between"},Re={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ze={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ee={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},Fe={key:0,class:"flex items-center justify-center py-12"},De={key:1,class:"flex items-center justify-center py-12"},Ie={class:"text-center"},Ne={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Ue={key:2,class:"space-y-4"},He={class:"relative flex items-start justify-between"},Ke={class:"flex-1"},Oe={class:"flex items-center gap-3 mb-4"},Pe={class:"relative"},Te={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},Ge={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},Je={key:0,class:"text-content-muted dark:text-content-muted text-sm"},qe={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},We={class:"text-content-primary dark:text-content-primary/90 ml-2"},Xe={class:"flex items-center gap-2"},Qe={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},Ye={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},Ze=["onClick"],et={class:"text-content-primary dark:text-content-primary/90 ml-2"},tt={key:0},rt={class:"text-content-primary dark:text-content-primary/90 ml-2"},ot={key:0,class:"text-accent-green"},st={key:1,class:"text-content-muted dark:text-content-muted"},nt={key:2,class:"text-primary"},at={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},lt={class:"ml-4 flex flex-wrap gap-2"},dt=["onClick","disabled","title"],it=["onClick","disabled","title"],ut=["onClick"],ct=["onClick"],pt={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},mt={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},xt={class:"space-y-4"},bt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},yt={key:0},gt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},kt={class:"grid grid-cols-2 gap-4"},ft={class:"grid grid-cols-2 gap-4"},ht={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},wt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},_t={class:"space-y-4"},Ct=["value"],Mt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},jt={key:0},Lt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},St={class:"grid grid-cols-2 gap-4"},$t={class:"grid grid-cols-2 gap-4"},At={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},Vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},Bt={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},Rt={class:"relative flex items-center justify-between"},zt={class:"flex items-center gap-4"},Et={class:"text-content-secondary dark:text-content-muted text-sm flex items-center gap-2"},Ft={class:"text-primary font-semibold"},Dt={class:"flex items-center gap-2"},It={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},Nt={class:"flex-1 overflow-y-auto mb-4 space-y-3"},Ut={key:0,class:"flex items-center justify-center py-12"},Ht={key:1,class:"flex items-center justify-center py-12"},Kt={class:"text-center"},Ot={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Pt={key:2,class:"space-y-3"},Tt={class:"relative flex items-start justify-between gap-3"},Gt={class:"flex-1 min-w-0"},Jt={class:"flex items-center gap-2 mb-3"},qt={class:"flex items-center gap-2 flex-wrap"},Wt={key:0,class:"text-primary text-sm font-bold"},Xt={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},Qt={key:2,class:"text-content-muted dark:text-content-muted text-xs"},Yt={class:"text-content-secondary dark:text-content-muted text-xs flex items-center gap-1"},Zt={key:3,class:"text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded"},er={class:"text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5"},tr=["onClick"],rr={key:0,class:"text-center pt-4"},or={key:1,class:"text-center pt-4"},sr={key:3,class:"flex items-center justify-center h-full"},nr={class:"relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4"},ar={class:"relative space-y-3"},lr={class:"flex gap-3"},dr={class:"flex-1 relative"},ir=["onKeydown"],ur=["disabled"],cr={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},pr={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},mr={class:"flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10"},vr={class:"text-content-secondary dark:text-content-primary/70 text-sm mt-1"},xr={class:"text-primary"},br={class:"flex-1 overflow-y-auto space-y-3"},yr={key:0,class:"text-center py-12"},gr={class:"space-y-2"},kr={class:"flex items-center justify-between"},fr={class:"flex items-center gap-2"},hr={class:"text-content-primary dark:text-content-primary font-semibold"},wr={class:"flex items-center gap-2"},_r={class:"text-content-secondary dark:text-content-muted text-xs"},Cr=["onClick"],Mr={class:"space-y-1 text-xs"},jr={class:"flex items-center gap-2"},Lr={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},Sr={class:"flex items-center gap-2"},$r={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},Ar={class:"flex items-center justify-between text-xs text-content-secondary dark:text-content-muted"},Vr={class:"flex items-center gap-4"},Br={key:0},Rr={key:1},zr={key:0},Ur=ve({name:"RoomServersView",__name:"RoomServers",setup(Er){const N=d(!1),j=d(null),c=d(null),L=d(!1),B=d(!1),l=d(null),w=d(!1),_=d(!1),S=d(new Set),R=d(!1),z=d(""),U=d(!1),H=d({message:"",variant:"success"}),K=d(!1),y=d(""),E=d(""),g=d([]),$=d(!1),C=d(null),k=d(""),F=d(ye("roomServers_messagesLimit",50)),D=d(0),O=d(!0);xe(F,o=>ge("roomServers_messagesLimit",o));const M=d([]),P=d(!1),p=d({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});be(async()=>{await A()});async function A(){N.value=!0,j.value=null;try{const o=await x.getIdentities();o.success?c.value=o.data:j.value=o.error||"Failed to load identities"}catch(o){j.value=o instanceof Error?o.message:"Failed to load identities"}finally{N.value=!1}}async function ee(){try{const o=await x.createIdentity(p.value);o.success?(L.value=!1,q(),await A(),i(o.message||"Identity created successfully!","success")):i(`Failed to create identity: ${o.error}`,"error")}catch(o){i(`Error creating identity: ${o}`,"error")}}async function te(){try{const o=await x.updateIdentity(l.value);o.success?(B.value=!1,l.value=null,await A(),i(o.message||"Identity updated successfully!","success")):i(`Failed to update identity: ${o.error}`,"error")}catch(o){i(`Error updating identity: ${o}`,"error")}}function re(o){z.value=o,R.value=!0}async function oe(){const o=z.value;R.value=!1;try{const t=await x.deleteIdentity(o);t.success?(await A(),i(t.message||"Identity deleted successfully!","success")):i(`Failed to delete identity: ${t.error}`,"error")}catch(t){i(`Error deleting identity: ${t}`,"error")}finally{z.value=""}}function i(o,t){H.value={message:o,variant:t},U.value=!0}async function se(o){try{const t=await x.sendRoomServerAdvert(o);t.success?i(t.message||`Advert sent for '${o}'!`,"success"):i(`Failed to send advert: ${t.error}`,"error")}catch(t){i(`Error sending advert: ${t}`,"error")}}function ne(o){l.value=JSON.parse(JSON.stringify(o)),l.value.settings||(l.value.settings={}),l.value.settings.admin_password||(l.value.settings.admin_password=""),l.value.settings.guest_password||(l.value.settings.guest_password=""),_.value=!1,B.value=!0}function q(){p.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},w.value=!1}function W(){L.value=!1,B.value=!1,l.value=null,w.value=!1,_.value=!1,q()}function ae(o){S.value.has(o)?S.value.delete(o):S.value.add(o)}async function le(o){y.value=o,K.value=!0,D.value=0,O.value=!0;const t=c.value?.configured.find(r=>r.name===o);E.value=t?.hash||"",await X(),await V(!0)}async function X(){try{console.log("Fetching ACL clients for room:",y.value,"hash:",E.value);const o=await x.getACLClients({identity_hash:E.value,identity_name:y.value});console.log("ACL clients response:",o),o.success&&o.data&&(M.value=o.data.clients||[],console.log("ACL clients loaded:",M.value.length))}catch(o){console.error("Failed to fetch ACL clients:",o)}}async function V(o=!1){o&&(D.value=0,g.value=[]),$.value=!0,C.value=null;try{const t=await x.getRoomMessages({room_name:y.value,limit:F.value,offset:D.value});if(t.success&&t.data){const r=t.data.messages||[];o?g.value=r:g.value=[...g.value,...r],O.value=r.length===F.value}else C.value=t.error||"Failed to load messages"}catch(t){C.value=t instanceof Error?t.message:"Failed to load messages"}finally{$.value=!1}}async function de(){D.value+=F.value,await V(!1)}async function T(){if(k.value.trim())try{const o=await x.postRoomMessage({room_name:y.value,message:k.value,author_pubkey:"server"});o.success?(k.value="",await V(!0)):i(`Failed to send message: ${o.error}`,"error")}catch(o){i(`Error sending message: ${o}`,"error")}}async function ie(o){if(confirm("Are you sure you want to delete this message?"))try{const t=await x.deleteRoomMessage({room_name:y.value,message_id:o});t.success?(await V(!0),i("Message deleted successfully","success")):i(`Failed to delete message: ${t.error}`,"error")}catch(t){i(`Error deleting message: ${t}`,"error")}}function ue(){K.value=!1,y.value="",E.value="",g.value=[],k.value="",C.value=null,M.value=[]}function ce(o){return o?new Date(o*1e3).toLocaleString():"Unknown"}async function pe(o,t){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const r=await x.removeACLClient({public_key:o,identity_hash:t});r.success?(await X(),i("Client removed successfully","success")):i(`Failed to remove client: ${r.error}`,"error")}catch(r){i(`Error removing client: ${r}`,"error")}}return(o,t)=>(n(),s(I,null,[e("div",he,[e("div",we,[t[26]||(t[26]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),t[27]||(t[27]=e("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),e("div",_e,[t[25]||(t[25]=G('
Room Servers Manage room server identities and messages
',1)),e("button",{onClick:t[0]||(t[0]=r=>L.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},t[24]||(t[24]=[e("span",{class:"flex items-center gap-2"},[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 4v16m8-8H4"})]),b(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(n(),s("div",Ce,[e("div",Me,[t[30]||(t[30]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",je,[e("div",null,[t[28]||(t[28]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),e("div",Le,a(c.value.total_configured),1)]),t[29]||(t[29]=e("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[e("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),e("div",Se,[t[33]||(t[33]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",$e,[e("div",null,[t[31]||(t[31]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),e("div",Ae,a(c.value.total_registered),1)]),t[32]||(t[32]=e("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[e("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),e("div",Ve,[t[37]||(t[37]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Be,[e("div",null,[t[34]||(t[34]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),e("div",{class:h(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},a(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),e("div",{class:h(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(n(),s("svg",Re,t[35]||(t[35]=[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"},null,-1)]))):(n(),s("svg",ze,t[36]||(t[36]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):u("",!0),e("div",Ee,[N.value?(n(),s("div",Fe,t[38]||(t[38]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):j.value?(n(),s("div",De,[e("div",Ie,[t[39]||(t[39]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),e("div",Ne,a(j.value),1),e("button",{onClick:A,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(n(),s("div",Ue,[(n(!0),s(I,null,J(c.value.configured,r=>(n(),s("div",{key:r.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[t[46]||(t[46]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",He,[e("div",Ke,[e("div",Oe,[e("div",Pe,[r.registered?(n(),s("div",Te)):u("",!0),e("div",{class:h(["relative w-3 h-3 rounded-full",r.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),e("h3",Ge,a(r.name),1),e("span",{class:h(["px-3 py-1 text-xs font-semibold rounded-full",r.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},a(r.registered?"● Active":"○ Inactive"),3),r.hash?(n(),s("span",Je,a(r.hash),1)):u("",!0)]),e("div",qe,[e("div",null,[t[40]||(t[40]=e("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),e("span",We,a(r.settings?.node_name||"Not set"),1)]),e("div",Xe,[t[41]||(t[41]=e("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),S.value.has(r.name)?(n(),s("span",Qe,a(r.identity_key),1)):(n(),s("span",Ye," •••••••••••••••• ")),e("button",{onClick:f=>ae(r.name),class:"text-primary/70 hover:text-primary text-xs underline"},a(S.value.has(r.name)?"Hide":"Show"),9,Ze)]),e("div",null,[t[42]||(t[42]=e("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),e("span",et,a(r.settings?.latitude||0)+", "+a(r.settings?.longitude||0),1)]),r.settings?.admin_password||r.settings?.guest_password?(n(),s("div",tt,[t[43]||(t[43]=e("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),e("span",rt,[r.settings?.admin_password?(n(),s("span",ot,"Admin")):u("",!0),r.settings?.admin_password&&r.settings?.guest_password?(n(),s("span",st," / ")):u("",!0),r.settings?.guest_password?(n(),s("span",nt,"Guest")):u("",!0)])])):u("",!0)]),r.address?(n(),s("div",at," Address: "+a(r.address),1)):u("",!0)]),e("div",lt,[e("button",{onClick:f=>le(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Manage messages for this room":"Room server must be active to manage messages"},t[44]||(t[44]=[e("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"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"})],-1),b(" Messages ",-1)]),10,dt),e("button",{onClick:f=>se(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Send advert for this room server":"Room server must be active to send advert"},t[45]||(t[45]=[e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),b(" Send Advert ",-1)]),10,it),e("button",{onClick:f=>ne(r),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,ut),e("button",{onClick:f=>re(r.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,ct)])])]))),128))])):(n(),s("div",pt,[t[47]||(t[47]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),t[48]||(t[48]=e("p",{class:"text-lg mb-2"},"No room servers configured",-1)),t[49]||(t[49]=e("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),e("button",{onClick:t[1]||(t[1]=r=>L.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),L.value?(n(),s("div",mt,[e("div",vt,[t[60]||(t[60]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),e("div",xt,[e("div",null,[t[50]||(t[50]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),m(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>p.value.name=r),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.name]])]),e("div",null,[e("label",bt,[t[51]||(t[51]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[3]||(t[3]=r=>w.value=!w.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(w.value?"Hide":"Show/Edit"),1)]),w.value?(n(),s("div",yt,[m(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>p.value.identity_key=r),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.identity_key]]),t[52]||(t[52]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(n(),s("div",gt," Will be auto-generated if not provided "))]),e("div",null,[t[53]||(t[53]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>p.value.settings.node_name=r),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.node_name]])]),e("div",kt,[e("div",null,[t[54]||(t[54]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>p.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[55]||(t[55]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[7]||(t[7]=r=>p.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.longitude,void 0,{number:!0}]])])]),e("div",ft,[e("div",null,[t[56]||(t[56]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>p.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.admin_password]]),t[57]||(t[57]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[58]||(t[58]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[9]||(t[9]=r=>p.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.guest_password]]),t[59]||(t[59]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:ee,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):u("",!0),B.value&&l.value?(n(),s("div",ht,[e("div",wt,[t[72]||(t[72]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),e("div",_t,[e("div",null,[t[61]||(t[61]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),e("input",{value:l.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,Ct)]),e("div",null,[t[62]||(t[62]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),m(e("input",{"onUpdate:modelValue":t[10]||(t[10]=r=>l.value.new_name=r),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.new_name]])]),e("div",null,[e("label",Mt,[t[63]||(t[63]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[11]||(t[11]=r=>_.value=!_.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(_.value?"Hide":"Show/Edit"),1)]),_.value?(n(),s("div",jt,[m(e("input",{"onUpdate:modelValue":t[12]||(t[12]=r=>l.value.identity_key=r),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.identity_key]]),t[64]||(t[64]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(n(),s("div",Lt,' Click "Show/Edit" to change the identity key '))]),e("div",null,[t[65]||(t[65]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[13]||(t[13]=r=>l.value.settings.node_name=r),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.node_name]])]),e("div",St,[e("div",null,[t[66]||(t[66]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[14]||(t[14]=r=>l.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[67]||(t[67]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[15]||(t[15]=r=>l.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.longitude,void 0,{number:!0}]])])]),e("div",$t,[e("div",null,[t[68]||(t[68]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),m(e("input",{"onUpdate:modelValue":t[16]||(t[16]=r=>l.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.admin_password]]),t[69]||(t[69]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[70]||(t[70]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),m(e("input",{"onUpdate:modelValue":t[17]||(t[17]=r=>l.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.guest_password]]),t[71]||(t[71]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:te,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):u("",!0)]),Q(ke,{show:R.value,title:"Delete Room Server",message:`Are you sure you want to delete '${z.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:t[18]||(t[18]=r=>R.value=!1),onConfirm:oe},null,8,["show","message"]),Q(fe,{show:U.value,message:H.value.message,variant:H.value.variant,onClose:t[19]||(t[19]=r=>U.value=!1)},null,8,["show","message","variant"]),K.value?(n(),s("div",At,[e("div",Vt,[e("div",Bt,[t[79]||(t[79]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),t[80]||(t[80]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),e("div",Rt,[e("div",zt,[t[75]||(t[75]=G('
',1)),e("div",null,[t[74]||(t[74]=e("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),e("p",Et,[t[73]||(t[73]=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:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),e("span",Ft,a(y.value),1)])])]),e("div",Dt,[e("button",{onClick:t[20]||(t[20]=r=>P.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[t[76]||(t[76]=e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),t[77]||(t[77]=e("span",{class:"hidden sm:inline"},"Sessions",-1)),e("span",It,a(M.value.length),1)]),e("button",{onClick:ue,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},t[78]||(t[78]=[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("div",Nt,[$.value&&g.value.length===0?(n(),s("div",Ut,t[81]||(t[81]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):C.value?(n(),s("div",Ht,[e("div",Kt,[t[82]||(t[82]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),e("div",Ot,a(C.value),1),e("button",{onClick:t[21]||(t[21]=r=>V(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):g.value.length>0?(n(),s("div",Pt,[(n(!0),s(I,null,J(g.value,(r,f)=>(n(),s("div",{key:r.id||f,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[t[87]||(t[87]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Tt,[e("div",Gt,[e("div",Jt,[e("div",qt,[t[84]||(t[84]=e("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[e("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),r.author_name?(n(),s("span",Wt,a(r.author_name),1)):u("",!0),r.author_pubkey?(n(),s("span",Xt,a(r.author_pubkey.substring(0,8))+"... ",1)):(n(),s("span",Qt," Anonymous ")),t[85]||(t[85]=e("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),e("span",Yt,[t[83]||(t[83]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),b(" "+a(ce(r.timestamp)),1)]),r.id?(n(),s("span",Zt," #"+a(r.id),1)):u("",!0)])]),e("div",er,a(r.message_text),1)]),e("button",{onClick:me=>ie(r.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},t[86]||(t[86]=[e("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,tr)])]))),128)),O.value&&!$.value?(n(),s("div",rr,[e("button",{onClick:de,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},t[88]||(t[88]=[e("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),b(" Load More Messages ",-1)]))])):$.value?(n(),s("div",or,t[89]||(t[89]=[e("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[e("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),b(" Loading... ")],-1)]))):u("",!0)])):(n(),s("div",sr,t[90]||(t[90]=[G('
No messages yet
Be the first to start the conversation
',1)])))]),e("div",nr,[t[93]||(t[93]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),e("div",ar,[e("div",lr,[e("div",dr,[m(e("textarea",{"onUpdate:modelValue":t[22]||(t[22]=r=>k.value=r),onKeydown:[Y(Z(T,["ctrl"]),["enter"]),Y(Z(T,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,ir),[[v,k.value]])]),e("button",{onClick:T,disabled:!k.value.trim(),class:h(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",k.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},t[91]||(t[91]=[e("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),e("span",{class:"hidden sm:inline"},"Send",-1)]),10,ur)]),t[92]||(t[92]=e("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),b(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):u("",!0),P.value?(n(),s("div",cr,[e("div",pr,[e("div",mr,[e("div",null,[t[95]||(t[95]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),e("p",vr,[t[94]||(t[94]=b("Room: ",-1)),e("span",xr,a(y.value),1)])]),e("button",{onClick:t[23]||(t[23]=r=>P.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},t[96]||(t[96]=[e("svg",{class:"w-6 h-6",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("div",br,[M.value.length===0?(n(),s("div",yr,t[97]||(t[97]=[e("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):u("",!0),(n(!0),s(I,null,J(M.value,(r,f)=>(n(),s("div",{key:r.public_key_full||f,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[e("div",gr,[e("div",kr,[e("div",fr,[e("span",hr,a(r.identity_name||"Unknown"),1),e("span",{class:h(["px-2 py-0.5 text-xs font-medium rounded",r.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},a(r.permissions),3)]),e("div",wr,[e("span",_r,a(r.identity_type),1),e("button",{onClick:me=>pe(r.public_key_full,r.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,Cr)])]),e("div",Mr,[e("div",jr,[t[98]||(t[98]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),e("code",Lr,a(r.public_key),1)]),e("div",Sr,[t[99]||(t[99]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),e("code",$r,a(r.public_key_full),1)])]),e("div",Ar,[e("div",Vr,[r.address?(n(),s("span",Br,"📍 "+a(r.address),1)):u("",!0),r.last_login_success?(n(),s("span",Rr,"Last Login: "+a(new Date(r.last_login_success*1e3).toLocaleString()),1)):u("",!0)]),r.last_activity?(n(),s("span",zr,"Active: "+a(Math.floor((Date.now()/1e3-r.last_activity)/60))+"m ago",1)):u("",!0)])])]))),128))])])])):u("",!0)],64))}});export{Ur as default};
diff --git a/repeater/web/html/assets/Sessions-DSu8xKSv.js b/repeater/web/html/assets/Sessions-DSu8xKSv.js
new file mode 100644
index 0000000..95ef7a5
--- /dev/null
+++ b/repeater/web/html/assets/Sessions-DSu8xKSv.js
@@ -0,0 +1 @@
+import{a as B,r as c,o as V,L as g,c as N,b as o,e as t,g as l,t as n,F as i,h as k,w as D,q as z,j as d,k as F,p as r}from"./index-D0IT5vDS.js";const T={class:"p-6 space-y-6"},$={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},E={class:"glass-card rounded-[15px] p-4"},H={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},O={class:"glass-card rounded-[15px] p-4"},P={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},G={class:"glass-card rounded-[15px] p-4"},q={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},U={class:"glass-card rounded-[15px] p-4"},J={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},K={class:"glass-card rounded-[15px] p-6"},Q={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},W=["onClick"],X={class:"flex items-center gap-2"},Y={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Z={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},et={class:"min-h-[400px]"},st={key:0,class:"flex items-center justify-center py-12"},nt={key:1,class:"flex items-center justify-center py-12"},ot={class:"text-center"},rt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},at={key:2,class:"space-y-4"},dt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},ct={key:1,class:"space-y-4"},lt={class:"flex items-start justify-between"},it={class:"flex-1 min-w-0"},xt={class:"flex items-center gap-2 flex-wrap mb-3"},ut={class:"text-lg font-semibold text-content-primary dark:text-content-primary truncate"},mt={class:"flex flex-wrap items-center gap-x-4 gap-y-2 text-sm"},pt={key:0,class:"flex items-center gap-1.5"},kt={class:"text-content-secondary dark:text-content-muted"},vt={key:1,class:"flex items-center gap-1.5"},yt={class:"text-content-secondary dark:text-content-muted"},_t={key:2,class:"text-content-secondary dark:text-content-muted font-mono text-xs"},bt={key:3,class:"text-content-muted dark:text-content-muted font-mono text-xs"},gt={key:0,class:"text-content-muted dark:text-content-muted text-xs mt-2 mb-0"},ht={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},ft={class:"text-content-primary dark:text-content-primary font-medium"},wt={class:"text-cyan-500 dark:text-primary font-medium"},Ct={class:"mt-3 flex items-center gap-2"},At={key:3,class:"space-y-4"},Lt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},St={key:1,class:"overflow-x-auto"},Nt={class:"w-full"},Mt={class:"py-3"},Rt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},It={class:"py-3"},jt={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},Bt={class:"py-3"},Vt={class:"text-sm text-content-primary dark:text-content-primary"},Dt={class:"text-xs text-content-muted dark:text-content-muted"},zt={class:"py-3"},Ft={class:"py-3"},Tt={class:"text-sm text-content-secondary dark:text-content-muted"},$t={class:"py-3"},Et=["onClick"],Ht={key:4,class:"space-y-4"},Ot={class:"mb-4"},Pt=["value"],Gt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},qt={key:1,class:"grid grid-cols-1 gap-4"},Ut={class:"flex items-start justify-between"},Jt={class:"flex-1"},Kt={class:"flex items-center gap-3 mb-3"},Qt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Wt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},Xt={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},Yt={class:"text-content-primary dark:text-content-primary/90 ml-2"},Zt={class:"text-content-primary dark:text-content-primary/90 ml-2"},te={class:"text-content-primary dark:text-content-primary/90 ml-2"},ee=["onClick"],se={class:"flex justify-end"},ne=["disabled"],ae=B({name:"SessionsView",__name:"Sessions",setup(oe){const u=c("overview"),w=c(!1),m=c(!1),v=c(null),h=c(null),p=c([]),x=c(null),y=c(null),M=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];V(async()=>{await _(),w.value=!0});async function _(){m.value=!0,v.value=null;try{const a=await g.getACLInfo();a.success&&(h.value=a.data);const s=await g.getACLClients();s.success&&s.data&&(p.value=s.data.clients||[]);const e=await g.getACLStats();e.success&&(x.value=e.data)}catch(a){v.value=a instanceof Error?a.message:"Failed to load ACL data",console.error("Error fetching ACL data:",a)}finally{m.value=!1}}async function C(a,s){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const e=await g.removeACLClient({public_key:a,identity_hash:s});e.success?await _():alert(`Failed to remove client: ${e.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function b(a){return a?new Date(a*1e3).toLocaleString():"Never"}function R(a){u.value=a}const A=N(()=>y.value?p.value.filter(a=>a.identity_name===y.value):p.value),f=N(()=>h.value?h.value.acls||[]:[]);function I(a){return a?.type==="companion"}function j(a){return a==="repeater"?"bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary":a==="companion"?"bg-violet-500/20 dark:bg-violet-400/20 text-violet-700 dark:text-violet-300":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"}function L(a){return a==null?"N/A":typeof a=="boolean"?a?"✓":"✗":String(a)}return(a,s)=>(r(),o("div",T,[s[22]||(s[22]=t("div",null,[t("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"Sessions & Access Control"),t("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Manage authenticated clients and access control lists"),t("p",{class:"text-content-muted dark:text-content-muted text-sm mt-1"},"Repeater, room servers, and companion identities; companions do not accept client logins.")],-1)),x.value?(r(),o("div",$,[t("div",E,[s[1]||(s[1]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Total Identities",-1)),t("div",H,n(x.value.total_identities),1)]),t("div",O,[s[2]||(s[2]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Authenticated Clients",-1)),t("div",P,n(x.value.total_clients),1)]),t("div",G,[s[3]||(s[3]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Admin Clients",-1)),t("div",q,n(x.value.admin_clients),1)]),t("div",U,[s[4]||(s[4]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Guest Clients",-1)),t("div",J,n(x.value.guest_clients),1)])])):l("",!0),t("div",K,[t("div",Q,[(r(),o(i,null,k(M,e=>t("button",{key:e.id,onClick:S=>R(e.id),class:d(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",u.value===e.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[t("div",X,[e.icon==="overview"?(r(),o("svg",Y,s[5]||(s[5]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):e.icon==="clients"?(r(),o("svg",Z,s[6]||(s[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):e.icon==="identities"?(r(),o("svg",tt,s[7]||(s[7]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):l("",!0),F(" "+n(e.label),1)])],10,W)),64))]),t("div",et,[m.value&&!w.value?(r(),o("div",st,s[8]||(s[8]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),t("div",{class:"text-content-secondary dark:text-content-muted"},"Loading ACL data...")],-1)]))):v.value?(r(),o("div",nt,[t("div",ot,[s[9]||(s[9]=t("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load ACL data",-1)),t("div",rt,n(v.value),1),t("button",{onClick:_,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):u.value==="overview"?(r(),o("div",at,[f.value.length===0?(r(),o("div",dt," No identities configured ")):(r(),o("div",ct,[(r(!0),o(i,null,k(f.value,e=>(r(),o("div",{key:e.hash,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors"},[t("div",lt,[t("div",it,[t("div",xt,[t("h3",ut,n(e.name),1),t("span",{class:d(["px-2 py-0.5 text-xs font-medium rounded shrink-0",j(e.type)])},n(e.type),3)]),I(e)?(r(),o(i,{key:0},[t("div",mt,[e.registered!==void 0?(r(),o("span",pt,[t("span",{class:d(["w-2 h-2 rounded-full shrink-0",e.registered?"bg-accent-green":"bg-accent-red"]),"aria-hidden":""},null,2),t("span",kt,"Registered: "+n(e.registered?"Active":"Inactive"),1)])):l("",!0),e.active!==void 0?(r(),o("span",vt,[t("span",{class:d(["w-2 h-2 rounded-full shrink-0",e.active?"bg-accent-green":"bg-accent-red"]),"aria-hidden":""},null,2),t("span",yt,"Bridge: "+n(e.active?"Connected":"Disconnected"),1)])):l("",!0),e.client_ip?(r(),o("span",_t," Client: "+n(e.client_ip),1)):l("",!0),e.hash?(r(),o("span",bt," Hash: "+n(e.hash),1)):l("",!0)]),e.last_seen!=null?(r(),o("p",gt," Last seen: "+n(b(e.last_seen)),1)):l("",!0)],64)):(r(),o(i,{key:1},[t("div",ht,[t("div",null,[s[10]||(s[10]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Max Clients",-1)),t("div",ft,n(L(e.max_clients)),1)]),t("div",null,[s[11]||(s[11]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Authenticated",-1)),t("div",wt,n(L(e.authenticated_clients)),1)]),t("div",null,[s[12]||(s[12]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Admin Password",-1)),t("div",{class:d(e.has_admin_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_admin_password!=null?e.has_admin_password?"✓ Set":"✗ Not Set":"N/A"),3)]),t("div",null,[s[13]||(s[13]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Guest Password",-1)),t("div",{class:d(e.has_guest_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_guest_password!=null?e.has_guest_password?"✓ Set":"✗ Not Set":"N/A"),3)])]),t("div",Ct,[s[14]||(s[14]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"Read-Only Access:",-1)),t("span",{class:d(e.allow_read_only?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.allow_read_only!=null?e.allow_read_only?"Allowed":"Disabled":"N/A"),3)])],64))])])]))),128))]))])):u.value==="clients"?(r(),o("div",At,[p.value.length===0?(r(),o("div",Lt," No authenticated clients ")):(r(),o("div",St,[t("table",Nt,[s[15]||(s[15]=t("thead",null,[t("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Client"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Address"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Identity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Permissions"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Last Activity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Actions")])],-1)),t("tbody",null,[(r(!0),o(i,null,k(p.value,e=>(r(),o("tr",{key:e.public_key_full,class:"border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors"},[t("td",Mt,[t("div",Rt,n(e.public_key),1)]),t("td",It,[t("div",jt,n(e.address),1)]),t("td",Bt,[t("div",Vt,n(e.identity_name),1),t("div",Dt,n(e.identity_hash),1)]),t("td",zt,[t("span",{class:d(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3)]),t("td",Ft,[t("div",Tt,n(b(e.last_activity)),1)]),t("td",$t,[t("button",{onClick:S=>C(e.public_key_full,e.identity_hash),class:"px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,Et)])]))),128))])])]))])):u.value==="identities"?(r(),o("div",Ht,[t("div",Ot,[s[17]||(s[17]=t("label",{class:"block text-content-secondary dark:text-content-muted text-sm mb-2"},"Filter by Identity",-1)),D(t("select",{"onUpdate:modelValue":s[0]||(s[0]=e=>y.value=e),class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors"},[s[16]||(s[16]=t("option",{value:null},"All Identities",-1)),(r(!0),o(i,null,k(f.value,e=>(r(),o("option",{key:e.name,value:e.name},n(e.name)+" ("+n(e.authenticated_clients??0)+" clients) ",9,Pt))),128))],512),[[z,y.value]])]),A.value.length===0?(r(),o("div",Gt," No clients for selected identity ")):(r(),o("div",qt,[(r(!0),o(i,null,k(A.value,e=>(r(),o("div",{key:e.public_key_full,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[t("div",Ut,[t("div",Jt,[t("div",Kt,[t("span",{class:d(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3),t("span",Qt,n(e.public_key),1)]),t("div",Wt,[t("div",null,[s[18]||(s[18]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Address:",-1)),t("span",Xt,n(e.address),1)]),t("div",null,[s[19]||(s[19]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Identity:",-1)),t("span",Yt,n(e.identity_name)+" ("+n(e.identity_hash)+")",1)]),t("div",null,[s[20]||(s[20]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Activity:",-1)),t("span",Zt,n(b(e.last_activity)),1)]),t("div",null,[s[21]||(s[21]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Login:",-1)),t("span",te,n(b(e.last_login_success)),1)])])]),t("button",{onClick:S=>C(e.public_key_full,e.identity_hash),class:"ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,ee)])]))),128))]))])):l("",!0)])]),t("div",se,[t("button",{onClick:_,disabled:m.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50"},n(m.value?"Refreshing...":"Refresh Data"),9,ne)])]))}});export{ae as default};
diff --git a/repeater/web/html/assets/Sessions-DlhL-i07.js b/repeater/web/html/assets/Sessions-DlhL-i07.js
deleted file mode 100644
index 38b25b8..0000000
--- a/repeater/web/html/assets/Sessions-DlhL-i07.js
+++ /dev/null
@@ -1 +0,0 @@
-import{a as I,r as d,o as N,L as b,c as S,b as o,e as t,g as f,t as n,F as m,h as y,w as R,q as V,j as i,k as B,p as r}from"./index-CcV73zGH.js";const z={class:"p-6 space-y-6"},D={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},F={class:"glass-card rounded-[15px] p-4"},T={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},$={class:"glass-card rounded-[15px] p-4"},E={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},H={class:"glass-card rounded-[15px] p-4"},P={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},G={class:"glass-card rounded-[15px] p-4"},O={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},q={class:"glass-card rounded-[15px] p-6"},U={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},J=["onClick"],K={class:"flex items-center gap-2"},Q={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},W={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},X={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Y={class:"min-h-[400px]"},Z={key:0,class:"flex items-center justify-center py-12"},tt={key:1,class:"flex items-center justify-center py-12"},et={class:"text-center"},st={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},nt={key:2,class:"space-y-4"},ot={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},rt={key:1,class:"space-y-4"},at={class:"flex items-start justify-between"},dt={class:"flex-1"},it={class:"flex items-center gap-3 mb-2"},lt={class:"text-lg font-semibold text-content-primary dark:text-content-primary"},ct={class:"text-content-muted dark:text-content-muted text-sm"},xt={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},ut={class:"text-content-primary dark:text-content-primary font-medium"},mt={class:"text-cyan-500 dark:text-primary font-medium"},yt={class:"mt-3 flex items-center gap-2"},vt={key:3,class:"space-y-4"},kt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},pt={key:1,class:"overflow-x-auto"},bt={class:"w-full"},_t={class:"py-3"},gt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},ht={class:"py-3"},ft={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},wt={class:"py-3"},Ct={class:"text-sm text-content-primary dark:text-content-primary"},At={class:"text-xs text-content-muted dark:text-content-muted"},Lt={class:"py-3"},St={class:"py-3"},Mt={class:"text-sm text-content-secondary dark:text-content-muted"},jt={class:"py-3"},It=["onClick"],Nt={key:4,class:"space-y-4"},Rt={class:"mb-4"},Vt=["value"],Bt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},zt={key:1,class:"grid grid-cols-1 gap-4"},Dt={class:"flex items-start justify-between"},Ft={class:"flex-1"},Tt={class:"flex items-center gap-3 mb-3"},$t={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Et={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},Ht={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},Pt={class:"text-content-primary dark:text-content-primary/90 ml-2"},Gt={class:"text-content-primary dark:text-content-primary/90 ml-2"},Ot={class:"text-content-primary dark:text-content-primary/90 ml-2"},qt=["onClick"],Ut={class:"flex justify-end"},Jt=["disabled"],Wt=I({name:"SessionsView",__name:"Sessions",setup(Kt){const c=d("overview"),w=d(!1),x=d(!1),v=d(null),_=d(null),u=d([]),l=d(null),k=d(null),M=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];N(async()=>{await p(),w.value=!0});async function p(){x.value=!0,v.value=null;try{const a=await b.getACLInfo();a.success&&(_.value=a.data);const s=await b.getACLClients();s.success&&s.data&&(u.value=s.data.clients||[]);const e=await b.getACLStats();e.success&&(l.value=e.data)}catch(a){v.value=a instanceof Error?a.message:"Failed to load ACL data",console.error("Error fetching ACL data:",a)}finally{x.value=!1}}async function C(a,s){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const e=await b.removeACLClient({public_key:a,identity_hash:s});e.success?await p():alert(`Failed to remove client: ${e.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function g(a){return a?new Date(a*1e3).toLocaleString():"Never"}function j(a){c.value=a}const A=S(()=>k.value?u.value.filter(a=>a.identity_name===k.value):u.value),h=S(()=>_.value?_.value.acls||[]:[]);return(a,s)=>(r(),o("div",z,[s[22]||(s[22]=t("div",null,[t("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"Sessions & Access Control"),t("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Manage authenticated clients and access control lists")],-1)),l.value?(r(),o("div",D,[t("div",F,[s[1]||(s[1]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Total Identities",-1)),t("div",T,n(l.value.total_identities),1)]),t("div",$,[s[2]||(s[2]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Authenticated Clients",-1)),t("div",E,n(l.value.total_clients),1)]),t("div",H,[s[3]||(s[3]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Admin Clients",-1)),t("div",P,n(l.value.admin_clients),1)]),t("div",G,[s[4]||(s[4]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Guest Clients",-1)),t("div",O,n(l.value.guest_clients),1)])])):f("",!0),t("div",q,[t("div",U,[(r(),o(m,null,y(M,e=>t("button",{key:e.id,onClick:L=>j(e.id),class:i(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",c.value===e.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[t("div",K,[e.icon==="overview"?(r(),o("svg",Q,s[5]||(s[5]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):e.icon==="clients"?(r(),o("svg",W,s[6]||(s[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):e.icon==="identities"?(r(),o("svg",X,s[7]||(s[7]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):f("",!0),B(" "+n(e.label),1)])],10,J)),64))]),t("div",Y,[x.value&&!w.value?(r(),o("div",Z,s[8]||(s[8]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),t("div",{class:"text-content-secondary dark:text-content-muted"},"Loading ACL data...")],-1)]))):v.value?(r(),o("div",tt,[t("div",et,[s[9]||(s[9]=t("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load ACL data",-1)),t("div",st,n(v.value),1),t("button",{onClick:p,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):c.value==="overview"?(r(),o("div",nt,[h.value.length===0?(r(),o("div",ot," No identities configured ")):(r(),o("div",rt,[(r(!0),o(m,null,y(h.value,e=>(r(),o("div",{key:e.hash,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors"},[t("div",at,[t("div",dt,[t("div",it,[t("h3",lt,n(e.name),1),t("span",{class:i(["px-2 py-1 text-xs font-medium rounded",e.type==="repeater"?"bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.type),3),t("span",ct,n(e.hash),1)]),t("div",xt,[t("div",null,[s[10]||(s[10]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Max Clients",-1)),t("div",ut,n(e.max_clients),1)]),t("div",null,[s[11]||(s[11]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Authenticated",-1)),t("div",mt,n(e.authenticated_clients),1)]),t("div",null,[s[12]||(s[12]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Admin Password",-1)),t("div",{class:i(e.has_admin_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_admin_password?"✓ Set":"✗ Not Set"),3)]),t("div",null,[s[13]||(s[13]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Guest Password",-1)),t("div",{class:i(e.has_guest_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_guest_password?"✓ Set":"✗ Not Set"),3)])]),t("div",yt,[s[14]||(s[14]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"Read-Only Access:",-1)),t("span",{class:i(e.allow_read_only?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.allow_read_only?"Allowed":"Disabled"),3)])])])]))),128))]))])):c.value==="clients"?(r(),o("div",vt,[u.value.length===0?(r(),o("div",kt," No authenticated clients ")):(r(),o("div",pt,[t("table",bt,[s[15]||(s[15]=t("thead",null,[t("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Client"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Address"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Identity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Permissions"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Last Activity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Actions")])],-1)),t("tbody",null,[(r(!0),o(m,null,y(u.value,e=>(r(),o("tr",{key:e.public_key_full,class:"border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors"},[t("td",_t,[t("div",gt,n(e.public_key),1)]),t("td",ht,[t("div",ft,n(e.address),1)]),t("td",wt,[t("div",Ct,n(e.identity_name),1),t("div",At,n(e.identity_hash),1)]),t("td",Lt,[t("span",{class:i(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3)]),t("td",St,[t("div",Mt,n(g(e.last_activity)),1)]),t("td",jt,[t("button",{onClick:L=>C(e.public_key_full,e.identity_hash),class:"px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,It)])]))),128))])])]))])):c.value==="identities"?(r(),o("div",Nt,[t("div",Rt,[s[17]||(s[17]=t("label",{class:"block text-content-secondary dark:text-content-muted text-sm mb-2"},"Filter by Identity",-1)),R(t("select",{"onUpdate:modelValue":s[0]||(s[0]=e=>k.value=e),class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors"},[s[16]||(s[16]=t("option",{value:null},"All Identities",-1)),(r(!0),o(m,null,y(h.value,e=>(r(),o("option",{key:e.name,value:e.name},n(e.name)+" ("+n(e.authenticated_clients)+" clients) ",9,Vt))),128))],512),[[V,k.value]])]),A.value.length===0?(r(),o("div",Bt," No clients for selected identity ")):(r(),o("div",zt,[(r(!0),o(m,null,y(A.value,e=>(r(),o("div",{key:e.public_key_full,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[t("div",Dt,[t("div",Ft,[t("div",Tt,[t("span",{class:i(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3),t("span",$t,n(e.public_key),1)]),t("div",Et,[t("div",null,[s[18]||(s[18]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Address:",-1)),t("span",Ht,n(e.address),1)]),t("div",null,[s[19]||(s[19]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Identity:",-1)),t("span",Pt,n(e.identity_name)+" ("+n(e.identity_hash)+")",1)]),t("div",null,[s[20]||(s[20]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Activity:",-1)),t("span",Gt,n(g(e.last_activity)),1)]),t("div",null,[s[21]||(s[21]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Login:",-1)),t("span",Ot,n(g(e.last_login_success)),1)])])]),t("button",{onClick:L=>C(e.public_key_full,e.identity_hash),class:"ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,qt)])]))),128))]))])):f("",!0)])]),t("div",Ut,[t("button",{onClick:p,disabled:x.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50"},n(x.value?"Refreshing...":"Refresh Data"),9,Jt)])]))}});export{Wt as default};
diff --git a/repeater/web/html/assets/Setup-CYa3-Scy.js b/repeater/web/html/assets/Setup-DFGUHlPP.js
similarity index 99%
rename from repeater/web/html/assets/Setup-CYa3-Scy.js
rename to repeater/web/html/assets/Setup-DFGUHlPP.js
index 8bb6def..2c2b8fc 100644
--- a/repeater/web/html/assets/Setup-CYa3-Scy.js
+++ b/repeater/web/html/assets/Setup-DFGUHlPP.js
@@ -1 +1 @@
-import{d as A,r as l,c as P,a as W,o as I,b as a,e,f as B,_ as Y,t as i,u as o,n as J,g as k,F as N,h as z,i as K,w as h,v as C,j as _,k as V,l as q,T,m as Q,p as n,q as E,s as X,x as Z}from"./index-CcV73zGH.js";const ee=A("setup",()=>{const m=l(1),r=l(5),y=l(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),b=l(null),v=l(null),x=l(""),f=l(""),w=l(!1),c=l({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),R=l([]),j=l([]),g=l(!1),S=l(!1),u=l(null),t=P(()=>{switch(m.value){case 1:return!0;case 2:return y.value.trim().length>0;case 3:return b.value!==null;case 4:return w.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:v.value!==null;case 5:return x.value.length>=6&&x.value===f.value;default:return!1}}),s=P(()=>m.value>1),M=P(()=>m.value===r.value);async function F(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/hardware_options")).json();if(p.error)throw new Error(p.error);R.value=p.hardware||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load hardware options",console.error("Error fetching hardware options:",d)}finally{g.value=!1}}async function H(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/radio_presets")).json();if(p.error)throw new Error(p.error);j.value=p.presets||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load radio presets",console.error("Error fetching radio presets:",d)}finally{g.value=!1}}async function U(){if(!t.value)return{success:!1,error:"Please complete all required fields"};S.value=!0,u.value=null;try{const d=w.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:v.value,L=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:y.value.trim(),hardware_key:b.value?.key,radio_preset:d,admin_password:x.value})})).json();if(!L.success)throw new Error(L.error||"Setup failed");return{success:!0,data:L}}catch(d){const p=d instanceof Error?d.message:"Failed to complete setup";return u.value=p,{success:!1,error:p}}finally{S.value=!1}}function O(){t.value&&m.value
=1&&d<=r.value&&(m.value=d)}function D(){m.value=1,y.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,b.value=null,v.value=null,w.value=!1,c.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},x.value="",f.value="",u.value=null}return{currentStep:m,totalSteps:r,nodeName:y,selectedHardware:b,selectedRadioPreset:v,useCustomRadio:w,customRadio:c,adminPassword:x,confirmPassword:f,hardwareOptions:R,radioPresets:j,isLoading:g,isSubmitting:S,error:u,canGoNext:t,canGoBack:s,isLastStep:M,fetchHardwareOptions:F,fetchRadioPresets:H,completeSetup:U,nextStep:O,previousStep:$,goToStep:G,reset:D}}),te={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4"},re={class:"absolute top-4 right-4 z-20"},oe={class:"w-full max-w-4xl relative z-10"},se={class:"mb-8"},ae={class:"flex justify-between mb-2"},ne={class:"text-content-secondary dark:text-content-muted text-sm"},de={class:"text-content-secondary dark:text-content-muted text-sm"},ie={class:"h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden"},le={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12"},ue={class:"flex justify-center mb-8"},ce={class:"flex gap-2"},pe={class:"mb-8"},me={class:"text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center"},be={key:0,class:"space-y-6 mt-8"},fe={key:1,class:"space-y-6 mt-8"},xe={class:"max-w-md mx-auto"},ke={key:2,class:"space-y-6 mt-8"},ve={key:0,class:"text-center text-content-secondary dark:text-content-muted"},ge={key:1,class:"text-center text-content-secondary dark:text-content-muted"},ye={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},he=["onClick"],we={class:"font-medium text-content-primary dark:text-content-primary mb-1"},_e={class:"text-sm text-content-secondary dark:text-content-muted"},Se={key:3,class:"space-y-6 mt-8"},Ce={key:0,class:"text-center text-content-secondary dark:text-content-muted"},Re={key:1,class:"text-center text-content-secondary dark:text-content-muted"},je={key:2,class:"max-w-5xl mx-auto"},Pe={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},Me=["onClick"],Le={class:"relative z-10"},Be={class:"font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2"},Ne={class:"flex items-center gap-2"},ze={class:"text-2xl"},Ve={key:0,class:"text-primary flex-shrink-0"},qe={class:"text-xs text-content-secondary dark:text-content-muted mb-3"},Te={class:"grid grid-cols-2 gap-2 text-xs"},Ee={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Fe={class:"text-content-primary dark:text-content-primary/80 font-medium"},He={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Ue={class:"text-content-primary dark:text-content-primary/80 font-medium"},Oe={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},$e={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ge={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},De={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ae={class:"border-t border-stroke-subtle dark:border-stroke/10 pt-6"},We={class:"flex items-center justify-between mb-2"},Ie={key:0,class:"text-primary"},Ye={key:0,class:"mt-4 grid grid-cols-2 gap-4"},Je={key:4,class:"space-y-6 mt-8"},Ke={class:"max-w-md mx-auto space-y-4"},Qe={key:0,class:"text-red-600 dark:text-red-400 text-sm"},Xe={key:0,class:"mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200"},Ze={class:"flex justify-between gap-4"},et={key:1},tt=["disabled"],rt={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},ot={key:1},st={key:2},at={key:3},nt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},dt={class:"flex justify-center mb-6"},it={key:0,class:"w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center"},lt={key:1,class:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center"},ut={class:"text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4"},ct={class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"},pt=W({name:"SetupView",__name:"Setup",setup(m){const r=ee(),y=Q(),b=l(!1),v=l(""),x=l(""),f=l("success"),w=u=>{const t=u.toLowerCase();return t.includes("australia")?"🇦🇺":t.includes("eu")||t.includes("uk")?"🇪🇺":t.includes("czech")?"🇨🇿":t.includes("new zealand")?"🇳🇿":t.includes("portugal")?"🇵🇹":t.includes("switzerland")?"🇨🇭":t.includes("usa")||t.includes("canada")?"🇺🇸":t.includes("vietnam")?"🇻🇳":"🌍"};I(async()=>{await Promise.all([r.fetchHardwareOptions(),r.fetchRadioPresets()])});const c=P(()=>r.currentStep/r.totalSteps*100);async function R(){if(r.isLastStep){const u=await r.completeSetup();u.success?(f.value="success",v.value="Setup Complete!",x.value="Your repeater has been configured successfully. The service is restarting now...",b.value=!0,setTimeout(()=>{b.value=!1,y.push("/login")},5e3)):(f.value="error",v.value="Setup Failed",x.value=u.error||"An unknown error occurred",b.value=!0)}else r.nextStep()}function j(){r.previousStep()}function g(){b.value=!1,f.value==="success"&&y.push("/login")}const S=["Welcome","Repeater Name","Hardware Selection","Radio Configuration","Security Setup"];return(u,t)=>(n(),a("div",te,[e("div",re,[B(Y)]),t[36]||(t[36]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[37]||(t[37]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[38]||(t[38]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),e("div",oe,[e("div",se,[e("div",ae,[e("span",ne,"Step "+i(o(r).currentStep)+" of "+i(o(r).totalSteps),1),e("span",de,i(Math.round(c.value))+"% Complete",1)]),e("div",ie,[e("div",{class:"h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500",style:J({width:`${c.value}%`})},null,4)])]),e("div",le,[e("div",ue,[e("div",ce,[(n(!0),a(N,null,z(o(r).totalSteps,s=>(n(),a("div",{key:s,class:_(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all",s===o(r).currentStep?"bg-primary text-white":s Welcome to your pyMC Repeater! Let's get you set up in just a few steps.
You'll configure:
Repeater name and identification Hardware board selection Radio frequency and settings Admin password for secure access ',1)]))):o(r).currentStep===2?(n(),a("div",fe,[t[12]||(t[12]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a unique name for your repeater. This will be used for identification on the mesh network. ",-1)),e("div",xe,[t[10]||(t[10]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Repeater Name",-1)),h(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>o(r).nodeName=s),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"e.g., pyRpt0001",maxlength:"32"},null,512),[[C,o(r).nodeName]]),t[11]||(t[11]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-2"}," Use letters, numbers, hyphens, or underscores (3-32 characters) ",-1))])])):o(r).currentStep===3?(n(),a("div",ke,[t[13]||(t[13]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Select your hardware board type ",-1)),o(r).isLoading?(n(),a("div",ve," Loading hardware options... ")):o(r).hardwareOptions.length===0?(n(),a("div",ge," No hardware options available ")):(n(),a("div",ye,[(n(!0),a(N,null,z(o(r).hardwareOptions,s=>(n(),a("button",{key:s.key,onClick:M=>o(r).selectedHardware=s,class:_(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).selectedHardware?.key===s.key?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",we,i(s.name),1),e("div",_e,i(s.description||s.key),1)],10,he))),128))]))])):o(r).currentStep===4?(n(),a("div",Se,[t[28]||(t[28]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a radio configuration preset for your region or create a custom configuration ",-1)),o(r).isLoading?(n(),a("div",Ce," Loading radio presets... ")):o(r).radioPresets.length===0?(n(),a("div",Re," No radio presets available ")):(n(),a("div",je,[e("div",Pe,[(n(!0),a(N,null,z(o(r).radioPresets,s=>(n(),a("button",{key:s.title,onClick:M=>{o(r).selectedRadioPreset=s,o(r).useCustomRadio=!1},class:_(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden",!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",Le,[e("div",Be,[e("span",Ne,[e("span",ze,i(w(s.title)),1),e("span",null,i(s.title),1)]),!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?(n(),a("div",Ve,t[14]||(t[14]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):k("",!0)]),e("div",qe,i(s.description),1),e("div",Te,[e("div",Ee,[t[15]||(t[15]=e("div",{class:"text-content-muted dark:text-content-muted"},"Freq",-1)),e("div",Fe,i(s.frequency),1)]),e("div",He,[t[16]||(t[16]=e("div",{class:"text-content-muted dark:text-content-muted"},"BW",-1)),e("div",Ue,i(s.bandwidth),1)]),e("div",Oe,[t[17]||(t[17]=e("div",{class:"text-content-muted dark:text-content-muted"},"SF",-1)),e("div",$e,i(s.spreading_factor),1)]),e("div",Ge,[t[18]||(t[18]=e("div",{class:"text-content-muted dark:text-content-muted"},"CR",-1)),e("div",De,i(s.coding_rate),1)])])])],10,Me))),128))]),e("div",Ae,[e("button",{onClick:t[1]||(t[1]=s=>{o(r).useCustomRadio=!o(r).useCustomRadio,o(r).useCustomRadio&&(o(r).selectedRadioPreset=null)}),class:_(["w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).useCustomRadio?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",We,[t[20]||(t[20]=e("div",{class:"font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[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 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})]),V(" Custom Configuration ")],-1)),o(r).useCustomRadio?(n(),a("div",Ie,t[19]||(t[19]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):k("",!0)]),t[21]||(t[21]=e("div",{class:"text-xs text-content-secondary dark:text-content-muted"},"Manually configure frequency, bandwidth, spreading factor, and coding rate",-1))],2),B(T,{name:"slide"},{default:q(()=>[o(r).useCustomRadio?(n(),a("div",Ye,[e("div",null,[t[22]||(t[22]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Frequency (MHz)",-1)),h(e("input",{"onUpdate:modelValue":t[2]||(t[2]=s=>o(r).customRadio.frequency=s),type:"number",step:"0.1",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"915.0"},null,512),[[C,o(r).customRadio.frequency]])]),e("div",null,[t[23]||(t[23]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Bandwidth (kHz)",-1)),h(e("input",{"onUpdate:modelValue":t[3]||(t[3]=s=>o(r).customRadio.bandwidth=s),type:"number",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"125"},null,512),[[C,o(r).customRadio.bandwidth]])]),e("div",null,[t[25]||(t[25]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Spreading Factor",-1)),h(e("select",{"onUpdate:modelValue":t[4]||(t[4]=s=>o(r).customRadio.spreading_factor=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[24]||(t[24]=[e("option",{value:"7"},"7",-1),e("option",{value:"8"},"8",-1),e("option",{value:"9"},"9",-1),e("option",{value:"10"},"10",-1),e("option",{value:"11"},"11",-1),e("option",{value:"12"},"12",-1)]),512),[[E,o(r).customRadio.spreading_factor]])]),e("div",null,[t[27]||(t[27]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Coding Rate",-1)),h(e("select",{"onUpdate:modelValue":t[5]||(t[5]=s=>o(r).customRadio.coding_rate=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[26]||(t[26]=[e("option",{value:"5"},"4/5",-1),e("option",{value:"6"},"4/6",-1),e("option",{value:"7"},"4/7",-1),e("option",{value:"8"},"4/8",-1)]),512),[[E,o(r).customRadio.coding_rate]])])])):k("",!0)]),_:1})])]))])):o(r).currentStep===5?(n(),a("div",Je,[t[32]||(t[32]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Set a secure admin password to protect your repeater ",-1)),e("div",Ke,[e("div",null,[t[29]||(t[29]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Admin Password",-1)),h(e("input",{"onUpdate:modelValue":t[6]||(t[6]=s=>o(r).adminPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Enter password (min 6 characters)",minlength:"6"},null,512),[[C,o(r).adminPassword]])]),e("div",null,[t[30]||(t[30]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Confirm Password",-1)),h(e("input",{"onUpdate:modelValue":t[7]||(t[7]=s=>o(r).confirmPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Confirm password"},null,512),[[C,o(r).confirmPassword]])]),o(r).adminPassword&&o(r).confirmPassword&&o(r).adminPassword!==o(r).confirmPassword?(n(),a("div",Qe," Passwords do not match ")):k("",!0),t[31]||(t[31]=e("div",{class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200"},[e("strong",null,"Important:"),V(" Remember this password - you'll need it to access the dashboard. ")],-1))])])):k("",!0)]),o(r).error?(n(),a("div",Xe,i(o(r).error),1)):k("",!0),e("div",Ze,[o(r).canGoBack?(n(),a("button",{key:0,onClick:j,class:"px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium"}," Back ")):(n(),a("div",et)),e("button",{onClick:R,disabled:!o(r).canGoNext||o(r).isSubmitting,class:_(["px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",o(r).canGoNext&&!o(r).isSubmitting?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white border border-primary/30 hover:border-primary/50":"bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10"])},[o(r).isSubmitting?(n(),a("div",rt)):k("",!0),o(r).isSubmitting?(n(),a("span",ot,"Setting up...")):o(r).isLastStep?(n(),a("span",st,"Complete Setup")):(n(),a("span",at,"Next")),!o(r).isSubmitting&&!o(r).isLastStep?(n(),a("svg",nt,t[33]||(t[33]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]))):k("",!0)],10,tt)])])]),B(T,{name:"modal"},{default:q(()=>[b.value?(n(),a("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:g},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]",onClick:t[8]||(t[8]=X(()=>{},["stop"]))},[e("div",dt,[f.value==="success"?(n(),a("div",it,t[34]||(t[34]=[e("svg",{class:"w-8 h-8 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):(n(),a("div",lt,t[35]||(t[35]=[e("svg",{class:"w-8 h-8 text-red-600 dark:text-red-400",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("h3",ut,i(v.value),1),e("p",ct,i(x.value),1),e("button",{onClick:g,class:_(["w-full px-6 py-3 rounded-lg font-medium transition-all",f.value==="success"?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white":"bg-gradient-to-r from-red-500/20 to-red-500/10 hover:from-red-500/30 hover:to-red-500/20 text-white"])},i(f.value==="success"?"Continue to Login":"Close"),3)])])):k("",!0)]),_:1})]))}}),bt=Z(pt,[["__scopeId","data-v-20a8772f"]]);export{bt as default};
+import{d as A,r as l,c as P,a as W,o as I,b as a,e,f as B,_ as Y,t as i,u as o,n as J,g as k,F as N,h as z,i as K,w as h,v as C,j as _,k as V,l as q,T,m as Q,p as n,q as E,s as X,x as Z}from"./index-D0IT5vDS.js";const ee=A("setup",()=>{const m=l(1),r=l(5),y=l(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),b=l(null),v=l(null),x=l(""),f=l(""),w=l(!1),c=l({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),R=l([]),j=l([]),g=l(!1),S=l(!1),u=l(null),t=P(()=>{switch(m.value){case 1:return!0;case 2:return y.value.trim().length>0;case 3:return b.value!==null;case 4:return w.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:v.value!==null;case 5:return x.value.length>=6&&x.value===f.value;default:return!1}}),s=P(()=>m.value>1),M=P(()=>m.value===r.value);async function F(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/hardware_options")).json();if(p.error)throw new Error(p.error);R.value=p.hardware||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load hardware options",console.error("Error fetching hardware options:",d)}finally{g.value=!1}}async function H(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/radio_presets")).json();if(p.error)throw new Error(p.error);j.value=p.presets||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load radio presets",console.error("Error fetching radio presets:",d)}finally{g.value=!1}}async function U(){if(!t.value)return{success:!1,error:"Please complete all required fields"};S.value=!0,u.value=null;try{const d=w.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:v.value,L=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:y.value.trim(),hardware_key:b.value?.key,radio_preset:d,admin_password:x.value})})).json();if(!L.success)throw new Error(L.error||"Setup failed");return{success:!0,data:L}}catch(d){const p=d instanceof Error?d.message:"Failed to complete setup";return u.value=p,{success:!1,error:p}}finally{S.value=!1}}function O(){t.value&&m.value