"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _objectSpread2=_interopRequireDefault(require("@babel/runtime/helpers/objectSpread")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_assertThisInitialized2=_interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),React=_interopRequireWildcard(require("react")),_withStyles=_interopRequireDefault(require("../../hoc/withStyles")),_styles=_interopRequireDefault(require("./styles")),_WizardSteps=_interopRequireDefault(require("../../bosons/WizardSteps")),_uploadFile=_interopRequireDefault(require("./uploadFile")),_mapData=_interopRequireDefault(require("./mapData")),_detailData=_interopRequireDefault(require("./detailData")),_findIndex=_interopRequireDefault(require("lodash/findIndex")),DataImports=/*#__PURE__*/function(_React$Component){function DataImports(props){var _this;return(0,_classCallCheck2.default)(this,DataImports),_this=(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(DataImports).call(this,props)),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"_makeStepActive",function(index){var wizardStep=_this.state.wizardStep,pos=(0,_findIndex.default)(wizardStep,{active:!0});-1<pos&&(wizardStep[pos]=(0,_objectSpread2.default)({},wizardStep[pos],{active:!1}),wizardStep[index]=(0,_objectSpread2.default)({},wizardStep[index],{active:!0}),_this.setState({wizardStep:wizardStep}))}),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"_markedVisited",function(index){var wizardStep=_this.state.wizardStep;wizardStep[index]=(0,_objectSpread2.default)({},wizardStep[index],{visited:!0}),_this.setState({wizardStep:wizardStep})}),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"_unmarkedVisited",function(index){var wizardStep=_this.state.wizardStep;wizardStep[index]=(0,_objectSpread2.default)({},wizardStep[index],{visited:!1}),_this.setState({wizardStep:wizardStep})}),(0,_defineProperty2.default)((0,_assertThisInitialized2.default)((0,_assertThisInitialized2.default)(_this)),"_onStepClick",function(step,index){_this._makeStepActive(index)}),_this.state={wizardStep:[{label:"Upload",active:!0,component:React.createElement(_uploadFile.default,{classes:props.classes,makeStepActive:_this._makeStepActive,markedVisited:_this._markedVisited})},{label:"Map",component:React.createElement(_mapData.default,{classes:props.classes,makeStepActive:_this._makeStepActive,markedVisited:_this._markedVisited,unmarkedVisited:_this._unmarkedVisited})},{label:"Details",component:React.createElement(_detailData.default,{classes:props.classes,makeStepActive:_this._makeStepActive,markedVisited:_this._markedVisited,unmarkedVisited:_this._unmarkedVisited})}]},_this}return(0,_inherits2.default)(DataImports,_React$Component),(0,_createClass2.default)(DataImports,[{key:"render",value:function render(){return React.createElement(React.Fragment,null,React.createElement("div",null,React.createElement(_WizardSteps.default,{steps:this.state.wizardStep,onStepClick:this._onStepClick})))}}]),DataImports}(React.Component),_default=(0,_withStyles.default)(_styles.default)(DataImports);exports.default=_default;