import{d as w,dT as E,ad as O,y as S,M as $,r as I,cI as e,j as _,q as n,t as f,v as R,k as s,x as A,A as u,a6 as h,a7 as V,O as c,dP as j,N as H,dM as P}from"./chunk.eVCQshbn.js";import{o as q,x as F,y as K,n as L}from"./components.a6A3eWos.js";const z={class:"bre-article"},D={class:"bre-page-grid"},G={class:"bre-page-grid-item"},J={key:0,class:"bre-article-content"},Q=c("p",null,"Медиа для статьи не найдены.",-1),U=[Q],Z=w({__name:"media",async setup(W){let d,m;const g=E(),{meta:k,title:v,media:r,getError:p,newSlug:y,notPublished:T,tabs:x,createdAt:M}=O(g);[d,m]=S(()=>j({getError:p,newSlug:y,notPublished:T})),await d,m(),p.value||$(()=>H({meta:{...k.value,"og:site_name":P},noindex:!0}));const l=I(e.All),o={[e.Images]:"Изображения",[e.Videos]:"Видео",[e.Audio]:"Аудио",[e.Maps]:"Карты"},b=_(()=>Object.keys(o).filter(a=>{var t;return(t=r.value[a])==null?void 0:t.length})),C=_(()=>{const a=b.value.map(t=>({title:o[t],name:t,class:l.value===t?"_active":""}));return[{title:"Все",name:e.All,class:l.value===e.All?"_active":""},...a]}),B=_(()=>l.value===e.All?b.value:[l.value]);function N(a){l.value=a}return(a,t)=>(n(),f(L,{tabs:s(x),articleTitle:s(v),createdAt:s(M)},{default:R(()=>[c("article",z,[c("div",D,[c("main",G,[A(q,{overline:s(v),title:"Медиа"},null,8,["overline"]),s(r)?(n(),u(h,{key:1},[A(F,{items:C.value,onClickOnTab:N},null,8,["items"]),(n(!0),u(h,null,V(B.value,i=>(n(),f(K,{key:i,type:i,title:o[i],items:s(r)[i]},null,8,["type","title","items"]))),128))],64)):(n(),u("div",J,U))])])])]),_:1},8,["tabs","articleTitle","createdAt"]))}});export{Z as default};