import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { ThemeProvider } from '@gravity-ui/uikit';
import { DEFAULT_THEME } from "../../components/constants.js";
import { AnalyticsContext } from "./analyticsContext/index.js";
import { AnimateContext } from "./animateContext/index.js";
import { DEFAULT_FORMS_CONTEXT_VALUE, FormsContext, } from "./formsContext/FormsContext.js";
import { ImageContext } from "./imageContext/index.js";
import { LocaleContext } from "./localeContext/index.js";
import { LocationContext } from "./locationContext/index.js";
import { MapsContext, initialMapValue } from "./mapsContext/mapsContext.js";
import { MicrodataContext } from "./microdataContext/index.js";
import { MobileContext } from "./mobileContext/index.js";
import { ProjectSettingsContext } from "./projectSettingsContext/index.js";
import { SSRContext } from "./ssrContext/index.js";
import { ThemeContext } from "./theme/index.js";
import { WindowWidthProvider } from "./windowWidthContext/index.js";
export const GravityBlocksProvider = ({ children, ...props }) => {
    const { isMobile, mapsContext = initialMapValue, locale = {}, location = {}, analytics = {}, ssrConfig = {}, projectSettings = {}, theme = DEFAULT_THEME, image = {}, forms = DEFAULT_FORMS_CONTEXT_VALUE, animated = true, microdata = {}, } = props;
    /* eslint-disable react/jsx-key */
    const context = [
        _jsx(ThemeProvider, { theme: theme }),
        _jsx(AnimateContext.Provider, { value: { animated } }),
        _jsx(ThemeContext.Provider, { value: { theme } }),
        _jsx(ProjectSettingsContext.Provider, { value: projectSettings }),
        _jsx(LocaleContext.Provider, { value: locale }),
        _jsx(ImageContext.Provider, { value: image }),
        _jsx(LocationContext.Provider, { value: location }),
        _jsx(MobileContext.Provider, { value: Boolean(isMobile) }),
        _jsx(MapsContext.Provider, { value: mapsContext }),
        _jsx(AnalyticsContext.Provider, { value: analytics }),
        _jsx(FormsContext.Provider, { value: forms }),
        _jsx(SSRContext.Provider, { value: { isServer: ssrConfig?.isServer } }),
        _jsx(MicrodataContext.Provider, { value: microdata }),
        _jsx(WindowWidthProvider, {}),
    ].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), children);
    /* eslint-enable react/jsx-key */
    return _jsx(React.Fragment, { children: context });
};
//# sourceMappingURL=GravityBlocksProvider.js.map
