"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 __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var types_1 = require("./types");
var __1 = require("../");
var styled_components_1 = __importDefault(require("styled-components"));
exports.StripeElement = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border: 1px solid\n    ", ";\n  border-radius: 3px;\n  padding: 12px;\n"], ["\n  border: 1px solid\n    ",
    ";\n  border-radius: 3px;\n  padding: 12px;\n"])), function (props) {
    return props.inputState === types_1.INPUT_STATE.INVALID ? __1.colors.accent.CIVIL_RED : __1.colors.accent.CIVIL_GRAY_3;
});
var InputWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  margin-bottom: 20px;\n  position: relative;\n  width: 100%;\n\n  p {\n    color: ", ";\n    font-size: 13px;\n    line-height: 18px;\n    margin: 5px 0 0;\n  }\n\n  input {\n    border: 1px solid\n      ", ";\n    border-radius: 3px;\n    font-size: 13px;\n    padding: 10px 35px 10px 12px;\n    width: 100%;\n\n    &::placeholder {\n      color: ", ";\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n  }\n\n  select {\n    appearance: none;\n    background-color: transparent;\n    border: 1px solid\n      ", ";\n    border-radius: 3px;\n    display: block;\n    font-family: ", ";\n    font-size: 13px;\n    line-height: 16px;\n    margin: 0;\n    padding: 11px 12px 12px;\n    position: relative;\n    width: 100%;\n    z-index: 1;\n\n    &::-ms-expand {\n      display: none;\n    }\n\n    &:hover {\n      cursor: pointer;\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n  }\n\n  &.positionTop {\n    margin-bottom: 0;\n\n    ", ",\n    input,\n    select {\n      border-radius: 3px 3px 0 0;\n    }\n  }\n\n  &.positionBottom {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 3px 3px;\n      border-width: 0 1px 1px 1px;\n    }\n  }\n\n  &.positionBottomLeft {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 0 3px;\n      border-width: 0 0 1px 1px;\n    }\n  }\n\n  &.positionBottomRight {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 3px;\n      border-width: 0 1px 1px 1px;\n    }\n  }\n"], ["\n  margin-bottom: 20px;\n  position: relative;\n  width: 100%;\n\n  p {\n    color: ", ";\n    font-size: 13px;\n    line-height: 18px;\n    margin: 5px 0 0;\n  }\n\n  input {\n    border: 1px solid\n      ",
    ";\n    border-radius: 3px;\n    font-size: 13px;\n    padding: 10px 35px 10px 12px;\n    width: 100%;\n\n    &::placeholder {\n      color: ", ";\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n  }\n\n  select {\n    appearance: none;\n    background-color: transparent;\n    border: 1px solid\n      ",
    ";\n    border-radius: 3px;\n    display: block;\n    font-family: ", ";\n    font-size: 13px;\n    line-height: 16px;\n    margin: 0;\n    padding: 11px 12px 12px;\n    position: relative;\n    width: 100%;\n    z-index: 1;\n\n    &::-ms-expand {\n      display: none;\n    }\n\n    &:hover {\n      cursor: pointer;\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n  }\n\n  &.positionTop {\n    margin-bottom: 0;\n\n    ", ",\n    input,\n    select {\n      border-radius: 3px 3px 0 0;\n    }\n  }\n\n  &.positionBottom {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 3px 3px;\n      border-width: 0 1px 1px 1px;\n    }\n  }\n\n  &.positionBottomLeft {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 0 3px;\n      border-width: 0 0 1px 1px;\n    }\n  }\n\n  &.positionBottomRight {\n    ", ",\n    input,\n    select {\n      border-radius: 0 0 3px;\n      border-width: 0 1px 1px 1px;\n    }\n  }\n"])), __1.colors.accent.CIVIL_GRAY_1, function (props) {
    return props.inputState === types_1.INPUT_STATE.INVALID ? __1.colors.accent.CIVIL_RED : __1.colors.accent.CIVIL_GRAY_3;
}, __1.colors.accent.CIVIL_GRAY_1, __1.colors.accent.CIVIL_BLUE, function (props) {
    return props.inputState === types_1.INPUT_STATE.INVALID ? __1.colors.accent.CIVIL_RED : __1.colors.accent.CIVIL_GRAY_3;
}, __1.fonts.SANS_SERIF, __1.colors.accent.CIVIL_BLUE, exports.StripeElement, exports.StripeElement, exports.StripeElement, exports.StripeElement);
var InputErrorIcon = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n  display: ", ";\n  position: absolute;\n  right: 5px;\n  top: calc(50% - 10px);\n"], ["\n  display: ", ";\n  position: absolute;\n  right: 5px;\n  top: calc(50% - 10px);\n"])), function (props) { return (props.inputState === types_1.INPUT_STATE.INVALID ? "block" : "none"); });
exports.InputValidationUI = function (props) {
    return (React.createElement(React.Fragment, null,
        React.createElement(InputWrapper, { inputState: props.inputState, className: props.className },
            props.children,
            React.createElement(InputErrorIcon, { inputState: props.inputState },
                React.createElement(__1.ErrorIcon, { width: 20, height: 20 })))));
};
var templateObject_1, templateObject_2, templateObject_3;
//# sourceMappingURL=PaymentsInputValidationUI.js.map