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