{"version":3,"names":[],"mappings":"","sources":["main-navigation.js"],"sourcesContent":["!function(e,n){\"use strict\";n.behaviors.mainNavigation={attach:function(i){i===document&&(this.navigationWrapper=\".navigation__menu\",e(\"body\").once().on(\"click\",(function(i){const a=i.target||i.srcElement,t=e(a).parents(\".navigation__menu\");if(e(a).hasClass(\"level--0--btn\")){i.preventDefault(),i.stopPropagation();const t=e(a).parents(\".level--0\");e(a).hasClass(\"active\")?n.behaviors.mainNavigation.resetMainNav():(n.behaviors.mainNavigation.resetMainNav(),e(a).attr(\"aria-selected\",\"true\"),e(a).addClass(\"active\"),n.behaviors.mainNavigation.levelOneProcess(t))}if(e(a).hasClass(\"level--1--tab\")){i.preventDefault(),i.stopPropagation();const t=e(a).parents(\".level--1\");n.behaviors.mainNavigation.levelTwoProcess(t)}0==t.length&&n.behaviors.mainNavigation.resetMainNav()})),e(\".menu-level-1 .level--1--tab\").on(\"keydown\",(function(e){n.behaviors.mainNavigation.keypressLevelOne(e)})),e(\".navigation__subnav-content-item\").on(\"keydown\",(function(e){n.behaviors.mainNavigation.keypressSubNav(e)})),e(\".navigation__menu--level-1-wrapper.no-tab\").on(\"keydown\",(function(e){n.behaviors.mainNavigation.keypressNoTab(e)})))},levelOneProcess:function(i){const a=\".navigation__menu--level-1-wrapper\",t=\".navigation__subnav-content-item\",o=\".level--1--tab\",s=e(i).find(\".menu-level-1\"),l=e(s).find(\".level--1:first-child\");e(this.navigationWrapper).find(t).hide(),e(this.navigationWrapper).find(o).attr(\"aria-selected\",\"false\"),e(this.navigationWrapper).find(o).removeClass(\"active\"),e(this.navigationWrapper).find(a).removeClass(\"active\"),e(l).find(o).attr(\"aria-selected\",\"true\"),e(l).find(o).addClass(\"active\"),e(i).find(a).addClass(\"active\"),e(l).find(t).show(),n.behaviors.mainNavigation.computeHeight(l)},levelTwoProcess:function(i){const a=\".level--1--tab\",t=\".navigation__subnav-content-item\";e(this.navigationWrapper).find(a).attr(\"aria-selected\",\"false\"),e(this.navigationWrapper).find(a).removeClass(\"active\"),e(this.navigationWrapper).find(t).hide(),e(i).find(a).attr(\"aria-selected\",\"true\"),e(i).find(a).addClass(\"active\"),e(i).find(t).show(),n.behaviors.mainNavigation.computeHeight(i)},keypressSubNav:function(i){const a=i.keyCode||i.which,t=i.target||i.srcElement,o=e(t).parents(\".level--1\"),s=o.find(\"a\"),l=o.find(\".level--1--tab\");if(9==a&&!i.shiftKey){i.preventDefault(),i.stopPropagation();const a=n.behaviors.mainNavigation.getIndex(t,s)+1;a=a.length?o:a[t],s.click(),s.focus()},resetMainNav:function(){const n=\".level--0--btn\";e(n).attr(\"aria-selected\",\"false\"),e(n).removeClass(\"active\"),e(\".navigation__menu--level-1-wrapper\").removeClass(\"active\")},computeHeight:function(n){const i=n.find(\".navigation__subnav-content-item\"),a=n.parents(\".navigation__menu--level-1\");e(this.navigationWrapper).find(\".navigation__menu--level-1\").height(\"auto\");const t=i.outerHeight(),o=a.height();t>o?a.height(t):a.height(o)},getIndex:function(e,n){let i;for(i=0;i0?(this.mobileMenuToggle=\".mobile-menu--trigger\",this.mobileMenuWrapper=\".mobile__navigation__menu--wrapper\",this.menuOptions={extensions:[\"fullscreen\",\"position-top\",\"position-front\"],navbar:{title:\" \"}},this.menuConfig={offCanvas:{page:{selector:\".dialog-off-canvas-main-canvas\"}}},n.behaviors.mobileMainNavigation.preprocessMarkUp(i)):e(\".mod-header__menu-btn\").hide())},preprocessMarkUp:function(i){0!==e(\"#menuMobile\").length&&(this.mmenuAPI=new Mmenu(\"#menuMobile\",this.menuOptions,this.menuConfig),n.behaviors.mobileMainNavigation.listenMobileMenuToogle())},listenSearchClick:function(){e(\"body\").bind(\"click\",(function(i){const a=i.target||i.srcElement;(e(a).hasClass(\"mod-search__trigger\")||0!==e(a).parents(\".mod-search__trigger\").length)&&n.behaviors.mobileMainNavigation.menuClose()}))},listenMobileMenuToogle:function(){e(this.mobileMenuToggle).on(\"click\",(function(e){n.behaviors.mobileMainNavigation.toggleOffCanvasMenu()}))},toggleOffCanvasMenu:function(){e(\"body\").hasClass(\"mm-wrapper_opened\")?n.behaviors.mobileMainNavigation.menuClose():n.behaviors.mobileMainNavigation.menuOpen()},menuClose:function(){this.mmenuAPI.close(),e(this.mobileMenuToggle).removeClass(\"is-active\")},menuOpen:function(){this.mmenuAPI.open(),e(this.mobileMenuToggle).addClass(\"is-active\")}}}(jQuery,Drupal);"],"file":"main-navigation.js"}