*/},{key:"_events",value:function _events(t){var i=this;t.off("click.zf.drilldown").on("click.zf.drilldown",(function(n){e(n.target).parentsUntil("ul","li").hasClass("is-drilldown-submenu-parent")&&n.preventDefault();i._show(t.parent("li"));if(i.options.closeOnClick){var s=e("body");s.off(".zf.drilldown").on("click.zf.drilldown",(function(t){if(t.target!==i.$element[0]&&!e.contains(i.$element[0],t.target)){t.preventDefault();i._hideAll();s.off(".zf.drilldown")}}))}}))}},{key:"_registerEvents",value:function _registerEvents(){if(this.options.scrollTop){this._bindHandler=this._scrollTop.bind(this);this.$element.on("open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown",this._bindHandler)}this.$element.on("mutateme.zf.trigger",this._resize.bind(this))}},{key:"_scrollTop",value:function _scrollTop(){var t=this;var i=""!==t.options.scrollTopElement?e(t.options.scrollTopElement):t.$element,n=parseInt(i.offset().top+t.options.scrollTopOffset,10);e("html, body").stop(true).animate({scrollTop:n},t.options.animationDuration,t.options.animationEasing,(function(){this===e("html")[0]&&t.$element.trigger("scrollme.zf.drilldown")}))}},{key:"_keyboardEvents",value:function _keyboardEvents(){var t=this;this.$menuItems.add(this.$element.find(".js-drilldown-back > a, .is-submenu-parent-item > a")).on("keydown.zf.drilldown",(function(i){var n,s,a=e(this),o=a.parent("li").parent("ul").children("li").children("a");o.each((function(t){if(e(this).is(a)){n=o.eq(Math.max(0,t-1));s=o.eq(Math.min(t+1,o.length-1))}else;}));l.handleKey(i,"Drilldown",{next:function next(){if(a.is(t.$submenuAnchors)){t._show(a.parent("li"));a.parent("li").one(transitionend(a),(function(){a.parent("li").find("ul li a").not(".js-drilldown-back a").first().focus()}));return true}},previous:function previous(){t._hide(a.parent("li").parent("ul"));a.parent("li").parent("ul").one(transitionend(a),(function(){setTimeout((function(){a.parent("li").parent("ul").parent("li").children("a").first().focus()}),1)}));return true},up:function up(){n.focus();return!a.is(t.$element.find("> li:first-child > a"))},down:function down(){s.focus();return!a.is(t.$element.find("> li:last-child > a"))},close:function close(){if(!a.is(t.$element.find("> li > a"))){t._hide(a.parent().parent());a.parent().parent().siblings("a").focus()}},open:function open(){if(t.options.parentLink&&a.attr("href"))return false;if(!a.is(t.$menuItems)){t._hide(a.parent("li").parent("ul"));a.parent("li").parent("ul").one(transitionend(a),(function(){setTimeout((function(){a.parent("li").parent("ul").parent("li").children("a").first().focus()}),1)}));return true}if(a.is(t.$submenuAnchors)){t._show(a.parent("li"));a.parent("li").one(transitionend(a),(function(){a.parent("li").find("ul li a").not(".js-drilldown-back a").first().focus()}));return true}},handled:function handled(e){e&&i.preventDefault()}})}))}},{key:"_hideAll",value:function _hideAll(){var e=this;var t=this.$element.find(".is-drilldown-submenu.is-active");t.addClass("is-closing");t.parent().closest("ul").removeClass("invisible");if(this.options.autoHeight){var i=t.parent().closest("ul").data("calcHeight");this.$wrapper.css({height:i})}this.$element.trigger("close.zf.drilldown");t.one(transitionend(t),(function(){t.removeClass("is-active is-closing");e.$element.trigger("closed.zf.drilldown")}))}