File: /home/lucendi/www/wp-content/themes/mesmerize/assets/js/drop_menu_selection.min.js
!function(e){function n(n){n.find("[data-selected-item]").each(function(){e(this).removeAttr("data-selected-item");var t=n.children("ul");n.is(".mobile-menu")&&t.slideDown()})}function t(n,t){e("body").off("tap.navigation-clear-selection"),e(window).off("scroll.navigation-clear-selection"),n.is(t)||e.contains(t[0],this)||i(t)}function i(n,t){n.find("li.hover").each(function(){var n;t&&(n=e(this),n.find("[data-selected-item]").length>0||n.is("[data-selected-item]"))||e(this).removeClass("hover")})}function a(e,n){if(n.parentsUntil("ul.dorpdown-menu").filter("li").length>0){var t=n.children("ul"),i=t.length&&n.offset().left+n.width()+300>window.innerWidth,a=t.length&&n.closest(".open-reverse").length;i||a?t.addClass("open-reverse"):t.length&&t.removeClass("open-reverse")}}function o(n){var t=n;e.fn.scrollSpy&&t.find("a").scrollSpy({onChange:function(){t.find(".current-menu-item,.current_page_item").removeClass("current-menu-item current_page_item"),e(this).closest("li").addClass("current-menu-item")},onLeave:function(){e(this).closest("li").removeClass("current-menu-item current_page_item")},smoothScrollAnchor:!0,offset:function(){var n=e(".navigation-bar.fixto-fixed");return n.length?n[0].getBoundingClientRect().height:0}}),e(window).trigger("smoothscroll.update")}e.event.special.tap||(e.event.special.tap={setup:function(n,t){e(this).bind("touchstart",e.event.special.tap.handler).bind("touchmove",e.event.special.tap.handler).bind("touchend",e.event.special.tap.handler)},teardown:function(n){e(this).unbind("touchstart",e.event.special.tap.handler).unbind("touchmove",e.event.special.tap.handler).unbind("touchend",e.event.special.tap.handler)},handler:function(n){var t,i=e(this),a=n.handleObj;return i.data(n.type,1),"touchend"!==n.type||i.data("touchmove")?i.data("touchend")&&i.removeData("touchstart touchmove touchend"):(n.type="tap",t=a.handler.call(this,n)),t}}),e("ul.dropdown-menu").each(function(){var s=e(this);if(s.hasClass("mobile-menu")){var r=e('<a href="#" data-menu-toggler="">Menu</a>');s.before(r),r.click(function(){r.hasClass("opened")?(s.slideUp(300,function(){s.css("display","")}),s.removeClass("mobile-menu"),r.removeClass("opened")):(r.addClass("opened"),s.slideDown(),s.addClass("mobile-menu"),i(s),n(s))})}e("");s.on("tap.navigation","li.menu-item > a, li.page_item > a",function(o){var r,l,c=e(this),d=c.parent();if(d.children("ul").length)if(d.is("[data-selected-item]")){var u=c.attr("href");if(0===u.indexOf("#")){var h=u.replace("#","").trim();if(!h||!e("#"+h).length)return}n(s)}else l=d,n(r=s),l.attr("data-selected-item",!0),i(r,l),l.addClass("hover"),a(0,l),e("body").on("tap.navigation-clear-selection","*",function(){t(jQuery(this),r)}),e(window).on("scroll.navigation-clear-selection",function(){t(jQuery(this),r)}),o.preventDefault(),o.stopPropagation();else o.stopPropagation(),n(s)}),s.on("mouseover.navigation","li",function(){s.find("li.hover").removeClass("hover"),a(0,e(this))}),o(s)}),e(function(){window.wp&&window.wp.customize&&(jQuery(".offcanvas_menu").find("li > ul").eq(0).each(function(){jQuery(this).show(),jQuery(this).parent().addClass("open")}),window.wp.customize.selectiveRefresh.bind("render-partials-response",function(n){Object.getOwnPropertyNames(n.contents).filter(function(e){return-1!==e.indexOf("nav_menu_instance[")}).length&&setTimeout(function(){e("ul.dropdown-menu").each(function(){o(e(this))})},1e3)}))})}(jQuery);