import{S as c,A as d}from"./autoplay.BCXr_mXN.js";const p="https://cursoagenteinmobiliario.pe/blog-gestor/wp-json/wp/v2";async function g(){const t=await(await fetch(`${p}/posts?per_page=6&_embed`)).json(),i=document.getElementById("blog-swiper-wrapper");t.forEach(e=>{const a=e.title.rendered,r=e.excerpt.rendered.replace(/<[^>]+>/g,"").split(" ").slice(0,20).join(" ")+"...",o=e._embedded?.["wp:featuredmedia"]?.[0]?.source_url||"https://via.placeholder.com/300x200",n=e.slug,l=e._embedded?.["wp:term"]?.[0]?.[0]?.name||"Sin categoría",s=document.createElement("div");s.className="swiper-slide",s.innerHTML=`
        <div >
          <img src="${o}" alt="${a}" />
          <span class="blog-category">${l}</span>
        </div>
        <div class="blog-slide-content">
          <h4>${a}</h4>
          <p>${r}</p>
          <div class="btn-articulo">
            <a href="https://cursoagenteinmobiliario.pe/blog/${n}">Leer más</a>
          </div>
        </div>
      `,i.appendChild(s)}),new c(".blog-swiper",{modules:[d],slidesPerView:1,spaceBetween:30,loop:!0,autoplay:{delay:3e3,disableOnInteraction:!1},breakpoints:{768:{slidesPerView:2},1024:{slidesPerView:3}}})}g();
