{ "version": 3, "sources": ["../src/js/portfolio-slider.js"], "sourcesContent": ["document.addEventListener('DOMContentLoaded', function () {\n\tvar section = document.querySelector('.properties')\n\tvar slider = section.querySelector('.properties-slider')\n\tvar duration = slider.querySelectorAll('.keen-slider__slide').length * 7000\n\n\tif (slider) {\n\t\tcreatePortfolioSlider(slider, { duration: duration, easing: identity })\n\t}\n})\n\nfunction identity(x) {\n\treturn x\n}\n\nfunction createPortfolioSlider(element, animationOptions) {\n\tconst stop = { duration: Number.MAX_SAFE_INTEGER, easing: identity }\n\tlet maxIdx = null\n\n\tnew KeenSlider(\n\t\telement,\n\t\t{\n\t\t\tvertical: true,\n\t\t\tloop: true,\n\t\t\trenderMode: 'performance',\n\t\t\tmode: 'free',\n\t\t\tslides: { perView: 'auto' },\n\t\t\tcreated(s) {\n\t\t\t\tmaxIdx = s.track.details.slides.length - 1\n\n\t\t\t\ts.moveToIdx(maxIdx, true, animationOptions)\n\n\t\t\t\t// Add hover event listeners to pause/resume\n\t\t\t\telement.addEventListener('mouseenter', () => {\n\t\t\t\t\ts.moveToIdx(maxIdx, true, stop)\n\t\t\t\t})\n\t\t\t\telement.addEventListener('mouseleave', () => {\n\t\t\t\t\ts.moveToIdx(s.track.details.abs + maxIdx, true, animationOptions)\n\t\t\t\t})\n\t\t\t},\n\t\t\tupdated(s) {\n\t\t\t\ts.moveToIdx(s.track.details.abs + maxIdx, true, animationOptions)\n\t\t\t},\n\t\t\tanimationEnded(s) {\n\t\t\t\ts.moveToIdx(s.track.details.abs + maxIdx, true, animationOptions)\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t'(max-width: 992px)': {\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tslides: { perView: 2.4 },\n\t\t\t\t},\n\t\t\t\t'(max-width: 500px)': {\n\t\t\t\t\tvertical: false,\n\t\t\t\t\tslides: { perView: 1.6 },\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t[WheelControls]\n\t)\n}\n\nfunction WheelControls(slider) {\n\tslider.on('created', () => {\n\t\tslider.container.addEventListener(\n\t\t\t'wheel',\n\t\t\tfunction (e) {\n\t\t\t\te.preventDefault()\n\n\t\t\t\tconst dy = Math.sign(e.deltaY)\n\t\t\t\t// slider.moveToIdx(Math.sign(e.deltaY), false, { duration: 80, easing: identity })\n\t\t\t\tif (dy > 0) {\n\t\t\t\t\tslider.next()\n\t\t\t\t} else if (dy < 0) {\n\t\t\t\t\tslider.prev()\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpassive: false,\n\t\t\t}\n\t\t)\n\t})\n}\n"], "mappings": "MAAA,SAAS,iBAAiB,mBAAoB,UAAY,CACzD,GAAI,GAAU,SAAS,cAAc,eACjC,EAAS,EAAQ,cAAc,sBAC/B,EAAW,EAAO,iBAAiB,uBAAuB,OAAS,IAEvE,AAAI,GACH,EAAsB,EAAQ,CAAE,SAAU,EAAU,OAAQ,MAI9D,WAAkB,EAAG,CACpB,MAAO,GAGR,WAA+B,EAAS,EAAkB,CACzD,GAAM,GAAO,CAAE,SAAU,OAAO,iBAAkB,OAAQ,GACtD,EAAS,KAEb,GAAI,YACH,EACA,CACC,SAAU,GACV,KAAM,GACN,WAAY,cACZ,KAAM,OACN,OAAQ,CAAE,QAAS,QACnB,QAAQ,EAAG,CACV,EAAS,EAAE,MAAM,QAAQ,OAAO,OAAS,EAEzC,EAAE,UAAU,EAAQ,GAAM,GAG1B,EAAQ,iBAAiB,aAAc,IAAM,CAC5C,EAAE,UAAU,EAAQ,GAAM,KAE3B,EAAQ,iBAAiB,aAAc,IAAM,CAC5C,EAAE,UAAU,EAAE,MAAM,QAAQ,IAAM,EAAQ,GAAM,MAGlD,QAAQ,EAAG,CACV,EAAE,UAAU,EAAE,MAAM,QAAQ,IAAM,EAAQ,GAAM,IAEjD,eAAe,EAAG,CACjB,EAAE,UAAU,EAAE,MAAM,QAAQ,IAAM,EAAQ,GAAM,IAEjD,YAAa,CACZ,qBAAsB,CACrB,SAAU,GACV,OA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