import{_ as O,a as V}from"./BZbwU0ef.js";import{_ as E}from"./CkiJIqRE.js";import{_ as K}from"./BBDO8lXc.js";import{g as M,b7 as W,m as G,h as l,k as J,u as Q,c as T,a as e,b as m,w as X,j as s,i as Y,am as Z,aC as ee,q as D,H as te,o as u,p as oe,f as se,bK as ne,_ as ae}from"./DgR3D_w1.js";import{a as ce}from"./O1F2TMdC.js";const c=r=>(oe("data-v-54137d88"),r=r(),se(),r),re=c(()=>e("section",{class:"pt-40 overflow-hidden"},[e("div",{class:"container max-w-lg lg:pl-70"},[e("h1",{"data-blog-h1-title":"",class:"font-agenda font-bold text-f42 md:text-f76 leading-z86 uppercase text-center"}," Our Blog ")])],-1)),ie={class:"pb-60 sm:pb-85"},pe={key:1,class:"container max-w-1174"},le=c(()=>e("div",{class:"px-16 md:px-33 w-full sm:w-1/2 md:w-1/3 mb-35 sm:mb-59 post-card"},[e("strong",{class:"block text-f12 sm:text-f18 text-green-100 font-medium mb-2"},"Nothing found."),e("p",{class:"text-base sm:text-f22 sm:max-w-300"}," We could not find any posts that match your search query. ")],-1)),ge=[le],me={class:"flex gap-[20px] justify-center items-center sm:gap-[50px]"},ue=c(()=>e("i",{class:"icon-legacy-chevron-a-left text-f13 mr-11"},null,-1)),de=c(()=>e("span",{class:"underline"}," Previous page ",-1)),_e=[ue,de],fe=c(()=>e("span",{class:"underline"}," Next page ",-1)),he=c(()=>e("i",{class:"icon-legacy-chevron-a-right-after text-f13 ml-11"},null,-1)),xe=[fe,he],be=M({__name:"index",async setup(r){var f,h,x,b,y,v,w,C,P,$,k,B,N,I;let i,d;const j=W(),_=G(),{public:{postsPerPage:z}}=ne(),p=l(()=>j.params.number||"1");function U(){_.push(`/blog/page/${parseInt(p.value)-1}/`)}function q(){_.push(`/blog/page/${parseInt(p.value)+1}/`)}const{data:a}=([i,d]=J(async()=>ce("blog-index",async()=>{const[o,S,g]=await Promise.all([$fetch("/api/content/categories"),$fetch("/api/content/pages/blog"),$fetch(`/api/content/post-pages/${p.value}?perPage=${z}`)]);return{categories:Object.values(o)??[],page:S,posts:g}})),i=await i,d(),i),A=l(()=>{var o;return((o=a==null?void 0:a.value)==null?void 0:o.categories)??[]}),n=l(()=>{var o;return((o=a.value)==null?void 0:o.posts)??[]}),t=l(()=>{var o;return((o=a==null?void 0:a.value)==null?void 0:o.page)??null});return t&&Q({title:(f=t.seo)==null?void 0:f.title,meta:[{name:"description",content:(h=t.seo)==null?void 0:h.metaDesc},{property:"og:title",content:(x=t.seo)==null?void 0:x.opengraphTitle},{property:"og:description",content:(b=t.seo)==null?void 0:b.opengraphDescription},{property:"og:url",content:(y=t.seo)==null?void 0:y.opengraphUrl},{property:"og:type",content:(v=t.seo)==null?void 0:v.opengraphType},{property:"og:site_name",content:(w=t.seo)==null?void 0:w.opengraphSiteName},{property:"og:image",content:(P=(C=t.seo)==null?void 0:C.opengraphImage)==null?void 0:P.sourceUrl},{property:"og:modified_time",content:($=t.seo)==null?void 0:$.opengraphModifiedTime},{property:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:(k=t.seo)==null?void 0:k.twitterTitle},{name:"twitter:description",content:(B=t.seo)==null?void 0:B.twitterDescription},{name:"twitter:image",content:(I=(N=t.seo)==null?void 0:N.twitterImage)==null?void 0:I.sourceUrl}]}),(o,S)=>{var R;const g=V,F=O,H=E,L=K;return u(),T(te,null,[re,e("section",ie,[m(F,{categories:s(A)},{search:X(()=>[m(g)]),_:1},8,["categories"]),s(n)&&s(n).content&&s(n).content.length>0?(u(),Y(H,{key:0,posts:s(n).content},null,8,["posts"])):(u(),T("div",pe,ge)),Z(e("div",me,[e("button",{"data-button-prev-posts":"",onClick:U,class:D(["text-green-500 hover:text-green-600 inline-flex items-center align-top font-medium font-agendaCond text-f14 uppercase",{disabled:Number(s(p))<=1}])},_e,2),e("button",{onClick:q,class:D([{disabled:!((R=s(n))!=null&&R.nextPage)},"text-green-500 hover:text-green-600 inline-flex items-center align-top font-medium font-agendaCond text-f14 uppercase"]),"data-button-next-posts":""},xe,2)],512),[[ee,s(n)&&s(n).content&&s(n).content.length>0]])]),m(L)],64)}}}),$e=ae(be,[["__scopeId","data-v-54137d88"]]);export{$e as default};