{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/modules/banner.ts"],"names":["Banner","Component","el","color"],"mappings":"6KAEA,MAAMA,UAAeC,WAAU,CAC7B,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAER,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,SAAS,KAAK,UAAU,IAAI,aAAa,CAC3C,CAEA,eAAgB,CACd,KAAK,IAAM,CACT,YAAa,KAAK,GAAG,cAA2B,gBAAgB,CAClE,CACF,CAEA,eAAgB,CACd,MAAMC,EAAQ,KAAK,GAAG,QAAQ,OAAS,QACvC,KAAK,GAAG,MAAM,gBAAkBA,CAClC,CAEA,aAAc,CACR,KAAK,IAAI,uBAAuB,aAClC,KAAK,IAAI,YAAY,iBAAiB,QAAS,IAAM,CACnD,KAAK,GAAG,MAAM,QAAU,OACxB,SAAS,KAAK,UAAU,OAAO,aAAa,CAC9C,CAAC,CAEL,CACF,CAEA,QAAeH,C","file":"scripts/4253.7fbbf5e7ec4d5ec33755.js","sourcesContent":["import { Component } from '@verndale/core';\n\nclass Banner extends Component {\n constructor(el: HTMLElement) {\n super(el);\n\n this.setBackground();\n this.closeBanner();\n document.body.classList.add('with-banner');\n }\n\n setupDefaults() {\n this.dom = {\n closeButton: this.el.querySelector('.banner__close')\n };\n }\n\n setBackground() {\n const color = this.el.dataset.color || 'white';\n this.el.style.backgroundColor = color;\n }\n\n closeBanner() {\n if (this.dom.closeButton instanceof HTMLElement) {\n this.dom.closeButton.addEventListener('click', () => {\n this.el.style.display = 'none';\n document.body.classList.remove('with-banner');\n });\n }\n }\n}\n\nexport default Banner;\n"],"sourceRoot":""}