text: define("mvc/ui/ui-color-picker",["exports","utils/utils"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(t);e.default=Backbone.View.extend({colors:{standard:["c00000","ff0000","ffc000","ffff00","92d050","00b050","00b0f0","0070c0","002060","7030a0"],base:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646"],theme:[["f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada"],["d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5"],["bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","92cddc","fac08f"],["a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","31859b","e36c09"],["7f7f7e","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","205867","974806"]]},initialize:function(e){this.options=i.default.merge(e,{}),this.setElement(this._template()),this.$panel=this.$(".ui-color-picker-panel"),this.$view=this.$(".ui-color-picker-view"),this.$value=this.$(".ui-color-picker-value"),this.$header=this.$(".ui-color-picker-header"),this._build(),this.visible=!1,this.value(this.options.value),this.$boxes=this.$(".ui-color-picker-box");var t=this;this.$boxes.on("click",function(){t.value($(this).css("background-color")),t.$header.trigger("click")}),this.$header.on("click",function(){t.visible=!t.visible,t.visible?t.$view.fadeIn("fast"):t.$view.fadeOut("fast")})},value:function(e){return void 0!==e&&null!==e&&(this.$value.css("background-color",e),this.$(".ui-color-picker-box").empty(),this.$(this._getValue()).html(this._templateCheck()),this.options.onchange&&this.options.onchange(e)),this._getValue()},_getValue:function(){var e=this.$value.css("background-color");if(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/)){var t=function(e){return("0"+parseInt(e).toString(16)).slice(-2)};return"#"+t(e[1])+t(e[2])+t(e[3])}return null},_build:function(){this._content({colors:this.colors.base});for(var e in this.colors.theme){var t={};0==e?t.bottom=!0:e!=this.colors.theme.length-1?(t.top=!0,t.bottom=!0):t.top=!0,t.colors=this.colors.theme[e],this._content(t)}this._content({colors:this.colors.standard})},_content:function(e){var t=e.colors,i=$(this._templateContent()),o=i.find(".line");this.$panel.append(i);for(var c in t){var s=$(this._templateBox(t[c]));e.top&&(s.css("border-top","none"),s.css("border-top-left-radius","0px"),s.css("border-top-right-radius","0px")),e.bottom&&(s.css("border-bottom","none"),s.css("border-bottom-left-radius","0px"),s.css("border-bottom-right-radius","0px")),o.append(s)}return i},_templateCheck:function(){return'<div class="ui-color-picker-check fa fa-check"/>'},_templateContent:function(){return'<div class="ui-color-picker-content"><div class="line"/></div>'},_templateBox:function(e){return'<div id="'+e+'" class="ui-color-picker-box" style="background-color: #'+e+';"/>'},_template:function(){return'<div class="ui-color-picker"><div class="ui-color-picker-header"><div class="ui-color-picker-value"/><div class="ui-color-picker-label">Select a color</div></div><div class="ui-color-picker-view ui-input"><div class="ui-color-picker-panel"/></div>'}})});