blob: 6a62054f8b99debdffcea892f30e167f7f607c86 [file] [log] [blame]
{
"version": 3,
"sources": ["header.ts"],
"sourcesContent": ["function registerHeaderListeners() {\n const header = document.querySelector('.js-header');\n const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n menuButtons.forEach(button => {\n button.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.toggle('is-active');\n button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n });\n });\n\n const scrim = document.querySelector('.js-scrim');\n scrim?.addEventListener('click', e => {\n e.preventDefault();\n header?.classList.remove('is-active');\n menuButtons.forEach(button => {\n button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n });\n });\n}\n\nfunction registerSearchFormListeners() {\n const searchForm = document.querySelector('.js-searchForm');\n const expandSearch = document.querySelector('.js-expandSearch');\n const input = searchForm?.querySelector('input');\n const headerLogo = document.querySelector('.js-headerLogo');\n const menuButton = document.querySelector('.js-headerMenuButton');\n expandSearch?.addEventListener('click', () => {\n searchForm?.classList.add('go-SearchForm--expanded');\n headerLogo?.classList.add('go-Header-logo--hidden');\n menuButton?.classList.add('go-Header-navOpen--hidden');\n input?.focus();\n });\n document?.addEventListener('click', e => {\n if (!searchForm?.contains(e.target as Node)) {\n searchForm?.classList.remove('go-SearchForm--expanded');\n headerLogo?.classList.remove('go-Header-logo--hidden');\n menuButton?.classList.remove('go-Header-navOpen--hidden');\n }\n });\n}\n\nregisterHeaderListeners();\nregisterSearchFormListeners();\n"],
"mappings": "AAAA,kCAAmC,CACjC,KAAM,GAAS,SAAS,cAAc,cAChC,EAAc,SAAS,iBAAiB,wBAC9C,EAAY,QAAQ,GAAU,CAC5B,EAAO,iBAAiB,QAAS,GAAK,CACpC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAO,aAAa,gBAAiB,OAAO,GAAQ,UAAU,SAAS,mBAK3E,AADc,SAAS,cAAc,cAC9B,iBAAiB,QAAS,GAAK,CACpC,EAAE,iBACF,GAAQ,UAAU,OAAO,aACzB,EAAY,QAAQ,GAAU,CAC5B,EAAO,aAAa,gBAAiB,OAAO,GAAQ,UAAU,SAAS,mBAK7E,sCAAuC,CACrC,KAAM,GAAa,SAAS,cAAc,kBACpC,EAAe,SAAS,cAAc,oBACtC,EAAQ,GAAY,cAAc,SAClC,EAAa,SAAS,cAAc,kBACpC,EAAa,SAAS,cAAc,wBAC1C,GAAc,iBAAiB,QAAS,IAAM,CAC5C,GAAY,UAAU,IAAI,2BAC1B,GAAY,UAAU,IAAI,0BAC1B,GAAY,UAAU,IAAI,6BAC1B,GAAO,UAET,UAAU,iBAAiB,QAAS,GAAK,CACvC,AAAK,GAAY,SAAS,EAAE,SAC1B,IAAY,UAAU,OAAO,2BAC7B,GAAY,UAAU,OAAO,0BAC7B,GAAY,UAAU,OAAO,gCAKnC,0BACA",
"names": []
}