import { _ as _sfc_main$M, a as _sfc_main$L, b as _sfc_main$K, c as _sfc_main$J, d as _sfc_main$I, e as _sfc_main$H, f as _sfc_main$G, g as _sfc_main$F, h as _sfc_main$E, i as _sfc_main$D, j as _sfc_main$C, k as _sfc_main$B, l as _sfc_main$A, m as _sfc_main$z, n as _sfc_main$y, o as _sfc_main$x, p as _sfc_main$w, q as _sfc_main$v, r as _sfc_main$u, s as _sfc_main$t, t as _sfc_main$s, u as _sfc_main$r, v as _sfc_main$p, w as _sfc_main$o, x as _sfc_main$n, y as _sfc_main$m, z as _sfc_main$l, A as _sfc_main$k, B as _sfc_main$j, C as _sfc_main$i, D as __nuxt_component_32, E as _sfc_main$g, F as _sfc_main$f, G as _sfc_main$e, H as _sfc_main$d, I as _sfc_main$c, J as _sfc_main$b, K as _sfc_main$a, L as _sfc_main$9, M as _sfc_main$8, N as _sfc_main$7, O as _sfc_main$6, P as _sfc_main$5, Q as _sfc_main$4, R as _sfc_main$3, S as _sfc_main$2, T as _sfc_main$q } from './AlamiyaMulti-BC6MJJp1.mjs';
import { _ as _sfc_main$1 } from './AboutCards-Dt9tMbfm.mjs';
import { _ as _sfc_main$1$1, a as __nuxt_component_52 } from './SkeltonSection2-Bw4lhr-n.mjs';
import { _ as _sfc_main$h } from './MetaTags-C8KDkLj_.mjs';
import { _ as __nuxt_component_49 } from './MainLoader-BFnVrwHB.mjs';
import { u as useI18n, g as useRoute, h as useRouter, i as useLocalePath, b as useNuxtApp, d as useLazyAsyncData, r as refreshNuxtData, f as useRuntimeConfig, j as _sfc_main$3$1 } from './server.mjs';
import { _ as __nuxt_component_51 } from './SkeltonSection1-CE-bQItR.mjs';
import { ref, withAsyncContext, watch, mergeProps, unref, createVNode, resolveDynamicComponent, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderVNode, ssrRenderList } from 'vue/server-renderer';
import './GeneralCallToAction-BNzByXfE.mjs';
import './MainModal-CspCWVZB.mjs';
import './PlayVideo-YRE_Sr6i.mjs';
import 'vue3-carousel/dist/carousel';
import '@headlessui/vue';
import './useAPIFetch-Bdd4OwYk.mjs';
import './components-BFogvFSQ.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'ipx';
import 'node:path';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-social-sharing';
import 'axios';
import 'yup';

const _sfc_main = {
  __name: "[slug]",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const headers = {
      AlamiyaHeader: _sfc_main$M,
      AlamiyaHeader1: _sfc_main$L,
      AlamiyaHeader2: _sfc_main$K,
      AlamiyaHeader3: _sfc_main$J,
      AlamiyaHeader4: _sfc_main$I,
      AlamiyaHeader5: _sfc_main$H,
      AlamiyaHeader6: _sfc_main$G,
      AlamiyaHeader7: _sfc_main$F,
      AlamiyaHeader8: _sfc_main$E,
      AlamiyaHeader9: _sfc_main$D,
      AlamiyaHeader10: _sfc_main$C,
      AlamiyaHeader11: _sfc_main$B
    };
    const allSections = {
      AboutCards: _sfc_main$1,
      HomePartners: _sfc_main$1$1,
      AlamiyaSection: _sfc_main$A,
      AlamiyaSection1: _sfc_main$z,
      AlamiyaSection2: _sfc_main$y,
      AlamiyaSection3: _sfc_main$x,
      AlamiyaSection4: _sfc_main$w,
      AlamiyaSection5: _sfc_main$v,
      AlamiyaSection6: _sfc_main$u,
      AlamiyaSection7: _sfc_main$t,
      AlamiyaSection8: _sfc_main$s,
      AlamiyaSection9: _sfc_main$r,
      AlamiyaBestServices1: _sfc_main$p,
      AlamiyaBrand: _sfc_main$o,
      AlamiyaCardSection: _sfc_main$n,
      AlamiyaCardSection1: _sfc_main$m,
      AlamiyaContactSection: _sfc_main$l,
      AlamiyaContactSection1: _sfc_main$k,
      AlamiyaContactSection2: _sfc_main$j,
      AlamiyaContactSection3: _sfc_main$i,
      AlamiyaContactSection4: __nuxt_component_32,
      AlamiyaFaq: _sfc_main$g,
      AlamiyaFeatures: _sfc_main$f,
      AlamiyaFeatures1: _sfc_main$e,
      AlamiyaProgress: _sfc_main$d,
      AlamiyaProgress1: _sfc_main$c,
      AlamiyaProgress2: _sfc_main$b,
      AlamiyaServiceStatistics: _sfc_main$a,
      AlamiyaStatistics: _sfc_main$9,
      AlamiyaStatistics1: _sfc_main$8,
      AlamiyaCardSwiper: _sfc_main$7,
      AlamiyaBestServices: _sfc_main$6,
      AlamiyaBestServicesSwiper: _sfc_main$5,
      AlamiyaBestServicesSwiper1: _sfc_main$4,
      AlamiyaBestServicesSwiper2: _sfc_main$3,
      AlamiyaBestServicesSwiper3: _sfc_main$2
    };
    const config = useRuntimeConfig();
    const { locale } = useI18n();
    const route = useRoute();
    const router = useRouter();
    const sections = ref(null);
    const sectionsLoading = ref(false);
    const localePath = useLocalePath();
    const axios = useNuxtApp().$axios;
    const { data: pageData, error, pending } = ([__temp, __restore] = withAsyncContext(() => useLazyAsyncData(
      `system`,
      () => axios.get(`systems/${encodeURI(route.params.slug)}`, {
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": locale.value
        }
      }).then((res) => res.data.data).catch((err) => err)
    )), __temp = await __temp, __restore(), __temp);
    watch(
      () => pageData.value,
      (newVal, old) => {
        if (old && old.id == newVal.id) {
          if (route.params.slug != newVal.slug) {
            router.push(localePath(`/system/${newVal.slug}`));
          }
        }
        sectionsLoading.value = true;
        if (pageData.value) {
          getData();
        }
      },
      {
        immediate: true,
        deep: true
      }
    );
    watch(
      () => locale.value,
      () => {
        refreshNuxtData();
      }
    );
    function getData() {
      axios.get(`systems/${pageData.value.id}/sections`, {
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": locale.value
        }
      }).then((res) => {
        sections.value = res.data.data;
        sectionsLoading.value = false;
      }).catch(() => sectionsLoading.value = false);
    }
    return (_ctx, _push, _parent, _attrs) => {
      const _component_meta_tags = _sfc_main$h;
      const _component_MainLoader = __nuxt_component_49;
      const _component_NotFound = _sfc_main$3$1;
      const _component_skelton_section1 = __nuxt_component_51;
      const _component_skelton_section2 = __nuxt_component_52;
      const _component_alamiya_multi = _sfc_main$q;
      const _component_alamiya_faq = _sfc_main$g;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-gradient-to-b" }, _attrs))}>`);
      if (unref(pageData) && unref(pageData).metas) {
        _push(ssrRenderComponent(_component_meta_tags, {
          metas: unref(pageData).metas
        }, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (unref(pending)) {
        _push(ssrRenderComponent(_component_MainLoader, null, null, _parent));
      } else {
        _push(`<!--[-->`);
        if (unref(error)) {
          _push(ssrRenderComponent(_component_NotFound, null, null, _parent));
        } else {
          _push(`<!--[-->`);
          if (unref(pageData)) {
            ssrRenderVNode(_push, createVNode(resolveDynamicComponent(headers[unref(pageData).type]), { item: unref(pageData) }, null), _parent);
          } else {
            _push(`<!---->`);
          }
          _push(`<!--]-->`);
        }
        if (unref(sectionsLoading)) {
          _push(`<!--[-->`);
          _push(ssrRenderComponent(_component_skelton_section1, null, null, _parent));
          _push(ssrRenderComponent(_component_skelton_section2, null, null, _parent));
          _push(`<!--]-->`);
        } else {
          _push(`<!---->`);
        }
        if (!unref(sectionsLoading) && unref(sections)) {
          _push(`<!--[-->`);
          ssrRenderList(unref(sections), (item) => {
            _push(`<!--[-->`);
            if (item[0].type == "AlamiyaMultiSection") {
              _push(ssrRenderComponent(_component_alamiya_multi, { items: item }, null, _parent));
            } else if (item[0].type == "AlamiyaFaq") {
              _push(ssrRenderComponent(_component_alamiya_faq, {
                item: item[0],
                "main-data": unref(pageData)
              }, null, _parent));
            } else {
              ssrRenderVNode(_push, createVNode(resolveDynamicComponent(allSections[item[0].type]), {
                item: item[0]
              }, null), _parent);
            }
            _push(`<!--]-->`);
          });
          _push(`<!--]-->`);
        } else {
          _push(`<!---->`);
        }
        _push(`<!--]-->`);
      }
      _push(`</div>`);
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/system/[slug].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=_slug_-7J06fN3m.mjs.map
