woodmartThemeModule.$document.on("wdShopPageInit",function(){woodmartThemeModule.clearSearch()}),jQuery.each(["frontend/element_ready/wd_search.default"],function(e,t){woodmartThemeModule.wdElementorAddAction(t,function(){woodmartThemeModule.clearSearch()})}),woodmartThemeModule.clearSearch=function(){function n(e,t){e.value.length?t.classList.remove("wd-hide"):(t.classList.add("wd-hide"),e.classList.remove("wd-search-inited"))}document.querySelectorAll("form .wd-clear-search").forEach(function(t){var e=t.closest("form").querySelector("input");e&&(n(e,t),e.addEventListener("keyup",function(){n(e,t)})),t.addEventListener("click",function(e){e.preventDefault();e=t.parentNode.querySelector("input");e.value="",e.dispatchEvent(new Event("keyup")),e.dispatchEvent(new Event("focus"))})})},window.addEventListener("wdEventStarted",function(){woodmartThemeModule.clearSearch()});