import{_}from"./DomainEntityNav.WTBtLm35.js";import{f,q as h,l as y,s as l,v as m,x as p,y as v,z as b,_ as w,o as g,c as x,a as o,d as N,t as U,b as u,B as $}from"./entry.eQZ3auYG.js";import{u as F}from"./object.9wxptNlh.js";import{u as T}from"./api.2o71dS_j.js";import{u as B}from"./toast.xQvLCn8q.js";import{i as R}from"./utils.kGqDb192.js";import"./nuxt-link.f01z1rl7.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"}],a=B(),d=h(),s=y(null);try{s.value=([e,t]=l(()=>T().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}=b(i);if(!R(r.value,s.value.realm_id))throw[e,t]=l(()=>m({path:"/admin/scopes"})),await e,t(),p({});return{entity:s,items:c,handleUpdated:n=>{a&&a.show({variant:"success",body:"The scope was successfully updated."}),F(s,n)},handleFailed:n=>{a&&a.show({variant:"warning",body:n.message})}}}},"$U47Hf8heHt"),k={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,a,d,s){const i=_,r=$;return g(),x("div",null,[o("h1",k,[A,N(" "+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 M=w(S,[["render",P]]);export{M as default};
