%PDF- %PDF-
Direktori : /var/www/projetos/prod.jornalshowdafe.com.br/wp-content/themes/__betheme/js/ |
Current File : /var/www/projetos/prod.jornalshowdafe.com.br/wp-content/themes/__betheme/js/accessibility.min.js |
!function(e){"use strict";var i={keysTriggered:{Tab:!1,Enter:!1,ShiftLeft:!1,ShiftRight:!1,Escape:!1,ArrowLeft:!1,ArrowRight:!1,ArrowUp:!1,ArrowDown:!1},utils:{isSimpleHamburgerStack:!(e("body").hasClass("header-simple")&&!e("body").hasClass("mobile-side-slide")),switchExpanded:(i,s)=>e(i).attr("aria-expanded",s)},menuLinks:e("#menu .menu-item a").not(".menu-toggle").toArray(),subheaderLinks:e("#Subheader a").toArray(),wooPopup:e(".mfn-header-login").find("a, input").toArray(),contentLinks:[...e("#Content a").toArray(),...e("#Footer a").toArray()],clickListener(){jQuery(document).on("keydown",'a, *[role="link"], button',(e=>{let{originalEvent:i}=e,{code:s}=i;s in this.keysTriggered&&(this.keysTriggered[s]=!0),setTimeout((i=>this.recognizeGesture(e)),1)})),jQuery(document).on("keyup",'a, *[role="link"], button',(e=>{let{originalEvent:i}=e,{code:s}=i;s in this.keysTriggered&&(this.keysTriggered[s]=!1),setTimeout((i=>this.recognizeGesture(e)),1)})),jQuery("#skip-links-menu").one("focus","a",(function(){e("#skip-links-menu").css("top","0px")}))},skipLinks(){e(":focus").closest("nav").is("#skip-links-menu")?e("#skip-links-menu").css("top","0px"):e("#skip-links-menu").css("top","-200px")},recognizeGesture(i){let{Tab:s,ShiftLeft:t,ShiftRight:a,ArrowDown:r,ArrowUp:n,ArrowLeft:l,ArrowRight:o,Enter:d,Escape:c}=this.keysTriggered;const g=e(":focus");let u=e("*[aria-expanded=true]:not(#menu):not(.sub-menu)");const h=e("nav#menu").find("*[aria-expanded=true]"),f=e("body").hasClass("side-slide-is-open")?".extras-wrapper ":".top_bar_right ",p=()=>{let i=!1;return e("body").hasClass("rtl")&&(i=!0),e("body").hasClass("header-rtl")&&(i=!0),i};if(e(u).length&&!g.closest(u).length){const i=Object.values(u).filter((i=>i.classList&&"Side_slide"!==e(i).attr("id")));switch(u=i.length?e(i[0]):u,"Side_slide"!==u.attr("id")&&"true"==u.attr("aria-expanded")&&(e(u).siblings(".mfn-close-icon").length?e(u).siblings(".mfn-close-icon").trigger("click"):e(u).find(".mfn-close-icon").trigger("click")),this.utils.switchExpanded(u,!1),!0){case u.hasClass("woocommerce-MyAccount-navigation"):e(`${f} .myaccount_button`).trigger("focus");break;case u.hasClass("mfn-cart-holder"):e(`${f} #header_cart`).trigger("focus");break;case"Side_slide"===u.attr("id"):u.find(".close").trigger("click"),e(".responsive-menu-toggle").trigger("focus")}}if(e(h).length&&this.utils.isSimpleHamburgerStack&&(g.closest(h).length||h.siblings().is(g)||e(h).attr("aria-expanded","false").slideUp()),e(".sub-menu[aria-expanded=true]").each(((i,s)=>{"none"==e(s).css("display")&&this.utils.switchExpanded(s,!1)})),d)switch(!0){case g.hasClass("close"):this.utils.switchExpanded(u,!1),e(".responsive-menu-toggle").trigger("focus");break;case g.hasClass("menu-toggle")&&e("body").hasClass("side-slide-is-open"):const i=g.siblings(".sub-menu");"block"==i.css("display")&&i.find("a").first().trigger("focus");break;case g.hasClass("menu-toggle")&&!e("body").hasClass("side-slide-is-open"):const s=g.siblings(".sub-menu");if(!this.utils.isSimpleHamburgerStack){if("true"==s.attr("aria-expanded"))this.utils.switchExpanded(s,!1);else{this.utils.switchExpanded(s,!0);let e=s.find("a").first();setTimeout((i=>e.trigger("focus")),100)}break}if("none"!=s.css("display")){this.utils.switchExpanded(s,!1),s.slideUp(0);const e=s.find("*[aria-expanded=true]");e.length&&(this.utils.switchExpanded(e,!1),e.slideUp())}else{this.utils.switchExpanded(s,!0);let e=s.slideDown(0).find("a").first();setTimeout((i=>e.trigger("focus")),100)}break;case g.hasClass("toggle-login-modal"):e(".woocommerce-MyAccount-navigation").find("a").first().trigger("focus"),e(".woocommerce-MyAccount-navigation").attr("aria-expanded","true");break;case"link"===g.attr("role"):g.find(".image_links").length?window.location=g.find("a").attr("href"):g.find(".title").length?g.find(".title").trigger("click"):g.closest(".mfn-woo-list").length&&g.trigger("click");break;case"wpml"===g.attr("data-title"):const t=g.siblings(".wpml-lang-dropdown");"false"==t.attr("aria-expanded")?(t.attr("aria-expanded","true"),t.find("a").first().trigger("focus")):t.attr("aria-expanded","false");break;case g.hasClass("single_add_to_cart_button"):e(".mfn-cart-holder").find("a").first().trigger("focus");break;case g.hasClass("responsive-menu-toggle"):e("body").hasClass("mobile-side-slide")&&(this.menuLinks=[...e("#Side_slide").find("a.close").toArray(),...e(".extras-wrapper").find("a").toArray(),...this.menuLinks,...e("#Side_slide .social").find("a").toArray()],e(this.menuLinks[0]).trigger("focus"),g.trigger("click"),this.utils.switchExpanded(e("#Side_slide"),!0));break;case g.hasClass("overlay-menu-toggle"):"false"==e("#overlay-menu ul").attr("aria-expanded")||void 0===e("#overlay-menu ul").attr("aria-expanded")?(this.utils.switchExpanded(e("#overlay-menu ul"),!0),e("#overlay-menu").find(".menu-item a").first().trigger("focus")):(this.utils.switchExpanded(e("#overlay-menu ul"),!1),g.hasClass("close")&&e(".overlay-menu-toggle").trigger("focus"))}else if(s&&(t||a))e("a.ui-tabs-anchor").attr("tabindex",0),this.skipLinks();else if(s)switch(e("a.ui-tabs-anchor").attr("tabindex",0),this.skipLinks(),!0){case g.closest("li").hasClass("wc-block-product-categories-list-item"):g.closest(".li-expanded").length||(g.siblings(".cat-expander").trigger("click"),g.siblings("ul").find("a").first().trigger("focus")),g.closest("li").siblings(".li-expanded").each(((i,s)=>e(s).find(".cat-expander").trigger("click")));break;case g.is(".overlay-menu-toggle",".focus")&&"block"===e("#Overlay").css("display"):e(".overlay-menu-toggle").trigger("focus");break;case g.is(e(this.contentLinks[this.contentLinks.length-1]))&&!e("body").hasClass("footer-menu-sticky"):e(".fixed-nav").length?e(".fixed-nav").first().trigger("focus"):e("body a").first().trigger("focus")}else if(c){var m=Array.from(e(".sub-menu[aria-expanded=true]")),b=e(".woocommerce").find("nav[aria-expanded=true]");if(e("body").hasClass("side-slide-is-open")&&g.closest("#Side_slide").length)this.utils.switchExpanded(u,!1),u.find(".close").trigger("click"),e(".responsive-menu-toggle").trigger("focus");else if(m.length){var k=e("nav").find(".sub-menu[aria-expanded=true]").siblings("a.menu-toggle");m.forEach((i=>{this.utils.switchExpanded(i,!1),e(i).slideUp()})),k.trigger("focus")}else if(e(".mfn-header-login").find("nav[aria-expanded=true]").length)e(".close-login-modal").trigger("click"),this.utils.switchExpanded(b,!1),e(".myaccount_button").trigger("focus");else{if("true"==e(".mfn-cart-holder").attr("aria-expanded"))return e(".mfn-cart-holder").find(".close-mfn-cart").trigger("click"),this.utils.switchExpanded(e(".mfn-cart-holder"),!1),void e("#header_cart").trigger("focus");e(".responsive-menu-toggle").hasClass("active")&&(e(".responsive-menu-toggle").trigger("click"),e(".responsive-menu-toggle").trigger("focus"))}}else if(p()?l:o){if(g.closest("li").find(".menu-toggle").length){const e=g.siblings(".sub-menu");if("none"==e.css("display")){this.utils.switchExpanded(e,!0);let i=e.slideDown(0).find("a").first();setTimeout((e=>i.trigger("focus")),100)}}}else if((p()?o:l)&&g.closest("ul[aria-expanded=true]").length){const e=g.closest(".sub-menu").find("*[aria-expanded=true]");e.length&&(this.utils.switchExpanded(e,!1),e.slideUp())}},init(){e("body").hasClass("keyboard-support")&&(this.clickListener(),e(".sub-menu").attr("aria-expanded","false"),e(".menu-toggle, .menu-item a").attr("tabindex","0"),e("#Content").attr("role","main"),e("#Header_wrapper").attr("role","banner").attr("aria-label",mfn.accessibility.translation.headerContainer),e(".woocommerce-MyAccount-navigation").attr("role","navigation").attr("aria-expanded","false"),e("body").is(".header-creative, .header-simple, .header-overlay")||e("#menu").removeAttr("aria-expanded"))}},s={onLinkAlert(){e("a").click((function(i){const s=e(i.currentTarget);"_blank"!==s.attr("target")&&"0"!==s.attr("target")||(confirm("The link will open in a new tab. Do you want to continue? ")||i.preventDefault())}))},init(){e("body").hasClass("warning-links")&&this.onLinkAlert()}};e(window).on("load",(function(){i.init(),s.init()}))}(jQuery);