import{_}from"./DomainEntityNav.05a2f50d.js";import{f,n as h,q as y,k as b,s as l,v as m,x as p,y as v,z as g,_ as w,o as x,c as N,a as o,d as U,t as $,b as u,A as F}from"./entry.c7cd0af6.js";import{u as k}from"./object.62d64729.js";import{u as A}from"./api.45358b0b.js";import{i as R}from"./utils.1db1ba01.js";import"./nuxt-link.40687dc5.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(()=>A().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."}),k(a,n)},handleFailed:n=>{s&&s.warning({body:n.message})}}}},"$U47Hf8heHt"),T={class:"title no-border mb-3"},B=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=F;return x(),N("div",null,[o("h1",T,[B,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};
