'use strict';(function(l,e,n){let m;const g={},h=e.isTouch?"click":"mouseover",f=function(a){if(!(e.w<m||a.target.closest(".mega-menu-posts"))){var b="mouseenter"===a.type||"focus"===a.type?this.getElementsByClassName("mega-link")[0]:a.target;b.classList.contains("child-arrow")&&(b=b.closest(".has-mega-sub-menu").getElementsByClassName("mega-link")[0]);if(b=b.classList.contains("mega-link")?b:b.closest(".tf_mega_taxes .mega-link")){"click"===a.type&&a.preventDefault();a=l(b);var c=a.data("termid"),
p=a.data("tax"),k=b.getElementsByTagName("a")[0].classList;b=a.closest(".mega-sub-menu");var d=a[0].getElementsByClassName("mega-menu-posts")[0];d||(d=n.createElement("div"),d.className="mega-menu-posts tf_left tf_box",a[0].appendChild(d));b.find(".tf_mega_selected").removeClass("tf_mega_selected");a.addClass("tf_mega_selected");void 0!==g[c]?d.innerHTML=g[c]:k.contains("tf_loader")||(k.add("tf_loader"),l.ajax({url:themify_vars.ajax_url,type:"POST",data:{action:"themify_theme_mega_posts",termid:c,
tax:p},complete:function(){k.remove("tf_loader")},success:function(q){g[c]=q;d.innerHTML=g[c]}}))}}};e.on("tf_mega_menu",function(a,b){a=a.getElementsByClassName("tf_mega_taxes");m=b;for(b=a.length-1;-1<b;--b){a[b].addEventListener(h,f);"mouseover"===h&&a[b].addEventListener("focusin",f);let c=a[b].closest(".has-mega-sub-menu");c&&("mouseover"===h?(c.addEventListener("mouseenter",f,{passive:!0}),c.querySelector("a").addEventListener("focus",f.bind(c),{passive:!0})):c.getElementsByClassName("child-arrow")[0].addEventListener("click",
f))}},!0);e.isTouch||setTimeout(function(){e.edgeMenu()},1500)})(jQuery,Themify,document);
