import { H as Head, T as Title, L as Link, M as Meta } from './components-BFogvFSQ.mjs';
import { useSSRContext, withCtx, createTextVNode, toDisplayString, openBlock, createBlock, createCommentVNode, Fragment, renderList, createVNode } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderList } from 'vue/server-renderer';

const _sfc_main = {
  __name: "MetaTags",
  __ssrInlineRender: true,
  props: {
    metas: {
      required: true
    }
  },
  setup(__props) {
    function getMetaKeywords(keys) {
      let keywords = keys.map((el) => el.keyword);
      return keywords.toString();
    }
    return (_ctx, _push, _parent, _attrs) => {
      const _component_Head = Head;
      const _component_Title = Title;
      const _component_Link = Link;
      const _component_Meta = Meta;
      _push(ssrRenderComponent(_component_Head, _attrs, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            if (__props.metas && __props.metas.title) {
              _push2(ssrRenderComponent(_component_Title, null, {
                default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                  if (_push3) {
                    _push3(`${ssrInterpolate(__props.metas.title)}`);
                  } else {
                    return [
                      createTextVNode(toDisplayString(__props.metas.title), 1)
                    ];
                  }
                }),
                _: 1
              }, _parent2, _scopeId));
            } else {
              _push2(`<!---->`);
            }
            _push2(`<!--[-->`);
            ssrRenderList(__props.metas, (item, key) => {
              _push2(`<!--[-->`);
              if (item) {
                _push2(`<!--[-->`);
                if (key == "canonical_tags") {
                  _push2(ssrRenderComponent(_component_Link, {
                    rel: "canonical",
                    href: item
                  }, null, _parent2, _scopeId));
                } else if (key == "keywords") {
                  _push2(ssrRenderComponent(_component_Meta, {
                    name: "keywords",
                    content: getMetaKeywords(item)
                  }, null, _parent2, _scopeId));
                } else if (key == "type") {
                  _push2(ssrRenderComponent(_component_Meta, {
                    name: "author",
                    content: item
                  }, null, _parent2, _scopeId));
                } else if (key != "id") {
                  _push2(`<!--[-->`);
                  _push2(ssrRenderComponent(_component_Meta, {
                    name: key,
                    content: item
                  }, null, _parent2, _scopeId));
                  _push2(ssrRenderComponent(_component_Meta, {
                    name: `og:${key}`,
                    content: item
                  }, null, _parent2, _scopeId));
                  _push2(`<!--]-->`);
                } else {
                  _push2(`<!---->`);
                }
                _push2(`<!--]-->`);
              } else {
                _push2(`<!---->`);
              }
              _push2(`<!--]-->`);
            });
            _push2(`<!--]-->`);
          } else {
            return [
              __props.metas && __props.metas.title ? (openBlock(), createBlock(_component_Title, { key: 0 }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(__props.metas.title), 1)
                ]),
                _: 1
              })) : createCommentVNode("", true),
              (openBlock(true), createBlock(Fragment, null, renderList(__props.metas, (item, key) => {
                return openBlock(), createBlock(Fragment, { key }, [
                  item ? (openBlock(), createBlock(Fragment, { key: 0 }, [
                    key == "canonical_tags" ? (openBlock(), createBlock(_component_Link, {
                      key: 0,
                      rel: "canonical",
                      href: item
                    }, null, 8, ["href"])) : key == "keywords" ? (openBlock(), createBlock(_component_Meta, {
                      key: 1,
                      name: "keywords",
                      content: getMetaKeywords(item)
                    }, null, 8, ["content"])) : key == "type" ? (openBlock(), createBlock(_component_Meta, {
                      key: 2,
                      name: "author",
                      content: item
                    }, null, 8, ["content"])) : key != "id" ? (openBlock(), createBlock(Fragment, { key: 3 }, [
                      createVNode(_component_Meta, {
                        name: key,
                        content: item
                      }, null, 8, ["name", "content"]),
                      createVNode(_component_Meta, {
                        name: `og:${key}`,
                        content: item
                      }, null, 8, ["name", "content"])
                    ], 64)) : createCommentVNode("", true)
                  ], 64)) : createCommentVNode("", true)
                ], 64);
              }), 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("components/MetaTags.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as _ };
//# sourceMappingURL=MetaTags-C8KDkLj_.mjs.map
