import{_ as f}from"./DomainEntityNav.05a2f50d.js";import{f as _,n as h,q as b,k as y,s as l,v as u,x as m,y as v,z as g,_ as x,o as N,c as $,a as o,d as w,t as F,b as p,A as R}from"./entry.c7cd0af6.js";import{u as S}from"./object.62d64729.js";import{u as U}from"./api.45358b0b.js";import{i as k}from"./utils.1db1ba01.js";import"./nuxt-link.40687dc5.js";const A=_({async setup(){let e,t;const d=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Roles",icon:"fa-solid fa-user-group",urlSuffix:"roles"}],s=h(),c=b(),a=y(null);try{a.value=([e,t]=l(()=>U().robot.getOne(c.params.id,{fields:["+secret"]})),e=await e,t(),e)}catch{[e,t]=l(()=>u({path:"/admin/robots"})),await e,t(),m({})}const i=v(),{realmManagement:r}=g(i);return k(r.value,a.value.realm_id)||([e,t]=l(()=>u({path:"/admin/robots"})),await e,t(),m({})),{entity:a,items:d,handleUpdated:n=>{s&&s.success({body:"The robot was successfully updated."}),S(a,n)},handleFailed:n=>{s&&s.warning({body:n.message})}}}},"$m3bphLu3X1"),P={class:"title no-border mb-3"},T=o("i",{class:"fa-solid fa-robot me-1"},null,-1),B=o("span",{class:"sub-title ms-1"},"Details",-1),D={class:"mb-2"};function E(e,t,d,s,c,a){const i=f,r=R;return N(),$("div",null,[o("h1",P,[T,w(" "+F(e.entity.name)+" ",1),B]),o("div",D,[p(i,{path:"/admin/robots/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const L=x(A,[["render",E]]);export{L as default};
