import { computed, withCtx, createTextVNode, toDisplayString, unref, createVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderAttr } from 'vue/server-renderer';
import { br as useState, V as VBtn, l as VIcon } from './server.mjs';
import { V as VCard, b as VCardTitle } from './VCard-D86CughW.mjs';
import { V as VCardText } from './VCardText-KkYigSmQ.mjs';
import { V as VAlert } from './VAlert-B_mtyJh1.mjs';
import { V as VCardActions } from './VCardActions-B8o0qNQf.mjs';
import { V as VSpacer } from './VSpacer-D6kTsy1m.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 'perfect-debounce';
import 'v-calendar';
import 'linkifyjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import './createSimpleFunctional-D4PbVxKo.mjs';
import './VAvatar-DZc9zgUD.mjs';

const _sfc_main = {
  __name: "EventEmbed",
  __ssrInlineRender: true,
  props: {
    event: { type: Object, default: () => ({}) }
  },
  emits: ["close"],
  setup(__props) {
    const settings = useState("settings");
    const props = __props;
    const code = computed(() => `<script src='${settings.value.baseurl}/gancio-events.es.js'><\/script>
<gancio-event baseurl='${settings.value.baseurl}' id=${props.event.id}></gancio-event>

`);
    return (_ctx, _push, _parent, _attrs) => {
      _push(ssrRenderComponent(VCard, _attrs, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(VCardTitle, { class: "bg-primary" }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(`${ssrInterpolate(_ctx.$t("common.embed_title"))}`);
                } else {
                  return [
                    createTextVNode(toDisplayString(_ctx.$t("common.embed_title")), 1)
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(VCardText, null, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(`${ssrInterpolate(_ctx.$t("common.embed_help"))} `);
                  _push3(ssrRenderComponent(VAlert, { class: "pa-5 my-4 bg-blue-grey-darken-4 text-body-1 text-lime-lighten-3" }, {
                    default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`<pre${_scopeId3}>${ssrInterpolate(unref(code))}</pre>`);
                        _push4(ssrRenderComponent(VBtn, {
                          class: "float-end",
                          variant: "flat",
                          color: "primary",
                          onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                        }, {
                          default: withCtx((_4, _push5, _parent5, _scopeId4) => {
                            if (_push5) {
                              _push5(`${ssrInterpolate(_ctx.$t("common.copy"))} `);
                              _push5(ssrRenderComponent(VIcon, {
                                class: "ml-1",
                                icon: "mdi-content-copy"
                              }, null, _parent5, _scopeId4));
                            } else {
                              return [
                                createTextVNode(toDisplayString(_ctx.$t("common.copy")) + " ", 1),
                                createVNode(VIcon, {
                                  class: "ml-1",
                                  icon: "mdi-content-copy"
                                })
                              ];
                            }
                          }),
                          _: 1
                        }, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode("pre", null, toDisplayString(unref(code)), 1),
                          createVNode(VBtn, {
                            class: "float-end",
                            variant: "flat",
                            color: "primary",
                            onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                          }, {
                            default: withCtx(() => [
                              createTextVNode(toDisplayString(_ctx.$t("common.copy")) + " ", 1),
                              createVNode(VIcon, {
                                class: "ml-1",
                                icon: "mdi-content-copy"
                              })
                            ]),
                            _: 1
                          }, 8, ["onClick"])
                        ];
                      }
                    }),
                    _: 1
                  }, _parent3, _scopeId2));
                  _push3(`<p class="mx-auto"${_scopeId2}><span class="mx-auto"${_scopeId2}><gancio-event${ssrRenderAttr("id", __props.event.id)}${ssrRenderAttr("baseurl", unref(settings).baseurl)}${_scopeId2}></gancio-event></span></p>`);
                } else {
                  return [
                    createTextVNode(toDisplayString(_ctx.$t("common.embed_help")) + " ", 1),
                    createVNode(VAlert, { class: "pa-5 my-4 bg-blue-grey-darken-4 text-body-1 text-lime-lighten-3" }, {
                      default: withCtx(() => [
                        createVNode("pre", null, toDisplayString(unref(code)), 1),
                        createVNode(VBtn, {
                          class: "float-end",
                          variant: "flat",
                          color: "primary",
                          onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                        }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(_ctx.$t("common.copy")) + " ", 1),
                            createVNode(VIcon, {
                              class: "ml-1",
                              icon: "mdi-content-copy"
                            })
                          ]),
                          _: 1
                        }, 8, ["onClick"])
                      ]),
                      _: 1
                    }),
                    createVNode("p", { class: "mx-auto" }, [
                      createVNode("span", { class: "mx-auto" }, [
                        createVNode("gancio-event", {
                          id: __props.event.id,
                          baseurl: unref(settings).baseurl
                        }, null, 8, ["id", "baseurl"])
                      ])
                    ])
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(VCardActions, null, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(VSpacer, null, null, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(VBtn, {
                    variant: "outlined",
                    color: "warning",
                    onClick: ($event) => _ctx.$emit("close")
                  }, {
                    default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("common.close"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("common.close")), 1)
                        ];
                      }
                    }),
                    _: 1
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(VBtn, {
                    variant: "outlined",
                    color: "primary",
                    onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                  }, {
                    default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("common.copy"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("common.copy")), 1)
                        ];
                      }
                    }),
                    _: 1
                  }, _parent3, _scopeId2));
                } else {
                  return [
                    createVNode(VSpacer),
                    createVNode(VBtn, {
                      variant: "outlined",
                      color: "warning",
                      onClick: ($event) => _ctx.$emit("close")
                    }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("common.close")), 1)
                      ]),
                      _: 1
                    }, 8, ["onClick"]),
                    createVNode(VBtn, {
                      variant: "outlined",
                      color: "primary",
                      onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                    }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("common.copy")), 1)
                      ]),
                      _: 1
                    }, 8, ["onClick"])
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(VCardTitle, { class: "bg-primary" }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(_ctx.$t("common.embed_title")), 1)
                ]),
                _: 1
              }),
              createVNode(VCardText, null, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(_ctx.$t("common.embed_help")) + " ", 1),
                  createVNode(VAlert, { class: "pa-5 my-4 bg-blue-grey-darken-4 text-body-1 text-lime-lighten-3" }, {
                    default: withCtx(() => [
                      createVNode("pre", null, toDisplayString(unref(code)), 1),
                      createVNode(VBtn, {
                        class: "float-end",
                        variant: "flat",
                        color: "primary",
                        onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(_ctx.$t("common.copy")) + " ", 1),
                          createVNode(VIcon, {
                            class: "ml-1",
                            icon: "mdi-content-copy"
                          })
                        ]),
                        _: 1
                      }, 8, ["onClick"])
                    ]),
                    _: 1
                  }),
                  createVNode("p", { class: "mx-auto" }, [
                    createVNode("span", { class: "mx-auto" }, [
                      createVNode("gancio-event", {
                        id: __props.event.id,
                        baseurl: unref(settings).baseurl
                      }, null, 8, ["id", "baseurl"])
                    ])
                  ])
                ]),
                _: 1
              }),
              createVNode(VCardActions, null, {
                default: withCtx(() => [
                  createVNode(VSpacer),
                  createVNode(VBtn, {
                    variant: "outlined",
                    color: "warning",
                    onClick: ($event) => _ctx.$emit("close")
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("common.close")), 1)
                    ]),
                    _: 1
                  }, 8, ["onClick"]),
                  createVNode(VBtn, {
                    variant: "outlined",
                    color: "primary",
                    onClick: ($event) => _ctx.$copyToClipboard(unref(code))
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("common.copy")), 1)
                    ]),
                    _: 1
                  }, 8, ["onClick"])
                ]),
                _: 1
              })
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Event/Embed.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
