import{aa as V,cm as h,ct as b,cG as y,cA as w,cR as C,$,cl as v,X as u,cS as t,p as x,ch as T,bB as d,c7 as a,W as k,c0 as i,a3 as n,V as B,a2 as p,Y as N}from"#entry";import{V as A}from"./C8MHOe0D.js";import{V as H,b as S}from"./RTCSF0Ks.js";import{V as M}from"./R1_j74h_.js";import"./BKDgfSxC.js";import"./BgQ5eU58.js";import"./Cp3UUybv.js";const I={class:"font-weight-semibold"},X=V({__name:"[slug]",async setup(L){let s,c;const{t:o}=h(),{$notify:l}=b(),m=y("settings"),f=w(),{data:e,refresh:_}=([s,c]=C(()=>T(`/api/pages/${f.params.slug}`,"$HgIisT4fpk")),s=await s,c(),s);if(!e.value)throw $({status:404,statusMessage:"Page not found"});v(()=>({title:`${m.value.title} - ${e.value?.title}`}));async function g(){if(e.value)try{await $fetch(`/api/pages/${e.value.id}`,{method:"PUT",body:{...e.value,visible:!0}}),_(),l(o("common.enabled"))}catch(r){l(String(r))}}return(r,P)=>(d(),u(x,null,{default:t(()=>[a(e)?.visible?N("",!0):(d(),u(A,{key:0,type:"warning",rounded:"",class:"mb-4"},{append:t(()=>[n(B,{color:"warning",onClick:g},{default:t(()=>[p(i(a(o)("common.enable")),1)]),_:1})]),default:t(()=>[k("span",I,i(a(o)("admin.page_is_disabled")),1)]),_:1})),n(H,null,{default:t(()=>[n(S,{class:"text-h4 font-weight-bold"},{default:t(()=>[p(i(a(e)?.title),1)]),_:1}),n(M,{innerHTML:a(e)?.content},null,8,["innerHTML"])]),_:1})]),_:1}))}});export{X as default};
