Liferay.Loader.define("portal-search-web@6.0.114/js/SearchBar",["module","exports","require"],(function(e,t,r){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({formId:e}){const t=document.getElementById(e);if(!t)return;const r=t.querySelector(".search-bar-empty-search-input"),n=r&&"true"===r.value,o=t.querySelector(".search-bar-keywords-input"),a=t.querySelector(".search-bar-reset-start-page"),u=t.querySelector(".search-bar-scope-select");function getKeywords(){if(!o)return"";return o.value.trim()}function search(){if(function isSubmitEnabled(){return""!==getKeywords()||n}()){const e=t.action,r=function updateQueryString(e){const t=new URLSearchParams(e);return o&&t.set(o.name,getKeywords()),a&&t.delete(a.name),u&&t.set(u.name,u.value),t.delete("p_p_id"),t.delete("p_p_state"),t.delete("start"),"?"+t.toString()}(document.location.search);document.location.href=e+r}}function onSubmit(e){e.preventDefault(),e.stopPropagation(),search()}return t.addEventListener("submit",onSubmit),{dispose(){t.removeEventListener("submit",onSubmit)}}}}));
//# sourceMappingURL=SearchBar.js.map