"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
var __rest = (this && this.__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)
            t[p[i]] = s[p[i]];
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var get = require("lodash/get");
var omit = require("lodash/omit");
var Text_1 = require("./Text");
var utils_1 = require("../utils");
var Base = Text_1.default.extend(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  text-decoration: ", ";\n  cursor: ", ";\n  opacity: ", ";\n  display: inline-block;\n\n  &:active,\n  &:hover {\n    color: ", ";\n  }\n"], ["\n  text-decoration: ", ";\n  cursor: ", ";\n  opacity: ", ";\n  display: inline-block;\n\n  &:active,\n  &:hover {\n    color: ",
    ";\n  }\n"])), function (props) { return props.decor || 'none'; }, function (props) { return (props.disabled ? 'not-allowed' : 'pointer'); }, function (props) { return (props.disabled ? 0.65 : 1); }, function (props) {
    return !props.disabled &&
        utils_1.darken(get(props.theme.colors, props.color) || props.color);
});
var Link = function (_a) {
    var is = _a.is, blank = _a.blank, props = __rest(_a, ["is", "blank"]);
    if (is) {
        Base = Base.withComponent(is);
    }
    if (props.disabled) {
        props = omit(props, 'href');
    }
    return (React.createElement(Base, __assign({}, props, { rel: blank && 'noopener', target: blank && '_blank' })));
};
Link.defaultProps = {
    is: 'a',
    color: 'primary.main'
};
exports.default = Link;
var templateObject_1;
