{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/modules/two-tabs-masthead-extension.js"],"names":["Module","Component","e","$tab","$panel","tab","panel"],"mappings":"4JAEA,MAAMA,UAAeC,WAAU,CAC7B,eAAgB,CACd,KAAK,IAAM,CACT,QAAS,KAAK,GAAG,IAAI,qCAAqC,EAC1D,MAAO,KAAK,GAAG,IAAI,mCAAmC,CACxD,CACF,CAEA,cAAe,CACb,KAAK,IAAI,MAAM,IAAI,QAAS,KAAK,eAAe,KAAK,IAAI,CAAC,CAC5D,CAEA,eAAeC,EAAG,CAChB,MAAMC,EAAOD,EAAE,cACTE,EAAS,SAAS,eAAeD,EAAK,aAAa,eAAe,CAAC,EAErEA,EAAK,aAAa,eAAe,IAAM,QACzCA,EAAK,aAAa,gBAAiB,OAAO,EAC1CC,EAAO,aAAa,cAAe,MAAM,IAEzC,KAAK,IAAI,MAAM,QAAQC,GAAOA,EAAI,aAAa,gBAAiB,OAAO,CAAC,EACxEF,EAAK,aAAa,gBAAiB,MAAM,EAEzC,KAAK,IAAI,QAAQ,QAAQG,GAASA,EAAM,aAAa,cAAe,MAAM,CAAC,EAC3EF,EAAO,gBAAgB,aAAa,EAExC,CACF,CAEA,UAAeJ,C","file":"Areas/SunriseSeniorLiving/Scripts/6229.330de9267004d2ff5c7a.bundle.js","sourcesContent":["import { Component } from '@verndale/core';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n $panels: this.el._$$('.two-tabs-masthead-extension__panel'),\n $tabs: this.el._$$('.two-tabs-masthead-extension__tab')\n };\n }\n\n addListeners() {\n this.dom.$tabs._on('click', this.handleTabClick.bind(this));\n }\n\n handleTabClick(e) {\n const $tab = e.currentTarget;\n const $panel = document.getElementById($tab.getAttribute('aria-controls'));\n\n if ($tab.getAttribute('aria-selected') === 'true') {\n $tab.setAttribute('aria-selected', 'false');\n $panel.setAttribute('aria-hidden', 'true');\n } else {\n this.dom.$tabs.forEach(tab => tab.setAttribute('aria-selected', 'false'));\n $tab.setAttribute('aria-selected', 'true');\n\n this.dom.$panels.forEach(panel => panel.setAttribute('aria-hidden', 'true'));\n $panel.removeAttribute('aria-hidden');\n }\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}