PageSourceSearch

https://www.nutaku.com/js/tab-navigation.js?t=31874e45

js nutaku.com collected 2026-09-24 23:43:25 UTC 12,077 bytes, 1 lines download raw bytes

1let isKeyboardUser=!1,isAccessibilityInitialized=!1,activeContainer=null,searchNavigation=null;const additionalFocusable=[],header=document.querySelector(".header-logo"),allFocusable=[],focusableSelectors=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","label[for]",".switch",'[tabindex]:not([tabindex="-1"])',".js-btn-back",".js-field-input iframe",".js-sidebar-item",".js-platform-button",".js-card-favorite",".js-read-more",".js-remove-from-continue-playing",".js-sales-label-close",".icon-close",".standard-notif"],clickRehandlingElements=[".js-cc-parent",".js-panel.add-new-card",".js-flyout-init-change-payment-method",".js-panel-all-cards",".js-dropdown-action",".js-btn-modal:not(.gold-package-pfo)",".js-filter-category","select:not([disabled])",".js-accordion > li .head",".js-show-more-less","span[data-filter]",".pay-method",".js-ui-select-info",".js-list-item",".results-item[data-support]",".pill-list .button",".avatar-items li",".js-pagination-item",".js-header-user-container .switch",".js-verify-age",".js-daily-reward",".js-home-skin",".js-close-announcement",".js-remove-notification",".js-dropdown-close",".js-remove-notification"],ignoredElements=[".swiper-pagination-bullet",".cnt-skin-carousel .swiper-button-prev",".cnt-skin-carousel .swiper-button-next"];function activateKeyboardNavigation(){isAccessibilityInitialized||(initAccessibility(),isAccessibilityInitialized=!0)}function resetHeaderFocus(){header.focus(),allFocusable.length=0}function initAccessibility(){const allPotential=void 0;document.querySelectorAll([...focusableSelectors,...clickRehandlingElements].join(",")).forEach(el=>{const isIgnored=void 0;if(ignoredElements.some(selector=>el.matches(selector)))return el.setAttribute("tabindex","-1"),el.removeAttribute("role"),void(el.inert=!0);if(el.closest('[class*="js-modal-"]:not(.open):not(.opened)'))return void el.setAttribute("tabindex","-1");if(el.closest(".cnt-closed"))return void el.setAttribute("tabindex","-1");el.hasAttribute("tabindex")||el.setAttribute("tabindex","0");const tagName=el.tagName.toLowerCase(),isNative=["a","button","select","input","textarea"].includes(tagName);el.hasAttribute("role")||isNative||el.setAttribute("role","button")})}function getFocusable(container){const potentialFocusable=void 0;return[...container.querySelectorAll([...focusableSelectors,...clickRehandlingElements].join(","))].filter(el=>{const isIgnored=void 0;if(ignoredElements.some(selector=>el.matches(selector)))return!1;const isException=el.matches(".js-btn-proceed, .js-flyout-init-change-payment-method, .js-panel-all-cards");if(el.closest(".js-disable-fields")&&!el.closest(".hide-fields")&&!el.closest(".opened")&&!isException||el.closest('[aria-hidden="true"]')||"true"===el.getAttribute("aria-hidden"))return el.matches(ignoredElements.join(","));const parentModal=el.closest('[class*="js-modal-"], [class*="modal"]');if(parentModal&&!parentModal.classList.contains("open")&&!parentModal.classList.contains("opened")&&container!==parentModal&&!container.contains(parentModal))return!1;const style=window.getComputedStyle(el);if("hidden"===style.visibility||"0"===style.opacity)return!1;const position=style.position;if(null===el.offsetParent&&"fixed"!==position&&"absolute"!==position)return!1;const tagName=el.tagName.toLowerCase();if("input"===tagName&&("checkbox"===el.type||"radio"===el.type))return!1;if("select"===tagName||"a"===tagName&&"#"===el.getAttribute("href")&&!el.classList.contains("button")&&!el.classList.contains("tab"))return!1;const rect=el.getBoundingClientRect();if(0===rect.width&&0===rect.height)return!1;const filterBox=el.closest(".filterbox");return!filterBox||!filterBox.classList.contains("cnt-closed")})}function focusActiveOverlay(){const cookie=$(".js-cookie-prompt"),ageDisclaimer=$(".js-disclaimer");let result=!0;return $(".js-modal-cookies-settings.open").length?keyboardFocus(".js-modal-cookies-settings"):cookie.length&&ageDisclaimer.length||cookie.length?keyboardFocus(".js-cookie-prompt"):ageDisclaimer.length?keyboardFocus(".js-disclaimer"):$(".js-fly-out-payment.open").length?keyboardFocus(".js-fly-out-payment"):$(".js-moengage-prompt.open").length?keyboardFocus(".js-moengage-prompt"):$(".js-modal-update-avatar.open").length?keyboardFocus(".js-modal-update-avatar"):result=!1,result}function handleModalTab(e,allFocusable2,idx){const nextIdx=void 0;allFocusable2[e.shiftKey?(idx-1+allFocusable2.length)%allFocusable2.length:(idx+1)%allFocusable2.length].focus()}function handleRegularTab(e,allFocusable2,idx,nextFocus){return!(!Array.isArray(allFocusable2)||0===allFocusable2.length)&&(e.shiftKey||idx!==allFocusable2.length-1?!(!e.shiftKey||0!==idx)&&
1(nextFocus&&setTimeout(()=>keyboardFocus(nextFocus,!0,!1),0),!0):(nextFocus&&setTimeout(()=>keyboardFocus(nextFocus,!0,!1),0),!0))}function keyboardAction(element,container,keyHandler,formType,manualTarget=null){if(element.hasAttribute("tabindex")||element.setAttribute("tabindex","0"),formType)return element.addEventListener("keydown",event=>{if("Enter"===event.key||" "===event.key){if(manualTarget){const targetToClick=manualTarget||element;event.preventDefault(),targetToClick.click()}if(element.matches(".switch, .js-daily-reward"))return;return container.removeEventListener("keydown",keyHandler),focusActiveOverlay()||resetHeaderFocus(),!0}}),!1}function pageFocus(container,keyHandler){resetHeaderFocus(),container.removeEventListener("keydown",keyHandler)}function queryVisible(container,selector){const elements=container.querySelectorAll(selector);return Array.from(elements).find(el=>hiddenRemove(el))||!1}function hiddenRemove(element){const style=window.getComputedStyle(element);if("none"===style.display||"hidden"===style.visibility)return!1;const rect=element.getBoundingClientRect();return 0!==rect.width&&0!==rect.height&&(null!==element.offsetParent||"fixed"===style.position)}const focusReady=()=>new Promise(res=>requestAnimationFrame(res));async function keyboardFocus(selector,nextFocus=!1,modal=!0,autoFocus=!0){const container=document.querySelector(selector);if(!container)return void resetHeaderFocus();activeContainer&&activeContainer.focusHandler&&activeContainer.removeEventListener("keydown",activeContainer.focusHandler),activeContainer=container,await focusReady();const closeSelectors=".js-modal-close, .js-close-modal-fly-out, .js-modal-close-coupon, .js-dropdown-close";let close=!!modal&&queryVisible(container,closeSelectors);const closedNestedModals=void 0;if(container.querySelectorAll('[class*="js-modal-"]:not(.open),.js-collapsible:not(.opened)').forEach(modalEl=>{modalEl===close||modalEl===container||hiddenRemove(modalEl)||modalEl.setAttribute("aria-hidden","true")}),allFocusable.length=0,allFocusable.push(...getFocusable(container)),!allFocusable.length)return void header.focus();const keyHandler=e=>{if("Escape"===e.key&&(close&&(e.preventDefault(),close.click()),allFocusable.some(el=>el.matches(closeSelectors))&&pageFocus(container,keyHandler),allFocusable.length=0),"Tab"!==e.key)return;e.stopImmediatePropagation(),isKeyboardUser=!0,(container.querySelector(".js-signup, .js-login")||container.matches(".js-signup, .js-login"))&&(allFocusable.length=0,allFocusable.push(...getFocusable(container)),allFocusable.forEach(el=>{"label"!==el.tagName.toLowerCase()||el.hasAttribute("tabindex")||keyboardAction(el,container,keyHandler,!0)}));let idx=allFocusable.indexOf(document.activeElement);if(-1===idx){const activeEl=document.activeElement;if(container.contains(activeEl)){const nextInDomIdx=allFocusable.findIndex(el=>el.compareDocumentPosition(activeEl)&Node.DOCUMENT_POSITION_PRECEDING);-1!==nextInDomIdx&&(idx=e.shiftKey?nextInDomIdx:nextInDomIdx-1)}}if(-1===idx){e.preventDefault();const startIdx=e.shiftKey?allFocusable.length-1:0;return void allFocusable[startIdx].focus()}if(e.preventDefault(),modal)return void handleModalTab(e,allFocusable,idx);if(handleRegularTab(e,allFocusable,idx,nextFocus))return void resetHeaderFocus();const nextIdx=e.shiftKey?(idx-1+allFocusable.length)%allFocusable.length:(idx+1)%allFocusable.length;allFocusable[nextIdx].focus()};if(close&&"button"!==close.tagName.toLowerCase()&&!nextFocus&&"true"!==close.getAttribute("aria-hidden")&&(allFocusable.includes(close)||(allFocusable.push(close),close.setAttribute("role","button")),keyboardAction(close,container,keyHandler,!0)&&(allFocusable.length=0)),container.classList.contains("js-modal-search-catalog"))additionalFocusable.length=0,additionalFocusable.push(...allFocusable),additionalFocusable.forEach(el=>{el.setAttribute("tabindex","0")});else if(container.classList.contains("js-search-content"))return allFocusable.push(...additionalFocusable),additionalFocusable.length=0,void(searchNavigation=searchNavigationHandler.bind(null,container,keyHandler));if(allFocusable.forEach(el=>{let currentElement=el.tagName.toLowerCase();if(el.matches("span[data-filter]")&&!el.hasAttribute("tabindex")&&(el.setAttribute("tabindex","0"),el.setAttribute("role","button")),"div"===currentElement||"li"===currentElement||"label"===currentElement)if(el.classList.contains("pay-method")){const actualTrigger=el.closest(".
1js-pay-methods");keyboardAction(el,container,keyHandler,!0,actualTrigger)}else{const shouldBind="div"!==currentElement||el.matches(clickRehandlingElements.join(","));keyboardAction(el,container,keyHandler,shouldBind)}}),container.focusHandler=keyHandler,container.addEventListener("keydown",keyHandler),container.setAttribute("tabindex","-1"),autoFocus){const focusOn=void 0;(additionalFocusable.length?allFocusable[0]:container).focus({preventScroll:!0})}}function gamesFilterBox(triggerElement){const filterBox=triggerElement.closest(".filterbox"),innerContent=filterBox.querySelector(".filtercontent-inner");if(!innerContent)return;const isClosed=filterBox.classList.contains("cnt-closed");innerContent.inert=isClosed}function searchNavigationHandler(container,keyHandler){container.removeEventListener("keydown",keyHandler),keyboardFocus(".js-modal-search-catalog"),searchNavigation=null}document.addEventListener("keydown",e=>{if("Tab"===e.key&&(isKeyboardUser=!0,isAccessibilityInitialized||activateKeyboardNavigation(),searchNavigation))return searchNavigation();const target=e.target;if("Enter"===e.key||" "===e.key){const tagName=target.tagName.toLowerCase();if("select"===tagName||"a"===tagName&&"#"===target.getAttribute("href")&&!target.classList.contains("button")&&!target.classList.contains("tab"))return;target.matches(".js-filter-category")&&setTimeout(()=>{gamesFilterBox(target)},50);const isCustomElement=void 0,isNativeInteractive=void 0;(target.matches(clickRehandlingElements.join(","))||target.matches('.switch, label[for], [role="button"]'))&&!("button"===tagName||"a"===tagName)&&(e.preventDefault(),target.click())}if(target.classList.contains("js-home-skin")&&"Tab"===e.key){const slideWrapper=target.closest(".swiper-slide");if(slideWrapper.classList.contains("swiper-slide-active")){const isShiftTab=e.shiftKey,ariaLabel=void 0,parts=slideWrapper.getAttribute("aria-label").split("/"),current=Number(parts[0].trim()),total=Number(parts[1].trim()),isFirst=void 0,isLast=void 0;if(!isShiftTab&&current===total||isShiftTab&&1===current)return;e.preventDefault();const navBtnSelector=isShiftTab?".swiper-button-prev":".swiper-button-next",navBtn=document.querySelector(".cnt-skin-carousel").querySelector(navBtnSelector);if(navBtn){navBtn.click();const newActiveLink=document.querySelector(".swiper-slide-active .js-home-skin");newActiveLink&&newActiveLink.focus()}}}}),document.addEventListener("mousedown",()=>{isKeyboardUser=!1}),document.addEventListener("focusin",e=>{document.querySelectorAll(".tab-focused").forEach(el=>el.classList.remove("tab-focused")),isKeyboardUser&&e.target.classList.add("tab-focused");const target=e.target,isInput=void 0,isRadioOrCheck=void 0;if("INPUT"===target.tagName&&("checkbox"===target.type||"radio"===target.type)){const label=target.id&&document.querySelector('label[for="'+target.id+'"]')||target.closest("label");label&&label.focus({preventScroll:!0})}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.