var site=site||{};!function(e){Drupal.behaviors.ada={attach:function(t){var a,s=e(".js-access-link",t),i=null,n="a:tabbable, button:tabbable, input:tabbable, select:tabbable, textarea:tabbable, iframe:tabbable, object:tabbable, embed:tabbable, *[tabindex]:tabbable",r="[tabindex=-1], [disabled], [aria-hidden=true]";function o(e){a=setTimeout((function(){c(e)}),250)}function c(t){e(n).not(r).eq(t,10).focus()}e(document).on("mousemove",_.debounce((function(){Drupal.settings.globals_variables&&Drupal.settings.globals_variables.cr20&&e("html").hasClass("ada-enabled")&&e("html").removeClass("ada-enabled")}),200)),e(window).on("keydown",(function(t){var a=t.key;!e("html").hasClass("ada-enabled")&&["Tab","ArrowLeft","ArrowRight","ArrowDown","ArrowUp"].indexOf(a)>-1&&e("html").addClass("ada-enabled")})),e(document).on("keydown",(function(t){var a=t.key;Drupal.settings.globals_variables&&!Drupal.settings.globals_variables.cr20||-1===["Enter"].indexOf(a)||"Enter"===a&&t.target&&"a"!==t.target.localName&&e(t.target).click()})),e("a, button, input, select, textarea, iframe, object, embed, *[tabindex], *[contenteditable]").not(r).on("keydown",(function(t){var s=e(this),i=t.key;if((!Drupal.settings.globals_variables||Drupal.settings.globals_variables.cr20)&&-1!==["Enter","Escape","ArrowLeft","ArrowRight","ArrowDown","ArrowUp"].indexOf(i)){var l,u=e(n).not(r),d=u.index(s);switch(i){case"ArrowLeft":case"ArrowUp":l=0===d?-1:d-1;break;case"ArrowRight":case"ArrowDown":l=d===u.length-1?0:d+1;break;case"Enter":a&&clearTimeout(a),s.hasClass("close-popup")&&o(d-1),s[0].hasAttribute("aria-haspopup")&&o(d+1);break;case"Escape":a&&clearTimeout(a),o(d-1)}null!=l&&c(l)}})),e.fn.enterKey=function(t){return this.each((function(){e(this).on("keydown",(function(e){"13"===site.getKeycode(e)&&t.call(this,e)}))}))},site.getKeycode=function(e){return e.keyCode?e.keyCode:e.which},e(".js-access-link").enterKey((function(){e(this).trigger("click")})),e("#cart").ajaxComplete((function(e,t,a){site.customElementsNavigation()})),site.customElementsNavigation=function(){e(".select2-focusser").attr({tabindex:"0","aria-expanded":"false",role:"combobox"}),e("select").on("select2-open",(function(){var t=e(this).prev(".select2-container").find(".select2-focusser");t.attr("aria-expanded","true");var a=t.parents("#colorbox");a.attr("tabindex")&&a.removeAttr("tabindex")})).on("select2-close",(function(){var t=e(this).prev(".select2-container").find(".select2-focusser");t.attr("aria-expanded","false");var a=t.parents("#colorbox");a.attr("tabindex")||a.attr("tabindex","-1")})),e("#colorbox").attr("aria-live","assertive")},e(".field[type=checkbox]").on("focusin",(function(){e(this).siblings("div.picker-checkbox").css({border:"1px dotted black"})})).on("focusout",(function(){e(this).siblings("div.picker-checkbox").removeAttr("style")})),site.restrict_navigation=function(e){var t=e.find(":tabbable"),a=t.filter(":first"),s=t.filter(":last");e.once().keydown((function(t){if(9===t.keyCode&&!t.isDefaultPrevented()){var i=t.target;i!==s[0]&&i!==e[0]||t.shiftKey?i!==a[0]&&i!==e[0]||!t.shiftKey||(s.focus(),t.preventDefault()):(a.focus(),t.preventDefault())}}))},e("[class *='js-product-gallery__img-thumb']").on("keydown",(function(t){e(this).addClass("js-access-link")})),e(".js-loyalty-checkbox-hide").length>0&&e(".js-loyalty-flag").attr("tabindex","-1"),e(".js-cl-block-img-hover").on("focusout",(function(){e(".js-cl-block-img-hover").removeClass("focused")}));var l,u,d,b;Drupal.settings.globals_variables&&!Drupal.settings.globals_variables.cr20&&(e(window).keyup((function(t){var a=site.getKeycode(t),s=e(document.activeElement);9===a&&s.length&&(i&&(i.hasClass("select2-focusser")&&i.parent().find(".select2-choice").removeClass("custom-outline"),i.hasClass("js-product-image")?i.parents(".js-shade-trigger").removeClass("custom-outline"):i.removeClass("custom-outline")),(i=s).hasClass("select2-focusser")&&i.parent().find(".select2-choice").addClass("custom-outline"),i.hasClass("js-product-image")?i.parents(".js-shade-trigger").addClass("custom-outline"):i.addClass("custom-outline"))})),s.enterKey((function(){e(this).trigger("click")}))),e('[role="tab"]').on("keydown",(function(t){var a=e(this),s=a.prev(),i=a.next(),n=[];switch(t.keyCode){case 37:n=s;break;case 39:n=i;break;case 13:1===a.children("a").length?a.children("a")[0].click():a.trigger("click")}n.length>0&&(a.attr({tabindex:"-1","aria-selected":null}),n.attr({tabindex:"0","aria-selected":!0}).focus())})),e(".js-mpp-product-layout, .js-product-grid"),e(".js-grid--mpp__item, .js-product-grid-item").each((function(){var t=e(this);t.focusin((function(){var a=t.find(".js-product_teaser, .js-product-brief");t.find(":tabbable").filter(":last").on("focusout",(function(){a.hasClass("hover")&&a.removeClass("hover").removeAttr("aria-live")})),a.on("keydown",(function(t){t.shiftKey&&e(this).hasClass("hover")&&a.removeClass("hover")}))}))})),l=e(".js-grid-filter"),u=".js-filter-item",d=".js-remove-filter",b=".js-done-button",l.on("keydown",u,(function(t){switch(site.getKeycode(t)){case 32:case 13:t.preventDefault(),e(this).trigger("click",u);break;case 38:t.preventDefault(),e(this).prev().focus();break;case 40:t.preventDefault(),e(this).next().focus()}})),e(document).on("keydown",d,(function(t){13===site.getKeycode(t)&&e(this).trigger("click",d)})),e(document).on("keydown",b,(function(t){var a=site.getKeycode(t);if((13===a||9===a)&&!t.shiftKey){t.preventDefault();var s=e(this).parents().find(".grid-filter__column--active");e(this).trigger("click",b),s.find(".js-gridFilter-title").focus()}})),e(".js-gridFilter-title").on("keydown",(function(t){var a=site.getKeycode(t);13===a?e(this).trigger("click"):40===a&&e(this).parent().find(u).filter(":first").focus()}))}}}(jQuery),$(window).load((function(){site.customElementsNavigation(),$(".js-mm-item").find(".slick-list.draggable").attr("tabindex","-1"),$(".js-artist--products__carousel").find(".slick-list.draggable").attr("tabindex","-1")})),$.curCSS=function(e,t,a){return $(e).css(t,a)}; //# sourceMappingURL=ada.min.js.map