import { _ as __nuxt_component_49 } from './MainLoader-BFnVrwHB.mjs';
import { T as Title } from './components-BFogvFSQ.mjs';
import { _ as _sfc_main$1 } from './MainModal-CspCWVZB.mjs';
import { ref, withAsyncContext, unref, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrRenderTeleport } from 'vue/server-renderer';
import { u as useI18n, c as useHead, g as useRoute, b as useNuxtApp, d as useLazyAsyncData, f as useRuntimeConfig } from './server.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 '@headlessui/vue';
import 'yup';

const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const { locale, t } = useI18n();
    useHead({
      title: t("NAV.media")
    });
    const route = useRoute();
    const config = useRuntimeConfig();
    const showMediaVal = ref(false);
    const media_src = ref(null);
    const axios = useNuxtApp().$axios;
    const { data: pageData, error, pending } = ([__temp, __restore] = withAsyncContext(() => useLazyAsyncData(
      `medias`,
      () => axios.get(`project-medias/${route.params.slug}`, {
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": locale.value
        }
      }).then((res) => res.data.data)
    )), __temp = await __temp, __restore(), __temp);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_MainLoader = __nuxt_component_49;
      const _component_Title = Title;
      const _component_main_modal = _sfc_main$1;
      _push(`<div${ssrRenderAttrs(_attrs)}>`);
      if (unref(pending)) {
        _push(ssrRenderComponent(_component_MainLoader, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (unref(pageData)) {
        _push(`<div class="container">`);
        _push(ssrRenderComponent(_component_Title, null, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(unref(pageData).title ? unref(pageData).title : unref(t)("NAV.media"))}`);
            } else {
              return [
                createTextVNode(toDisplayString(unref(pageData).title ? unref(pageData).title : unref(t)("NAV.media")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`<div class="flex items-center justify-center py-8"><img${ssrRenderAttr("src", unref(pageData).logo[0].media_trans)}${ssrRenderAttr("alt", unref(pageData).logo[0].alt)} width="130" height="65" loading="lazy"></div><div class="grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-4 gap-11 pb-10 gallary"><!--[-->`);
        ssrRenderList(unref(pageData).images, (item) => {
          _push(`<div class="rounded-2xl h-[400px]"><img class="h-[400px] w-full object-cover rounded-2xl cursor-pointer"${ssrRenderAttr("src", item.media_trans)}${ssrRenderAttr("alt", item.alt)}></div>`);
        });
        _push(`<!--]--></div></div>`);
      } else {
        _push(`<!---->`);
      }
      ssrRenderTeleport(_push, (_push2) => {
        if (unref(showMediaVal)) {
          _push2(ssrRenderComponent(_component_main_modal, {
            onClose: ($event) => showMediaVal.value = false
          }, {
            default: withCtx((_, _push3, _parent2, _scopeId) => {
              if (_push3) {
                _push3(`<img${ssrRenderAttr("src", unref(media_src))} alt="media" class="max-h-[600px] object-contain rounded-3xl"${_scopeId}>`);
              } else {
                return [
                  createVNode("img", {
                    src: unref(media_src),
                    alt: "media",
                    class: "max-h-[600px] object-contain rounded-3xl"
                  }, null, 8, ["src"])
                ];
              }
            }),
            _: 1
          }, _parent));
        } else {
          _push2(`<!---->`);
        }
      }, "body", false, _parent);
      _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/media/[slug]/images/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

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