{"version":3,"file":"search.f4fd4da92c74fa5d1f45.js","mappings":";;CACA;AACE,IAAIA,IAAYC,SAASC,cAAc,uBACnCC,IAAiBH,EAAUE,cAAc,6CACzCE,IAAkBH,SAASC,cAAc,kFACzCG,IAAmBC,SAASC,iBAAiBP,GAAW,IAAIQ;AAEhE,SAASC;AACHL,EAAgBM,wBAAwBC,OAAON,KAC7CL,EAAUY,UAAUC,SAAS,0BAC/BV,EAAeW,QAAQV,EAAgBU;AAEzCd,EAAUY,UAAUG,OAAO,0BAEtBf,EAAUY,UAAUC,SAAS,0BAChCT,EAAgBU,QAAQX,EAAeW;AAEzCd,EAAUY,UAAUI,IAAI;AAE5B;AAEAC,OAAOC,iBAAiB,UAAUT,IAClCA;AACF,CAEAU,I","sources":["webpack://wp/./modules/search/client/index.js"],"sourcesContent":["\nfunction init() {\n let fixedForm = document.querySelector(\".search-form_fixed\");\n let fixedFormInput = fixedForm.querySelector(\".search-form__query .text-input__control\");\n let staticFormInput = document.querySelector(\".search-form:not(.search-form_fixed) .search-form__query .text-input__control\");\n let fixedInputOffset = parseInt(getComputedStyle(fixedForm, \"\").paddingTop);\n\n function updateFixedForm() {\n if (staticFormInput.getBoundingClientRect().top <= fixedInputOffset) {\n if (fixedForm.classList.contains(\"search-form_hidden\")) {\n fixedFormInput.value = staticFormInput.value;\n }\n fixedForm.classList.remove(\"search-form_hidden\");\n } else {\n if (!fixedForm.classList.contains(\"search-form_hidden\")) {\n staticFormInput.value = fixedFormInput.value;\n }\n fixedForm.classList.add(\"search-form_hidden\");\n }\n }\n\n window.addEventListener(\"scroll\", updateFixedForm);\n updateFixedForm(); // set initial state\n}\n\ninit();\n"],"names":["fixedForm","document","querySelector","fixedFormInput","staticFormInput","fixedInputOffset","parseInt","getComputedStyle","paddingTop","updateFixedForm","getBoundingClientRect","top","classList","contains","value","remove","add","window","addEventListener","init"],"sourceRoot":""}