"use strict";

var _style = require("styled-jsx/style");

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __makeTemplateObject = undefined && undefined.__makeTemplateObject || function (cooked, raw) {
    if (Object.defineProperty) {
        Object.defineProperty(cooked, "raw", { value: raw });
    } else {
        cooked.raw = raw;
    }
    return cooked;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var ageOfDate_1 = require("./util/ageOfDate");
var ResultViewer_1 = require("./ResultViewer");
var cn = require("classnames");
var react_redux_1 = require("react-redux");
var reselect_1 = require("reselect");
var selectors_1 = require("../../state/sessions/selectors");
var styled_1 = require("../../styled");
var Results = function Results(_a) {
    var setRef = _a.setRef,
        responses = _a.responses;
    return React.createElement(
        "div",
        { className: cn('result-window', {
                isSubscription: responses.size > 1
            }), ref: setRef, "data-jsx": 4186134571
        },
        React.createElement(_style2.default, {
            styleId: 4186134571,
            css: ".subscription-time[data-jsx=\"4186134571\"] {height: 17px;margin-top: 12px;margin-bottom: 4px}.subscription-time[data-jsx=\"4186134571\"][data-jsx=\"4186134571\"]:before {content: '';top: 9px;left: 95px;border-top: 1px solid rgba(255, 255, 255, .2)}.subscription-time-text[data-jsx=\"4186134571\"] {padding-left: 15px;}.result-viewer-wrapper[data-jsx=\"4186134571\"] {position: absolute;top: 0;left: 0;right: 0;bottom: 0;overflow: auto;}.isSubscription[data-jsx=\"4186134571\"] .result-viewer-wrapper[data-jsx=\"4186134571\"] {position: relative;}.bgDarkBlue,\n.result-window[data-jsx=\"4186134571\"],\n.subscription-time-text[data-jsx=\"4186134571\"] {background-color: #172a3a}.nosb,\n.result-window[data-jsx=\"4186134571\"] {-ms-overflow-style: none}.nosb::-webkit-scrollbar,\n.result-window[data-jsx=\"4186134571\"]::-webkit-scrollbar {display: none}.relative,\n.result-window[data-jsx=\"4186134571\"],\n.subscription-time[data-jsx=\"4186134571\"] {position: relative}.relative,\n.result-window[data-jsx=\"4186134571\"],\n.subscription-time[data-jsx=\"4186134571\"] {position: relative}.absolute,\n.subscription-time[data-jsx=\"4186134571\"][data-jsx=\"4186134571\"]:before {position: absolute}.w100,\n.subscription-time[data-jsx=\"4186134571\"][data-jsx=\"4186134571\"]:before {width: 100%}.bgDarkBlue,\n.result-window[data-jsx=\"4186134571\"],\n.subscription-time-text[data-jsx=\"4186134571\"] {background-color: #172a3a}.white50,\n.subscription-time-text[data-jsx=\"4186134571\"] {color: hsla(0,0%,100%,.5)}.f12,\n.subscription-time-text[data-jsx=\"4186134571\"] {font-size: 12px}"
        }),
        responses.map(function (response) {
            return React.createElement(
                Response,
                { key: response.resultID || String(response.time) },
                responses.size > 1 && response.time && React.createElement(
                    "div",
                    { className: "subscription-time", "data-jsx": 4186134571
                    },
                    React.createElement(
                        "div",
                        { className: "subscription-time-text", "data-jsx": 4186134571
                        },
                        ageOfDate_1.default(response.time)
                    )
                ),
                React.createElement(
                    "div",
                    { className: "result-viewer-wrapper", "data-jsx": 4186134571
                    },
                    React.createElement(ResultViewer_1.ResultViewer, { value: response.date })
                )
            );
        })
    );
};
var mapStateToProps = reselect_1.createStructuredSelector({
    responses: selectors_1.getResponses
});
exports.default = react_redux_1.connect(mapStateToProps)(Results);
var Response = styled_1.styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  &:not(:first-child):last-of-type {\n    margin-bottom: 48px;\n  }\n"], ["\n  &:not(:first-child):last-of-type {\n    margin-bottom: 48px;\n  }\n"])));
var templateObject_1;
//# sourceMappingURL=Results.jsx.map