import{T as j}from"./components.voK2NSS7.js";import V from"./MailerLiteSubscribeToBlog.PoO85Log.js";import{b as A,u as I,e as C,g as M,a as $}from"./entry.y7SvvUsU.js";import{u as E,q as R}from"./query.p9fZ0NNT.js";import{u as q}from"./url.q4VsgBRY.js";import{u as F}from"./index.rStYacgG.js";import{j as H,a as u,B as J,M as O,I as l,N as d,E as S,L as U,U as X,V as p,Y as o,F as L,a3 as Y,J as z,u as v,$ as N,a5 as G,a6 as K}from"./swiper-vue.b4jj2PFe.js";import"./preview.m92LbQl-.js";const Q=g=>(G("data-v-90ed2d7c"),g=g(),K(),g),W=Q(()=>o("h1",{class:"mt-32 text-4xl text-sky-500 text-center p-5"},"VANAS Blog",-1)),Z={class:"w-2/3 m-auto"},ee={class:"flex flex-wrap gap-5 items-center justify-center"},te=["src"],oe={class:"flex bg-gradient-to-r from-sky-500 via-transparent to-transparent h-9 text-left items-center pl-1"},se={class:"text-2xl p-5"},ae={class:"clamp-3"},ne={key:0,class:"text-sky-500"},re={key:1,class:"text-sky-500"},b=20,le=H({__name:"index",async setup(g){let k,B;A();const{t:s}=I(),T=C(),{localeProperties:h}=I(),x=u(1),i=u(!1),f=u(!1),y=u(null),w=u([]),D=async e=>{if(i.value||f.value)return;i.value=!0;const c=(e-1)*b,{data:a}=await E(`articles-page-${e}`,()=>{var _,m;return R(`/blog/${((m=(_=h==null?void 0:h.value)==null?void 0:_.iso)==null?void 0:m.substring(0,2))||"en"}`).sort({date:-1}).skip(c).limit(b).find()});a.value&&a.value.length>0&&(w.value=[...w.value,...a.value]),(!a.value||a.value.length<b)&&(f.value=!0),i.value=!1};J(()=>{const e=new IntersectionObserver(async c=>{c[0].isIntersecting&&!i.value&&!f.value&&(x.value++,await D(x.value))},{threshold:.1});y.value&&e.observe(y.value)}),[k,B]=O(()=>D(x.value)),await k,B();const{locale:n}=I();let r=n.value;n.value==="en"&&(r="en-US"),n.value==="fr"&&(r="fr-FR"),n.value==="mx"&&(r="es-MX"),n.value==="es"&&(r="es-ES"),n.value==="de"&&(r="de-DE");const P=e=>new Date(e).toLocaleDateString(r,{year:"numeric",month:"short",day:"numeric"});return q(),F({title:s("generalUI.footerBlog"),description:s("generalUI.footerBlogDescription"),ogTitle:s("generalUI.footerBlog"),ogDescription:s("generalUI.footerBlogDescription"),ogImage:"/images/hero/vanas-online-animation-school-og.jpg",twitterTitle:s("generalUI.footerBlog"),twitterDescription:s("generalUI.footerBlogDescription"),twitterImage:"/images/hero/vanas-online-animation-school-og.jpg",twitterCard:s("generalUI.footerBlogDescription")}),(e,c)=>{const a=j,_=V,m=M;return l(),d(L,null,[S(a,null,{default:U(()=>[X(" VANAS | "+p(e.$t("generalUI.footerBlog")),1)]),_:1}),W,o("div",Z,[S(_)]),o("div",ee,[(l(!0),d(L,null,Y(v(w),t=>(l(),d("div",{key:t._path,class:"w-96 overflow-hidden flex flex-col justify-between text-center border-sky-500 border rounded p-5 bg-gray-900 hover:border-white hover:scale-105 transition-transform"},[t._path?(l(),z(m,{key:0,class:"h-96",to:v(T)(`/blog/${t._path.split("/").pop()}`)},{default:U(()=>[o("img",{src:t.blogHeroImage,alt:"Image",class:"object-cover w-full h-1/2"},null,8,te),o("p",oe,p(P(t.date))+" | "+p(t.category),1),o("h2",se,p(t.title),1),o("p",ae,p(t.description),1)]),_:2},1032,["to"])):N("",!0)]))),128))]),o("div",{ref_key:"loadingTrigger",ref:y,class:"w-full h-20 flex items-center justify-center"},[v(i)?(l(),d("p",ne,"Loading more posts...")):v(f)?(l(),d("p",re,"No more posts to load")):N("",!0)],512)],64)}}}),me=$(le,[["__scopeId","data-v-90ed2d7c"]]);export{me as default};
