import __nuxt_component_0 from './InternalHeaderSection-DIj5MLKD.mjs';
import _sfc_main$4 from './MainButton-ul6epHgF.mjs';
import { defineComponent, computed, mergeProps, withCtx, createVNode, toDisplayString, watch, unref, createTextVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import { a as _sfc_main$1$1, _ as __nuxt_component_3 } from './SubscribeSection-D6lSAdXw.mjs';
import __nuxt_component_6 from './Spacer-DtCydRp3.mjs';
import { _ as _sfc_main$6 } from './Skeleton-CRkCoUmX.mjs';
import { u as useBlogsQuery, _ as __nuxt_component_2 } from './blogs-B7krQ5hx.mjs';
import _sfc_main$5 from './EmptyState-CWK2sm1Q.mjs';
import { d as useI18n, e as useSeoMeta, f as __nuxt_component_0$1 } from './server.mjs';
import { _ as __nuxt_component_5, a as __nuxt_component_4 } from './ArrowLeftIcon-Dfw2cv7V.mjs';
import { useRoute } from 'vue-router';
import './useBreadcrumbSchema-CZ-Fj_m_.mjs';
import './utils-H80jjgLf.mjs';
import 'clsx';
import 'tailwind-merge';
import 'reka-ui';
import 'lucide-vue-next';
import '@unhead/schema-org';
import './index-m9AqQ9dr.mjs';
import 'class-variance-authority';
import './useUtmPayload-DlQ2OH8k.mjs';
import 'vee-validate';
import './index-Cce4iXMN.mjs';
import './index-B_IDLhd1.mjs';
import 'zod';
import '@vee-validate/zod';
import './useApi-Dv-cyvzn.mjs';
import 'axios';
import 'vue-sonner';
import './CardTitle-CK392g0A.mjs';
import '@pinia/colada';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'nitropack/dist/runtime/plugin';
import 'packrup';
import 'consola';
import 'node:fs';
import 'node:url';
import '@iconify/utils';
import 'node:crypto';
import 'ipx';
import 'node:path';
import 'pinia';
import '@unhead/schema-org/vue';
import 'deep-pick-omit';
import '@iconify/vue';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';

const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "BLogHero",
  __ssrInlineRender: true,
  setup(__props) {
    const scrollToSubscribeSection = () => {
      const subscribeSection = (void 0).getElementById("subscribe");
      subscribeSection == null ? void 0 : subscribeSection.scrollIntoView({ behavior: "smooth" });
    };
    return (_ctx, _push, _parent, _attrs) => {
      const _component_InternalHeaderSection = __nuxt_component_0;
      const _component_MainButton = _sfc_main$4;
      _push(ssrRenderComponent(_component_InternalHeaderSection, mergeProps({
        pages: [{ name: _ctx.$t("blogs") }],
        "video-url": "/videos/blog-hero.mp4"
      }, _attrs), {
        title: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<h1${_scopeId}>${ssrInterpolate(_ctx.$t("blogsHero.title"))}</h1>`);
          } else {
            return [
              createVNode("h1", null, toDisplayString(_ctx.$t("blogsHero.title")), 1)
            ];
          }
        }),
        button: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_MainButton, {
              contnet: _ctx.$t("blogsHero.button"),
              onClick: scrollToSubscribeSection
            }, null, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_MainButton, {
                contnet: _ctx.$t("blogsHero.button"),
                onClick: scrollToSubscribeSection
              }, null, 8, ["contnet"])
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
});
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/blogs/BLogHero.vue");
  return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "BlogCardSkeleton",
  __ssrInlineRender: true,
  setup(__props) {
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-full bg-[#0B0F1A] rounded-xl border border-surface-border overflow-hidden shadow-md animate-pulse" }, _attrs))}>`);
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-full h-[200px] sm:h-[200px] md:h-[200px] lg:h-[216px] rounded-t-xl" }, null, _parent));
      _push(`<div class="p-4 flex flex-col gap-3">`);
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-24 h-4 rounded-full" }, null, _parent));
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-[90%] h-6 rounded-md" }, null, _parent));
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-[70%] h-6 rounded-md" }, null, _parent));
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-[95%] h-4 rounded-md" }, null, _parent));
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-[90%] h-4 rounded-md" }, null, _parent));
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-[85%] h-4 rounded-md" }, null, _parent));
      _push(`<div class="mt-4">`);
      _push(ssrRenderComponent(unref(_sfc_main$6), { class: "w-28 h-9 rounded-lg" }, null, _parent));
      _push(`</div></div></div>`);
    };
  }
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/skeletons/BlogCardSkeleton.vue");
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "BlogSection",
  __ssrInlineRender: true,
  setup(__props) {
    const route = useRoute();
    const currentPage = computed(() => Number(route.query.page) || 1);
    const blogsQuery = useBlogsQuery(currentPage);
    const blogs = computed(() => blogsQuery.data.value || {});
    const status = computed(() => blogsQuery.status.value);
    watch(
      () => route.query.page,
      () => {
        const blogsSection = (void 0).getElementById("blogs");
        if (blogsSection) {
          blogsSection.scrollIntoView({ behavior: "smooth" });
        }
      }
    );
    return (_ctx, _push, _parent, _attrs) => {
      var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
      const _component_BlogsTitle = _sfc_main$1$1;
      const _component_Spacer = __nuxt_component_6;
      const _component_SkeletonsBlogCardSkeleton = _sfc_main$2;
      const _component_BlogsBlogCard = __nuxt_component_2;
      const _component_EmptyState = _sfc_main$5;
      const _component_NuxtLinkLocale = __nuxt_component_0$1;
      const _component_SvgArrowRightIcon = __nuxt_component_5;
      const _component_SvgArrowLeftIcon = __nuxt_component_4;
      const _component_SubscribeSection = __nuxt_component_3;
      _push(`<section${ssrRenderAttrs(mergeProps({
        id: "blogs",
        class: "bg-gradient-odd py-section px-4"
      }, _attrs))}>`);
      _push(ssrRenderComponent(_component_BlogsTitle, {
        title: _ctx.$t("blogs-main-section.title"),
        description: _ctx.$t("blogs-main-section.description"),
        "custom-style": "!gap-1",
        "title-heading": "h2"
      }, null, _parent));
      _push(ssrRenderComponent(_component_Spacer, null, null, _parent));
      if (unref(status) === "pending") {
        _push(`<div class="container mx-auto grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3"><!--[-->`);
        ssrRenderList(6, (i) => {
          _push(ssrRenderComponent(_component_SkeletonsBlogCardSkeleton, { key: i }, null, _parent));
        });
        _push(`<!--]--></div>`);
      } else if (unref(blogsQuery).data && ((_b = (_a = unref(blogs)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) > 0) {
        _push(`<div class="container mx-auto grid grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3"><!--[-->`);
        ssrRenderList((_c = unref(blogs)) == null ? void 0 : _c.data, (blog) => {
          _push(ssrRenderComponent(_component_BlogsBlogCard, {
            id: blog.id,
            key: blog.id,
            slug: blog.slug,
            title: blog.title,
            tag: blog.tag,
            description: blog.description,
            image: blog.image
          }, null, _parent));
        });
        _push(`<!--]--></div>`);
      } else {
        _push(`<div class="container mx-auto flex items-center justify-center">`);
        _push(ssrRenderComponent(_component_EmptyState, null, null, _parent));
        _push(`</div>`);
      }
      if (((_e = (_d = unref(blogs)) == null ? void 0 : _d.meta) == null ? void 0 : _e.last_page) > 1) {
        _push(`<div class="mt-8 flex items-center justify-center gap-2">`);
        _push(ssrRenderComponent(_component_NuxtLinkLocale, {
          class: "mx-2 cursor-pointer disabled:opacity-50",
          to: {
            query: unref(currentPage) > 2 ? { page: String(unref(currentPage) - 1) } : {}
          },
          "aria-disabled": unref(currentPage) === 1
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(ssrRenderComponent(_component_SvgArrowRightIcon, { class: "hidden h-5 w-5 rtl:block" }, null, _parent2, _scopeId));
              _push2(ssrRenderComponent(_component_SvgArrowLeftIcon, { class: "h-5 w-5 rtl:hidden" }, null, _parent2, _scopeId));
            } else {
              return [
                createVNode(_component_SvgArrowRightIcon, { class: "hidden h-5 w-5 rtl:block" }),
                createVNode(_component_SvgArrowLeftIcon, { class: "h-5 w-5 rtl:hidden" })
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`<!--[-->`);
        ssrRenderList((_g = (_f = unref(blogs)) == null ? void 0 : _f.meta) == null ? void 0 : _g.last_page, (page) => {
          _push(ssrRenderComponent(_component_NuxtLinkLocale, {
            key: page,
            class: [
              "w-9 cursor-pointer !rounded-sm px-3 py-1 text-center",
              page === unref(currentPage) ? "hover:bg-accent/90 border-surface-border ws-gradient-border border-1 bg-transparent shadow-xs" : "text-primary underline-offset-4 hover:underline"
            ],
            to: { query: page === 1 ? {} : { page: String(page) } }
          }, {
            default: withCtx((_, _push2, _parent2, _scopeId) => {
              if (_push2) {
                _push2(`${ssrInterpolate(page)}`);
              } else {
                return [
                  createTextVNode(toDisplayString(page), 1)
                ];
              }
            }),
            _: 2
          }, _parent));
        });
        _push(`<!--]-->`);
        _push(ssrRenderComponent(_component_NuxtLinkLocale, {
          class: "mx-2 cursor-pointer disabled:opacity-50",
          to: {
            query: unref(currentPage) < ((_i = (_h = unref(blogs)) == null ? void 0 : _h.meta) == null ? void 0 : _i.last_page) ? { page: String(unref(currentPage) + 1) } : { page: String(unref(currentPage)) }
          },
          "aria-disabled": unref(currentPage) === ((_k = (_j = unref(blogs)) == null ? void 0 : _j.meta) == null ? void 0 : _k.last_page)
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(ssrRenderComponent(_component_SvgArrowLeftIcon, { class: "hidden h-5 w-5 rtl:block" }, null, _parent2, _scopeId));
              _push2(ssrRenderComponent(_component_SvgArrowRightIcon, { class: "h-5 w-5 rtl:hidden" }, null, _parent2, _scopeId));
            } else {
              return [
                createVNode(_component_SvgArrowLeftIcon, { class: "hidden h-5 w-5 rtl:block" }),
                createVNode(_component_SvgArrowRightIcon, { class: "h-5 w-5 rtl:hidden" })
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(ssrRenderComponent(_component_Spacer, null, null, _parent));
      _push(ssrRenderComponent(_component_SubscribeSection, null, null, _parent));
      _push(`</section>`);
    };
  }
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/blogs/BlogSection.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useI18n();
    useSeoMeta({
      title: computed(() => t("blogSeo.title")),
      description: computed(() => t("blogSeo.description")),
      ogTitle: computed(() => t("blogSeo.ogTitle")),
      ogDescription: computed(() => t("blogSeo.ogDescription")),
      keywords: computed(() => t("blogSeo.keywords"))
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_BlogsBLogHero = _sfc_main$3;
      const _component_BlogsBlogSection = _sfc_main$1;
      _push(`<main${ssrRenderAttrs(_attrs)}>`);
      _push(ssrRenderComponent(_component_BlogsBLogHero, null, null, _parent));
      _push(ssrRenderComponent(_component_BlogsBlogSection, null, null, _parent));
      _push(`</main>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/blogs/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=index-lmmcoSN8.mjs.map
