import{_ as f}from"./DomainEntityNav.05a2f50d.js";import{f as _,n as h,q as y,k as v,s as l,v as c,x as m,y as b,z as g,_ as w,o as x,c as N,a as n,d as $,t as R,b as p,A as F}from"./entry.c7cd0af6.js";import{u as S}from"./object.62d64729.js";import{u as U}from"./api.45358b0b.js";import{i as k}from"./utils.1db1ba01.js";import"./nuxt-link.40687dc5.js";const A=_({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(()=>U().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(!k(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."}),S(a,o)},handleFailed:o=>{t&&t.warning({body:o.message})}}}},"$2mGreBrdRV"),B={class:"title no-border mb-3"},D=n("i",{class:"fa fa-user me-1"},null,-1),E=n("span",{class:"sub-title ms-1"}," Details ",-1),P={class:"mb-2"};function T(e,s,d,t,u,a){const i=f,r=F;return x(),N("div",null,[n("h1",B,[D,$(" "+R(e.entity.name)+" ",1),E]),n("div",P,[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(A,[["render",T]]);export{M as default};
