import { _ as _sfc_main$1 } from './index-m9AqQ9dr.mjs';
import { d as useI18n, C as useSwitchLocalePath, l as __nuxt_component_1$2 } from './server.mjs';
import { defineComponent, computed, mergeProps, unref, withCtx, createTextVNode, toDisplayString, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { a as useMobileMenuState } from './states-DsTfWW88.mjs';
import 'reka-ui';
import './utils-H80jjgLf.mjs';
import 'clsx';
import 'tailwind-merge';
import 'class-variance-authority';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'nitropack/dist/runtime/plugin';
import 'packrup';
import 'consola';
import 'node:fs';
import 'node:url';
import '@iconify/utils';
import 'node:crypto';
import 'ipx';
import 'node:path';
import 'pinia';
import '@pinia/colada';
import 'vue-router';
import '@unhead/schema-org/vue';
import 'deep-pick-omit';
import '@iconify/vue';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "LanguageSwitcher",
  __ssrInlineRender: true,
  setup(__props) {
    const { locale, locales } = useI18n();
    const switchLocalePath = useSwitchLocalePath();
    const mobileMenuOpen = useMobileMenuState();
    const availableLocales = computed(() => {
      return locales.value.filter((i) => i.code !== locale.value);
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_Button = _sfc_main$1;
      const _component_NuxtLink = __nuxt_component_1$2;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex gap-2" }, _attrs))}><!--[-->`);
      ssrRenderList(unref(availableLocales), (localeOption) => {
        _push(ssrRenderComponent(_component_Button, {
          key: localeOption.code,
          class: "p-2",
          variant: "ghost",
          size: "default",
          "as-child": ""
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(ssrRenderComponent(_component_NuxtLink, {
                to: unref(switchLocalePath)(localeOption.code),
                onClick: ($event) => mobileMenuOpen.value = false
              }, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(`${ssrInterpolate(localeOption.name || localeOption.code.toUpperCase())}`);
                  } else {
                    return [
                      createTextVNode(toDisplayString(localeOption.name || localeOption.code.toUpperCase()), 1)
                    ];
                  }
                }),
                _: 2
              }, _parent2, _scopeId));
            } else {
              return [
                createVNode(_component_NuxtLink, {
                  to: unref(switchLocalePath)(localeOption.code),
                  onClick: ($event) => mobileMenuOpen.value = false
                }, {
                  default: withCtx(() => [
                    createTextVNode(toDisplayString(localeOption.name || localeOption.code.toUpperCase()), 1)
                  ]),
                  _: 2
                }, 1032, ["to", "onClick"])
              ];
            }
          }),
          _: 2
        }, _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("components/global/LanguageSwitcher.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=LanguageSwitcher-hWE4P39-.mjs.map
