"use strict";
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 __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var classnames_1 = __importDefault(require("classnames"));
var TabPanel_1 = require("./TabPanel");
var TabItem_1 = require("./TabItem");
var Icon_1 = require("./Icon");
var Block_1 = require("./Block");
var WizardNavbar = /** @class */ (function (_super) {
    __extends(WizardNavbar, _super);
    function WizardNavbar() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    WizardNavbar.prototype.render = function () {
        var _this = this;
        var currentStepIndex = this.context.wizard.getCurrentStepIndex();
        var maxVisitedStepIndex = this.context.wizard.getMaxVisitedStepIndex();
        return (react_1.default.createElement(Block_1.Block, { cancelBottomOffset: true },
            react_1.default.createElement(TabPanel_1.TabPanel, { centered: true, noBorder: true }, this.context.wizard
                .getSteps()
                .filter(function (step) {
                return !step.props.skipNavbarItem;
            })
                .map(function (step, index) {
                var isPassed = index < currentStepIndex;
                var isCurrent = index === currentStepIndex;
                var isBlocked = step.props.disabled || index > maxVisitedStepIndex;
                return (react_1.default.createElement(TabItem_1.TabItem, { key: 'wizardStep-' + step.props.id, testAutomationId: step.props.id, active: isCurrent, disabled: isBlocked, className: classnames_1.default({ success: isPassed }), onSelect: function () { return _this.context.wizard.goToStep(step.props.id); } },
                    isPassed ? (react_1.default.createElement(Icon_1.Icon, { name: "checkbox-selected-readonly" })) : (react_1.default.createElement("strong", null, index + 1)),
                    step.props.tabText || step.props.title));
            }))));
    };
    WizardNavbar.contextTypes = {
        wizard: prop_types_1.default.object.isRequired
    };
    return WizardNavbar;
}(react_1.default.Component));
exports.WizardNavbar = WizardNavbar;
//# sourceMappingURL=WizardNavbar.js.map