"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 ButtonText () {
        return ButtonText;
    },
    get ButtonValue () {
        return ButtonValue;
    },
    get LoadWrap () {
        return LoadWrap;
    },
    get Loader () {
        return Loader;
    },
    get StyledAdditionalContent () {
        return StyledAdditionalContent;
    },
    get StyledContentLeft () {
        return StyledContentLeft;
    },
    get StyledContentRight () {
        return StyledContentRight;
    },
    get StyledSpinner () {
        return StyledSpinner;
    },
    get base () {
        return base;
    },
    get baseContent () {
        return baseContent;
    }
});
var _styledcomponents = /*#__PURE__*/ _interop_require_wildcard(require("styled-components"));
var _mixins = require("../../mixins");
var _engines = require("../../engines");
var _Spinner = require("../Spinner");
var _Buttontokens = require("./Button.tokens");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
// issue #823
var mergedConfig = (0, _engines.mergeConfig)(_Spinner.spinnerConfig);
var Spinner = (0, _engines.component)(mergedConfig);
var ButtonText = _styledcomponents.default.span.withConfig({
    displayName: "Button.styles__ButtonText",
    componentId: "sc-5e938d89-0"
})([
    "min-width:4ch;&.",
    "{flex-grow:2;text-align:start;}color:var(",
    ");",
    ""
], String(_Buttontokens.classes.contentRelaxed), _Buttontokens.tokens.buttonTextColor, (0, _mixins.applyEllipsis)());
var StyledAdditionalContent = _styledcomponents.default.div.withConfig({
    displayName: "Button.styles__StyledAdditionalContent",
    componentId: "sc-5e938d89-1"
})([
    "display:flex;align-items:center;margin:var(",
    ");&.",
    "{text-align:start;flex-grow:2;}&.",
    "{margin-right:var(",
    ");}"
], _Buttontokens.tokens.buttonAdditionalContentMargin, String(_Buttontokens.classes.contentRelaxed), _Buttontokens.classes.buttonHasValue, _Buttontokens.tokens.buttonAdditionalContentMarginRightWidthValue);
var ButtonValue = _styledcomponents.default.span.withConfig({
    displayName: "Button.styles__ButtonValue",
    componentId: "sc-5e938d89-2"
})([
    "min-width:4ch;margin:var(",
    ");color:var(",
    ");font-weight:var(",
    ");",
    ""
], _Buttontokens.tokens.buttonValueMargin, _Buttontokens.tokens.buttonValueColor, _Buttontokens.tokens.buttonValueFontWeight, (0, _mixins.applyEllipsis)());
var LoadWrap = _styledcomponents.default.div.withConfig({
    displayName: "Button.styles__LoadWrap",
    componentId: "sc-5e938d89-3"
})([
    "opacity:",
    ";display:flex;align-items:inherit;justify-content:",
    ";height:100%;width:100%;"
], function(param) {
    var isLoading = param.isLoading;
    return isLoading ? '0' : '1';
}, function(param) {
    var contentPlacing = param.contentPlacing;
    return contentPlacing;
});
var Loader = _styledcomponents.default.div.withConfig({
    displayName: "Button.styles__Loader",
    componentId: "sc-5e938d89-4"
})([
    "position:absolute;"
]);
var StyledSpinner = (0, _styledcomponents.default)(Spinner).withConfig({
    displayName: "Button.styles__StyledSpinner",
    componentId: "sc-5e938d89-5"
})([
    "",
    ":var(",
    ");",
    ":var(",
    ");"
], _Spinner.spinnerTokens.size, _Buttontokens.tokens.buttonSpinnerSize, _Spinner.spinnerTokens.color, _Buttontokens.tokens.buttonSpinnerColor);
var StyledContentLeft = _styledcomponents.default.div.withConfig({
    displayName: "Button.styles__StyledContentLeft",
    componentId: "sc-5e938d89-6"
})([
    "display:flex;align-self:var(",
    ");color:var(",
    ");margin:",
    ";"
], _Buttontokens.tokens.buttonLeftContentAlignSelf, _Buttontokens.tokens.buttonIconColor, function(param) {
    var hasContentMargin = param.hasContentMargin;
    return hasContentMargin ? "var(".concat(_Buttontokens.tokens.buttonLeftContentMargin, ")") : 0;
});
var StyledContentRight = _styledcomponents.default.div.withConfig({
    displayName: "Button.styles__StyledContentRight",
    componentId: "sc-5e938d89-7"
})([
    "display:flex;align-self:var(",
    ");color:var(",
    ");margin:",
    ";"
], _Buttontokens.tokens.buttonRightContentAlignSelf, _Buttontokens.tokens.buttonIconColor, function(param) {
    var hasContentMargin = param.hasContentMargin;
    return hasContentMargin ? "var(".concat(_Buttontokens.tokens.buttonRightContentMargin, ")") : 0;
});
var base = (0, _styledcomponents.css)([
    "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;}--plasma_private-btn-br:var(--plasma_computed-btn-br);border-radius:var(--plasma_private-btn-br);&&.",
    "{width:var(",
    ");padding:0;}"
], String(_Buttontokens.classes.buttonSquare), _Buttontokens.tokens.buttonHeight);
var baseContent = "\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    box-sizing: border-box;\n    justify-content: center;\n\n    appearance: none;\n    border: none;\n    cursor: pointer;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n    a& {\n        text-decoration: none;\n    }\n\n    /* NOTE:\n        --plasma_computed-btn-br-radius is defined in Button.tsx\n    */\n    --plasma_private-btn-br: var(--plasma_computed-btn-br);\n    border-radius: var(--plasma_private-btn-br);\n\n    &&.".concat(String(_Buttontokens.classes.buttonSquare), " {\n        width: var(").concat(_Buttontokens.tokens.buttonHeight, ");\n        padding: 0;\n    }\n\n    color: var(").concat(_Buttontokens.tokens.buttonColor, ");\n    background: var(").concat(_Buttontokens.tokens.buttonBackgroundColor, ");\n    box-shadow: inset 0 0 0 0.063rem var(").concat(_Buttontokens.tokens.buttonBorderColor, ", inset 0 0 0 0 transparent);\n\n    @media (hover: hover) and (pointer: fine) {\n        :hover {\n            color: var(").concat(_Buttontokens.tokens.buttonColorHover, ", var(").concat(_Buttontokens.tokens.buttonColor, "));\n            background: var(").concat(_Buttontokens.tokens.buttonBackgroundColorHover, ", var(").concat(_Buttontokens.tokens.buttonBackgroundColor, "));\n            box-shadow: inset 0 0 0 0.063rem var(").concat(_Buttontokens.tokens.buttonBorderColorHover, ", inset 0 0 0 0 transparent);\n\n            scale: var(").concat(_Buttontokens.tokens.buttonScaleHover, ");\n        }\n    }\n\n    :active {\n        color: var(").concat(_Buttontokens.tokens.buttonColorActive, ", var(").concat(_Buttontokens.tokens.buttonColor, "));\n        background: var(").concat(_Buttontokens.tokens.buttonBackgroundColorActive, ", var(").concat(_Buttontokens.tokens.buttonBackgroundColor, "));\n        box-shadow: inset 0 0 0 0.063rem var(").concat(_Buttontokens.tokens.buttonBorderColorActive, ", inset 0 0 0 0 transparent);\n\n        scale: var(").concat(_Buttontokens.tokens.buttonScaleActive, ");\n    }\n\n    height: var(").concat(_Buttontokens.tokens.buttonHeight, ");\n    width: var(").concat(_Buttontokens.tokens.buttonWidth, ");\n\n    /* TODO: #714 move these calc's to plasma-mapping | ds-generator and add Math.round() */\n    padding: 0 var(").concat(_Buttontokens.tokens.buttonPadding, ", calc(var(").concat(_Buttontokens.tokens.buttonHeight, ") * 1.618 / 4));\n\n    font-family: var(").concat(_Buttontokens.tokens.buttonFontFamily, ");\n    font-size: var(").concat(_Buttontokens.tokens.buttonFontSize, ");\n    font-style: var(").concat(_Buttontokens.tokens.buttonFontStyle, ");\n    font-weight: var(").concat(_Buttontokens.tokens.buttonFontWeight, ");\n    letter-spacing: var(").concat(_Buttontokens.tokens.buttonLetterSpacing, ");\n    line-height: var(").concat(_Buttontokens.tokens.buttonLineHeight, ");\n\n    /* TODO: #710 make it token API ? */\n    --plasma_private-btn-outline-size: var(--plasma-button-outline-size, 0.0625rem);\n\n    :focus-visible {\n        outline: none;\n    }\n\n    ").concat((0, _mixins.addFocus)({
    outlineOffset: '-0.125rem',
    outlineSize: 'var(--plasma_private-btn-outline-size)',
    outlineRadius: 'calc(0.125rem + var(--plasma_private-btn-br))',
    outlineColor: "var(".concat(_Buttontokens.tokens.buttonFocusColor, ")")
}), "\n\n    &[disabled] {\n        opacity: var(").concat(_Buttontokens.tokens.buttonDisabledOpacity, ");\n        cursor: not-allowed;\n\n        @media (hover: hover) and (pointer: fine) {\n            :hover,\n            :active {\n                scale: none;\n\n                color: var(").concat(_Buttontokens.tokens.buttonColor, ");\n                background: var(").concat(_Buttontokens.tokens.buttonBackgroundColor, ");\n            }\n        }\n    }\n\n    &.").concat(_Buttontokens.classes.fixedStretching, " {\n        width: var(").concat(_Buttontokens.tokens.buttonWidth, ");\n    }\n    &.").concat(_Buttontokens.classes.filledStretching, " {\n        width: 100%;\n    }\n    &.").concat(_Buttontokens.classes.autoStretching, " {\n        width: fit-content;\n    }\n");
