var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { withStyles } from '@signatu/styles';
import PropTypes from 'prop-types';
import React from 'react';
var styles = function (theme) { return ({
    root: {},
    lightbox: {
        position: 'fixed',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        height: '100%',
        width: '100%',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        zIndex: 999,
        opacity: '1.0',
        visibility: 'visible',
        transition: 'opacity 0.5s linear'
    },
    hidden: {
        visibility: 'hidden',
        opacity: 0,
        transition: 'visibility 0s 0.5s, opacity 0.5s linear'
    },
    overlay: {
        position: 'fixed',
        width: 'auto',
        height: 'auto',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        transform: 'translate(0, 0)',
        backgroundColor: 'rgba(0,0,0,0.9)'
    },
    content: {
        backgroundColor: theme.palette.backgroundColor,
        maxWidth: "600px",
        position: 'relative',
        padding: theme.spacing.unit * 2,
        opacity: '1.0',
        zIndex: '1000'
    },
    closeButton: {}
}); };
var Popup = /** @class */ (function (_super) {
    __extends(Popup, _super);
    function Popup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Popup.prototype.render = function () {
        var _this = this;
        var classes = this.props.classes;
        var hidden = this.props.show ? "" : classes.hidden;
        var content = React.createElement("div", { className: classes.lightbox + " " + hidden },
            React.createElement("div", { className: classes.overlay, onClick: function () {
                    _this.props.onClose();
                } }),
            React.createElement("div", { className: classes.content }, this.props.children));
        return React.createElement("div", { "data-type": "Popup" },
            this.props.preload && React.createElement("div", { "data-type": "PopupContent", style: { visibility: "" + (this.props.show ? "visible" : "hidden") } }, content),
            !this.props.preload && React.createElement("div", { "data-type": "PopupContent" },
                " ",
                content,
                " "),
            this.props.closeButton &&
                React.createElement("button", { className: classes.closeButton }, "Close "));
    };
    Popup.propTypes = {
        show: PropTypes.bool.isRequired,
        contentStyle: PropTypes.string,
        onClose: PropTypes.func.isRequired,
        preload: PropTypes.bool,
        closeButton: PropTypes.bool,
        classes: PropTypes.any
    };
    return Popup;
}(React.Component));
var styled = withStyles(styles)(Popup);
export { styled as Popup };
//# sourceMappingURL=consentPopup.js.map