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