import{u as d}from"./object.62d64729.js";import{u as c}from"./api.160776dd.js";import{a as f,j as p,k as v,b,l as r,m as h,s as g,h as e,N as x}from"./entry.e097670d.js";import{i as y}from"./utils.c307b373.js";/* empty css                    */import{b as R}from"./enity-nav.bde0d636.js";import"./nuxt-link.1a4e25e4.js";const k=f({async setup(){const i=[{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=p(),o=v(),s=b(null);try{s.value=await c().user.getOne(o.params.id,{fields:["+email"]})}catch{return r({path:"/admin/users"})}const n=h(),{realmManagement:u}=g(n);if(!y(u.value,s.value.realm_id))return r({path:"/admin/users"});const l=a=>{t.success("The user was successfully updated."),d(s,a)},m=a=>{t.warning(a.message)};return()=>e("div",[e("h1",{class:"title no-border mb-3"},[e("i",{class:"fa fa-user me-1"}),s.value.name,e("span",{class:"sub-title ms-1"},["Details"])]),e("div",{class:"mb-2"},[R(`/admin/users/${s.value.id}`,i,{prevLink:!0})]),e("div",[e(x,{onUpdated:l,onFailed:m,entity:s.value})])])}});export{k as default};
