"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const designSystem = require("@strapi/design-system");
const helperPlugin = require("@strapi/helper-plugin");
const reactIntl = require("react-intl");
const reactQuery = require("react-query");
const styled = require("styled-components");
const index = require("./index-3649838b.js");
const SSOProviders = require("./SSOProviders-b395a4e6.js");
require("react-dom/client");
require("invariant");
require("lodash/isFunction");
require("lodash/merge");
require("lodash/pick");
require("react-helmet");
require("react-router-dom");
require("react");
require("react-redux");
require("@radix-ui/react-context");
require("@strapi/design-system/v2");
require("@strapi/icons");
require("formik");
require("lodash/camelCase");
require("yup");
require("lodash/defaultsDeep");
require("lodash/omit");
require("qs");
require("immer");
require("lodash/get");
require("lodash/set");
require("@reduxjs/toolkit");
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
const styled__default = /* @__PURE__ */ _interopDefault(styled);
const DividerFull = styled__default.default(designSystem.Divider)`
  flex: 1;
`;
const LoginEE = (loginProps) => {
  const { formatMessage } = reactIntl.useIntl();
  const { get } = helperPlugin.useFetchClient();
  const { isLoading, data: providers = [] } = reactQuery.useQuery(
    ["ee", "providers"],
    async () => {
      const { data } = await get("/admin/providers");
      return data;
    },
    {
      enabled: window.strapi.features.isEnabled(window.strapi.features.SSO)
    }
  );
  if (!window.strapi.features.isEnabled(window.strapi.features.SSO) || !isLoading && providers.length === 0) {
    return /* @__PURE__ */ jsxRuntime.jsx(index.Login, { ...loginProps });
  }
  return /* @__PURE__ */ jsxRuntime.jsx(index.Login, { ...loginProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 7, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 7, children: [
    /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
      /* @__PURE__ */ jsxRuntime.jsx(DividerFull, {}),
      /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 3, paddingRight: 3, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: formatMessage({ id: "Auth.login.sso.divider" }) }) }),
      /* @__PURE__ */ jsxRuntime.jsx(DividerFull, {})
    ] }),
    /* @__PURE__ */ jsxRuntime.jsx(SSOProviders.SSOProviders, { providers, displayAllProviders: false })
  ] }) }) });
};
exports.LoginEE = LoginEE;
//# sourceMappingURL=Login-f7215a2b.js.map
