!function(e,t){var i=function(t,i){function a(e){e.preventDefault(),e.stopPropagation();var t=z.offset(),i=t[p],a=w?e.pageY:e.pageX;a>i+H?(H=a-i-S+E,H>D&&(H=D)):(H=a-i-E,0>H&&(H=0)),h.update_scroll()}function s(t){t.preventDefault(),t.stopPropagation(),te=ee=w?t.pageY:t.pageX,R=!0,e("html").off("mousemove.ace_scroll").on("mousemove.ace_scroll",n),e(N).off("mouseup.ace_scroll").on("mouseup.ace_scroll",o),z.addClass("active"),Q&&h.$element.trigger("drag.start")}function n(e){e.preventDefault(),e.stopPropagation(),te=w?e.pageY:e.pageX,te-ee+H>D?te=ee+D-H:0>te-ee+H&&(te=ee-H),H+=te-ee,ee=te,0>H?H=0:H>D&&(H=D),h.update_scroll()}function o(t){t.preventDefault(),t.stopPropagation(),R=!1,e("html").off(".ace_scroll"),e(N).off(".ace_scroll"),z.removeClass("active"),Q&&h.$element.trigger("drag.end"),x&&G&&!X&&l()}function r(e){var t=+new Date;if(J&&t-ae>1e3){var i=$[_];K!=i&&(K=i,Z=!0,h.reset(!0)),ae=t}x&&G&&(null!=ie&&(clearTimeout(ie),ie=null),z.addClass("not-idle"),X||1!=e||l())}function l(){null!=ie&&(clearTimeout(ie),ie=null),ie=setTimeout(function(){ie=null,z.removeClass("not-idle")},V)}function c(){z.css("visibility","hidden").addClass("scroll-hover"),F=w?parseInt(z.outerWidth())||0:parseInt(z.outerHeight())||0,z.css("visibility","").removeClass("scroll-hover")}function d(){if(Y!==!1){var e=k.offset(),t=e.left,i=e.top;w?O||(t+=k.outerWidth()-F):O||(i+=k.outerHeight()-F),Y===!0?z.css({top:parseInt(i),left:parseInt(t)}):"left"===Y?z.css("left",parseInt(t)):"top"===Y&&z.css("top",parseInt(i))}}var h=this,u=ace.helper.getAttrSettings(t,e.fn.ace_scroll.defaults),f=e.extend({},e.fn.ace_scroll.defaults,i,u);this.size=0,this.lock=!1,this.lock_anyway=!1,this.$element=e(t),this.element=t;var p,v,g,m,b,_,w=!0,y=!1,x=!1,C=!1,k=null,$=null,z=null,j=null,A=null,I=null,T=null,S=0,H=0,D=0,E=0,P=!0,M=!1,L="",O=!1,F=0,q=1,W=!1,R=!1,N="onmouseup"in window?window:"html",Q=f.dragEvent||!1,U=i.scrollEvent||!1,B=f.detached||!1,Y=f.updatePos||!1,G=f.hideOnIdle||!1,V=f.hideDelay||1500,X=!1,J=f.observeContent||!1,K=0,Z=!0;this.ref=function(){return this},this.create=function(t){if(!C){t&&(f=e.extend({},e.fn.ace_scroll.defaults,t)),this.size=parseInt(this.$element.attr("data-size"))||f.size||200,w=!f.horizontal,p=w?"top":"left",v=w?"height":"width",g=w?"maxHeight":"maxWidth",m=w?"clientHeight":"clientWidth",b=w?"scrollTop":"scrollLeft",_=w?"scrollHeight":"scrollWidth",this.$element.addClass("ace-scroll"),"static"==this.$element.css("position")?(W=this.element.style.position,this.element.style.position="relative"):W=!1;var i=null;B?i=e('
').appendTo("body"):(this.$element.wrapInner('
'),this.$element.prepend('
')),k=this.$element,B||(k=this.$element.find(".scroll-content").eq(0)),w||k.wrapInner("
"),$=k.get(0),B?(z=i,d()):z=this.$element.find(".scroll-track").eq(0),j=z.find(".scroll-bar").eq(0),A=z.get(0),I=j.get(0),T=I.style,w||z.addClass("scroll-hz"),f.styleClass&&(L=f.styleClass,z.addClass(L),O=!!L.match(/scroll\-left|scroll\-top/)),0==F&&(z.show(),c()),z.hide(),z.on("mousedown",a),j.on("mousedown",s),k.on("scroll",function(){P&&(H=parseInt(Math.round(this[b]*q)),T[p]=H+"px"),P=!1,U&&this.$element.trigger("scroll",[$])}),f.mouseWheel&&(this.lock=f.mouseWheelLock,this.lock_anyway=f.lockAnyway,this.$element.on(e.event.special.mousewheel?"mousewheel.ace_scroll":"mousewheel.ace_scroll DOMMouseScroll.ace_scroll",function(t){if(!y){if(r(!0),!x)return!h.lock_anyway;R&&(R=!1,e("html").off(".ace_scroll"),e(N).off(".ace_scroll"),Q&&h.$element.trigger("drag.end")),t.deltaY=t.deltaY||0;var i=t.deltaY>0||t.originalEvent.detail<0||t.originalEvent.wheelDelta>0?1:-1,a=!1,s=$[m],n=$[b];h.lock||(a=-1==i?$[_]<=n+s:0==n),h.move_bar(!0);var o=parseInt(s/8);return 80>o&&(o=80),o>h.size&&(o=h.size),o+=1,$[b]=n-i*o,a&&!h.lock_anyway}}));var n=ace.vars.touch&&"ace_drag"in e.event.special&&f.touchDrag;if(n){var o="",u=n?"ace_drag":"swipe";this.$element.on(u+".ace_scroll",function(e){if(y)return void(e.retval.cancel=!0);if(r(!0),!x)return void(e.retval.cancel=this.lock_anyway);if(o=e.direction,w&&("up"==o||"down"==o)||!w&&("left"==o||"right"==o)){var t=w?e.dy:e.dx;0!=t&&(Math.abs(t)>20&&n&&(t=2*t),h.move_bar(!0),$[b]=$[b]+t)}})}G&&z.addClass("idle-hide"),J&&z.on("mouseenter.ace_scroll",function(){X=!0,r(!1)}).on("mouseleave.ace_scroll",function(){X=!1,0==R&&l()}),this.$element.on("mouseenter.ace_scroll touchstart.ace_scroll",function(e){Z=!0,J?r(!0):f.hoverReset&&h.reset(!0),z.addClass("scroll-hover")}).on("mouseleave.ace_scroll touchend.ace_scroll",function(){z.removeClass("scroll-hover")}),w||k.children(0).css(v,this.size),k.css(g,this.size),y=!1,C=!0}},this.is_active=function(){return x},this.is_enabled=function(){return!y},this.move_bar=function(e){P=e},this.get_track=function(){return A},this.reset=function(e){if(!y){C||this.create();var t=this.size;if(!e||Z){if(Z=!1,B){var i=parseInt(Math.round((parseInt(k.css("border-top-width"))+parseInt(k.css("border-bottom-width")))/2.5));t-=i}var a=w?$[_]:t;if(w&&0==a||!w&&0==this.element.scrollWidth)return void z.removeClass("scroll-active");var s=w?t:$.clientWidth;w||k.children(0).css(v,t),k.css(g,this.size),a>s?(x=!0,z.css(v,s).show(),q=parseFloat((s/a).toFixed(5)),S=parseInt(Math.round(s*q)),E=parseInt(Math.round(S/2)),D=s-S,H=parseInt(Math.round($[b]*q)),T[v]=S+"px",T[p]=H+"px",z.addClass("scroll-active"),0==F&&c(),M||(f.reset&&($[b]=0,T[p]=0),M=!0),B&&d()):(x=!1,z.hide(),z.removeClass("scroll-active"),k.css(g,""))}}},this.disable=function(){$[b]=0,T[p]=0,y=!0,x=!1,z.hide(),this.$element.addClass("scroll-disabled"),z.removeClass("scroll-active"),k.css(g,"")},this.enable=function(){y=!1,this.$element.removeClass("scroll-disabled")},this.destroy=function(){x=!1,y=!1,C=!1,this.$element.removeClass("ace-scroll scroll-disabled scroll-active"),this.$element.off(".ace_scroll"),B||(w||k.find("> div").children().unwrap(),k.children().unwrap(),k.remove()),z.remove(),W!==!1&&(this.element.style.position=W),null!=ie&&(clearTimeout(ie),ie=null)},this.modify=function(t){t&&(f=e.extend({},f,t)),this.destroy(),this.create(),Z=!0,this.reset(!0)},this.update=function(t){t&&(f=e.extend({},f,t)),this.size=f.size||this.size,this.lock=f.mouseWheelLock||this.lock,this.lock_anyway=f.lockAnyway||this.lock_anyway,G=f.hideOnIdle||G,V=f.hideDelay||V,J=f.observeContent||!1,Q=f.dragEvent||!1,"undefined"!=typeof t.styleClass&&(L&&z.removeClass(L),L=t.styleClass,L&&z.addClass(L),O=!!L.match(/scroll\-left|scroll\-top/))},this.start=function(){$[b]=0},this.end=function(){$[b]=$[_]},this.hide=function(){z.hide()},this.show=function(){z.show()},this.update_scroll=function(){P=!1,T[p]=H+"px",$[b]=parseInt(Math.round(H/q))};var ee=-1,te=-1,ie=null,ae=0;return this.track_size=function(){return 0==F&&c(),F},this.create(),Z=!0,this.reset(!0),K=$[_],this};e.fn.ace_scroll=function(a,s){var n,o=this.each(function(){var t=e(this),o=t.data("ace_scroll"),r="object"==typeof a&&a;o||t.data("ace_scroll",o=new i(this,r)),"string"==typeof a&&(n=o[a](s))});return n===t?o:n},e.fn.ace_scroll.defaults={size:200,horizontal:!1,mouseWheel:!0,mouseWheelLock:!1,lockAnyway:!1,styleClass:!1,observeContent:!1,hideOnIdle:!1,hideDelay:1500,hoverReset:!0,reset:!1,dragEvent:!1,touchDrag:!0,touchSwipe:!1,scrollEvent:!1,detached:!1,updatePos:!0}}(window.jQuery),function(e,t){var i=function(t,i){var a=ace.helper.getAttrSettings(t,e.fn.ace_colorpicker.defaults),s=e.extend({},e.fn.ace_colorpicker.defaults,i,a),n=e(t),o="",r="",l=null,c=[];n.addClass("hide").find("option").each(function(){var e="colorpick-btn",t=this.value.replace(/[^\w\s,#\(\)\.]/g,"");t.indexOf("number")>=0||(this.value!=t&&(this.value=t),this.selected&&(e+=" selected",r=t),c.push(t),o+='
  • ')}).end().on("change.color",function(){n.next().find(".btn-colorpicker").css("background-color",this.value)}).after('");var d=n.next().find(".dropdown-menu");d.on(ace.click_event,function(t,i){var a=e(t.target);if(!a.is(".colorpick-btn"))return!1;l&&l.removeClass("selected"),l=a,l.addClass("selected");var s=l.data("color");return i!==!0&&n.val(s).trigger("change"),n.next().find(".btn-colorpicker").css("background-color",s),t.preventDefault(),!0}),l=n.next().find("a.selected"),this.pick=function(i,a){if("number"==typeof i){if(i>=c.length)return;t.selectedIndex=i,d.find("a:eq("+i+")").trigger(ace.click_event,[!0])}else if("string"==typeof i){var s=i.replace(/[^\w\s,#\(\)\.]/g,"");if(i=c.indexOf(s),-1==i&&a===!0&&(c.push(s),e("