text: define(["jquery","underscore","home/wheelEvent","home/jquery-ui"],function(e,t,n){var r=[],i=0,s=!1,o={init:function(){r[0].setHeight(r[0].getHeight()+e("#headerDiv").height()),r[0].play(),n(document,function(e){o.handleScroll(e)});var i=t.throttle(o.adjustLayout,100);e(window).resize(i)},setCurrIndex:function(e){i=e,r[i].setPosition("product","end")},push:function(e){r.push(e)},run:function(){var e=0,t=r[e];t.load();var n=setInterval(function(){if(e==r.length-1){clearInterval(n);return}t.isReady()&&(e==0&&o.init(),e++,t=r[e],t.load())},150)},handleScroll:function(t){if(s){t.preventDefault();return}var n=t.deltaY;if(n>0&&i<r.length){t.preventDefault(),s=!0;var u=0,a=0;for(;a<=i;a++)u+=r[a].getHeight();e("html, body").animate({scrollTop:u},600,"easeInQuint",function(){if(!s)return;o.resetView(),i++,o.setViewer(),s=!1}),o.startAnimate(n)}if(n<0&&i>0){t.preventDefault(),s=!0;var u=0,a=0;for(;a<i-1;a++)u+=r[a].getHeight();e("html, body").animate({scrollTop:u},600,"easeInQuint",function(){if(!s)return;o.resetView(),i--,o.setViewer(),s=!1}),o.startAnimate(n)}},startAnimate:function(e){var t=r[e>0?i+1:i-1];t&&t.setPosition&&t.setPosition("product","end")},resetView:function(){var e=r[i];e&&e.setPosition&&e.setPosition("product","start")},adjustLayout:function(){e.each(r,function(e,t){if(!t.setPosition)return;e==i?(t.setPosition("text","end"),t.setPosition("product","end")):(t.setPosition("text","start"),t.setPosition("product","start"))})},setViewer:function(){var t=e("#viewer"),n=i==-1?0:i==r.length?i-1:i;t.find("li").removeClass("active"),t.find("li:eq("+n+")").addClass("active")}};return o});