!function(s){var p="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},s.widget("wp.wpColorPicker",s.wp.wpColorPicker,{_create:function(){if(s.support.iris){var i=this,t=i.element;if(s.extend(i.options,t.data()),"hue"===i.options.type)return i._createHueOnly();i.close=s.proxy(i.close,i),i.initialValue=t.val(),t.addClass("wp-color-picker"),t.parent("label").length||(t.wrap(""),i.wrappingLabelText=s('').insertBefore(t).text(wpColorPickerL10n.defaultLabel)),i.wrappingLabel=t.parent(),i.wrappingLabel.wrap('
'),i.wrap=i.wrappingLabel.parent(),i.toggler=s('').insertBefore(i.wrappingLabel).css({backgroundColor:i.initialValue}),i.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),i.pickerContainer=s('').insertAfter(i.wrappingLabel),i.button=s(''),i.options.defaultColor?i.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString).attr("aria-label",wpColorPickerL10n.defaultAriaLabel):i.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear).attr("aria-label",wpColorPickerL10n.clearAriaLabel),i.wrappingLabel.wrap('').after(i.button),i.inputWrapper=t.closest(".wp-picker-input-wrap"),i.toggler.css({height:"24px",padding:"0 0 0 30px","font-size":"11px"}),i.toggler.find(".wp-color-result-text").css({background:"#f7f7f7","border-radius":"0 2px 2px 0","border-left":"1px solid #ccc",color:"#555",display:"block","line-height":"22px",padding:"0 6px","text-align":"center"}),t.iris({target:i.pickerContainer,hide:i.options.hide,width:i.options.width,mode:i.options.mode,palettes:i.options.palettes,change:function(t,o){i.options.alpha?(i.toggler.css({"background-image":"url("+p+")",position:"relative"}),0==i.toggler.find("span.color-alpha").length&&i.toggler.append(''),i.toggler.find("span.color-alpha").css({width:"30px",height:"22px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:o.color.toString()})):i.toggler.css({backgroundColor:o.color.toString()}),s.isFunction(i.options.change)&&i.options.change.call(this,t,o)}}),t.val(i.initialValue),i._addListeners(),i.options.hide||i.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(t){""!==s(this).val()&&!o.element.hasClass("iris-error")||(o.options.alpha?o.toggler.find("span.color-alpha").css("backgroundColor",""):o.toggler.css("backgroundColor",""),s.isFunction(o.options.clear)&&o.options.clear.call(this,t))}),o.button.on("click",function(t){s(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?o.toggler.find("span.color-alpha").css("backgroundColor",""):o.toggler.css("backgroundColor",""),s.isFunction(o.options.clear)&&o.options.clear.call(this,t)):s(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),s.widget("a8c.iris",s.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var i=this,t=i.element,o=s('').appendTo(i.picker.find(".iris-picker-inner")),e=o.find(".iris-slider-offset-alpha"),r={aContainer:o,aSlider:e};void 0!==t.data("custom-width")?i.options.customWidth=parseInt(t.data("custom-width"))||0:i.options.customWidth=100,i.options.defaultWidth=t.width(),(i._color._alpha<1||-1!=i._color.toString().indexOf("rgb"))&&t.width(parseInt(i.options.defaultWidth+i.options.customWidth)),s.each(r,function(t,o){i.controls[t]=o}),i.controls.square.css({"margin-right":"0"});var a=i.picker.width()-i.controls.square.width()-20,n=a/6,l=a/2-n;s.each(["aContainer","strip"],function(t,o){i.controls[o].width(l).css({"margin-left":n+"px"})}),i._initControls(),i._change()}},_initControls:function(){if(this._super(),this.options.alpha){var i=this;i.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*i._color._alpha),slide:function(t,o){i._color._alpha=parseFloat(o.value/100),i._change.apply(i,arguments)}})}},_change:function(){this._super();var t=this,o=t.element;if(this.options.alpha){var i=t.controls,e=parseInt(100*t._color._alpha),r=t._color.toRgb(),a=["rgb("+r.r+","+r.g+","+r.b+") 0%","rgba("+r.r+","+r.g+","+r.b+", 0) 100%"],n=t.options.defaultWidth,l=t.options.customWidth,s=t.picker.closest(".wp-picker-container").find(".wp-color-result");i.aContainer.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+p+")"}),s.hasClass("wp-picker-open")&&(i.aSlider.slider("value",e),t._color._alpha<1?(i.strip.attr("style",i.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),o.width(parseInt(n+l))):o.width(n))}!o.data("reset-alpha")&&1||t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()})},_addInputListeners:function(e){function t(t){var o=new Color(e.val()),i=e.val();e.removeClass("iris-error"),o.error?""!==i&&e.addClass("iris-error"):o.toString()!==r._color.toString()&&("keyup"===t.type&&i.match(/^[0-9a-fA-F]{3}$/)||r._setOption("color",o.toString()))}var r=this;e.on("change",t).on("keyup",r._debounce(t,100)),r.options.hide&&e.on("focus",function(){r.show()})}})}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});