import { createElementVNode, normalizeStyle, normalizeClass, createVNode, defineComponent, ref, withAsyncContext, computed, mergeProps, withCtx, isRef, unref, createTextVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, createCommentVNode, withModifiers, shallowRef, toRef, watchEffect, defineAsyncComponent, useSSRContext } from 'vue';
import { g as genericComponent, ak as provideTheme, a7 as useRtl, a as useRender, L as useDimension, p as propsFactory, O as makeThemeProps, o as omit, T as makeComponentProps, P as makeTagProps, N as makeDimensionProps, s as useState, y as useI18n, v as useFetch, b as VBtn, F as useBackgroundColor, am as useBorder, aa as useElevation, G as useRounded, Y as useResizeObserver, al as useToggleScope, X as convertToUnit, b4 as useRuntimeConfig, Q as makeRoundedProps, a9 as makeElevationProps, ap as makeBorderProps } from './server.mjs';
import { c as createLayout, a as useLayout, b as makeLayoutProps, u as useLayoutItem, m as makeLayoutItemProps } from './layout-_qmElGmu.mjs';
import { d as useSsrBoot, V as VList, a as VListItem, q as VListItemTitle, p as VListItemSubtitle } from './VOverlay-DatVsI3B.mjs';
import { ssrRenderComponent, ssrRenderList, ssrInterpolate } from 'vue/server-renderer';
import { V as VDialog } from './VDialog-CiQ-ZFmd.mjs';
import { V as VMenu } from './VMenu-eOMhQZM2.mjs';
import { V as VSpacer } from './VSpacer-ClGQoN2i.mjs';

const makeVAppProps = propsFactory({
  ...makeComponentProps(),
  ...omit(makeLayoutProps(), ["fullHeight"]),
  ...makeThemeProps()
}, "VApp");
const VApp = genericComponent()({
  name: "VApp",
  props: makeVAppProps(),
  setup(props, _ref) {
    let {
      slots
    } = _ref;
    const theme = provideTheme(props);
    const {
      layoutClasses,
      getLayoutItem,
      items,
      layoutRef
    } = createLayout({
      ...props,
      fullHeight: true
    });
    const {
      rtlClasses
    } = useRtl();
    useRender(() => createElementVNode("div", {
      "ref": layoutRef,
      "class": normalizeClass(["v-application", theme.themeClasses.value, layoutClasses.value, rtlClasses.value, props.class]),
      "style": normalizeStyle([props.style])
    }, [createElementVNode("div", {
      "class": "v-application__wrap"
    }, [slots.default?.()])]));
    return {
      getLayoutItem,
      items,
      theme
    };
  }
});
const makeVFooterProps = propsFactory({
  app: Boolean,
  color: String,
  height: {
    type: [Number, String],
    default: "auto"
  },
  ...makeBorderProps(),
  ...makeComponentProps(),
  ...makeElevationProps(),
  ...makeLayoutItemProps(),
  ...makeRoundedProps(),
  ...makeTagProps({
    tag: "footer"
  }),
  ...makeThemeProps()
}, "VFooter");
const VFooter = genericComponent()({
  name: "VFooter",
  props: makeVFooterProps(),
  setup(props, _ref) {
    let {
      slots
    } = _ref;
    const layoutItemStyles = ref();
    const {
      themeClasses
    } = provideTheme(props);
    const {
      backgroundColorClasses,
      backgroundColorStyles
    } = useBackgroundColor(() => props.color);
    const {
      borderClasses
    } = useBorder(props);
    const {
      elevationClasses
    } = useElevation(props);
    const {
      roundedClasses
    } = useRounded(props);
    const autoHeight = shallowRef(32);
    const {
      resizeRef
    } = useResizeObserver();
    const height = computed(() => props.height === "auto" ? autoHeight.value : parseInt(props.height, 10));
    useToggleScope(() => props.app, () => {
      const layout = useLayoutItem({
        id: props.name,
        order: computed(() => parseInt(props.order, 10)),
        position: toRef(() => "bottom"),
        layoutSize: height,
        elementSize: computed(() => props.height === "auto" ? void 0 : height.value),
        active: toRef(() => props.app),
        absolute: toRef(() => props.absolute)
      });
      watchEffect(() => {
        layoutItemStyles.value = layout.layoutItemStyles.value;
      });
    });
    useRender(() => createVNode(props.tag, {
      "ref": resizeRef,
      "class": normalizeClass(["v-footer", themeClasses.value, backgroundColorClasses.value, borderClasses.value, elevationClasses.value, roundedClasses.value, props.class]),
      "style": normalizeStyle([backgroundColorStyles.value, props.app ? layoutItemStyles.value : {
        height: convertToUnit(props.height)
      }, props.style])
    }, slots));
    return {};
  }
});
const makeVMainProps = propsFactory({
  scrollable: Boolean,
  ...makeComponentProps(),
  ...makeDimensionProps(),
  ...makeTagProps({
    tag: "main"
  })
}, "VMain");
const VMain = genericComponent()({
  name: "VMain",
  props: makeVMainProps(),
  setup(props, _ref) {
    let {
      slots
    } = _ref;
    const {
      dimensionStyles
    } = useDimension(props);
    const {
      mainStyles
    } = useLayout();
    const {
      ssrBootStyles
    } = useSsrBoot();
    useRender(() => createVNode(props.tag, {
      "class": normalizeClass(["v-main", {
        "v-main--scrollable": props.scrollable
      }, props.class]),
      "style": normalizeStyle([mainStyles.value, ssrBootStyles.value, dimensionStyles.value, props.style])
    }, {
      default: () => [props.scrollable ? createElementVNode("div", {
        "class": "v-main__scroller"
      }, [slots.default?.()]) : slots.default?.()]
    }));
    return {};
  }
});
const __nuxt_component_0_lazy = defineAsyncComponent(() => import('./FollowMe-Do4OWYb0.mjs').then((c) => c.default || c));
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Footer",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const settings = useState("settings");
    const config = useRuntimeConfig();
    const { t } = useI18n();
    const showFollowMe = ref(false);
    const { data: trusted_sources } = ([__temp, __restore] = withAsyncContext(() => useFetch(
      "/api/ap_actors/trusted",
      { lazy: true },
      "$N2KraaNDgR"
      /* nuxt-injected */
    )), __temp = await __temp, __restore(), __temp);
    const footerLinks = computed(() => settings.value.footerLinks?.map((link) => {
      if (/^https?:\/\//.test(link.href)) {
        return { href: link.href, label: link.label.startsWith("common.") ? t(link.label) : link.label };
      } else {
        return { to: link.href, label: link.label.startsWith("common.") ? t(link.label) : link.label };
      }
    }));
    return (_ctx, _push, _parent, _attrs) => {
      const _component_LazyFollowMe = __nuxt_component_0_lazy;
      _push(ssrRenderComponent(VFooter, mergeProps({
        id: "footer",
        color: "surface",
        border: "",
        "aria-label": "Footer",
        class: "flex-grow-0 py-3 flex-wrap flex-column flex-sm-row"
      }, _attrs), {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(VDialog, {
              modelValue: unref(showFollowMe),
              "onUpdate:modelValue": ($event) => isRef(showFollowMe) ? showFollowMe.value = $event : null,
              "destroy-on-close": "",
              "max-width": "700px",
              fullscreen: _ctx.$vuetify.display?.mobile
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_LazyFollowMe, {
                    "is-dialog": "",
                    onClose: ($event) => showFollowMe.value = false
                  }, null, _parent3, _scopeId2));
                } else {
                  return [
                    createVNode(_component_LazyFollowMe, {
                      "is-dialog": "",
                      onClose: ($event) => showFollowMe.value = false
                    }, null, 8, ["onClose"])
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(`<!--[-->`);
            ssrRenderList(unref(footerLinks), (link) => {
              _push2(ssrRenderComponent(VBtn, {
                key: link?.label,
                color: "primary",
                class: "ml-1",
                href: link?.href,
                to: link?.to,
                target: link?.href && "_blank"
              }, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(`${ssrInterpolate(_ctx.$t(link?.label))}`);
                  } else {
                    return [
                      createTextVNode(toDisplayString(_ctx.$t(link?.label)), 1)
                    ];
                  }
                }),
                _: 2
              }, _parent2, _scopeId));
            });
            _push2(`<!--]-->`);
            if (unref(settings).enable_federation && unref(trusted_sources)?.length) {
              _push2(ssrRenderComponent(VMenu, { transition: "slide-y-transition" }, {
                activator: withCtx(({ props }, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(ssrRenderComponent(VBtn, mergeProps({ class: "ml-1" }, props, { color: "primary" }), {
                      default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                        if (_push4) {
                          _push4(`${ssrInterpolate(unref(settings).trusted_sources_label || _ctx.$t("admin.trusted_sources_label_default"))}`);
                        } else {
                          return [
                            createTextVNode(toDisplayString(unref(settings).trusted_sources_label || _ctx.$t("admin.trusted_sources_label_default")), 1)
                          ];
                        }
                      }),
                      _: 2
                    }, _parent3, _scopeId2));
                  } else {
                    return [
                      createVNode(VBtn, mergeProps({ class: "ml-1" }, props, { color: "primary" }), {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(unref(settings).trusted_sources_label || _ctx.$t("admin.trusted_sources_label_default")), 1)
                        ]),
                        _: 1
                      }, 16)
                    ];
                  }
                }),
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(ssrRenderComponent(VList, {
                      lines: "two",
                      "max-height": "300",
                      "max-width": "550"
                    }, {
                      default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                        if (_push4) {
                          _push4(`<!--[-->`);
                          ssrRenderList(unref(trusted_sources), (instance) => {
                            _push4(ssrRenderComponent(VListItem, {
                              key: instance.ap_id,
                              lines: "two",
                              target: "_blank",
                              href: instance.url ?? instance.ap_id,
                              "prepend-avatar": instance.icon
                            }, {
                              default: withCtx((_4, _push5, _parent5, _scopeId4) => {
                                if (_push5) {
                                  _push5(ssrRenderComponent(VListItemTitle, null, {
                                    default: withCtx((_5, _push6, _parent6, _scopeId5) => {
                                      if (_push6) {
                                        _push6(`${ssrInterpolate(instance.name ?? instance.preferredUsername)}`);
                                      } else {
                                        return [
                                          createTextVNode(toDisplayString(instance.name ?? instance.preferredUsername), 1)
                                        ];
                                      }
                                    }),
                                    _: 2
                                  }, _parent5, _scopeId4));
                                  _push5(ssrRenderComponent(VListItemSubtitle, null, {
                                    default: withCtx((_5, _push6, _parent6, _scopeId5) => {
                                      if (_push6) {
                                        _push6(`<span${_scopeId5}>${instance?.summary ?? ""}</span>`);
                                      } else {
                                        return [
                                          createVNode("span", {
                                            innerHTML: instance?.summary
                                          }, null, 8, ["innerHTML"])
                                        ];
                                      }
                                    }),
                                    _: 2
                                  }, _parent5, _scopeId4));
                                } else {
                                  return [
                                    createVNode(VListItemTitle, null, {
                                      default: withCtx(() => [
                                        createTextVNode(toDisplayString(instance.name ?? instance.preferredUsername), 1)
                                      ]),
                                      _: 2
                                    }, 1024),
                                    createVNode(VListItemSubtitle, null, {
                                      default: withCtx(() => [
                                        createVNode("span", {
                                          innerHTML: instance?.summary
                                        }, null, 8, ["innerHTML"])
                                      ]),
                                      _: 2
                                    }, 1024)
                                  ];
                                }
                              }),
                              _: 2
                            }, _parent4, _scopeId3));
                          });
                          _push4(`<!--]-->`);
                        } else {
                          return [
                            (openBlock(true), createBlock(Fragment, null, renderList(unref(trusted_sources), (instance) => {
                              return openBlock(), createBlock(VListItem, {
                                key: instance.ap_id,
                                lines: "two",
                                target: "_blank",
                                href: instance.url ?? instance.ap_id,
                                "prepend-avatar": instance.icon
                              }, {
                                default: withCtx(() => [
                                  createVNode(VListItemTitle, null, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(instance.name ?? instance.preferredUsername), 1)
                                    ]),
                                    _: 2
                                  }, 1024),
                                  createVNode(VListItemSubtitle, null, {
                                    default: withCtx(() => [
                                      createVNode("span", {
                                        innerHTML: instance?.summary
                                      }, null, 8, ["innerHTML"])
                                    ]),
                                    _: 2
                                  }, 1024)
                                ]),
                                _: 2
                              }, 1032, ["href", "prepend-avatar"]);
                            }), 128))
                          ];
                        }
                      }),
                      _: 1
                    }, _parent3, _scopeId2));
                  } else {
                    return [
                      createVNode(VList, {
                        lines: "two",
                        "max-height": "300",
                        "max-width": "550"
                      }, {
                        default: withCtx(() => [
                          (openBlock(true), createBlock(Fragment, null, renderList(unref(trusted_sources), (instance) => {
                            return openBlock(), createBlock(VListItem, {
                              key: instance.ap_id,
                              lines: "two",
                              target: "_blank",
                              href: instance.url ?? instance.ap_id,
                              "prepend-avatar": instance.icon
                            }, {
                              default: withCtx(() => [
                                createVNode(VListItemTitle, null, {
                                  default: withCtx(() => [
                                    createTextVNode(toDisplayString(instance.name ?? instance.preferredUsername), 1)
                                  ]),
                                  _: 2
                                }, 1024),
                                createVNode(VListItemSubtitle, null, {
                                  default: withCtx(() => [
                                    createVNode("span", {
                                      innerHTML: instance?.summary
                                    }, null, 8, ["innerHTML"])
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1032, ["href", "prepend-avatar"]);
                          }), 128))
                        ]),
                        _: 1
                      })
                    ];
                  }
                }),
                _: 1
              }, _parent2, _scopeId));
            } else {
              _push2(`<!---->`);
            }
            if (unref(settings).enable_federation) {
              _push2(ssrRenderComponent(VBtn, {
                class: "ml-1",
                color: "primary",
                rel: "me",
                onClick: ($event) => showFollowMe.value = true
              }, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(`${ssrInterpolate(_ctx.$t("event.interact_with_me"))}`);
                  } else {
                    return [
                      createTextVNode(toDisplayString(_ctx.$t("event.interact_with_me")), 1)
                    ];
                  }
                }),
                _: 1
              }, _parent2, _scopeId));
            } else {
              _push2(`<!---->`);
            }
            _push2(ssrRenderComponent(VSpacer, null, null, _parent2, _scopeId));
            _push2(ssrRenderComponent(VBtn, {
              color: "primary",
              href: "https://gancio.org",
              target: "_blank",
              rel: "noopener"
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(` Gancio <small${_scopeId2}>${ssrInterpolate(unref(config).public.version)}</small>`);
                } else {
                  return [
                    createTextVNode(" Gancio "),
                    createVNode("small", null, toDisplayString(unref(config).public.version), 1)
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(VDialog, {
                modelValue: unref(showFollowMe),
                "onUpdate:modelValue": ($event) => isRef(showFollowMe) ? showFollowMe.value = $event : null,
                "destroy-on-close": "",
                "max-width": "700px",
                fullscreen: _ctx.$vuetify.display?.mobile
              }, {
                default: withCtx(() => [
                  createVNode(_component_LazyFollowMe, {
                    "is-dialog": "",
                    onClose: ($event) => showFollowMe.value = false
                  }, null, 8, ["onClose"])
                ]),
                _: 1
              }, 8, ["modelValue", "onUpdate:modelValue", "fullscreen"]),
              (openBlock(true), createBlock(Fragment, null, renderList(unref(footerLinks), (link) => {
                return openBlock(), createBlock(VBtn, {
                  key: link?.label,
                  color: "primary",
                  class: "ml-1",
                  href: link?.href,
                  to: link?.to,
                  target: link?.href && "_blank"
                }, {
                  default: withCtx(() => [
                    createTextVNode(toDisplayString(_ctx.$t(link?.label)), 1)
                  ]),
                  _: 2
                }, 1032, ["href", "to", "target"]);
              }), 128)),
              unref(settings).enable_federation && unref(trusted_sources)?.length ? (openBlock(), createBlock(VMenu, {
                key: 0,
                transition: "slide-y-transition"
              }, {
                activator: withCtx(({ props }) => [
                  createVNode(VBtn, mergeProps({ class: "ml-1" }, props, { color: "primary" }), {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(unref(settings).trusted_sources_label || _ctx.$t("admin.trusted_sources_label_default")), 1)
                    ]),
                    _: 1
                  }, 16)
                ]),
                default: withCtx(() => [
                  createVNode(VList, {
                    lines: "two",
                    "max-height": "300",
                    "max-width": "550"
                  }, {
                    default: withCtx(() => [
                      (openBlock(true), createBlock(Fragment, null, renderList(unref(trusted_sources), (instance) => {
                        return openBlock(), createBlock(VListItem, {
                          key: instance.ap_id,
                          lines: "two",
                          target: "_blank",
                          href: instance.url ?? instance.ap_id,
                          "prepend-avatar": instance.icon
                        }, {
                          default: withCtx(() => [
                            createVNode(VListItemTitle, null, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(instance.name ?? instance.preferredUsername), 1)
                              ]),
                              _: 2
                            }, 1024),
                            createVNode(VListItemSubtitle, null, {
                              default: withCtx(() => [
                                createVNode("span", {
                                  innerHTML: instance?.summary
                                }, null, 8, ["innerHTML"])
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          _: 2
                        }, 1032, ["href", "prepend-avatar"]);
                      }), 128))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })) : createCommentVNode("", true),
              unref(settings).enable_federation ? (openBlock(), createBlock(VBtn, {
                key: 1,
                class: "ml-1",
                color: "primary",
                rel: "me",
                onClick: withModifiers(($event) => showFollowMe.value = true, ["prevent"])
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(_ctx.$t("event.interact_with_me")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : createCommentVNode("", true),
              createVNode(VSpacer),
              createVNode(VBtn, {
                color: "primary",
                href: "https://gancio.org",
                target: "_blank",
                rel: "noopener"
              }, {
                default: withCtx(() => [
                  createTextVNode(" Gancio "),
                  createVNode("small", null, toDisplayString(unref(config).public.version), 1)
                ]),
                _: 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/Core/Footer.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __nuxt_component_3 = Object.assign(_sfc_main, { __name: "CoreFooter" });

export { VApp as V, __nuxt_component_3 as _, VMain as a };
