File: /var/www/html/wp-content/plugins/conditional-menus/assets/admin.min.js
'use strict';jQuery(function(a){function p(b,c,d,e){var f=b.clone().removeClass("cm-location");f.find(".menu-location-title").empty();b=f.find("select").attr("name").match(/menu-locations\[(.*)\]/)[1];if(null==c){if("undefined"==typeof l[b]){c=parseInt;var h=themify_cm.options[b],k=[],g;for(g in h)h.hasOwnProperty(g)&&k.push(g);l[b]=c(a(k).last()[0]);a.isNumeric(l[b])||(l[b]=1)}c=l[b]++}f.find("select").find('option[value="0"]').text(themify_cm.lang.disable_menu).before('<option value=""></option>').end().val(d).attr("name",
"themify_cm["+b+"]["+c+"][menu]");d="themify_cm["+b+"]["+c+"][condition]";e=e||"";f.find(".locations-row-links").empty().html('<input type="hidden" name="'+d+"\" value='"+e+'\' /><a href="#" class="themify-cm-conditions">'+themify_cm.lang.conditions+'</a> <a class="themify-cm-remove" href="#">x</a>');f.insertBefore(jQuery('.menu-locations tr[data-menu="'+b+'"]'));e=a(".menu-location-menus select").length;d=a(".cm-replacement-button").length+1;f.find(".menu-location-menus").attr("data-item",b+c);e===
d&&a(".themify-cm-conditions-container:first").addClass("themify-cm-conditions-container-"+b+c).data("item",b+c);e>d&&a(".themify-cm-conditions-container:first").clone().removeClass().addClass("themify-cm-conditions-container themify-admin-lightbox tf_clearfix themify-cm-conditions-container-"+b+c).data("item",b+c).insertAfter(".themify-cm-conditions-container:last");a(".lightbox_container",".themify-cm-conditions-container-"+b+c).html("")}var l=[],m,n=function(){var b=document;return Math.max(Math.max(b.body.scrollHeight,
b.documentElement.scrollHeight),Math.max(b.body.offsetHeight,b.documentElement.offsetHeight),Math.max(b.body.clientHeight,b.documentElement.clientHeight))};a(".menu-locations .locations-row-links").empty();a("body").on("click",".themify-cm-conditions",function(b){b.preventDefault();var c=a(this);b=c.html();c.html('<span class="tb_slider_loader_wrapper"><span class="tb_slider_loader"></span></span>'+b);m=a(this).prev();var d=a(document).scrollTop()+80,e=a(".themify-cm-conditions-container-"+a(this).parents(".menu-location-menus").data("item"));
e.hasClass("is-loaded")?(a(".tb_slider_loader_wrapper",c).remove(),a("#themify-cm-overlay").show(),e.show().css("top",n()).animate({top:d},800),a("#visibility-tabs",e).tabs(),a("#visibility-tabs .themify-visibility-inner-tabs",e).tabs()):a.ajax({type:"POST",url:ajaxurl,data:{action:"themify_cm_get_conditions",selected:m.val()},success:function(f){a(".tb_slider_loader_wrapper",c).remove();a("#themify-cm-overlay").show();a(".lightbox_container",e).append(f);e.show().css("top",n()).animate({top:d},800);
a("#visibility-tabs",e).tabs();a("#visibility-tabs .themify-visibility-inner-tabs",e).tabs()}});return!1}).on("click","#visibility-tabs .themify-visibility-tab",function(b){b.preventDefault();var c=a(this);b=a("#themify-cm-original-conditions");if(!c.data("active")){var d=c.data("type"),e=c.parents("#visibility-tabs").find(".themify-visibility-type-options[data-type="+d+"]"),f=c.parents(".themify-cm-conditions-container").data("item");f=a(".menu-location-menus[data-item="+f+"] .locations-row-links input").val();
var h=function(){var g=a('.themify-visibility-options[data-type="'+this.dataset.type+'"] .themify-visibility-items-page input');this.checked?g.bind("change",{type:this.dataset.type},k):g.unbind("change",k)},k=function(g){g=a('.themify-visibility-options[data-type="'+g.data.type+'"] input[data-parent="'+this.dataset.slug+'"]');g.length&&g.prop("checked",this.checked).trigger("change")};a.ajax({url:ajaxurl,type:"post",data:{action:"themify_create_inner_page",type:d,selected:f,original_values:b.val()},
beforeSend:function(){e.html('<div class="tb_slider_loader"></div>')},success:function(g){g=JSON.parse(g);e.html(g.html);"page"!==d&&"category"!==d||document.querySelector(".tf_cm_select_sub input[data-type="+d+"]").addEventListener("change",h);c.data("active","on");a("#themify-cm-original-conditions").val(g.original_values)}})}}).on("click",".themify-visibility-pagination a.page-numbers",function(b){b.preventDefault();b=a(this);var c=b.parents(".themify-visibility-options"),d=b.parents(".themify-visibility-items-inner"),
e=a(".themify-visibility-pagination",d),f=parseFloat(a(".themify-visibility-pagination .current",d).text()),h=1;b.hasClass("next")?h=f+1:b.hasClass("prev")?h=f-1:b.hasClass("page-numbers")&&(h=parseFloat(b.text()));var k=a(".themify-visibility-items-inner",c);a.ajax({url:ajaxurl,type:"post",data:{action:"themify_create_page_pagination",current_page:h,num_of_pages:d.data("pages")},beforeSend:function(){a(".tb_slider_loader",c).remove();e.hide();k.append('<div class="tb_slider_loader"></div>')},success:function(g){a(".tb_slider_loader",
c).remove();a(".themify-visibility-items-page-"+h,d).removeClass("is-hidden");e.html(g).show()}})}).on("click",".themify-cm-close, #themify-cm-overlay",function(b){b.preventDefault();var c=a(this).parents(".themify-cm-conditions-container");c.animate({top:n()},800,function(){a("#themify-cm-overlay").hide();c.hide().addClass("is-loaded")});return!1}).on("click",".themify-mc-add-assignment",function(b){p(a("#locations-"+a(this).closest("tr").attr("data-menu")).closest("tr"));return!1}).on("click",".themify-cm-save",
function(){var b=a(this).parents(".themify-cm-conditions-container"),c=b.data("item"),d=a("form",b).serialize(),e=a("#themify-cm-original-conditions",b).val();e=""===e?[]:e.split("&");d=""===d?[]:d.split("&");d=e.concat(d).concat();for(e=0;e<d.length;++e)for(var f=e+1;f<d.length;++f)d[e]===d[f]&&d.splice(f--,1);d=d.join("&");m.val(d);a(".menu-location-menus[data-item="+c+"]").val(d);a(".themify-cm-close",b).click();return!1}).on("click",".themify-cm-remove",function(){a(this).closest("tr").fadeOut(function(){a(this).remove()});
var b=a(this).closest(".menu-location-menus").data("item");1<a(".menu-location-menus[data-item]").length?a(".themify-cm-conditions-container-"+b).remove():a(".themify-cm-conditions-container").removeClass().addClass("themify-cm-conditions-container themify-admin-lightbox tf_clearfix");return!1}).on("click",".themify-cm-conditions-container .uncheck-all",function(){a(this).before('<span class="tb_slider_loader_wrapper"><span class="tb_slider_loader"></span></span>');var b=a(this).parents(".themify-cm-conditions-container"),
c=b.data("item");a(".menu-location-menus[data-item="+c+"] .locations-row-links input[type=hidden]").val("");a("#themify-cm-original-conditions",b).val("");a("input:checkbox",b).removeAttr("checked");a(this).parent().find(".tb_slider_loader_wrapper").remove();a(".themify_all_condition_checked",b).removeClass("themify_all_condition_checked");return!1}).on("click",".themify-cm-conditions-container .themify_apply_all_conditions",function(){var b=a(this),c=b.parents(".themify-visibility-inner-tab").find(".themify-visibility-items-inner");
b.prop("checked")?c.addClass("themify_all_condition_checked"):c.removeClass("themify_all_condition_checked")});a.each(themify_cm.nav_menus,function(b,c){a("#locations-"+c).closest("tr").after('<tr class="cm-replacement-button" data-menu="'+c+'"><td> </td><td><a href="#" class="themify-mc-add-assignment">'+themify_cm.lang.add_assignment+"</a></td></tr>")});a.each(themify_cm.options,function(b,c){"object"==typeof c&&a.each(c,function(d,e){p(a("#locations-"+b).closest("tr"),d,e.menu,e.condition);
l[b]=++d})});a("#themify-cm-about").appendTo("p.button-controls")});