"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "pathReducer", {
    enumerable: true,
    get: function() {
        return pathReducer;
    }
});
function pathReducer(state, action) {
    switch(action.type){
        case 'reset':
            {
                return [];
            }
        case 'opened_first_level':
            {
                return [
                    'root'
                ];
            }
        case 'added_next_level':
            {
                return [
                    ...state,
                    action.value
                ];
            }
        case 'removed_last_level':
            {
                return [
                    ...state.slice(0, -1)
                ];
            }
        case 'changed_on_level':
            {
                return [
                    ...state.slice(0, action.level),
                    action.value
                ];
            }
        case 'cut_by_level':
            {
                return state.slice(0, action.level);
            }
        default:
            {
                return state;
            }
    }
}
