content: import React from 'react'
  
  // VENDOR DEPENDENCIES _________________________________________________________
  import { Router, Route, IndexRoute, browserHistory } from 'react-router'
  import {Provider} from 'react-redux'
  
  // COMPONENTS __________________________________________________________________
  import AppContainer from '../containers/App_container.js'
  import Home from '../components/Home/Home'
  import Booking from '../components/Booking'
  import BookingAvailability from '../components/Booking/Availability'
  import BookingRoom from '../components/Booking/Rooms'
  import BookingNotAvailable from '../components/Booking/NotAvailable'
  import BookingExtrasContainer from '../components/Booking/Extras'
  
  // HELPERS _____________________________________________________________________
  import {
    redirectIfInvalid,
    redirectIfStepSkipped
  } from '../components/Booking/helpers'
  import {
    resetHandler,
    resetFromStep,
    resetCurrentRoom
  } from './resetters'
  
  /**
   * Executes logic that prevents from skipping steps.
   * @param  {String} baseURL    String with the base URL of the form step
   * @param  {Integer} stepNumber Number that represents the step
   * @param  {Object} params     URL params straight from 'react-router'
   * @param  {Function} replace    `react-router`'s `replace` function
   */
  function onEnterValidation(baseURL, stepNumber, {params}, replace) {
    const state = this.store.getState(),
        {current_room, current_step} = state.form_nav
  
    redirectIfInvalid(
      current_room,
      params,
      replace,
      baseURL + `/${current_room}`
    )
  
    redirectIfStepSkipped(
      current_step,
      replace,
      stepNumber
    )
  }
  
  // ROUTER DEFINITION ___________________________________________________________
  const AppRouter = ({store}) => (
    <Provider store={store}>
      <Router history={browserHistory} onUpdate={() => window.scrollTo(0,0)}>
        <Route path="/" component={AppContainer}>
          <IndexRoute component={Home} />
          <Route path="booking" onChange={resetHandler.bind({}, store)} component={Booking}>
            <IndexRoute component={BookingAvailability}
              onEnter={resetFromStep.bind({}, store, 0, undefined)}
            />
            <Route path="not-available" component={BookingNotAvailable} />
            <Route path="rooms" component={BookingRoom}
              onEnter={onEnterValidation.bind({store}, '/booking/rooms', 1)}
              onChange={(prev, next) => {
                resetFromStep(store, 1, next.params.roomId)
              }}
              onLeave={() => resetCurrentRoom(store.dispatch)}
            >
              <Route path=":roomId" component={BookingRoom} />
            </Route>
            <Route path="extras" component={BookingExtrasContainer}
              onEnter={onEnterValidation.bind({store}, '/booking/extras', 2)}
              onChange={(prev, next) => {
                resetFromStep(store, 2, next.params.roomId)
              }}
              onLeave={() => resetCurrentRoom(store.dispatch)}
            >
              <Route path=":roomId" component={BookingExtrasContainer} />
            </Route>
          </Route>
        </Route>
      </Router>
    </Provider>
  )
  
  export default AppRouter
  