"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineExtensions = void 0;
const react_1 = __importDefault(require("react"));
const ApiProvider_1 = require("./providers/ApiProvider");
const ReactVersionAdapter_1 = __importDefault(require("./adapters/ReactVersionAdapter"));
const defineExtensions = (extensions) => {
    const _extensions = extensions;
    const hoc = (Component) => (props) => {
        return (react_1.default.createElement(ReactVersionAdapter_1.default, null,
            react_1.default.createElement(ApiProvider_1.ApiProvider, { ...props },
                react_1.default.createElement(Component, null))));
    };
    return Object.keys(extensions).reduce((components, key) => {
        const Component = _extensions[key];
        if (Component !== undefined) {
            return {
                ...components,
                [key]: hoc(Component),
            };
        }
        return components;
    }, {});
};
exports.defineExtensions = defineExtensions;
//# sourceMappingURL=api.js.map