import{_ as f}from"./DomainEntityNav.BAO77Cju.js";import{f as _,g as h,r as y,h as l,n as m,i as c,j as b,s as v,_ as w,o as g,c as x,a as o,d as U,t as $,b as p,k as N}from"./entry.2l8qV6vk.js";import{u as R}from"./object.koeG6dC5.js";import{u as S}from"./api.HNdnc-09.js";import{u as F}from"./toast.Duw7-oGa.js";import{i as T}from"./utils.RlM3h-HS.js";import"./nuxt-link.CpFeHJNO.js";const k=_({async setup(){let e,s;const u=[{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=F(),d=h(),a=y(null);try{a.value=([e,s]=l(()=>S().permission.getOne(d.params.id)),e=await e,s(),e)}catch{throw[e,s]=l(()=>m({path:"/admin/permissions"})),await e,s(),c({})}const i=b(),{realmManagement:r}=v(i);if(!T(r.value,a.value.realm_id))throw[e,s]=l(()=>m({path:"/admin/permissions"})),await e,s(),c({});return{items:u,entity:a,handleUpdated:n=>{t&&t.show({variant:"success",body:"The permission was successfully updated."}),R(a,n)},handleFailed:n=>{t&&t.show({variant:"warning",body:n.message})}}}},"$50PpUw12GC"),P={class:"title no-border mb-3"},A=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,u,t,d,a){const i=f,r=N;return g(),x("div",null,[o("h1",P,[A,U(" "+$(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 z=w(k,[["render",E]]);export{z as default};
