/* jce - 2.9.30 | 2022-09-14 | https://www.joomlacontenteditor.net | Copyright (C) 2006 - 2022 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */ !function($){$.support.canvas=!1;$.fn.tips=function(options){function init(element){$(element).hasClass("wf-tooltip-cancel-ondrag")&&cancelOnDrag(element),$(element).on("click",function(e){if(e.preventDefault(),!("click"==options.trigger&&$(this).is(options.disabled)||"A"==this.nodeName||$("a",this).length||$(this).hasClass("wf-tooltip-cancel-ondrag"))){if("click"==options.trigger){if($(".uk-tooltip").is(":visible"))return end();start(e,element)}$(".uk-tooltip").hasClass("uk-tooltip-sticky")?unpin():pin(element)}}),$(element).on("tooltip:close",function(){return end(element)}),"hover"==options.trigger&&$(element).on("mouseover",function(e){if(!$(".uk-tooltip").hasClass("uk-tooltip-sticky")&&!$(this).hasClass("uk-tooltip-nohover"))return start(e,element)}).on("mouseout",function(e){if(!$(".uk-tooltip").hasClass("uk-tooltip-sticky")&&!$(this).hasClass("uk-tooltip-nohover"))return end(element)})}function createTips(){var $tips=$(".uk-tooltip");$tips.get(0)||($tips=$('<div class="uk-tooltip" role="tooltip" aria-hidden="true"><span class="close uk-icon uk-icon-close" title="Close"></span><div class="uk-tooltip-inner"></div><div class="arrow"></div></div>').appendTo(options.parent),$(".uk-icon-close",$tips).on("click",function(){end()}).hide()),$tips.addClass(options.className),$tips.hasClass("popover")&&$tips.find(".arrow").addClass("popover-arrow")}function start(e,element){createTips();var $tips=$(".uk-tooltip");if($(element).hasClass("hasPopover")&&$tips.addClass("popover"),$tips.data("source",element),options.content)var h=options.content;else{var h="",text=$(element).attr("title")||"",title="";if(text=$(element).data("content")||text,/::/.test(text)){var parts=text.split("::");title=$.trim(parts[0]),text=$.trim(parts[1])}title||(title=$(element).text()),title&&(h+="<h4>"+title+"</h4>"),$(element).data("title",$(element).attr("title")).attr("title",""),$(element).attr("aria-describedby","uk-tooltip"),h+='<div class="uk-tooltip-content">'+text+"</div>"}$(".uk-tooltip-inner",$tips).html(h),$(element).hasClass("hasPopover")&&($(".uk-tooltip-inner > h4",$tips).addClass("popover-title popover-header"),$(".uk-tooltip-inner > .uk-tooltip-content",$tips).addClass("popover-content popover-body")),$tips.show().addClass("in").attr("aria-hidden","false"),locate(e,element),$(element).trigger("tooltip:show"),window.setTimeout(function(){$tips.css("visibility","visible")},1)}function end(element){var $tips=$(".uk-tooltip"),element=$tips.data("source")||element;$(element).data("title")&&$(element).attr("title",$(element).data("title")),$(element).removeAttr("aria-describedby"),$tips.css("visibility","hidden").attr("aria-hidden","true").hide(),$(".uk-tooltip").attr("class","uk-tooltip").removeClass("in"),$(".uk-tooltip-inner").empty(),$(element).trigger("tooltip:hide"),unpin()}function cancelOnDrag(element){$(element).on("mousedown",function(){$(this).addClass("nohover"),end(),$(this).data("title",$(this).attr("title")).attr("title","")}).on("mouseup",function(){$(this).removeClass("nohover"),$(this).attr("title",$(this).data("title"))})}function pin(element){$(".uk-tooltip").addClass("uk-tooltip-sticky"),$(".uk-icon-close",".uk-tooltip").show(),$(window).on("click.tooltip-blur",function(e){var el=$(element).get(0),n=e.target;n==el||"LABEL"==el.nodeName&&$(el).attr("for")&&n==$("#"+$(el).attr("for")).get(0)||n==$(".uk-tooltip").get(0)||0===$(n).parents(".uk-tooltip").length&&end()})}function unpin(){$(".uk-tooltip").removeClass("uk-tooltip-sticky"),$(".uk-icon-close",".uk-tooltip").hide(),$(window).off("click.tooltip-blur")}function locate(e,element){createTips();var $tips=$(".uk-tooltip"),o=options.offsets,pos=$(e.target).offset(),parent=$tips.parent().position();pos.left=pos.left-parent.left,pos.top=pos.top-parent.top;var tip={width:$tips.outerWidth(),height:$tips.outerHeight()};pos=$.extend(pos,{width:$(e.target).outerWidth(),height:$(e.target).outerHeight()});var position=options.position,scrollTop=$(document).scrollTop();position=pos.top-tip.height<0||pos.top<scrollTop+tip.height+o.y?position.replace(/(top|center)\s+/,"bottom "):position.replace(/(bottom|center)\s+/,"top "),position=pos.left+tip.width>$(window).width()?position.replace("right","left"):position.replace("left","right");var style={"top center":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left+pos.width/2-tip.width/2,5)},"bottom center":{top:Math.max(pos.top+pos.height+o.y,10),left:Math.max(pos.left+pos.width/2-tip.width/2,5)},"center right":{top:Math.max(pos.top-tip.height/2+pos.height/2,5),left:Math.max(pos.left+pos.width,10)},"center left":{top:Math.max(pos.top-tip.height/2+pos.height/2,5),left:Math.max(pos.left-tip.width,10)},"bottom right":{top:Math.max(pos.top-tip.height+o.y,5),left:Math.max(pos.left+pos.width,10)},"bottom left":{top:Math.max(pos.top-tip.height+pos.height+o.y,5),left:Math.max(pos.left-tip.width,10)},"top right":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left+pos.width,10)},"top left":{top:Math.max(pos.top-tip.height-o.y,10),left:Math.max(pos.left-tip.width,10)}};$.each(position.split(" "),function(i,s){$tips.addClass(s).addClass("uk-tooltip-"+s),$tips.hasClass("popover")&&$tips.addClass(s).addClass("bs-popover-"+s)}),$tips.css(style[position])}return options=$.extend({speed:150,position:"top center",className:"",offsets:{x:16,y:16},width:200,fixed:!0,parent:"body",trigger:"hover",disabled:":disabled, .disabled"},options),this.each(function(){init(this)})}}(jQuery),function($){var ColorPicker=function(element,options){this.options=$.extend(this.options,options),this.element=element,this._init()};ColorPicker.prototype={options:{color:"#FFFFFF",detail:50,speed:200,stylesheets:[],custom_colors:"",forcedHighContrastMode:!1,labels:{picker:"Picker",title:"Color Picker",palette:"Web Colors",named:"Named Colors",template:"Template Colors",custom:"Custom Colors",color:"Color",apply:"Apply",name:"Name"},dialog:!1,parent:"body"},_strhex:"0123456789abcdef",_colors:["#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033","#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099","#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff","#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033","#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399","#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff","#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333","#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399","#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff","#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633","#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699","#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff","#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633","#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999","#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff","#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933","#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999","#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff","#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33","#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99","#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff","#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33","#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99","#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff","#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33","#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99","#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"],_named:{"#F0F8FF":"AliceBlue","#FAEBD7":"AntiqueWhite","#7FFFD4":"Aquamarine","#F0FFFF":"Azure","#F5F5DC":"Beige","#FFE4C4":"Bisque","#000000":"Black","#FFEBCD":"BlanchedAlmond","#0000FF":"Blue","#8A2BE2":"BlueViolet","#A52A2A":"Brown","#DEB887":"BurlyWood","#5F9EA0":"CadetBlue","#7FFF00":"Chartreuse","#D2691E":"Chocolate","#FF7F50":"Coral","#6495ED":"CornflowerBlue","#FFF8DC":"Cornsilk","#DC143C":"Crimson","#00008B":"DarkBlue","#008B8B":"DarkCyan","#B8860B":"DarkGoldenRod","#A9A9A9":"DarkGray","#006400":"DarkGreen","#BDB76B":"DarkKhaki","#8B008B":"DarkMagenta","#556B2F":"DarkOliveGreen","#FF8C00":"Darkorange","#9932CC":"DarkOrchid","#8B0000":"DarkRed","#E9967A":"DarkSalmon","#8FBC8F":"DarkSeaGreen","#483D8B":"DarkSlateBlue","#2F4F4F":"DarkSlateGrey","#00CED1":"DarkTurquoise","#9400D3":"DarkViolet","#FF1493":"DeepPink","#00BFFF":"DeepSkyBlue","#696969":"DimGrey","#1E90FF":"DodgerBlue","#B22222":"FireBrick","#FFFAF0":"FloralWhite","#228B22":"ForestGreen","#DCDCDC":"Gainsboro","#F8F8FF":"GhostWhite","#FFD700":"Gold","#DAA520":"GoldenRod","#808080":"Grey","#008000":"Green","#ADFF2F":"GreenYellow","#F0FFF0":"HoneyDew","#FF69B4":"HotPink","#CD5C5C":"IndianRed","#4B0082":"Indigo","#FFFFF0":"Ivory","#F0E68C":"Khaki","#E6E6FA":"Lavender","#FFF0F5":"LavenderBlush","#7CFC00":"LawnGreen","#FFFACD":"LemonChiffon","#ADD8E6":"LightBlue","#F08080":"LightCoral","#E0FFFF":"LightCyan","#FAFAD2":"LightGoldenRodYellow","#D3D3D3":"LightGrey","#90EE90":"LightGreen","#FFB6C1":"LightPink","#FFA07A":"LightSalmon","#20B2AA":"LightSeaGreen","#87CEFA":"LightSkyBlue","#778899":"LightSlateGrey","#B0C4DE":"LightSteelBlue","#FFFFE0":"LightYellow","#00FF00":"Lime","#32CD32":"LimeGreen","#FAF0E6":"Linen","#FF00FF":"Magenta","#800000":"Maroon","#66CDAA":"MediumAquaMarine","#0000CD":"MediumBlue","#BA55D3":"MediumOrchid","#9370D8":"MediumPurple","#3CB371":"MediumSeaGreen","#7B68EE":"MediumSlateBlue","#00FA9A":"MediumSpringGreen","#48D1CC":"MediumTurquoise","#C71585":"MediumVioletRed","#191970":"MidnightBlue","#F5FFFA":"MintCream","#FFE4E1":"MistyRose","#FFE4B5":"Moccasin","#FFDEAD":"NavajoWhite","#000080":"Navy","#FDF5E6":"OldLace","#808000":"Olive","#6B8E23":"OliveDrab","#FFA500":"Orange","#FF4500":"OrangeRed","#DA70D6":"Orchid","#EEE8AA":"PaleGoldenRod","#98FB98":"PaleGreen","#AFEEEE":"PaleTurquoise","#D87093":"PaleVioletRed","#FFEFD5":"PapayaWhip","#FFDAB9":"PeachPuff","#CD853F":"Peru","#FFC0CB":"Pink","#DDA0DD":"Plum","#B0E0E6":"PowderBlue","#800080":"Purple","#FF0000":"Red","#BC8F8F":"RosyBrown","#4169E1":"RoyalBlue","#8B4513":"SaddleBrown","#FA8072":"Salmon","#F4A460":"SandyBrown","#2E8B57":"SeaGreen","#FFF5EE":"SeaShell","#A0522D":"Sienna","#C0C0C0":"Silver","#87CEEB":"SkyBlue","#6A5ACD":"SlateBlue","#708090":"SlateGrey","#FFFAFA":"Snow","#00FF7F":"SpringGreen","#4682B4":"SteelBlue","#D2B48C":"Tan","#008080":"Teal","#D8BFD8":"Thistle","#FF6347":"Tomato","#40E0D0":"Turquoise","#EE82EE":"Violet","#F5DEB3":"Wheat","#FFFFFF":"White","#F5F5F5":"WhiteSmoke","#FFFF00":"Yellow","#9ACD32":"YellowGreen"},_translate:function(s,d){var o=this.options,v=o.labels[s]||d||"";return"undefined"!=typeof tinyMCEPopup&&(v=tinyMCEPopup.getLang("colorpicker."+s,v)),v},_init:function(){var self=this;this.options;if(this._getStylesheetColors(),this.options.dialog){if($("#tab-content .colorpicker_generated").length)return;var color=$(this.element).val()||"#000000";/\d/.test(color)||(color=this._namedToHex(color)),/rgb/.test(color)&&(color=this._rgbToHex(color)),color&&color.indexOf("#")===-1&&(color="#"+color),$(this.element).val(color),$("#colorpicker_color").on("change",function(){var v=this.value;"#"===v.substr(0,1)&&(v=v.substring(1)),self._wheel&&self._wheel.setColor("#"+v),this.value=v}).trigger("change"),this._createTabs(),$("#colorpicker_insert").on("click",function(e){e.preventDefault(),self._insert()}),self._wheel&&self._wheel.setColor(color)}else this.options.widget?this.widget=$(this.options.widget):(this.widget=$(this.element).parent().find(".colorpicker_widget"),this.widget.length||(this.widget=$('<span class="colorpicker_widget"></span>').insertAfter(this.element))),$(this.widget).css("background-color",$(this.element).val()||"#000000").tips({trigger:"click",position:"center right",content:'<div id="colorpicker" title="Color Picker">'+self._getContent()+"</div>",className:"wf-colorpicker",opacity:1,parent:this.options.parent}).on("tooltip:show",function(){var color=$(self.element).val()||"#000000";/rgb/.test(color)&&(color=this._rgbToHex(color)),"#"!==color.substr(0,1)&&(color="#"+color),$("#tab-content .colorpicker_generated").length||($("#colorpicker_tabs").html(function(i,h){return h.replace(/\{#(\w+)\}/gi,function(a,b){return self._translate(b)})}),$("#colorpicker").append('<div class="modal-footer uk-modal-footer"><div id="colorpicker_preview"><div id="colorpicker_preview_text" class="uk-form-icon uk-form-icon-both"><i class="uk-icon-hashtag"></i><input type="text" id="colorpicker_color" size="8" maxlength="8" value="'+color.substring(1)+'" aria-required="true" /><span class="uk-icon-none" id="colorpicker_preview_color" style="background-color: rgb(0, 0, 0);"></span></div></div><button type="button" class="btn btn-primary uk-button uk-button-primary" id="colorpicker_insert"><i class="uk-icon-check" />'+self._translate("apply","Apply")+"</button></div>"),$("#colorpicker_preview_color").css("background-color",color),$("#colorpicker_color").on("change",function(){var v=this.value;"#"===v.substr(0,1)&&(v=v.substring(1)),self._wheel&&self._wheel.setColor("#"+v),this.value=v}).trigger("change"),$("#colorpicker_insert").on("click",function(e){e.preventDefault(),self._insert()}),self._createTabs(),self._wheel&&self._wheel.setColor(color))})},_getContent:function(){var h="",o=this.options;return h+='<div id="colorpicker_tabs" class="uk-tabs">',h+='<ul class="nav nav-tabs uk-tab">',h+='<li><a href="#colorpicker_picker" aria-controls="colorpicker_picker" class="active">{#picker}</a></li>',h+='<li><a href="#colorpicker_web" aria-controls="colorpicker_web">{#palette}</a></li>',h+='<li><a href="#colorpicker_named" aria-controls="colorpicker_named">{#named}</a></li>',o.stylesheets.length&&(h+='<li><a href="#colorpicker_template" aria-controls="colorpicker_template">{#template}</a></li>'),h+="</ul>",h+='<div class="tab-content uk-switcher uk-tabs-panel">',h+='<div id="colorpicker_picker" data-type="picker" class="tab-pane"></div>',h+='<div id="colorpicker_web" data-type="web" class="tab-pane"></div>',h+='<div id="colorpicker_named" data-type="named" class="tab-pane"></div>',o.stylesheets.length&&(h+='<div id="colorpicker_template" data-type="template" class="tab-pane"></div>'),h+="</div>",h+="</div>"},_createTabs:function(){var self=this;$("#colorpicker_tabs").on("tabs.activate",function(e,tab,panel){var type=$(panel).data("type");self["_create"+type].call(self,$(panel)),$("#colorpicker_insert").css("visibility",function(){return"picker"===type?"visible":"hidden"})}).tabs();var $tab=$(".uk-tab > li:visible","#colorpicker_tabs").first();$tab.length||($tab=$(".uk-tab > li","#colorpicker_tabs").first()),$tab.addClass("active uk-active").trigger("click")},_blur:function(e){var t=this;if(e){if(e.target==this.picker||e.target==this.picker.colorpicker)return!1;var matched=!1;$(this.picker.colorpicker).find("*").each(function(){if(this==e.target)return matched=!0,!1}),matched||t.close()}},_close:function(){$(this.widget).trigger("tooltip:close"),$(this.element).trigger("colorpicker:close")},_insert:function(){var color=$("#colorpicker_color").val();"#"!==color.substr(0,1)&&(color="#"+color),$(this.element).trigger("colorpicker:insert",color),color&&($(this.element).val(color).removeClass("placeholder").trigger("change"),$(this.widget).css("background-color",color)),this._close()},_namedToHex:function(value){var color="";return $.each(this._named,function(name,hex){if(name.toLowerCase()===value.toLowerCase())return color=hex,!0}),color},_rgbToHex:function(c){var r,g,b,re=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");if(!c)return c;var rgb=c.replace(re,"$1,$2,$3").split(",");return 3==rgb.length?(r=parseInt(rgb[0]).toString(16),g=parseInt(rgb[1]).toString(16),b=parseInt(rgb[2]).toString(16),r=1==r.length?"0"+r:r,g=1==g.length?"0"+g:g,b=1==b.length?"0"+b:b,"#"+r+g+b):c},_hexToRGB:function(c){var r,g,b;return c.indexOf("#")!=-1?(c=c.replace(new RegExp("[^0-9A-F]","gi"),""),r=parseInt(c.substring(0,2),16),g=parseInt(c.substring(2,4),16),b=parseInt(c.substring(4,6),16),{r:r,g:g,b:b}):null},_createpicker:function(parent){var self=this;$(parent).hasClass("colorpicker_generated")||(self._wheel=$.farbtastic(parent,$("#colorpicker_color").val(),function(color){self._showColor(color)}),$(parent).addClass("colorwheel colorpicker_generated"))},_createweb:function(parent){var self=this,h="";$(parent).hasClass("colorpicker_generated")||(h+='<div role="listbox" aria-labelledby="colorpicker_web" tabindex="0">',h+="<ul>",$.each(this._colors,function(i,v){h+='<li style="background-color:'+v+'"><span class="colorpicker_webblock" role="option" aria-labelledby="web_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="web_colors_'+i+'">'+v.toUpperCase()+"</span>"}),h+="</ul></div>",$(parent).append(h).append('<br style="clear:both;" />').addClass("colorpicker_generated"),$("span.colorpicker_webblock",parent).on("click",function(){self._insert()}).on("mouseover",function(){self._showColor($(this).attr("title"))}),this._paintCanvas(parent))},_createnamed:function(parent){var self=this,h="",i=0;$(parent).hasClass("colorpicker_generated")||(h+='<div role="listbox" aria-labelledby="colorpicker_named" tabindex="0">',h+="<ul>",$.each(this._named,function(k,v){h+='<li style="background-color:'+k+'"><span class="colorpicker_namedblock" aria-labelledby="named_colors_'+k+'" title="'+self._translate(k.replace(/[^\w]/g,""),v)+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="named_colors_'+k+'">'+v.toUpperCase()+"</span>",i++}),h+="</ul></div>",$(parent).append(h).append('<br style="clear:both;" />').addClass("colorpicker_generated").append('<div id="colorpicker_colorname">'+this.options.labels.name+"</div>"),$("span.colorpicker_namedblock",parent).on("click",function(){self._insert()}).on("mouseover",function(){self._showColor($(this).parent("li").css("background-color"),$(this).attr("title"))}),this._paintCanvas(parent))},_createtemplate:function(parent){var self=this,h="";if(!$(parent).hasClass("colorpicker_generated")){if(this.template_colors){var templateColors=this.template_colors;"string"==$.type(this.template_colors)&&(templateColors=templateColors.split(",")),h+='<div role="listbox" aria-labelledby="colorpicker_template_label" tabindex="0">',h+="<ul>",$.each(templateColors,function(i,v){4==v.length&&(v+=v.substr(1)),h+='<li style="background-color:'+v+'"><span class="colorpicker_templateblock" aria-labelledby="template_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" id="template_colors_'+i+'">'+v.toUpperCase()+"</span>"}),h+="</ul></div>",$(parent).append(h)}if(this.options.custom_colors){var h="";$(parent).append('<p id="colorpicker_custom_label">'+this.options.labels.custom+"</p>");var customColors=this.options.custom_colors.split(",");h+='<div role="listbox" aria-labelledby="colorpicker_custom_label" tabindex="0">',h+="<ul>",$.each(customColors,function(i,v){4==v.length&&(v+=v.replace("#","")),h+='<li style="background-color:'+v+'"><span class="colorpicker_templateblock" aria-labelledby="custom_colors_'+i+'" title="'+v+'"></span></li>',self.options.forcedHighContrastMode&&(h+='<canvas class="mceColorSwatch" data-color="'+v+'"></canvas>'),h+='<span class="mceVoiceLabel" style="display:none;" id="custom_colors_'+i+'">'+v.toUpperCase()+"</span>",(i+1)%18==0&&(h+="</ul><ul>")}),h+="</div>",$(parent).append(h),this._paintCanvas(parent)}$(parent).addClass("colorpicker_generated"),$("span.colorpicker_templateblock",parent).on("click",function(){self._insert()}).on("mouseover",function(){self._showColor($(this).attr("title"))})}},_showColor:function(color,name){name&&$("#colorpicker_colorname").html(this.options.labels.name+": "+name),color=color.toLowerCase(),/rgb/.test(color)&&(color=this._rgbToHex(color)),$("#colorpicker_preview_color").css("background-color",color),$("#colorpicker_color").val(color.replace("#",""))},_changeFinalColor:function(color){/#/.test(color)||(color=this._rgbToHex(color)),color=color.toLowerCase(),$("#colorpicker_preview").css("background-color",color),$("#colorpicker_color").val(color.replace("#",""))},_paintCanvas:function(el){$("canvas.mceColorSwatch",el).each(function(){$canvas=$(this).get(0),$canvas.getContext&&(context=$canvas.getContext("2d"))&&(context.fillStyle=$canvas.getAttribute("data-color"),context.fillRect(0,0,10,10))})},_sort_colors:function(colors){var sorted=[],s=[];return $.each(colors,function(x,color){if(color=color.replace("#","").toLowerCase(),6==color.length){var condensed="";$.each(color.split(""),function(i,c){i%2==0&&(condensed+=c)});var color_str=condensed}var v=0;$.each(color_str.split(""),function(i,c){v+=parseInt(c,16)}),color&&(sorted[v+x]="#"+color)}),$.each(sorted,function(i,c){c&&s.push(c)}),s},_getStylesheetColors:function(){function addColor(s){$.inArray(s,colors)==-1&&colors.push(s)}function parseCSS(s){s.imports&&$.each(s.imports,function(i,r){parseCSS(r)}),$.each(s.cssRules||s.rules,function(i,r){switch(r.type||1){case 1:var css=r.cssText||r.style.cssText;css&&(hex=css.match(hexRe),rgb=css.match(rgbRe),rgb&&addColor(self._rgbToHex(rgb[0])),hex&&addColor(hex[0]));break;case 3:if(r.href.indexOf("://")!=-1)return;parseCSS(r.styleSheet)}})}function processStyleSheets(stylesheets){try{$.each(stylesheets,function(i,s){parseCSS(s)})}catch(ex){}return colors}var hex,rgb,self=this,o=this.options,colors=[],hexRe=/#[0-9a-f]{3,6}/gi,rgbRe=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");if("string"==$.type(o.stylesheets[0])){var doc,el,ifr;if(document.getElementById("stylsheets_iframe"))return;var h='<!DOCTYPE html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge">';$.each(o.stylesheets,function(i,s){h+='<link href="'+s+'" rel="stylesheet" type="text/css" />'}),h+="</head><body></body></html>",ifr=document.createElement("iframe"),$(ifr).attr({src:'javascript:""',id:"stylsheets_iframe"}).hide().appendTo("body").on("load",function(e){el=e.target,doc=el.contentWindow.document,doc&&doc.styleSheets&&(self.template_colors=processStyleSheets(doc.styleSheets)),$(ifr).remove()}),doc=ifr.contentWindow.document,doc&&(doc.open(),doc.write(h),doc.close())}else this.template_colors=processStyleSheets(o.stylesheets)}},$.fn.colorpicker=function(options){return this.each(function(){new ColorPicker(this,options)})}}(jQuery),function($){$.fn.farbtastic=function(callback){return $.farbtastic(this,callback),this},$.farbtastic=function(container,color,callback){var container=$(container).get(0);return container.farbtastic||(container.farbtastic=new $._farbtastic(container,color,callback))},$._farbtastic=function(container,color,callback){var fb=this;$(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');var e=$(".farbtastic",container);fb.wheel=$(".wheel",container).get(0),fb.radius=84,fb.square=100,fb.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",e).each(function(){if("none"!=this.currentStyle.backgroundImage){var image=this.currentStyle.backgroundImage;image=this.currentStyle.backgroundImage.substring(5,image.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"})}}),fb.linkTo=function(callback){return"object"==typeof fb.callback&&$(fb.callback).off("keyup",fb.updateValue),fb.color=null,"function"==typeof callback?fb.callback=callback:"object"!=typeof callback&&"string"!=typeof callback||(fb.callback=$(callback),fb.callback.on("keyup",fb.updateValue),fb.callback.get(0).value&&fb.setColor(fb.callback.get(0).value)),this},fb.updateValue=function(event){this.value&&this.value!=fb.color&&fb.setColor(this.value)},fb.setColor=function(color){var unpack=fb.unpack(color);return fb.color!=color&&unpack&&(fb.color=color,fb.rgb=unpack,fb.hsl=fb.RGBToHSL(fb.rgb),fb.updateDisplay()),this},fb.setHSL=function(hsl){return fb.hsl=hsl,fb.rgb=fb.HSLToRGB(hsl),fb.color=fb.pack(fb.rgb),fb.updateDisplay(),this},fb.widgetCoords=function(event){var x,y,el=event.target||event.srcElement,reference=fb.wheel;if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=fb.absolutePosition(reference);x=(event.pageX||0*(event.clientX+$("html").get(0).scrollLeft))-pos.x,y=(event.pageY||0*(event.clientY+$("html").get(0).scrollTop))-pos.y}return{x:x-fb.width/2,y:y-fb.width/2}},fb.mousedown=function(event){var pos=fb.widgetCoords(event);return fb.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>fb.square,fb.mousemove(event),!1},fb.touchconvert=function(e){var e=e.originalEvent.touches.item(0);return e},fb.touchmove=function(e){return fb.mousemove(fb.touchconvert(e)),event.preventDefault(),!1},fb.touchend=function(event){return $(document).off("touchmove",fb.touchmove),$(document).off("touchend",fb.touchend),document.dragging=!1,event.preventDefault(),!1},fb.mousemove=function(event){var pos=fb.widgetCoords(event);if(fb.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),fb.setHSL([hue,fb.hsl[1],fb.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/fb.square)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/fb.square)+.5));fb.setHSL([fb.hsl[0],sat,lum])}return!1},fb.mouseup=function(){$(document).off("mousemove",fb.mousemove),$(document).off("mouseup",fb.mouseup),document.dragging=!1},fb.updateDisplay=function(){var angle=6.28*fb.hsl[0];$(".h-marker",e).css({left:Math.round(Math.sin(angle)*fb.radius+fb.width/2)+"px",top:Math.round(-Math.cos(angle)*fb.radius+fb.width/2)+"px"}),$(".sl-marker",e).css({left:Math.round(fb.square*(.5-fb.hsl[1])+fb.width/2)+"px",top:Math.round(fb.square*(.5-fb.hsl[2])+fb.width/2)+"px"}),$(".color",e).css("backgroundColor",fb.pack(fb.HSLToRGB([fb.hsl[0],1,.5]))),"object"==typeof fb.callback?($(fb.callback).css({backgroundColor:fb.color,color:fb.hsl[2]>.5?"#000":"#fff"}),$(fb.callback).each(function(){this.value&&this.value!=fb.color&&(this.value=fb.color)})):"function"==typeof fb.callback&&fb.callback.call(fb,fb.color)},fb.absolutePosition=function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=fb.absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},fb.pack=function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},fb.unpack=function(color){return 7==color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4==color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},fb.HSLToRGB=function(hsl){var m1,m2,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this.hueToRGB(m1,m2,h+.33333),this.hueToRGB(m1,m2,h),this.hueToRGB(m1,m2,h-.33333)]},fb.hueToRGB=function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},fb.RGBToHSL=function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},$("*",e).on("mousedown",function(e){document.dragging||($(document).on("mousemove",fb.mousemove).on("mouseup",fb.mouseup),document.dragging=!0),fb.mousedown(e)}),$("*",e).on("touchstart",function(e){return document.dragging||($(document).on("touchmove",fb.touchmove).on("touchend",fb.touchend),document.dragging=!0),fb.mousedown(fb.touchconvert(e)),e.preventDefault(),!1}),fb.setColor("#000000"),callback&&fb.linkTo(callback)}}(jQuery),function($){$(document).ready(function(){$(".controls").on("change",".wf-keyvalue :input",function(e){var $parent=$(this).parents(".wf-keyvalue"),$ctrl=$parent.parent(),items=[];$(".wf-keyvalue",$ctrl).each(function(){var data={};$(":input[name]",this).each(function(){var name=$(this).attr("name"),val=$(this).val();return""==name||void(data[name]=$("<textarea/>").text(val).html())}),items.push(data)}),$ctrl.find('input[name*="jform"][type="hidden"]').val(JSON.stringify(items)).trigger("change")})})}(jQuery),function($){$(document).ready(function(){$(".controls").on("click",".form-field-repeatable-add",function(e){e.preventDefault();var $repeatable=$(this).parents(".form-field-repeatable-item"),$parent=$repeatable.parent(),$item=$repeatable.clone();$parent.append($item),$parent.find(":input[name]").not('input[type="hidden"]').each(function(){var elm=this,$p=$(this).parents(".form-field-repeatable-item"),idx=$p.index(),x=0;$p.find(":input[name]").each(function(i){if(elm===this)return x=i,!0});var id=this.id.replace(/(_\d+)$/,"");$(this).attr("id",id+"_"+idx+"_"+x)}).trigger("change"),$item.find(":input[name]").val("").trigger("change"),$item.find(".field-media-wrapper").each(function(){$(this).fieldMedia()})}),$(".controls").on("click",".form-field-repeatable-remove",function(e){e.preventDefault();var $repeatable=$(this).parents(".form-field-repeatable-item"),$parent=$repeatable.parent();$repeatable.remove(),$parent.find(":input").trigger("change")})})}(jQuery),function($){function init(){$(document).ready(function(){$(".ui-jce").removeClass("loading")})}$.fn.popover=function(){return this},$(document).ready(function(){$(".form-horizontal",".ui-jce").not(".form-help-inline").find(".hasPopover").tips(),init()})}(jQuery);