1(function(){"use strict";function getFilterDrawer(){return document.querySelector(".mobile-facets__wrapper:not(.naoko-sort-drawer-wrapper) .mobile-facets__disclosure")}function getForm(){return document.getElementById("FacetFiltersFormMobile")}function parseProductCount(){var el=document.getElementById("ProductCount")||document.getElementById("ProductCountMobile");if(!el)return null;var text=(el.textContent||"").replace(/Â /g," "),match=text.match(/\d[\d\s.]*/);if(!match)return null;var n=parseInt(match[0].replace(/[^\d]/g,""),10);return isNaN(n)?null:n}function isPriceActive(form){var active=!1,min=form.querySelector("[data-naoko-price-min]"),max=form.querySelector("[data-naoko-price-max]");if(min){var mv=(min.value||"").trim();mv!==""&&mv!=="0"&&(active=!0)}if(max){var xv=(max.value||"").trim(),rangeMax=(max.dataset.rangeMax||"").trim();xv!==""&&xv!==rangeMax&&(active=!0)}return active}function countActiveFilters(form){var n=form.querySelectorAll('input[type="checkbox"]:checked').length;return isPriceActive(form)&&(n+=1),n}function updateCounters(fresh){var form=getForm();if(form){var footer=form.querySelector(".nk-sheet-footer");if(footer){var active=countActiveFilters(form),clear=footer.querySelector("[data-nk-clear]"),clearCount=footer.querySelector("[data-nk-clear-count]");clearCount&&(clearCount.textContent=active>0?"("+active+")":""),clear&&(active>0?(clear.classList.remove("is-disabled"),clear.removeAttribute("aria-disabled"),clear.removeAttribute("tabindex")):(clear.classList.add("is-disabled"),clear.setAttribute("aria-disabled","true"),clear.setAttribute("tabindex","-1")));var resultsCount=footer.querySelector("[data-nk-results-count]");if(resultsCount){if(active===0)resultsCount.textContent="",resultsCount.hidden=!0;else if(fresh){var pc=parseProductCount();pc!=null&&(resultsCount.textContent="("+pc+")",resultsCount.hidden=!1)}}footer.setAttribute("data-nk-active-filters",String(active))}}}function closeSheet(){var details=getFilterDrawer();if(details){var inner=details.querySelector(".mobile-facets__inner");inner&&(inner.classList.remove("nk-dragging"),inner.style.setProperty("transform","translateY(100%)","important")),window.setTimeout(function(){details.classList.remove("menu-opening"),details.removeAttribute("open"),document.body.classList.remove("overflow-hidden-mobile"),inner&&inner.style.removeProperty("transform")},400)}}function initDrag(){var details=getFilterDrawer();
1if(!details)return;var inner=details.querySelector(".mobile-facets__inner"),handles=details.querySelectorAll("[data-nk-sheet-grabber], .mobile-facets__header");if(!inner||!handles.length)return;var startY=0,startX=0,delta=0,dragging=!1,decided=!1;function onStart(e){var t=e.touches?e.touches[0]:e;startY=t.clientY,startX=t.clientX,delta=0,dragging=!0,decided=!1,inner.classList.add("nk-dragging")}function onMove(e){if(dragging){var t=e.touches?e.touches[0]:e,dy=t.clientY-startY,dx=t.clientX-startX;if(!decided&&(Math.abs(dy)>6||Math.abs(dx)>6)&&(decided=!0,Math.abs(dx)>Math.abs(dy))){dragging=!1,inner.classList.remove("nk-dragging"),inner.style.removeProperty("transform");return}delta=dy,delta<0&&(delta=0),inner.style.setProperty("transform","translateY("+delta+"px)","important"),delta>0&&e.cancelable&&e.preventDefault()}}function onEnd(){if(dragging){dragging=!1,inner.classList.remove("nk-dragging");var threshold=Math.min(140,inner.offsetHeight*.25);delta>threshold?(inner.style.setProperty("transform","translateY(100%)","important"),window.setTimeout(function(){details.classList.remove("menu-opening"),details.removeAttribute("open"),document.body.classList.remove("overflow-hidden-mobile"),inner.style.removeProperty("transform")},400)):inner.style.removeProperty("transform"),delta=0}}handles.forEach(function(h){h.addEventListener("touchstart",onStart,{passive:!0}),h.addEventListener("touchmove",onMove,{passive:!1}),h.addEventListener("touchend",onEnd),h.addEventListener("touchcancel",onEnd)})}function init(){var form=getForm();if(form){form.addEventListener("input",function(){updateCounters(!1)}),form.addEventListener("change",function(){updateCounters(!1)});var showBtn=form.querySelector("[data-nk-show-results]");showBtn&&showBtn.addEventListener("click",function(e){e.preventDefault(),closeSheet()})}if(initDrag(),updateCounters(!0),typeof FacetFiltersForm!="undefined"&&typeof FacetFiltersForm.renderProductCount=="function"&&!FacetFiltersForm._nkCountPatched){var origRenderCount=FacetFiltersForm.renderProductCount;FacetFiltersForm.renderProductCount=function(html){origRenderCount.call(this,html),updateCounters(!0)},FacetFiltersForm._nkCountPatched=!0}var grid=document.getElementById("ProductGridContainer");if(grid&&"MutationObserver"in window){var scheduled=!1,observer=new MutationObserver(function(){scheduled||(scheduled=!0,window.requestAnimationFrame(function(){scheduled=!1,updateCounters(!1)}))});observer.observe(grid,{childList:!0,subtree:!0})}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})(); 2//# sourceMappingURL=/cdn/shop/t/20/assets/naoko-filter-sheet.js.map?v=171430520465892991021784214916
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.