import { Fragment, jsx } from "react/jsx-runtime";
import React from "react";
import GoogleFontLoader from "react-google-font-loader";
import { withTheme } from "styled-components";
const FontLoader = ({
  theme: {
    yoga: {
      baseFont: { family, weight }
    }
  }
}) => {
  const uniqueWeights = [...new Set(weight)];
  return /* @__PURE__ */ jsx(Fragment, { children: typeof window !== "undefined" ? /* @__PURE__ */ jsx(GoogleFontLoader, { fonts: [{ font: family, weights: uniqueWeights }] }) : /* @__PURE__ */ jsx(
    "link",
    {
      rel: "stylesheet",
      href: `https://fonts.googleapis.com/css?family=${family}:${uniqueWeights.join()}`
    }
  ) });
};
var FontLoader_default = withTheme(FontLoader);
export {
  FontLoader_default as default
};
