import{_ as f}from"./DomainEntityNav.05a2f50d.js";import{f as _,n as h,q as y,k as b,s as l,v as c,x as m,y as v,z as g,_ as w,o as x,c as U,a as o,d as $,t as N,b as p,A as R}from"./entry.c7cd0af6.js";import{u as S}from"./object.62d64729.js";import{u as F}from"./api.45358b0b.js";import{i as k}from"./utils.1db1ba01.js";import"./nuxt-link.40687dc5.js";const A=_({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(()=>F().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(!k(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),B=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),B]),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(A,[["render",E]]);export{M as default};
