!function(e,t){"use strict";function n(t,n){this.defaultSettings={bodyMenuOpenClass:"overflow-hidden",menuToggleItemSelector:".hamburger",menuOverlaySelector:".navigation-mobile__overlay",menuItemWithSubmenuSelector:".menu-item--has-submenu",submenuToggleItemSelector:".menu-item__toggler",submenuSelector:".submenu",childMenuItemWithSubmenuSelector:".submenu-item--has-submenu",childSubmenuToggleSelector:".submenu-item__toggler",openClass:"open"},this.settings=e.extend(!0,this.defaultSettings,n||{}),this.$wrapper=t,this.$menuToggleItem=e(this.settings.menuToggleItemSelector),this.$submenuToggleItem=t.find(this.settings.submenuToggleItemSelector),this.$childSubmenuToggleItem=t.find(this.settings.childSubmenuToggleSelector),this.$overlay=t.find(this.settings.menuOverlaySelector),this.bindNavigationToggleAction(),this.bindNavigationSubmenuToggleAction(),this.bindChildSubmenuItemToggleAction(),this.openActiveSubmenu()}n.prototype.bindNavigationToggleAction=function(){var t=this;this.$menuToggleItem.click((function(){e(this).toggleClass(t.settings.openClass),t.$wrapper.toggleClass(t.settings.openClass),e("body").toggleClass(t.settings.bodyMenuOpenClass)})),this.$overlay.click((function(){e(t.$menuToggleItem).trigger("click")}))},n.prototype.bindNavigationSubmenuToggleAction=function(){var t=this;this.$submenuToggleItem.click((function(n){n.stopPropagation();var s=e(this).closest(t.settings.menuItemWithSubmenuSelector);s.toggleClass(t.settings.openClass),s.find(t.settings.submenuSelector).first().toggleClass(t.settings.openClass)}))},n.prototype.bindChildSubmenuItemToggleAction=function(){var t=this;this.$childSubmenuToggleItem.click((function(n){n.stopPropagation();var s=e(this).closest(t.settings.childMenuItemWithSubmenuSelector);s.toggleClass(t.settings.openClass),s.find(t.settings.submenuSelector).first().toggleClass(t.settings.openClass)}))},n.jQueryInterface=function(t){return this.each((function(){new n(e(this),t)}))},n.prototype.openActiveSubmenu=function(){var t=this.$wrapper.find(".menu-item--active, .submenu-item--active");t.length&&(t.removeClass("open"),t.hasClass("menu-item--active")&&(t.parents(".menu-item--has-submenu").addClass("open"),t.parents(".menu-item--has-submenu").find(".submenu").first().addClass("open")),t.hasClass("submenu-item--active")&&t.parents(".submenu-item--has-submenu, .menu-item--has-submenu").each((function(){e(this).addClass("open"),e(this).find(".submenu").first().addClass("open"),e(this).removeClass("submenu-item--active")})))},e.fn.navigationMobile=n.jQueryInterface,t.behaviors.navigationMobile={attach:function(t){e(once("navigation-mobile",".navigation-mobile",t)).each((function(){new n(e(this),{openingItemSelector:".hamburger",childMenuItemWithSubmenuSelector:".submenu-item--has-submenu",childSubmenuToggleSelector:".submenu-item__toggler"})}))}}}(jQuery,Drupal);
//# sourceMappingURL=navigation-mobile.js.map