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