{ "version": 3, "sources": ["../src/js/lightbox-slider.js"], "sourcesContent": ["document.addEventListener('DOMContentLoaded', function () {\n\tconst popup = document.querySelector('.popup')\n\tconst sliderEl = popup.querySelector('.keen-slider')\n\tconst prevBtn = popup.querySelector('.prev')\n\tconst nextBtn = popup.querySelector('.next')\n\tconst dots = popup.querySelectorAll('button.dot')\n\tconst closeBtn = popup.querySelector('.close-popup')\n\n\tcloseBtn.addEventListener('click', () => {\n\t\tpopup.hidePopover()\n\t})\n\n\tsliderInstance = new KeenSlider(\n\t\tsliderEl,\n\t\t{\n\t\t\tloop: true,\n\t\t\tslides: {\n\t\t\t\tperView: 1,\n\t\t\t},\n\t\t},\n\t\t[\n\t\t\t(slider) => {\n\t\t\t\tfunction updateClasses() {\n\t\t\t\t\tlet slide = slider.track.details.rel\n\t\t\t\t\tdots.forEach((dot) => {\n\t\t\t\t\t\tdot.classList.remove('active')\n\t\t\t\t\t})\n\t\t\t\t\tdots[slide].classList.add('active')\n\t\t\t\t}\n\n\t\t\t\tprevBtn.addEventListener('click', () => slider.prev())\n\t\t\t\tnextBtn.addEventListener('click', () => slider.next())\n\n\t\t\t\tdots.forEach((dot) => {\n\t\t\t\t\tdot.addEventListener('click', () => {\n\t\t\t\t\t\tlet targetIndex = parseInt(dot.dataset.index)\n\t\t\t\t\t\tslider.moveToIdx(targetIndex)\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tslider.on('slideChanged', () => {\n\t\t\t\t\tupdateClasses()\n\t\t\t\t})\n\t\t\t},\n\t\t]\n\t)\n\n\tfunction updateSlider(index) {\n\t\tsliderInstance.moveToIdx(index)\n\t\tdots.forEach((dot, idx) => {\n\t\t\tif (idx === index) {\n\t\t\t\tdot.classList.add('active')\n\t\t\t} else {\n\t\t\t\tdot.classList.remove('active')\n\t\t\t}\n\t\t})\n\t}\n\n\tdocument.querySelectorAll('.grid .img-wrapper').forEach((imgWrapper) => {\n\t\timgWrapper.addEventListener('click', function () {\n\t\t\tpopup.showPopover()\n\t\t\tsliderInstance.update()\n\t\t\tupdateSlider(parseInt(imgWrapper.id))\n\t\t})\n\t})\n})\n"], "mappings": "MAAA,SAAS,iBAAiB,mBAAoB,UAAY,CACzD,GAAM,GAAQ,SAAS,cAAc,UAC/B,EAAW,EAAM,cAAc,gBAC/B,EAAU,EAAM,cAAc,SAC9B,EAAU,EAAM,cAAc,SAC9B,EAAO,EAAM,iBAAiB,cAGpC,AAFiB,EAAM,cAAc,gBAE5B,iBAAiB,QAAS,IAAM,CACxC,EAAM,gBAGP,eAAiB,GAAI,YACpB,EACA,CACC,KAAM,GACN,OAAQ,CACP,QAAS,IAGX,CACC,AAAC,GAAW,CACX,YAAyB,CACxB,GAAI,GAAQ,EAAO,MAAM,QAAQ,IACjC,EAAK,QAAQ,AAAC,GAAQ,CACrB,EAAI,UAAU,OAAO,YAEtB,EAAK,GAAO,UAAU,IAAI,UAG3B,EAAQ,iBAAiB,QAAS,IAAM,EAAO,QAC/C,EAAQ,iBAAiB,QAAS,IAAM,EAAO,QAE/C,EAAK,QAAQ,AAAC,GAAQ,CACrB,EAAI,iBAAiB,QAAS,IAAM,CACnC,GAAI,GAAc,SAAS,EAAI,QAAQ,OACvC,EAAO,UAAU,OAInB,EAAO,GAAG,eAAgB,IAAM,CAC/B,SAMJ,WAAsB,EAAO,CAC5B,eAAe,UAAU,GACzB,EAAK,QAAQ,CAAC,EAAK,IAAQ,CAC1B,AAAI,IAAQ,EACX,EAAI,UAAU,IAAI,UAElB,EAAI,UAAU,OAAO,YAKxB,SAAS,iBAAiB,sBAAsB,QAAQ,AAAC,GAAe,CACvE,EAAW,iBAAiB,QAAS,UAAY,CAChD,EAAM,cACN,eAAe,SACf,EAAa,SAAS,EAAW", "names": [] }