var uniflash;
(function (uniflash) {
    var resets;
    (function (resets_1) {
        'use strict';
        angular.module('uniflash').service('ufResets', resets);
        resets.$inject = ['ufSession', 'ufContext'];
        function resets(ufSession, ufContext, ufIsBinary, ticFileFactory, ufProgramProviders) {
            var cores = {};
            ufSession.registerSessionDataProvider('resets', {
                onSessionLoad: function () {
                    cores = {}; // reset data
                    // init cores
                    _.each(ufSession.queryConfig().cores, function (coreInfo) {
                        cores[coreInfo.name] = {
                            name: coreInfo.name,
                            reset: {
                                resetAfterLoad: false,
                                selectedResetOption: undefined,
                                availableResetOptions: []
                            }
                        };
                    });
                },
                getSessionData: function () { }
            });
            function getCoreData() {
                return cores[ufContext.getCurrentCore().name];
            }
            function getAllGUICoresData() {
                return _.map(ufSession.queryConfig().cores, function (coreInfo) {
                    return cores[coreInfo.name];
                });
            }
            function getReset() {
                return getCoreData().reset;
            }
            function getResetOnCore(coreName) {
                if (coreName && cores[coreName]) {
                    return cores[coreName].reset;
                }
                else {
                    return undefined;
                }
            }
            return {
                getReset: getReset,
                getAllGUICoresData: getAllGUICoresData,
                getResetOnCore: getResetOnCore,
            };
        }
    })(resets = uniflash.resets || (uniflash.resets = {}));
})(uniflash || (uniflash = {}));
