// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/_base/lang dojo/_base/html dojo/on dojo/_base/Color jimu/dijit/ColorSelector".split(" "),function(l,m,n,p,g,e,h,d,q){return m([n,p,l],{baseClass:"jimu-color-picker",declaredClass:"jimu.dijit.ColorPicker",templateString:"\x3cdiv\x3e\x3c/div\x3e",_isTooltipDialogOpened:!1,color:null,showHex:!0,showHsv:!0,showRgb:!0,ensureMode:!1,showLabel:!1,postMixInProperties:function(){this.nls=window.jimuNls.common},postCreate:function(){this.inherited(arguments);
this.color?this.color instanceof d||(this.color=new d(this.color)):this.color=new d("#ccc");e.setStyle(this.domNode,"backgroundColor",this.color.toHex());this._createDialog(this.domNode)},destroy:function(){this.picker.destroy();this.inherited(arguments)},_handlerOk:function(a){a&&a.stopPropagation&&a.preventDefault&&(a.stopPropagation(),a.preventDefault());this.emit("ok",this.color)},_handlerApply:function(a){a&&a.stopPropagation&&a.preventDefault&&(a.stopPropagation(),a.preventDefault());this.emit("apply",
this.color)},_handlerCancel:function(a){a&&a.stopPropagation&&a.preventDefault&&(a.stopPropagation(),a.preventDefault());this.emit("cancel")},_createDialog:function(){var a=e.create("div",{"class":"dojox-color-picker-container"},this.domNode),c=new q({showHex:this.showHex,showRgb:this.showRgb,showHsv:this.showHsv,value:this.color.toHex(),onChange:g.hitch(this,function(b){b=new d(b);this.setColor(b)})});c.placeAt(a);c.startup();a=e.create("div",{"class":"btns-container jimu-float-trailing"},a);if(!0===
this.showOk){var f=e.create("div",{"class":"jimu-btn jimu-float-leading ok",title:this.nls.ok,innerHTML:this.nls.ok},a);this.own(h(f,"click",g.hitch(this,function(b){var k=this.picker.get("value");this.setColor(new d(k));this._handlerOk(b)})))}!0===this.showApply&&(f=e.create("div",{"class":"jimu-btn jimu-float-leading apply",title:this.nls.apply,innerHTML:this.nls.apply},a),this.own(h(f,"click",g.hitch(this,function(b){var k=this.picker.get("value");this.setColor(new d(k));this._handlerApply(b)}))));
a=e.create("div",{"class":"jimu-btn jimu-btn-vacation jimu-float-leading",title:this.nls.cancel,innerHTML:this.nls.cancel},a);this.own(h(a,"click",g.hitch(this,function(b){this._handlerCancel(b)})));this.picker=c},setColor:function(a){if(a instanceof d){var c=this.color,f="";c&&(f=c.toHex());c=a.toHex();this.color=a;f!==c&&this.picker.set("value",c)}},getColor:function(){return this.color},onClose:function(){}})});