function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import React, { forwardRef } from "react";
import { css } from "@emotion/react";
import styled from "@emotion/styled";
import { getStaticVariants, getDynamicVariants, getIntersectionStyles } from "./utils";
export { css };
var Root = /*#__PURE__*/ styled("div", {
    target: "e15myntr0",
    label: "Root"
})(function(param) {
    var base = param.base;
    return base;
}, ";", function(param) {
    var staticVariants = param.staticVariants;
    return staticVariants;
}, ";", function(param) {
    var dynamicVariants = param.dynamicVariants;
    return dynamicVariants;
}, ";", function(param) {
    var intersectionStyles = param.intersectionStyles;
    return intersectionStyles;
}, ";");
/* eslint-disable no-underscore-dangle */ export var _component = function _component(componentConfig) {
    var tag = componentConfig.tag, base = componentConfig.base, intersections = componentConfig.intersections;
    var staticVariants = getStaticVariants(componentConfig);
    var dynamicVariants = getDynamicVariants(componentConfig);
    // TODO: should we type tag as more then string ?
    var R = Root.withComponent(tag);
    return /*#__PURE__*/ forwardRef(function(props, ref) {
        var intersectionStyles = getIntersectionStyles(props, intersections);
        return /*#__PURE__*/ React.createElement(R, _object_spread_props(_object_spread({
            base: base,
            staticVariants: staticVariants,
            dynamicVariants: dynamicVariants,
            intersectionStyles: intersectionStyles
        }, props), {
            ref: ref
        }));
    });
};
