{"version":3,"sources":["webpack:///./js/components/init-awards-carousel.ts"],"names":["whenDomReady","then","elements","Array","from","document","querySelectorAll","forEach","element","controls","querySelector","track","progress","items","slider","tns","autoplay","autoplayButtonOutput","autoplayHoverPause","center","container","controlsContainer","edgePadding","gutter","loop","nav","slideBy","speed","touch","responsive","768","1024","sliderInfo","getInfo","progressWidth","length","setAttribute","events","on","event","index","slideCount"],"mappings":"2FAAA,4BA+CAA,cAAeC,MA7Cf,WACI,IAAMC,EAAWC,MAAMC,KAAKC,SAASC,iBAAiB,wBACjDJ,GAGLA,EAASK,SAAQ,SAAAC,GACb,IAAMC,EAAWD,EAAQE,cAAc,gCACjCC,EAAQH,EAAQE,cAAc,6BAC9BE,EAAWJ,EAAQE,cAAc,oBACjCG,EAAQL,EAAQF,iBAAiB,kBACjCQ,EAASC,YAAI,CACfC,UAAU,EACVC,sBAAsB,EACtBC,oBAAoB,EACpBC,QAAQ,EACRC,UAAWT,EACXU,kBAAmBZ,EACnBa,YAAa,GACbC,OAAQ,GACRV,MAAO,EACPW,MAAM,EACNC,KAAK,EACLC,QAAS,EACTC,MAAO,KACPC,OAAO,EACPC,WAAY,CACRC,IAAK,CACDjB,MAAO,EACPa,QAAS,GAEbK,KAAM,CACFlB,MAAO,EACPa,QAAS,MAIfM,EAAalB,EAAOmB,UACtBC,EAAiBF,EAAWN,QAAUb,EAAMsB,OAAU,IAC1DvB,WAAUwB,aAAa,QAAvB,4BAAqDF,EAArD,MACApB,EAAOuB,OAAOC,GAAG,gBAAgB,SAAAC,GAC7BL,GAAkBK,EAAMC,MAAQR,EAAWN,SAAWa,EAAME,WAAc,IAC1E7B,WAAUwB,aAAa,QAAvB,4BAAqDF,EAArD","file":"26-196452022be52c006609.js","sourcesContent":["import { tns } from 'tiny-slider/src/tiny-slider';\r\nimport whenDomReady from 'when-dom-ready';\r\nfunction initialise() {\r\n const elements = Array.from(document.querySelectorAll('.js-awards-carousel'));\r\n if (!elements) {\r\n return;\r\n }\r\n elements.forEach(element => {\r\n const controls = element.querySelector('.js-awards-carousel-controls');\r\n const track = element.querySelector('.js-awards-carousel-track');\r\n const progress = element.querySelector('.js-progress-bar');\r\n const items = element.querySelectorAll('.js-award-item');\r\n const slider = tns({\r\n autoplay: false,\r\n autoplayButtonOutput: false,\r\n autoplayHoverPause: true,\r\n center: false,\r\n container: track,\r\n controlsContainer: controls,\r\n edgePadding: 15,\r\n gutter: 30,\r\n items: 1,\r\n loop: false,\r\n nav: false,\r\n slideBy: 1,\r\n speed: 1500,\r\n touch: true,\r\n responsive: {\r\n 768: {\r\n items: 2,\r\n slideBy: 2,\r\n },\r\n 1024: {\r\n items: 3,\r\n slideBy: 3,\r\n },\r\n },\r\n });\r\n const sliderInfo = slider.getInfo();\r\n let progressWidth = (sliderInfo.slideBy / items.length) * 100;\r\n progress?.setAttribute('style', `--progress-width: ${progressWidth}%`);\r\n slider.events.on('indexChanged', event => {\r\n progressWidth = ((event.index + sliderInfo.slideBy) / event.slideCount) * 100;\r\n progress?.setAttribute('style', `--progress-width: ${progressWidth}%`);\r\n });\r\n });\r\n}\r\nwhenDomReady().then(initialise);\r\n"],"sourceRoot":""}