{"version":3,"file":"blocks/accordion.js","mappings":"AAcAA,SAASC,iBAAiB,wBAAwBC,SAAQ,SAACC,GACvDA,EAAKC,iBAAiB,SAAS,SAACC,GAC5B,IACMC,EADaD,EAAXE,OACeC,cACwB,SAA3CF,EAAQG,aAAa,kBAlBjC,SAAuBH,GACnB,IAAMI,EAAUJ,EAAQK,cAAc,YAChCC,EAAgBF,EAAQG,aAC9BH,EAAQI,MAAMC,UAAY,GAAHC,OAAMJ,EAAa,MAC1CN,EAAQW,aAAa,iBAAkB,QAC3C,CAcYC,CAAcZ,GAZ1B,SAAyBA,GACLA,EAAQK,cAAc,YAC9BG,MAAMC,UAAY,EAC1BT,EAAQK,cAAc,wBAAwBQ,QAC9Cb,EAAQW,aAAa,iBAAkB,OAC3C,CASYG,CAAgBd,EAExB,GACJ","sources":["webpack://thecloroxcompany/./js/src/blocks/accordion.js"],"sourcesContent":["function expandSection(element) {\n const section = element.querySelector('.content');\n const sectionHeight = section.scrollHeight;\n section.style.maxHeight = `${sectionHeight}px`;\n element.setAttribute('data-collapsed', 'false');\n}\n\nfunction collapseSection(element) {\n const section = element.querySelector('.content');\n section.style.maxHeight = 0;\n element.querySelector('.js-accordion-button').focus();\n element.setAttribute('data-collapsed', 'true');\n}\n\ndocument.querySelectorAll('.js-accordion-button').forEach((item) => {\n item.addEventListener('click', (event) => {\n const { target } = event;\n const element = target.parentElement;\n if (element.getAttribute('data-collapsed') === 'true') {\n expandSection(element);\n } else {\n collapseSection(element);\n }\n });\n});\n"],"names":["document","querySelectorAll","forEach","item","addEventListener","event","element","target","parentElement","getAttribute","section","querySelector","sectionHeight","scrollHeight","style","maxHeight","concat","setAttribute","expandSection","focus","collapseSection"],"sourceRoot":""}