"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get Button () {
        return Button;
    },
    get ButtonContentWrapper () {
        return ButtonContentWrapper;
    },
    get ButtonLoader () {
        return ButtonLoader;
    },
    get ButtonRoot () {
        return ButtonRoot;
    },
    get ButtonText () {
        return ButtonText;
    },
    get StyledSpinner () {
        return StyledSpinner;
    }
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
var _styledcomponents = /*#__PURE__*/ _interop_require_default(require("styled-components"));
var _mixins = require("../../mixins");
var _Spinner = require("../Spinner");
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 _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: 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;
}
var ButtonRoot = _styledcomponents.default.button.withConfig({
    displayName: "Button__ButtonRoot",
    componentId: "sc-b39b3537-0"
})([
    "position:relative;display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);a&{text-decoration:none;}&:focus{outline:none;}",
    " ",
    ""
], function(param) {
    var isLoading = param.$isLoading;
    return !isLoading && _mixins.applyDisabled;
}, _mixins.applyBlur);
var ButtonLoader = _styledcomponents.default.div.withConfig({
    displayName: "Button__ButtonLoader",
    componentId: "sc-b39b3537-1"
})([
    "position:absolute;"
]);
var StyledSpinner = (0, _styledcomponents.default)(_Spinner.Spinner).withConfig({
    displayName: "Button__StyledSpinner",
    componentId: "sc-b39b3537-2"
})([
    "width:1.375rem;"
]);
var ButtonContentWrapper = _styledcomponents.default.span.withConfig({
    displayName: "Button__ButtonContentWrapper",
    componentId: "sc-b39b3537-3"
})([
    "display:flex;align-items:inherit;justify-content:inherit;width:100%;",
    ""
], function(param) {
    var isLoading = param.$isLoading;
    return isLoading && 'opacity: 0;';
});
var ButtonText = _styledcomponents.default.span.withConfig({
    displayName: "Button__ButtonText",
    componentId: "sc-b39b3537-4"
})([
    "box-sizing:border-box;",
    " ",
    " ",
    ""
], _mixins.applyEllipsis, function(param) {
    var isContentLeft = param.$isContentLeft;
    return isContentLeft && 'margin-left: 0.375rem;';
}, function(param) {
    var isContentRight = param.$isContentRight;
    return isContentRight && 'margin-right: 0.375rem;';
});
var Button = /*#__PURE__*/ _react.default.forwardRef(// eslint-disable-next-line prefer-arrow-callback
function Button(props, ref) {
    return /*#__PURE__*/ _react.default.createElement(ButtonRoot, _object_spread({
        ref: ref
    }, props));
});
Button.defaultProps = {
    pin: 'square-square',
    outlined: false
};
