tribe.events=tribe.events||{},tribe.events.views=tribe.events.views||{},tribe.events.views.weekGridScroller={},function(e,r){"use strict";var t=e(document);r.selectors={weekGridEventsRowOuterWrapper:'[data-js="tribe-events-pro-week-grid-events-row-outer-wrapper"]',weekGridEventsRowWrapper:'[data-js="tribe-events-pro-week-grid-events-row-wrapper"]',weekGridEventsRowWrapperClass:".tribe-events-pro-week-grid__events-row-wrapper",weekGridEventsRowWrapperActiveClass:".tribe-events-pro-week-grid__events-row-wrapper--active",weekGridEventsPaneClass:".tribe-events-pro-week-grid__events-row-scroll-pane",weekGridEventsSliderClass:".tribe-events-pro-week-grid__events-row-scroll-slider",weekGridEvent:'[data-js="tribe-events-pro-week-grid-event"]'},r.getFirstEventPosition=function(t){var s=null,i=0,n=0;return t.find(r.selectors.weekGridEvent).each((function(r,t){var n=e(t),o=n.data("start-time");(!s||s&&o<i)&&(s=n,i=o)})),(n=s?s.position().top:n)-16>0?n-=16:n=0,n},r.deinitScroller=function(e){e.find(r.selectors.weekGridEventsRowOuterWrapper).nanoScroller({destroy:!0})},r.initScroller=function(e){var t=r.getFirstEventPosition(e);e.find(r.selectors.weekGridEventsRowOuterWrapper).nanoScroller({paneClass:r.selectors.weekGridEventsPaneClass.className(),sliderClass:r.selectors.weekGridEventsSliderClass.className(),contentClass:r.selectors.weekGridEventsRowWrapperClass.className(),iOSNativeScrolling:!0,alwaysVisible:!1,scrollTop:t}).find(r.selectors.weekGridEventsRowWrapper).addClass(r.selectors.weekGridEventsRowWrapperActiveClass.className())},r.deinit=function(e,t,s){var i=e.data.container;r.deinitScroller(i),i.off("beforeAjaxSuccess.tribeEvents",r.deinit)},r.init=function(e,t,s,i){"week"===i.slug&&(r.initScroller(s),s.on("beforeAjaxSuccess.tribeEvents",{container:s},r.deinit))},r.ready=function(){t.on("afterSetup.tribeEvents",tribe.events.views.manager.selectors.container,r.init)},e(r.ready)}(jQuery,tribe.events.views.weekGridScroller),window.tec=window.tec||{},window.tec.eventsPro=window.tec.eventsPro||{},window.tec.eventsPro.views=window.tec.eventsPro.views||{},window.tec.eventsPro.views.weekGridScroller={};