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AAKE,cGzEkB3D,SAASC,iBAChC,4BAGeC,SAASC,UACxB,MAAMC,SAAWD,QAAQE,cAAc,WACjCC,WAAaH,QAAQE,cAAc,sBACnCE,KAAOJ,QAAQE,cAAc,uBAC7BG,KAAOL,QAAQE,cAAc,uBAE/BD,UACF,IAAIK,OAAOL,SAAU,CACnBM,cAAe,IACfI,aAAc,EACdH,eAAe,EACfE,MAAO,IAEPD,eAAe,EACfgE,KAAM,CACJC,aAAa,EACbC,cAAc,EACdC,uBAAuB,EACvBgB,mBAAoB,GAEtBzE,YAAa,CACX,IAAK,CACHZ,cAAe,EACfI,aAAc,IAEhB,IAAK,CACHJ,cAAe,EACfI,aAAc,KAGlBR,WAAY,CACVa,GAAIb,WACJc,KAAM,UACNC,WAAW,GAEbN,WAAY,CACVC,OAAQT,KACRU,OAAQT,OAGd,IH+BA,QAAQgD,OI3EgB,IAAI/C,OAAO,0BAA2B,CAC1DC,cAAe,IACfsF,eAAgB,EAChBlF,aAAc,GACdF,eAAe,EACfC,MAAO,IACP+D,KAAM,CACFC,aAAa,EACbC,cAAc,EACdC,uBAAuB,EACvBgB,mBAAoB,GAExBzE,YAAa,CACT,IAAK,CACDZ,cAAe,GAEnB,IAAK,CACDA,cAAe,EACfI,aAAc,IAGtBR,WAAY,CACRa,GAAI,6CACJC,KAAM,UACNC,WAAW,IJsDrB,GAGF+D,OAAO3C,iBAAiB,oBAAoB,KAC1CiB,KAAKF,MAAK,G","sources":["webpack://build/../papelcomlacos/assets/javascripts/components/reviews.js","webpack://build/../papelcomlacos/assets/javascripts/pages/home.js","webpack://build/../papelcomlacos/assets/javascripts/pages/home/fullbanner.js","webpack://build/../papelcomlacos/assets/javascripts/components/conditionalLazy.js","webpack://build/../papelcomlacos/assets/javascripts/components/carousel.js","webpack://build/../papelcomlacos/assets/javascripts/pages/home/instagram.js"],"sourcesContent":["const Reviews = {\r\n setSwiperReviews: function () {\r\n const reviews = document.querySelectorAll('[data-reviews-carousel]');\r\n\r\n reviews.forEach(section => {\r\n const carousel = section.querySelector('.swiper');\r\n const pagination = section.querySelector('.swiper-pagination');\r\n const next = section.querySelector('.swiper-button-next');\r\n const prev = section.querySelector('.swiper-button-prev');\r\n\r\n new Swiper(carousel, {\r\n slidesPerView: 3,\r\n watchOverflow: true,\r\n preloadImages: false,\r\n speed: 1000,\r\n spaceBetween: 10,\r\n navigation: {\r\n nextEl: next,\r\n prevEl: prev,\r\n disabledClass: '-disabled'\r\n },\r\n pagination: {\r\n el: pagination,\r\n type: 'bullets',\r\n clickable: true,\r\n },\r\n breakpoints: {\r\n 0: {\r\n slidesPerView: 1.15,\r\n spaceBetween: 10,\r\n },\r\n 425: {\r\n slidesPerView: 1.35,\r\n },\r\n 768: {\r\n slidesPerView: 2,\r\n spaceBetween: 24,\r\n },\r\n 1024: {\r\n slidesPerView: 3,\r\n spaceBetween: 24,\r\n }\r\n }\r\n });\r\n });\r\n },\r\n\r\n handleModalReviews: function () {\r\n if (document.querySelector('[data-reviews-carousel]')) {\r\n document.querySelector('[data-btn-review]').addEventListener('click', openModal);\r\n\r\n document.querySelector('[data-close-review]').addEventListener('click', closeModal);\r\n // Função para abrir o modal\r\n function openModal() {\r\n document.getElementById('starContainer').innerHTML = '';\r\n\r\n for (let i = 1; i <= 5; i++) {\r\n const star = document.createElement('div');\r\n const svgIcon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n const useElement = document.createElementNS('http://www.w3.org/2000/svg', 'use');\r\n\r\n star.className = 'star';\r\n svgIcon.classList.add('icon');\r\n useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#icon-starmodal');\r\n\r\n svgIcon.appendChild(useElement);\r\n star.setAttribute('data-rating', i);\r\n star.appendChild(svgIcon);\r\n\r\n svgIcon.style.fill = 'transparent';\r\n document.getElementById('starContainer').appendChild(star);\r\n }\r\n\r\n const stars = document.querySelectorAll('.star');\r\n stars.forEach((star) => {\r\n star.addEventListener('click', () => {\r\n setRating(star);\r\n })\r\n })\r\n\r\n notSendName();\r\n\r\n document.getElementById(\"modal-review\").style.display = \"flex\";\r\n }\r\n }\r\n\r\n function closeModal() {\r\n document.getElementById(\"modal-review\").style.display = \"none\";\r\n }\r\n\r\n function setRating(star) {\r\n const selectedRating = star.dataset.rating;\r\n const stars = document.querySelectorAll('.star');\r\n stars.forEach(star => {\r\n const rating = star.getAttribute('data-rating');\r\n const svgIcon = star.querySelector('.icon use');\r\n\r\n if (rating <= selectedRating) {\r\n svgIcon.style.fill = '#f8a92d';\r\n } else {\r\n svgIcon.style.fill = '';\r\n }\r\n });\r\n\r\n // Atualiza o valor do input hidden com a avaliação selecionada\r\n document.getElementById('ratingInput').value = selectedRating;\r\n }\r\n function notSendName() {\r\n const checkboxNotName = document.getElementById('not-name');\r\n const inputName = document.getElementById('name');\r\n\r\n checkboxNotName.addEventListener('change', function () {\r\n if (checkboxNotName.checked) {\r\n inputName.setAttribute('disabled', 'disabled');\r\n inputName.value = '';\r\n inputName.removeAttribute('required');\r\n inputName.classList.add('disabled');\r\n\r\n } else {\r\n inputName.removeAttribute('disabled');\r\n inputName.setAttribute('required', 'required');\r\n inputName.classList.remove('disabled');\r\n }\r\n });\r\n }\r\n },\r\n init: function () {\r\n const _this = this;\r\n _this.setSwiperReviews();\r\n _this.handleModalReviews();\r\n }\r\n}\r\n\r\nexport default Reviews;\r\n","import setFullbanner from './home/fullbanner';\r\nimport setCarousel from '../components/carousel';\r\nimport setInstagram from './home/instagram';\r\nimport Reviews from '../components/reviews';\r\nimport handleConditionalLazy from '../components/conditionalLazy';\r\n\r\nconst Home = {\r\n swipersHome: function () {\r\n try {\r\n //Quando a página carrega seleciona o primeiro swiper da lista\r\n loadProductSwiper(1);\r\n\r\n //Adiciona evento Click nos links\r\n $('.swiper-master .links a').on('click', function (e) {\r\n e.preventDefault();\r\n $('.swiper-master .links a').removeClass('-active');\r\n $(this).addClass('-active');\r\n var tag = $(this).attr('href');\r\n $('.swiper-home-produtos').removeClass('active');\r\n $('[data-link=\"' + tag + '\"]').addClass('active');\r\n var val = $(this).attr('value');\r\n\r\n //Instancia o swiper de acordo com o index selecionado\r\n loadProductSwiper(val);\r\n });\r\n\r\n //Instancia dinamicamente o swiper selecionado\r\n function loadProductSwiper(index) {\r\n var swiperHomeProdutos = new Swiper(`.swiper-home-produtos-${index}`, {\r\n direction: 'horizontal',\r\n slidesPerView: 1.25,\r\n spaceBetween: 10,\r\n watchOverflow: true,\r\n loop: false,\r\n navigation: {\r\n nextEl: '.home-produtos .swiper-button-next',\r\n prevEl: '.home-produtos .swiper-button-prev',\r\n },\r\n pagination: {\r\n el: '.home-produtos .swiper-pagination',\r\n type: 'bullets',\r\n clickable: true,\r\n },\r\n breakpoints: {\r\n 0: {\r\n centeredSlides: false,\r\n },\r\n '@0.75': {\r\n slidesPerView: 1.25, \r\n },\r\n '@1.00': {\r\n slidesPerView: 2,\r\n },\r\n '@1.20': {\r\n slidesPerView: 4,\r\n centeredSlides: false\r\n },\r\n '@1.50': {\r\n slidesPerView: 4,\r\n },\r\n },\r\n }\r\n );\r\n }\r\n } catch (error) {\r\n /*LOG DEV */\r\n //console.log(`${error}`);\r\n /*LOG PROD */\r\n //console.log(`ação inesperada em store home:swipersHome`);\r\n }\r\n },\r\n init: function () {\r\n setFullbanner();\r\n handleConditionalLazy();\r\n this.swipersHome();\r\n setCarousel();\r\n Reviews.init();\r\n setInstagram();\r\n//calls\r\n },\r\n};\r\n\r\nwindow.addEventListener('DOMContentLoaded', () => {\r\n Home.init()\r\n})\r\n","export default function setFullbanner() {\r\n const bannerRotative = document.querySelectorAll('[data-fullbanner]');\r\n\r\n bannerRotative.forEach((section) => {\r\n const carousel = section.querySelector('.swiper');\r\n const pagination = section.querySelector('.swiper-pagination');\r\n const next = section.querySelector('.swiper-button-next');\r\n const prev = section.querySelector('.swiper-button-prev');\r\n\r\n const Fullbanner = new Swiper(carousel, {\r\n slidesPerView: 1,\r\n spaceBetween: 0,\r\n watchOverflow: true,\r\n autoHeight: true,\r\n preloadImages: false,\r\n lazy: {\r\n checkInView: true,\r\n loadPrevNext: false,\r\n loadOnTransitionStart: true,\r\n },\r\n pagination: {\r\n el: pagination,\r\n type: 'bullets',\r\n clickable: true,\r\n },\r\n loop: true,\r\n autoplay: {\r\n delay: 8000,\r\n },\r\n });\r\n\r\n Fullbanner.autoplay.stop();\r\n const setAutoPlay = () => {\r\n window.removeEventListener('scroll', setAutoPlay);\r\n window.removeEventListener('mousemove', setAutoPlay);\r\n Fullbanner.autoplay.start();\r\n }\r\n window.addEventListener('scroll', setAutoPlay);\r\n window.addEventListener('mousemove', setAutoPlay);\r\n });\r\n}\r\n\r\n","// ===============================================================\r\n// CONDITIONAL LAZY\r\n// ===============================================================\r\nexport default function handleConditionalLazy() {\r\n const eventType = window.innerWidth <= 1024 ? 'scroll' : 'mousemove';\r\n window.addEventListener(\r\n eventType,\r\n () => {\r\n const conditionalLazyElements = document.querySelectorAll('[data-conditional-lazy]');\r\n conditionalLazyElements.length > 0 &&\r\n conditionalLazyElements.forEach((element) => {\r\n element.classList.add('lazy');\r\n element.setAttribute('loading', 'lazy');\r\n window.lazyLoad && window.lazyLoad.init();\r\n });\r\n },\r\n { once: true }\r\n );\r\n}\r\n","export default function setCarousel() {\r\n const productsCarousel = document.querySelectorAll(\r\n '[data-products-carousel]'\r\n );\r\n\r\n productsCarousel.forEach((section) => {\r\n const carousel = section.querySelector('.swiper');\r\n const pagination = section.querySelector('.swiper-pagination');\r\n const next = section.querySelector('.swiper-button-next');\r\n const prev = section.querySelector('.swiper-button-prev');\r\n\r\n if (carousel) {\r\n new Swiper(carousel, {\r\n slidesPerView: 1.2,\r\n spaceBetween: 6,\r\n watchOverflow: true,\r\n speed: 1000,\r\n //lazy load\r\n preloadImages: false,\r\n lazy: {\r\n checkInView: true,\r\n loadPrevNext: true,\r\n loadOnTransitionStart: true,\r\n loadPrevNextAmount: 1,\r\n },\r\n breakpoints: {\r\n 768: {\r\n slidesPerView: 3,\r\n spaceBetween: 20,\r\n },\r\n 992: {\r\n slidesPerView: 4,\r\n spaceBetween: 20,\r\n },\r\n },\r\n pagination: {\r\n el: pagination,\r\n type: 'bullets',\r\n clickable: true,\r\n },\r\n navigation: {\r\n nextEl: next,\r\n prevEl: prev,\r\n },\r\n });\r\n }\r\n });\r\n}\r\n","export default function setInstagram() {\r\n const instagramSwiper = new Swiper('[data-instagram-swiper]', {\r\n slidesPerView: 2.3,\r\n slidesPerGroup: 1,\r\n spaceBetween: 10,\r\n preloadImages: false,\r\n speed: 1000,\r\n lazy: {\r\n checkInView: true,\r\n loadPrevNext: true,\r\n loadOnTransitionStart: true,\r\n loadPrevNextAmount: 4,\r\n },\r\n breakpoints: {\r\n 768: {\r\n slidesPerView: 4,\r\n },\r\n 992: {\r\n slidesPerView: 6,\r\n spaceBetween: 0,\r\n },\r\n },\r\n pagination: {\r\n el: '[data-instagram-swiper] .swiper-pagination',\r\n type: 'bullets',\r\n clickable: true,\r\n },\r\n });\r\n}\r\n"],"names":["setSwiperReviews","document","querySelectorAll","forEach","section","carousel","querySelector","pagination","next","prev","Swiper","slidesPerView","watchOverflow","preloadImages","speed","spaceBetween","navigation","nextEl","prevEl","disabledClass","el","type","clickable","breakpoints","handleModalReviews","openModal","getElementById","innerHTML","i","star","createElement","svgIcon","createElementNS","useElement","className","classList","add","setAttributeNS","appendChild","setAttribute","style","fill","addEventListener","selectedRating","dataset","rating","stars","getAttribute","value","setRating","checkboxNotName","inputName","checked","removeAttribute","remove","notSendName","display","init","this","Home","swipersHome","loadProductSwiper","index","direction","loop","centeredSlides","$","on","e","preventDefault","removeClass","addClass","tag","attr","error","Fullbanner","autoHeight","lazy","checkInView","loadPrevNext","loadOnTransitionStart","autoplay","delay","stop","setAutoPlay","window","removeEventListener","start","eventType","innerWidth","conditionalLazyElements","length","element","lazyLoad","once","handleConditionalLazy","loadPrevNextAmount","slidesPerGroup"],"sourceRoot":""}