var UR=UR||{};UR.store=function(){var c=JSON.parse(localStorage.remotes||JSON.stringify({Hash:0}));var a=JSON.parse(localStorage.layouts||JSON.stringify([]));function b(){localStorage.layouts=JSON.stringify(a)}return{saveRemotes:function(d){var e=["Relmtech.Basic Input","Unified.Command","Unified.FileManager","Unified.Start","Unified.Screen","Unified.ScrollWheel","Unified.SendText","Unified.TaskManager"];d.Remotes=_.filter(d.Remotes,function(f){return _.indexOf(e,f.ID)===-1});c=d;localStorage.remotes=JSON.stringify(d)},getRemotes:function(){return c},getRemoteHash:function(){return c.Hash},getRemoteList:function(){return _.sortBy(c.Remotes,function(d){d.Name.toLowerCase()})},getRemoteById:function(d){return _.find(model.remotes,function(e){return e.ID===d})},updateLayouts:function(e,d){_.forEach(e,function(g){var h=g.ID;var f={ID:h};if(!_.some(a,f)){a.push(f)}d(h,function(k){var j=_.findIndex(a,f);var i=a[j];a[j]=k;b()})})},getLayouts:function(){return a},getLayoutsHash:function(){return _.map(a,function(d){return{ID:d.ID,Hash:d.Hash}})},getLayout:function(d){return _.find(a,{ID:d})},getSavedCredentials:function(){if(localStorage.session){return JSON.parse(UR.util.base64decode(localStorage.session))}else{return false}},saveCredentials:function(d){localStorage.session=UR.util.base64encode(JSON.stringify(d))},resetCredentials:function(){delete localStorage.session}}}();