!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):t(jQuery)}(function(jt,Et){"use strict";function Dt(t,e,r,n){for(var a=[],i=0;i')}else{var u="sp-clear-display";a.push(jt("
").append(jt('').attr("title",n.noColorSelectedText)).html())}}return"
"+a.join("")+"
"}function It(){for(var t=0;tMath.abs(e-a);nt=i?"x":"y"}}else nt=null;var o=!nt||"y"===nt;(!nt||"x"===nt)&&(Y=parseFloat(t/z)),o&&(G=parseFloat((B-e)/B)),Ot=!1,F.showAlpha||(Q=1),_()},s,l),Rt?(m(Rt),x(),Ft=F.preferredFormat||tinycolor(Rt).format,i(Rt)):x(),T&&d();var r=Xt?"mousedown.spectrum":"click.spectrum touchstart.spectrum";vt.delegate(".sp-thumb-el",r,t),mt.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},t)}function a(){if(q&&window.localStorage){try{var t=window.localStorage[q].split(",#");1et;)tt.shift();if(q&&window.localStorage)try{window.localStorage[q]=tt.join(";")}catch(r){}}}function o(){var t=[];if(F.showPalette)for(var e=0;el&&nc&&a","
","
","
"].join(""),Qt=function(){var t="";if(Xt)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
",t,"
","
","
","
","
","","
","
","
","","","
","
","
"].join("")}(),i="spectrum.id";jt.fn.spectrum=function(r){if("string"!=typeof r)return this.spectrum("destroy").each(function(){var t=e(this,jt.extend({},r,jt(this).data()));jt(this).data(i,t.id)});var n=this,a=Array.prototype.slice.call(arguments,1);return this.each(function(){var t=Wt[jt(this).data(i)];if(t){var e=t[r];if(!e)throw new Error("Spectrum: no such method: '"+r+"'");"get"==r?n=t.get():"container"==r?n=t.container:"option"==r?n=t.option.apply(t,a):"destroy"==r?(t.destroy(),jt(this).removeData(i)):e.apply(t,a)}}),n},jt.fn.spectrum.load=!0,jt.fn.spectrum.loadOpts={},jt.fn.spectrum.draggable=Kt,jt.fn.spectrum.defaults=a,jt.fn.spectrum.inputTypeColorSupport=function $t(){if("undefined"==typeof $t._cachedResult){var t=jt("")[0];$t._cachedResult="color"===t.type&&""!==t.value}return $t._cachedResult},jt.spectrum={},jt.spectrum.localization={},jt.spectrum.palettes={},jt.fn.spectrum.processNativeColorInputs=function(){var t=jt("input[type=color]");t.length&&!$t()&&t.spectrum({preferredFormat:"hex6"})},function(){function n(t){var e={r:0,g:0,b:0},r=1,n=!1,a=!1;return"string"==typeof t&&(t=T(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=i(t.r,t.g,t.b),n=!0,a="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=R(t.s),t.v=R(t.v),e=l(t.h,t.s,t.v),n=!0,a="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=R(t.s),t.l=R(t.l),e=o(t.h,t.s,t.l),n=!0,a="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=x(r),{ok:n,format:t.format||a,r:D(255,I(e.r,0)),g:D(255,I(e.g,0)),b:D(255,I(e.b,0)),a:r}}function i(t,e,r){return{r:255*k(t,255),g:255*k(e,255),b:255*k(r,255)}}function a(t,e,r){t=k(t,255),e=k(e,255),r=k(r,255);var n,a,i=I(t,e,r),o=D(t,e,r),s=(i+o)/2;if(i==o)n=a=0;else{var l=i-o;switch(a=.5>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(B(n));return i}function w(t,e){e=e||6;for(var r=B(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(B({h:n,s:a,v:i})),i=(i+s)%1;return o}function _(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function x(t){return t=parseFloat(t),(isNaN(t)||t<0||1