System.register(["./index-legacy-BGUFxny_.js"],function(e,t){"use strict";var r,n,s,i,l,g,u,d,a,c,o,h,w,$,p,m,y,k,x,f,S,_,b,A,v,I,M,z,C,D;return{setters:[e=>{r=e.B,n=e.b9,s=e.bq,i=e.D,l=e.aw,g=e.c0,u=e.ag,d=e.b$,a=e.dj,c=e.K,o=e.o,h=e.bt,w=e.r,$=e.S,p=e.bV,m=e.aY,y=e.L,k=e.M,x=e.E,f=e.bu,S=e.F,_=e.G,b=e.bR,A=e.bE,v=e.I,I=e.T,M=e.J,z=e.ah,C=e.ab,D=e.Q}],execute:function(){const t=[{name:"title",textAlign:"left",w:"calc(35% - 110px)"},{name:"fingerprint",textAlign:"left",w:"calc(65% - 110px)"},{name:"last_used",textAlign:"right",w:"140px"},{name:"operation",textAlign:"right",w:"80px"}],O=e=>{const p=o(),[m,y]=r(!1),[k,x]=e.isMine?n(()=>s.post(`/me/sshkey/delete?id=${e.id}`)):n(()=>s.post(`/admin/user/sshkey/delete?uid=${e.userId}&id=${e.id}`)),f={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};return i($,{get when(){return!m()},get children(){return i(l,{w:"$full",p:"$2",get children(){return[i(g,{get w(){return t[0].w},size:"sm",get textAlign(){return t[0].textAlign},css:f,get children(){return e.title}}),i(u,{get w(){return t[1].w},size:"sm",get textAlign(){return t[1].textAlign},css:f,get children(){return e.fingerprint}}),i(u,{get w(){return t[2].w},size:"sm",get textAlign(){return t[2].textAlign},css:f,get children(){return`${(t=new Date(e.last_used_time)).getFullYear().toString()}/${(t.getMonth()+1).toString().padStart(2,"0")}/${t.getDate().toString().padStart(2,"0")} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}`;var t}}),i(d,{get w(){return t[3].w},gap:"$1",get children(){return[i(a,{}),i(c,{size:"sm",colorScheme:"danger",get loading(){return k()},onClick:async()=>{const e=await x();h(e,()=>{w.success(p("global.delete_success")),y(!0)})},get children(){return p("global.delete")}})]}})]}})}})};e("P",e=>{const w=o(),[T,j]=r([]),[B,E]=e.isMine?n(()=>s.get("/me/sshkey/list")):n(()=>s.get(`/admin/user/sshkey/list?uid=${e.userId}`)),[F,Y]=p({title:"",key:""}),[q,G]=n(()=>s.post("/me/sshkey/add",F)),{isOpen:H,onOpen:J,onClose:K}=m(),L=async()=>{const e=await E();h(e,e=>{j(e.content)})};L();const P=e=>({fontWeight:"bold",fontSize:"$sm",color:"$neutral11",textAlign:e.textAlign});return i(z,{w:"$full",alignItems:"start",spacing:"$2",get children(){return[i(d,{w:"$full",get children(){return[i(g,{get children(){return w("users.ssh_keys.heading")}}),i($,{get when(){return e.isMine},get children(){return[i(a,{}),i(c,{get loading(){return B()},onClick:J,get children(){return w("global.add")}}),i(y,{get opened(){return H()},onClose:K,scrollBehavior:"inside",get children(){return[i(k,{}),i(x,{get children(){return[i(f,{}),i(S,{get children(){return w("users.ssh_keys.add_heading")}}),i(_,{get children(){return[i(b,{mb:"$4",get children(){return[i(A,{for:"add_title",get children(){return w("users.ssh_keys.title")}}),i(v,{id:"add_title",get value(){return F.title},onInput:e=>Y("title",e.currentTarget.value)})]}}),i(b,{get children(){return[i(A,{for:"add_key",get children(){return w("users.ssh_keys.key")}}),i(I,{id:"add_key",get value(){return F.key},onInput:e=>Y("key",e.currentTarget.value)})]}})]}}),i(M,{get children(){return i(c,{get loading(){return q()},onClick:async()=>{const e=await G();h(e,()=>{Y("title",""),Y("key",""),L(),K()})},get children(){return w("global.add")}})}})]}})]}})]}})]}}),i(z,{w:"$full",overflowX:"auto",shadow:"$md",rounded:"$lg",spacing:"$1",p:"$1",get children(){return[i(l,{class:"title",w:"$full",p:"$2",get children(){return[i(u,D({get w(){return t[0].w}},()=>P(t[0]),{get children(){return w(`users.ssh_keys.${t[0].name}`)}})),i(u,D({get w(){return t[1].w}},()=>P(t[1]),{get children(){return w(`users.ssh_keys.${t[1].name}`)}})),i(u,D({get w(){return t[2].w}},()=>P(t[2]),{get children(){return w(`users.ssh_keys.${t[2].name}`)}})),i(u,D({get w(){return t[3].w}},()=>P(t[3]),{get children(){return w(`users.ssh_keys.${t[3].name}`)}}))]}}),C(()=>T().map(t=>i(O,D(e,t))))]}})]}})})}}});
