/home/arranoyd/mice/wp-content/plugins/contact-form-maker/js/theme-edit-scripts.min.js
function fm_admin_ready(){jQuery(".wd-header a").on("click",function(){jQuery("input[name='task']").val("add"),jQuery(this).parents("form").submit()}),set_no_items(),jQuery(".wd-datepicker").each(function(){jQuery(this).datepicker(),jQuery(this).datepicker("option","dateFormat",jQuery(this).data("format"))}),jQuery(".hndle:not(.readonly), .handlediv").each(function(){jQuery(this).off("click").on("click",function(){fm_toggle_postbox(this)})}),jQuery(".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view").each(function(){jQuery(this).attr("title",form_maker.add_placeholder)}),jQuery(document).on("click",".wd-has-placeholder .dashicons.dashicons-list-view, .wd-editor-placeholder .dashicons.dashicons-list-view",function(){fm_placeholders_popup(jQuery(this).data("id"))}),fm_disabled_uninstall_btn(),jQuery(".fm-uninstall-form #check_yes").on("click",function(){fm_disabled_uninstall_btn()}),void 0!==jQuery(document).tooltip&&jQuery(document).tooltip({show:null,items:".wd-info",content:function(){if(jQuery(this).is(".wd-info"))return jQuery("#"+jQuery(this).data("id")).html()},open:function(e,t){if(void 0===e.originalEvent)return!1;var r=jQuery(t.tooltip).attr("id");jQuery("div.ui-tooltip").not("#"+r).remove()},close:function(e,t){t.tooltip.hover(function(){jQuery(this).stop(!0).fadeTo(400,1)},function(){jQuery(this).fadeOut("400",function(){jQuery(this).remove()})})},position:{my:"center top+30",at:"center top",using:function(e,t){jQuery(this).css(e),jQuery("<div>").addClass("tooltip-arrow").addClass(t.vertical).addClass(t.horizontal).appendTo(this)}}})}function wd_insert_placeholder(e,t){var r=document.getElementById(e);if(tinyMCE.get(e)&&tinyMCE.get(e).focus(),"none"!=r.style.display)if(r.focus(),document.selection)sel=document.selection.createRange(),sel.text=t;else if(r.selectionStart||"0"==r.selectionStart){var a=r.selectionStart,n=r.selectionEnd;r.value=r.value.substring(0,a)+"{"+t+"}"+r.value.substring(n,r.value.length)}else r.value+="{"+t+"}";else tinyMCE.execCommand("mceInsertContent",!1,"{"+t+"}")}function fm_toggle_postbox(e){jQuery(e).parent(".postbox").toggleClass("closed")}function fm_option_tabs_mail_validation(){return!0}function fm_clear_input_value(e){jQuery("#"+e).val("")}function set_no_items(){jQuery(".colspanchange").attr("colspan",jQuery(".wd-form table.adminlist>thead>tr>th:visible").length+jQuery(".wd-form table.adminlist>thead>tr>td:visible").length)}function search(e){var t=jQuery(e).parents("form");t.attr("action",window.location+"&paged=1&s="+jQuery("input[name='s']").val()),t.submit()}function input_search(e,t){return 13==(e.keyCode?e.keyCode:e.which)&&search(t),!0}function input_pagination(e,t){if(13==(e.keyCode?e.keyCode:e.which)){var r=jQuery(t).parents("form"),a=jQuery(t).val();if(a<=jQuery(t).parents(".pagination-links").data("pages-count")&&0<a){var n=new RegExp("&nonce_fm="+nonce_fm,"g"),i=r.attr("action").replace(n,"").replace(/&paged=(\d+)/,"")+"&paged="+a;r.attr("action",i),location.href=i}}return!0}function fm_select_value(e){e.focus(),e.select()}function fm_doNothing(e){13==(e.keyCode?e.keyCode:e.which?e.which:e.charCode)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}function wd_bulk_action(e){var t=jQuery("select[name='bulk_action']").val();if(-1!=t){if(!jQuery("input[name^='check']").is(":checked"))return void alert(form_maker.select_at_least_one_item);if("delete"==t&&!confirm(form_maker.delete_confirmation))return!1;jQuery("input[name='task']").val(t),jQuery(e).parents("form").submit()}}function fm_ajax_save(e){var t=jQuery("#"+e).action,r=jQuery("#search_value").val(),a=jQuery("#current_id").val(),n=jQuery("#page_number").val(),i=(jQuery("#search_or_not").val(),jQuery("#ids_string").val()),s=jQuery("#image_order_by").val(),o=jQuery("#asc_or_desc").val(),l=jQuery("#ajax_task").val(),c=jQuery("#image_current_id").val();return ids_array=i.split(","),jQuery.ajax({type:"POST",url:t,data:{search_value:r,current_id:a,page_number:n,image_order_by:s,asc_or_desc:o,ids_string:i,task:"ajax_search",ajax_task:l,image_current_id:c,nonce:fm_ajax.ajaxnonce},success:function(e){var t=jQuery(e).find("#images_table").html();jQuery("#images_table").html(t);t=jQuery(e).find("#tablenav-pages").html();jQuery("#tablenav-pages").html(t),jQuery("#show_hide_weights").val("Hide order column"),fm_show_hide_weights(),fm_run_checkbox()}}),!1}function fm_run_checkbox(){jQuery("tbody").children().children(".check-column").find(":checkbox").click(function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!i)return!0;d=jQuery(i).closest("form").find(":checkbox"),f=d.index(i),j=d.index(this),h=jQuery(this).prop("checked"),0<f&&0<j&&f!=j&&d.slice(f,j).prop("checked",function(){return!!jQuery(this).closest("tr").is(":visible")&&h})}i=this;var t=jQuery(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return jQuery(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0==t.length}),!0}),jQuery("thead, tfoot").find(".check-column :checkbox").click(function(e){var t=jQuery(this).prop("checked"),r="undefined"!=typeof toggleWithKeyboard&&toggleWithKeyboard,a=e.shiftKey||r;jQuery(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!jQuery(this).is(":hidden")&&(a?jQuery(this).prop("checked"):!!t)}),jQuery(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return!a&&!!t})})}function fm_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function fm_form_submit(e,t,r,a){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function fm_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" field is required."),jQuery("#"+e).attr("style","border-color: #FF0000; border-style: solid; border-width: 1px;"),jQuery("#"+e).focus(),jQuery("html, body").animate({scrollTop:jQuery("#"+e).offset().top-200},500),!0)}function fm_show_hide_weights(){var a;"Show order column"==jQuery("#show_hide_weights").val()?(jQuery(".connectedSortable").css("cursor","default"),jQuery("#tbody_arr").find(".handle").hide(0),jQuery("#th_order").show(0),jQuery("#tbody_arr").find(".fm_order").show(0),jQuery("#show_hide_weights").val("Hide order column"),jQuery("#tbody_arr").sortable()&&jQuery("#tbody_arr").sortable("disable")):(jQuery(".connectedSortable").css("cursor","move"),a=jQuery("#page_number")&&""!=jQuery("#page_number").val()&&1!=jQuery("#page_number").val()?20*(jQuery("#page_number").val()-1)+1:1,jQuery("#tbody_arr").sortable({handle:".connectedSortable",connectWith:".connectedSortable",update:function(e,t){jQuery("#draganddrop").attr("style",""),jQuery("#draganddrop").html("<strong><p>Changes made in this table should be saved.</p></strong>");var r=a;jQuery(".fm_order").each(function(e){jQuery(this).find("input").val()&&jQuery(this).find("input").val(r++)})}}),jQuery("#tbody_arr").sortable("enable"),jQuery("#tbody_arr").find(".handle").show(0),jQuery("#tbody_arr").find(".handle").attr("class","handle connectedSortable"),jQuery("#th_order").hide(0),jQuery("#tbody_arr").find(".fm_order").hide(0),jQuery("#show_hide_weights").val("Show order column"))}function fm_popup(e){if(void 0===e)e="";var a,i,s;(a=function(){var e,t,r=jQuery("#TB_window"),a=jQuery(window).height(),n=jQuery(window).width();e=i&&i<n-90?i:n-40,t=s&&s<a-60?s:a-40,r.size()&&(r.width(e).height(t),jQuery("#TB_iframeContent").width(e).height(t-27),r.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),void 0!==document.body.style.maxWidth&&r.css({top:(a-t)/2,"margin-top":"0"}))})(),jQuery(window).resize(function(){a()}),jQuery("a.thickbox-preview"+e).click(function(){tb_click.call(this);var e=jQuery(this).parents(".available-theme").find(".activatelink"),t="",r=jQuery(this).attr("href");return i=(i=r.match(/&width=[0-9]+/))?parseInt(i[0].replace(/[^0-9]+/g,""),10):jQuery(window).width()-120,s=(s=r.match(/&height=[0-9]+/))?parseInt(s[0].replace(/[^0-9]+/g,""),10):jQuery(window).height()-120,t=e.length?' <a href="'+(e.attr("href")||"")+'" target="_top" class="tb-theme-preview-link">'+(e.attr("title")||"")+"</a>":' <span class="tb-theme-preview-link">'+(jQuery(this).attr("title")||"")+"</span>",jQuery("#TB_title").css({"background-color":"#222",color:"#dfdfdf"}),jQuery("#TB_closeAjaxWindow").css({float:"right"}),jQuery("#TB_ajaxWindowTitle").css({float:"left"}).html(t),jQuery("#TB_iframeContent").width("100%"),a(),!1}),jQuery(".theme-detail").click(function(){return jQuery(this).siblings(".themedetaildiv").toggle(),!1})}function bwg_inputs(){jQuery(".fm_int_input").keypress(function(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||57<t)&&46!=t&&45!=t)})}function fm_check_isnum(e){var t=e.which||e.paramlist_keyCode;return!(31<t&&(t<48||58<t)&&46!=t&&45!=t&&(t<65||70<t)&&(t<97||102<t))}function fm_change_payment_method(e){switch(e){case"paypal":jQuery(".fm_payment_option").show(),jQuery(".fm_paypal_option").show(),jQuery(".fm_payment_option_stripe").hide();break;case"stripe":jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").show();break;default:jQuery(".fm_payment_option").hide(),jQuery(".fm_paypal_option").hide(),jQuery(".fm_payment_option_stripe").hide()}}function stopRKey(e){var t=(e=e||(event||null)).target?e.target:e.srcElement?e.srcElement:null;if(13==e.keyCode&&("text"==t.type||"search"==t.type))return!1}function fmRemoveHeaderImage(e,t){jQuery("#header_image_url").val(""),jQuery("#header_image").css("background-image",""),jQuery("#header_image").addClass("fm-hide")}function fmOpenMediaUploader(e,t){void 0===t&&(t=!1),e.preventDefault();var r=wp.media({title:"Upload",button:{text:"Add Image"},multiple:!1}).on("select",function(){var e=r.state().get("selection").first().toJSON();jQuery("#header_image_url").val(e.url),jQuery("#header_image").css("background-image",'url("'+e.url+'")'),jQuery("#header_image").css("background-position","center"),jQuery("#header_image").removeClass("fm-hide")}).open();return!1}function fm_toggle_posts(e){jQuery(e).prop("checked")?jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}function fm_toggle_pages(e){jQuery(e).prop("checked")?jQuery(".fm-pages-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-pages-show").removeClass("fm-show").addClass("fm-hide")}function fm_apply_options(e){fm_set_input_value("task",e),document.getElementById("manage_form").submit()}function pp_live_search(e,t,r){var a=e,n=a.val(),i=a.data("post_type");setTimeout(function(){n===a.val()&&jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"manage_fmc",task:"fm_live_search",nonce:fm_ajax.ajaxnonce,pp_live_search:n,pp_post_type:i,pp_full_content:r},beforeSend:function(e){a.css("width","95%"),a.parent().find(".fm-loading").css("display","inline-block")},success:function(e){a.css("width","100%"),a.parent().find(".fm-loading").css("display","none"),a.closest(".fm-pp").find(".pp_search_results").replaceWith(e)},error:function(e){console.log(e)}})},t)}function fm_toggle(e){jQuery(e).parent().next().toggleClass("hide")}function change_tab(e){jQuery(".fm-subscriber-header .fm-button").removeClass("active-button"),jQuery(".fm-subscriber-header ."+e).addClass("active-button"),jQuery(".fm-subscriber-content").hide(),jQuery("."+e+"-tab").show()}function change_form_type(e){jQuery("#fieldset_id").val(e),jQuery(".fm-form-types span").removeClass("active"),jQuery(".fm-form-types").find(".fm-"+e).addClass("active"),jQuery("#type_settings_fieldset .wd-group").removeClass("fm-show").addClass("fm-hide")}function change_hide_show(e){jQuery("."+e+".fm-hide").removeClass("fm-hide").addClass("fm-temporary"),jQuery("."+e+".fm-show").removeClass("fm-show").addClass("fm-hide"),jQuery("."+e+".fm-show-table").removeClass("fm-show-table").addClass("fm-hide"),jQuery("."+e+".fm-temporary").removeClass("fm-temporary").addClass("fm-show"),"fm-embedded"!=e&&(fm_toggle_posts(jQuery(".pp_display_on #pt3")),fm_toggle_pages(jQuery(".pp_display_on #pt4")))}function fm_change_radio_checkbox_text(e){var t=[];t.stripemode=["Test","Live"],t.checkout_mode=["Testmode","Production"],t.mail_mode=["Text","HTML"],t.mail_mode_user=["Text","HTML"],t.value=["1","0"],t.popover_show_on=["Page Exit","Page Load"],t.topbar_position=["Bottom","Top"],t.scrollbox_position=["Left","Right"],jQuery(e).val(t.value[jQuery(e).val()]),jQuery(e).next().val(jQuery(e).val());var r=t[jQuery(e).attr("name")];jQuery(e).find("label").html(r[jQuery(e).val()]),jQuery(e).hasClass("fm-text-yes")?(jQuery(e).removeClass("fm-text-yes").addClass("fm-text-no"),jQuery(e).find("span").animate({right:parseInt(jQuery(e).css("width"))-14+"px"},400,function(){})):(jQuery(e).removeClass("fm-text-no").addClass("fm-text-yes"),jQuery(e).find("span").animate({right:0},400,function(){}))}function fm_show_hide(e){jQuery("."+e).hasClass("fm-hide")?jQuery("."+e).removeClass("fm-hide").addClass("fm-show"):jQuery("."+e).removeClass("fm-show").addClass("fm-hide")}function fm_delete_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var r=jQuery("#blocked_ips").attr("action");jQuery.ajax({type:"POST",url:r,data:{current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"delete_blocked_ip"},success:function(e){var t=parseInt(jQuery(e).find("#total_for_paging").html());isNaN(t)||(r=r.replace(/(paged=)[^\&]+/,"$1"+t)),jQuery("#blocked_ips").parent(".wrap").load(r+" #blocked_ips",function(){window.history.pushState(null,null,r),0!=jQuery(".updated").length?jQuery(" .updated p strong").html("Items Successfully Deleted"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Deleted.</strong></p></div>").insertBefore("#blocked_ips"),set_no_items()})}})}function fm_save_ip(t){var r=jQuery("#ip"+t).val();url=jQuery("#blocked_ips").attr("action"),jQuery.ajax({type:"POST",url:url,data:{ip:r,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip"},success:function(e){jQuery("#td_ip_"+t).html('<a id="ip'+t+'" class="pointer" title="Edit" onclick="fm_edit_ip('+t+')">'+r+"</a>"),jQuery(".insert, .error").hide(),jQuery("#fm_blocked_ips_message").html("<div class='updated'><strong><p>Items Successfully Inserted.</p></strong></div>"),jQuery("#fm_blocked_ips_message").show()}})}function fm_insert_blocked_ip(){jQuery("#tr .loading").css("display","initial");var e=jQuery("#fm_ip").val(),t=window.location.href;jQuery.ajax({type:"POST",url:t,data:{ip:e,nonce_fm:jQuery("#nonce_fm").val(),task:"insert_blocked_ip",last_id:1},success:function(e){jQuery("#blocked_ips").parent(".wrap").load(t+" #blocked_ips",function(){window.history.pushState(null,null,t),0!=jQuery(".updated").length?jQuery(".updated p strong").html("Items Successfully Saved"):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Saved.</strong></p></div>").insertBefore("#blocked_ips")})}})}function fm_edit_ip(e){var t='<input id="ip'+e+'" class="input_th'+e+' ip_input" type="text" onkeypress="if(event.keyCode == 13){ if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); } return fm_check_isnum(event); " value="'+jQuery("#ip"+e).html()+'" name="ip'+e+'"/>';t+='<input type="button" class="button ip_save" style="margin-left: 5px" onclick="if (fm_check_required(\'ip'+e+"', 'IP')) {return false;} fm_update_blocked_ip("+e+'); return false;" value="Save"><div class="loading">',t+="<img src="+plugin_url+"/images/loading.gif></div>",jQuery("#td_ip_"+e).html(t)}function fm_enter_ip(e){if(13==e.which){if(fm_check_required("fm_ip","IP"))return!1;e.preventDefault(),fm_insert_blocked_ip()}}function fm_update_blocked_ip(e){jQuery("#td_ip_"+e+" .loading").css("display","initial");var t=jQuery("#ip"+e).val(),r=window.location.href;jQuery.ajax({type:"POST",url:r,data:{ip:t,current_id:e,nonce_fm:jQuery("#nonce_fm").val(),task:"update_blocked_ip"},success:function(e){jQuery("#fm-form-admin").load(r+" #blocked_ips",function(){0!=jQuery(".updated").length?(window.history.pushState(null,null,r),jQuery(".updated p strong").html("Items Successfully Updated")):jQuery("<div class='updated below-h2'><p><strong>Items Successfully Updated.</strong></p></div>").insertBefore("#blocked_ips")})}})}function onEnableChange(e,t,r){var a=jQuery("#"+e+" #"+t);"1"==r?a.removeClass("hidden"):a.addClass("hidden")}function show_stats(){var e=jQuery(".fm-statistics .fm_error_sorted_label_key");""!=jQuery("#sorted_label_key").val()?(e.hide(),jQuery(".fm-div_stats-loading").addClass("is-active"),jQuery.ajax({dataType:"json",type:"POST",url:show_stats_url,data:{sorted_label_key:jQuery("#sorted_label_key").val(),startdate:jQuery("#startstats").val(),enddate:jQuery("#endstats").val(),nonce:fm_ajax.ajaxnonce},beforeSend:function(e){},error:function(e){},success:function(e){jQuery(".fm-div_stats-loading").removeClass("is-active"),e.html&&jQuery("#div_stats").html(e.html)}})):e.show()}function fm_loading_show(){jQuery("#fm_loading").show()}function fm_loading_hide(){jQuery("#fm_loading").hide(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items()}function getFormLocalStorage(){var e={};formId=getAllUrlParams().current_id;var t=localStorage.getItem("fm_form"+formId);return null!=t&&(e=jQuery.parseJSON(t)),e}function getAllUrlParams(e){var t=e?e.split("?")[1]:window.location.search.slice(1),r={};if(t)for(var a=(t=t.split("#")[0]).split("&"),n=0;n<a.length;n++){var i=a[n].split("="),s=void 0,o=i[0].replace(/\[\d*\]/,function(e){return s=e.slice(1,-1),""}),l=void 0===i[1]||i[1];o=o.toLowerCase(),l=l.toLowerCase(),r[o]?("string"==typeof r[o]&&(r[o]=[r[o]]),void 0===s?r[o].push(l):r[o][s]=l):r[o]=l}return r}function fm_disabled_uninstall_btn(){jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!0),jQuery(".fm-uninstall-form #check_yes").is(":checked")&&jQuery(".fm-uninstall-form .fm-uninstall-btn").prop("disabled",!1)}function fm_theme_submit_button(e,t){var r="";return r=1==t?jQuery("textarea[name=CUPCSS]").serializeObject():jQuery("#"+e).serializeObject(),jQuery("#params").val(JSON.stringify(r).replace(plugin_url,"[SITE_ROOT]")),!0}jQuery(document).on("ready fm_tab_loaded, ready fm_tab_email_loaded",function(){fm_admin_ready()}),jQuery(window).on("load",function(){jQuery("#fm_loading").hide(),jQuery("#fm_admin_container").show(),"function"==typeof add_scroll_width&&add_scroll_width(),set_no_items(),jQuery("#fm_ask_question").parent().attr("target","_blank")}),document.onkeypress=stopRKey,jQuery(document).ready(function(){jQuery(".pp_display_on #pt0").click(function(){var e=jQuery(this).prop("checked");jQuery('.pp_display_on input[type="checkbox"]').prop("checked",e),e?jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-hide").addClass("fm-show"):jQuery(".fm-posts-show, .fm-pages-show, .fm-cat-show").removeClass("fm-show").addClass("fm-hide")}),jQuery('.pp_display_on input[type="checkbox"]:not("#pt0")').click(function(){var e=jQuery(this).prop("checked");jQuery(".pp_display_on #pt0").prop("checked")&&!e&&jQuery(".pp_display_on #pt0").prop("checked",!1)}),jQuery(".pp_display_on #pt4").click(function(){fm_toggle_pages(this)}),jQuery(".pp_display_on #pt3").click(function(){fm_toggle_posts(this)}),jQuery("body").on("focusin",".pp_search_posts",function(){var e=jQuery(this);e.closest("ul").find(".pp_live_search").removeClass("fm-hide"),e.hasClass("already_triggered")||(e.addClass("already_triggered"),pp_live_search(e,500,!0))}),jQuery(document).click(function(){jQuery(".pp_live_search").addClass("fm-hide")}),jQuery("body").on("click",".fm-pp",function(){return!1}),jQuery("body").on("input",".pp_search_posts",function(){pp_live_search(jQuery(this),500,!0)}),jQuery("body").on("click",".pp_search_results li",function(){var e=jQuery(this);if(!e.hasClass("pp_no_res")){var t=e.text(),r=e.data("post_id"),a=e.closest(".fm-pp"),n=a.find(".pp_selected"),i=a.find(".pp_exclude"),s='<span data-post_id="'+r+'">'+t+'<span class="pp_selected_remove">x</span></span>';-1===n.html().indexOf('data-post_id="'+r+'"')&&(n.append(s),""===i.val()?i.val(r):i.val(function(e,t){return t+","+r}))}return!1}),jQuery("body").on("click",".pp_selected span.pp_selected_remove",function(){var e=jQuery(this).parent(),t=e.closest(".fm-pp").find(".pp_exclude"),r=t.val(),a=e.data("post_id");if(-1!==r.indexOf(a)){var n,i=-1!==r.indexOf(","+a)?","+a:a+",";i=-1!==r.indexOf(",")?i:a;n=r.replace(i,""),t.val(n)}return e.remove(),!1}),jQuery("body").on("click",'.pp_display_on_categories input[name="display_on_categories[]"]',function(){var e=jQuery('.pp_display_on_categories input[name="display_on_categories[]"]'),t=jQuery(".fm-display-all-categories");if("select_all_categories"==jQuery(this).val())jQuery(this).is(":checked")?e.prop("checked",!0):e.prop("checked",!1);else{var r=jQuery('input[name="display_on_categories[]"]:checked').length,a=parseInt(t.attr("data-categories-count"));jQuery(this).prop("checked")||(r-=1),t.prop("checked",!1),r==a&&t.prop("checked",!0)}})}),function(o){o.fn.serializeObject=function(){var n=this,i={},t={},s={validate:/^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,key:/[a-zA-Z0-9_]+|(?=\[\])/g,push:/^$/,fixed:/^\d+$/,named:/^[a-zA-Z0-9_]+$/};return this.build=function(e,t,r){return e[t]=r,e},this.push_counter=function(e){return void 0===t[e]&&(t[e]=0),t[e]++},o.each(o(this).serializeArray(),function(){if(s.validate.test(this.name)){for(var e,t=this.name.match(s.key),r=this.value,a=this.name;void 0!==(e=t.pop());)a=a.replace(new RegExp("\\["+e+"\\]$"),""),e.match(s.push)?r=n.build([],n.push_counter(a),r):e.match(s.fixed)?r=n.build([],e,r):e.match(s.named)&&(r=n.build({},e,r));i=o.extend(!0,i,r)}}),i}}(jQuery),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery")):e(jQuery)}(function(Fe,Ee){"use strict";var Be={beforeShow:e,move:e,change:e,show:e,hide:e,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},qe=[],De=!!/msie/i.exec(window.navigator.userAgent),Ne=function(){function e(e,t){return!!~(""+e).indexOf(t)}var t=document.createElement("div").style;return t.cssText="background-color:rgba(0,0,0,.5)",e(t.backgroundColor,"rgba")||e(t.backgroundColor,"hsla")}(),ze=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),Le=function(){var e="";if(De)for(var t=1;t<=6;t++)e+="<div class='sp-"+t+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",e,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();function Ke(e,t,r,a){for(var n=[],i=0;i<e.length;i++){var s=e[i];if(s){var o=tinycolor(s),l=o.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";l+=tinycolor.equals(t,s)?" sp-thumb-active":"";var c=o.toString(a.preferredFormat||"rgb"),u=Ne?"background-color:"+o.toRgbString():"filter:"+o.toFilter();n.push('<span title="'+c+'" data-color="'+o.toRgbString()+'" class="'+l+'"><span class="sp-thumb-inner" style="'+u+';" /></span>')}else{n.push(Fe("<div />").append(Fe('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",a.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+n.join("")+"</div>"}function t(e,t){var r,a,n,i,s,o,l,u=(s=t,o=e,(l=Fe.extend({},Be,s)).callbacks={move:$e(l.move,o),change:$e(l.change,o),show:$e(l.show,o),hide:$e(l.hide,o),beforeShow:$e(l.beforeShow,o)},l),d=u.flat,c=u.showSelectionPalette,f=u.localStorageKey,h=u.theme,p=u.callbacks,m=(r=Ie,a=10,function(){var e=this,t=arguments;n&&clearTimeout(i),!n&&i||(i=setTimeout(function(){i=null,r.apply(e,t)},a))}),g=!1,y=!1,_=0,v=0,b=0,j=0,w=0,Q=0,k=0,x=0,C=0,S=0,P=1,T=[],A=[],O={},R=u.selectionPalette.slice(0),I=u.maxSelectionSize,M="sp-dragging",H=null,F=e.ownerDocument,E=(F.body,Fe(e)),B=!1,q=Fe(Le,F).addClass(h),D=q.find(".sp-picker-container"),N=q.find(".sp-color"),z=q.find(".sp-dragger"),L=q.find(".sp-hue"),K=q.find(".sp-slider"),W=q.find(".sp-alpha-inner"),$=q.find(".sp-alpha"),U=q.find(".sp-alpha-handle"),V=q.find(".sp-input"),Z=q.find(".sp-palette"),J=q.find(".sp-initial"),X=q.find(".sp-cancel"),Y=q.find(".sp-clear"),G=q.find(".sp-choose"),ee=q.find(".sp-palette-toggle"),te=E.is("input"),re=te&&"color"===E.attr("type")&&Ve(),ae=te&&!d,ne=ae?Fe(ze).addClass(h).addClass(u.className).addClass(u.replacerClassName):Fe([]),ie=ae?ne:E,se=ne.find(".sp-preview-inner"),oe=u.color||te&&E.val(),le=!1,ce=u.preferredFormat,ue=!u.showButtons||u.clickoutFiresChange,de=!oe,fe=u.allowEmpty&&!re;function he(){if(u.showPaletteOnly&&(u.showPalette=!0),ee.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),u.palette){T=u.palette.slice(0),A=Fe.isArray(T[0])?T:[T],O={};for(var e=0;e<A.length;e++)for(var t=0;t<A[e].length;t++){var r=tinycolor(A[e][t]).toRgbString();O[r]=!0}}q.toggleClass("sp-flat",d),q.toggleClass("sp-input-disabled",!u.showInput),q.toggleClass("sp-alpha-enabled",u.showAlpha),q.toggleClass("sp-clear-enabled",fe),q.toggleClass("sp-buttons-disabled",!u.showButtons),q.toggleClass("sp-palette-buttons-disabled",!u.togglePaletteOnly),q.toggleClass("sp-palette-disabled",!u.showPalette),q.toggleClass("sp-palette-only",u.showPaletteOnly),q.toggleClass("sp-initial-disabled",!u.showInitial),q.addClass(u.className).addClass(u.containerClassName),Ie()}function pe(){if(f&&window.localStorage){try{var e=window.localStorage[f].split(",#");1<e.length&&(delete window.localStorage[f],Fe.each(e,function(e,t){me(t)}))}catch(e){}try{R=window.localStorage[f].split(";")}catch(e){}}}function me(e){if(c){var t=tinycolor(e).toRgbString();if(!O[t]&&-1===Fe.inArray(t,R))for(R.push(t);R.length>I;)R.shift();if(f&&window.localStorage)try{window.localStorage[f]=R.join(";")}catch(e){}}}function ge(){var r=Pe(),e=Fe.map(A,function(e,t){return Ke(e,r,"sp-palette-row sp-palette-row-"+t,u)});pe(),R&&e.push(Ke(function(){var e=[];if(u.showPalette)for(var t=0;t<R.length;t++){var r=tinycolor(R[t]).toRgbString();O[r]||e.push(R[t])}return e.reverse().slice(0,u.maxSelectionSize)}(),r,"sp-palette-row sp-palette-row-selection",u)),Z.html(e.join(""))}function ye(){if(u.showInitial){var e=le,t=Pe();J.html(Ke([e,t],t,"sp-palette-row-initial",u))}}function _e(){(v<=0||_<=0||j<=0)&&Ie(),y=!0,q.addClass(M),H=null,E.trigger("dragstart.spectrum",[Pe()])}function ve(){y=!1,q.removeClass(M),E.trigger("dragstop.spectrum",[Pe()])}function be(){var e=V.val();if(null!==e&&""!==e||!fe){var t=tinycolor(e);t.isValid()?(Se(t),Re(!0)):V.addClass("sp-validation-error")}else Se(null),Re(!0)}function je(){g?xe():we()}function we(){var e=Fe.Event("beforeShow.spectrum");g?Ie():(E.trigger(e,[Pe()]),!1===p.beforeShow(Pe())||e.isDefaultPrevented()||(!function(){for(var e=0;e<qe.length;e++)qe[e]&&qe[e].hide()}(),g=!0,Fe(F).bind("keydown.spectrum",Qe),Fe(F).bind("click.spectrum",ke),Fe(window).bind("resize.spectrum",m),ne.addClass("sp-active"),q.removeClass("sp-hidden"),Ie(),Ae(),le=Pe(),ye(),p.show(le),E.trigger("show.spectrum",[le])))}function Qe(e){27===e.keyCode&&xe()}function ke(e){2!=e.button&&(y||(ue?Re(!0):Ce(),xe()))}function xe(){g&&!d&&(g=!1,Fe(F).unbind("keydown.spectrum",Qe),Fe(F).unbind("click.spectrum",ke),Fe(window).unbind("resize.spectrum",m),ne.removeClass("sp-active"),q.addClass("sp-hidden"),p.hide(Pe()),E.trigger("hide.spectrum",[Pe()]))}function Ce(){Se(le,!0)}function Se(e,t){var r,a;tinycolor.equals(e,Pe())?Ae():(!e&&fe?de=!0:(de=!1,a=(r=tinycolor(e)).toHsv(),x=a.h%360/360,C=a.s,S=a.v,P=a.a),Ae(),r&&r.isValid()&&!t&&(ce=u.preferredFormat||r.getFormat()))}function Pe(e){return e=e||{},fe&&de?null:tinycolor.fromRatio({h:x,s:C,v:S,a:Math.round(100*P)/100},{format:e.format||ce})}function Te(){Ae(),p.move(Pe()),E.trigger("move.spectrum",[Pe()])}function Ae(){V.removeClass("sp-validation-error"),Oe();var e=tinycolor.fromRatio({h:x,s:1,v:1});N.css("background-color",e.toHexString());var t=ce;P<1&&(0!==P||"name"!==t)&&("hex"!==t&&"hex3"!==t&&"hex6"!==t&&"name"!==t||(t="rgb"));var r=Pe({format:t}),a="";if(se.removeClass("sp-clear-display"),se.css("background-color","transparent"),!r&&fe)se.addClass("sp-clear-display");else{var n=r.toHexString(),i=r.toRgbString();if(Ne||1===r.alpha?se.css("background-color",i):(se.css("background-color","transparent"),se.css("filter",r.toFilter())),u.showAlpha){var s=r.toRgb();s.a=0;var o=tinycolor(s).toRgbString(),l="linear-gradient(left, "+o+", "+n+")";De?W.css("filter",tinycolor(o).toFilter({gradientType:1},n)):(W.css("background","-webkit-"+l),W.css("background","-moz-"+l),W.css("background","-ms-"+l),W.css("background","linear-gradient(to right, "+o+", "+n+")"))}a=r.toString(t)}u.showInput&&V.val(a),u.showPalette&&ge(),ye()}function Oe(){var e=C,t=S;if(fe&&de)U.hide(),K.hide(),z.hide();else{U.show(),K.show(),z.show();var r=e*_,a=v-t*v;r=Math.max(-b,Math.min(_-b,r-b)),a=Math.max(-b,Math.min(v-b,a-b)),z.css({top:a+"px",left:r+"px"});var n=P*w;U.css({left:n-Q/2+"px"});var i=x*j;K.css({top:i-k+"px"})}}function Re(e){var t=Pe(),r="",a=!tinycolor.equals(t,le);t&&(r=t.toString(ce),me(t)),te&&E.val(r),e&&a&&(p.change(t),E.trigger("change",[t]))}function Ie(){var e,t,r,a,n,i,s,o,l,c;g&&(_=N.width(),v=N.height(),b=z.height(),L.width(),j=L.height(),k=K.height(),w=$.width(),Q=U.width(),d||(q.css("position","absolute"),u.offset?q.offset(u.offset):q.offset((t=ie,r=(e=q).outerWidth(),a=e.outerHeight(),n=t.outerHeight(),i=e[0].ownerDocument,s=i.documentElement,o=s.clientWidth+Fe(i).scrollLeft(),l=s.clientHeight+Fe(i).scrollTop(),(c=t.offset()).top+=n,c.left-=Math.min(c.left,c.left+r>o&&r<o?Math.abs(c.left+r-o):0),c.top-=Math.min(c.top,c.top+a>l&&a<l?Math.abs(a+n-0):0),c))),Oe(),u.showPalette&&ge(),E.trigger("reflow.spectrum"))}function Me(){xe(),B=!0,E.attr("disabled",!0),ie.addClass("sp-disabled")}!function(){if(De&&q.find("*:not(input)").attr("unselectable","on"),he(),ae&&E.after(ne).hide(),fe||Y.hide(),d)E.after(q).hide();else{var e="parent"===u.appendTo?E.parent():Fe(u.appendTo);1!==e.length&&(e=Fe("body")),e.append(q)}function t(e){return e.data&&e.data.ignore?(Se(Fe(e.target).closest(".sp-thumb-el").data("color")),Te()):(Se(Fe(e.target).closest(".sp-thumb-el").data("color")),Te(),Re(!0),u.hideAfterPaletteSelect&&xe()),!1}pe(),ie.bind("click.spectrum touchstart.spectrum",function(e){B||je(),e.stopPropagation(),Fe(e.target).is("input")||e.preventDefault()}),(E.is(":disabled")||!0===u.disabled)&&Me(),q.click(We),V.change(be),V.bind("paste",function(){setTimeout(be,1)}),V.keydown(function(e){13==e.keyCode&&be()}),X.text(u.cancelText),X.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),Ce(),xe()}),Y.attr("title",u.clearText),Y.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),de=!0,Te(),d&&Re(!0)}),G.text(u.chooseText),G.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),De&&V.is(":focus")&&V.trigger("change"),V.hasClass("sp-validation-error")||(Re(!0),xe())}),ee.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),ee.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),u.showPaletteOnly=!u.showPaletteOnly,u.showPaletteOnly||d||q.css("left","-="+(D.outerWidth(!0)+5)),he()}),Ue($,function(e,t,r){P=e/w,de=!1,r.shiftKey&&(P=Math.round(10*P)/10),Te()},_e,ve),Ue(L,function(e,t){x=parseFloat(t/j),de=!1,u.showAlpha||(P=1),Te()},_e,ve),Ue(N,function(e,t,r){if(r.shiftKey){if(!H){var a=C*_,n=v-S*v,i=Math.abs(e-a)>Math.abs(t-n);H=i?"x":"y"}}else H=null;var s=!H||"y"===H;(!H||"x"===H)&&(C=parseFloat(e/_)),s&&(S=parseFloat((v-t)/v)),de=!1,u.showAlpha||(P=1),Te()},_e,ve),oe?(Se(oe),Ae(),ce=u.preferredFormat||tinycolor(oe).format,me(oe)):Ae(),d&&we();var r=De?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Z.delegate(".sp-thumb-el",r,t),J.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},t)}();var He={show:we,hide:xe,toggle:je,reflow:Ie,option:function(e,t){return e===Ee?Fe.extend({},u):t===Ee?u[e]:(u[e]=t,"preferredFormat"===e&&(ce=u.preferredFormat),void he())},enable:function(){B=!1,E.attr("disabled",!1),ie.removeClass("sp-disabled")},disable:Me,offset:function(e){u.offset=e,Ie()},set:function(e){Se(e),Re()},get:Pe,destroy:function(){E.show(),ie.unbind("click.spectrum touchstart.spectrum"),q.remove(),ne.remove(),qe[He.id]=null},container:q};return He.id=qe.push(He)-1,He}function e(){}function We(e){e.stopPropagation()}function $e(e,t){var r=Array.prototype.slice,a=r.call(arguments,2);return function(){return e.apply(t,a.concat(r.call(arguments)))}}function Ue(s,o,t,e){o=o||function(){},t=t||function(){},e=e||function(){};var l=document,c=!1,u={},d=0,f=0,h="ontouchstart"in window,r={};function p(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function a(e){if(c){if(De&&l.documentMode<9&&!e.button)return m();var t=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0],r=t&&t.pageX||e.pageX,a=t&&t.pageY||e.pageY,n=Math.max(0,Math.min(r-u.left,f)),i=Math.max(0,Math.min(a-u.top,d));h&&p(e),o.apply(s,[n,i,e])}}function m(){c&&(Fe(l).unbind(r),Fe(l.body).removeClass("sp-dragging"),setTimeout(function(){e.apply(s,arguments)},0)),c=!1}r.selectstart=p,r.dragstart=p,r["touchmove mousemove"]=a,r["touchend mouseup"]=m,Fe(s).bind("touchstart mousedown",function(e){(e.which?3==e.which:2==e.button)||c||!1!==t.apply(s,arguments)&&(c=!0,d=Fe(s).height(),f=Fe(s).width(),u=Fe(s).offset(),Fe(l).bind(r),Fe(l.body).addClass("sp-dragging"),a(e),p(e))})}function Ve(){return Fe.fn.spectrum.inputTypeColorSupport()}var i="spectrum.id";Fe.fn.spectrum=function(r,e){if("string"!=typeof r)return this.spectrum("destroy").each(function(){var e=t(this,Fe.extend({},r,Fe(this).data()));Fe(this).data(i,e.id)});var a=this,n=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=qe[Fe(this).data(i)];if(e){var t=e[r];if(!t)throw new Error("Spectrum: no such method: '"+r+"'");"get"==r?a=e.get():"container"==r?a=e.container:"option"==r?a=e.option.apply(e,n):"destroy"==r?(e.destroy(),Fe(this).removeData(i)):t.apply(e,n)}}),a},Fe.fn.spectrum.load=!0,Fe.fn.spectrum.loadOpts={},Fe.fn.spectrum.draggable=Ue,Fe.fn.spectrum.defaults=Be,Fe.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var t=Fe("<input type='color'/>")[0];e._cachedResult="color"===t.type&&""!==t.value}return e._cachedResult},Fe.spectrum={},Fe.spectrum.localization={},Fe.spectrum.palettes={},Fe.fn.spectrum.processNativeColorInputs=function(){var e=Fe("input[type=color]");e.length&&!Ve()&&e.spectrum({preferredFormat:"hex6"})},function(){var l=/^[\s,#]+/,c=/\s+$/,a=0,u=Math,i=u.round,d=u.min,f=u.max,e=u.random,h=function(e,t){if(t=t||{},(e=e||"")instanceof h)return e;if(!(this instanceof h))return new h(e,t);var r=function(e){var t={r:0,g:0,b:0},r=1,a=!1,n=!1;"string"==typeof e&&(e=function(e){e=e.replace(l,"").replace(c,"").toLowerCase();var t,r=!1;if(C[e])e=C[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=E.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=E.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=E.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=E.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=E.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=E.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=E.hex8.exec(e))return{a:(a=t[1],O(a)/255),r:O(t[2]),g:O(t[3]),b:O(t[4]),format:r?"name":"hex8"};var a;if(t=E.hex6.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:r?"name":"hex"};if(t=E.hex3.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:r?"name":"hex"};return!1}(e));"object"==typeof e&&(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")?(i=e.r,s=e.g,o=e.b,t={r:255*T(i,255),g:255*T(s,255),b:255*T(o,255)},a=!0,n="%"===String(e.r).substr(-1)?"prgb":"rgb"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")?(e.s=I(e.s),e.v=I(e.v),t=function(e,t,r){e=6*T(e,360),t=T(t,100),r=T(r,100);var a=u.floor(e),n=e-a,i=r*(1-t),s=r*(1-n*t),o=r*(1-(1-n)*t),l=a%6;return{r:255*[r,s,i,i,o,r][l],g:255*[o,r,r,s,i,i][l],b:255*[i,i,o,r,r,s][l]}}(e.h,e.s,e.v),a=!0,n="hsv"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")&&(e.s=I(e.s),e.l=I(e.l),t=function(e,t,r){var a,n,i;function s(e,t,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=T(e,360),t=T(t,100),r=T(r,100),0===t)a=n=i=r;else{var o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;a=s(l,o,e+1/3),n=s(l,o,e),i=s(l,o,e-1/3)}return{r:255*a,g:255*n,b:255*i}}(e.h,e.s,e.l),a=!0,n="hsl"),e.hasOwnProperty("a")&&(r=e.a));var i,s,o;return r=P(r),{ok:a,format:e.format||n,r:d(255,f(t.r,0)),g:d(255,f(t.g,0)),b:d(255,f(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=i(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=r.ok,this._tc_id=a++};function n(e,t,r){e=T(e,255),t=T(t,255),r=T(r,255);var a,n,i=f(e,t,r),s=d(e,t,r),o=(i+s)/2;if(i==s)a=n=0;else{var l=i-s;switch(n=.5<o?l/(2-i-s):l/(i+s),i){case e:a=(t-r)/l+(t<r?6:0);break;case t:a=(r-e)/l+2;break;case r:a=(e-t)/l+4}a/=6}return{h:a,s:n,l:o}}function s(e,t,r){e=T(e,255),t=T(t,255),r=T(r,255);var a,n,i=f(e,t,r),s=d(e,t,r),o=i,l=i-s;if(n=0===i?0:l/i,i==s)a=0;else{switch(i){case e:a=(t-r)/l+(t<r?6:0);break;case t:a=(r-e)/l+2;break;case r:a=(e-t)/l+4}a/=6}return{h:a,s:n,v:o}}function t(e,t,r,a){var n=[R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16))];return a&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function o(e,t,r,a){var n;return[R((n=a,Math.round(255*parseFloat(n)).toString(16))),R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16))].join("")}function r(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.s-=t/100,r.s=A(r.s),h(r)}function p(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.s+=t/100,r.s=A(r.s),h(r)}function m(e){return h(e).desaturate(100)}function g(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.l+=t/100,r.l=A(r.l),h(r)}function y(e,t){t=0===t?0:t||10;var r=h(e).toRgb();return r.r=f(0,d(255,r.r-i(-t/100*255))),r.g=f(0,d(255,r.g-i(-t/100*255))),r.b=f(0,d(255,r.b-i(-t/100*255))),h(r)}function _(e,t){t=0===t?0:t||10;var r=h(e).toHsl();return r.l-=t/100,r.l=A(r.l),h(r)}function v(e,t){var r=h(e).toHsl(),a=(i(r.h)+t)%360;return r.h=a<0?360+a:a,h(r)}function b(e){var t=h(e).toHsl();return t.h=(t.h+180)%360,h(t)}function j(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+120)%360,s:t.s,l:t.l}),h({h:(r+240)%360,s:t.s,l:t.l})]}function w(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+90)%360,s:t.s,l:t.l}),h({h:(r+180)%360,s:t.s,l:t.l}),h({h:(r+270)%360,s:t.s,l:t.l})]}function Q(e){var t=h(e).toHsl(),r=t.h;return[h(e),h({h:(r+72)%360,s:t.s,l:t.l}),h({h:(r+216)%360,s:t.s,l:t.l})]}function k(e,t,r){t=t||6,r=r||30;var a=h(e).toHsl(),n=360/r,i=[h(e)];for(a.h=(a.h-(n*t>>1)+720)%360;--t;)a.h=(a.h+n)%360,i.push(h(a));return i}function x(e,t){t=t||6;for(var r=h(e).toHsv(),a=r.h,n=r.s,i=r.v,s=[],o=1/t;t--;)s.push(h({h:a,s:n,v:i})),i=(i+o)%1;return s}h.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},setAlpha:function(e){return this._a=P(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=s(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),a=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+a+"%)":"hsva("+t+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var e=n(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=n(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),a=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+a+"%)":"hsla("+t+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(e){return t(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(){return o(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*T(this._r,255))+"%",g:i(100*T(this._g,255))+"%",b:i(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*T(this._r,255))+"%, "+i(100*T(this._g,255))+"%, "+i(100*T(this._b,255))+"%)":"rgba("+i(100*T(this._r,255))+"%, "+i(100*T(this._g,255))+"%, "+i(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[t(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+o(this._r,this._g,this._b,this._a),r=t,a=this._gradientType?"GradientType = 1, ":"";e&&(r=h(e).toHex8String());return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,a=this._a<1&&0<=this._a;return t||!a||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(r,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(Q,arguments)},triad:function(){return this._applyCombination(j,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},h.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var a in e)e.hasOwnProperty(a)&&(r[a]="a"===a?e[a]:I(e[a]));e=r}return h(e,t)},h.equals=function(e,t){return!(!e||!t)&&h(e).toRgbString()==h(t).toRgbString()},h.random=function(){return h.fromRatio({r:e(),g:e(),b:e()})},h.mix=function(e,t,r){r=0===r?0:r||50;var a,n=h(e).toRgb(),i=h(t).toRgb(),s=r/100,o=2*s-1,l=i.a-n.a,c=1-(a=((a=o*l==-1?o:(o+l)/(1+o*l))+1)/2),u={r:i.r*a+n.r*c,g:i.g*a+n.g*c,b:i.b*a+n.b*c,a:i.a*s+n.a*(1-s)};return h(u)},h.readability=function(e,t){var r=h(e),a=h(t),n=r.toRgb(),i=a.toRgb(),s=r.getBrightness(),o=a.getBrightness(),l=Math.max(n.r,i.r)-Math.min(n.r,i.r)+Math.max(n.g,i.g)-Math.min(n.g,i.g)+Math.max(n.b,i.b)-Math.min(n.b,i.b);return{brightness:Math.abs(s-o),color:l}},h.isReadable=function(e,t){var r=h.readability(e,t);return 125<r.brightness&&500<r.color},h.mostReadable=function(e,t){for(var r=null,a=0,n=!1,i=0;i<t.length;i++){var s=h.readability(e,t[i]),o=125<s.brightness&&500<s.color,l=s.brightness/125*3+s.color/500;(o&&!n||o&&n&&a<l||!o&&!n&&a<l)&&(n=o,a=l,r=h(t[i]))}return r};var C=h.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=h.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(C);function P(e){return e=parseFloat(e),(isNaN(e)||e<0||1<e)&&(e=1),e}function T(e,t){var r;"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var a,n="string"==typeof(a=e)&&-1!=a.indexOf("%");return e=d(t,f(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),u.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function A(e){return d(1,f(0,e))}function O(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function I(e){return e<=1&&(e=100*e+"%"),e}var M,H,F,E=(H="[\\s|\\(]+("+(M="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",F="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",{rgb:new RegExp("rgb"+H),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+H),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+H),hsva:new RegExp("hsva"+F),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=h}(),Fe(function(){Fe.fn.spectrum.load&&Fe.fn.spectrum.processNativeColorInputs()})}),jQuery(document).ready(function(){jQuery(".fm-themes-tabs li a").on("click",function(){return jQuery(".fm-themes-tabs-container .fm-themes-container").addClass("fm-hide"),jQuery(".fm-themes-tabs li a").removeClass("fm-theme-active-tab"),jQuery("#"+jQuery(this).attr("id")+"-content").removeClass("fm-hide"),jQuery(this).addClass("fm-theme-active-tab"),jQuery("#active_tab").val(jQuery(this).attr("id")),!1}),jQuery(".color").spectrum({showAlpha:!0,showInput:!0,showSelectionPalette:!0,preferredFormat:"hex",allowEmpty:!0,move:function(e){jQuery(this).val(e),jQuery(this).trigger("change")},change:function(e){jQuery(this).val(e),jQuery(this).trigger("change")}}),jQuery(".fm-preview-form").show()});