/*! grafana - v4.5.1 - 2017-09-19
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["app/core/core_module","app/core/config","lodash"],function(a,b){"use strict";var c,d,e,f;b&&b.id;return{setters:[function(a){c=a},function(a){d=a},function(a){e=a}],execute:function(){f=function(){function a(a,b,c,e,f){this.$http=a,this.$routeParams=b,this.$location=c,this.backendSrv=e,this.colors=[],this.buttonNames=["primary","secondary","inverse","success","warning","danger"],this.buttonSizes=["btn-small","","btn-large"],this.buttonVariants=["-","-outline-"],this.icons=[],this.pages=["colors","buttons","icons","plugins"],this.navModel=f.getAdminNav(),this.theme=d.default.bootData.user.lightTheme?"light":"dark",this.page={},b.page?this.page[b.page]=1:this.page.colors=!0,this.page.colors&&this.loadColors(),this.page.icons&&this.loadIcons()}return a.$inject=["$http","$routeParams","$location","backendSrv","navModelSrv"],a.prototype.loadColors=function(){var a=this;this.$http.get("public/sass/styleguide.json").then(function(b){a.colors=e.default.map(b.data[a.theme],function(a,b){return{name:b,value:a}})})},a.prototype.loadIcons=function(){var a=this;this.$http.get("public/sass/icons.json").then(function(b){a.icons=b.data})},a.prototype.switchTheme=function(){this.$routeParams.theme="dark"===this.theme?"light":"dark";var a={theme:this.$routeParams.theme};this.backendSrv.put("/api/user/preferences",a).then(function(){window.location.href=window.location.href})},a}(),c.default.controller("StyleGuideCtrl",f)}}});