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AAnB5B,GACJU,GACF,G","sources":["webpack://global-main/./Feature/Product/code/Views/Feature/Product/ProductListItem.js"],"sourcesContent":["import Splide from '@splidejs/splide';\n\nconst productlistings = document.querySelectorAll('.product-listing');\nlet isotopeItems = [];\nproductlistings.forEach((listing) => {\n isotopeItems = isotopeItems.concat(Array.from(listing.querySelectorAll('.isotope-item')));\n});\nconst productListItems = isotopeItems;\nlet splide = undefined;\n\nconst bindEvents = () => {\n const isDealerBuyersGuideListing = document.getElementById('buyersGuide') != null;\n productListItems.forEach((item) => {\n const colorSwatches = item.querySelector('.plp-color-swatches')?.firstElementChild;\n const titleSection = item.querySelector('.product-info-section');\n const slider = item.querySelector('.slider-wrapper');\n const slides = parseInt(item.querySelector('.product-list-item')?.dataset.images);\n const arrows = item.querySelector('.splide__arrows');\n\n if (colorSwatches && !isDealerBuyersGuideListing) {\n item.addEventListener('mouseenter', () => {\n colorSwatches?.classList.remove('d-lg-none');\n titleSection?.classList.add('d-lg-none');\n });\n item.addEventListener('mouseleave', () => {\n colorSwatches?.classList.add('d-lg-none');\n titleSection?.classList.remove('d-lg-none');\n });\n }\n\n if (arrows && slides > 1) {\n item.addEventListener('mouseenter', () => {\n arrows?.classList.remove('d-lg-none');\n });\n item.addEventListener('mouseleave', () => {\n arrows?.classList.add('d-lg-none');\n });\n }\n\n if (slider) {\n splide = new Splide(slider, {\n type: 'slide',\n start: 0,\n arrows: slides > 1,\n pagination: false,\n drag: slides > 1,\n clones: 0,\n });\n splide.mount();\n }\n });\n};\n\nconst init = () => {\n if (_THULEDATA.IsEditing) {\n return;\n }\n bindEvents();\n};\n\nwindow.addEventListener('changePLPLayout', function () {\n init();\n});\n\ndocument.addEventListener('DOMContentLoaded', function () {\n if (productlistings == null) return;\n init();\n});\n"],"names":["productlistings","document","querySelectorAll","isotopeItems","forEach","listing","concat","Array","from","productListItems","init","isDealerBuyersGuideListing","_THULEDATA","IsEditing","getElementById","item","_item$querySelector","_item$querySelector2","colorSwatches","querySelector","firstElementChild","titleSection","slider","slides","parseInt","dataset","images","arrows","addEventListener","classList","remove","add","Splide","type","start","pagination","drag","clones","mount","window"],"sourceRoot":""}