import{_ as f}from"./DomainEntityNav.BAO77Cju.js";import{f as _,g as h,r as y,h as l,n as m,i as u,j as v,s as b,_ as w,o as g,c as U,a as o,d as x,t as N,b as p,k as $}from"./entry.2l8qV6vk.js";import{u as k}from"./api.HNdnc-09.js";import{u as F}from"./toast.Duw7-oGa.js";import{i as S}from"./utils.RlM3h-HS.js";import"./index.BoeiH9Ni.js";import{u as T}from"./object.koeG6dC5.js";import"./nuxt-link.CpFeHJNO.js";const P=_({async setup(){let e,s;const d=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Users",icon:"fas fa-users",urlSuffix:"users"}],t=F(),c=h(),a=y(null);try{a.value=([e,s]=l(()=>k().role.getOne(c.params.id)),e=await e,s(),e)}catch{throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({})}const r=v(),{realmManagement:i}=b(r);if(!S(i.value,a.value.realm_id))throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({});return{entity:a,items:d,handleUpdated:n=>{t&&t.show({variant:"success",body:"The role was successfully updated."}),T(a,n)},handleFailed:n=>{t&&t.show({variant:"warning",body:n.message})}}}},"$661tUZZfJV"),R={class:"title no-border mb-3"},V=o("i",{class:"fa-solid fa-theater-masks me-1"},null,-1),A=o("span",{class:"sub-title ms-1"},"Details",-1),B={class:"mb-2"};function D(e,s,d,t,c,a){const r=f,i=$;return g(),U("div",null,[o("h1",R,[V,x(" "+N(e.entity.name)+" ",1),A]),o("div",B,[p(r,{path:"/admin/roles/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[p(i,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const q=w(P,[["render",D]]);export{q as default};
