{"version":3,"file":"Src_Scripts_components_product-info_js.83b9dbaf6b8de8c7937f.js","sources":["webpack://haveselskabet/./Src/Scripts/components/product-info.js"],"sourcesContent":["export default class ProductInfo {\n constructor(elm, args) {\n const infoHeadlines = [...elm.querySelectorAll('.product__info-headline')];\n\n const showInfoText = (element) => {\n const selectedInfoHeadline = elm.querySelector('.product__info-headline--selected');\n selectedInfoHeadline.classList.remove('product__info-headline--selected');\n element.target.classList.add('product__info-headline--selected');\n\n const selectedInfoText = elm.querySelector('.product__info-text--selected');\n selectedInfoText.classList.remove('product__info-text--selected');\n\n let newSelectedInfoText;\n if (element.target.classList.contains('product__info-headline--product-info')) {\n newSelectedInfoText = elm.querySelector('.product__info-text--product-info');\n } else if (element.target.classList.contains('product__info-headline--size-guide')) {\n newSelectedInfoText = elm.querySelector('.product__info-text--size-guide');\n } else {\n newSelectedInfoText = elm.querySelector('.product__info-text--recommended');\n }\n newSelectedInfoText.classList.add('product__info-text--selected');\n }\n\n infoHeadlines.forEach(headline => {\n headline.addEventListener('click', (e) => { showInfoText(e) });\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;;A;;A","sourceRoot":""}