import { V as VLazy, _ as __nuxt_component_1 } from './VLazy-D-VhjAPp.mjs';
import { defineComponent, computed, withAsyncContext, mergeProps, withCtx, unref, createVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';
import { bl as useRoute$2, br as useState, b8 as useHead, b4 as useFetch, j as VContainer } from './server.mjs';
import './nuxt-link-DENluCKo.mjs';
import '../nitro/nitro.mjs';
import 'luxon';
import '@sequelize/core';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';
import './Img-C7RhygJ-.mjs';
import './useTime-ByXQWA_w.mjs';
import './VAvatar-DZc9zgUD.mjs';
import './VCardText-KkYigSmQ.mjs';
import './VChip-BLze6MCM.mjs';
import './index-0tjXFI7F.mjs';
import 'perfect-debounce';
import 'v-calendar';
import 'linkifyjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "[name]",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const route = useRoute$2();
    const settings = useState("settings");
    useHead({
      title: computed(() => `${settings.value?.title} - ${route.params.name}`),
      meta: [
        { property: "og:title", content: settings.value.title },
        { property: "og:url", content: settings.value.baseurl },
        { property: "og:image", content: settings.value.baseurl + "/logo.png" }
      ],
      link: [
        { rel: "alternate", type: "application/rss+xml", title: settings.value.title, href: settings.value.baseurl + "/feed/rss?collection=" + route.params.name },
        { rel: "alternate", type: "text/calendar", title: settings.value.title, href: settings.value.baseurl + "/feed/ics?collection=" + route.params.name }
      ]
    });
    const { data: events } = ([__temp, __restore] = withAsyncContext(() => useFetch(
      `/api/collections/${encodeURIComponent(route.params.name)}`,
      "$kQ1jXNgolx"
      /* nuxt-injected */
    )), __temp = await __temp, __restore(), __temp);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_EventCard = __nuxt_component_1;
      _push(ssrRenderComponent(VContainer, mergeProps({
        id: "home",
        class: "px-2 px-sm-6 pt-0",
        fluid: ""
      }, _attrs), {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<h1 class="d-block text-h3 font-weight-black text-center text-uppercase mt-10 mb-16 mx-auto w-100 text-underline"${_scopeId}><u${_scopeId}>${ssrInterpolate(unref(route).params.name)}</u></h1><div class="mb-2 events"${_scopeId}><!--[-->`);
            ssrRenderList(unref(events), (event, idx) => {
              _push2(ssrRenderComponent(VLazy, {
                key: event.id,
                class: "event v-card",
                "model-value": idx < 9,
                options: { threshold: 0.5, rootMargin: "500px" }
              }, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(ssrRenderComponent(_component_EventCard, {
                      event,
                      lazy: idx > 9,
                      "hide-thumbs": unref(settings).hide_thumbs
                    }, null, _parent3, _scopeId2));
                  } else {
                    return [
                      createVNode(_component_EventCard, {
                        event,
                        lazy: idx > 9,
                        "hide-thumbs": unref(settings).hide_thumbs
                      }, null, 8, ["event", "lazy", "hide-thumbs"])
                    ];
                  }
                }),
                _: 2
              }, _parent2, _scopeId));
            });
            _push2(`<!--]--></div>`);
          } else {
            return [
              createVNode("h1", { class: "d-block text-h3 font-weight-black text-center text-uppercase mt-10 mb-16 mx-auto w-100 text-underline" }, [
                createVNode("u", null, toDisplayString(unref(route).params.name), 1)
              ]),
              createVNode("div", { class: "mb-2 events" }, [
                (openBlock(true), createBlock(Fragment, null, renderList(unref(events), (event, idx) => {
                  return openBlock(), createBlock(VLazy, {
                    key: event.id,
                    class: "event v-card",
                    "model-value": idx < 9,
                    options: { threshold: 0.5, rootMargin: "500px" }
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_EventCard, {
                        event,
                        lazy: idx > 9,
                        "hide-thumbs": unref(settings).hide_thumbs
                      }, null, 8, ["event", "lazy", "hide-thumbs"])
                    ]),
                    _: 2
                  }, 1032, ["model-value"]);
                }), 128))
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/collection/[name].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
