function pushHistory(screen, state) {
    if (state.screen === screen) return state;
    return {
        ...state,
        screen,
        screenHistory: [
            ...state.screenHistory,
            state.screen
        ]
    };
}
function replaceHistory(screen, state) {
    if (state.screen === screen) return state;
    return {
        ...state,
        screen,
        screenHistory: []
    };
}
function canGoBack(state) {
    return state.screenHistory.length > 0;
}

export { canGoBack, pushHistory, replaceHistory };
//# sourceMappingURL=navigation.mjs.map
