import { h } from './index-dd1fc9a4.js';
import { a as applyProps } from './common-ecdc423b.js';
var __rest = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var Breakpoint = function (_a, children) {
    var xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, _b = _a.display, display = _b === void 0 ? 'block' : _b, props = __rest(_a, ["xs", "sm", "md", "lg", "xl", "display"]);
    var Tag = display === 'inline' ? 'span' : 'div';
    //cascade values up breakpoints
    xs = xs !== undefined ? xs : false;
    sm = sm !== undefined ? sm : xs;
    md = md !== undefined ? md : sm;
    lg = lg !== undefined ? lg : md;
    xl = xl !== undefined ? xl : lg;
    var breakpoints = [['xs', xs], ['sm', sm], ['md', md], ['lg', lg], ['xl', xl]];
    //Combine classes into string based on breakpoint values
    var className = breakpoints.reduce(function (acc, cur) { return acc + " " + (cur[1] ? "ui-breakpoint-" + cur[0] : ""); }, 'ui-breakpoint');
    return (h(Tag, Object.assign({}, applyProps(props, { class: className }), { style: { '--display': display } }), children));
};
export { Breakpoint as B };
