import{_ as f}from"./DomainEntityNav.WTBtLm35.js";import{f as _,q as h,l as y,s as l,v as u,x as m,y as v,z as b,_ as w,o as g,c as x,a as o,d as N,t as S,b as p,B as U}from"./entry.eQZ3auYG.js";import{u as $}from"./api.2o71dS_j.js";import{u as F}from"./toast.xQvLCn8q.js";import{i as R}from"./utils.kGqDb192.js";import"./index.w-DIluOk.js";import{u as T}from"./object.9wxptNlh.js";import"./nuxt-link.f01z1rl7.js";const k=_({async setup(){let e,t;const c=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Scopes",icon:"fa-solid fa-meteor",urlSuffix:"/scopes"},{name:"URL",icon:"fa-solid fa-link",urlSuffix:"/url"}],a=F(),d=h(),s=y(null);try{s.value=([e,t]=l(()=>$().client.getOne(d.params.id,{fields:["+secret"]})),e=await e,t(),e)}catch{throw[e,t]=l(()=>u({path:"/admin/clients"})),await e,t(),m({})}const i=v(),{realmManagement:r}=b(i);if(!R(r.value,s.value.realm_id))throw[e,t]=l(()=>u({path:"/admin/clients"})),await e,t(),m({});return{entity:s,items:c,handleUpdated:n=>{a&&a.show({variant:"success",body:"The client was successfully updated."}),T(s,n)},handleFailed:n=>{a&&a.show({variant:"success",body:n.message})}}}},"$ufKM444D2Q"),B={class:"title no-border mb-3"},D=o("i",{class:"fa-solid fa-ghost me-1"},null,-1),A=o("span",{class:"sub-title ms-1"},"Details",-1),E={class:"mb-2"};function P(e,t,c,a,d,s){const i=f,r=U;return g(),x("div",null,[o("h1",B,[D,N(" "+S(e.entity.name)+" ",1),A]),o("div",E,[p(i,{path:"/admin/clients/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const L=w(k,[["render",P]]);export{L as default};
