'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.getServerSheets = exports.css = exports.StyleSheet = undefined;

var _jss = require('jss');

var _jssCamelCase = require('jss-camel-case');

var _jssCamelCase2 = _interopRequireDefault(_jssCamelCase);

var _jssVendorPrefixer = require('jss-vendor-prefixer');

var _jssVendorPrefixer2 = _interopRequireDefault(_jssVendorPrefixer);

var _jssNested = require('jss-nested');

var _jssNested2 = _interopRequireDefault(_jssNested);

var _jssDefaultUnit = require('jss-default-unit');

var _jssDefaultUnit2 = _interopRequireDefault(_jssDefaultUnit);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var jss = (0, _jss.create)();

jss.use((0, _jssNested2.default)());
jss.use((0, _jssCamelCase2.default)());
jss.use((0, _jssVendorPrefixer2.default)());
jss.use((0, _jssDefaultUnit2.default)());

function Styles(classes) {
    Object.assign(this, classes);
}

Styles.prototype.getPreset = function (prefix, preset) {
    return this['' + prefix + preset.charAt(0).toUpperCase() + preset.substr(1)];
};

var StyleSheet = exports.StyleSheet = {
    create: function create(styles) {
        var sheet = jss.createStyleSheet(styles).attach();

        return new Styles(sheet.classes);
    }
};

var css = exports.css = function css() {
    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
    }

    return [].concat(args).filter(function (i) {
        return i;
    }).join(' ');
};

var getServerSheets = exports.getServerSheets = function getServerSheets() {
    return jss.sheets.toString();
};