// 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("require dojo dijit dojo/_base/declare dijit/_editor/_Plugin dijit/form/DropDownButton".split(" "),function(h,f,k,l,m,n){f.experimental("dijit.editor.plugins.EditorTextColor");var g=l("dijit.editor.plugins.EditorTextColor",m,{buttonClass:n,colorPicker:"jimu/dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command="editorTextColor";this.hackCommand="foreColor";this.inherited(arguments);var a="",d=!1;this.params.custom&&(this.params.custom.recordUID&&(a=this.params.custom.recordUID),
this.params.custom.forceAttr&&(d=this.params.custom.forceAttr));var b=this;this.button.set("iconClass",this.iconClassPrefix+" "+this.iconClassPrefix+"ForeColor");this.button.set("title",this.getLabel(this.hackCommand));this.button.loadDropDown=function(c){function e(p){b.button.dropDown=new p({dir:b.editor.dir,ownerDocument:b.editor.ownerDocument,value:b.value,appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showColorPickerApply:!1,showCoustomRecord:!0},recordUID:a,onChange:function(q){b.editor.execCommand("useCSS",
d);b.editor.execCommand("styleWithCSS",!d);b.editor.execCommand(b.hackCommand,q)},onClose:function(){b.button.closeDropDown()}});c()}"string"===typeof b.colorPicker?h([b.colorPicker],e):e(b.colorPicker)}},updateState:function(){var a=this.editor,d=this.hackCommand;if(a&&a.isLoaded&&d.length){if(this.button){var b=this.get("disabled");this.button.set("disabled",b);if(b)return;try{var c=a.queryCommandValue(d)||""}catch(e){c=""}}""===c?c="#000000":"transparent"===c&&(c="rgba(0, 0, 0, 0)");this.value=
c;(a=this.button.dropDown)&&a.getColor&&c!==a.getColor()&&(a.refreshRecords(),a.setColor(c))}}});f.subscribe(k._scopeName+".Editor.getPlugin",null,function(a){if(!a.plugin)switch(a.args.name){case "editorTextColor":a.plugin=new g}});return g});