import{_ as f}from"./DomainEntityNav.WTBtLm35.js";import{f as _,q as h,l as b,s as l,v as u,x as m,y,z as v,_ as g,o as w,c as x,a as o,d as N,t as $,b as p,B as F}from"./entry.eQZ3auYG.js";import{u as R}from"./object.9wxptNlh.js";import{u as S}from"./api.2o71dS_j.js";import{u as T}from"./toast.xQvLCn8q.js";import{i as U}from"./utils.kGqDb192.js";import"./nuxt-link.f01z1rl7.js";const B=_({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=T(),c=h(),a=b(null);try{a.value=([e,t]=l(()=>S().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=y(),{realmManagement:r}=v(i);return U(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.show({variant:"success",body:"The robot was successfully updated."}),R(a,n)},handleFailed:n=>{s&&s.show({variant:"warning",body:n.message})}}}},"$m3bphLu3X1"),P={class:"title no-border mb-3"},k=o("i",{class:"fa-solid fa-robot me-1"},null,-1),A=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=F;return w(),x("div",null,[o("h1",P,[k,N(" "+$(e.entity.name)+" ",1),A]),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 M=g(B,[["render",E]]);export{M as default};
